{"version":3,"sources":["components/shared/layout/useScreenSize.ts","integrations/crossborderit/agreements/interfaces.ts","integrations/crossborderit/apiKeys/interfaces.ts","integrations/crossborderit/agreements/api.ts","integrations/crossborderit/appMetaData/interfaces.ts","integrations/crossborderit/apiKeys/useApiKeys.ts","integrations/crossborderit/appMetaData/api.ts","integrations/crossborderit/brokerage/interfaces.ts","integrations/crossborderit/calculation/api.ts","integrations/crossborderit/calculation/interfaces.ts","integrations/crossborderit/classificationExternalJobs/interfaces.ts","integrations/crossborderit/classificationExternalJobs/api.ts","integrations/crossborderit/cms/interfaces.ts","integrations/crossborderit/cms/api.ts","integrations/crossborderit/cms/useCms.ts","integrations/crossborderit/companies/interfaces.ts","integrations/crossborderit/companies/companyTransformer.ts","integrations/crossborderit/companiesNotes/interfaces.ts","integrations/crossborderit/companies/api.ts","integrations/crossborderit/companies/useCompany.ts","integrations/crossborderit/companies/useCompanies.ts","integrations/crossborderit/companiesNotes/api.ts","integrations/crossborderit/companiesNotes/useNoteMention.ts","integrations/crossborderit/countries/interfaces.ts","integrations/crossborderit/constants/api.ts","integrations/crossborderit/countries/api.ts","integrations/crossborderit/customers/interfaces.ts","integrations/crossborderit/countries/useCountries.tsx","integrations/crossborderit/customers/useCustomers.ts","integrations/crossborderit/payments/useBraintree.ts","integrations/crossborderit/employees/api.ts","integrations/crossborderit/industryNews/useIndustryNews.ts","integrations/crossborderit/invitations/api.ts","integrations/crossborderit/payments/api.ts","integrations/crossborderit/productExports/interfaces.ts","integrations/crossborderit/productExports/api.ts","integrations/crossborderit/users/interfaces.ts","integrations/crossborderit/productImports/api.ts","integrations/crossborderit/users/api.ts","integrations/crossborderit/companyProducts/interfaces.ts","integrations/crossborderit/companyProducts/productTransformer.ts","integrations/crossborderit/iossOrderInformation/interfaces.ts","integrations/crossborderit/pageOptions/api.ts","integrations/crossborderit/pageOptions/usePageOptions.ts","integrations/crossborderit/advancedFees/interfaces.ts","integrations/crossborderit/advancedFees/api.ts","integrations/crossborderit/webShopIntegrations/api.ts","integrations/crossborderit/iossReimport/interfaces.ts","integrations/crossborderit/iossReimport/api.ts","integrations/crossborderit/iossInvoiceJobs/api.ts","integrations/crossborderit/iossInvoiceJobs/interfaces.ts","integrations/crossborderit/iossVatReturns/api.ts","integrations/crossborderit/iossVatReturns/interfaces.ts","integrations/crossborderit/analytics/interfaces.ts","integrations/crossborderit/analytics/api.ts","integrations/crossborderit/dynamics/interface.ts","integrations/crossborderit/crmActions/interfaces.ts","integrations/crossborderit/analytics/useAnalytics.ts","integrations/crossborderit/billings/useBillings.ts","integrations/crossborderit/dynamics/api.ts","integrations/crossborderit/crmActions/api.ts","integrations/crossborderit/crmCompanies/interfaces.ts","integrations/crossborderit/crmActions/useCrmActions.ts","integrations/crossborderit/crmContacts/api.ts","integrations/crossborderit/crmCompanies/api.ts","integrations/crossborderit/crmCompanies/useCrmCompanies.ts","integrations/crossborderit/documents/interface.ts","integrations/crossborderit/companyAccountManagers/api.ts","integrations/crossborderit/documents/api.ts","integrations/crossborderit/webShopPlugins/api.ts","integrations/crossborderit/subscriptions/interfaces.ts","integrations/crossborderit/cbitBlog/useCbitBlog.ts","integrations/crossborderit/cbitBlog/api.ts","integrations/crossborderit/companyPaymentSolutions/api.ts","integrations/crossborderit/subscriptions/api.ts","integrations/crossborderit/payouts/interfaces.ts","integrations/crossborderit/verification/api.ts","integrations/crossborderit/payouts/api.ts","integrations/crossborderit/userMessage/interfaces.ts","components/logo/Logo.tsx","components/header/Breadcrumb.tsx","components/header/UserMenu.tsx","components/header/Header.tsx","components/notifications/Notifications.tsx","integrations/crossborderit/userMessage/api.ts","components/header/Help.tsx","integrations/crossborderit/authorization/interfaces.ts","integrations/crossborderit/authorization/constants.js","integrations/crossborderit/authorization/service.js","integrations/crossborderit/userPreferences/useUserPreferences.ts","integrations/crossborderit/userPreferences/api.ts","config.js","components/apiAuthorization/useAuthenticationStatus.ts","styles/theme.ts","styles/CbitDefaultTheme.ts","styles/customIcons.tsx","styles/plusisus_logo.png","store/interfaces.ts","components/shared/switch/Case.tsx","components/shared/switch/Switch.tsx","integrations/crossborderit/contacts/api.ts","integrations/crossborderit/collectionInvoices/api.ts","integrations/crossborderit/collectionInvoices/interface.ts","integrations/crossborderit/collectionInvoices/useStatements.ts","integrations/crossborderit/collectionInvoices/useCollectionInvoices.ts","integrations/crossborderit/onboardings/interfaces.ts","integrations/crossborderit/onboardings/api.ts","integrations/crossborderit/fetch.ts","components/shared/result/ErrorResult.tsx","components/shared/result/CompactResult.tsx","components/shared/input/ContactPerson.tsx","components/shared/input/InternationalPhoneNumber.tsx","components/shared/input/AmlKybContactPerson.tsx","components/verification/VerifyPhoneNumberModal.tsx","components/shared/input/Country.tsx","components/shared/input/AddressInput.tsx","components/shared/input/CompanyCategorySelect.tsx","components/shared/input/CountrySelect.tsx","components/shared/input/Currency.tsx","components/shared/input/Input.tsx","components/shared/status/Status.tsx","components/shared/result/SuccessResult.tsx","components/shared/layout/LayoutContent.tsx","components/shared/display/Address.tsx","components/shared/display/Country.tsx","components/shared/display/Currency.tsx","components/shared/display/Date.tsx","components/shared/display/TimeAgo.tsx","integrations/crossborderit/digitalCustoms/api.ts","utility/isObjKeysEmpty.ts","utility/hasAnyCompanyCategory.ts","utility/hasActiveSubscription.ts","utility/string.ts","utility/fromUtcToLocalTime.ts","utility/validateIossNumber.ts","components/shared/guide/Guide.tsx","utility/replaceBy.ts","store/selectors/selectors.ts","components/shared/layout/LayoutLoading.tsx","components/shared/sidebar/useSidebar.ts","components/shared/sidebar/Sidebar.tsx","components/shared/sidebar/SidebarSecondary.tsx","components/shared/button/Button.tsx","components/shared/hoc/withConditionalRendering.tsx","utility/removeBy.ts","utility/removeById.ts","integrations/crossborderit/companyProducts/api.ts","utility/navigate.ts","components/workspace/useWoony.ts","components/shared/layout/Layout.tsx","components/shared/layout/LayoutHeader.tsx","components/shared/layout/LayoutSidebar.tsx","components/apiAuthorization/useAuthorizationStatus.ts","components/apiAuthorization/isAuthorized.ts","components/apiAuthorization/AuthorizeRoute.tsx","integrations/crossborderit/iossOrderInformation/api.ts","integrations/crossborderit/iossOrderInformation/useIossOrderInformation.ts","integrations/crossborderit/billings/api.ts","components/shared/layout/index.ts","components/merchantOnboardning/MerchantOnboardning.tsx","AppDataLoader.tsx","components/apiAuthorization/Login.tsx","components/apiAuthorization/Logout.tsx","components/apiAuthorization/ApiAuthorizationRoutes.tsx","components/notFound/NotFound.tsx","i18n.js","SupportedBrowsersGuard.tsx","components/merchantOnboardning/MerchantOnboardingSuccess.tsx","supportedBrowsers.ts","components/onboarding/startOnboarding/StartOnboardingPage.tsx","App.tsx","index.tsx","store/actions/createAction.ts","store/actions/agreements.ts","store/actions/setAsyncResource.ts","store/actions/index.ts","store/rootReducer.ts","store/storeSetup.ts","utility/stringToColor.ts","integrations/crossborderit/fetchFormData.ts","components/shared/button/index.ts","integrations/crossborderit/useCrossborderitApi.ts"],"names":["ScreenSize","useScreenSize","useState","Medium","screenSize","setScreenSize","theme","useTheme","getScreenSize","useCallback","window","innerWidth","breakpoints","medium","Large","small","extraSmall","Small","ExtraSmall","useEffect","addEventListener","removeEventListener","AgreementType","ApiAccess","getAgreements","apiFetch","getAllAgreements","postAgreement","agreement","formData","FormData","append","upload","file","originFileObj","agreementType","JSON","stringify","companyCategories","name","description","updateSummary","apiFetchFormData","HTTPMethod","POST","putAgreement","PUT","deleteAgreement","agreementId","undefined","DELETE","getPendingCompanyAgreements","companyId","getSignedCompanyAgreements","signCompanyAgreement","Environment","useApiKeys","storePath","useMemo","api","useCrossborderitApi","dispatch","useDispatch","useSelector","selectAsyncResource","data","apiKeys","status","AsyncStatus","NotInitialized","loadApiKeys","setAsyncResource","Loading","then","Success","catch","Error","createApiKey","apiKey","newApiKey","token","updateKeyDescription","apiKeyId","updatedKey","replaceBy","revokeApiKey","revokedKey","getAppVersion","fetch","process","response","json","FeeTriggerType","FeeCalculationType","CustomsBrokerCountryRoles","CalculationMeasurementUnit","CalculationTransportationType","CalculationResultStatus","CalculationTaxAndFeeType","putCalculation","calculation","ClassificationExternalStatus","CmsContentType","queryString","require","getListOfSubmittedExternalJobs","query","queryStringified","getListOfProductsInSubmittedExternalJob","submitId","x","map","transformToExternalClassificationProduct","submitProductsForExternalClassification","classificationRequest","resubmitFailedExternalProducts","sendResponseToClassifier","externalClassificationResponse","resubmitableClassificationStatuses","FailedToClassify","SubmissionRejected","SubmissionFailed","classificationResultSingleProduct","isResubmitable","includes","classificationStatus","getCmsContentForAdmin","contentId","getCmsContentForCompany","getCmsContentWithTypeForCompany","contentType","getCmsContentWithTypeForAdmin","onlyVisible","postCmsContent","cmsContent","putCmsContent","revokeCmsContent","CompanyCategory","PaymentTerm","IossAdvancedFeeName","useCms","getCmsContentWithIdForAdmin","getAllCmsContentWithTypeForAdmin","getCmsContentWithIdForCompany","getAllCmsContentWithTypeForCompany","createCmsContent","newCmsContent","updateCmsContent","updatedCmsContent","inactivateCmsContent","fromUrlToCmsContentType","urlContentTypeParam","NewFeatures","HowItWorks","SystemAlert","NotSelected","CompanyOnboardingStatus","CompanyIossStatus","companyOnboardingStatusOrder","StatementPaymentProvider","CompanyContactType","EmailStatus","AddressType","PhoneType","paymentTerms","UserNoteType","SystemNoteType","NoteCategory","companyBackendModelToCompany","companyBackendModel","omit","postalAddress","findAddress","Postal","invoiceBillingAddress","InvoiceBilling","visitAddress","Visit","addressType","addresses","find","address","addressTypes","getCompaniesUserCanAccess","ActiveStatus","All","getCompany","putCompany","company","id","isObjKeysEmpty","push","companyToCompanyBackendModel","syncOnboardingStatus","addPlusiusCustomer","updatePlusiusCustomer","getCompanyIossNumberHistory","useCompany","selectCompany","useUserPreferences","formatCompanyName","userPreferencesStatus","formattedCompany","loadCompany","setCompany","updateCompany","updatedCompanyFields","updatedCompany","partialCompaniesStorePath","useCompanies","loadUserPreferences","equals","companies","inactiveCompanies","filter","revokedUtc","activeCompanies","loadCompanies","createCompany","inactivateCompany","reactivateCompany","updateCompaniesState","formattedCompanyNames","didCancel","getEntityNotes","entityId","createEntityNote","entityNote","editEntityNote","revokeEntityNote","noteId","GetEntityNotesTaggedWithUserId","userId","limit","GET","CountryDataType","useNoteMentions","mentionRegex","getMentionsFromNote","note","displayRegex","idRegex","matches","match","mentions","forEach","m","replace","display","fullName","getNoteOutput","message","users","entityNoteUserTags","newNote","split","output","i","n","length","user","_","email","getCurrencies","getCountries","getCountryCustomsLink","countryCode","postCountryData","countryData","getAllDataForCountry","putCountryData","countryDataId","deleteCountryData","countriesStorePath","useCountries","countries","loadCountries","selectCountryBy","prop","value","findCountry","memoizeWith","identity","country","BraintreeDropinStatus","TypeOfCharge","useCustomers","customers","inactiveCustomers","customer","companyIsActive","companyName","activeCustomers","loadCustomers","activeStatus","loadCustomer","customerId","createCustomer","newCustomer","inactivateCustomer","reactivateCustomer","addCompanyCompanyRelationship","removeCompanyCompanyRelationship","relationshipId","removeById","getEmployees","useIndustryNews","industryNews","loadIndustryNews","getCompanyInvitations","postInvitation","onboarding","deleteInvitation","resendInvitation","reactivateInvitation","inactivateInvitation","getPayPalClientToken","clientToken","putPayPalPaymentNonce","nonce","createPayPalPayment","paymentMethodNonce","invoiceId","Separator","NumberFormat","useBraintree","containerSelector","setStatus","braintreeInstance","setBraintreeInstance","isBillingMethodValid","setIsBillingMethodValid","Object","threeDSecureParameters","setNonce","braintreeConfiguration","container","paypal","flow","currency","payPalClientToken","Idle","createDropinInstance","authorization","isPaymentMethodRequestable","enableNextButton","disableNextButton","on","off","instance","updateBillingMethod","requestPaymentMethod","payload","Promise","reject","createPayment","pipe","CompanyUserRole","exportFile","importId","separator","Semicolon","numberFormattingOption","DecimalComma","ok","blob","download","uploadFile","importFile","importDecision","getImports","startDeleteProductImportFileJob","getRemoveProductImportFileJobStatus","getCompaniesUsersByLastLoggedIn","generalTimePeriodType","getCompanyUsers","getCompanyUser","companyUserId","postCompanyUser","companyUser","putCompanyUser","HTTPStatus","NoContent","deleteCompanyUser","sendPasswordResetEmail","reactivateCompanyUser","HsCodeValidationStatus","ProductCondition","ProductQuerySearchMode","ProductFilter","ProductClassificationStatus","countryCodesPossibleToValidate","IossValidationErrorCode","productListBackendModelToPartialProducts","productListFromBackEnd","product","cId","articleNumber","a","d","commodityType","c","confidence","cf","hsCode","h","hsCodeValidationStatus","hvs","hsCodeValidationStatusUtcDate","hvsd","hsCodeId","hId","hsCode2","h2","hsCode2ValidationStatus","h2vs","hsCode2ValidationStatusUtcDate","h2vsd","hsCode2Id","h2Id","hsCode3","h3","hsCode3ValidationStatus","h3vs","hsCode3ValidationStatusUtcDate","h3vsd","hsCode3Id","h3Id","hsCodeSuggestionByAI","hsba","imageUrl","productUrl","p","lastUpdated","lu","updatedBy","ub","shipmentOriginCountryCode","s","cs","assignedToFullName","aTfN","assignedToId","aTi","aiTranslated","at","trade6hsCode","t6","trade6ValidationStatus","t6vs","trade6ValidationStatusUtcDate","t6vsd","trade6Id","t6id","created","cr","netWeightInKg","nw","grossWeightInKg","gw","manufacturedInCountry","mc","brandOrManufacturer","bom","ean","getPageOptions","usePageOptions","pageOptions","selectPageOptionsData","loadPageOptionsData","Api","setPageOptions","FeeCategory","getAdvancedFees","postAdvancedFee","fee","putAdvancedFee","deleteAdvancedFee","getAdvancedFeeRelated","updateCompanyAdvancedFees","advancedFeesIds","IossReimportJobState","getAllWebShopIntegrationsForAdmin","getWebShopIntegrations","postWebShopIntegrations","integrationKey","webShop","IntegrationKey","webShopType","putWebShopIntegrations","webShopIntegrationId","emailOnErrors","deleteWebShopIntegrations","iossReimportPreview","iossReimportStart","iossReimportProgress","IossInvoiceJobState","IossJobType","IossInvoiceJobInvoiceType","startIossInvoiceJob","endDate","jobType","getIossInvoiceJobStatus","getIossInvoiceJobs","deleteIossInvoiceJob","jobId","getIossInvoiceJobInvoices","getIossInvoiceJobInvoiceText","getIossInvoiceJobInvoicesText","VatReturnsJobState","getStatusOfVatReturnJob","getIossVatReturnJobs","getListOfAllVatReturnsForJob","putIossVatReturnJob","year","month","detailAnalysis","replaceExistingData","getCombinedVatReturns","iossNumber","dates","dateParams","date","join","url","ChartState","ChartType","AdminChart","PlatformType","ChartGroupedPeriod","UploadType","ClassificationHelpMethods","getSalesByPeriod","from","to","getSalesByPeriodAndDestination","destinationCountry","getSalesByPeriodAdmin","platform","getIossRegistrationsByPeriod","getIossRegistrationsByPeriodAndCountry","getEarningsAndVatByCompanyAndDate","feeType","getEarningsAndVatByCompanyAndDateAllFeeTypes","getDestinationCountriesForEachCompany","getAllDestinationCountries","getProductCountAsync","getProductWithMissingDescriptionCountAsync","getProductWithMissingTrade6CountAsync","getProductWithInvalidStatusCountAsync","getUploadedProductCountAsync","getClassfiedProductCountAsync","getInProgressClassficationsAsync","getCompletedClassificationJobs","getReportForDigitalCustomsOrdersByCustomsStatus","getReportForDigitalCustomsOrdersWithCorrections","getDayWiseReportForDigitalCustomsOrders","DynamicsInvoiceType","CrmActionType","useAnalytics","t","useTranslation","dateRange","datas","keys","key","y","color","DefaultPalette","blue","legend","getAllUnpaidInvoices","invoiceType","overDueUnpaidInvoices","invoice","CollectionInvoiceStatus","SentToCustomer","moment","dueDate","isBefore","groupedInvoices","groupBy","groupByDueDateCompanyName","xAxisPoint","format","chartData","values","companysInvoices","xAxisCalloutData","yAxisCalloutData","stringToColour","transactionDate","slice","count","Array","Set","iossStartDate","datasDate","data2","data3","transformEarningsAndVatByCompanyAndDateAllFeeTypesVertical","vat","sort","vatAmount","orders","earnings","revenue","transformOrdersByCompanyAndDateAllFeeTypes","reduce","previousValue","currentValue","transformEarningsAndVatByCompanyAndDateAllFeeTypesHorizontal","highestXValues","Math","max","chartTitle","horizontalBarChartdata","round","getCompanyVatAndOrdersByPeriod","totalSalesDatas","vatValue","getSalesByDestinationCountry","selectedCountry","alpha2Code","salesPerDestinationCountryDatas","getVatAndOrdersBySourceCountry","fromDate","toDate","groupedPeriod","formatXAxisPoint","item","Monthly","Weekly","isoWeek","toString","groupedData","companyData","companyInvoiceStorePath","useBillings","invoices","loadInvoicesForCompanyId","getInvoicesByCompany","refreshCollectionInvoice","collectionInvoiceId","getCollectionInvoice","ci","updatedInvoices","downloadCollectionInvoicePdf","refreshInvoices","concat","createDynamicsCustomer","result","customerCreated","statusCode","e","createInitialInvoice","invoiceCreated","CrmCompanyStatus","CrmCompanyType","CrmDigitalCustomerCategory","CrmAccountCategory","getCrmActions","createCrmAction","crmAction","updateCrmAction","crmActionId","finishCrmAction","dismissCrmAction","crmActionsStorePath","useCrmActions","crmActions","loadCrmActions","allCrmActions","addCrmAction","createdCrmAction","editCrmAction","updatedCrmAction","completeCrmAction","finishedCrmAction","rejectCrmAction","rejectedCrmAction","removeCrmAction","deleteCrmAction","removeBy","activeCrmActions","action","actionUtc","isSameOrBefore","completedUtc","rejectedUtc","upcomingCrmActions","isAfter","pastCrmActions","createCrmContact","crmCompanyId","crmContact","updateCrmContact","crmContactId","updatedCrmContact","deleteCrmContact","getCrmCompany","updateCrmCompany","updatedCrmCompany","syncCompaniesToCrm","DocumentType","crmCompaniesStorePath","useCrmCompanies","crmCompanies","loadCrmCompanies","crmCompanyType","crmCompanyStatus","getCrmCompanies","allCrmCompanies","addCrmCompany","crmCompany","createCrmCompany","createdCrmCompany","editCrmCompany","inactivateCrmCompany","revokeCrmCompany","revokedCrmCompany","activateCrmCompany","unRevokeCrmCompany","unrevokedCrmCompany","addCrmCompanyContactState","createdCrmContact","crmContacts","updateCrmCompanyContactState","crmCompanyProp","updatedCrmContacts","removeCrmCompanyContactState","removedCrmContactId","getCompanyAccountManagers","UpdateCompanyAccountManagersForCompany","companyAccountManagers","getDocuments","updateDocument","document","uploadDocument","documentType","SalesDocument","deleteDocument","documentId","SubscriptionInitialFeeType","SubscriptionModule","SubscriptionLength","CompanySubscriptionState","OnboardingStep","SubscriptionModuleAccess","getAllWebShopPlugins","postWebShopPlugin","newWebShopPlugin","fileList","version","putWebShopPlugin","webShopPluginModel","deleteWebShopPlugin","webShopPluginId","useCbitBlog","blogPosts","loadCbitBlog","getActiveCompanyPaymentSolution","paymentServiceProvider","updateAutoDebitForCompanyPaymentSolution","companyPaymentSolutionId","isAutoDebit","getZuluMaskedCardForCompany","syncCompanyPaymentSolutionsWithPlusius","getAllSubscriptions","getSingleSubscription","subscriptionId","postSubscription","subscription","putSubscription","getAllCompanySubscriptions","getAllSubscriptionsCompanyCanAccess","getAgreementsForSubscriptions","subscriptionIds","checkCompanySubscriptionState","getUnsignedAgreementsForCompanySubscription","companySubscriptionId","signMultipleCompanySubscriptionAgreements","companySubscriptionIds","adminAddCompanySubscription","companySubscription","adminUpdateCompanySubscription","getSubscriptionGroups","addSubscriptionGroup","subscriptionGroup","updateSubscriptionGroup","removeSubscriptionGroup","subscriptionGroupId","getSubscriptionInitialFees","addSubscriptionInitialFee","subscriptionInitialFee","updateSubscriptionInitialFee","deleteSubscriptionInitialFee","subscriptionInitialFeeId","PayoutStatus","ClassitSubscriptionModuleAccessOrder","ClassitSmall","ClassitMedium","ClassitLarge","sendPhoneNumberVerification","phoneNumber","verifyCompanyPhoneNumber","verificationCode","sendCompanyEmailAddressVerification","verifyCompanyEmailAddress","emailAddress","contactId","setCompanyEmailAddressAsVerified","getVerifiedCompanyPhoneNumbers","setCompanyPhoneNumberAsVerified","getVerifiedCompanyEmailAddresses","getPayoutReports","getPayoutsForReport","payoutReportId","createPayoutReport","payoutReportModel","addStatementPayoutsToReport","statementsIds","removePayoutFromReport","payoutId","removePayoutReport","sendPayoutReport","sendPayout","updatePayout","payout","MessageType","Logo","className","symbol","props","xmlns","viewBox","points","style","fill","selectBreadcrumb","state","breadcrumbs","breadcrumb","text","Breadcrumb","cond","customerCompanyId","links","href","lineHeight","DropdownItem","head","rest","Text","overlay","link","Item","LinkItem","Customers","setCustomer","width","menu","overlayStyle","top","height","fontFamily","WebkitFontSmoothing","renderWithDropdown","useBreadcrumb","previousBreadcrumbRef","useRef","current","setBreadcrumbs","selectUserMenuProps","appVersion","UserMenu","minWidth","boxShadow","DefaultEffects","elevation16","backgroundColor","padding","Persona","secondaryText","size","PersonaSize","size40","margin","Stack","horizontal","Icon","marginRight","iconName","ApplicationPaths","Profile","pathname","LogOut","local","textAlign","variant","environment","trigger","borderRadius","justifyContent","alignItems","cursor","userSelect","HeaderTheme","Notifications","iconClassName","iconStyle","numberOfUnreadMessages","setNumberOfUnreadMessages","unreadMessages","setUnreadMessages","readMessages","setReadMessages","dropdownVisible","setDropDownVisible","openMessage","isRead","markAsRead","prev","handleMenuClick","messageId","Pivot","maxHeight","overflow","PivotItem","onClick","headerText","itemCount","horizontalAlign","messageType","ClassificationJobFinished","header","fontSize","paddingLeft","timestamp","received","preventDefault","verticalAlign","onVisibleChange","visible","IconButton","iconProps","Help","setDropdownVisible","selectCompanyId","target","UserRole","SuperAdmin","menuIconsStyle","Header","showRightSideMenu","logoNavLink","headerTheme","Dark","openCompanyNotes","toggleExtraSmallSidebar","history","useHistory","authenticationStatus","useAuthenticationStatus","isCbitAdmin","selectIsUserInRole","Employee","location","useLocation","isCompanyPage","startsWith","path","setPath","marginBottom","Authentication","Authenticated","tokens","childrenGap","Login","marginLeft","flex","flexDirection","TooltipHost","content","styles","root","ApplicationName","QueryParameterNames","ReturnUrl","Message","LogoutActions","LogoutCallback","Logout","LoggedOut","LoginActions","LoginCallback","LoginFailed","prefix","DefaultLoginRedirectPath","ApiAuthorizationClientConfigurationUrl","ApiAuthorizationPrefix","LogOutCallback","IdentityManagePath","ResetPassword","AuthorizeService","_callbacks","_nextSubscriptionId","_user","_isAuthenticated","_popUpDisabled","this","getUser","profile","ensureUserManagerInitialized","userManager","access_token","signinSilent","createArguments","silentUser","updateState","success","console","log","signinPopup","popUpUser","error","signinRedirect","redirect","signinCallback","signoutPopup","signoutRedirect","signoutCallback","notifySubscribers","callback","subscriptionIndex","element","index","found","splice","useReplaceToNavigate","AuthenticationResultStatus","Fail","Redirect","settings","automaticSilentRenew","includeIdTokenInSilentRenew","userStore","WebStorageStateStore","UserManager","events","addUserSignedOut","removeUser","authService","maskCompanyData","preferences","updateUserPreferences","userPreferencesToUpdate","userPreferences","sub","prefrences","cbitSupportEmail","Authenticating","subscribe","isAuthenticated","NotAuthenticated","unsubscribe","useFluentTheme","cbitDefaultTheme","large","initializeCustomIcons","registerIcons","icons","PlusiusLogo","src","alt","cbitIcon","Case","children","component","Switch","Children","child","cloneElement","getContacts","deleteContact","postContact","contact","putContact","resendContactEmailVerification","companyContactId","getCollectionInvoices","getStatementsForCompanyId","CollectionInvoiceType","Statement","getStatementReminderEmails","includeRows","getOrCreateInitialSubscriptionInvoice","createStatements","jobIds","periodEnd","createFeeInvoices","companiesExcludedFromDiscount","pdfDownloadCatch","title","processPdfResponse","fileName","getFileName","CollectionInvoiceStatusUserView","collectionInvoice","invoiceNumber","downloadCollectionInvoicePdfPreview","clearBankWireInfo","clearInitiatedCardPayment","updatePDF","sendStatements","collectionInvoiceIds","sendStatementReminderEmails","getCollectionInvoiceDetails","deleteCollectionInvoices","getStatementPdfGeneratorStatus","migrateStatements","companyIds","getExternalPayments","getUnprocessedTransactions","initiateZuluCardPayment","isMerchantInitiated","initiateBankwirePayment","getDynamicsInvoiceCreationInfo","queueInvoicesForDynamicsCreation","changeCollectionInvoiceStatus","clearCollectionInvoiceErrors","updateStatementTransactions","transactions","cancelReminderFeeInvoiceCreation","reactivateReminderFeeInvoiceCreation","GetCollectionInvoicePaymentTransactions","PaymentTransactionStatus","PaymentAccountType","PaymentServiceProviderEnum","ExternalPaymentTypeEnum","collectionInvoiceStatusOrder","statementCollectionInvoices","useStatements","statements","loadStatements","loadStatementsForCompanyId","deleteStatements","ids","deletedStatementIds","filteredStatements","refreshStatementInvoice","collectionInvoicesSelector","useCollectionInvoices","collectionInvoices","loadCollectionInvoices","Invoice","sendToErp","createInvoiceInERP","updateCis","updateCollectionInvoicesState","updatedCollectionInvoice","OnboardingOptions","postMerchantOnboarding","PostCustomerInitiatedOnboarding","AuthStatus","endpoint","body","method","requestInit","getAccessToken","headers","Accept","Authorization","apiResponse","Unauthorized","signOut","Forbidden","PreconditionFailed","getReader","read","b","tokenChallengeId","TextDecoder","decode","tokenChallengeResponse","prompt","valueOf","apiResponseWithToken","get","Conflict","reasonForConflict","BadRequest","NotFound","textResult","contentDisposition","ErrorResult","_title","_subTitle","subTitle","icon","FontIcon","CompactResult","_icon","Overlay","InternationalPhoneNumber","fieldKey","required","requireValidFormat","noStyle","label","disabled","placeholder","getValue","isValidFormat","hasFeedBack","validationStatus","validateTriggerType","setValidateTriggerType","validateTrigger","rules","validator","isValidPhoneNumber","resolve","hasFeedback","validateStatus","onBlur","onChange","PhoneInputComponent","inputValue","setInputValue","initialLoad","setInitialLoad","parsePhoneNumber","countryCallingCode","number","international","focusInputOnCountrySelection","countryCallingCodeEditable","AmlKybContactPerson","gutter","beneficialOwners","selectedContact","useParams","span","hidden","autoComplete","type","emailStatus","NoVerificationNeeded","Verified","StatusColor","NotVerified","initialValue","Group","min","VerifyPhoneNumberModal","phoneNumberToVerify","emailAddressToVerify","overlayType","onFinish","onCancel","isPhoneVerification","VerifyPhoneNumber","useForm","verificationForm","footer","form","layout","verifiedPhoneNumber","finally","resetFields","verifiedEmailAddress","hostname","htmlType","ComponentStatus","ContactPerson","firstNameRequired","lastNameRequired","emailRequired","phoneRequired","mainContact","verifyNumber","verifyEmailAddress","pendingPhoneVerification","pendingEmailVerification","formRemoteSubmit","phoneNumberNeedsVerification","setPhoneNumberNeedsVerification","emailAddressNeedsVerification","setEmailAddressNeedsVerification","newPhoneNumber","setNewPhoneNumber","setEmailAddress","verifiedCompanyPhoneNumbers","setVerifiedCompanyPhoneNumbers","verifiedCompanyEmailAddresses","setVerifiedCompanyEmailAddresses","verifiedCompanyPhoneNumbersLoaded","setVerifiedCompanyPhoneNumbersLoaded","verifiedCompanyEmailAddressesLoaded","setVerifiedCompanyEmailAddressesLoaded","None","setOverlay","isUserSuperAdmin","isValidPhoneNumberFormat","setIsValidPhoneNumberFormat","onChangePhoneNumberVerificationStatus","onChangeEmailVerificationStatus","res","some","phone","marginTop","VerifyEmailAddress","err","addressFieldsTheUserCanChange","isAnotherFieldFilled","fieldName","formValues","entries","AddressInput","requiredFieldsDependencies","dependencies","getFieldValue","showSearch","optionFilterProp","filterOption","allowClear","Option","alpha3Code","CAPITAL_LETTER","CompanyCategorySelect","category","Status","CountryInput","valueType","mode","countriesStatus","componentStatus","setComponentStatus","loading","CountrySelect","valueDisplayType","optionLabelType","disabledOptions","_onChange","_value","defaultValue","filteredCountries","isArray","setValue","selectableCountries","setSelectableCountries","optionLabelProp","CurrencyInput","currencies","selectCurrencies","Input","mask","onFocus","inputRef","internalValue","setInternalValue","displayedValue","setDisplayedValue","focused","ref","event","NoStatus","Processing","SharedColors","cyanBlue10","Warning","orange10","greenCyan10","red10","Restricted","paddingTop","SuccessResult","LayoutContent","verticalScroll","withSidebar","as","Element","gridArea","overflowY","overflowX","Address","block","addressLine1","addressLine2","city","postalCode","Country","countryStatus","setCountry","Currency","currencyCode","selectCurrency","toDisplayDate","time","Date","toLocaleDateString","toLocaleTimeString","trim","DisplayDate","TimeAgo","utc","fromNow","getCompanyDigitalCustomsOrdersByDate","isTest","getCompanyDigitalCustomsArticlesByOrderId","orderId","getCompanyDigitalCustomsConsolidationsNotSentToMymo","getCompanyConsolidationsByMasterWaybill","masterwaybill","getCompanyDigitalCustomsUploads","getCompanyDigitalCustomsOrdersByConsolidationId","consolidationId","getCorrectionArticles","fromDateQuery","toDateQuery","getCompanyDigitalCustomsArticlesByConsolidationId","putCompanyDigitalCustomsArticle","articleId","article","putCompanyDigitalCustomsOrder","order","sendConsolidationToMymo","getNumberOfCorrectionsForCompany","getConsolidation","deleteConsolidationsCorrection","approveAndSendCorrections","sendInvalid","getCorrectionArticlesInMappings","articles","getHsCodesMappingsByIds","articlesWithMappingIds","getMasterFileList","getOrdersFileList","getMasterFile","getOrderFile","deleteMasterFile","deleteOrderFile","uploadMasterFile","files","uploadOrderFile","resendDigitalCustomConsolidations","consolidationIds","portOfDestination","customsCountry","params","URLSearchParams","getCompanyDigitalCustomsMasterPreviews","getCompanyDigitalCustomsDetailedMaster","masterId","editMaster","master","TriggerImportOrdersOnHoldNotification","obj","isEmpty","hasAnyCategory","categories","intersection","hasActiveSubscription","companySubscriptions","subscriptionModules","subscriptionModuleAccess","modulesInSubscription","companySubscriptionState","Active","hasSubscription","decapitalize","toLowerCase","isGuid","test","fromUtcToLocalTime","utcDate","utcToLocal","validateIossNumber","Guide","extra","maxWidth","curry","list","findIndex","propEq","update","selectAppStatus","findCurrency","isUserInRole","requiredRoles","userRoles","role","requiredRole","selectIsCompanyUserInRole","companyUsers","companyUserRoles","isCompanyUserInRole","allCompanyIds","asyncCompany","selectCompanyUsers","asyncUsers","selectCompanyContacts","asyncContacts","companyContacts","contacts","selectAdminData","asyncAdminData","admin","companyInvitations","asyncPageOptions","selectPendingCompanyAgreements","asyncAgreements","companyAgreements","pendingAgreements","agreements","selectSignedCompanyAgreements","signedAgreements","selectNumberOfCompanyTestCorrections","asyncNumberOfCompanyTestCorrections","numberOfCompanyTestCorrections","selectNumberOfCompanyCorrections","asyncNumberOfCompanyCorrections","numberOfCompanyCorrections","fallbackData","fallbackResource","asyncResource","pathOr","LayoutLoading","sidebar","loadingLabel","spinnerFullHeight","windowWidth","setWindowWidth","sidebarWidth","handleResize","LoadingSpinner","SpinnerSize","useSidebar","useRouteMatch","selectedKeys","setSelectedKeys","isSidebarCollapsed","setIsSidebarCollapsed","collapsed","saveIsSidebarCollapsed","getItemKey","isSidebarItemVisible","isVisible","toggleIsSidebarCollapsed","openedSidebarWidth","closedSidebarWidth","Sidebar","renderSubMenu","menuItem","subMenu","items","flat","every","SubMenu","groupIcon","groupTitle","groupKey","subItem","HorizontalSidebar","menuItems","background","borderBottom","VerticalSidebar","inlineCollapsed","borderRight","ExtraSmallSidebar","defaultStyles","border","navItems","renderGroupHeader","group","headerExtra","SidebarSecondary","selectedKey","navStyles","mergeDeepRight","Nav","onRenderGroupHeader","linkAs","isActive","DefaultButton","PrimaryButton","Button","Comp","show","withConditionalRendering","remove","getProducts","search","getProduct","productId","putProduct","assignClassificationJobProductsToAgents","assignedJobProducts","getClassifications","putClassification","classification","putClassifications","bulkClassification","classifyProduct","isTrade6HsCode","dutyRate","taxRate","bulkUpdateProductClassificationStatusAsync","updatedStatuses","deleteProducts","productIdList","getValidateHsCodeAsync","productClassificationId","getTemporaryProducts","checkForTemporaryProducts","handleTemporaryProducts","articleNumbers","updateProducts","postOnlyValidateHsCodesAsync","hsCodeValidationItems","saveValidations","productInformation","getUnprocessedValidations","classifyProductsWithHsCodesFromAi","productIds","translateProducts","getListOfAvailableLanguagesForProductTranslation","navigateUpAndAddRoute","route","selectProps","Layout","extraSmallSidebarOpen","currentCompanyId","environmentName","flatMap","woonyScript","given_name","family_name","phones","woonyWidget","getElementsByClassName","script","createElement","innerHTML","appendChild","ImportWoony","Production","cbitLayoutStyles","mergeStyles","gridTemplateColumns","gridTemplateRows","gridTemplateAreas","Content","useAuthorizationStatus","requiredUserRoles","requiredCompanyUserRoles","requiredCompanyCategories","requiredActiveCompanySubscriptionModules","Authorizing","currentCompanyUser","activeCompanySubscriptionModules","effectiveUserRoles","isAuthorized","NotAuthorized","Authorized","AuthorizeRoute","companySubcriptionModules","Component","authorizationStatus","returnUrl","protocol","host","hash","loginUrl","encodeURIComponent","getIossOrderInformationFileEntries","fileId","getAllIossOrderInformationFileEntries","getIossOrderRefundDetails","iossRefundId","useIossOrderInformation","options","initialize","iossOrderInformationStorePath","apiFormData","iossOrderInformationFiles","loadIossOrderInformationFiles","deleteIossOrderInformationFile","isNil","is","String","cannotBeDeleted","deleteMultipleIossOrderInformationFiles","filteredFiles","f","filesIds","uploadIossOrderInformationFile","failedToImport","iossFailedToImportItems","rowIndex","errorMessages","iossOrderInformationFile","postIossRefund","iossOrderDataEntryId","iossOrderRefundReason","postIossFileRefund","iossImportFileId","validateIossFile","syncInvoicesWithDynamics","deleteInvoiceEmailAddress","billingInformationId","putInvoiceEmailAddress","updatedInvoiceEmail","postInvoiceEmailAddress","newInvoiceEmail","PageState","AppDataLoader","loadAppData","login","getReturnUrl","processLoginCallback","setState","redirectToProfile","signIn","navigateToReturnUrl","completeSignIn","fromQuery","origin","redirectToApiAuthorizationPath","apiAuthorizationPath","redirectUrl","isReady","authenticated","logout","processLogoutCallback","populateAuthenticationState","completeSignOut","loginAction","logoutAction","ApiAuthorizationRoutes","render","resources","en","translation","GuardStatus","MerchantOnboarding","Form","pageState","setPageState","webShopTypeDataOption","setWebShopTypeDataOption","webShopReferrer","iconClass","hostStyles","calloutProps","gapSpace","webShopTypeOption","webshop","downloadUrl","marketPlaceUrl","Submitting","preserve","urlParams","onboardingOptions","AddIoss","Merchant","referrer","RegistrationComplete","fontWeight","Link","directionalHint","DirectionalHint","bottomCenter","submit","left","right","MerchantOnboardingSuccess","supportedBrowsers","FormStatus","SupportedBrowsersGuard","BrowserSupported","guardStatus","setGuardStatus","navigator","userAgent","BrowserNotSupported","StartOnboardingPage","formStatus","setFormStatus","verticalFill","SubmittingForm","initializeFileTypeIcons","CbitAdminModule","lazy","OnboardingModule","WorkspaceModule","initializeIcons","i18n","use","initReactI18next","init","lng","keySeparator","interpolation","escapeValue","store","setupStore","baseUrl","getElementsByTagName","getAttribute","App","ThemeProvider","basename","exact","fallback","rootElement","getElementById","ReactDOM","createAction","fn","assign","loadPendingCompanyAgreements","setPendingCompanyAgreements","loadSignedCompanyAgreements","setSignedCompanyAgreements","setAppData","all","appData","companiesUserCanAccess","isCollapsed","savedIsSidebarCollapsed","localStorage","setItem","loadAdminData","setAdminData","invitations","setCompanyUsers","setCompanyContacts","setNumberOfCompanyTestCorrections","setNumberOfCompanyCorrections","numberOfTestConsolidations","numberOfConsolidations","loadCompanyUsers","addCompanyUser","replaceCompanyUser","loadCompanyContacts","addCompanyContact","replaceCompanyContact","deleteCompanyContact","decreaseNumberOfCompanyTestCorrections","amount","decreaseNumberOfCompanyCorrections","consolidationCount","rootReducer","companyPath","lensPath","set","companyUsersPath","over","companyContactsPath","pendingCompanyAgreementsPath","signedCompanyAgreementsPath","numberOfCompanyTestCorrectionsPath","numberOfCompanyCorrectionsPath","newState","subtract","lens","middleware","thunk","createStore","subscriptions","parse","getItem","multiSelect","billingFrequencies","carrierCountryRoles","classificationModes","codeFormatterTypes","companyContactTypes","companyCompanyRoles","countryDataType","customsBrokerCountryRoles","feeCalculationTypes","feeTriggerTypes","importedTypeOfData","importMethods","keyDomains","numberFormattingOptions","phoneTypes","productConditions","productIdentificationNumberTypes","productImportProblems","rateTypes","composeWithDevTools","applyMiddleware","str","charCodeAt","colour","substr","errorMessageConverter","errorMessage"],"mappings":"oNAGkBA,E,kCAAAA,O,iBAAAA,I,mBAAAA,I,iBAAAA,I,4BAAAA,M,KAOX,IAAMC,EAAgB,WAC3B,MAAoCC,mBAAqBF,EAAWG,QAApE,mBAAOC,EAAP,KAAmBC,EAAnB,KACMC,EAAQC,cAERC,EAAgBC,uBAAY,WAChC,GAAIC,OAAOC,WAAaL,EAAMM,YAAYC,OACxCR,EAAcL,EAAWc,YAEtB,GAAIJ,OAAOC,WAAaL,EAAMM,YAAYG,OAASL,OAAOC,YAAcL,EAAMM,YAAYC,OAC7FR,EAAcL,EAAWG,aAEtB,GAAIO,OAAOC,WAAaL,EAAMM,YAAYI,YAAcN,OAAOC,YAAcL,EAAMM,YAAYG,MAClGV,EAAcL,EAAWiB,WAEtB,MAAIP,OAAOC,YAAcL,EAAMM,YAAYI,YAGzC,OAFLX,EAAcL,EAAWkB,eAG1B,CAACZ,IAWJ,OATAa,qBAAU,WAIR,OAHAX,IACAE,OAAOU,iBAAiB,SAAUZ,GAE3B,WACLE,OAAOW,oBAAoB,SAAUb,MAEtC,CAACA,IAEG,CAACJ,gB,ogWClBEkB,ECFAC,E,eCfCC,EAAgB,kBAA4BC,YAAS,gBAErDC,EAAmB,kBAA4BD,YAAS,oBAExDE,EAAgB,SAACC,GAC5B,IAAMC,EAAW,IAAIC,SAOrB,OANAD,EAASE,OAAO,OAAQH,EAAUI,OAAOC,KAAKC,eAC9CL,EAASE,OAAO,gBAAiBH,EAAUO,eAC3CN,EAAS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C,MAAMob,EAAK,CACnCmoB,SACAD,OACAI,QAAS,CACPE,cAAc,UAAD,OAAYpkC,MAlBC,YAcxBqkC,EAdwB,QAsBdllC,SAAW0T,IAAWyxB,aAtBR,sBAuBtB,CAAEnlC,OAAQykC,IAAWpG,kBAvBC,YAwBnB6G,EAAYzyB,GAxBO,2CAyBV,OAAXyyB,QAAW,IAAXA,GAAA,UAAAA,EAAaH,eAAb,mBAAsBkB,IAAI,uBAA1B,eAA2CxiC,SAAS,qBACvDyhC,EAAY1jC,OACZ0jC,GA3BwB,yBA6BHA,EAAY1U,OA7BT,cA6BxBmiC,EA7BwB,OA8BxBD,EAAsBC,GACxBA,EAAeD,EAAsBC,KAE7BA,IAA4B,QAAZ,EAAAA,SAAA,eAAc3mD,QAAS,OAC/C2mD,EAAY,6DAAyDl2C,IAEjE,IAAIhc,MAAMkyD,GApCY,4CAAH,yD,gCCT7B,kD,gCCAA,qDAGalzD,EAAsB,iBAAO,CACxCD,IAAKlC,IACL6nD,YAAa5mD,Q","file":"static/js/main.58812d43.chunk.js","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\r\nimport { useTheme } from 'styles';\r\n\r\nexport const enum ScreenSize{\r\n Large,\r\n Medium,\r\n Small,\r\n ExtraSmall,\r\n}\r\n\r\nexport const useScreenSize = () => {\r\n const [screenSize, setScreenSize] = useState(ScreenSize.Medium);\r\n const theme = useTheme();\r\n\r\n const getScreenSize = useCallback(() => {\r\n if (window.innerWidth > theme.breakpoints.medium ) {\r\n setScreenSize(ScreenSize.Large);\r\n }\r\n else if (window.innerWidth > theme.breakpoints.small && window.innerWidth <= theme.breakpoints.medium) {\r\n setScreenSize(ScreenSize.Medium);\r\n }\r\n else if (window.innerWidth > theme.breakpoints.extraSmall && window.innerWidth <= theme.breakpoints.small) {\r\n setScreenSize(ScreenSize.Small);\r\n }\r\n else if (window.innerWidth <= theme.breakpoints.extraSmall) {\r\n setScreenSize(ScreenSize.ExtraSmall);\r\n }\r\n else { return; }\r\n }, [theme]);\r\n\r\n useEffect(() => {\r\n getScreenSize();\r\n window.addEventListener('resize', getScreenSize);\r\n\r\n return () => {\r\n window.removeEventListener('resize', getScreenSize);\r\n };\r\n }, [getScreenSize]);\r\n\r\n return {screenSize};\r\n\r\n};","import { CompanyCategory } from '../companies';\r\n\r\nexport interface Agreement {\r\n id?: string\r\n createdUtc?: string\r\n agreementType: AgreementType\r\n companyCategories: CompanyCategory[]\r\n name: string\r\n description: string\r\n upload?: any\r\n documentUrl?: string\r\n fileBase64?: string\r\n fileName?: string\r\n fileSize?: number\r\n updatedUtc?: string\r\n signedBy?: string; //Name not id\r\n signedUtc?: string;\r\n decompressedFile?: string;\r\n updateSummary?: string;\r\n}\r\n\r\nexport enum AgreementType {\r\n TermsAndConditions = 'TermsAndConditions',\r\n PowerOfAttorney = 'PowerOfAttorney',\r\n BillingTerms = 'BillingTerms',\r\n Other = 'Other',\r\n}\r\n","export interface CreateApiKey {\r\n lifeTime: number;\r\n description: string;\r\n apiAccess: ApiAccess[];\r\n}\r\n\r\nexport interface ApiKey {\r\n id: string;\r\n companyId: string;\r\n addedUtc: string;\r\n expiresUtc: string;\r\n revokedUtc: string;\r\n token: string;\r\n description: string;\r\n apiAccess: ApiAccess[];\r\n managedBySystem: boolean;\r\n isInactive: boolean;\r\n}\r\n\r\nexport enum ApiAccess {\r\n Collections = 'Collections',\r\n Calculations = 'Calculations',\r\n Ioss = 'Ioss',\r\n Classification = 'Classification',\r\n DigitalCustoms = 'DigitalCustoms',\r\n Manifests = 'Manifests',\r\n OrderImport = 'OrderImport',\r\n ClassificationBasic = 'ClassificationBasic',\r\n}\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { apiFetchFormData } from 'integrations/crossborderit/fetchFormData';\r\nimport { Agreement } from './interfaces';\r\n\r\nexport const getAgreements = (): Promise => apiFetch('/agreements');\r\n\r\nexport const getAllAgreements = (): Promise => apiFetch('/agreements/all');\r\n\r\nexport const postAgreement = (agreement: Agreement): Promise => {\r\n const formData = new FormData();\r\n formData.append('file', agreement.upload.file.originFileObj);\r\n formData.append('agreementType', agreement.agreementType);\r\n formData.append('companyCategories', JSON.stringify(agreement.companyCategories));\r\n formData.append('name', agreement.name);\r\n formData.append('description', agreement.description);\r\n formData.append('updateSummary', agreement.updateSummary || '');\r\n return apiFetchFormData('/agreements', formData, HTTPMethod.POST);\r\n};\r\n\r\nexport const putAgreement = (agreement: Agreement): Promise =>\r\n apiFetch('/agreements', agreement, HTTPMethod.PUT);\r\n\r\nexport const deleteAgreement = (agreementId: string): Promise =>\r\n apiFetch(`/agreements/${agreementId}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const getPendingCompanyAgreements = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/agreements/pending`);\r\n\r\nexport const getSignedCompanyAgreements = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/agreements/signed`);\r\n\r\nexport const signCompanyAgreement = (companyId: string, agreementId: string) =>\r\n apiFetch(`/companies/${companyId}/agreements/sign/${agreementId}`);\r\n","export interface AppVersion {\r\n environment: string;\r\n version: string;\r\n}\r\n\r\nexport enum Environment {\r\n Production = 'Production',\r\n Local = 'Local',\r\n Stage = 'Stage/Test',\r\n Development = 'Development',\r\n}","import { useCallback, useEffect, useMemo } from 'react';\r\nimport { useCrossborderitApi } from '../useCrossborderitApi';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { CreateApiKey, ApiKey } from './interfaces';\r\nimport { HTTPMethod } from 'integrations/crossborderit/fetch';\r\nimport { replaceBy } from 'utility';\r\n\r\nexport const useApiKeys = (companyId: string) => {\r\n const storePath = useMemo(() => ['apiKeys', companyId], [companyId]);\r\n const { api } = useCrossborderitApi();\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n data: apiKeys = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], storePath));\r\n\r\n const loadApiKeys = useCallback(() => {\r\n if (!companyId) return;\r\n\r\n dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Loading,\r\n []\r\n ));\r\n\r\n api(`/companies/${companyId}/apikeys`)\r\n .then(apiKeys => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n apiKeys\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n }, [api, dispatch, storePath, companyId]);\r\n\r\n const createApiKey = useCallback((apiKey: CreateApiKey) =>\r\n api(`/companies/${companyId}/apikeys`, apiKey, HTTPMethod.POST)\r\n .then(newApiKey => {\r\n\r\n const { token, ...apiKey } = newApiKey;\r\n\r\n dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n [apiKey, ...apiKeys]\r\n ));\r\n\r\n return token;\r\n })\r\n , [api, dispatch, storePath, companyId, apiKeys]);\r\n\r\n const updateKeyDescription = useCallback((apiKeyId: string, description: string) =>\r\n api(`/companies/${companyId}/apikeys/${apiKeyId}`, description, HTTPMethod.PUT)\r\n .then(updatedKey => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', updatedKey, apiKeys)\r\n )))\r\n , [api, dispatch, storePath, companyId, apiKeys]);\r\n\r\n const revokeApiKey = useCallback((apiKeyId: string) =>\r\n api(`/companies/${companyId}/apikeys/${apiKeyId}/revoke`, undefined, HTTPMethod.PUT)\r\n .then((revokedKey) => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', revokedKey, apiKeys)\r\n )))\r\n , [api, dispatch, storePath, companyId, apiKeys]);\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized) return;\r\n loadApiKeys();\r\n }, [status, loadApiKeys]);\r\n\r\n return {\r\n status,\r\n apiKeys,\r\n loadApiKeys,\r\n updateKeyDescription,\r\n createApiKey,\r\n revokeApiKey,\r\n };\r\n\r\n};\r\n","import { AppVersion } from './interfaces';\r\n\r\nexport const getAppVersion = (): Promise => fetch(`${process.env.PUBLIC_URL}/appversion`).then((response) => response.json());\r\n","export interface Fee {\r\n companyCountryFeeId: string;\r\n name: string;\r\n feeTriggerType: FeeTriggerType;\r\n feeCalculationType: FeeCalculationType;\r\n staffedFees: StaffedFee[];\r\n currencyCode: string;\r\n}\r\n\r\nexport interface StaffedFee {\r\n staffedFeeId: string;\r\n triggerLowLimit: number;\r\n feeValue: number;\r\n}\r\n\r\nexport enum FeeTriggerType {\r\n Never = 'Never',\r\n Always = 'Always',\r\n}\r\n\r\nexport enum FeeCalculationType {\r\n FixedAmount = 'FixedAmount',\r\n MultipliedAmount = 'MultipliedAmount',\r\n}\r\n\r\nexport interface CreateCompanyCountryRole {\r\n countryCode: string;\r\n customsBrokerCountryRoles: CustomsBrokerCountryRoles[];\r\n}\r\n\r\nexport interface CompanyCountryRole extends CreateCompanyCountryRole {\r\n id: string;\r\n}\r\n\r\nexport enum CustomsBrokerCountryRoles {\r\n Broker = 'Broker',\r\n PostalHandler = 'PostalHandler',\r\n ProductClassifier = 'ProductClassifier',\r\n}\r\n\r\nexport interface CarrierCountryBroker {\r\n countryCode: string;\r\n brokerCompanyId: string;\r\n brokerCompanyName: string;\r\n countryName: string;\r\n}\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { CalculationInput, CalculationResult } from './interfaces';\r\n\r\nexport const putCalculationDemo = (companyId: string, calculation: CalculationInput): Promise =>\r\n apiFetch(`/companies/${companyId}/calculations/demo`, calculation, HTTPMethod.PUT);\r\n\r\nexport const putCalculation = (calculation: CalculationInput): Promise =>\r\n apiFetch('/companies/calculations/prod', calculation, HTTPMethod.PUT);\r\n","export interface CalculationInput {\r\n originCountryCode: string;\r\n destinationCountryCode: string;\r\n destinationStateOrProvince: string; // Mandatory for Canada\r\n currencyCode: string;\r\n freightCharges: number; // Decimal\r\n insuranceCharges: number; // Decimal\r\n brokerageCharges: number; // Decimal\r\n transportationType: string;\r\n commodities: CalculationCommodityEntry[];\r\n}\r\n\r\nexport interface CalculationCommodityEntry {\r\n hsCode: string;\r\n customsValue: string; // Decimal\r\n measureAmount: string; // Decimal, Number of items, How many Kgs etc\r\n measurementUnit: CalculationMeasurementUnit;\r\n countryOfManufactureId: string;\r\n}\r\n\r\nexport interface CalculationResult {\r\n currencyCode: string;\r\n calculationResultStatus: string;\r\n extraStatusMessage: string;\r\n calculationCommodityResults: CalculationCommodityResult[];\r\n}\r\n\r\nexport interface CalculationCommodityResult {\r\n hsCode: string;\r\n status: CalculationResultStatus;\r\n errorMessages: string[];\r\n taxData: CalculationResultTaxData[];\r\n}\r\n\r\nexport interface CalculationResultTaxData {\r\n taxAndFeeType: CalculationTaxAndFeeType;\r\n name: string;\r\n currencyCode: string;\r\n effectiveDate: string;\r\n taxableValue: number; // Decimal\r\n description: string;\r\n formula: string;\r\n amount: number; // Decimal\r\n}\r\n\r\nexport enum CalculationMeasurementUnit {\r\n ItemCount = 'ItemCount',\r\n Kilogram = 'Kilogram',\r\n Liter = 'Liter',\r\n Meter = 'Meter',\r\n SquareMeter = 'SquareMeter',\r\n}\r\n\r\nexport enum CalculationTransportationType {\r\n Air = 'Air',\r\n Ground = 'Ground',\r\n Ocean = 'Ocean',\r\n Rail = 'Rail',\r\n}\r\n\r\nexport enum CalculationResultStatus {\r\n None = 'None',\r\n Success = 'Success',\r\n Failure = 'Failure',\r\n Error = 'Error',\r\n Warning = 'Warning',\r\n CommunicationError = 'Communication Error',\r\n NoResponseReceivedForEntry = 'No Response Received For Entry',\r\n}\r\n\r\nexport enum CalculationTaxAndFeeType {\r\n Duty = 'Duty',\r\n CustomsSurcharges = 'Customs Surcharges',\r\n GeneralSalesTax = 'General Sales Tax',\r\n AdditionalTaxes = 'Additional Taxes',\r\n}\r\n","export interface ProductsSubmittedForExternalClassificationRequest {\r\n productIds: string[];\r\n countries: string[];\r\n}\r\n\r\nexport interface ClassificationExternalRequestStatus {\r\n submitFailed: boolean;\r\n submitFailedMessage: string;\r\n submitId: string;\r\n numberOfSubmittedCountries: number;\r\n numberOfSubmittedProducts: number;\r\n isCompleted: boolean;\r\n numberOfProductsProcessing: number;\r\n numberOfProductsFailed: number;\r\n numberOfProductsSucceeded: number;\r\n}\r\n\r\nexport interface ClassifiationExternalJobsQuery {\r\n onlyMyJobs?: boolean;\r\n offset?: number;\r\n count?: number;\r\n}\r\n\r\nexport interface ClassificationExternalSubmitOverview {\r\n submitId: string;\r\n numberOfProductsSubmitted: number;\r\n numberOfCompletedProducts: number;\r\n numberOfFailedProducts: number;\r\n countries: string[];\r\n isCompleted: boolean;\r\n submittedUtc: string;\r\n lastUpdatedUtc: string;\r\n numberOfProductsWithAdditionalInfoRequired: number;\r\n}\r\n\r\nexport interface ExternalClassificationResponse {\r\n response: string;\r\n productId: string;\r\n}\r\n\r\nexport enum ClassificationExternalStatus {\r\n None = 'None',\r\n Submitted = 'Submitted',\r\n Classifying = 'Classifying',\r\n ClassifiedSuccessfully = 'ClassifiedSuccessfully',\r\n FailedToClassify = 'FailedToClassify',\r\n SubmissionRejected = 'SubmissionRejected',\r\n SubmissionFailed = 'SubmissionFailed',\r\n AdditionalInformationRequired = 'AdditionalInformationRequired',\r\n}\r\n\r\nexport interface ClassificationExternalResultSingleProduct {\r\n classificationStatus: ClassificationExternalStatus;\r\n countries: string[];\r\n lastUpdatedUtc: string;\r\n message: string;\r\n productId: string;\r\n submittedUtc: string;\r\n productArticleNumber: string;\r\n productName: string;\r\n}\r\n\r\n// ClassificationProduct is the same as ClassificationResultSingleProduct\r\n// but with additional properties that make it easier for frontend to handle.\r\n// The extra properties are all computed from ClassificationResultSingleProduct.\r\nexport interface ClassificationExternalProduct extends ClassificationExternalResultSingleProduct {\r\n isResubmitable: boolean;\r\n}","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport {\r\n ProductsSubmittedForExternalClassificationRequest,\r\n ClassificationExternalRequestStatus,\r\n ClassifiationExternalJobsQuery,\r\n ClassificationExternalSubmitOverview,\r\n ClassificationExternalProduct,\r\n ClassificationExternalStatus,\r\n ClassificationExternalResultSingleProduct,\r\n ExternalClassificationResponse,\r\n} from './interfaces';\r\n// TypeScript complains that there are no types for query-string if import keyword is used.\r\nconst queryString = require('query-string');\r\n\r\nexport const getListOfSubmittedExternalJobs = (\r\n companyId: string,\r\n query?: ClassifiationExternalJobsQuery\r\n) => {\r\n const queryStringified = !!query ? `?${queryString.stringify(query)}` : '';\r\n return apiFetch(\r\n `/companies/${companyId}/products/classifications/services${queryStringified}`\r\n );\r\n};\r\n\r\nexport const getListOfProductsInSubmittedExternalJob = (\r\n companyId: string,\r\n submitId: string\r\n) => apiFetch(\r\n `/companies/${companyId}/products/classifications/services/${submitId}`\r\n).then(x => x.map(transformToExternalClassificationProduct));\r\n\r\nexport const submitProductsForExternalClassification = (\r\n companyId: string,\r\n classificationRequest: ProductsSubmittedForExternalClassificationRequest\r\n) => apiFetch(\r\n `/companies/${companyId}/products/classifications/services/`,\r\n classificationRequest,\r\n HTTPMethod.PUT\r\n);\r\n\r\nexport const resubmitFailedExternalProducts = (\r\n companyId: string,\r\n submitId: string\r\n) => apiFetch(\r\n `/companies/${companyId}/products/classifications/services/${submitId}/ResubmitFailedProducts`,\r\n undefined,\r\n HTTPMethod.PUT\r\n);\r\n\r\nexport const sendResponseToClassifier = (\r\n companyId: string, externalClassificationResponse: ExternalClassificationResponse\r\n) => apiFetch(\r\n `/companies/${companyId}/products/classifications/services/sendResponseToEmail`, externalClassificationResponse, HTTPMethod.PUT);\r\n\r\nconst resubmitableClassificationStatuses = [\r\n ClassificationExternalStatus.FailedToClassify,\r\n ClassificationExternalStatus.SubmissionRejected,\r\n ClassificationExternalStatus.SubmissionFailed,\r\n];\r\n\r\nconst transformToExternalClassificationProduct = (classificationResultSingleProduct: ClassificationExternalResultSingleProduct): ClassificationExternalProduct => ({\r\n ...classificationResultSingleProduct,\r\n isResubmitable: resubmitableClassificationStatuses\r\n .includes(classificationResultSingleProduct.classificationStatus),\r\n});\r\n","import { CompanyCategory } from '..';\r\n\r\nexport enum CmsContentType {\r\n NotSelected,\r\n All,\r\n NewFeatures,\r\n HowItWorks,\r\n SystemAlert,\r\n}\r\nexport interface CmsContent {\r\n id: string;\r\n contentType: CmsContentType;\r\n title: string;\r\n content: string;\r\n active: boolean;\r\n addedUtc: Date;\r\n addedBy: string;\r\n visibleFromUtc?: Date;\r\n visibleToUtc?: Date;\r\n revokedUtc?: Date,\r\n revokedBy?: string;\r\n visibleFor?: CompanyCategory[];\r\n}","import {\r\n CmsContent,\r\n CmsContentType,\r\n} from './interfaces';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getCmsContentForAdmin = (contentId: string): Promise =>\r\n apiFetch(`/admin/cmsContent/${contentId}`);\r\n\r\nexport const getCmsContentForCompany = (companyId: string, contentId: string): Promise =>\r\n apiFetch(`/company/${companyId}/cmsContent/${contentId}`);\r\n\r\nexport const getCmsContentWithTypeForCompany = (companyId: string, contentType: CmsContentType): Promise =>\r\n apiFetch(`/company/${companyId}/cmsContent?contentType=${contentType}`);\r\n\r\nexport const getCmsContentWithTypeForAdmin = (contentType: CmsContentType, onlyVisible: boolean = false): Promise =>\r\n apiFetch(`/admin/cmsContent/?contentType=${contentType}&onlyVisible=${onlyVisible}`);\r\n\r\nexport const postCmsContent = (cmsContent: CmsContent): Promise =>\r\n apiFetch('/admin/cmsContent', cmsContent, HTTPMethod.POST);\r\n\r\nexport const putCmsContent = (cmsContent: CmsContent): Promise =>\r\n apiFetch('/admin/cmsContent', cmsContent, HTTPMethod.PUT);\r\n\r\nexport const revokeCmsContent = (contentId: string): Promise =>\r\n apiFetch(`/admin/cmsContent/${contentId}/inactivate`, undefined, HTTPMethod.PUT);\r\n\r\n","import {\r\n putCmsContent,\r\n postCmsContent,\r\n CmsContent,\r\n CmsContentType,\r\n revokeCmsContent,\r\n getCmsContentWithTypeForCompany,\r\n getCmsContentWithTypeForAdmin,\r\n getCmsContentForAdmin,\r\n getCmsContentForCompany,\r\n} from 'integrations/crossborderit';\r\nimport { useCallback } from 'react';\r\n\r\nexport const useCms = () => {\r\n\r\n const getCmsContentWithIdForAdmin = useCallback((contentId: string) =>\r\n getCmsContentForAdmin(contentId), []);\r\n\r\n const getAllCmsContentWithTypeForAdmin = useCallback((contentType: CmsContentType, onlyVisible?: boolean) =>\r\n getCmsContentWithTypeForAdmin(contentType, onlyVisible), []);\r\n\r\n const getCmsContentWithIdForCompany = useCallback((companyId: string, contentId: string) =>\r\n getCmsContentForCompany(companyId, contentId), []);\r\n\r\n const getAllCmsContentWithTypeForCompany = useCallback((companyId: string, contentType: CmsContentType) =>\r\n getCmsContentWithTypeForCompany(companyId, contentType), []);\r\n\r\n const updateCmsContent = (updatedCmsContent: CmsContent) =>\r\n putCmsContent(updatedCmsContent);\r\n\r\n const createCmsContent = (newCmsContent: CmsContent) =>\r\n postCmsContent(newCmsContent);\r\n\r\n const inactivateCmsContent = (contentId: string) =>\r\n revokeCmsContent(contentId);\r\n\r\n const fromUrlToCmsContentType = useCallback((urlContentTypeParam: string) => {\r\n if (urlContentTypeParam === 'new-features') {\r\n return CmsContentType.NewFeatures;\r\n } else if (urlContentTypeParam === 'how-it-works') {\r\n return CmsContentType.HowItWorks;\r\n } else if (urlContentTypeParam === 'system-alert') {\r\n return CmsContentType.SystemAlert;\r\n }\r\n else {\r\n return CmsContentType.NotSelected;\r\n }\r\n }, []);\r\n\r\n return {\r\n getCmsContentWithIdForAdmin,\r\n getAllCmsContentWithTypeForAdmin,\r\n getCmsContentWithIdForCompany,\r\n getAllCmsContentWithTypeForCompany,\r\n createCmsContent,\r\n updateCmsContent,\r\n inactivateCmsContent,\r\n fromUrlToCmsContentType,\r\n };\r\n};\r\n","import { AdvancedFee } from '../advancedFees';\r\nimport { AmlKybDocument } from '../amlKyb';\r\nimport { CompanyAccountManager } from '../companyAccountManagers';\r\nimport { CrmCompanyType } from '../crmCompanies';\r\nimport { SubscriptionModule } from '../subscriptions';\r\n\r\nexport enum CompanyCategory {\r\n NotSelected = 'NotSelected',\r\n Carrier = 'Carrier',\r\n CustomsBroker = 'CustomsBroker',\r\n Merchant = 'Merchant',\r\n PaymentServiceProvider = 'PaymentServiceProvider',\r\n ThirdPartyLogistics = 'ThirdPartyLogistics',\r\n Labeling = 'Labeling',\r\n IossReseller = 'IossReseller',\r\n ProductClassifier = 'ProductClassifier',\r\n Test = 'Test',\r\n}\r\n\r\nexport interface CompanyIdAndName{\r\n id: string,\r\n name: string,\r\n}\r\n\r\nexport interface WebShop {\r\n id?: string;\r\n name?: string;\r\n description?: string;\r\n companies?: any[]; // Define companies\r\n companyRelationships?: any[]; // Define companyRelationships,\r\n}\r\n\r\nexport enum PaymentTerm {\r\n DaysOfCredit7 = 7,\r\n DaysOfCredit10 = 10,\r\n DaysOfCredit30 = 30,\r\n DaysOfCredit60 = 60,\r\n DaysOfCredit90 = 90,\r\n}\r\n\r\nexport enum IossAdvancedFeeName {\r\n TenPercentIossVatFee = '10% IOSS VAT fee (maximum 1€ per order row)',\r\n FivePercentIossVatFee = '5% IOSS VAT fee (maximum 1€ per order row)',\r\n DefaultPercentIossVatFee = 'Default IOSS VAT fee (1€ per order row)',\r\n EnionIossVatFee = 'Enion IOSS VAT fee (10% or max 0.75€ per order row)',\r\n NoAdvancedFees = 'null',\r\n}\r\n\r\nexport const companyOnboardingStatusOrder = [\r\n 0,\r\n 1,\r\n 6,\r\n 7,\r\n 2,\r\n 3,\r\n 5,\r\n 4,\r\n];\r\n\r\nexport enum CompanyOnboardingStatus {\r\n Onboarding = 0,\r\n OnboardingComplete = 1,\r\n InvoiceSent = 2,\r\n InvoicePaid = 3,\r\n IossNumberSet = 4,\r\n IossNumberRequested = 5,\r\n ERPCustomerCreated = 6,\r\n InvoiceCreated = 7,\r\n}\r\n\r\nexport enum CompanyIossStatus {\r\n None = 0,\r\n ReadyForIoss = 1,\r\n IossNumberRequested = 2,\r\n IossNumberSet = 3,\r\n IossNumberRevoked = 4,\r\n IossNumberExpired = 5,\r\n}\r\n\r\nexport const paymentTerms = [7, 10, 30, 60, 90];\r\n\r\nexport enum StatementPaymentProvider{\r\n None = 0,\r\n Plusius = 1,\r\n}\r\nexport interface Billing {\r\n id: string;\r\n paymentTerm?: PaymentTerm;\r\n currencyCode?: string;\r\n invoiceEmailAddresses?: BillingInformationEmailAddress [];\r\n optionalReference?: string,\r\n customerNumber: number;\r\n statementPaymentProvider: StatementPaymentProvider;\r\n iban?: string;\r\n bicSwift?: string;\r\n}\r\n\r\nexport interface BillingInformationEmailAddress {\r\n id?: string,\r\n emailAddress: string\r\n}\r\n\r\nexport interface CompanyBackendModel {\r\n id: string;\r\n name?: string;\r\n number?: string;\r\n vatNumber?: string;\r\n email?: string;\r\n soleTrader: boolean,\r\n addresses: Address[];\r\n companyWebShops?: WebShop[];\r\n companyContacts?: CompanyContact[];\r\n companyCompanyRelationships?: CompanyCompanyRelationships[];\r\n phones?: Phone[];\r\n web?: string;\r\n urlPrefix?: string;\r\n billingInformation: Billing;\r\n companyCategories: CompanyCategory[];\r\n validationIssues?: string[];\r\n addedUtc?: string;\r\n activeCompanySubscriptionModules?: SubscriptionModule[];\r\n revokedUtc?: string;\r\n listOfTransportCarriers?: string; // Merchant\r\n estimateDailyShipments?: number; // Merchant\r\n eCommercePlatform?: string // Merchant\r\n iossNumber?: string; // Merchant\r\n iossComment?: string; // Merchant\r\n iossStartDate?: string; // Merchant\r\n iossEndDate?: string; // Merchant\r\n iossNumberHistory?: string [];\r\n referrerCompanyId?: string;\r\n iossAdvancedFeeName?: string;\r\n paymentTerm?: PaymentTerm;\r\n customerNumber: string;\r\n onboardingStatus: CompanyOnboardingStatus;\r\n crmCompanyType: CrmCompanyType;\r\n companyAccountManagers: CompanyAccountManager[];\r\n webhookUpdatesUrl?: string;\r\n webhookUpdatesUrlToken?: string;\r\n hasCompanyNotes: boolean;\r\n hasActiveAutoDebit: boolean;\r\n iossStatus: CompanyIossStatus;\r\n advancedFees?: AdvancedFee[];\r\n}\r\n\r\nexport interface CreateCompany {\r\n name: string\r\n email: string\r\n companyCategories: CompanyCategory[];\r\n crmCompanyType: CrmCompanyType;\r\n}\r\n\r\n// Partial company is used in lists for example\r\nexport interface PartialCompany extends Pick<\r\nCompanyBackendModel,\r\n'id'\r\n| 'email'\r\n| 'addedUtc'\r\n| 'revokedUtc'\r\n| 'companyCategories'\r\n| 'validationIssues'\r\n| 'iossNumber'\r\n| 'iossComment'\r\n| 'iossNumberHistory'\r\n| 'customerNumber'\r\n| 'onboardingStatus'\r\n| 'name'\r\n| 'estimateDailyShipments'\r\n| 'iossAdvancedFeeName'\r\n| 'eCommercePlatform'\r\n| 'crmCompanyType'\r\n| 'companyAccountManagers'\r\n| 'hasCompanyNotes'\r\n| 'hasActiveAutoDebit'\r\n| 'iossStatus'\r\n| 'companyContacts'\r\n| 'advancedFees'\r\n> {}\r\n\r\n// Company frontend model\r\nexport interface Company extends Omit {\r\n // Assigning the different address types to specific properties\r\n // because it's easier to work with and at the moment a company cannot\r\n // add multiple addresses of the same type.\r\n postalAddress?: Address,\r\n invoiceBillingAddress?: Address,\r\n visitAddress?: Address,\r\n}\r\n\r\nexport enum CompanyContactType {\r\n NotSelected = 'NotSelected',\r\n Billing = 'Billing',\r\n Technical = 'Technical',\r\n Operational = 'Operational',\r\n Director = 'Director',\r\n BeneficialOwner = 'BeneficialOwner',\r\n}\r\n\r\nexport interface CompanyContact {\r\n id?: string;\r\n contactTitle?: string,\r\n firstName?: string;\r\n lastName?: string;\r\n personalId?: string,\r\n ownerPercentage?: number,\r\n nationality?: string,\r\n email?: string;\r\n emailStatus?: EmailStatus;\r\n phone?: string;\r\n companyContactTypes?: CompanyContactType [];\r\n amlKybDocuments?: AmlKybDocument [],\r\n addresses?: Address[];\r\n}\r\n\r\nexport enum EmailStatus {\r\n NoVerificationNeeded = 'NoVerificationNeeded',\r\n NotVerified = 'NotVerified',\r\n Verified = 'Verified',\r\n}\r\n\r\nexport interface CompanyCompanyRelationships {\r\n id?: string;\r\n companyName?: string;\r\n companyId?: string;\r\n}\r\n\r\nexport enum AddressType {\r\n Visit = 'Visit',\r\n Postal = 'Postal',\r\n InvoiceBilling = 'InvoiceBilling',\r\n}\r\n\r\nexport interface Address {\r\n id: string;\r\n addressTypes: AddressType[];\r\n addressLine1: string;\r\n addressLine2: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n countryCode: string;\r\n}\r\n\r\nexport enum PhoneType {\r\n NotNoneSelected = 0,\r\n CompanyMain = 1,\r\n Direct = 2,\r\n Mobile = 3,\r\n}\r\n\r\nexport interface Phone {\r\n phoneId?: string;\r\n phoneType: PhoneType;\r\n number: string;\r\n}\r\n\r\nexport interface ZuluCustomer{\r\n customerReference: string;\r\n companyName: string;\r\n companyId: string;\r\n publicUrl: string;\r\n streetAddress: string;\r\n zipCode: string;\r\n countryCode: string;\r\n}\r\n\r\nexport interface CompanyEmail{\r\n to: string;\r\n isSent: boolean;\r\n body?: string;\r\n subject?: string;\r\n}","import { omit } from 'ramda';\r\nimport { isObjKeysEmpty } from 'utility';\r\nimport {\r\n CompanyBackendModel,\r\n Company,\r\n Address,\r\n AddressType,\r\n} from './interfaces';\r\n\r\nexport const companyToCompanyBackendModel = (\r\n company: Company\r\n): CompanyBackendModel => {\r\n const addresses: Address[] = [];\r\n\r\n !isObjKeysEmpty(company?.postalAddress || {})\r\n && addresses.push({\r\n ...company.postalAddress!,\r\n addressTypes: [AddressType.Postal],\r\n });\r\n\r\n !isObjKeysEmpty(company?.invoiceBillingAddress || {})\r\n && addresses.push({\r\n ...company.invoiceBillingAddress!,\r\n addressTypes: [AddressType.InvoiceBilling],\r\n });\r\n\r\n !isObjKeysEmpty(company?.visitAddress || {})\r\n && addresses.push({\r\n ...company.visitAddress!,\r\n addressTypes: [AddressType.Visit],\r\n });\r\n\r\n return {\r\n ...omit(\r\n ['postalAddress', 'invoiceBillingAddress', 'visitAddress'],\r\n company\r\n ),\r\n addresses: addresses,\r\n };\r\n};\r\n\r\nexport const companyBackendModelToCompany = (\r\n companyBackendModel: CompanyBackendModel\r\n): Company => ({\r\n ...omit(['addresses'], companyBackendModel),\r\n postalAddress: findAddress(AddressType.Postal, companyBackendModel) || ({} as Address),\r\n invoiceBillingAddress: findAddress(AddressType.InvoiceBilling, companyBackendModel) || ({} as Address),\r\n visitAddress: findAddress(AddressType.Visit, companyBackendModel) || ({} as Address),\r\n});\r\n\r\nconst findAddress = (\r\n addressType: AddressType,\r\n companyBackendModel: CompanyBackendModel\r\n) => companyBackendModel.addresses\r\n .find((address) => (address.addressTypes || []).includes(addressType));\r\n","export interface EntityNote {\r\n id: string,\r\n message: string,\r\n createdByFullName: string,\r\n createdUtc: Date,\r\n entityNoteType: SystemNoteType | UserNoteType,\r\n collectionInvoiceId?: string;\r\n collectionInvoiceNumber?: string;\r\n entityNoteUserTags: EntityNoteUserTag[];\r\n entityNoteCategory: NoteCategory\r\n companyId: string;\r\n entityNoteReference?: string;\r\n}\r\n\r\nexport enum UserNoteType {\r\n Note = 'Note',\r\n Support = 'Support',\r\n Meeting = 'Meeting',\r\n Phonecall = 'Phonecall',\r\n Email = 'Email',\r\n Other = 'Other',\r\n}\r\n\r\nexport enum SystemNoteType {\r\n Invite = 'Invite',\r\n}\r\n\r\nexport interface EntityNoteUserTag {\r\n id: string;\r\n userId: string;\r\n fullName: string;\r\n entityNoteId: string;\r\n email: string;\r\n}\r\n\r\nexport interface EntityNoteGroup {\r\n entityId: string;\r\n groupName: string;\r\n notes: EntityNote[];\r\n}\r\n\r\nexport enum NoteCategory {\r\n Company = 'Company',\r\n Invoice = 'Invoice',\r\n Order = 'Order',\r\n Master= 'Master',\r\n}","import {\r\n CompanyBackendModel,\r\n Company,\r\n PartialCompany,\r\n ZuluCustomer,\r\n CompanyIdAndName,\r\n} from './interfaces';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\nimport {\r\n companyBackendModelToCompany,\r\n companyToCompanyBackendModel,\r\n} from './companyTransformer';\r\nimport { ActiveStatus } from '..';\r\n\r\nexport const getCompaniesUserCanAccess = () =>\r\n apiFetch(`/companies?activeStatus=${ActiveStatus.All}`);\r\n\r\nexport const getCompany = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}`)\r\n .then(companyBackendModelToCompany);\r\n\r\nexport const putCompany = (company: Company) =>\r\n apiFetch(\r\n `/companies/${company.id}`,\r\n companyToCompanyBackendModel(company),\r\n HTTPMethod.PUT\r\n ).then(companyBackendModelToCompany);\r\n\r\nexport const syncOnboardingStatus = () =>\r\n apiFetch('/companies/syncOnboardingStatus', undefined, HTTPMethod.PUT);\r\n\r\nexport const addPlusiusCustomer = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/zuluCustomer`, undefined, HTTPMethod.POST);\r\n\r\nexport const updatePlusiusCustomer = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/zuluCustomer`, undefined, HTTPMethod.PUT);\r\n\r\nexport const getCompanyIossNumberHistory = (companyId: string): Promise =>\r\n apiFetch(`/companies/${companyId}/iossNumberHistory`);\r\n\r\nexport const getCompaniesIdsAndNames = (): Promise =>\r\n apiFetch('/companies/companiesIdsAndNames');","import { useEffect, useMemo } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport {\r\n Company,\r\n putCompany,\r\n} from 'integrations/crossborderit';\r\nimport {\r\n AsyncStatus,\r\n selectCompany,\r\n setCompany,\r\n loadCompany,\r\n} from 'store';\r\nimport { useUserPreferences } from '../userPreferences/useUserPreferences';\r\n\r\nexport const useCompany = (companyId: string) => {\r\n const dispatch = useDispatch();\r\n const { status, company } = useSelector(selectCompany(companyId));\r\n const { formatCompanyName, status: userPreferencesStatus } = useUserPreferences();\r\n\r\n const formattedCompany = useMemo(() => ({ ...company, name: formatCompanyName(company?.name || '') })\r\n , [company, formatCompanyName]);\r\n\r\n const updateCompany = (updatedCompanyFields: Partial) =>\r\n putCompany({ ...company, ...updatedCompanyFields})\r\n .then(updatedCompany => {\r\n dispatch(setCompany(updatedCompany.id, AsyncStatus.Success, updatedCompany));\r\n return updatedCompany;\r\n }\r\n );\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized && userPreferencesStatus !== AsyncStatus.NotInitialized) return;\r\n companyId\r\n ? dispatch(loadCompany(companyId))\r\n : dispatch(setCompany(companyId, AsyncStatus.Error));\r\n }, [dispatch, companyId, status, userPreferencesStatus]);\r\n\r\n return {\r\n status,\r\n company : formattedCompany,\r\n updateCompany,\r\n };\r\n};\r\n","import { useCallback, useEffect, useMemo } from 'react';\r\nimport { useCrossborderitApi } from '../useCrossborderitApi';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, setAsyncResource, selectAsyncResource } from 'store';\r\nimport { Company, CreateCompany, CompanyBackendModel } from './interfaces';\r\nimport { HTTPMethod } from 'integrations/crossborderit/fetch';\r\nimport { replaceBy } from 'utility';\r\nimport { PartialCompany, getCompaniesUserCanAccess } from 'integrations/crossborderit';\r\nimport { companyBackendModelToCompany } from './companyTransformer';\r\nimport { equals } from 'ramda';\r\nimport { useUserPreferences } from '../userPreferences/useUserPreferences';\r\n\r\nexport const partialCompaniesStorePath = ['companiesUserCanAccess'];\r\n\r\nexport const useCompanies = () => {\r\n const { api } = useCrossborderitApi();\r\n const dispatch = useDispatch();\r\n const { loadUserPreferences, formatCompanyName, status: userPreferencesStatus } = useUserPreferences();\r\n\r\n const {\r\n data: companies = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], partialCompaniesStorePath), equals);\r\n\r\n const inactiveCompanies = useMemo(\r\n () => companies.filter(company => company.revokedUtc).map((company) => ({ ...company, name: formatCompanyName(company?.name ?? '') })),\r\n [companies, formatCompanyName]\r\n );\r\n\r\n const activeCompanies = useMemo(\r\n () => companies.filter(company => !company.revokedUtc).map((company) => ({ ...company, name: formatCompanyName(company?.name ?? '') })),\r\n [companies, formatCompanyName]\r\n );\r\n\r\n const loadCompanies = useCallback(() =>\r\n getCompaniesUserCanAccess()\r\n .then(companies => dispatch(setAsyncResource(\r\n partialCompaniesStorePath,\r\n AsyncStatus.Success,\r\n companies\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n partialCompaniesStorePath,\r\n AsyncStatus.Error,\r\n []\r\n )))\r\n , [dispatch]);\r\n\r\n const createCompany = useCallback((company: CreateCompany) =>\r\n api('/companies/', company, HTTPMethod.POST)\r\n .then(company => dispatch(setAsyncResource(\r\n partialCompaniesStorePath,\r\n AsyncStatus.Success,\r\n [...companies, company]\r\n ))), [api, companies, dispatch]);\r\n\r\n const inactivateCompany = useCallback((companyId: string) =>\r\n api(`/companies/${companyId}/inactivate`, undefined, HTTPMethod.PUT)\r\n .then(companyBackendModelToCompany)\r\n .then(company => dispatch(setAsyncResource(\r\n partialCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', company, companies)\r\n )))\r\n , [api, companies, dispatch]);\r\n\r\n const reactivateCompany = useCallback((companyId: string) =>\r\n api(`/companies/${companyId}/reactivate`, undefined, HTTPMethod.PUT)\r\n .then(companyBackendModelToCompany)\r\n .then(company => dispatch(setAsyncResource(\r\n partialCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', company, companies)\r\n )))\r\n , [api, companies, dispatch]);\r\n\r\n const updateCompaniesState = useCallback((updatedCompany: Company) =>\r\n dispatch(setAsyncResource(\r\n partialCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', updatedCompany, companies)\r\n ))\r\n , [companies, dispatch]);\r\n\r\n const formattedCompanyNames = useMemo(() => companies.map((company) => ({ ...company, name: formatCompanyName(company?.name ?? '') })), [companies, formatCompanyName]);\r\n\r\n useEffect(() => {\r\n let didCancel = false;\r\n if (didCancel) return;\r\n if (userPreferencesStatus === AsyncStatus.Success && status !== AsyncStatus.NotInitialized) {\r\n loadCompanies();\r\n } else if (userPreferencesStatus === AsyncStatus.NotInitialized && !didCancel) {\r\n loadUserPreferences();\r\n }\r\n return () => {\r\n didCancel = true;\r\n };\r\n }, [status, loadCompanies, userPreferencesStatus, loadUserPreferences]);\r\n\r\n return {\r\n companies: formattedCompanyNames,\r\n inactiveCompanies,\r\n activeCompanies,\r\n inactivateCompany,\r\n reactivateCompany,\r\n status,\r\n createCompany,\r\n loadCompanies,\r\n updateCompaniesState,\r\n };\r\n};\r\n","import {\r\n EntityNote, EntityNoteGroup,\r\n} from './interfaces';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getEntityNotes = (entityId: string, companyId?: string): Promise =>\r\n apiFetch(`/EntityNotes/${entityId}${!!companyId ? `?companyId=${companyId}` : ''\r\n }`);\r\n\r\nexport const createEntityNote = (entityId: string, entityNote: EntityNote): Promise =>\r\n apiFetch(`/EntityNotes/${entityId}`, entityNote, HTTPMethod.POST);\r\n\r\nexport const editEntityNote = (entityId: string, entityNote: EntityNote): Promise =>\r\n apiFetch(`/EntityNotes/${entityId}/${entityNote.id}`, entityNote, HTTPMethod.PUT);\r\n\r\nexport const revokeEntityNote = (entityId: string, noteId: string) =>\r\n apiFetch(`/EntityNotes/${entityId}/${noteId}/revoke`, undefined, HTTPMethod.PUT);\r\n\r\nexport const GetEntityNotesTaggedWithUserId = (userId: string | null = '', limit: number = 10) =>\r\n apiFetch(`/EntityNotes/userTagged?userId=${userId}&limit=${limit}`, undefined, HTTPMethod.GET);","import { useCallback, useMemo } from 'react';\r\nimport { EntityNote, EntityNoteUserTag } from './interfaces';\r\n\r\nexport const useNoteMentions = () => {\r\n const mentionRegex = useMemo(() => /@\\[.+?\\]\\(.+?\\)/gm, []);\r\n\r\n const getMentionsFromNote = useCallback((note: string) => {\r\n const displayRegex = /@\\[.+?\\]/g;\r\n const idRegex = /\\(.+?\\)/g;\r\n const matches = note.match(mentionRegex);\r\n const mentions: EntityNoteUserTag[] = [];\r\n matches && matches.forEach((m: any) => {\r\n const id = m\r\n .match(idRegex)[0]\r\n .replace('(', '')\r\n .replace(')', '');\r\n const display: string = m\r\n .match(displayRegex)[0]\r\n .replace('@[', '')\r\n .replace(']', '');\r\n mentions.push({ userId: id, fullName: display } as EntityNoteUserTag);\r\n });\r\n return mentions;\r\n }, [mentionRegex]);\r\n\r\n const getNoteOutput = useCallback((note: EntityNote) => {\r\n if (note.message && note.message !== '') {\r\n const mentions = getMentionsFromNote(note.message);\r\n const users = note.entityNoteUserTags;\r\n const newNote = note.message.split(mentionRegex);\r\n let output = '';\r\n for (let i = 0; i < newNote.length; i += 1) {\r\n const n = newNote[i];\r\n if (i === newNote.length - 1) output += n;\r\n else {\r\n const user = users.find(_ => _.userId === mentions[i].userId);\r\n output += `${n}${user?.fullName}`;\r\n }\r\n }\r\n return output.replace(/\\n\\r?/g, '
');\r\n }\r\n }, [getMentionsFromNote, mentionRegex]);\r\n\r\n return {\r\n getMentionsFromNote,\r\n getNoteOutput,\r\n };\r\n};","export interface Country {\r\n alpha2Code: string;\r\n name: string;\r\n alpha3Code: string;\r\n currencyCode?: string;\r\n}\r\n\r\nexport interface CountryData {\r\n id?: string;\r\n countryDataType: CountryDataType;\r\n text: string;\r\n value: string;\r\n}\r\n\r\nexport enum CountryDataType {\r\n CustomsHsCodeUrl = 'CustomsHsCodeUrl',\r\n}\r\n","import { apiFetch } from '../fetch';\r\nimport { Currency } from './interfaces';\r\n\r\nexport const getCurrencies = (): Promise => apiFetch('/PageOptions/Currencies');\r\n","import { Country, CountryData } from './interfaces';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getCountries = () => apiFetch('/PageOptions/Countries');\r\n\r\nexport const getCountryCustomsLink = (countryCode: string) => apiFetch(`/countries/${countryCode}/data/customshscodeurls`);\r\n\r\nexport const postCountryData = (countryCode: string, countryData: CountryData) => apiFetch(`/countries/${countryCode}/data`, countryData, HTTPMethod.POST);\r\n\r\nexport const getAllDataForCountry = (countryCode: string) => apiFetch(`/countries/${countryCode}/data`);\r\n\r\nexport const putCountryData = (countryCode: string, countryData: CountryData, countryDataId: string) =>\r\n apiFetch(`/countries/${countryCode}/data/${countryDataId}`, countryData, HTTPMethod.PUT);\r\n\r\nexport const deleteCountryData = (countryCode: string, countryDataId: string) => apiFetch(`/countries/${countryCode}/data/${countryDataId}`, undefined, HTTPMethod.DELETE);\r\n","export interface Customer {\r\n id: string;\r\n companyId: string;\r\n companyName: string;\r\n companyIsActive: boolean;\r\n companyCompanyRoles: string[];\r\n companyCategories: string[];\r\n iossNumber: string;\r\n iossEndDate?: string;\r\n}\r\n\r\nexport enum ActiveStatus {\r\n Active = 1,\r\n Inactive = 2,\r\n All = 3,\r\n}","import { useCallback, useEffect } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport {\r\n Country,\r\n getCountries,\r\n} from 'integrations/crossborderit';\r\nimport { equals, memoizeWith, identity } from 'ramda';\r\n\r\nexport const countriesStorePath = ['countries'];\r\n\r\nexport const useCountries = () => {\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n data: countries = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], countriesStorePath), equals);\r\n\r\n const loadCountries = useCallback(() => {\r\n dispatch(setAsyncResource(\r\n countriesStorePath,\r\n AsyncStatus.Loading,\r\n countries\r\n ));\r\n\r\n return getCountries()\r\n .then(countries => dispatch(setAsyncResource(\r\n countriesStorePath,\r\n AsyncStatus.Success,\r\n countries\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n countriesStorePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n\r\n }, [countries, dispatch]);\r\n\r\n const selectCountryBy = useCallback((prop: keyof Country, value: string) => {\r\n const findCountry = memoizeWith(identity, (value: string):\r\n | Country\r\n | undefined => countries.find((country) => country[prop] === value));\r\n return findCountry(value);\r\n }, [countries]);\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized) return;\r\n loadCountries();\r\n }, [status, loadCountries]);\r\n\r\n return {\r\n countries,\r\n status,\r\n loadCountries,\r\n selectCountryBy,\r\n };\r\n};","import { useCallback, useEffect, useMemo } from 'react';\r\nimport { useCrossborderitApi } from '../useCrossborderitApi';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { ActiveStatus, Customer } from './interfaces';\r\nimport { HTTPMethod } from 'integrations/crossborderit/fetch';\r\nimport { removeById, replaceBy } from 'utility';\r\nimport { useUserPreferences } from '../userPreferences/useUserPreferences';\r\n\r\nexport const useCustomers = (companyId: string) => {\r\n const storePath = useMemo(() => ['companyCustomers', companyId], [companyId]);\r\n const { api } = useCrossborderitApi();\r\n const dispatch = useDispatch();\r\n const { loadUserPreferences, formatCompanyName, status: userPreferencesStatus } = useUserPreferences();\r\n\r\n const {\r\n data: customers = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], storePath));\r\n\r\n const inactiveCustomers = useMemo(\r\n () => customers.filter(customer => !customer.companyIsActive).map((customer) => ({ ...customer, name: formatCompanyName(customer.companyName ?? ''), companyName: formatCompanyName(customer.companyName ?? '') })),\r\n [customers, formatCompanyName]\r\n );\r\n\r\n const activeCustomers = useMemo(\r\n () => customers.filter(customer => customer.companyIsActive).map((customer) => ({ ...customer, name: formatCompanyName(customer.companyName ?? ''), companyName: formatCompanyName(customer.companyName ?? '') })),\r\n [customers, formatCompanyName]\r\n );\r\n\r\n const formattedCompanyNames = useMemo(() => customers.map((customer) => ({ ...customer, name: formatCompanyName(customer.companyName ?? ''), companyName: formatCompanyName(customer.companyName ?? '') })), [customers, formatCompanyName]);\r\n\r\n const loadCustomers = useCallback((activeStatus: ActiveStatus) => {\r\n if (!companyId) return;\r\n\r\n dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Loading,\r\n []\r\n ));\r\n\r\n api(`/companies/${companyId}/relationships?activeStatus=${activeStatus}`)\r\n .then(customers => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n customers\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n }, [api, dispatch, storePath, companyId]);\r\n\r\n const loadCustomer = useCallback((customerId: string) =>\r\n api(`/companies/${companyId}/relationships/${customerId}`)\r\n .then(customer => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', customer, customers)\r\n )))\r\n , [api, dispatch, storePath, companyId, customers]);\r\n\r\n const createCustomer = useCallback((customer: Customer) =>\r\n api(`/companies/${companyId}/relationships`, customer, HTTPMethod.POST)\r\n .then(newCustomer => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n [newCustomer, ...customers]\r\n )))\r\n , [api, dispatch, storePath, companyId, customers]);\r\n\r\n const inactivateCustomer = useCallback((customerId: string) =>\r\n api(`/companies/${companyId}/relationships/${customerId}/inactivate`, undefined, HTTPMethod.PUT)\r\n .then(() => loadCustomer(customerId))\r\n , [api, companyId, loadCustomer]);\r\n\r\n const reactivateCustomer = useCallback((customerId: string) =>\r\n api(`/companies/${companyId}/relationships/${customerId}/reactivate`, undefined, HTTPMethod.PUT)\r\n .then(() => loadCustomer(customerId))\r\n , [api, companyId, loadCustomer]);\r\n\r\n const addCompanyCompanyRelationship = useCallback((customer: Customer) =>\r\n api(`/companies/${companyId}/relationships/add`, customer, HTTPMethod.POST)\r\n .then(newCustomer => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n [newCustomer, ...customers]\r\n )))\r\n , [api, dispatch, storePath, companyId, customers]);\r\n\r\n const removeCompanyCompanyRelationship = useCallback((relationshipId: string) =>\r\n api(`/companies/${companyId}/relationships/${relationshipId}`, undefined, HTTPMethod.DELETE)\r\n .then(() => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n removeById(relationshipId, customers)\r\n )))\r\n , [api, dispatch, storePath, companyId, customers]);\r\n\r\n useEffect(() => {\r\n let didCancel = false;\r\n if (didCancel) return;\r\n if (userPreferencesStatus === AsyncStatus.Success && status === AsyncStatus.NotInitialized) {\r\n loadCustomers(ActiveStatus.All);\r\n } else if (userPreferencesStatus === AsyncStatus.NotInitialized && !didCancel) {\r\n loadUserPreferences();\r\n }\r\n return () => {\r\n didCancel = true;\r\n };\r\n }, [status, loadCustomers, userPreferencesStatus, loadUserPreferences]);\r\n\r\n return {\r\n status,\r\n customers: formattedCompanyNames || [],\r\n activeCustomers,\r\n inactiveCustomers,\r\n loadCustomers,\r\n loadCustomer,\r\n createCustomer,\r\n inactivateCustomer,\r\n reactivateCustomer,\r\n addCompanyCompanyRelationship,\r\n removeCompanyCompanyRelationship,\r\n };\r\n\r\n};\r\n","import { useState, useEffect } from 'react';\r\nimport { Dropin, create as createDropinInstance } from 'braintree-web-drop-in';\r\nimport {\r\n getPayPalClientToken,\r\n putPayPalPaymentNonce,\r\n createPayPalPayment,\r\n} from 'integrations/crossborderit';\r\n\r\nexport enum BraintreeDropinStatus {\r\n Error = 'Error',\r\n Loading = 'Loading',\r\n Idle = 'Idle',\r\n}\r\nexport enum TypeOfCharge {\r\n TaxAmount = 1,\r\n TaxExempty = 2,\r\n}\r\n\r\nexport const useBraintree = (companyId: string, containerSelector: string) => {\r\n const [status, setStatus] = useState(BraintreeDropinStatus.Loading);\r\n const [braintreeInstance, setBraintreeInstance] = useState();\r\n const [isBillingMethodValid, setIsBillingMethodValid] = useState(false);\r\n const [threeDSecureParameters] = useState(Object);\r\n const [nonce, setNonce] = useState();\r\n\r\n const updateBillingMethod = () => !braintreeInstance\r\n ? Promise.reject(new Error('Braintree instance not initialized'))\r\n : braintreeInstance.requestPaymentMethod()\r\n .then(payload => putPayPalPaymentNonce(companyId, payload.nonce).then(() => { setNonce(payload.nonce); }));\r\n\r\n const createPayment = (invoiceId: string) => !braintreeInstance\r\n ? Promise.reject(new Error('Braintree instance not initialized'))\r\n : braintreeInstance.requestPaymentMethod()\r\n .then(payload => createPayPalPayment(companyId, payload.nonce, invoiceId).then(() => setNonce(payload.nonce)));\r\n\r\n useEffect(() => {\r\n let didCancel = false;\r\n setStatus(BraintreeDropinStatus.Loading);\r\n const braintreeConfiguration = {\r\n container: containerSelector,\r\n //threeDSecure: true,\r\n // card: false,\r\n paypal: {\r\n flow: 'vault' as 'vault', // I don't understand it either\r\n currency: 'EUR',\r\n },\r\n\r\n };\r\n\r\n getPayPalClientToken(companyId)\r\n .then(payPalClientToken => {\r\n if (didCancel) return;\r\n setStatus(BraintreeDropinStatus.Idle);\r\n return createDropinInstance({\r\n ...braintreeConfiguration,\r\n authorization: payPalClientToken,\r\n });\r\n })\r\n .then(braintreeInstance => setBraintreeInstance(braintreeInstance))\r\n .catch(() => {\r\n if (didCancel) return;\r\n setStatus(BraintreeDropinStatus.Error);\r\n\r\n });\r\n\r\n return () => {\r\n didCancel = true;\r\n };\r\n }, [containerSelector, companyId, nonce]);\r\n\r\n useEffect(() => {\r\n if (!braintreeInstance) return;\r\n\r\n if (braintreeInstance?.isPaymentMethodRequestable()) {\r\n setIsBillingMethodValid(true);\r\n } else {\r\n setIsBillingMethodValid(false);\r\n }\r\n const enableNextButton = () => setIsBillingMethodValid(true);\r\n const disableNextButton = () => setIsBillingMethodValid(false);\r\n braintreeInstance.on('paymentMethodRequestable', enableNextButton);\r\n braintreeInstance.on('noPaymentMethodRequestable', disableNextButton);\r\n\r\n const unsubscribe = () => {\r\n if (!braintreeInstance) return;\r\n braintreeInstance.off('paymentMethodRequestable', enableNextButton);\r\n braintreeInstance.off('noPaymentMethodRequestable', disableNextButton);\r\n };\r\n\r\n return unsubscribe;\r\n }, [braintreeInstance]);\r\n\r\n return {\r\n status,\r\n isBillingMethodValid,\r\n instance: braintreeInstance,\r\n updateBillingMethod,\r\n createPayment,\r\n threeDSecureParameters,\r\n };\r\n\r\n};\r\n","import { Employee } from '.';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getEmployees = (): Promise =>\r\n apiFetch('/UserEmployees', undefined, HTTPMethod.GET);\r\n","import { useCallback, useEffect } from 'react';\r\nimport { useCrossborderitApi } from '../useCrossborderitApi';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\n\r\nconst storePath = ['industryNews'];\r\n\r\nexport const useIndustryNews = () => {\r\n const { api } = useCrossborderitApi();\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n status = AsyncStatus.NotInitialized,\r\n data: industryNews = [],\r\n } = useSelector(selectAsyncResource([], storePath));\r\n\r\n const loadIndustryNews = useCallback(() => {\r\n api('/industry-news')\r\n .then(industryNews => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n industryNews\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n }, [api, dispatch]);\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized) return;\r\n loadIndustryNews();\r\n }, [status, loadIndustryNews]);\r\n\r\n return {\r\n status,\r\n industryNews,\r\n loadIndustryNews,\r\n };\r\n\r\n};\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { Invitation } from './interfaces';\r\n\r\nexport const getCompanyInvitations = () =>\r\n apiFetch('/onboardings');\r\n\r\nexport const postInvitation = (onboarding: Invitation) =>\r\n apiFetch('/onboardings', onboarding, HTTPMethod.POST);\r\n\r\nexport const putInvitation = (onboarding: Invitation) =>\r\n apiFetch(`/onboardings/${onboarding.id}`, onboarding, HTTPMethod.PUT);\r\n\r\nexport const deleteInvitation = (id : string) =>\r\n apiFetch(`/onboardings/${id}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const resendInvitation = (id : string) =>\r\n apiFetch(`/onboardings/${id}/resend`, undefined, HTTPMethod.PUT);\r\n\r\nexport const reactivateInvitation = (id : string) =>\r\n apiFetch(`/onboardings/${id}/reactivate`, undefined, HTTPMethod.PUT);\r\n\r\nexport const inactivateInvitation = (id : string) =>\r\n apiFetch(`/onboardings/${id}/inactivate`, undefined, HTTPMethod.PUT);\r\n","import { apiFetch, HTTPMethod } from 'integrations/crossborderit/fetch';\r\n\r\nexport const getPayPalClientToken = (companyId: string) =>\r\n apiFetch<{ clientToken: string }>(`/companies/${companyId}/payments/GetClientToken/PayPal`)\r\n .then((data) => data?.clientToken);\r\n\r\nexport const putPayPalPaymentNonce = (companyId: string, nonce: string) =>\r\n apiFetch(\r\n `/companies/${companyId}/payments/PayPal?accessToken=${nonce}`,\r\n undefined,\r\n HTTPMethod.PUT\r\n );\r\n\r\nexport const createPayPalPayment = (companyId: string, paymentMethodNonce: string, invoiceId: string) =>\r\n apiFetch(\r\n `/companies/${companyId}/payments/PayPalPayment?invoiceId=${invoiceId}&paymentMethodNonce=${paymentMethodNonce}`,\r\n undefined,\r\n HTTPMethod.PUT\r\n );\r\n","export interface ProductExportOptions {\r\n separator: Separator;\r\n numberFormattingOption: NumberFormat;\r\n}\r\n\r\nexport interface ProductExportPreview {\r\n numberOfProducts: number;\r\n // List which countries that at least one product has been classified for\r\n classificationCountries: string[];\r\n /// Number of products with classification information for a country\r\n /// This list has the same order as the Countries list above\r\n numberOfProductsClassifiedForCountry: number[];\r\n // Oldest updated timestamp that will be exported\r\n oldestDate: string;\r\n // Newest updated timestamp that will be exported\r\n newestDate: string;\r\n}\r\n\r\nexport enum Separator {\r\n Comma = ',',\r\n Semicolon = ';',\r\n}\r\n\r\nexport enum NumberFormat {\r\n DecimalPoint = 0,\r\n DecimalComma = 1,\r\n}\r\n","import download from 'downloadjs';\r\nimport { match, pipe, replace } from 'ramda';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\nimport { Separator, NumberFormat } from './interfaces';\r\n\r\nconst FILENAME = /filename=.+(?=;)/;\r\n\r\nexport const findFilename = pipe(match(FILENAME), ([fileName]) => fileName, replace('filename=', ''));\r\n\r\nexport const exportFile = (companyId: string, importId: string): Promise =>\r\n apiFetch(\r\n `/companies/${companyId}/products/export?importId=${importId}`,\r\n {\r\n separator: Separator.Semicolon,\r\n numberFormattingOption: NumberFormat.DecimalComma,\r\n },\r\n HTTPMethod.PUT\r\n )\r\n .then((response) => (response.ok ? response : Promise.reject()))\r\n .then((response) => response\r\n .blob()\r\n .then((blob) => download(blob, 'exportedProductList.csv'))\r\n .then());\r\n","import { PhoneType } from '..';\r\n\r\nexport enum CompanyUserRole {\r\n CompanyAdmin = 'CompanyAdmin',\r\n User = 'User',\r\n}\r\n\r\nexport interface CompanyUser {\r\n id?: string;\r\n userId?: string;\r\n companyId?: string;\r\n firstName?: string;\r\n lastName?: string;\r\n email?: string;\r\n phones?: Phone[];\r\n workTitle?: string;\r\n companyUserRoles?: CompanyUserRole[];\r\n inheritedUserRoles?: CompanyUserRole[];\r\n effectiveUserRoles?: CompanyUserRole[];\r\n inheritCompanyUserRole?: boolean;\r\n lastLoggedInUtc?: string;\r\n revokedAt?: string;\r\n}\r\n\r\ninterface Phone{\r\n id?: string;\r\n companyId?: string;\r\n phoneType?: PhoneType;\r\n number?: string;\r\n}","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { ProductImportPreviewResult, ProductImportPreviewDecision, ProductImportInfo } from './interfaces';\r\nimport { apiFetchFormData } from 'integrations/crossborderit/fetchFormData';\r\nimport { IossInvoiceJobStatus } from '../iossInvoiceJobs';\r\n\r\n// uploadFile() uploads the file and does some basic verification\r\nexport const uploadFile = (companyId: string, file: any): Promise => {\r\n const formData = new FormData();\r\n formData.append('file', file);\r\n return apiFetchFormData(`/companies/${companyId}/productimport`, formData, HTTPMethod.POST);\r\n};\r\n\r\n// importFile() is used after uploadFile() to confirm or abort the import\r\nexport const importFile = (\r\n companyId: string,\r\n importDecision: ProductImportPreviewDecision\r\n) => apiFetch(\r\n `/companies/${companyId}/productimport`,\r\n importDecision,\r\n HTTPMethod.PUT\r\n);\r\n\r\nexport const getImports = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/productimport`);\r\n\r\nexport const startDeleteProductImportFileJob = (companyId: string, importId: string) =>\r\n apiFetch(`/companies/${companyId}/productimport/${importId}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const getRemoveProductImportFileJobStatus = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/productimport/removeProductImportFileJobStatus`);","import { CompanyUser } from './interfaces';\r\nimport { apiFetch, HTTPMethod, HTTPStatus } from '../fetch';\r\nimport { GeneralTimePeriodType } from '../shared';\r\n\r\nexport const getCompaniesUsersByLastLoggedIn = (generalTimePeriodType: GeneralTimePeriodType) =>\r\n apiFetch(`/users/companiesUsersByLastLogin?generalTimePeriodType=${generalTimePeriodType}`);\r\n\r\nexport const getCompanyUsers = (companyId: string) =>\r\n apiFetch(`/companies/${companyId}/users`);\r\n\r\nexport const getCompanyUser = (companyId: string, companyUserId: string) =>\r\n apiFetch(`/companies/${companyId}/users/${companyUserId}`);\r\n\r\nexport const postCompanyUser = (companyUser: CompanyUser) =>\r\n apiFetch(`/companies/${companyUser.companyId}/users`, companyUser, HTTPMethod.POST);\r\n\r\nexport const putCompanyUser = (companyUser: CompanyUser): Promise =>\r\n apiFetch(`/companies/${companyUser.companyId}/users`, companyUser, HTTPMethod.PUT).then((response) => {\r\n if ('status' in response && response.status === HTTPStatus.NoContent) {\r\n return companyUser;\r\n } else {\r\n return response as CompanyUser;\r\n }\r\n });\r\n\r\nexport const deleteCompanyUser = (companyId: string, companyUserId: string) =>\r\n apiFetch(`/companies/${companyId}/users/${companyUserId}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const sendPasswordResetEmail = (companyId: string, companyUserId: string): Promise =>\r\n apiFetch(`/companies/${companyId}/users/${companyUserId}/SendPasswordReset`, undefined, HTTPMethod.PUT);\r\n\r\nexport const reactivateCompanyUser = (companyId: string, companyUserId: string): Promise =>\r\n apiFetch(`/companies/${companyId}/users/${companyUserId}/Reactivate`, undefined, HTTPMethod.PUT);\r\n","export interface Product {\r\n id: string;\r\n companyId: string;\r\n name: string; // MaxLength 255\r\n description: string; // MaxLength 1000\r\n articleNumber: string; // MaxLength 100, The identity used by the company that the product belongs to.\r\n productCondition: ProductCondition; // Will be set to \"New\" if it does not contain a legal value\r\n shipmentOriginCountryCode?: string; // If set to null, the property of the owning company will be used instead\r\n manufacturedInCountryCode?: string; // Needed for calculation. If set to null, the property of the owning company will be used instead\r\n currencyCode?: string; // If set to null, the property of the owning company will be used instead\r\n itemCost: number; // Decimal, The price of one item of this product.\r\n merchantName: string; // MaxLength 255\r\n commodityType: string; // MaxLength 255\r\n brandOrManufacturer: string; // MaxLength 255\r\n productUrl: string; // MaxLength 255\r\n imageUrl: string; // MaxLength 255\r\n countryOfOriginExportClassificationCode: string; // MaxLength 100\r\n gtin?: string; // GlobalTradeItemNumber\r\n sku?: string; // StockKeepingUnit\r\n ean?: string; // EuropeanArticleNumber, can also be called International Article Number\r\n upc?: string; // UniversalProductCode\r\n mpn?: string; // ManufacturerPartNumber\r\n asin?: string; // AmazonStandardIdentificationNumber\r\n apn?: string; // AustralianProductNumber\r\n isbn?: string; // InternationalStandardBookNumber\r\n readonly lastUpdated: string; // Will be updated by back end.\r\n classificationStatus?: ProductClassificationStatus;\r\n productClassifications?: Classification[];\r\n assignedToFullName?: string;\r\n assignedToId?: string;\r\n confidence?: number;\r\n hsCodeSuggestionByAI?: string;\r\n aiTranslated: boolean;\r\n}\r\n\r\n// PartialProduct is used in the product lists where we don't need all the information\r\nexport interface PartialProduct {\r\n id: string;\r\n companyId: string;\r\n articleNumber: string;\r\n name?: string;\r\n description?: string;\r\n commodityType?: string;\r\n confidence?: number;\r\n hsCode?: string;\r\n hsCodeValidationStatus?: HsCodeValidationStatus;\r\n hsCodeValidationStatusUtcDate?: string;\r\n hsCodeId?: string;\r\n hsCode2?: string;\r\n hsCode2ValidationStatus?: HsCodeValidationStatus;\r\n hsCode2ValidationStatusUtcDate?: string;\r\n hsCode2Id?: string;\r\n hsCode3?: string;\r\n hsCode3ValidationStatus?: HsCodeValidationStatus;\r\n hsCode3ValidationStatusUtcDate?: string;\r\n hsCode3Id?: string;\r\n hsCodeSuggestionByAI?: string;\r\n hsCodeTrade6?: string;\r\n imageUrl?: string;\r\n productUrl?: string;\r\n readonly lastUpdated: string;\r\n readonly updatedBy: string;\r\n shipmentOriginCountryCode?: string;\r\n classificationStatus?: ProductClassificationStatus;\r\n hsCodeTradeTypeExport?: boolean;\r\n hsCodeTradeTypeImport?: boolean;\r\n hsCode2TradeTypeExport?: boolean;\r\n hsCode2TradeTypeImport?: boolean;\r\n hsCode3TradeTypeExport?: boolean;\r\n hsCode3TradeTypeImport?: boolean;\r\n assignedToFullName?: string;\r\n assignedToId?: string;\r\n aiTranslated: boolean;\r\n trade6hsCode?: string;\r\n trade6ValidationStatus?: HsCodeValidationStatus;\r\n trade6ValidationStatusUtcDate?: string;\r\n trade6Id?: string;\r\n created: string;\r\n dutyRate?: number;\r\n taxRate?: number;\r\n netWeightInKg?: number;\r\n grossWeightInKg?: number;\r\n manufacturedInCountry?: string;\r\n brandOrManufacturer?: string;\r\n ean?: string;\r\n}\r\n\r\nexport const countryCodesPossibleToValidate = [\r\n 'AT',\r\n 'BE',\r\n 'BG',\r\n 'HR',\r\n 'CY',\r\n 'CZ',\r\n 'DK',\r\n 'EE',\r\n 'FI',\r\n 'FR',\r\n 'DE',\r\n 'GR',\r\n 'HU',\r\n 'IE',\r\n 'IT',\r\n 'LV',\r\n 'LT',\r\n 'LU',\r\n 'MT',\r\n 'NL',\r\n 'PL',\r\n 'PT',\r\n 'RO',\r\n 'SK',\r\n 'SI',\r\n 'ES',\r\n 'SE',\r\n 'NO',\r\n];\r\n\r\nexport enum HsCodeValidationStatus {\r\n NotValidated = 0,\r\n Invalid = 1,\r\n Valid = 2,\r\n UnableToValidate = 3, //if the hs code data does not meet the pre requirements\r\n ValidationError = 4,\r\n Restricted = 5,\r\n}\r\n\r\nexport enum ProductCondition {\r\n New = 'New',\r\n Used = 'Used',\r\n Refurbished = 'Refurbished',\r\n}\r\n\r\nexport enum ProductQuerySearchMode {\r\n Equals = 'EQUAL',\r\n Contains = 'CONTAINS',\r\n}\r\n\r\nexport interface ProductsQuery {\r\n importId?: string;\r\n country1?: string;\r\n country2?: string;\r\n country3?: string;\r\n filter?: ProductFilter;\r\n sortingColumn?: string;\r\n sortDescending?: boolean;\r\n pageIndex?: number;\r\n pageSize?: number;\r\n totalCount?: number;\r\n totalPages?: number;\r\n hasPreviousPage?: boolean;\r\n hasNextPage?: boolean;\r\n}\r\n\r\nexport interface Search {\r\n textToFind?: string;\r\n columnToSearch?: string;\r\n searchMode?: ProductQuerySearchMode;\r\n}\r\n\r\nexport enum ProductFilter {\r\n All,\r\n Classified,\r\n NotClassified,\r\n}\r\n\r\nexport interface ProductListContainerModel {\r\n productList: PartialProduct[];\r\n totalNumberOfMatchingEntriesInDb: number;\r\n}\r\n\r\nexport interface Classification {\r\n id?: string;\r\n productId: string;\r\n countryCode: string;\r\n hsCode?: string;\r\n importProhibited?: boolean;\r\n importRestricted?: boolean;\r\n readonly classificationMode?: string; // information about how the classification was made.\r\n isTrade6HsCode?: boolean;\r\n dutyRate?: number;\r\n taxRate?: number;\r\n}\r\n\r\nexport interface PartialClassification {\r\n id: string;\r\n countryCode: string;\r\n hsCode: string;\r\n dutyRate: number;\r\n taxRate: number;\r\n}\r\n\r\nexport interface ProductBulkClassification {\r\n countryCode?: string;\r\n hsCode: string;\r\n productId: string;\r\n isTrade6HsCode?: boolean;\r\n}\r\n\r\nexport interface ProductBulkClassificationResponse {\r\n productDetails: ProductBulkClassificationResponseEntry[];\r\n countryCode: string;\r\n isTrade6HsCode?: boolean;\r\n}\r\n\r\nexport interface ProductBulkClassificationResponseEntry {\r\n productId: string;\r\n hsCode: string;\r\n lastUpdated: string;\r\n classificationStatus: ProductClassificationStatus;\r\n validationStatus: HsCodeValidationStatus;\r\n validationStatusDate: string;\r\n productClassificationId: string;\r\n}\r\n\r\nexport enum ProductClassificationStatus {\r\n New = 0,\r\n ProductUpdateRequired = 1,\r\n Pending = 2,\r\n Approved = 3,\r\n AiClassified = 4,\r\n}\r\n\r\nexport interface UpdateStatuses {\r\n UpdateParams: {\r\n Id: string;\r\n ClassificationStatus: ProductClassificationStatus;\r\n }[];\r\n}\r\n\r\nexport interface UpdatedStatus {\r\n id: string;\r\n classificationStatus: ProductClassificationStatus;\r\n classificationStatusDate: string;\r\n lastUpdated: string;\r\n updatedBy: string;\r\n}\r\n\r\nexport interface ValidateHsCodesAsyncResponse {\r\n countryCode: string;\r\n hsCode: string;\r\n productClassificationId: string;\r\n tradeTypeExport?: boolean;\r\n tradeTypeImport?: boolean;\r\n validationStatus: HsCodeValidationStatus;\r\n validationStatusDate: string;\r\n productId: string;\r\n}\r\n\r\nexport interface ProductListInfoHsCodeItem {\r\n countryCode: string;\r\n hsCode: string;\r\n productClassificationId: string;\r\n isGlobalHsCode: boolean;\r\n}\r\n\r\nexport interface SaveValidation {\r\n ProductClassificationId: string;\r\n HsCode: string;\r\n CountryCode: string;\r\n TradeTypeImport?: boolean;\r\n TradeTypeExport?: boolean;\r\n ValidationStatus: HsCodeValidationStatus;\r\n ValidationStatusDate: string;\r\n}\r\n\r\nexport interface HsCodeValidationItem {\r\n HsCode: string;\r\n CountryCode?: string;\r\n TradeTypeImport: boolean;\r\n TradeTypeExport: boolean;\r\n ProductId: string;\r\n IsGlobalHsCode?: boolean;\r\n}\r\n\r\nexport interface ProductClassification {\r\n countryCode: string;\r\n created: string;\r\n createdBy: string;\r\n hsCode: string;\r\n id: string;\r\n importProhibited: boolean;\r\n importRestricted: boolean;\r\n lastUpdated: string;\r\n productId: string;\r\n tradeTypeExport: boolean;\r\n tradeTypeImport: boolean;\r\n updatedBy: string;\r\n validationStatus: HsCodeValidationStatus\r\n validationStatusDate?: string;\r\n}\r\n\r\nexport interface HsCodeValidationBatch {\r\n id: string;\r\n addedUtc: string;\r\n companyId: string;\r\n processedUtc?: string;\r\n productClassifications: ProductClassification[]\r\n}\r\n\r\nexport interface ProductClassificationFromAiQuery {\r\n countryCodesToUpdate?: string;\r\n allCountryCodes: string[];\r\n}","import { HsCodeValidationStatus, PartialProduct, ProductClassificationStatus } from './interfaces';\r\n\r\nexport interface ProductListContainerBackEndModel {\r\n productList: productBackEndModel[];\r\n totalNumberOfMatchingEntriesInDb: number;\r\n}\r\n\r\ninterface productBackEndModel {\r\n id: string; // Id\r\n cId: string; // CompanyId\r\n a: string; // ArticleNumber\r\n n?: string; // Name\r\n d?: string; // Description\r\n c?: string; // CommodityType\r\n cf?: number; //Confidence\r\n hsba?: string; //HsCodeSuggestionByAI\r\n h?: string; // HsCode\r\n hvs?: HsCodeValidationStatus; // HsCodeValidationStatus\r\n hvsd?: string; // HsCodeValidationStatusUtcDate\r\n hId?: string; // HsCodeId\r\n h2?: string; // HsCode2\r\n h2vs?: HsCodeValidationStatus; // HsCode2ValidationStatus\r\n h2vsd: string; // HsCode2ValidationStatusUtcDate\r\n h2Id?: string; // HsCode2Id\r\n h3?: string; // HsCode3\r\n h3vs?: HsCodeValidationStatus; // HsCode3ValidationStatus\r\n h3vsd?: string; // HsCode2ValidationStatusUtcDate\r\n h3Id?: string; // HsCode2Id\r\n i?: string; // ImageUrl\r\n p?: string; // ProductUrl\r\n lu: string; // LastUpdated\r\n ub: string; // UpdatedBy\r\n s?: string; // ShipmentOriginCountryCode\r\n cs?: ProductClassificationStatus; // ClassificationStatus\r\n aTfN?: string; //AssignToFullName\r\n aTi?: string; //AssignedToId\r\n at: boolean; //AiTranslated\r\n t6?: string; //Trade6HsCode\r\n t6vs?: HsCodeValidationStatus; //Trade6ValidationStatus\r\n t6vsd?: string; //Trade6ValidationStatusUtcDate\r\n t6id?: string; //Trade6Id\r\n cr: string; //Created\r\n nw: number; //NetWeightInKg\r\n gw: number; //GrossWeightInKg\r\n mc: string; //ManufacturedInCountry\r\n bom: string; //BrandOrManufacturer\r\n ean: string; //Ean\r\n}\r\n\r\nexport const productListBackendModelToPartialProducts = (productListFromBackEnd: productBackEndModel[]) => {\r\n\r\n const productList: PartialProduct[] = productListFromBackEnd.map((product: productBackEndModel) => ({\r\n id: product.id,\r\n companyId: product.cId,\r\n articleNumber: product.a,\r\n name: product.n,\r\n description: product.d,\r\n commodityType: product.c,\r\n confidence: product.cf,\r\n hsCode: product.h,\r\n hsCodeValidationStatus: product.hvs,\r\n hsCodeValidationStatusUtcDate: product.hvsd,\r\n hsCodeId: product.hId,\r\n hsCode2: product.h2,\r\n hsCode2ValidationStatus: product.h2vs,\r\n hsCode2ValidationStatusUtcDate: product.h2vsd,\r\n hsCode2Id: product.h2Id,\r\n hsCode3: product.h3,\r\n hsCode3ValidationStatus: product.h3vs,\r\n hsCode3ValidationStatusUtcDate: product.h3vsd,\r\n hsCode3Id: product.h3Id,\r\n hsCodeSuggestionByAI: product.hsba,\r\n imageUrl: product.i,\r\n productUrl: product.p,\r\n lastUpdated: product.lu,\r\n updatedBy: product.ub,\r\n shipmentOriginCountryCode: product.s,\r\n classificationStatus: product.cs,\r\n assignedToFullName:product.aTfN,\r\n assignedToId: product.aTi,\r\n aiTranslated: product.at,\r\n trade6hsCode: product.t6,\r\n trade6ValidationStatus: product.t6vs,\r\n trade6ValidationStatusUtcDate: product.t6vsd,\r\n trade6Id: product.t6id,\r\n created: product.cr,\r\n netWeightInKg: product.nw,\r\n grossWeightInKg: product.gw,\r\n manufacturedInCountry: product.mc,\r\n brandOrManufacturer: product.bom,\r\n ean: product.ean,\r\n }));\r\n\r\n return productList;\r\n};","export interface IossImportDataEntryModel {\r\n id: string;\r\n createdTimeStamp: string;\r\n rowIndex: number;\r\n trackingNumber: string;\r\n orderNumber: string;\r\n iossNumber: string;\r\n transactionDate: string;\r\n currency: string;\r\n saleValue: number;\r\n vatAmount: number;\r\n saleValueInEuro: number;\r\n vatAmountInEuro: number;\r\n vatRate: number;\r\n importType: string;\r\n sourceCountryCode: string;\r\n destinationCountryCode: string;\r\n goodsType: any;\r\n isCorrection: boolean;\r\n originalTransactionDate: string;\r\n hasRefund: boolean;\r\n refundEntryId?: string;\r\n}\r\n\r\nexport interface ImportFileListCollection {\r\n fileId: string;\r\n uploadTimestamp: string;\r\n importedBy: string;\r\n rowCount: number;\r\n failedRowCount: number;\r\n documentUrl: string;\r\n cannotBeDeleted: boolean;\r\n iossFailedToImportItems: IossFailedToImportItem[];\r\n filename: string;\r\n uploadedWithApi: boolean;\r\n failedToImport: boolean;\r\n containsCorrectionEntries: boolean;\r\n containsRefundedEntries: boolean;\r\n}\r\n\r\nexport interface IossFailedToImportItem {\r\n rowIndex: number;\r\n orderNumber: number;\r\n errorMessages: string[];\r\n}\r\n\r\nexport interface IossValidationItem {\r\n orderNumber: string;\r\n errorCode: IossValidationErrorCode;\r\n severity: number;\r\n}\r\n\r\nexport enum IossValidationErrorCode {\r\n IncorrectVat = 'INCORRECT_VAT_APPLIED',\r\n}\r\n\r\nexport interface IossOrderRefund {\r\n iossOriginalOrderId: string;\r\n uploadedFile?: File;\r\n iossOrderRefundReason?: string;\r\n}\r\n\r\nexport interface IossOrderRefundDetails {\r\n iossOrderRefundReason?: string;\r\n uploadedFileName?: File;\r\n documentUrl?: string;\r\n}","import { apiFetch } from '../fetch';\r\nimport { PageOptions } from './interfaces';\r\n\r\nexport const getPageOptions = (): Promise => apiFetch('/PageOptions/Enums');\r\n","import * as Api from 'integrations/crossborderit';\r\nimport { useCallback, useEffect } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AsyncStatus, selectPageOptionsData, setPageOptions } from 'store';\r\n\r\nexport const usePageOptions = () => {\r\n const dispatch = useDispatch();\r\n const { pageOptions } = useSelector(selectPageOptionsData);\r\n\r\n const loadPageOptionsData = useCallback(() => {\r\n Api.getPageOptions()\r\n\r\n .then((pageOptions) => {\r\n dispatch(setPageOptions(AsyncStatus.Success, pageOptions));\r\n })\r\n .catch(() => dispatch(setPageOptions(AsyncStatus.Error, [])));\r\n }, [dispatch]);\r\n\r\n useEffect(() => {\r\n if (pageOptions.status !== AsyncStatus.NotInitialized) return;\r\n loadPageOptionsData();\r\n }, [loadPageOptionsData, pageOptions.status]);\r\n\r\n return { pageOptions };\r\n};\r\n","export interface AdvancedFee {\r\n id: string;\r\n name: string;\r\n feeCategory: FeeCategory;\r\n feeFixedAmount: number;\r\n feePercentAmount: number;\r\n minimumAmount: number;\r\n maximumAmount: number;\r\n isActive: boolean;\r\n isDefaultFeeForCategory: boolean;\r\n createdUtc: string;\r\n updatedUtc: string;\r\n createdBy: User;\r\n updatedBy: User;\r\n}\r\n\r\ninterface User {\r\n firstName: string;\r\n lastName: string;\r\n fullName: string;\r\n}\r\n\r\nexport enum FeeCategory {\r\n None = 0,\r\n IossOrderEntry = 1,\r\n ClassificationWISE = 2,\r\n GoogleTranslation = 3,\r\n DigitalCustom = 4,\r\n AiDockClassification = 5,\r\n ManualClassification = 6,\r\n InvoiceFee = 7,\r\n}\r\n\r\nexport interface CompanyAdvancedFee {\r\n id: string;\r\n advancedFeeId: string;\r\n companyId: string;\r\n advancedFee: AdvancedFee;\r\n}","import { AdvancedFee, CompanyAdvancedFee } from './interfaces';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getAdvancedFees = (): Promise =>\r\n apiFetch('/advancedfees');\r\n\r\nexport const postAdvancedFee = (fee: AdvancedFee): Promise =>\r\n apiFetch('/advancedfees', fee, HTTPMethod.POST);\r\n\r\nexport const putAdvancedFee = (fee: AdvancedFee): Promise =>\r\n apiFetch(`/advancedfees/${fee.id}`, fee, HTTPMethod.PUT);\r\n\r\nexport const deleteAdvancedFee = (id: string): Promise =>\r\n apiFetch(`/advancedfees/${id}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const getAdvancedFeeRelated = (fee: AdvancedFee): Promise =>\r\n apiFetch(`/advancedfees/${fee.id}/related`);\r\n\r\nexport const updateCompanyAdvancedFees = (companyId: string, advancedFeesIds: string[]) =>\r\n apiFetch(`/advancedfees/company/${companyId}/companyAdvancedFees`, advancedFeesIds, HTTPMethod.POST);","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { WebshopIntegration } from './interfaces';\r\n\r\nexport const getAllWebShopIntegrationsForAdmin = () =>\r\n apiFetch('/Admin/Integrations/WebShop');\r\n\r\nexport const getWebShopIntegrations = (companyId: string) =>\r\n apiFetch(`/Company/${companyId}/Integrations/WebShop`);\r\n\r\nexport const postWebShopIntegrations = (\r\n companyId: string,\r\n integrationKey: string,\r\n webShop: string\r\n) =>\r\n apiFetch(\r\n `/Company/${companyId}/Integrations/WebShop`,\r\n { IntegrationKey: integrationKey, webShopType: webShop },\r\n HTTPMethod.POST\r\n );\r\n\r\nexport const putWebShopIntegrations = (\r\n companyId: string,\r\n webShopIntegrationId: string,\r\n emailOnErrors: string\r\n) =>\r\n apiFetch(\r\n `/Company/${companyId}/Integrations/WebShop/${webShopIntegrationId}`,\r\n {\r\n emailOnErrors: emailOnErrors,\r\n },\r\n HTTPMethod.PUT\r\n );\r\n\r\nexport const deleteWebShopIntegrations = (\r\n companyId: string,\r\n webShopIntegrationId: string\r\n) =>\r\n apiFetch(\r\n `/Company/${companyId}/Integrations/WebShop/${webShopIntegrationId}`,\r\n undefined,\r\n HTTPMethod.DELETE\r\n );\r\n","export interface IossReimportStatusModel {\r\n message: string;\r\n totalNumberOfEntries: number;\r\n currentEntry: number;\r\n stateName: string;\r\n state: IossReimportJobState;\r\n}\r\n\r\nexport enum IossReimportJobState {\r\n Idle,\r\n Processing,\r\n CompletedSuccessfully,\r\n CompletedWithErrors,\r\n}\r\n","import { apiFetch } from '../fetch';\r\nimport { IossReimportStatusModel } from '.';\r\n\r\nexport const iossReimportPreview = (): Promise => apiFetch('/ioss/reimport/preview');\r\n\r\nexport const iossReimportStart = (): Promise => apiFetch('/ioss/reimport/start');\r\n\r\nexport const iossReimportProgress = (): Promise => apiFetch('/ioss/reimport/progress');\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport {\r\n IossInvoiceJobInvoice,\r\n IossInvoiceJob,\r\n IossInvoiceJobStatus,\r\n} from './interfaces';\r\n\r\nexport const startIossInvoiceJob = (endDate: string, jobType: number) =>\r\n apiFetch(`/iossJob/invoicing?endDate=${endDate}&iossJobType=${jobType}`, null, HTTPMethod.PUT);\r\n\r\nexport const getIossInvoiceJobStatus = (): Promise =>\r\n apiFetch('/iossJob/invoicing');\r\n\r\nexport const getIossInvoiceJobs = (): Promise =>\r\n apiFetch('/iossJob/list');\r\n\r\nexport const deleteIossInvoiceJob = (jobId: string): Promise =>\r\n apiFetch(`/iossJob/${jobId}`, null, HTTPMethod.DELETE);\r\n\r\nexport const getIossInvoiceJobInvoices = (\r\n jobId: string\r\n): Promise => apiFetch(`/iossJob/${jobId}/invoiceList`);\r\n\r\nexport const getIossInvoiceJobInvoiceText = (\r\n jobId: string,\r\n invoiceId: string\r\n): Promise => apiFetch(`/iossJob/${jobId}/invoicePreview/${invoiceId}`);\r\n\r\nexport const getIossInvoiceJobInvoicesText = (\r\n jobId: string\r\n): Promise => apiFetch(`/iossJob/${jobId}/invoicePreviewAll?compact=true`);\r\n","export interface IossInvoiceJobStatus {\r\n message: string | null;\r\n totalNumberOfEntries: number;\r\n totalNumberOfEntriesWithProblems: number;\r\n currentEntry: number;\r\n state: number;\r\n stateName: IossInvoiceJobState;\r\n}\r\n\r\nexport enum IossInvoiceJobState {\r\n Idle,\r\n Processing,\r\n CompletedSuccessfully,\r\n CompletedWithErrors,\r\n}\r\nexport enum IossJobType {\r\n None = 0,\r\n Fee = 1,\r\n Vat = 2,\r\n //Obsolete\r\n VatAndFee = 3,\r\n}\r\n\r\nexport interface IossInvoiceJob {\r\n id: string;\r\n coveredFilesStartUtc: string;\r\n coveredFilesEndUtc: string;\r\n coveredEntriesStartUtc: string;\r\n coveredEntriesEndUtc: string;\r\n numberOfFilesProcessed: number;\r\n numberOfEntriesProcessed: number;\r\n numberOfDuplicateEntriesFiltered: number;\r\n numberOfIossNumbersProcessed: number;\r\n numberOfInvoicesProduced: number;\r\n numberOfVatNotificationsProduced: number;\r\n totalSalesValueOfEntries: number;\r\n totalVatValueOfEntries: number;\r\n totalFeesValueCalculated: number;\r\n jobStartedBy: string;\r\n jobStartedByName: string;\r\n jobStartedUtc: string;\r\n jobEndedUtc: string;\r\n endDateForJobRunUtc: string;\r\n jobType: IossJobType;\r\n}\r\n\r\nexport interface IossInvoiceJobInvoice {\r\n id: string;\r\n companyId: string;\r\n companyName: string;\r\n customerNumber: string;\r\n collectionInvoiceNumber?: string;\r\n invoiceType: IossInvoiceJobInvoiceType;\r\n invoiceNumber: string;\r\n isPrepaid: boolean;\r\n sendTimestampUtc: string;\r\n recipient: string;\r\n createdUtc: string;\r\n updatedUtc: string;\r\n totalAmount: number;\r\n paidDate: string;\r\n invoiceRows: IossInvoiceJobInvoiceRow[];\r\n}\r\n\r\nexport interface IossInvoiceJobInvoiceRow {\r\n rowNumber: number;\r\n numberOfSourceItems: number;\r\n numberOfItems: number;\r\n articleNumber: string;\r\n text: string;\r\n}\r\n\r\nexport enum IossInvoiceJobInvoiceType {\r\n None,\r\n IossFee,\r\n IossVat,\r\n}\r\n","import { CombinedReport } from 'components/vatReturns/CombineVatReturnsPage';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\nimport { StatusOfVatReturnJob, VatReturn, VatReturnJob } from './interfaces';\r\n\r\nexport const getStatusOfVatReturnJob = (): Promise => apiFetch('/iossjob/VatReturns/');\r\n\r\nexport const getIossVatReturnJobs = (): Promise => apiFetch('/iossjob/VatReturns/list/');\r\n\r\nexport const getListOfAllVatReturnsForJob = (\r\n id: string\r\n): Promise => apiFetch(`/iossjob/VatReturns/${id}/list/`);\r\n\r\nexport const putIossVatReturnJob = (\r\n year: number,\r\n month: number,\r\n detailAnalysis: boolean,\r\n replaceExistingData: boolean\r\n): Promise => apiFetch(\r\n `/iossjob/VatReturns?year=${year}&month=${month}&detailAnalysis=${detailAnalysis}&replaceExistingData=${replaceExistingData}`,\r\n undefined,\r\n HTTPMethod.PUT\r\n);\r\n\r\nexport const getCombinedVatReturns = (iossNumber: string, dates: string[]): Promise => {\r\n const dateParams = dates.map(date => `dates=${date}`).join('&');\r\n const url = `/iossjob/VatReturns/CombineIossVatReturns?iossNumber=${iossNumber}&${dateParams}`;\r\n return apiFetch(url);\r\n};","export interface StatusOfVatReturnJob {\r\n currentEntry: number\r\n message?: string\r\n state: VatReturnsJobState\r\n stateName: VatReturnsJobState\r\n totalNumberOfEntries: number\r\n totalNumberOfEntriesWithProblems: number\r\n}\r\n\r\nexport interface VatReturnJob {\r\n documentUrl: string\r\n id: string\r\n jobEndedUtc: string\r\n jobStartedBy: string\r\n jobStartedByName: string\r\n jobStartedUtc: string\r\n month: number\r\n numberOfCorrections: number\r\n numberOfDuplicatesFiltered: number\r\n numberOfEmptyTaxReturnsProduced: number\r\n numberOfEntries: number\r\n numberOfIossNumbersProcessed: number\r\n totalCorrectionsSalesAmount: number\r\n totalCorrectionsVatAmount: number\r\n totalSalesAmount: number\r\n totalVatAmount: number\r\n year: number\r\n}\r\n\r\nexport interface VatReturn {\r\n documentUrl: string\r\n id: string\r\n iossNumber: string\r\n month: number\r\n numberOfCorrectionsForPreviousPeriods: number\r\n numberOfDuplicatesFiltered: number\r\n numberOfEntriesForPeriod: number\r\n referenceNumberFromSkv: number\r\n totalCorrectionsSalesAmount: number\r\n totalCorrectionsVatAmount: number\r\n totalSalesAmount: number\r\n totalVatAmount: number\r\n year: number\r\n}\r\n\r\nexport enum VatReturnsJobState {\r\n Idle,\r\n Processing,\r\n CompletedSuccessfully,\r\n CompletedWithErrors,\r\n None,\r\n}","import { IChartProps, IVSChartDataPoint } from '@fluentui/react-charting';\r\nimport { CustomsStatus } from '../digitalCustoms/interfaces';\r\n\r\nexport interface SalesByPeriod {\r\n transactionDate: string;\r\n vatValue: number;\r\n count: number;\r\n country: string;\r\n}\r\nexport interface SalesByPeriodAndDestination {\r\n country: string;\r\n transactionDate: string;\r\n vatValue: number;\r\n count: number;\r\n}\r\n\r\nexport interface IossRegistrationsByPeriod {\r\n count: number;\r\n transactionDate: string;\r\n}\r\n\r\nexport interface IossRegistrationsByPeriodAndCountry {\r\n count: number;\r\n country: string;\r\n iossStartDate: string;\r\n}\r\n\r\nexport interface EarningsByCompanyAndDate {\r\n companyId: string;\r\n companyName: string;\r\n count: number;\r\n revenue: number;\r\n transactionDate: string\r\n}\r\n\r\nexport interface VatByCompanyAndDate {\r\n companyId: string;\r\n companyName: string;\r\n vatAmount: number;\r\n transactionDate: string\r\n}\r\n\r\nexport interface SalesByPeriodAdmin {\r\n transactionDate: string;\r\n country: string;\r\n count: number;\r\n vatValue: number;\r\n}\r\nexport interface DateRange {\r\n from: string;\r\n to: string;\r\n}\r\n\r\nexport interface IossRegistrationsByPeriodAndCountry {\r\n iossStartDate: string;\r\n country: string;\r\n count: number;\r\n}\r\n\r\nexport interface DestinationCountriesForEachCompany{\r\n [country: string]: number;\r\n}\r\nexport interface AllDestinationCountries{\r\n [country: string]: number;\r\n}\r\n\r\nexport enum ChartState {\r\n Idle = 'Idle',\r\n Loading = 'Loading',\r\n Error = 'Error',\r\n NoData = 'NoData',\r\n}\r\n\r\nexport enum ChartType {\r\n LineChart = 'LineChart',\r\n VerticalBarChart = 'VerticalBarChart',\r\n VerticalStackedBarChart = 'VerticalStackedBarChart',\r\n GroupedVerticalBarChart = 'GroupedVerticalBarChart',\r\n HorizontalBarChart = 'HorizontalBarChart',\r\n}\r\n\r\nexport interface EarningsAndVatByCompanyAndDate {\r\n earnings: EarningsByCompanyAndDate[];\r\n vat: VatByCompanyAndDate[];\r\n}\r\n\r\nexport interface IVSChartDataPointWithCompanyId extends IVSChartDataPoint {\r\n companyId: string;\r\n}\r\n\r\nexport interface IChartPropsWithCompanyId extends IChartProps {\r\n companyId: string;\r\n}\r\n\r\nexport enum AdminChart {\r\n ByFeeType = 'ByFeeType',\r\n AllFeeTypes = 'AllFeeTypes',\r\n UnpaidInvoices = 'UnpaidInvoices',\r\n NewIossRegistrations = 'NewIossRegistrations',\r\n NewIossRegistrationsByCountry = 'NewIossRegistrationsByCountry',\r\n EarningsByCompany = 'EarningsByCompany',\r\n AllFeeTypesBySourceCountry = 'AllFeeTypesBySourceCountry',\r\n OrdersOfTop10DestinationCountries = 'OrdersOfTop10DestinationCountries',\r\n Devations = 'Deviations',\r\n}\r\n\r\nexport enum PlatformType {\r\n All = 0,\r\n ShopifyApp = 1,\r\n MagentoApp = 2,\r\n WooCommerceApp = 3,\r\n PublicApi = 4,\r\n}\r\n\r\nexport interface DigitalCustomsAnalyticsData{\r\n data: DigitalCustomsOrdersByPeriod [],\r\n deliveryTypes: string [],\r\n}\r\n\r\nexport interface DigitalCustomsOrdersByPeriod {\r\n count: number;\r\n timePeriod: string;\r\n}\r\n\r\nexport interface AnalyticsQuery {\r\n fromDate: string;\r\n toDate: string;\r\n companyId?: string;\r\n groupedPeriod?: ChartGroupedPeriod;\r\n includeChildCompanies?: boolean;\r\n}\r\n\r\nexport enum ChartGroupedPeriod {\r\n Daily = 'daily',\r\n Weekly = 'weekly',\r\n Monthly = 'monthly',\r\n}\r\n\r\nexport interface ClassitProductCountByCompany {\r\n fromDate: string;\r\n toDate: string;\r\n id: string;\r\n name: string;\r\n productCount: number;\r\n}\r\n\r\nexport interface ClassitProductWithoutDescriptionByCompany {\r\n fromDate: string;\r\n toDate: string;\r\n id: string;\r\n name: string;\r\n missingDescriptionCount: number;\r\n}\r\n\r\nexport interface ClassitProductWithoutTrade6ByCompany {\r\n fromDate: string;\r\n toDate: string;\r\n id: string;\r\n name: string;\r\n missingTrade6Count: number;\r\n}\r\n\r\nexport interface ClassitProductWithInvalidStatusByCompany {\r\n fromDate: string;\r\n toDate: string;\r\n id: string;\r\n name: string;\r\n invalidStatusCount: number;\r\n}\r\n\r\nexport interface ClassitUploadedProductsByTypeAndCompany {\r\n id: string;\r\n name: string;\r\n productCount: number;\r\n uploadType: UploadType;\r\n}\r\n\r\nexport enum UploadType {\r\n MANUAL = 'MANUAL',\r\n API = 'API',\r\n}\r\n\r\nexport enum ClassificationHelpMethods {\r\n FEDEX = 'FEDEX',\r\n AI = 'AI',\r\n}\r\n\r\nexport interface ClassitClassifiedProductsByTypeAndCompany {\r\n classifiedBy: ClassificationHelpMethods;\r\n id: string;\r\n name: string;\r\n productCount: number;\r\n errored?: number;\r\n}\r\n\r\nexport interface ClassitClassifyingByTypeAndCompany {\r\n id: string;\r\n name: string;\r\n classifiedBy: ClassificationHelpMethods;\r\n productCount: number;\r\n}\r\n\r\nexport interface ClassitCompletedClassificationJobs {\r\n id: string;\r\n name: string;\r\n classifiedBy: ClassificationHelpMethods;\r\n productCount: number;\r\n}\r\n\r\nexport interface DigitalCustomsOrdersAnalytics {\r\n articles: number;\r\n companyId: string;\r\n declarations: number;\r\n orders: number;\r\n companyName: string;\r\n}\r\n\r\nexport interface DigitalCustomsOrdersByCustomsStatusAnalytics {\r\n articles: number;\r\n companyId: string;\r\n customsStatus: CustomsStatus;\r\n declarations: number;\r\n orders: number;\r\n companyName: string;\r\n fromDate: string;\r\n toDate: string;\r\n}\r\n\r\nexport interface DigitalCustomsOrdersWithCorrections {\r\n companyId: string;\r\n orders: number;\r\n}\r\n\r\nexport interface DigitalCustomsDayWiseReportOrders {\r\n orders: number;\r\n companyId: string;\r\n companyName: string;\r\n date: string;\r\n}","import {\r\n EarningsAndVatByCompanyAndDate,\r\n IossRegistrationsByPeriod,\r\n IossRegistrationsByPeriodAndCountry,\r\n SalesByPeriod,\r\n SalesByPeriodAdmin,\r\n SalesByPeriodAndDestination,\r\n DestinationCountriesForEachCompany,\r\n AllDestinationCountries,\r\n PlatformType,\r\n AnalyticsQuery,\r\n ClassitUploadedProductsByTypeAndCompany,\r\n ClassitProductCountByCompany,\r\n ClassitClassifiedProductsByTypeAndCompany,\r\n ClassitClassifyingByTypeAndCompany,\r\n ClassitCompletedClassificationJobs,\r\n DigitalCustomsOrdersAnalytics,\r\n DigitalCustomsOrdersByCustomsStatusAnalytics,\r\n DigitalCustomsOrdersWithCorrections,\r\n DigitalCustomsDayWiseReportOrders,\r\n ClassitProductWithoutDescriptionByCompany,\r\n ClassitProductWithoutTrade6ByCompany,\r\n ClassitProductWithInvalidStatusByCompany,\r\n} from '.';\r\nimport { apiFetch } from '../fetch';\r\n\r\nconst queryString = require('query-string');\r\n\r\nexport const getSalesByPeriod = (\r\n companyId: string,\r\n from: string,\r\n to: string\r\n): Promise =>\r\n apiFetch(`/Company/${companyId}/Analytics/SalesByPeriod?fromDate=${from}&toDate=${to}`);\r\n\r\nexport const getSalesByPeriodAndDestination = (\r\n companyId: string,\r\n from: string,\r\n to: string,\r\n destinationCountry: string\r\n): Promise =>\r\n apiFetch(\r\n `/Company/${companyId}/Analytics/SalesByPeriodAndDestination?fromDate=${from}&toDate=${to}&destinationCountry=${destinationCountry}`\r\n );\r\n\r\nexport const getSalesByPeriodAdmin = (\r\n from: string,\r\n to: string,\r\n platform: PlatformType = PlatformType.All\r\n): Promise =>\r\n apiFetch(`/Analytics/SalesByPeriod?fromDate=${from}&toDate=${to}&platform=${platform}`);\r\n\r\nexport const getIossRegistrationsByPeriod = (\r\n from: string,\r\n to: string\r\n): Promise =>\r\n apiFetch(`/Analytics/IossRegistrationsByPeriod?fromDate=${from}&toDate=${to}`);\r\n\r\nexport const getIossRegistrationsByPeriodAndCountry = (\r\n from: string,\r\n to: string\r\n): Promise =>\r\n apiFetch(`/Analytics/IossRegistrationsByPeriodAndCountry?fromDate=${from}&toDate=${to}`);\r\n\r\nexport const getEarningsAndVatByCompanyAndDate = (from: string, to: string, feeType: string, platform: PlatformType = PlatformType.All): Promise =>\r\n apiFetch(`/Analytics/EarningsAndVatByCompanyAndDate?fromDate=${from}&toDate=${to}&advancedFeeId=${feeType}&platform=${platform}`);\r\n\r\nexport const getEarningsAndVatByCompanyAndDateAllFeeTypes = (from: string, to: string, platform: PlatformType = PlatformType.All): Promise =>\r\n apiFetch(`/Analytics/EarningsAndVatByCompanyAndDate?fromDate=${from}&toDate=${to}&platform=${platform}`);\r\n\r\nexport const getDestinationCountriesForEachCompany = (companyId: string, from: string, to: string\r\n): Promise =>\r\n apiFetch(`/Company/${companyId}/Analytics/DestinationCountriesForEachCompany?fromDate=${from}&toDate=${to}`);\r\n\r\nexport const getAllDestinationCountries = (from: string, to: string, platform: PlatformType = PlatformType.All): Promise =>\r\n apiFetch(`/Analytics/AllDestinationCountries?fromDate=${from}&toDate=${to}&platform=${platform}`);\r\n\r\nexport const getProductCountAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/products/count${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getProductWithMissingDescriptionCountAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/products/missing-description${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getProductWithMissingTrade6CountAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/products/missing-trade6${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getProductWithInvalidStatusCountAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/products/invalid-status${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getUploadedProductCountAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/uploadedproducts${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getClassfiedProductCountAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/classifiedproducts${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getInProgressClassficationsAsync = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/inprogressclassifications${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getCompletedClassificationJobs = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/completedclassificationjobs${!!query ? `?${queryString.stringify(query)}` : ''\r\n}`);\r\n\r\nexport const getReportForDigitalCustomsOrders = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/digitalCustomsOrders${!!query ? `?${queryString.stringify(query)}` : ''}`);\r\n\r\nexport const getReportForDigitalCustomsOrdersByCustomsStatus = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/digitalCustomsOrders/customsStatus${!!query ? `?${queryString.stringify(query)}` : ''}`);\r\n\r\nexport const getReportForDigitalCustomsOrdersWithCorrections = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/digitalCustomsOrders/corrections${!!query ? `?${queryString.stringify(query)}` : ''}`);\r\n\r\nexport const getDayWiseReportForDigitalCustomsOrders = (query: AnalyticsQuery): Promise => apiFetch(`/Analytics/digitalCustomsOrders/dayWiseReport${!!query ? `?${queryString.stringify(query)}` : ''}`);","export interface CreateDynamicsResponse {\r\n invoiceCreated: boolean;\r\n message?: string;\r\n statusCode: number;\r\n}\r\n\r\nexport interface CreateDynamicsCustomerResponse extends CreateDynamicsResponse {\r\n customerCreated: boolean;\r\n}\r\n\r\nexport interface CreateDynamicsError {\r\n statusCode: number;\r\n message: string;\r\n}\r\n\r\nexport enum DynamicsInvoiceType{\r\n FeeInvoice = 1,\r\n ReminderFeeInvoice = 2,\r\n InterestInvoice = 3,\r\n InitialSubscriptionInvoice = 4,\r\n SubscriptionInvoice = 5,\r\n EconomicEntriesInvoice = 6,\r\n}","export interface CrmAction {\r\n id: string,\r\n companyId: string,\r\n addedUtc: string,\r\n addedByFullName: string,\r\n actionType: CrmActionType,\r\n note: string,\r\n actionUtc: string,\r\n completedUtc?: string,\r\n rejectedUtc?: string,\r\n assignedToId: string,\r\n assignedToFullName: string,\r\n companyName: string,\r\n performedUtc?: string,\r\n completed?:boolean,\r\n}\r\n\r\nexport enum CrmActionType {\r\n Meeting = 'Meeting',\r\n Phonecall = 'Phonecall',\r\n Email = 'Email',\r\n Other = 'Other',\r\n}\r\n","import * as Api from 'integrations/crossborderit';\r\nimport {\r\n ChartGroupedPeriod,\r\n DateRange,\r\n DigitalCustomsDayWiseReportOrders,\r\n EarningsAndVatByCompanyAndDate,\r\n PlatformType,\r\n} from 'integrations/crossborderit/analytics';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { DefaultPalette } from '@fluentui/react';\r\nimport { stringToColour } from 'utility/stringToColor';\r\nimport { CollectionInvoiceStatus, CollectionInvoiceType, Country } from 'integrations/crossborderit';\r\nimport { useCallback } from 'react';\r\nimport { IVerticalStackedChartProps } from '@fluentui/react-charting';\r\nimport { groupBy, map, pipe, prop } from 'ramda';\r\nimport moment from 'moment';\r\nimport { useUserPreferences } from '../userPreferences/useUserPreferences';\r\n\r\nexport const useAnalytics = () => {\r\n const { t } = useTranslation();\r\n const { formatCompanyName } = useUserPreferences();\r\n\r\n const getEarningsAndVatByCompanyAndDateAllFeeTypes = useCallback(\r\n (dateRange: DateRange, platform: PlatformType = PlatformType.All) =>\r\n Api.getEarningsAndVatByCompanyAndDateAllFeeTypes(\r\n dateRange.from,\r\n dateRange.to,\r\n platform\r\n ),\r\n []\r\n );\r\n\r\n const getAllDestinationCountries = useCallback(\r\n (dateRange: DateRange, platform: PlatformType = PlatformType.All) =>\r\n Api.getAllDestinationCountries(dateRange.from, dateRange.to, platform).then(\r\n (datas) =>\r\n Object.keys(datas).map((key) => ({\r\n x: key,\r\n y: datas[key],\r\n color: DefaultPalette.blue,\r\n legend: t('Total orders'),\r\n }))\r\n ),\r\n [t]\r\n );\r\n\r\n const getAllUnpaidInvoices = useCallback(\r\n (invoiceType: CollectionInvoiceType, dateRange: DateRange) =>\r\n Api.getCollectionInvoices(invoiceType, dateRange.from, dateRange.to).then(\r\n (datas) => {\r\n const unpaidInvoices = datas?.filter(invoice => invoice.status === CollectionInvoiceStatus.SentToCustomer);\r\n const overDueUnpaidInvoices = unpaidInvoices.filter(invoice => moment(invoice.dueDate).isBefore(moment()));\r\n\r\n let invoicesByDate: IVerticalStackedChartProps[] = [];\r\n\r\n const groupByDueDateCompanyName = pipe(\r\n groupBy(prop('dueDate') as any),\r\n map(groupBy(prop('companyName') as any)) as any\r\n );\r\n\r\n const groupedInvoices: any = groupByDueDateCompanyName(overDueUnpaidInvoices);\r\n\r\n invoicesByDate = Object.keys(groupedInvoices).map((key) => ({\r\n xAxisPoint: moment(key).format('YYYY-MM-DD'),\r\n chartData: Object.values(groupedInvoices[key]).map((companysInvoices: any) => ({\r\n legend: formatCompanyName(companysInvoices[0].companyName),\r\n data: companysInvoices.length,\r\n xAxisCalloutData: moment(key).format('YYYY-MM-DD'),\r\n yAxisCalloutData: `${companysInvoices.length} invoices`,\r\n color: stringToColour(companysInvoices[0].companyName),\r\n })),\r\n }));\r\n return invoicesByDate;\r\n }\r\n ),\r\n [formatCompanyName]\r\n );\r\n\r\n const getDestinationCountriesForEachCompany = useCallback(\r\n (companyId: string, dateRange: DateRange) =>\r\n Api.getDestinationCountriesForEachCompany(\r\n companyId,\r\n dateRange.from,\r\n dateRange.to\r\n ).then((datas) =>\r\n Object.keys(datas).map((key) => ({\r\n x: key,\r\n y: datas[key],\r\n color: DefaultPalette.blue,\r\n legend: t('Total orders'),\r\n }))\r\n ),\r\n [t]\r\n );\r\n\r\n const getIossRegistrationsByPeriod = useCallback(\r\n (dateRange: DateRange) =>\r\n Api.getIossRegistrationsByPeriod(dateRange.from, dateRange.to).then(\r\n (datas) => ({\r\n data: datas.map((data) => ({\r\n x: data.transactionDate.slice(0, -9),\r\n y: data.count,\r\n color: DefaultPalette.blue,\r\n legend: t('New IOSS registrations'),\r\n })),\r\n })\r\n ),\r\n [t]\r\n );\r\n\r\n const getIossRegistrationsByPeriodAndCountry = useCallback(\r\n (dateRange: DateRange) =>\r\n Api.getIossRegistrationsByPeriodAndCountry(\r\n dateRange.from,\r\n dateRange.to\r\n ).then((datas) =>\r\n Array.from(new Set(datas.map((data) => data.iossStartDate)))\r\n .map((datasDate) =>\r\n datas.filter((data) => data.iossStartDate === datasDate)\r\n )\r\n .map((data2) => ({\r\n xAxisPoint: data2[0].iossStartDate.slice(0, -9),\r\n chartData: data2.map((data3) => ({\r\n legend: data3.country,\r\n data: data3.count,\r\n xAxisCalloutData: data2[0].iossStartDate.slice(0, -9),\r\n yAxisCalloutData: `${data3.count} registrations`,\r\n color: stringToColour(data3.country),\r\n })),\r\n }))\r\n ),\r\n []\r\n );\r\n\r\n const transformEarningsAndVatByCompanyAndDateAllFeeTypesVertical\r\n = useCallback(\r\n (datas: EarningsAndVatByCompanyAndDate) => ({\r\n vat: Array.from(\r\n new Set(datas.vat.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.vat.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: formatCompanyName(data.companyName),\r\n companyId: data.companyId,\r\n data: data.vatAmount,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.vatAmount} € VAT`,\r\n color: stringToColour(data.companyName),\r\n })),\r\n })),\r\n\r\n orders: Array.from(\r\n new Set(datas.earnings.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: formatCompanyName(data.companyName),\r\n companyId: data.companyId,\r\n data: data.count,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.count} Orders`,\r\n color: stringToColour(data.companyName),\r\n })),\r\n })),\r\n\r\n revenue: Array.from(\r\n new Set(datas.earnings.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: formatCompanyName(data.companyName),\r\n companyId: data.companyId,\r\n data: data.revenue,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.revenue} € Revenue`,\r\n color: stringToColour(data.companyName),\r\n })),\r\n })),\r\n }),\r\n [formatCompanyName]\r\n );\r\n\r\n const transformOrdersByCompanyAndDateAllFeeTypes = useCallback(\r\n (datas: EarningsAndVatByCompanyAndDate) =>\r\n Array.from(new Set(datas.earnings.map((data) => data.companyName).sort()))\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) => ({\r\n companyName: formatCompanyName(data[0].companyName),\r\n companyId: data[0].companyId,\r\n count: data.reduce(\r\n (previousValue, currentValue) => previousValue + currentValue.count,\r\n 0\r\n ),\r\n })),\r\n [formatCompanyName]\r\n );\r\n\r\n const transformEarningsAndVatByCompanyAndDateAllFeeTypesHorizontal\r\n = useCallback(\r\n (datas: EarningsAndVatByCompanyAndDate, dateRange: DateRange) => {\r\n const highestXValues = {\r\n vat: Math.max(\r\n ...Array.from(\r\n new Set(datas.vat.map((data) => data.companyName).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.vat.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) =>\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.vatAmount,\r\n 0\r\n )\r\n )\r\n ),\r\n orders: Math.max(\r\n ...Array.from(\r\n new Set(datas.earnings.map((data) => data.companyName).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) =>\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.count,\r\n 0\r\n )\r\n )\r\n ),\r\n\r\n revenue: Math.max(\r\n ...Array.from(\r\n new Set(datas.earnings.map((data) => data.companyName).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) =>\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.revenue,\r\n 0\r\n )\r\n )\r\n ),\r\n };\r\n\r\n return {\r\n vat: Array.from(\r\n new Set(datas.vat.map((data) => data.companyName).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.vat.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) => ({\r\n chartTitle: formatCompanyName(data[0].companyName),\r\n companyId: data[0].companyId,\r\n chartData: [\r\n {\r\n legend: formatCompanyName(data[0].companyName),\r\n horizontalBarChartdata: {\r\n x:\r\n Math.round(\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.vatAmount,\r\n 0\r\n ) * 100\r\n ) / 100,\r\n y: highestXValues.vat,\r\n },\r\n xAxisCalloutData: `${dateRange.from.slice(\r\n 0,\r\n -14\r\n )} - ${dateRange.to.slice(0, -14)}`,\r\n yAxisCalloutData: `${Math.round(\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.vatAmount,\r\n 0\r\n ) * 100\r\n ) / 100\r\n }${t('€ VAT')}`,\r\n color: stringToColour(data[0].companyName),\r\n },\r\n ],\r\n })),\r\n\r\n orders: Array.from(\r\n new Set(datas.earnings.map((data) => data.companyName).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) => ({\r\n chartTitle: formatCompanyName(data[0].companyName),\r\n companyId: data[0].companyId,\r\n chartData: [\r\n {\r\n legend: formatCompanyName(data[0].companyName),\r\n horizontalBarChartdata: {\r\n x: data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.count,\r\n 0\r\n ),\r\n y: highestXValues.orders,\r\n },\r\n xAxisCalloutData: `${dateRange.from.slice(\r\n 0,\r\n -14\r\n )} - ${dateRange.to.slice(0, -14)}`,\r\n yAxisCalloutData: `${data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.count,\r\n 0\r\n )} ${t('Orders')}`,\r\n color: stringToColour(data[0].companyName),\r\n },\r\n ],\r\n })),\r\n\r\n revenue: Array.from(\r\n new Set(datas.earnings.map((data) => data.companyName).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.companyName === datasDate)\r\n )\r\n .map((data) => ({\r\n chartTitle: formatCompanyName(data[0].companyName),\r\n companyId: data[0].companyId,\r\n chartData: [\r\n {\r\n legend: formatCompanyName(data[0].companyName),\r\n horizontalBarChartdata: {\r\n x:\r\n Math.round(\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.revenue,\r\n 0\r\n ) * 100\r\n ) / 100,\r\n y: highestXValues.revenue,\r\n },\r\n xAxisCalloutData: `${dateRange.from.slice(\r\n 0,\r\n -14\r\n )} - ${dateRange.to.slice(0, -14)}`,\r\n yAxisCalloutData: `${Math.round(\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.revenue,\r\n 0\r\n ) * 100\r\n ) / 100\r\n }${t('€ Revenue')}`,\r\n color: stringToColour(data[0].companyName),\r\n },\r\n ],\r\n })),\r\n };\r\n },\r\n [t, formatCompanyName]\r\n );\r\n\r\n const getCompanyVatAndOrdersByPeriod = useCallback(\r\n (companyId: string, dateRange: DateRange) =>\r\n Api.getSalesByPeriod(companyId, dateRange.from, dateRange.to).then(\r\n (totalSalesDatas) => ({\r\n countries: Array.from(\r\n new Set(totalSalesDatas.map((data) => data.country).sort())\r\n ),\r\n orders: Array.from(\r\n new Set(totalSalesDatas.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n totalSalesDatas.filter(\r\n (data) => data.transactionDate === datasDate\r\n )\r\n )\r\n .map((data) => ({\r\n x: data[0].transactionDate,\r\n y: data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.count,\r\n 0\r\n ),\r\n color: DefaultPalette.blue,\r\n legend: t('Orders'),\r\n })),\r\n vat: Array.from(\r\n new Set(totalSalesDatas.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n totalSalesDatas.filter(\r\n (data) => data.transactionDate === datasDate\r\n )\r\n )\r\n .map((data) => ({\r\n x: data[0].transactionDate,\r\n y:\r\n Math.round(\r\n data.reduce(\r\n (previousValue, currentValue) =>\r\n previousValue + currentValue.vatValue,\r\n 0\r\n ) * 100\r\n ) / 100,\r\n color: DefaultPalette.blue,\r\n legend: t('€ VAT'),\r\n })),\r\n })\r\n ),\r\n [t]\r\n );\r\n\r\n const getSalesByDestinationCountry = useCallback(\r\n (companyId: string, dateRange: DateRange, selectedCountry: Country) =>\r\n Api.getSalesByPeriodAndDestination(\r\n companyId,\r\n dateRange.from,\r\n dateRange.to,\r\n selectedCountry.alpha2Code\r\n ).then((salesPerDestinationCountryDatas) => ({\r\n vat: salesPerDestinationCountryDatas.map((datas) => ({\r\n x: datas.transactionDate,\r\n y: datas.vatValue,\r\n legend: t('€ VAT'),\r\n color: DefaultPalette.blue,\r\n })),\r\n orders: salesPerDestinationCountryDatas.map((datas) => ({\r\n x: datas.transactionDate,\r\n y: datas.count,\r\n legend: t('Orders'),\r\n color: DefaultPalette.blue,\r\n })),\r\n countries: salesPerDestinationCountryDatas.map(\r\n (datas) => datas.country\r\n ),\r\n })),\r\n [t]\r\n );\r\n\r\n const getEarningsAndVatByCompanyAndDate = useCallback(\r\n (dateRange: DateRange, feeType: string, platform: PlatformType = PlatformType.All) =>\r\n Api.getEarningsAndVatByCompanyAndDate(\r\n dateRange.from,\r\n dateRange.to,\r\n feeType,\r\n platform\r\n ).then((datas) => ({\r\n vat: Array.from(\r\n new Set(datas.vat.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.vat.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: formatCompanyName(data.companyName),\r\n companyId: data.companyId,\r\n data: data.vatAmount,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.vatAmount} € VAT`,\r\n color: stringToColour(data.companyName),\r\n })),\r\n })),\r\n\r\n orders: Array.from(\r\n new Set(datas.earnings.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: formatCompanyName(data.companyName),\r\n companyId: data.companyId,\r\n data: data.count,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.count} Orders`,\r\n color: stringToColour(data.companyName),\r\n })),\r\n })),\r\n\r\n revenue: Array.from(\r\n new Set(datas.earnings.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.earnings.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: formatCompanyName(data.companyName),\r\n companyId: data.companyId,\r\n data: data.revenue,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.revenue} € Revenue`,\r\n color: stringToColour(data.companyName),\r\n })),\r\n })),\r\n })),\r\n [formatCompanyName]\r\n );\r\n\r\n const getVatAndOrdersBySourceCountry = useCallback(\r\n (dateRange: DateRange, platform: PlatformType = PlatformType.All) =>\r\n Api.getSalesByPeriodAdmin(dateRange.from, dateRange.to, platform).then((datas) => ({\r\n vat: Array.from(\r\n new Set(datas.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: data.country,\r\n data: data.vatValue,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.vatValue} € VAT`,\r\n color: stringToColour(data.country),\r\n })),\r\n })),\r\n\r\n orders: Array.from(\r\n new Set(datas.map((data) => data.transactionDate).sort())\r\n )\r\n .map((datasDate) =>\r\n datas.filter((data) => data.transactionDate === datasDate)\r\n )\r\n .map((data) => ({\r\n xAxisPoint: data[0].transactionDate,\r\n chartData: data.map((data) => ({\r\n legend: data.country,\r\n data: data.count,\r\n xAxisCalloutData: data.transactionDate,\r\n yAxisCalloutData: `${data.count} Orders`,\r\n color: stringToColour(data.country),\r\n })),\r\n })),\r\n })),\r\n []\r\n );\r\n\r\n const getDayWiseReportForDigitalCustomsOrders = useCallback(\r\n (fromDate: string, toDate: string, groupedPeriod: ChartGroupedPeriod, companyId?: string) => {\r\n const formatXAxisPoint = (item: DigitalCustomsDayWiseReportOrders, groupedPeriod: ChartGroupedPeriod) => {\r\n if (groupedPeriod === ChartGroupedPeriod.Monthly) {\r\n return moment(item.date).format('MMMM');\r\n } else if (groupedPeriod === ChartGroupedPeriod.Weekly) {\r\n return t('Week ') + moment(item.date).isoWeek().toString();\r\n } else {\r\n return item.date;\r\n }\r\n };\r\n return Api.getDayWiseReportForDigitalCustomsOrders({\r\n fromDate,\r\n toDate,\r\n groupedPeriod,\r\n companyId,\r\n }).then((datas) => {\r\n const groupedData = groupBy(prop('date'), datas);\r\n const chartData = Object.keys(groupedData).map((date) => {\r\n const companies = groupBy(prop('companyName'), groupedData[date]);\r\n const chartData = Object.keys(companies).map((companyName) => {\r\n const companyData = companies[companyName];\r\n return {\r\n legend: formatCompanyName(companyName),\r\n companyId: companyData[0].companyId,\r\n data: companyData[0].orders,\r\n xAxisCalloutData: formatXAxisPoint(companyData[0], groupedPeriod),\r\n yAxisCalloutData: `${companyData[0].orders} Orders`,\r\n color: stringToColour(companyData[0].companyId),\r\n };\r\n });\r\n return {\r\n xAxisPoint: formatXAxisPoint(groupedData[date][0], groupedPeriod),\r\n chartData,\r\n };\r\n });\r\n return chartData;\r\n });\r\n },\r\n [t, formatCompanyName]\r\n );\r\n return {\r\n getIossRegistrationsByPeriod,\r\n getIossRegistrationsByPeriodAndCountry,\r\n getCompanyVatAndOrdersByPeriod,\r\n getSalesByDestinationCountry,\r\n getEarningsAndVatByCompanyAndDate,\r\n getVatAndOrdersBySourceCountry,\r\n getDestinationCountriesForEachCompany,\r\n getAllDestinationCountries,\r\n getEarningsAndVatByCompanyAndDateAllFeeTypes,\r\n transformEarningsAndVatByCompanyAndDateAllFeeTypesVertical,\r\n transformEarningsAndVatByCompanyAndDateAllFeeTypesHorizontal,\r\n transformOrdersByCompanyAndDateAllFeeTypes,\r\n getAllUnpaidInvoices,\r\n getDayWiseReportForDigitalCustomsOrders,\r\n };\r\n};\r\n","import { getInvoicesByCompany } from './api';\r\nimport { useCallback, useEffect } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { CollectionInvoice, downloadCollectionInvoicePdf, getCollectionInvoice } from '../collectionInvoices';\r\nimport { replaceBy } from 'utility';\r\n\r\nconst companyInvoiceStorePath = ['companyInvoices'];\r\n\r\nexport const useBillings = (companyId: string) => {\r\n\r\n const {\r\n data: invoices = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(\r\n selectAsyncResource([], companyInvoiceStorePath)\r\n );\r\n const dispatch = useDispatch();\r\n\r\n const loadInvoicesForCompanyId = useCallback((companyId:string) => {\r\n dispatch(setAsyncResource(companyInvoiceStorePath, AsyncStatus.Loading, []));\r\n getInvoicesByCompany(companyId)\r\n .then(invoices => {\r\n dispatch(setAsyncResource(companyInvoiceStorePath, AsyncStatus.Success, invoices));\r\n }).catch(() => {\r\n dispatch(setAsyncResource(companyInvoiceStorePath, AsyncStatus.Error, []));\r\n });\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [dispatch, companyId]);\r\n\r\n const refreshCollectionInvoice = useCallback((collectionInvoiceId: string) => {\r\n getCollectionInvoice(companyId, collectionInvoiceId).then(ci => {\r\n const updatedInvoices = replaceBy('id', ci, invoices!);\r\n dispatch(setAsyncResource(companyInvoiceStorePath, AsyncStatus.Success, updatedInvoices));\r\n });\r\n }, [companyId, invoices, dispatch]);\r\n\r\n const refreshInvoices = () => {\r\n if (invoices && invoices.length) {\r\n const updatedInvoices = invoices.concat([]);\r\n dispatch(setAsyncResource(companyInvoiceStorePath, AsyncStatus.Success, updatedInvoices));\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (status === AsyncStatus.NotInitialized) {\r\n loadInvoicesForCompanyId(companyId);\r\n }\r\n }, [companyId, status, loadInvoicesForCompanyId]);\r\n\r\n return {\r\n invoices,\r\n status,\r\n loadInvoicesForCompanyId,\r\n refreshCollectionInvoice,\r\n downloadCollectionInvoicePdf,\r\n refreshInvoices,\r\n };\r\n};","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { CreateDynamicsResponse, CreateDynamicsCustomerResponse, CreateDynamicsError} from './interface';\r\n\r\nexport const createDynamicsCustomer = (companyId: string): Promise =>\r\n apiFetch(`/dynamics/customers/${companyId}`, null, HTTPMethod.POST)\r\n .then(result => {\r\n if (!result.customerCreated) {\r\n return Promise.reject({ statusCode: result.statusCode, message: result.message });\r\n }\r\n return result;\r\n }).catch((e: CreateDynamicsError) => {\r\n if (e.statusCode && e.message) {\r\n return Promise.reject({message:`${e.statusCode}: ${e.message}`});\r\n } else if (e.message) {\r\n return Promise.reject({message:e.message});\r\n } else {\r\n return Promise.reject(e);\r\n }\r\n });\r\n\r\nexport const createInitialInvoice = (companyId: string): Promise =>\r\n apiFetch(`/dynamics/customers/${companyId}/applicationFeeInvoice`, null, HTTPMethod.POST)\r\n .then(result => {\r\n if (!result.invoiceCreated) {\r\n return Promise.reject({ statusCode: result.statusCode, message: result.message });\r\n }\r\n return result;\r\n }).catch((e: CreateDynamicsError) => {\r\n if (e.statusCode && e.message) {\r\n return Promise.reject(`${e.statusCode}: ${e.message}`);\r\n } else if (e.message) {\r\n return Promise.reject(e.message);\r\n } else {\r\n return Promise.reject(e);\r\n }\r\n });","import { CrmAction } from '.';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getCrmActions = (companyId?: string) => {\r\n const url = companyId ? `/CrmActions?companyId=${companyId}` : '/CrmActions';\r\n return apiFetch(url);\r\n};\r\n\r\nexport const createCrmAction = (crmAction: CrmAction): Promise =>\r\n apiFetch('/CrmActions', crmAction, HTTPMethod.POST);\r\n\r\nexport const updateCrmAction = (crmActionId: string, crmAction: CrmAction) : Promise =>\r\n apiFetch(`/CrmActions/${crmActionId}`, crmAction, HTTPMethod.PUT);\r\n\r\nexport const finishCrmAction = (crmActionId: string) : Promise =>\r\n apiFetch(`/CrmActions/${crmActionId}/complete`, undefined, HTTPMethod.PUT);\r\n\r\nexport const dismissCrmAction = (crmActionId: string) : Promise =>\r\n apiFetch(`/CrmActions/${crmActionId}/reject`, undefined, HTTPMethod.PUT);\r\n\r\nexport const deleteCrmAction = (crmActionId: string) =>\r\n apiFetch(`/CrmActions/${crmActionId}`, undefined, HTTPMethod.DELETE);","import { CrmContact } from '..';\r\nimport { CompanyCategory } from '../companies';\r\nimport { CompanyAccountManager } from '../companyAccountManagers/interfaces';\r\n\r\nexport interface CrmCompany {\r\n id: string;\r\n companyName?: string;\r\n email?: string;\r\n phone?: string;\r\n website?: string;\r\n linkedIn?: string;\r\n AdressLine1?: string;\r\n AdressLine2?: string;\r\n countryCode?: string;\r\n city?: string;\r\n state?: string;\r\n postalCode?: string;\r\n crmCompanyType: CrmCompanyType;\r\n crmCompanyCategories?: CrmDigitalCustomerCategory[] | CrmAccountCategory[] ;\r\n companyCategories?: CompanyCategory[];\r\n crmCompanyStatus: CrmCompanyStatus;\r\n revokedUtc?:string;\r\n revokedBy?:string;\r\n addedUtc: string;\r\n addedBy: string;\r\n crmContacts?: CrmContact[];\r\n companyAccountManagers?: CompanyAccountManager[];\r\n}\r\n\r\nexport enum CrmCompanyStatus {\r\n Prospect = 0,\r\n Lead = 1,\r\n Invited = 2,\r\n Negotiating = 3,\r\n Company = 4,\r\n}\r\n\r\nexport enum CrmCompanyType {\r\n NotSelected = 0,\r\n DigitalCustomer = 1,\r\n DirectAccount = 2,\r\n Partner = 3,\r\n}\r\n\r\nexport enum CrmDigitalCustomerCategory {\r\n Shopify = 'Shopify',\r\n Magento = 'Magento',\r\n WooCommerce = 'WooCommerce',\r\n PrestaShop = 'PrestaShop',\r\n API = 'Api',\r\n VentureCapital = 'VentureCapital',\r\n Partner = 'Partner',\r\n Investor = 'Investor',\r\n Other = 'Other',\r\n}\r\n\r\nexport enum CrmAccountCategory {\r\n Reseller = 'Reseller',\r\n Platform = 'Platform',\r\n WebShop = 'WebShop',\r\n Broker = 'Broker',\r\n Carrier = 'Carrier',\r\n Postal = 'Postal',\r\n}\r\n","import { useCallback, useEffect, useMemo } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { removeBy, replaceBy } from 'utility';\r\nimport { equals } from 'ramda';\r\nimport { createCrmAction, CrmAction, dismissCrmAction, finishCrmAction, getCrmActions, updateCrmAction } from '..';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport moment from 'moment';\r\nimport { deleteCrmAction } from '.';\r\n\r\nexport const crmActionsStorePath = ['crmActions'];\r\n\r\nexport const useCrmActions = () => {\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n data: crmActions = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], crmActionsStorePath), equals);\r\n\r\n const loadCrmActions = useCallback(() =>\r\n getCrmActions()\r\n .then(allCrmActions =>\r\n dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Success,\r\n allCrmActions\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Error,\r\n []\r\n )))\r\n , [dispatch]);\r\n\r\n const addCrmAction = useCallback((crmAction: CrmAction) =>\r\n createCrmAction(crmAction)\r\n .then(createdCrmAction =>\r\n dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Success,\r\n [...crmActions, createdCrmAction]\r\n )))\r\n , [dispatch, crmActions]);\r\n\r\n const editCrmAction = useCallback((crmActionId: string, crmAction: CrmAction) =>\r\n updateCrmAction(crmActionId, crmAction)\r\n .then(updatedCrmAction =>\r\n dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', updatedCrmAction, crmActions)\r\n )))\r\n , [dispatch, crmActions]);\r\n\r\n const completeCrmAction = useCallback((crmActionId: string) =>\r\n finishCrmAction(crmActionId)\r\n .then(finishedCrmAction =>\r\n dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', finishedCrmAction, crmActions)\r\n )))\r\n , [dispatch, crmActions]);\r\n\r\n const rejectCrmAction = useCallback((crmActionId: string) =>\r\n dismissCrmAction(crmActionId)\r\n .then(rejectedCrmAction =>\r\n dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Success,\r\n [...replaceBy('id', rejectedCrmAction, crmActions)]\r\n )))\r\n , [dispatch, crmActions]);\r\n\r\n const removeCrmAction = useCallback((crmActionId: string) =>\r\n deleteCrmAction(crmActionId)\r\n .then(() =>\r\n dispatch(setAsyncResource(\r\n crmActionsStorePath,\r\n AsyncStatus.Success,\r\n removeBy('id', crmActionId, crmActions)\r\n )))\r\n , [dispatch, crmActions]);\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized) return;\r\n loadCrmActions();\r\n }, [status, loadCrmActions]);\r\n\r\n const activeCrmActions = useMemo(() =>\r\n crmActions.filter(action => moment(action.actionUtc).isSameOrBefore(moment(), 'day') && action.completedUtc === null && action.rejectedUtc === null)\r\n , [crmActions]);\r\n\r\n const upcomingCrmActions = useMemo(() =>\r\n crmActions.filter(action => moment(action.actionUtc).isAfter(moment()))\r\n , [crmActions]);\r\n\r\n const pastCrmActions = useMemo(() =>\r\n crmActions.filter(action => action.completedUtc !== null || action.rejectedUtc !== null)\r\n , [crmActions]);\r\n\r\n return {\r\n status,\r\n loadCrmActions,\r\n crmActions,\r\n activeCrmActions,\r\n upcomingCrmActions,\r\n pastCrmActions,\r\n addCrmAction,\r\n editCrmAction,\r\n completeCrmAction,\r\n rejectCrmAction,\r\n removeCrmAction,\r\n };\r\n};\r\n","import { CrmContact } from '.';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getCrmCompanyContacts = (crmCompanyId: string): Promise =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}`, undefined, HTTPMethod.GET);\r\n\r\nexport const getCrmContact = (crmCompanyId: string, crmContactId: string): Promise =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}/${crmContactId}`, undefined, HTTPMethod.GET);\r\n\r\nexport const createCrmContact = (crmCompanyId: string, crmContact: CrmContact): Promise =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}`, crmContact, HTTPMethod.POST);\r\n\r\nexport const updateCrmContact = (crmCompanyId: string, crmContactId: string, updatedCrmContact: CrmContact): Promise =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}/${crmContactId}`, updatedCrmContact, HTTPMethod.PUT);\r\n\r\nexport const revokeCrmContact = (crmCompanyId: string, crmContactId:string): Promise =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}/${crmContactId}/revoke`, undefined, HTTPMethod.PUT);\r\n\r\nexport const unRevokeCrmContact = (crmCompanyId: string, crmContactId:string): Promise =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}/${crmContactId}/unrevoke`, undefined, HTTPMethod.PUT);\r\n\r\nexport const deleteCrmContact = (crmCompanyId: string, crmContactId:string) =>\r\n apiFetch(`/CrmContacts/${crmCompanyId}/${crmContactId}`, undefined, HTTPMethod.DELETE);","import { CrmCompany, CrmCompanyStatus, CrmCompanyType } from '.';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const getCrmCompanies = (crmCompanyType?: CrmCompanyType, crmCompanyStatus?: CrmCompanyStatus): Promise =>\r\n apiFetch(`/CrmCompanies?type=${crmCompanyType || ''}&status=${crmCompanyStatus || ''}`, undefined, HTTPMethod.GET);\r\n\r\nexport const getCrmCompany = (crmCompanyId: string): Promise =>\r\n apiFetch(`/CrmCompanies/${crmCompanyId}`, undefined, HTTPMethod.GET);\r\n\r\nexport const createCrmCompany = (crmCompany: CrmCompany): Promise =>\r\n apiFetch('/CrmCompanies', crmCompany, HTTPMethod.POST);\r\n\r\nexport const updateCrmCompany = (crmCompanyId: string, updatedCrmCompany: CrmCompany): Promise =>\r\n apiFetch(`/CrmCompanies/${crmCompanyId}`, updatedCrmCompany, HTTPMethod.PUT);\r\n\r\nexport const revokeCrmCompany = (crmCompanyId:string): Promise =>\r\n apiFetch(`/CrmCompanies/${crmCompanyId}/revoke`, undefined, HTTPMethod.PUT);\r\n\r\nexport const unRevokeCrmCompany = (crmCompanyId:string): Promise =>\r\n apiFetch(`/CrmCompanies/${crmCompanyId}/unrevoke`, undefined, HTTPMethod.PUT);\r\n\r\nexport const syncCompaniesToCrm = () =>\r\n apiFetch('/CrmCompanies/syncCompanies', undefined, HTTPMethod.POST);","import { useCallback } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, setAsyncResource, selectAsyncResource} from 'store';\r\nimport { removeBy, replaceBy } from 'utility';\r\nimport { equals } from 'ramda';\r\nimport { CrmCompany, CrmContact, updateCrmCompany } from '..';\r\nimport { getCrmCompanies, createCrmCompany, revokeCrmCompany, unRevokeCrmCompany, CrmCompanyType } from '.';\r\n\r\nexport const crmCompaniesStorePath = ['crmCompanies'];\r\n\r\nexport const useCrmCompanies = () => {\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n data: crmCompanies = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], crmCompaniesStorePath), equals);\r\n\r\n const loadCrmCompanies = useCallback((crmCompanyType?: CrmCompanyType) => {\r\n //Reset current CrmCompanies and reload.\r\n dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Loading,\r\n []\r\n ));\r\n\r\n return getCrmCompanies(crmCompanyType)\r\n .then(allCrmCompanies =>\r\n dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n allCrmCompanies\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n }, [dispatch]);\r\n\r\n const addCrmCompany = useCallback((crmCompany: CrmCompany) =>\r\n createCrmCompany(crmCompany)\r\n .then(createdCrmCompany =>\r\n dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n [...crmCompanies, createdCrmCompany]\r\n )))\r\n , [dispatch, crmCompanies]);\r\n\r\n const editCrmCompany = useCallback((crmCompanyId: string, crmCompany: CrmCompany) =>\r\n updateCrmCompany(crmCompanyId, crmCompany)\r\n .then(updatedCrmCompany =>\r\n dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n crmCompanies.find(c => c.id === crmCompany.id)?.crmCompanyType === updatedCrmCompany.crmCompanyType ? replaceBy('id', updatedCrmCompany, crmCompanies) : removeBy('id', updatedCrmCompany.id, crmCompanies)\r\n )))\r\n , [dispatch, crmCompanies]);\r\n\r\n const inactivateCrmCompany = useCallback((crmCompanyId: string) =>\r\n revokeCrmCompany(crmCompanyId)\r\n .then(revokedCrmCompany =>\r\n dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', revokedCrmCompany, crmCompanies)\r\n )))\r\n , [dispatch, crmCompanies]);\r\n\r\n const activateCrmCompany = useCallback((crmCompanyId: string) =>\r\n unRevokeCrmCompany(crmCompanyId)\r\n .then(unrevokedCrmCompany =>\r\n dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', unrevokedCrmCompany, crmCompanies)\r\n )))\r\n , [dispatch, crmCompanies]);\r\n\r\n const addCrmCompanyContactState = useCallback((crmCompany: CrmCompany, createdCrmContact:CrmContact) => {\r\n const updatedCrmCompany = { ...crmCompany, crmContacts: [...crmCompany?.crmContacts || [], { ...createdCrmContact }] };\r\n return dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', updatedCrmCompany, crmCompanies)\r\n ));\r\n }\r\n , [dispatch, crmCompanies]);\r\n\r\n const updateCrmCompanyContactState = useCallback((crmCompanyProp: CrmCompany, updatedCrmContact:CrmContact) => {\r\n const crmCompany: CrmCompany = crmCompanyProp;\r\n const updatedCrmContacts: CrmContact[] = replaceBy('id', updatedCrmContact, crmCompany.crmContacts!);\r\n crmCompany.crmContacts = updatedCrmContacts;\r\n return dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', crmCompany, crmCompanies)\r\n ));\r\n }\r\n , [dispatch, crmCompanies]);\r\n\r\n const removeCrmCompanyContactState = useCallback((crmCompanyProp: CrmCompany, removedCrmContactId:string) => {\r\n const crmCompany: CrmCompany = crmCompanyProp;\r\n const updatedCrmContacts: CrmContact[] = removeBy('id', removedCrmContactId, crmCompany.crmContacts!);\r\n crmCompany.crmContacts = updatedCrmContacts;\r\n return dispatch(setAsyncResource(\r\n crmCompaniesStorePath,\r\n AsyncStatus.Success,\r\n replaceBy('id', crmCompany, crmCompanies)\r\n ));\r\n }\r\n , [dispatch, crmCompanies]);\r\n\r\n return {\r\n crmCompanies,\r\n inactivateCrmCompany,\r\n activateCrmCompany,\r\n status,\r\n addCrmCompany,\r\n editCrmCompany,\r\n loadCrmCompanies,\r\n addCrmCompanyContactState,\r\n updateCrmCompanyContactState,\r\n removeCrmCompanyContactState,\r\n };\r\n};\r\n","export interface Document {\r\n id: string\r\n companyId?: string\r\n addedUtc?: string\r\n addedByFullName?: string,\r\n name: string\r\n description: string\r\n upload?: any\r\n documentUrl?: string\r\n fileName?: string\r\n updatedUtc?: string\r\n}\r\n\r\nexport enum DocumentType {\r\n Other = 'Other',\r\n SalesDocument = 'SalesDocument',\r\n}","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { CompanyAccountManager } from './interfaces';\r\n\r\nexport const getCompanyAccountManagers = (companyId?: string) => {\r\n const url = companyId ? `/CompanyAccountManagers?companyId=${companyId}` : '/CompanyAccountManagers';\r\n return apiFetch(url);\r\n};\r\n\r\nexport const UpdateCompanyAccountManagersForCompany = (companyId: string, companyAccountManagers: CompanyAccountManager[]) =>\r\n apiFetch(`/CompanyAccountManagers/${companyId}/updateforcompany`, companyAccountManagers, HTTPMethod.PUT);","import { DocumentType } from '.';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\nimport { apiFetchFormData } from '../fetchFormData';\r\nimport { Document } from './interface';\r\n\r\nexport const getDocuments = (companyId?: string) => {\r\n const url = companyId ? `/documents?companyId=${companyId}` : '/documents';\r\n return apiFetch(url);\r\n};\r\n\r\nexport const getDocument = (documentId: string) =>\r\n apiFetch(`/documents/${documentId}`);\r\n\r\nexport const updateDocument = (document: Document) =>\r\n apiFetch('/documents', document, HTTPMethod.PUT);\r\n\r\nexport const uploadDocument = (document: Document, documentType: DocumentType = DocumentType.SalesDocument) => {\r\n const formData = new FormData();\r\n formData.append('file', document.upload.file.originFileObj);\r\n formData.append('name', document.name || '');\r\n formData.append('description', document.description || '');\r\n formData.append('documentType', documentType);\r\n if (document.companyId) formData.append('companyId', document.companyId);\r\n return apiFetchFormData('/documents', formData, HTTPMethod.POST);\r\n};\r\n\r\nexport const deleteDocument = (documentId: string) =>\r\n apiFetch(`/documents/${documentId}`, undefined, HTTPMethod.DELETE);\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { apiFetchFormData } from 'integrations/crossborderit/fetchFormData';\r\nimport { WebShopPluginModel, NewWebShopPlugin } from './interfaces';\r\nimport { UploadFile } from 'antd/lib/upload/interface';\r\n\r\nexport const getAllWebShopPlugins = () =>\r\n apiFetch('/Admin/Plugins');\r\n\r\nexport const getLatestWebShopPlugins = () =>\r\n apiFetch('/Admin/Plugins/Latest');\r\n\r\nexport const postWebShopPlugin = (newWebShopPlugin: NewWebShopPlugin, fileList: UploadFile[]): Promise => {\r\n const formData = new FormData();\r\n formData.append('file', fileList[0].originFileObj as Blob);\r\n formData.append('webShopType', newWebShopPlugin.webShopType);\r\n formData.append('version', newWebShopPlugin.version);\r\n formData.append('description', newWebShopPlugin.description);\r\n return apiFetchFormData('/Admin/Plugins', formData, HTTPMethod.POST);\r\n};\r\n\r\nexport const putWebShopPlugin = (webShopPluginModel : WebShopPluginModel\r\n) =>\r\n apiFetch('/Admin/Plugins', webShopPluginModel, HTTPMethod.PUT);\r\n\r\nexport const deleteWebShopPlugin = (\r\n webShopPluginId: string\r\n) =>\r\n apiFetch(\r\n `/Admin/Plugins/${webShopPluginId}`,\r\n undefined,\r\n HTTPMethod.DELETE\r\n );\r\n","import { Agreement } from '../agreements';\r\n\r\nexport interface Subscription {\r\n id: string;\r\n isActive: Boolean;\r\n name: string;\r\n description: string;\r\n informationUrl?: string;\r\n subscriptionInfoPoints?: SubscriptionInfoPoint[];\r\n modulesInSubscription: SubscriptionModule[];\r\n createdByUserName?: string;\r\n updatedUtc?: string;\r\n createdUtc?: string;\r\n endUtc?: string;\r\n startUtc?: string;\r\n subscriptionLengthsAndFees: SubscriptionLengthsAndFee[];\r\n subscriptionAgreements: SubscriptionAgreements[];\r\n subscriptionInitialFees: SubscriptionInitialFee[];\r\n onboardingSteps: OnboardingStep[];\r\n subscriptionModuleAccess: SubscriptionModuleAccess[];\r\n subscriptionGroupId?: string;\r\n orderInGroup: number;\r\n isSubscribable: Boolean;\r\n}\r\n\r\nexport interface SubscriptionLengthsAndFee {\r\n id?: string;\r\n subscriptionLength: SubscriptionLength;\r\n fee: number;\r\n updatedUtc?: string;\r\n isActive: Boolean;\r\n updatedById?: string;\r\n subscriptionId?: string;\r\n};\r\n\r\nexport interface SubscriptionInitialFee {\r\n id: string;\r\n name: string;\r\n description: string;\r\n type: SubscriptionInitialFeeType;\r\n initialFee: number;\r\n articleNumber: string;\r\n isActive: boolean;\r\n createdUtc: string;\r\n updatedUtc?: string;\r\n};\r\n\r\nexport enum SubscriptionInitialFeeType {\r\n NotSelected = 0,\r\n IossFee = 1,\r\n CompanySpecificFee = 2,\r\n GeneralFee = 3,\r\n}\r\n\r\nexport interface SubscriptionInfoPoint {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nexport interface SubscriptionAgreements{\r\n id: string;\r\n name: string;\r\n}\r\nexport interface options {\r\n id: string;\r\n text: string;\r\n};\r\n\r\nexport enum SubscriptionModule {\r\n None = 'None',\r\n Classification = 'Classification',\r\n Calculation = 'Calculation',\r\n Collection = 'Collection',\r\n Customs = 'Customs',\r\n}\r\n\r\nexport enum SubscriptionLength {\r\n Monthly = 'Monthly',\r\n Quarterly = 'Quarterly',\r\n Yearly = 'Yearly',\r\n}\r\n\r\nexport interface CompanySubscription {\r\n id: string,\r\n fee: number,\r\n subscriptionId: string,\r\n companySubscriptionState: CompanySubscriptionState,\r\n subscriptionLengthAndFeeId: string,\r\n subscriptionLength: SubscriptionLength,\r\n name: string,\r\n nextDebitDate?: string,\r\n modulesInSubscription: SubscriptionModule[],\r\n endsUtc?: string,\r\n unsignedAgreements: Agreement[],\r\n subscriptionModuleAccess: SubscriptionModuleAccess[],\r\n initialInvoicePaid?: boolean,\r\n createdUtc: string,\r\n initialFees: SubscriptionInitialFee[],\r\n}\r\n\r\nexport enum CompanySubscriptionState {\r\n None = 'None',\r\n Ended = 'Ended',\r\n WaitingForAgreementsToBeSigned = 'WaitingForAgreementsToBeSigned',\r\n Onboarding = 'Onboarding',\r\n AwaitingPayment = 'AwaitingPayment',\r\n Active = 'Active',\r\n};\r\n\r\nexport enum OnboardingStep {\r\n None = 'None',\r\n Company = 'Company',\r\n Contact = 'Contact',\r\n Billing = 'Billing',\r\n Merchant = 'Merchant',\r\n Addresses = 'Addresses',\r\n AML = 'AML',\r\n}\r\n\r\nexport enum SubscriptionModuleAccess {\r\n NotSelected = 'NotSelected',\r\n ClassitSmall = 'ClassitSmall',\r\n ClassitMedium = 'ClassitMedium',\r\n ClassitLarge = 'ClassitLarge',\r\n ClassitDirect = 'ClassitDirect',\r\n Ioss = 'Ioss',\r\n Ddp = 'Ddp',\r\n Ddu = 'Ddu',\r\n}\r\n\r\nexport const ClassitSubscriptionModuleAccessOrder = {\r\n [SubscriptionModuleAccess.ClassitSmall]: 0,\r\n [SubscriptionModuleAccess.ClassitMedium]: 1,\r\n [SubscriptionModuleAccess.ClassitLarge]: 2,\r\n};\r\n\r\nexport interface SubscriptionGroup {\r\n id: string;\r\n name: string;\r\n description: string;\r\n subscriptionsInGroup: SubscriptionGroupItem[];\r\n}\r\n\r\nexport interface SubscriptionGroupItem {\r\n id: string;\r\n subscriptionId: string;\r\n name: string;\r\n order: number;\r\n}","import { useCallback, useEffect } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { CbitBlogPost, getCbitBlog } from '.';\r\n\r\nconst storePath = ['cbitBlog'];\r\n\r\nexport const useCbitBlog = () => {\r\n const dispatch = useDispatch();\r\n\r\n const {\r\n status = AsyncStatus.NotInitialized,\r\n data: blogPosts = [],\r\n } = useSelector(selectAsyncResource([], storePath));\r\n\r\n const loadCbitBlog = useCallback(() => {\r\n getCbitBlog()\r\n .then(blogPosts => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n blogPosts\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n }, [dispatch]);\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized) return;\r\n loadCbitBlog();\r\n }, [status, loadCbitBlog]);\r\n\r\n return {\r\n status,\r\n blogPosts,\r\n loadCbitBlog,\r\n };\r\n};\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { CbitBlogPost } from '.';\r\n\r\nexport const getCbitBlog = (): Promise =>\r\n apiFetch('/cbit-blog', undefined, HTTPMethod.GET);","import { PaymentServiceProviderEnum } from '../collectionInvoices';\r\nimport { apiFetch, HTTPMethod, HTTPStatus } from '../fetch';\r\nimport { CompanyPaymentSolution, ZuluCard } from './interfaces';\r\n\r\nexport const getActiveCompanyPaymentSolution = (companyId: string, paymentServiceProvider: PaymentServiceProviderEnum) =>\r\n apiFetch(`/companyPaymentSolutions/${companyId}/active?paymentServiceProviderEnum=${paymentServiceProvider}`)\r\n .then((response) => {\r\n if ('status' in response && response.status === HTTPStatus.NoContent) {\r\n return undefined as unknown as CompanyPaymentSolution;\r\n } else {\r\n return response as CompanyPaymentSolution;\r\n }\r\n });\r\n\r\nexport const updateAutoDebitForCompanyPaymentSolution = (companyId: string, companyPaymentSolutionId: string, isAutoDebit: boolean) =>\r\n apiFetch(`/companyPaymentSolutions/${companyId}/${companyPaymentSolutionId}/IsAutoDebit`, isAutoDebit, HTTPMethod.PUT);\r\n\r\nexport const getZuluMaskedCardForCompany = (companyId: string): Promise =>\r\n apiFetch(`/companyPaymentSolutions/${companyId}/zuluMaskedCard`, undefined, HTTPMethod.GET);\r\n\r\nexport const syncCompanyPaymentSolutionsWithPlusius = () =>\r\n apiFetch('/companyPaymentSolutions/syncWithPlusius', undefined, HTTPMethod.PUT);\r\n","import { Agreement } from '../agreements';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\nimport { CompanySubscription, Subscription, SubscriptionInitialFee, SubscriptionGroup } from './interfaces';\r\n\r\n// Subscription endpoints\r\nexport const getAllSubscriptions = () => apiFetch('/subscriptions/');\r\n\r\nexport const getSingleSubscription = (subscriptionId: string) =>\r\n apiFetch(`/subscriptions/${subscriptionId}`);\r\n\r\nexport const postSubscription = (subscription:Subscription): Promise =>\r\n apiFetch('/subscriptions/', subscription, HTTPMethod.POST);\r\n\r\nexport const putSubscription = (subscription:Subscription): Promise =>\r\n apiFetch(`/subscriptions/${subscription.id}`, subscription, HTTPMethod.PUT);\r\n\r\n// CompanySubscriptions endpoints\r\nexport const getAllCompanySubscriptions = (companyId: string) => apiFetch(`/companies/${companyId}/subscriptions/`);\r\n\r\nexport const getAllSubscriptionsCompanyCanAccess = (companyId: string) => apiFetch(`/companies/${companyId}/subscriptions/allSubscriptionsCompanyCanAccess`);\r\n\r\nexport const getAgreementsForSubscriptions = (companyId: string, subscriptionIds: string[]) => {\r\n const queryString = subscriptionIds?.map(item => `subscriptionIds=${item}`).join('&');\r\n return apiFetch(`/companies/${companyId}/subscriptions/agreements?${queryString}`);\r\n};\r\n\r\nexport const checkCompanySubscriptionState = (companyId: string, subscriptionIds: string[]) =>\r\n apiFetch(`/companies/${companyId}/subscriptions/CheckSubscriptionStates`, subscriptionIds, HTTPMethod.PUT);\r\n\r\nexport const getUnsignedAgreementsForCompanySubscription = (companyId: string, companySubscriptionId: string) =>\r\n apiFetch(`/companies/${companyId}/subscriptions/${companySubscriptionId}/unsignedAgreements`);\r\n\r\nexport const signCompanySubscriptionAgreements = (companyId: string, companySubscriptionId: string) =>\r\n apiFetch(`/companies/${companyId}/subscriptions/${companySubscriptionId}/signAgreements`, undefined, HTTPMethod.PUT);\r\n\r\nexport const signMultipleCompanySubscriptionAgreements = (companyId: string, companySubscriptionIds: string[]) =>\r\n apiFetch(`/companies/${companyId}/subscriptions/signMultipleCompanySubscriptionAgreements`, companySubscriptionIds, HTTPMethod.PUT);\r\n\r\n// ADMIN CompanySubscriptions endpoints\r\nexport const adminAddCompanySubscription = (companyId: string, companySubscription: CompanySubscription) =>\r\n apiFetch(`/companies/${companyId}/subscriptions/adminAdd`, companySubscription, HTTPMethod.POST);\r\n\r\nexport const adminUpdateCompanySubscription = (companyId: string, companySubscription: CompanySubscription) =>\r\n apiFetch(`/companies/${companyId}/subscriptions/adminUpdate`, companySubscription, HTTPMethod.PUT);\r\n\r\n// Subscription groups endpoints\r\nexport const getSubscriptionGroups = () =>\r\n apiFetch('/subscriptionGroup');\r\n\r\nexport const getSubscriptionGroup = (subscriptionGroupId: string) =>\r\n apiFetch(`/subscriptionGroup/${subscriptionGroupId}`);\r\n\r\nexport const addSubscriptionGroup = (subscriptionGroup: SubscriptionGroup) =>\r\n apiFetch('/subscriptionGroup', subscriptionGroup, HTTPMethod.POST);\r\n\r\nexport const updateSubscriptionGroup = (subscriptionGroup: SubscriptionGroup) =>\r\n apiFetch(`/subscriptionGroup/${subscriptionGroup.id}`, subscriptionGroup, HTTPMethod.PUT);\r\n\r\nexport const removeSubscriptionGroup = (subscriptionGroupId: string) =>\r\n apiFetch(`/subscriptionGroup/${subscriptionGroupId}`, undefined, HTTPMethod.DELETE);\r\n\r\n// Subscription initialFees endpoints\r\nexport const getSubscriptionInitialFees = () =>\r\n apiFetch('/subscriptionInitialFees');\r\n\r\nexport const addSubscriptionInitialFee = (subscriptionInitialFee: SubscriptionInitialFee) =>\r\n apiFetch('/subscriptionInitialFees', subscriptionInitialFee, HTTPMethod.POST);\r\n\r\nexport const updateSubscriptionInitialFee = (subscriptionInitialFee: SubscriptionInitialFee) =>\r\n apiFetch(`/subscriptionInitialFees/${subscriptionInitialFee.id}`, subscriptionInitialFee, HTTPMethod.PUT);\r\n\r\nexport const deleteSubscriptionInitialFee = (subscriptionInitialFeeId: string) =>\r\n apiFetch(`/subscriptionInitialFees/${subscriptionInitialFeeId}`, undefined, HTTPMethod.DELETE);","export interface PayoutReport {\r\n id: string;\r\n periodReference: string;\r\n sentUtc?: string;\r\n sentBy: string;\r\n createdUtc: string;\r\n createdBy: string;\r\n numberOfPayouts: number;\r\n totalPayoutAmount: number;\r\n payouts: Payout[];\r\n}\r\n\r\nexport interface Payout {\r\n id: string;\r\n payoutStatus: PayoutStatus;\r\n skvReference: string;\r\n quoteId: string;\r\n collectionInvoiceId: string;\r\n internalPaymentReference: string;\r\n addedUtc: string;\r\n addedBy: string;\r\n sentUtc?: string;\r\n completedUtc?: string;\r\n payoutAmount: number;\r\n IossNumber: string;\r\n companyName: string;\r\n errors: Errors[];\r\n}\r\n\r\ninterface Errors {\r\n message: string;\r\n createdUtc: string;\r\n}\r\n\r\nexport enum PayoutStatus {\r\n Added = 0,\r\n Sent = 1,\r\n Failed = 2,\r\n Completed = 3,\r\n}","import { apiFetch, HTTPMethod } from '../fetch';\r\n\r\nexport const sendPhoneNumberVerification = (phoneNumber: string, companyId: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/sendPhoneNumberVerification`, phoneNumber, HTTPMethod.POST);\r\n\r\nexport const verifyCompanyPhoneNumber = (phoneNumber: string, verificationCode: string, companyId: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/verifyCompanyPhoneNumber?verificationCode=${verificationCode}`, phoneNumber, HTTPMethod.PUT);\r\n\r\nexport const sendCompanyEmailAddressVerification = (phoneNumber: string, companyId: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/sendCompanyEmailAddressVerification`, phoneNumber, HTTPMethod.POST);\r\n\r\nexport const verifyCompanyEmailAddress = (emailAddress: string, verificationCode: string, companyId: string, contactId: string = ''): Promise =>\r\n apiFetch(`/Verification/${companyId}/verifyCompanyEmailAddress?verificationCode=${verificationCode}&contactId=${contactId}`, emailAddress, HTTPMethod.PUT);\r\n\r\nexport const setCompanyEmailAddressAsVerified = (companyId: string, emailAddress: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/setCompanyEmailAddressAsVerified`, emailAddress, HTTPMethod.PUT);\r\n\r\nexport const getVerifiedCompanyPhoneNumbers = (companyId: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/verifiedCompanyPhoneNumbers`);\r\n\r\nexport const setCompanyPhoneNumberAsVerified = (companyId: string, phoneNumber: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/setCompanyPhoneNumberAsVerified`, phoneNumber, HTTPMethod.PUT);\r\n\r\nexport const getVerifiedCompanyEmailAddresses = (companyId: string): Promise =>\r\n apiFetch(`/Verification/${companyId}/verifiedCompanyEmailAddresses`);","import { apiFetch, HTTPMethod } from 'integrations/crossborderit/fetch';\r\nimport { InitiatePayoutResult } from '../collectionInvoices';\r\nimport { PayoutReport, Payout } from './interfaces';\r\n\r\nexport const getPayoutReports = ():Promise => apiFetch('/payouts');\r\n\r\nexport const getPayoutReport = (payoutReportId: string):Promise => apiFetch(`/payouts/${payoutReportId}`);\r\n\r\nexport const getPayoutsForReport = (payoutReportId: string):Promise => apiFetch(`/payouts/${payoutReportId}/payoutList`);\r\n\r\nexport const createPayoutReport = (payoutReportModel: PayoutReport):Promise => apiFetch('/payouts', payoutReportModel, HTTPMethod.POST);\r\n\r\nexport const addStatementPayoutsToReport = (payoutReportId: string, statementsIds: string[]):Promise => apiFetch(`/payouts/${payoutReportId}/addPayouts`, statementsIds, HTTPMethod.POST);\r\n\r\nexport const removePayoutFromReport = (payoutReportId: string, payoutId: string) => apiFetch(`/payouts/${payoutReportId}/payout/${payoutId}/removePayout`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const removePayoutReport = (payoutReportId: string) => apiFetch(`/payouts/${payoutReportId}/removePayoutReport`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const sendPayoutReport = (payoutReportId: string):Promise => apiFetch(`/payouts/${payoutReportId}/sendPayoutReport`, undefined, HTTPMethod.PUT);\r\n\r\nexport const sendPayout = (payoutId: string):Promise => apiFetch(`/payouts/payout/${payoutId}/send`, undefined, HTTPMethod.PUT);\r\n\r\nexport const updatePayout = (payout: Payout):Promise => apiFetch(`/payouts/payout/${payout.id}`, payout, HTTPMethod.PUT);","export interface Message {\r\n from: string;\r\n header: string;\r\n id: string;\r\n isImportant: boolean;\r\n isRead: boolean;\r\n messageText: string;\r\n messageType: MessageType;\r\n payload?: ClassificationJobFinishedPayload;\r\n received: string;\r\n}\r\n\r\nexport enum MessageType {\r\n ClassificationJobFinished = 1,\r\n}\r\n\r\nexport interface ClassificationJobFinishedPayload {\r\n customerId?: string;\r\n companyId?: string;\r\n numberOfCompletedProducts?: number;\r\n numberOfFailedProducts?: number;\r\n numberOfProductsSubmitted?: number;\r\n submitId?: string;\r\n submittedCountries?: string[];\r\n}\r\n","import './index.css';\r\n\r\nexport const Logo = ({ className = '', symbol = false, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n","import { useState, useEffect, useRef, FunctionComponent, CSSProperties } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport { Menu, Dropdown } from 'antd';\r\nimport { cond, equals } from 'ramda';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AppState, setBreadcrumbs, AsyncStatus} from 'store';\r\nimport { Switch, Case } from 'components/shared/switch';\r\nimport { Customer, useCustomers } from 'integrations/crossborderit';\r\nimport { Text } from '@fluentui/react';\r\nimport './Breadcrumb.css';\r\n\r\nexport interface BreadcrumbItem {\r\n text: string;\r\n href?: string;\r\n links?: {\r\n text: string;\r\n href: string;\r\n }[];\r\n}\r\n\r\nexport interface CustomersBreadcrumbItem extends BreadcrumbItem {\r\n text: '@customer';\r\n companyId: string;\r\n customerCompanyId: string;\r\n}\r\n\r\nconst selectBreadcrumb = (state: AppState) =>\r\n (state?.breadcrumbs || []).filter((breadcrumb) => !!breadcrumb.text);\r\n\r\nexport const Breadcrumb: FunctionComponent<{ style?: CSSProperties }> = (\r\n props\r\n) => {\r\n const breadcrumbs = useSelector(selectBreadcrumb);\r\n return (\r\n
    \r\n {breadcrumbs.map(\r\n cond([\r\n [\r\n (item) => item.text === '@customer',\r\n (item) => (\r\n \r\n ),\r\n ],\r\n [\r\n (item) => !!item.links,\r\n (item, i) => ,\r\n ],\r\n [\r\n (item) => !!item.href,\r\n (item, i) => ,\r\n ],\r\n [\r\n () => true,\r\n (item, i) => (\r\n \r\n {item.text}\r\n \r\n ),\r\n ],\r\n ])\r\n )}\r\n
\r\n );\r\n};\r\n\r\nconst DropdownItem = ({\r\n links,\r\n}: {\r\n links: { text: string; href: string }[];\r\n}) => {\r\n const [head, ...rest] = links;\r\n\r\n const renderSingle = () => (\r\n
  • \r\n {head.text}\r\n
  • \r\n );\r\n\r\n const renderWithDropdown = () => (\r\n
  • \r\n \r\n {rest.map((link) => (\r\n \r\n {link.text}\r\n \r\n ))}\r\n \r\n }\r\n >\r\n {head.text}\r\n \r\n
  • \r\n );\r\n\r\n return rest.length === 0 ? renderSingle() : renderWithDropdown();\r\n};\r\n\r\nconst LinkItem = ({ item }: { item: { text: string; href?: string } }) => (\r\n
  • \r\n {item.text}\r\n
  • \r\n);\r\n\r\ninterface CustomersProps {\r\n companyId: string;\r\n customerCompanyId: string;\r\n}\r\n\r\nconst Customers = ({ companyId, customerCompanyId }: CustomersProps) => {\r\n const [customer, setCustomer] = useState();\r\n const {activeCustomers, status} = useCustomers(companyId);\r\n\r\n const renderSingle = () => (\r\n
  • {customer?.companyName}
  • \r\n );\r\n\r\n const renderWithDropdown = () => {\r\n const menu = (\r\n \r\n {activeCustomers.map((customer) => (\r\n \r\n \r\n {customer.companyName}\r\n \r\n \r\n ))}\r\n \r\n );\r\n\r\n return (\r\n
  • \r\n \r\n \r\n {customer?.companyName}\r\n \r\n \r\n
  • \r\n );\r\n };\r\n\r\n useEffect(() => {\r\n setCustomer(activeCustomers.find(customer => customer.companyId === customerCompanyId));\r\n }, [customerCompanyId, activeCustomers]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {activeCustomers.length === 1\r\n ? renderSingle()\r\n : renderWithDropdown()\r\n }\r\n \r\n \r\n );\r\n};\r\n\r\nexport const useBreadcrumb = (\r\n breadcrumb: (BreadcrumbItem | CustomersBreadcrumbItem)[]\r\n) => {\r\n const previousBreadcrumbRef = useRef();\r\n const dispatch = useDispatch();\r\n\r\n useEffect(() => {\r\n // equals function checks for deep comparison and not object reference\r\n if (!equals(previousBreadcrumbRef.current, breadcrumb)) {\r\n previousBreadcrumbRef.current = breadcrumb;\r\n dispatch(setBreadcrumbs(breadcrumb));\r\n }\r\n }, [breadcrumb, dispatch]);\r\n};\r\n","import { Link } from 'react-router-dom';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useSelector } from 'react-redux';\r\nimport {\r\n Persona,\r\n PersonaSize,\r\n DefaultEffects,\r\n Icon,\r\n Stack,\r\n Text,\r\n} from '@fluentui/react';\r\nimport { Menu, Dropdown, Divider } from 'antd';\r\nimport { AppState } from 'store';\r\nimport { ApplicationPaths, User, AppVersion } from 'integrations/crossborderit';\r\nimport './UserMenu.css';\r\n\r\ninterface Props {\r\n user?: User;\r\n appVersion?: AppVersion;\r\n}\r\n\r\nconst selectUserMenuProps = (state: AppState): Props => ({\r\n user: state.user,\r\n appVersion: state.appVersion,\r\n});\r\n\r\nexport const UserMenu = () => {\r\n const { t } = useTranslation();\r\n const { user, appVersion } = useSelector(selectUserMenuProps);\r\n\r\n const UserMenu = () => (\r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n {t('Manage account')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {t('Logout')}\r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n {appVersion?.environment}: {appVersion?.version}\r\n \r\n
    \r\n \r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { FunctionComponent, useEffect, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Link, useHistory, useLocation } from 'react-router-dom';\r\nimport { Logo } from 'components/logo';\r\nimport { Breadcrumb } from './Breadcrumb';\r\nimport {\r\n ApplicationPaths,\r\n UserRole,\r\n} from 'integrations/crossborderit';\r\nimport { Authentication, useAuthenticationStatus } from 'components/apiAuthorization';\r\nimport { UserMenu } from './UserMenu';\r\nimport { Notifications } from 'components/notifications';\r\nimport { Stack, IconButton, TooltipHost } from '@fluentui/react';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsUserInRole } from 'store';\r\nimport { Help } from './Help';\r\nimport './Header.css';\r\nimport { ScreenSize, useScreenSize } from 'components/shared/layout/useScreenSize';\r\nimport { Case, Switch } from 'components/shared/switch';\r\n\r\nconst menuIconsStyle = {\r\n color: 'hsl(0, 0%, 100%)',\r\n fontSize: '18px',\r\n height: '100%',\r\n};\r\n\r\nexport enum HeaderTheme {\r\n Dark = 'dark',\r\n Light = 'light',\r\n}\r\ninterface Props {\r\n showRightSideMenu?: boolean;\r\n headerTheme?: HeaderTheme;\r\n className?: string;\r\n logoNavLink?: string;\r\n openCompanyNotes?: () => void;\r\n toggleExtraSmallSidebar?: () => void;\r\n}\r\n\r\nexport const Header: FunctionComponent = ({\r\n showRightSideMenu = true,\r\n logoNavLink = undefined,\r\n headerTheme = HeaderTheme.Dark,\r\n className = '',\r\n openCompanyNotes,\r\n toggleExtraSmallSidebar = () => { },\r\n}) => {\r\n const { t } = useTranslation();\r\n const history = useHistory();\r\n const authenticationStatus = useAuthenticationStatus();\r\n const isCbitAdmin = useSelector(selectIsUserInRole(UserRole.Employee));\r\n const location = useLocation();\r\n const isCompanyPage = location.pathname.startsWith('/workspace/');\r\n const [path, setPath] = useState();\r\n const { screenSize } = useScreenSize();\r\n\r\n useEffect(() => {\r\n if (path) {\r\n toggleExtraSmallSidebar();\r\n }\r\n setPath(location.pathname);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [location]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {authenticationStatus === Authentication.Authenticated ? (\r\n \r\n \r\n \r\n )\r\n : (\r\n \r\n Login\r\n )}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {showRightSideMenu && (\r\n \r\n {authenticationStatus === Authentication.Authenticated ? (\r\n \r\n
    \r\n {isCbitAdmin && (\r\n \r\n history.push('/admin')}\r\n className=\"cbit-header-menu__button\"\r\n />\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {isCbitAdmin && isCompanyPage\r\n && \r\n \r\n \r\n }\r\n
    \r\n \r\n \r\n ) : (\r\n \r\n Login\r\n \r\n )}\r\n \r\n )}\r\n \r\n
    \r\n \r\n \r\n \r\n );\r\n};","import { FunctionComponent, useState, CSSProperties } from 'react';\r\nimport { Divider, Dropdown } from 'antd';\r\nimport {\r\n DefaultEffects,\r\n Pivot,\r\n PivotItem,\r\n Stack,\r\n IconButton,\r\n} from '@fluentui/react';\r\nimport { Link } from 'react-router-dom';\r\nimport { removeById } from 'utility';\r\nimport { putMarkMessageAsRead } from '../../integrations/crossborderit/userMessage/api';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n Message,\r\n MessageType,\r\n} from 'integrations/crossborderit/userMessage/interfaces';\r\nimport { TimeAgo } from 'components/shared/display';\r\nimport { Text } from '@fluentui/react/lib/Text';\r\n\r\ninterface NotificationsProps {\r\n iconStyle?: CSSProperties;\r\n iconClassName?: string;\r\n}\r\n\r\nexport const Notifications: FunctionComponent = ({\r\n iconClassName = '',\r\n iconStyle,\r\n}) => {\r\n const { t } = useTranslation();\r\n const [numberOfUnreadMessages, setNumberOfUnreadMessages]\r\n = useState();\r\n const [unreadMessages, setUnreadMessages] = useState([]);\r\n const [readMessages, setReadMessages] = useState([]);\r\n const [dropdownVisible, setDropDownVisible] = useState(false);\r\n\r\n const messages = () => (\r\n \r\n \r\n {unreadMessages.length === 0 ? (\r\n \r\n
    \r\n {t('You have no unread messages')}\r\n
    \r\n \r\n ) : (\r\n \r\n {unreadMessages.map((message) => (\r\n
    \r\n \r\n {message.messageType\r\n === MessageType.ClassificationJobFinished ? (\r\n openMessage(message)}\r\n >\r\n {message.header}{' '}\r\n \r\n ) : (\r\n {message.header}\r\n )}\r\n \r\n \r\n \r\n
    \r\n ))}\r\n \r\n )}\r\n\r\n e.preventDefault()}\r\n >\r\n {readMessages.length === 0 ? (\r\n
    \r\n {t('You have no read messages')}\r\n
    \r\n ) : (\r\n readMessages.map((message) => (\r\n \r\n \r\n {message.messageType === 1 ? (\r\n openMessage(message)}\r\n >\r\n {message.header}{' '}\r\n \r\n ) : (\r\n {message.header}\r\n )}\r\n\r\n \r\n \r\n\r\n \r\n \r\n ))\r\n )}\r\n \r\n \r\n \r\n );\r\n\r\n const openMessage = (message: Message) => {\r\n if (!message.isRead) {\r\n markAsRead(message);\r\n setNumberOfUnreadMessages((prev) => prev && prev - 1);\r\n }\r\n setDropDownVisible(false);\r\n };\r\n\r\n const handleMenuClick = (e: any) => {\r\n if (e.key === '1' || e.key === '2') {\r\n setDropDownVisible(true);\r\n }\r\n };\r\n\r\n const markAsRead = (message: Message) => {\r\n putMarkMessageAsRead(message.id).then(() => {\r\n setUnreadMessages(removeById(message.id, unreadMessages));\r\n setReadMessages((prev) => [...prev, message]);\r\n });\r\n };\r\n\r\n // Disabling notifications for now, there are some issues we need to look into\r\n // Related bugs: #1028\r\n // useEffect(() => {\r\n // if (!isInactiveUser) {\r\n // getAllMessagesForUser().then((messages) => {\r\n // setUnreadMessages(\r\n // messages.filter((message) => message.isRead === false)\r\n // );\r\n // setReadMessages(messages.filter((message) => message.isRead === true));\r\n // });\r\n //\r\n // getNumberOfUnreadMessages().then(setNumberOfUnreadMessages);\r\n // } else {\r\n // setUnreadMessages([]);\r\n // setReadMessages([]);\r\n // }\r\n // }, [isInactiveUser]);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { Message } from './interfaces';\r\n\r\nexport const getAllMessagesForUser = (): Promise =>\r\n apiFetch('/user/messages');\r\n\r\nexport const putMarkMessageAsRead = (messageId: string) =>\r\n apiFetch(`/user/messages?messageId=${messageId}`, undefined, HTTPMethod.PUT);\r\n\r\nexport const getNumberOfUnreadMessages = (): Promise =>\r\n apiFetch('/user/messages/count/');\r\n","import { Divider, Dropdown } from 'antd';\r\nimport { FunctionComponent, useState, CSSProperties } from 'react';\r\nimport { DefaultEffects, IconButton } from '@fluentui/react';\r\nimport { Link } from 'react-router-dom';\r\nimport { selectCompanyId } from 'store';\r\nimport { useSelector } from 'react-redux';\r\nimport { UserRole } from 'integrations/crossborderit';\r\n\r\ninterface HelpProps {\r\n iconClassName: string;\r\n iconStyle: CSSProperties;\r\n iconName: string;\r\n}\r\n\r\nexport const Help: FunctionComponent = ({\r\n iconClassName,\r\n iconStyle,\r\n iconName,\r\n}) => {\r\n const [dropdownVisible, setDropdownVisible] = useState(false);\r\n\r\n /*\r\n A superadmin is not connected to any company id,\r\n so we generate this companyId below to make the feedback function visible\r\n when a superadmin is active on a company in the UI\r\n */\r\n const { companyId } = useSelector(selectCompanyId);\r\n\r\n const helpDropdown = () => (\r\n \r\n
    \r\n FAQ\r\n
    \r\n\r\n {(companyId || !UserRole.SuperAdmin) && <>
    \r\n Feedback\r\n
    }\r\n\r\n \r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n","export enum UserRole {\r\n Employee = 'Employee',\r\n SuperAdmin = 'SuperAdmin',\r\n}\r\n\r\nexport interface User {\r\n name: string;\r\n email: string;\r\n /* eslint-disable camelcase */\r\n family_name?: string;\r\n given_name?: string;\r\n /* eslint-enable camelcase */\r\n sub: string;\r\n role: UserRole[];\r\n}\r\n","export const ApplicationName = 'Cbit.Classifier.Web';\r\n\r\nexport const QueryParameterNames = {\r\n ReturnUrl: 'returnUrl',\r\n Message: 'message',\r\n};\r\n\r\nexport const LogoutActions = {\r\n LogoutCallback: 'logout-callback',\r\n Logout: 'logout',\r\n LoggedOut: 'logged-out',\r\n};\r\n\r\nexport const LoginActions = {\r\n Login: 'login',\r\n LoginCallback: 'login-callback',\r\n LoginFailed: 'login-failed',\r\n Profile: 'profile',\r\n};\r\n\r\nconst prefix = '/authentication';\r\n\r\nexport const ApplicationPaths = {\r\n DefaultLoginRedirectPath: '/',\r\n ApiAuthorizationClientConfigurationUrl: `_configuration/${ApplicationName}`,\r\n ApiAuthorizationPrefix: prefix,\r\n Login: `${prefix}/${LoginActions.Login}`,\r\n LoginFailed: `${prefix}/${LoginActions.LoginFailed}`,\r\n LoginCallback: `${prefix}/${LoginActions.LoginCallback}`,\r\n Profile: `${prefix}/${LoginActions.Profile}`,\r\n LogOut: `${prefix}/${LogoutActions.Logout}`,\r\n LoggedOut: `${prefix}/${LogoutActions.LoggedOut}`,\r\n LogOutCallback: `${prefix}/${LogoutActions.LogoutCallback}`,\r\n IdentityManagePath: 'Identity/Account/Manage',\r\n ResetPassword: 'Identity/Account/ForgotPassword',\r\n};\r\n","import { UserManager, WebStorageStateStore } from 'oidc-client';\r\nimport { ApplicationPaths, ApplicationName } from './constants';\r\n\r\nexport class AuthorizeService {\r\n _callbacks = [];\r\n _nextSubscriptionId = 0;\r\n _user = null;\r\n _isAuthenticated = false;\r\n\r\n // By default pop ups are disabled because they don't work properly on Edge.\r\n // If you want to enable pop up authentication simply set this flag to false.\r\n _popUpDisabled = true;\r\n\r\n async isAuthenticated () {\r\n const user = await this.getUser();\r\n return !!user;\r\n }\r\n\r\n async getUser () {\r\n if (this._user && this._user.profile) {\r\n return this._user.profile;\r\n }\r\n\r\n await this.ensureUserManagerInitialized();\r\n const user = await this.userManager.getUser();\r\n return user && user.profile;\r\n }\r\n\r\n async getAccessToken () {\r\n await this.ensureUserManagerInitialized();\r\n const user = await this.userManager.getUser();\r\n return user && user.access_token;\r\n }\r\n\r\n // We try to authenticate the user in three different ways:\r\n // 1) We try to see if we can authenticate the user silently. This happens\r\n // when the user is already logged in on the IdP and is done using a hidden iframe\r\n // on the client.\r\n // 2) We try to authenticate the user using a PopUp Window. This might fail if there is a\r\n // Pop-Up blocker or the user has disabled PopUps.\r\n // 3) If the two methods above fail, we redirect the browser to the IdP to perform a traditional\r\n // redirect flow.\r\n async signIn (state) {\r\n await this.ensureUserManagerInitialized();\r\n try {\r\n const silentUser = await this.userManager.signinSilent(this.createArguments());\r\n this.updateState(silentUser);\r\n return this.success(state);\r\n } catch (silentError) {\r\n // User might not be authenticated, fallback to popup authentication\r\n console.log('Silent authentication error: ', silentError);\r\n\r\n try {\r\n if (this._popUpDisabled) {\r\n throw new Error('Popup disabled. Change \\'AuthorizeService.js:AuthorizeService._popupDisabled\\' to false to enable it.');\r\n }\r\n\r\n const popUpUser = await this.userManager.signinPopup(this.createArguments());\r\n this.updateState(popUpUser);\r\n return this.success(state);\r\n } catch (popUpError) {\r\n if (popUpError.message === 'Popup window closed') {\r\n // The user explicitly cancelled the login action by closing an opened popup.\r\n return this.error('The user closed the window.');\r\n } else if (!this._popUpDisabled) {\r\n console.log('Popup authentication error: ', popUpError);\r\n }\r\n\r\n // PopUps might be blocked by the user, fallback to redirect\r\n try {\r\n await this.userManager.signinRedirect(this.createArguments(state));\r\n return this.redirect();\r\n } catch (redirectError) {\r\n console.log('Redirect authentication error: ', redirectError);\r\n return this.error(redirectError);\r\n }\r\n }\r\n }\r\n }\r\n\r\n async completeSignIn (url) {\r\n try {\r\n await this.ensureUserManagerInitialized();\r\n const user = await this.userManager.signinCallback(url);\r\n this.updateState(user);\r\n return this.success(user && user.state);\r\n } catch (error) {\r\n console.log('There was an error signing in: ', error);\r\n return this.error('There was an error signing in.');\r\n }\r\n }\r\n\r\n // We try to sign out the user in two different ways:\r\n // 1) We try to do a sign-out using a PopUp Window. This might fail if there is a\r\n // Pop-Up blocker or the user has disabled PopUps.\r\n // 2) If the method above fails, we redirect the browser to the IdP to perform a traditional\r\n // post logout redirect flow.\r\n async signOut (state) {\r\n await this.ensureUserManagerInitialized();\r\n try {\r\n if (this._popUpDisabled) {\r\n throw new Error('Popup disabled. Change \\'AuthorizeService.js:AuthorizeService._popupDisabled\\' to false to enable it.');\r\n }\r\n\r\n await this.userManager.signoutPopup(this.createArguments());\r\n this.updateState(undefined);\r\n return this.success(state);\r\n } catch (popupSignOutError) {\r\n console.log('Popup signout error: ', popupSignOutError);\r\n try {\r\n await this.userManager.signoutRedirect(this.createArguments(state));\r\n return this.redirect();\r\n } catch (redirectSignOutError) {\r\n console.log('Redirect signout error: ', redirectSignOutError);\r\n return this.error(redirectSignOutError);\r\n }\r\n }\r\n }\r\n\r\n async completeSignOut (url) {\r\n await this.ensureUserManagerInitialized();\r\n try {\r\n const response = await this.userManager.signoutCallback(url);\r\n this.updateState(null);\r\n return this.success(response && response.data);\r\n } catch (error) {\r\n console.log(`There was an error trying to log out '${error}'.`);\r\n return this.error(error);\r\n }\r\n }\r\n\r\n updateState (user) {\r\n this._user = user;\r\n this._isAuthenticated = !!this._user;\r\n this.notifySubscribers();\r\n }\r\n\r\n subscribe (callback) {\r\n this._callbacks.push({\r\n callback,\r\n subscription: this._nextSubscriptionId++, // eslint-disable-line no-plusplus\r\n });\r\n return this._nextSubscriptionId - 1;\r\n }\r\n\r\n unsubscribe (subscriptionId) {\r\n const subscriptionIndex = this._callbacks\r\n .map((element, index) => (element.subscription === subscriptionId ? { found: true, index } : { found: false }))\r\n .filter((element) => element.found === true);\r\n if (subscriptionIndex.length !== 1) {\r\n throw new Error(`Found an invalid number of subscriptions ${subscriptionIndex.length}`);\r\n }\r\n\r\n this._callbacks.splice(subscriptionIndex[0].index, 1);\r\n }\r\n\r\n notifySubscribers () {\r\n for (let i = 0; i < this._callbacks.length; i++) { // eslint-disable-line no-plusplus\r\n const callback = this._callbacks[i].callback;\r\n callback();\r\n }\r\n }\r\n\r\n createArguments (state) {\r\n return { useReplaceToNavigate: true, data: state };\r\n }\r\n\r\n error (message) {\r\n return { status: AuthenticationResultStatus.Fail, message };\r\n }\r\n\r\n success (state) {\r\n return { status: AuthenticationResultStatus.Success, state };\r\n }\r\n\r\n redirect () {\r\n return { status: AuthenticationResultStatus.Redirect };\r\n }\r\n\r\n async ensureUserManagerInitialized () {\r\n if (this.userManager !== undefined) {\r\n return;\r\n }\r\n\r\n const response = await fetch(ApplicationPaths.ApiAuthorizationClientConfigurationUrl);\r\n if (!response.ok) {\r\n throw new Error(`Could not load settings for '${ApplicationName}'`);\r\n }\r\n\r\n const settings = await response.json();\r\n settings.automaticSilentRenew = true;\r\n settings.includeIdTokenInSilentRenew = true;\r\n settings.userStore = new WebStorageStateStore({\r\n prefix: ApplicationName,\r\n });\r\n\r\n this.userManager = new UserManager(settings);\r\n\r\n this.userManager.events.addUserSignedOut(async () => {\r\n await this.userManager.removeUser();\r\n this.updateState(undefined);\r\n });\r\n }\r\n\r\n static get instance () {\r\n return authService;\r\n }\r\n}\r\n\r\nexport const authService = new AuthorizeService();\r\n\r\nexport const AuthenticationResultStatus = {\r\n Redirect: 'redirect',\r\n Success: 'success',\r\n Fail: 'fail',\r\n};\r\n","import { useCallback, useEffect } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AppState, AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { UserPreferences } from './interfaces';\r\nimport { getUserPreferencesAsync, updateUserPreferencesAsync } from './api';\r\nimport { User } from '..';\r\n\r\nconst storePath = ['userPreferences'];\r\nconst selectUserMenuProps = (state: AppState): { user?: User; } => ({\r\n user: state.user,\r\n});\r\n\r\nexport const useUserPreferences = () => {\r\n const dispatch = useDispatch();\r\n const { user } = useSelector(selectUserMenuProps);\r\n\r\n const {\r\n status = AsyncStatus.NotInitialized,\r\n data: preferences = { maskCompanyData: false },\r\n } = useSelector(selectAsyncResource({ maskCompanyData: false }, storePath));\r\n\r\n const updateUserPreferences = useCallback((userPreferencesToUpdate: UserPreferences) => {\r\n if (user) {\r\n return updateUserPreferencesAsync({ ...userPreferencesToUpdate, userId: user.sub })\r\n .then(() => {\r\n dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n userPreferencesToUpdate\r\n ));\r\n });\r\n }\r\n }, [dispatch, user]);\r\n\r\n const loadUserPreferences = useCallback(() => {\r\n if (user && user.sub) getUserPreferencesAsync(user.sub)\r\n .then(prefrences => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Success,\r\n prefrences\r\n )))\r\n .catch(() => dispatch(setAsyncResource(\r\n storePath,\r\n AsyncStatus.Error,\r\n []\r\n )));\r\n }, [dispatch, user]);\r\n\r\n const formatCompanyName = useCallback((name: string) =>\r\n (preferences.maskCompanyData && !!name) ? '*****' : name, [preferences]);\r\n\r\n useEffect(() => {\r\n if (status !== AsyncStatus.NotInitialized || !user) return;\r\n loadUserPreferences();\r\n }, [status, loadUserPreferences, user]);\r\n\r\n return {\r\n status,\r\n preferences,\r\n loadUserPreferences,\r\n updateUserPreferences,\r\n formatCompanyName,\r\n };\r\n};\r\n","import { HTTPMethod, apiFetch } from '../fetch';\r\nimport { UserPreferences } from './interfaces';\r\n\r\nexport const getUserPreferencesAsync = (userId: string): Promise =>\r\n apiFetch(`/userPreferences/${userId}`);\r\n\r\nexport const createUserPreferencesAsync = (userPreferences: UserPreferences): Promise =>\r\n apiFetch('/userPreferences/', userPreferences, HTTPMethod.POST);\r\n\r\nexport const updateUserPreferencesAsync = (userPreferences: UserPreferences): Promise =>\r\n apiFetch('/userPreferences/', userPreferences, HTTPMethod.PUT);","export const cbitSupportEmail = 'support@crossborderit.com';\r\n\r\n","import { useState, useEffect } from 'react';\r\nimport { authService } from 'integrations/crossborderit';\r\n\r\nexport enum Authentication {\r\n Authenticating = 'Authenticating',\r\n Authenticated = 'Authenticated',\r\n NotAuthenticated = 'NotAuthenticated',\r\n}\r\n\r\nexport const useAuthenticationStatus = () => {\r\n const [status, setStatus] = useState(Authentication.Authenticating);\r\n\r\n useEffect(() => {\r\n\r\n const subscription = authService.subscribe(() => {\r\n setStatus(Authentication.Authenticating);\r\n\r\n authService.isAuthenticated().then(isAuthenticated => {\r\n setStatus(isAuthenticated\r\n ? Authentication.Authenticated\r\n : Authentication.NotAuthenticated\r\n );\r\n });\r\n\r\n });\r\n\r\n authService.isAuthenticated().then(isAuthenticated => {\r\n setStatus(isAuthenticated\r\n ? Authentication.Authenticated\r\n : Authentication.NotAuthenticated\r\n );\r\n });\r\n\r\n return () => authService.unsubscribe(subscription);\r\n }, []);\r\n\r\n return status;\r\n};\r\n","import { PartialTheme, useTheme as useFluentTheme } from '@fluentui/react';\r\n\r\nexport interface CbitTheme extends PartialTheme {\r\n breakpoints: {\r\n large?: number;\r\n medium: number;\r\n small: number;\r\n extraSmall: number;\r\n };\r\n}\r\n\r\nexport const useTheme = () => useFluentTheme() as CbitTheme;\r\n","import { CbitTheme } from './theme';\r\n\r\nexport const cbitDefaultTheme: CbitTheme = {\r\n breakpoints: {\r\n large: 1920,\r\n medium: 1440,\r\n small: 700,\r\n extraSmall: 480,\r\n },\r\n};\r\n","import { registerIcons } from '@fluentui/react/lib/Styling';\r\nimport plusiusLogo from './plusisus_logo.png';\r\n\r\nexport function initializeCustomIcons () {\r\n registerIcons({\r\n icons: {\r\n PlusiusLogo: (\"P\"),\r\n cbitIcon: (\r\n \r\n \r\n \r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055l6GdGQqprR0n6HQ9Oz3LrBt+nmrxu9TCPb+8xpdjLs5b2mnJ0T17KvTzwtIdeOfDDBOV2tGpmyx2vcqznGH+VwvgRfPD9K+e1kOH/yKSkpbuXnnu/H2WEDb0IYNqlXvUFb0FAIQARK0gQAAJ6EYCI9aoveAsCCgGIWEGCABDQiwBErFd9wVsQUAhAxAoSBICAXgQgYr3qC96CgEIAIlaQIAAE9CIAEetVX/AWBBQCELGCBAEgoBcBiFiv+oK3IKAQgIgVJAgAAb0IQMR61Re8BQGFAESsIEEACOhFACLWq77gLQgoBCBiBQkCQEAvAhCxXvUFb0FAIQARK0gQAAJ6EYCI9aoveAsCCgGIWEGCABDQiwBErFd9wVsQUAhAxAoSBICAXgQgYr3qC96CgEIAIlaQIAAE9CIAEetVX/AWBBQCELGCBAEgoBcBiFiv+oK3IKAQgIgVJAgAAb0IQMR61Re8BQGFAESsIEEACOhFACLWq77gLQgoBCBiBQkCQEAvAhCxXvUFb0FAIQARK0gQAAJ6EYCI9aoveAsCCgGIWEGCABDQiwBErFd9wVsQUAhAxAoSBICAXgQgYr3qC96CgEIAIlaQIAAE9CIAEetVX/AWBBQCELGCBAEgoBcBiFiv+oK3IKAQgIgVJAgAAb0IQMR61Re8BQGFAESsIEEACOhFACLWq77gLQgoBCBiBQkCQEAvAhCxXvUFb0FAIQARK0gQAAJ6Efg/mjS858d25VMAAAAASUVORK5CYII=\"","export enum AsyncStatus {\r\n NotInitialized = 'NotInitialized',\r\n NotAuthenticated = 'NotAuthenticated',\r\n Loading = 'Loading',\r\n Error = 'Error',\r\n Success = 'Success',\r\n}\r\n\r\nexport interface AsyncResource {\r\n status?: AsyncStatus;\r\n data?: T;\r\n}\r\n","import { FunctionComponent } from 'react';\r\n\r\ninterface Props {\r\n data?: string;\r\n match?: (string | number | undefined)[];\r\n component?: JSX.Element;\r\n}\r\n\r\nexport const Case: FunctionComponent = ({\r\n data,\r\n match = [],\r\n children,\r\n component,\r\n}) => <>{match.includes(data) && (component || children)};\r\n","import { ReactElement, Children, cloneElement } from 'react';\r\n\r\ninterface Props {\r\n on: string | number;\r\n children: ReactElement[];\r\n}\r\n\r\nexport const Switch = ({ on, children }: Props) => (\r\n <>\r\n {Children.map(children, (child) =>\r\n cloneElement(child, { data: on })\r\n )}\r\n \r\n);\r\n","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { CompanyContact } from '../companies/interfaces';\r\n\r\nexport const getContacts = (companyId: string): Promise =>\r\n apiFetch(`/companies/${companyId}/contacts/`);\r\n\r\nexport const deleteContact = (companyId: string, contactId: string): Promise =>\r\n apiFetch(`/companies/${companyId}/contacts/${contactId}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const postContact = (companyId: string, contact: CompanyContact): Promise =>\r\n apiFetch(`/companies/${companyId}/contacts`, contact, HTTPMethod.POST);\r\n\r\nexport const putContact = (companyId: string, contact: CompanyContact): Promise =>\r\n apiFetch(`/companies/${companyId}/contacts/${contact.id}`, contact, HTTPMethod.PUT);\r\n\r\nexport const resendContactEmailVerification = (companyId: string, companyContactId: string): Promise =>\r\n apiFetch(`/companies/${companyId}/contacts/${companyContactId}/resendEmailVerification`, undefined, HTTPMethod.PUT);","\r\nimport { CollectionInvoiceType } from '.';\r\nimport { apiFetch, HTTPMethod, getFileName } from '../fetch';\r\nimport { CollectionInvoice, InitiatePaymentResult, DynamicsCreationInfo as DynamicsInvoiceCreationInfo, ExternalPaymentTransaction, UnproccessedTransaction, UpdateStatementTransactions, CollectionInvoiceStatus, PaymentTransactionListItem } from './interface';\r\nimport download from 'downloadjs';\r\nimport { IossImportDataEntryModel } from '../iossOrderInformation';\r\nimport { CompanyEmail } from '../companies';\r\n\r\nexport const getStatements = (fromDate: string, toDate: string) =>\r\n apiFetch(`/collectionInvoice?invoiceType=${CollectionInvoiceType.Statement}&fromDate=${fromDate}&toDate=${toDate}`);\r\n\r\nexport const getCollectionInvoices = (invoiceType:CollectionInvoiceType, fromDate: string, toDate: string) =>\r\n apiFetch(`/collectionInvoice?invoiceType=${invoiceType}&fromDate=${fromDate}&toDate=${toDate}`);\r\n\r\nexport const getStatementsForCompanyId = (companyId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}?invoiceType=${CollectionInvoiceType.Statement}`);\r\n\r\nexport const getStatementReminderEmails = () =>\r\n apiFetch('/collectionInvoice/statementReminderEmails');\r\n\r\nexport const getCollectionInvoice = (companyId: string, collectionInvoiceId: string, includeRows: boolean = false) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoiceId}?includeRows=${includeRows}`);\r\n\r\nexport const getCompanyFirstInitialSubscriptionCollectionInvoice = (companyId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}/firstInitialSubscriptionInvoice`);\r\n\r\nexport const createInitialSubscriptionInvoice = (companyId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}/createInitialSubscriptionInvoice`, undefined, HTTPMethod.POST);\r\n\r\nexport const getInitialSubscriptionInvoice = (companyId: string, subscriptionIds: string[]) =>\r\n apiFetch(`/collectionInvoice/${companyId}/getInitialSubscriptionInvoice`, subscriptionIds, HTTPMethod.POST);\r\n\r\nexport const getOrCreateInitialSubscriptionInvoice = (companyId: string, subscriptionIds: string[]) =>\r\n apiFetch(`/collectionInvoice/${companyId}/getOrCreateInitialSubscriptionInvoice`, subscriptionIds, HTTPMethod.POST);\r\n\r\nexport const createStatements = (jobIds: string[], periodEnd: string) =>\r\n apiFetch('/collectionInvoice/statements', { jobIds, periodEnd }, HTTPMethod.POST);\r\n\r\nexport const createFeeInvoices = (jobIds: string[], periodEnd: string, companiesExcludedFromDiscount: string[]) =>\r\n apiFetch('/collectionInvoice/feeinvoices', { jobIds, periodEnd, companiesExcludedFromDiscount }, HTTPMethod.POST);\r\n\r\nfunction pdfDownloadCatch (e: { status?: string; message?: string; title?: string; }) {\r\n if (e.status) {\r\n if (e.message) throw new Error(`${e.status}: ${e.message}`);\r\n else if (e.title) throw new Error(`${e.status}: ${e.title}`);\r\n }\r\n throw e;\r\n}\r\n\r\nasync function processPdfResponse (result: Response) {\r\n const fileName = getFileName(result);\r\n const blob = await result.blob();\r\n return { blob, fileName };\r\n}\r\n\r\nexport const downloadCollectionInvoicePdf = (companyId: string, collectionInvoice: CollectionInvoice) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoice.id}/pdfFile`)\r\n .then(processPdfResponse)\r\n .then(data => {\r\n let fileName = data.fileName;\r\n if (!fileName) {\r\n if (collectionInvoice.invoiceType === CollectionInvoiceType.Statement) {\r\n fileName = `FileName-${collectionInvoice.id}.pdf`;\r\n } else {\r\n fileName = `SalesInvoice_${collectionInvoice.invoiceNumber}.pdf`;\r\n }\r\n }\r\n return download(data.blob, fileName );\r\n })\r\n .catch(pdfDownloadCatch);\r\n\r\nexport const downloadCollectionInvoicePdfPreview = (companyId: string, collectionInvoice: CollectionInvoice) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoice.id}/pdfFilePreview`)\r\n .then(processPdfResponse)\r\n .then(data => {\r\n let fileName = data.fileName;\r\n if (!fileName) {\r\n fileName = `Preview-FileName-${collectionInvoice.id}.pdf`;\r\n }\r\n return download(data.blob, fileName);\r\n })\r\n .catch(pdfDownloadCatch);\r\nexport const clearBankWireInfo = (companyId: string, collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoiceId}/clearbankwire`, undefined, HTTPMethod.PUT);\r\n\r\nexport const clearInitiatedCardPayment = (companyId: string, collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoiceId}/clearInitiatedCardPayment`, undefined, HTTPMethod.PUT);\r\n\r\nexport const updatePDF = (collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/updatePDF`, undefined, HTTPMethod.PUT);\r\n\r\nexport const sendStatements = (collectionInvoiceIds: string[]) =>\r\n apiFetch('/collectionInvoice/sendstatements', collectionInvoiceIds, HTTPMethod.POST);\r\n\r\nexport const sendStatementReminderEmails = (collectionInvoiceIds: string[]) =>\r\n apiFetch('/collectionInvoice/sendStatementReminderEmails', collectionInvoiceIds, HTTPMethod.PUT);\r\n\r\nexport const getCollectionInvoiceDetails = (companyId: string, collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoiceId}/orders`);\r\n\r\nexport const deleteCollectionInvoices = (collectionInvoiceIds: string[]) =>\r\n apiFetch('/collectionInvoice', collectionInvoiceIds, HTTPMethod.DELETE);\r\n\r\nexport const getStatementPdfGeneratorStatus = () =>\r\n apiFetch('/collectionInvoice/StatementPdfGeneratorStatus');\r\n\r\nexport const migrateStatements = (companyIds?: string[]) =>\r\n apiFetch('/migrateStatements', companyIds ?? [], HTTPMethod.POST);\r\n\r\nexport const getExternalPayments = (companyId: string) =>\r\n apiFetch(`/migrateStatements/${companyId}/payments`);\r\n\r\nexport const getUnprocessedTransactions = (companyId?: string) =>\r\n apiFetch(`/collectionInvoice/unprocessedTransactions${companyId ? `?companyId=${companyId}` : ''}`);\r\n\r\nexport const initiateZuluCardPayment = (companyId: string, collectionInvoiceId: string, isMerchantInitiated: boolean) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoiceId}/paywithzulucard?isMerchantInitiated=${isMerchantInitiated}`, undefined, HTTPMethod.PUT);\r\n\r\nexport const initiateBankwirePayment = (companyId: string, collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${companyId}/${collectionInvoiceId}/bankwire`, undefined, HTTPMethod.PUT);\r\n\r\nexport const getDynamicsInvoiceCreationInfo = () =>\r\n apiFetch('/collectionInvoice/dynamicsCreationInfo');\r\n\r\nexport const queueInvoicesForDynamicsCreation = (collectionInvoiceIds: string[]) =>\r\n apiFetch('/collectionInvoice/QueueDynamicInvoiceCreation', collectionInvoiceIds, HTTPMethod.POST);\r\n\r\nexport const createInvoiceInERP = (collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/createInERP`, null, HTTPMethod.PUT);\r\n\r\nexport const changeCollectionInvoiceStatus = (collectionInvoiceId: string, status: CollectionInvoiceStatus) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/changeStatus`, status, HTTPMethod.PUT);\r\n\r\nexport const clearCollectionInvoiceErrors = (collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/clearErrors`, null, HTTPMethod.PUT);\r\n\r\nexport const updateStatementTransactions = (transactions: UpdateStatementTransactions[]) =>\r\n apiFetch('/collectionInvoice/transactions', transactions, HTTPMethod.PUT);\r\n\r\nexport const cancelReminderFeeInvoiceCreation = (collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/cancelReminderFeeInvoiceCreation`, null, HTTPMethod.PUT);\r\n\r\nexport const reactivateReminderFeeInvoiceCreation = (collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/reactivateReminderFeeInvoiceCreation`, null, HTTPMethod.PUT);\r\n\r\nexport const GetCollectionInvoicePaymentTransactions = (collectionInvoiceId: string) =>\r\n apiFetch(`/collectionInvoice/${collectionInvoiceId}/paymentTransactions`);","import { CompanyContact, PartialCompany } from '../companies';\r\nimport { DynamicsInvoiceType } from '../dynamics';\r\n\r\nexport enum CollectionInvoiceStatus {\r\n Draft = 1,\r\n QuoteCreated = 2,\r\n PdfCreated = 3,\r\n SentToCustomer = 4,\r\n PaidByCustomer = 5,\r\n Cancelled = 6,\r\n ProcessingPayment = 7,\r\n ProcessingRefund = 8,\r\n ERPCreated = 9,\r\n CreditCardPaymentStarted = 10,\r\n PartiallyPaid = 11,\r\n VATCredit = 12,\r\n TaxPaymentStarted = 13,\r\n PaymentCompleted = 14,\r\n Credit = 15,\r\n}\r\nexport enum CollectionInvoiceStatusUserView {\r\n Pending = 'Pending',\r\n QuoteCreated = 'Quote Created',\r\n PdfCreated = 'Not Sent',\r\n SentToCustomer = 'Unpaid',\r\n PaidByCustomer = 'Paid',\r\n Cancelled = 'Cancelled',\r\n ProcessingPayment = 'Processing Payment',\r\n ProcessingRefund = 'Processing Refund',\r\n ERPCreated = 'Not Sent',\r\n CreditCardPaymentStarted = 'Credit Card Payment Started',\r\n PartiallyPaid = 'Partially Paid',\r\n VATCredit = 'VAT Credit Request',\r\n TaxPaymentStarted = 'Paid',\r\n PaymentCompleted = 'Payment Completed',\r\n Credit = 'Credit',\r\n}\r\n\r\nexport const collectionInvoiceStatusOrder = [\r\n 1,\r\n 12,\r\n 2,\r\n 3,\r\n 9,\r\n 4,\r\n 11,\r\n 10,\r\n 7,\r\n 5,\r\n 8,\r\n 6,\r\n];\r\n\r\nexport enum CollectionInvoiceType {\r\n Statement = 1,\r\n Invoice = 2,\r\n}\r\nexport enum PaymentTransactionStatus {\r\n Submitted = 0,\r\n Completed = 1,\r\n Rejected = 2,\r\n Failed = 3,\r\n Created = 4,\r\n Cancelled = 6,\r\n}\r\nenum PaymentAccountType{\r\n Main = 1,\r\n Escrow = 2,\r\n}\r\nexport enum PaymentServiceProviderEnum {\r\n None = 0,\r\n PayPal = 1,\r\n Plusius = 2,\r\n}\r\nexport interface PaymentTransaction {\r\n id: string;\r\n collectionInvoiceIds: string[];\r\n transactionTimestamp: string;\r\n amount: number;\r\n vat: number;\r\n knownFees: number;\r\n currencyCode: string;\r\n paymentServiceProvider: PaymentServiceProviderEnum;\r\n paymentTransactionStatus: PaymentTransactionStatus;\r\n externalTransactionId: string;\r\n externalQuoteId: string;\r\n externalPaymentOptionId: string;\r\n accountType: PaymentAccountType;\r\n transactionCompleted: string;\r\n statusInformation: string;\r\n comment: string;\r\n pendingToBeRemoved: boolean;\r\n}\r\n\r\nexport enum ExternalPaymentTypeEnum {\r\n None = 0,\r\n VATAccount = 1,\r\n STDAccount = 2,\r\n Shopify = 3,\r\n Enion = 4,\r\n PostPlus = 5,\r\n Plusius = 6,\r\n Shyplite = 7,\r\n US = 8,\r\n Credit = 9,\r\n SKV = 10,\r\n}\r\n\r\nexport interface UpdateStatementTransactions{\r\n collectionInvoiceId: string;\r\n status: CollectionInvoiceStatus;\r\n unprocessedTransactions: UnproccessedTransaction[];\r\n externalTransactions: ExternalPaymentTransaction[];\r\n transactionToRemove: PaymentTransaction[];\r\n existingTransactions: PaymentTransaction[];\r\n}\r\n\r\nexport interface UnproccessedTransaction {\r\n id: string;\r\n companyId: string;\r\n companyName: string;\r\n amount: number;\r\n transactionDate: string;\r\n currency: string;\r\n platformPaymentReference: string;\r\n status: string,\r\n pendingToBeAdded: boolean\r\n}\r\nexport interface ExternalPaymentTransaction {\r\n paymentId: number;\r\n companyId: string;\r\n transferRef: string;\r\n ocr: string;\r\n amount: number;\r\n amountCurrency: string;\r\n pspAmount: number;\r\n pspCurrency: string;\r\n paymentDate: string;\r\n registredDate: string;\r\n paymentType: ExternalPaymentTypeEnum;\r\n pendingToBeAdded: boolean;\r\n}\r\n\r\nexport interface MigrateCollectionInvoice extends CollectionInvoice {\r\n externalTransactions: ExternalPaymentTransaction[];\r\n unprocessedTransactions: UnproccessedTransaction[];\r\n existingTransactionToAdd: PaymentTransaction[];\r\n}\r\n\r\nexport interface CollectionInvoice {\r\n id: string;\r\n company: PartialCompany;\r\n companyName: string;\r\n companyContact: CompanyContact;\r\n settlementAmount: number;\r\n settlementCurrency: string;\r\n settlementVatAmount?: number;\r\n collectionAmount?: number;\r\n collectionCurrency?: string;\r\n dueDate: string;\r\n status: CollectionInvoiceStatus;\r\n externalPaymentReference: string;\r\n internalPaymentReference: string;\r\n createdUtc: string;\r\n sentUtc: string;\r\n sentTo: string;\r\n invoiceNumber: string;\r\n errors: ErrorEntry[];\r\n invoiceType: CollectionInvoiceType;\r\n pdfDocumentId?: string;\r\n paymentTransactions: PaymentTransaction[];\r\n hasCompanyNotes: boolean;\r\n taxAgencyPaymentDate: string;\r\n quoteId?: string;\r\n dynamicsInvoiceType?: DynamicsInvoiceType;\r\n companyIsActive?: boolean;\r\n reminderFeeInvoiceCreationCancelled: boolean;\r\n reminderFeeInvoiceCreated: boolean;\r\n invoiceRows?: CollectionInvoiceRow[];\r\n}\r\n\r\nexport interface CollectionInvoiceRow {\r\n id: string,\r\n articleNumber: string,\r\n amount: number,\r\n text: string,\r\n}\r\n\r\ninterface ErrorEntry {\r\n message: string,\r\n statusCode: number,\r\n}\r\n\r\nexport interface DynamicsCreationInfo {\r\n count: number;\r\n doneProcessing: boolean;\r\n}\r\n\r\nexport interface InitiatePaymentResult {\r\n redirectUrl: string;\r\n collectionAmount: number;\r\n collectionCurrency: string;\r\n feeInCollectionCurrency: number;\r\n externalPaymentReference?: string;\r\n}\r\n\r\nexport interface InitiatePayoutResult {\r\n successCount: number;\r\n initiatePayoutRows: InitiatePayoutRow[];\r\n}\r\n\r\nexport interface InitiatePayoutRow {\r\n collectionInvoiceId: string;\r\n internalPaymentReference: string;\r\n message: string;\r\n}\r\n\r\nexport interface PaymentTransactionListItem extends PaymentTransaction {\r\n externalStatus: string;\r\n externalStatusMessage: string;\r\n plusiusStatusResponse?: PlusiusStatusResponse;\r\n}\r\n\r\nexport interface PlusiusStatusResponse {\r\n quoteId: string;\r\n paymentOptionId: string;\r\n amount: number;\r\n currency: string;\r\n status: string;\r\n errors?: ErrorEntry[];\r\n errorDetail?: PlusiusErrorDetail;\r\n}\r\n\r\nexport interface PlusiusErrorDetail {\r\n failedAt: string;\r\n name: string;\r\n description: string;\r\n}\r\n","import { useCallback } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { replaceBy } from 'utility';\r\nimport {\r\n getCollectionInvoices,\r\n getStatementsForCompanyId,\r\n sendStatements,\r\n getCollectionInvoiceDetails,\r\n deleteCollectionInvoices,\r\n getStatementPdfGeneratorStatus,\r\n getCollectionInvoice,\r\n} from '.';\r\nimport { CollectionInvoice, CollectionInvoiceType } from './interface';\r\n\r\nconst statementCollectionInvoices = ['statements'];\r\n\r\nexport const useStatements = () => {\r\n const {\r\n data: statements = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(\r\n selectAsyncResource([], statementCollectionInvoices)\r\n );\r\n const dispatch = useDispatch();\r\n\r\n const loadStatements = useCallback((fromDate: string, toDate: string) => {\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Loading, []));\r\n getCollectionInvoices(CollectionInvoiceType.Statement, fromDate, toDate).then(s => {\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Success, s));\r\n }).catch(() => {\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Error, []));\r\n }); }, [dispatch]);\r\n\r\n const loadStatementsForCompanyId = useCallback((companyId: string) => {\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Loading, []));\r\n getStatementsForCompanyId(companyId).then(s => {\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Success, s));\r\n }).catch(() => {\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Error, []));\r\n }); }, [dispatch]);\r\n\r\n const deleteStatements = useCallback((ids: string[]) =>\r\n deleteCollectionInvoices(ids).then(deletedStatementIds => {\r\n const filteredStatements = statements?.filter(s => !deletedStatementIds.includes(s.id));\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Success, filteredStatements));\r\n return deletedStatementIds;\r\n }), [dispatch, statements]);\r\n\r\n const refreshStatementInvoice = useCallback((companyId: string, collectionInvoiceId: string) => {\r\n if (statements) {\r\n getCollectionInvoice(companyId, collectionInvoiceId).then(ci => {\r\n const updatedInvoices = replaceBy('id', ci, statements);\r\n dispatch(setAsyncResource(statementCollectionInvoices, AsyncStatus.Success, updatedInvoices));\r\n return ci;\r\n });\r\n }\r\n }, [statements, dispatch]);\r\n\r\n return {\r\n loadStatements,\r\n loadStatementsForCompanyId,\r\n status,\r\n statements,\r\n sendStatements,\r\n getCollectionInvoiceDetails,\r\n deleteStatements,\r\n getStatementPdfGeneratorStatus,\r\n refreshStatementInvoice,\r\n };\r\n};","import { useCallback } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { AsyncStatus, selectAsyncResource, setAsyncResource } from 'store';\r\nimport { replaceBy } from 'utility';\r\nimport { CollectionInvoiceType } from '.';\r\nimport { createInvoiceInERP, getCollectionInvoices, clearCollectionInvoiceErrors } from './api';\r\nimport { CollectionInvoice } from './interface';\r\n\r\nconst collectionInvoicesSelector = ['collectionInvoices'];\r\n\r\nexport const useCollectionInvoices = () => {\r\n\r\n const {\r\n data: collectionInvoices = [],\r\n status = AsyncStatus.NotInitialized,\r\n } = useSelector(selectAsyncResource([], collectionInvoicesSelector));\r\n const dispatch = useDispatch();\r\n\r\n const loadCollectionInvoices = useCallback((fromDate: string, toDate: string) => {\r\n dispatch(setAsyncResource(collectionInvoicesSelector, AsyncStatus.Loading, []));\r\n return getCollectionInvoices(CollectionInvoiceType.Invoice, fromDate, toDate).then(s => {\r\n dispatch(setAsyncResource(collectionInvoicesSelector, AsyncStatus.Success, s));\r\n }).catch(() => {\r\n dispatch(setAsyncResource(collectionInvoicesSelector, AsyncStatus.Error, []));\r\n });\r\n }, [dispatch]);\r\n\r\n const sendToErp = (collectionInvoiceId: string) =>\r\n createInvoiceInERP(collectionInvoiceId).then(ci => {\r\n const updateCis = replaceBy('id', ci, collectionInvoices);\r\n dispatch(setAsyncResource(collectionInvoicesSelector, AsyncStatus.Success, updateCis));\r\n return ci;\r\n });\r\n\r\n const updateCollectionInvoicesState = (updatedCollectionInvoice: CollectionInvoice) => {\r\n dispatch(setAsyncResource(collectionInvoicesSelector, AsyncStatus.Success, replaceBy('id', updatedCollectionInvoice, collectionInvoices)));\r\n };\r\n\r\n return {\r\n status,\r\n collectionInvoices,\r\n loadCollectionInvoices,\r\n sendToErp,\r\n clearCollectionInvoiceErrors,\r\n updateCollectionInvoicesState,\r\n };\r\n};","import { CompanyCategory } from '../companies';\r\n\r\nexport enum OnboardingOptions {\r\n AddIoss = 'Addioss',\r\n}\r\n\r\nexport interface Onboarding {\r\n id: string;\r\n email: string;\r\n firstName: string;\r\n lastName: string;\r\n companyName: string;\r\n token?: string;\r\n tokenExpires?: string;\r\n completedTimestamp?: string;\r\n onboardingCompleted?: boolean;\r\n companyCategories: CompanyCategory[];\r\n onboardingOptions?: OnboardingOptions[];\r\n referrer: string | null;\r\n}","import { apiFetch, HTTPMethod } from '../fetch';\r\nimport { Onboarding } from './interfaces';\r\n\r\nexport const postMerchantOnboarding = (onboarding: Onboarding) =>\r\n apiFetch('/onboardings/merchant', onboarding, HTTPMethod.POST);\r\n\r\nexport const PostCustomerInitiatedOnboarding = (onboarding: Onboarding) =>\r\n apiFetch('/onboardings/initiate', onboarding, HTTPMethod.POST);","import { authService } from './authorization';\r\n\r\nexport enum AuthStatus {\r\n NotAuthenticated = 'NotAuthenticated',\r\n Authenticated = 'Authenticated',\r\n Authenticating = 'Authenticating',\r\n PreconditionFailed = 'PreconditionFailed',\r\n}\r\n\r\nexport enum HTTPStatus {\r\n NoContent = 204,\r\n Unauthorized = 401,\r\n Forbidden = 403,\r\n PreconditionFailed = 412,\r\n Conflict = 409,\r\n BadRequest = 400,\r\n NotFound = 404,\r\n}\r\n\r\nexport enum HTTPMethod {\r\n GET = 'GET',\r\n POST = 'POST',\r\n PUT = 'PUT',\r\n DELETE = 'DELETE',\r\n}\r\n\r\nexport interface ValidationErrorsResponse {\r\n type: string;\r\n title: string;\r\n status: number;\r\n traceId: string;\r\n errors: {\r\n [key:string]: string[];\r\n };\r\n}\r\n\r\n/* eslint-disable no-throw-literal */\r\nexport const apiFetch = async (endpoint: string, body?: any, method: HTTPMethod = HTTPMethod.GET): Promise => {\r\n const isAuthenticated = await authService.isAuthenticated();\r\n\r\n const url = `${process.env.PUBLIC_URL}/api${endpoint}`;\r\n let requestInit = {};\r\n let authorization = '';\r\n if (isAuthenticated) {\r\n const token = await authService.getAccessToken();\r\n authorization = `Bearer ${token}`;\r\n requestInit = {\r\n method,\r\n headers: {\r\n Accept: 'application/json',\r\n 'Content-Type': 'application/json',\r\n Authorization: authorization,\r\n },\r\n body: JSON.stringify(body),\r\n };\r\n } else {\r\n requestInit = {\r\n method,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n body: JSON.stringify(body),\r\n };\r\n\r\n }\r\n\r\n const apiResponse = await fetch(url, requestInit);\r\n\r\n if (apiResponse.status === HTTPStatus.Unauthorized) {\r\n authService.signOut();\r\n throw { status: AuthStatus.NotAuthenticated };\r\n } else if (apiResponse.status === HTTPStatus.Forbidden) {\r\n document.location.href = './';\r\n throw { status: AuthStatus.Authenticating };\r\n } else if (apiResponse.status === HTTPStatus.PreconditionFailed) {\r\n apiResponse.body\r\n ?.getReader()\r\n .read()\r\n .then(async (b) => {\r\n const tokenChallengeId = new TextDecoder().decode(b.value);\r\n\r\n const tokenChallengeResponse = prompt(`\r\n To proceed with this, you need to enter the code that has been sent to your email\r\n `);\r\n\r\n if (tokenChallengeResponse === null || tokenChallengeResponse === '') {\r\n throw { status: AuthStatus.NotAuthenticated };\r\n }\r\n\r\n const apiResponseWithToken = await fetch(url, {\r\n method,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Authorization: authorization,\r\n tokenChallengeId: tokenChallengeId,\r\n tokenChallengeResponse: tokenChallengeResponse.valueOf().toString(),\r\n },\r\n body: JSON.stringify(body),\r\n });\r\n if (apiResponseWithToken.ok) {\r\n return apiResponseWithToken?.headers?.get('Content-Type')?.includes('application/json')\r\n ? apiResponseWithToken.json()\r\n : apiResponseWithToken;\r\n } else {\r\n throw new Error(`Something unexpected happened when trying to fetch ${url}`);\r\n\r\n // TODO: Add modal popup requesting one time token which has been sent to users email inbox instead of throwing exception\r\n }\r\n });\r\n throw { status: AuthStatus.NotAuthenticated };\r\n } else if (apiResponse.status === HTTPStatus.Conflict) {\r\n return apiResponse.text()\r\n .then(reasonForConflict => new Error(reasonForConflict))\r\n .then(error => Promise.reject(error));\r\n } else if (apiResponse.ok) {\r\n\r\n const contentType = apiResponse?.headers?.get('Content-Type');\r\n\r\n if (contentType?.includes('application/json')) {\r\n return apiResponse.json();\r\n } else if (contentType?.includes('text/plain')) {\r\n return apiResponse.text() as unknown as T;\r\n } else {\r\n return apiResponse as unknown as T;\r\n }\r\n\r\n } else if (apiResponse.status === HTTPStatus.BadRequest || apiResponse.status === HTTPStatus.NotFound) {\r\n if (apiResponse?.headers?.get('Content-Type')?.includes('application/problem+json')) {\r\n throw (await apiResponse.json()) as ValidationErrorsResponse;\r\n } else if (apiResponse.text) {\r\n const textResult = await apiResponse.text();\r\n if (textResult.includes('Cannot PUT' || 'Cannot GET' || 'Cannot POST' ))\r\n {\r\n throw new Error(`Could not fetch \"${url}\", please contact support, support@crossborderit.com.`);\r\n } else {\r\n throw new Error(textResult);\r\n }\r\n }\r\n throw apiResponse;\r\n } else if (apiResponse.text) {\r\n throw new Error(await apiResponse.text());\r\n } else {\r\n throw new Error(`Something unexpected happened when trying to fetch ${url}`);\r\n }\r\n};\r\n\r\nexport const getFileName = (result: Response) => {\r\n const contentDisposition = result.headers.get('content-disposition');\r\n const match = contentDisposition?.match(/filename\\s*=\\s*(.+);/i);\r\n const fileName = match && match.length === 2 ? match[1] : null;\r\n return fileName;\r\n};","import { FunctionComponent, ReactNode, CSSProperties } from 'react';\r\nimport { Result } from 'antd';\r\nimport { FontIcon, Text } from '@fluentui/react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface ErrorResultProps {\r\n title?: ReactNode;\r\n subTitle?: string;\r\n extra?: ReactNode;\r\n style?: CSSProperties;\r\n}\r\n\r\nexport const ErrorResult: FunctionComponent = ({\r\n title: _title,\r\n subTitle: _subTitle,\r\n ...props\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const title = _title || t('Something went wrong');\r\n const subTitle = (_subTitle && _subTitle?.length < 200) ? _subTitle : t('Try again in a few minutes. If the error persists, please contact our support, support@crossborderit.com.');\r\n\r\n return (\r\n \r\n }\r\n title={{title}}\r\n subTitle={{subTitle}}\r\n {...props}\r\n />\r\n );\r\n};\r\n","import { FunctionComponent } from 'react';\r\nimport { Icon, Stack, Text } from '@fluentui/react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport './CompactResult.css';\r\n\r\nexport interface CompactResultProps {\r\n title?: string;\r\n subTitle?: string;\r\n icon?: string;\r\n}\r\n\r\nexport const CompactResult: FunctionComponent = ({\r\n title: _title,\r\n subTitle: _subTitle,\r\n icon: _icon,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const title = _title || t('Something went wrong');\r\n const subTitle = _subTitle || t('Try again in a few minutes');\r\n const icon = _icon || 'Info';\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {title}\r\n {subTitle}\r\n \r\n \r\n );\r\n};\r\n","import { FunctionComponent, useEffect, useState } from 'react';\r\nimport { Form, Col, Row, Input, message } from 'antd';\r\nimport { InternationalPhoneNumber } from '.';\r\nimport { useTranslation } from 'react-i18next';\r\nimport {\r\n CompanyContact, getVerifiedCompanyPhoneNumbers,\r\n sendPhoneNumberVerification, setCompanyPhoneNumberAsVerified, UserRole, getVerifiedCompanyEmailAddresses, sendCompanyEmailAddressVerification, setCompanyEmailAddressAsVerified,\r\n} from 'integrations/crossborderit';\r\nimport { Button } from '../button';\r\nimport { useParams } from 'react-router';\r\nimport { VerifyPhoneNumberModal } from 'components/verification';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectIsUserInRole } from 'store';\r\nimport { Stack } from '@fluentui/react';\r\n\r\nexport enum Overlay {\r\n None,\r\n VerifyPhoneNumber,\r\n VerifyEmailAddress,\r\n}\r\n\r\ninterface Props {\r\n name?: (string | number)[];\r\n fieldKey?: (string | number)[];\r\n gutter?: number;\r\n disabled?: boolean;\r\n firstNameRequired?: boolean;\r\n lastNameRequired?: boolean;\r\n emailRequired?: boolean;\r\n mainContact?: CompanyContact;\r\n phoneRequired?: boolean;\r\n verifyNumber?: boolean;\r\n verifyEmailAddress?: boolean;\r\n pendingPhoneVerification?: (state: boolean) => void;\r\n pendingEmailVerification?: (state: boolean) => void;\r\n formRemoteSubmit?: (submit: boolean) => void;\r\n}\r\n\r\nexport const ContactPerson: FunctionComponent = ({\r\n name = [],\r\n fieldKey = [],\r\n gutter = 16,\r\n disabled = false,\r\n firstNameRequired = true,\r\n lastNameRequired = true,\r\n emailRequired = true,\r\n phoneRequired = true,\r\n mainContact,\r\n verifyNumber,\r\n verifyEmailAddress,\r\n pendingPhoneVerification = () => { },\r\n pendingEmailVerification = () => { },\r\n formRemoteSubmit = () => { },\r\n ...props\r\n}) => {\r\n const { t } = useTranslation();\r\n const [phoneNumberNeedsVerification, setPhoneNumberNeedsVerification] = useState(false);\r\n const [emailAddressNeedsVerification, setEmailAddressNeedsVerification] = useState(false);\r\n const { companyId } = useParams<{ companyId: string }>();\r\n const [newPhoneNumber, setNewPhoneNumber] = useState();\r\n const [emailAddress, setEmailAddress] = useState(mainContact?.email);\r\n const [verifiedCompanyPhoneNumbers, setVerifiedCompanyPhoneNumbers] = useState([]);\r\n const [verifiedCompanyEmailAddresses, setVerifiedCompanyEmailAddresses] = useState([]);\r\n const [verifiedCompanyPhoneNumbersLoaded, setVerifiedCompanyPhoneNumbersLoaded] = useState(false);\r\n const [verifiedCompanyEmailAddressesLoaded, setVerifiedCompanyEmailAddressesLoaded] = useState(false);\r\n const [overlay, setOverlay] = useState(Overlay.None);\r\n const isUserSuperAdmin = useSelector(selectIsUserInRole(UserRole.SuperAdmin));\r\n const [isValidPhoneNumberFormat, setIsValidPhoneNumberFormat] = useState();\r\n\r\n const handleSendPhoneVerification = () => {\r\n sendPhoneNumberVerification(newPhoneNumber!, companyId).then(() => {\r\n setOverlay(Overlay.VerifyPhoneNumber);\r\n }).catch(() => {\r\n message.error(t('Phone number could not be verified'));\r\n });\r\n };\r\n\r\n const onChangePhoneNumberVerificationStatus = (status: boolean) => {\r\n setPhoneNumberNeedsVerification(status);\r\n pendingPhoneVerification(status);\r\n };\r\n\r\n const onChangeEmailVerificationStatus = (status: boolean) => {\r\n setEmailAddressNeedsVerification(status);\r\n pendingEmailVerification(status);\r\n };\r\n\r\n const setPhoneNumberAsVerified = () => {\r\n setCompanyPhoneNumberAsVerified(companyId, newPhoneNumber!)\r\n .then((verifiedPhoneNumber) => {\r\n setVerifiedCompanyPhoneNumbers([...verifiedCompanyPhoneNumbers, verifiedPhoneNumber]);\r\n onChangePhoneNumberVerificationStatus(false);\r\n formRemoteSubmit(true);\r\n }).catch(() => {\r\n message.error(t('Could not set phone number as verified and update contact information'));\r\n });\r\n };\r\n\r\n const setEmailAddressAsVerified = () => {\r\n setCompanyEmailAddressAsVerified(companyId, emailAddress!)\r\n .then((verifiedEmailAddress) => {\r\n setVerifiedCompanyEmailAddresses([...verifiedCompanyEmailAddresses, verifiedEmailAddress]);\r\n onChangeEmailVerificationStatus(false);\r\n formRemoteSubmit(true);\r\n }).catch(() => {\r\n message.error(t('Could not set email address as verified and update contact information'));\r\n });\r\n };\r\n\r\n const handleSendEmailVerification = () => {\r\n sendCompanyEmailAddressVerification(emailAddress!, companyId).then(() => {\r\n setOverlay(Overlay.VerifyEmailAddress);\r\n }).catch((err) => {\r\n message.error(t('Email Address could not be verified'));\r\n });\r\n };\r\n\r\n useEffect(() => {\r\n (verifyNumber && companyId) && getVerifiedCompanyPhoneNumbers(companyId).then((res) => {\r\n setVerifiedCompanyPhoneNumbers(res);\r\n setVerifiedCompanyPhoneNumbersLoaded(true);\r\n }).catch(() => {\r\n message.error(t('Could not get verified company phone numbers'));\r\n });\r\n\r\n (verifyEmailAddress && companyId) && getVerifiedCompanyEmailAddresses(companyId).then((res) => {\r\n setVerifiedCompanyEmailAddresses(res);\r\n setVerifiedCompanyEmailAddressesLoaded(true);\r\n }).catch(() => {\r\n message.error(t('Could not get verified company email addresses'));\r\n });\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (verifyEmailAddress && verifiedCompanyEmailAddressesLoaded && !verifiedCompanyEmailAddresses.some(email => email === emailAddress)) {\r\n onChangeEmailVerificationStatus(true);\r\n } else {\r\n onChangeEmailVerificationStatus(false);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [verifyEmailAddress, emailAddress, verifiedCompanyEmailAddresses, verifiedCompanyEmailAddressesLoaded]);\r\n\r\n useEffect(() => {\r\n if (verifyNumber && verifiedCompanyPhoneNumbersLoaded && !verifiedCompanyPhoneNumbers.some(phone => phone === newPhoneNumber)) {\r\n onChangePhoneNumberVerificationStatus(true);\r\n } else {\r\n onChangePhoneNumberVerificationStatus(false);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [verifyNumber, newPhoneNumber, verifiedCompanyPhoneNumbers, verifiedCompanyPhoneNumbersLoaded]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n e.target.value && setEmailAddress(e.target.value)} />\r\n \r\n \r\n {(verifyEmailAddress && emailAddressNeedsVerification)\r\n && \r\n \r\n {t('Verify Email Address')}\r\n \r\n \r\n }\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n { setIsValidPhoneNumberFormat(value); }}\r\n getValue={(value) => { value && setNewPhoneNumber(value); }}\r\n hasFeedBack={(verifyNumber && !phoneNumberNeedsVerification)}\r\n validationStatus=\"success\"\r\n />\r\n \r\n {(verifyNumber && phoneNumberNeedsVerification)\r\n && \r\n \r\n {t('Verify Phone Number')}\r\n \r\n \r\n }\r\n \r\n \r\n \r\n\r\n {isUserSuperAdmin\r\n && \r\n \r\n \r\n {(phoneNumberNeedsVerification && verifyNumber && isValidPhoneNumberFormat)\r\n && \r\n {t('Set Phone Number As Verified')}\r\n \r\n }\r\n {(emailAddressNeedsVerification && verifyEmailAddress)\r\n && \r\n {t('Set Email Address As Verified')}\r\n \r\n }\r\n \r\n \r\n \r\n }\r\n\r\n {\r\n ((phoneNumberNeedsVerification || emailAddressNeedsVerification) && (verifyNumber || verifyEmailAddress))\r\n && {\r\n if (isPhoneVerification) {\r\n setVerifiedCompanyPhoneNumbers([...verifiedCompanyPhoneNumbers, res]);\r\n setOverlay(Overlay.None);\r\n onChangePhoneNumberVerificationStatus(false);\r\n formRemoteSubmit(true);\r\n } else {\r\n setVerifiedCompanyEmailAddresses([...verifiedCompanyEmailAddresses, res]);\r\n setOverlay(Overlay.None);\r\n onChangeEmailVerificationStatus(false);\r\n formRemoteSubmit(true);\r\n }\r\n }}\r\n onCancel={() => setOverlay(Overlay.None)}\r\n visible={overlay === Overlay.VerifyPhoneNumber || overlay === Overlay.VerifyEmailAddress}\r\n phoneNumberToVerify={newPhoneNumber}\r\n emailAddressToVerify={emailAddress}\r\n companyId={companyId}\r\n overlayType={overlay}\r\n contactId={mainContact?.id}\r\n />\r\n }\r\n \r\n );\r\n};\r\n","import {\r\n FunctionComponent,\r\n useEffect,\r\n useState,\r\n} from 'react';\r\nimport PhoneInput, {\r\n isValidPhoneNumber,\r\n parsePhoneNumber,\r\n} from 'react-phone-number-input';\r\nimport 'react-phone-number-input/style.css';\r\nimport { E164Number } from 'libphonenumber-js/types';\r\nimport { Form } from 'antd';\r\nimport { useTranslation } from 'react-i18next';\r\nimport './InternationalPhoneNumber.css';\r\nimport { ValidateStatus } from 'antd/lib/form/FormItem';\r\n\r\ninterface FormProps {\r\n name?: (string | number)[];\r\n fieldKey?: (string | number)[];\r\n label?: string;\r\n required?: boolean;\r\n requireValidFormat?: boolean;\r\n allowClear?: boolean;\r\n noStyle?: boolean;\r\n placeholder?: string;\r\n disabled?: boolean,\r\n getValue?: (value: string | undefined) => void,\r\n isValidFormat?: (value: boolean) => void,\r\n hasFeedBack?: boolean,\r\n validationStatus?: ValidateStatus,\r\n}\r\n\r\ninterface InputProps {\r\n placeholder?: string;\r\n disabled?: boolean,\r\n onChange?: (value: string | undefined) => void;\r\n onBlur?:() => void;\r\n value?: string;\r\n}\r\n\r\nexport const InternationalPhoneNumber: FunctionComponent = ({\r\n name = ['phone'],\r\n fieldKey = name,\r\n required = true,\r\n requireValidFormat = true,\r\n noStyle,\r\n label,\r\n disabled,\r\n placeholder,\r\n getValue = () => {},\r\n isValidFormat = () => {},\r\n hasFeedBack = false,\r\n validationStatus = '',\r\n}) => {\r\n const { t } = useTranslation();\r\n const [validateTriggerType, setValidateTriggerType] = useState('onBlur');\r\n\r\n return (\r\n {\r\n isValidFormat(requireValidFormat && value && isValidPhoneNumber(value));\r\n getValue(value);\r\n return (requireValidFormat && value && !isValidPhoneNumber(value))\r\n ? Promise.reject(\r\n new Error(\r\n t('Phone number seems to be incorrect. Please enter complete number, including the country code.')\r\n )\r\n )\r\n : Promise.resolve();\r\n },\r\n },\r\n ]}\r\n hasFeedback={hasFeedBack}\r\n validateStatus={validationStatus}\r\n >\r\n setValidateTriggerType('onChange')} disabled={disabled} placeholder={placeholder} onChange={(value) => { getValue(value); isValidFormat(isValidPhoneNumber(value || '')); }}/>\r\n \r\n );\r\n};\r\n\r\nconst PhoneInputComponent: FunctionComponent = ({\r\n disabled = false,\r\n placeholder,\r\n onChange,\r\n onBlur,\r\n value,\r\n}) => {\r\n const { t } = useTranslation();\r\n const [inputValue, setInputValue] = useState();\r\n const [initialLoad, setInitialLoad] = useState(true);\r\n\r\n useEffect(() => {\r\n if (initialLoad && value) {\r\n if (!isValidPhoneNumber(value) && !parsePhoneNumber(value.toString())?.countryCallingCode) {\r\n // To make sure that already entered invalid phone numbers works in the field.\r\n setInputValue(`+0${value}`);\r\n } else if (isValidPhoneNumber(value)) {\r\n // To make sure that the form.item gets the parsed value from the field on load.\r\n onChange!(parsePhoneNumber(value.toString())?.number.toString());\r\n }\r\n setInitialLoad(false);\r\n }\r\n }, [value, initialLoad, onChange]);\r\n\r\n const onChangePhoneNumber = (value: E164Number | undefined) => {\r\n setInputValue(value);\r\n onChange!(value && parsePhoneNumber(value.toString())?.number.toString());\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\n","import { FunctionComponent } from 'react';\r\nimport { Form, Col, Row, Input, Radio, InputNumber, message } from 'antd';\r\nimport { InternationalPhoneNumber } from './InternationalPhoneNumber';\r\nimport { CompanyContact, EmailStatus } from 'integrations/crossborderit';\r\nimport { Status, StatusColor } from '../status';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { useParams } from 'react-router';\r\nimport { resendContactEmailVerification } from 'integrations/crossborderit/contacts';\r\nimport { Button } from '../button';\r\n\r\ninterface Props {\r\n name?: (string | number)[];\r\n gutter?: number;\r\n beneficialOwners: CompanyContact[];\r\n selectedContact?: CompanyContact;\r\n}\r\n\r\nexport const AmlKybContactPerson: FunctionComponent = ({\r\n name = [],\r\n gutter = 16,\r\n beneficialOwners,\r\n selectedContact,\r\n ...props\r\n}) => {\r\n const {t} = useTranslation();\r\n const { companyId } = useParams<{ companyId: string }>();\r\n\r\n const resendEmailVerification = () => {\r\n resendContactEmailVerification(companyId, selectedContact?.id!)\r\n .then(() => message.success(t('Email verification link has been sent')))\r\n .catch(() => message.error(t('Email verification link could not been sent')));\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {(selectedContact && selectedContact?.emailStatus !== EmailStatus.NoVerificationNeeded)\r\n ? \r\n \r\n \r\n \r\n \r\n : <>\r\n }\r\n \r\n {selectedContact?.emailStatus === EmailStatus.NotVerified\r\n && \r\n \r\n \r\n \r\n {t('Resend verification link')}\r\n \r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {beneficialOwners.length !== 0 && Director}\r\n\r\n Beneficial Owner\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ); };","import { Stack } from '@fluentui/react';\r\nimport { Form, Input, message, Modal } from 'antd';\r\nimport { useForm } from 'antd/lib/form/Form';\r\nimport { Button } from 'components/shared/button';\r\nimport { Overlay } from 'components/shared/input/ContactPerson';\r\nimport { verifyCompanyEmailAddress, verifyCompanyPhoneNumber } from 'integrations/crossborderit';\r\nimport React, { FC } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\ntype Props = {\r\n visible: boolean,\r\n phoneNumberToVerify?: string,\r\n emailAddressToVerify?: string,\r\n onFinish: (phoneNumber: string, isPhoneVerififcation: boolean) => void,\r\n onCancel: () => void,\r\n overlayType: Overlay;\r\n companyId: string\r\n contactId?: string;\r\n};\r\n\r\nexport const VerifyPhoneNumberModal: FC = ({\r\n visible,\r\n phoneNumberToVerify,\r\n emailAddressToVerify,\r\n companyId,\r\n contactId,\r\n overlayType,\r\n onFinish = () => {},\r\n onCancel = () => {},\r\n}) => {\r\n const {t} = useTranslation();\r\n const isPhoneVerification = overlayType === Overlay.VerifyPhoneNumber;\r\n const [verificationForm] = useForm();\r\n\r\n const handlePhoneVerification = (formData: any) => {\r\n verifyCompanyPhoneNumber(phoneNumberToVerify!, formData.verificationCode, companyId).then((verifiedPhoneNumber) => {\r\n onFinish(verifiedPhoneNumber, isPhoneVerification);\r\n }).catch(() => {\r\n message.error(t('Phone number could not be verified'));\r\n onCancel();\r\n }).finally(() => {\r\n verificationForm.resetFields();\r\n });\r\n };\r\n\r\n const handleEmailVerification = (formData: any) => {\r\n verifyCompanyEmailAddress(emailAddressToVerify!, formData.verificationCode, companyId, contactId).then((verifiedEmailAddress) => {\r\n onFinish(verifiedEmailAddress, isPhoneVerification);\r\n }).catch(() => {\r\n message.error(t('Email address could not be verified'));\r\n onCancel();\r\n }).finally(() => {\r\n verificationForm.resetFields();\r\n });\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {t('Verify')}\r\n \r\n \r\n \r\n \r\n );\r\n};","import { FunctionComponent, CSSProperties, useEffect, useState } from 'react';\r\nimport { Form, Select } from 'antd';\r\nimport { useCountries } from 'integrations/crossborderit';\r\nimport { AsyncStatus } from 'store';\r\nimport { Switch, Case } from 'components/shared/switch';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\ninterface Props {\r\n name?: (string | number)[];\r\n fieldKey?: (string | number)[];\r\n label?: string;\r\n required?: boolean;\r\n allowClear?: boolean;\r\n style?: CSSProperties;\r\n placeholder?: string;\r\n noStyle?: boolean;\r\n mode?: 'multiple' | 'tags';\r\n disabled?: boolean;\r\n valueType?: string;\r\n}\r\n\r\nenum ComponentStatus {\r\n Error = 'Error',\r\n Loading = 'Loading',\r\n Idle = 'Idle',\r\n}\r\n\r\nexport const CountryInput: FunctionComponent = ({\r\n name = ['countryCode'],\r\n fieldKey = ['countryCode'],\r\n valueType = 'alpha2Code',\r\n required = true,\r\n allowClear = false,\r\n disabled = false,\r\n style = {},\r\n placeholder,\r\n noStyle,\r\n label,\r\n mode,\r\n ...props\r\n}) => {\r\n const { t } = useTranslation();\r\n const { countries, status: countriesStatus } = useCountries();\r\n const [componentStatus, setComponentStatus] = useState(ComponentStatus.Idle);\r\n\r\n useEffect(() => {\r\n if (countriesStatus === AsyncStatus.Loading) {\r\n setComponentStatus(ComponentStatus.Loading);\r\n } else if (countriesStatus === AsyncStatus.Error) {\r\n setComponentStatus(ComponentStatus.Error);\r\n } else if (countriesStatus === AsyncStatus.Success) {\r\n setComponentStatus(ComponentStatus.Idle);\r\n }\r\n }, [countriesStatus]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {countries.map((country) => (\r\n \r\n {country.name}\r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { FunctionComponent } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Form, Col, Row, Input, Select } from 'antd';\r\nimport { Country, Address } from 'integrations/crossborderit';\r\n\r\ninterface AddressProps {\r\n name?: (string | number)[];\r\n fieldKey?: (string | number)[];\r\n gutter?: number;\r\n countries: Country[];\r\n required?: boolean;\r\n}\r\n\r\nconst addressFieldsTheUserCanChange = [\r\n 'addressLine1',\r\n 'addressLine2',\r\n 'postalCode',\r\n 'city',\r\n 'state',\r\n 'countryCode',\r\n];\r\n\r\nconst isAnotherFieldFilled = (fieldName: string, formValues: Address) =>\r\n Object.entries(formValues)\r\n .filter(([key]) => addressFieldsTheUserCanChange.includes(key))\r\n .filter(([key]) => key !== fieldName)\r\n .some(([_, value]) => !!value);\r\n\r\nexport const AddressInput: FunctionComponent = ({\r\n name = [],\r\n fieldKey = [],\r\n gutter = 16,\r\n countries = [],\r\n required = false,\r\n ...props\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const requiredFieldsDependencies = addressFieldsTheUserCanChange.map(\r\n (fieldName) => [...name, fieldName]\r\n );\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ({\r\n validator: (_, value: string) => {\r\n if (!!value || required) return Promise.resolve();\r\n return isAnotherFieldFilled(\r\n 'addressLine1',\r\n getFieldValue(name)\r\n )\r\n ? Promise.reject(new Error(t('Please enter an address')))\r\n : Promise.resolve();\r\n },\r\n }),\r\n ]}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ({\r\n validator: (_, value: string) => {\r\n if (!!value || required) return Promise.resolve();\r\n return isAnotherFieldFilled('postalCode', getFieldValue(name))\r\n ? Promise.reject(new Error(t('Please enter a zip code')))\r\n : Promise.resolve();\r\n },\r\n }),\r\n ]}\r\n >\r\n \r\n \r\n \r\n \r\n ({\r\n validator: (_, value: string) => {\r\n if (!!value || required) return Promise.resolve();\r\n return isAnotherFieldFilled('city', getFieldValue(name))\r\n ? Promise.reject(new Error(t('Please enter a city')))\r\n : Promise.resolve();\r\n },\r\n }),\r\n ]}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ({\r\n validator: (_, value: string) => {\r\n if (!!value || required) return Promise.resolve();\r\n return isAnotherFieldFilled('countryCode', getFieldValue(name))\r\n ? Promise.reject(new Error(t('Please enter a Country')))\r\n : Promise.resolve();\r\n },\r\n }),\r\n ]}\r\n >\r\n \r\n {countries.map((country) => (\r\n \r\n {country.name}\r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n","import { FunctionComponent } from 'react';\r\nimport { Select } from 'antd';\r\nimport { SelectProps } from 'antd/es/select';\r\nimport { CompanyCategory } from 'integrations/crossborderit';\r\n\r\nconst CAPITAL_LETTER = /(?=[A-Z])/;\r\n\r\ninterface Props extends SelectProps {\r\n companyCategories?: CompanyCategory[];\r\n}\r\n\r\nexport const CompanyCategorySelect: FunctionComponent = ({\r\n companyCategories,\r\n ...props\r\n}) => (\r\n \r\n);\r\n","import { useEffect, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { Select } from 'antd';\r\nimport { SelectProps } from 'antd/es/select';\r\nimport { Country, useCountries} from 'integrations/crossborderit';\r\nimport { AsyncStatus } from 'store';\r\nimport { Switch, Case } from 'components/shared/switch';\r\nimport './CountrySelect.css';\r\n\r\ninterface CountrySelectProps\r\n extends Omit, 'onSelect' | 'onDeselect'> {\r\n valueDisplayType?: keyof Country | 'alpha2AndName';\r\n optionLabelType?: keyof Country;\r\n disabledOptions?: (string | number | undefined)[];\r\n onChange?: (value: Country | Country[] | undefined) => void;\r\n value?: Country | Country[] | undefined;\r\n filteredCountries?: Country[];\r\n}\r\n\r\nenum Status {\r\n Error = 'Error',\r\n Loading = 'Loading',\r\n Idle = 'Idle',\r\n}\r\n\r\nexport const CountrySelect = ({\r\n valueDisplayType = 'alpha2AndName',\r\n optionLabelType = 'name',\r\n disabledOptions = [],\r\n onChange: _onChange = () => {},\r\n value: _value = undefined,\r\n defaultValue = undefined,\r\n filteredCountries = undefined,\r\n ...props\r\n}: CountrySelectProps) => {\r\n const { t } = useTranslation();\r\n const [value, setValue] = useState(\r\n Array.isArray(_value)\r\n ? _value.map((value) => value.alpha2Code || '')\r\n : _value?.alpha2Code\r\n );\r\n const [status, setStatus] = useState(Status.Loading);\r\n const { countries, status: countriesStatus } = useCountries();\r\n const [selectableCountries, setSelectableCountries] = useState([]);\r\n\r\n useEffect(() => {\r\n let didCancel = false;\r\n if (didCancel) return;\r\n setSelectableCountries(filteredCountries || countries);\r\n\r\n return () => {\r\n didCancel = true;\r\n setSelectableCountries([]);\r\n };\r\n }, [countries, filteredCountries]);\r\n\r\n useEffect(() => {\r\n\r\n if (countriesStatus === AsyncStatus.Loading) {\r\n setStatus(Status.Loading);\r\n } else if (countriesStatus === AsyncStatus.Error) {\r\n setStatus(Status.Error);\r\n } else if (countriesStatus === AsyncStatus.Success) {\r\n setStatus(Status.Idle);\r\n if (!!value){\r\n const country = Array.isArray(value)\r\n ? selectableCountries.filter((country) => value.includes(country.alpha2Code || ''))\r\n : selectableCountries.find((country) => country.alpha2Code === value);\r\n _onChange(country); }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [value, selectableCountries, countriesStatus]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n loading={status === Status.Loading}\r\n defaultValue={undefined as unknown as string}\r\n value={value}\r\n showSearch\r\n optionLabelProp=\"label\"\r\n optionFilterProp=\"data-search\"\r\n filterOption={true}\r\n onChange={setValue}\r\n {...props}\r\n >\r\n {selectableCountries.map((country) => (\r\n \r\n {valueDisplayType === 'alpha2AndName'\r\n ? `(${country.alpha2Code}) ${country.name}`\r\n : country[optionLabelType]}\r\n \r\n ))}\r\n \r\n \r\n \r\n );\r\n};\r\n","import { FunctionComponent, CSSProperties } from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { Form, Select } from 'antd';\r\nimport { selectCurrencies } from 'store';\r\nimport { Switch, Case } from 'components/shared/switch';\r\n\r\ninterface Props {\r\n name?: (string | number)[];\r\n fieldKey?: (string | number)[];\r\n mode?: 'name' | 'alpha3Code' | 'both';\r\n label?: string;\r\n required?: boolean;\r\n style?: CSSProperties;\r\n noStyle?: boolean;\r\n placeholder?: string;\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CurrencyInput: FunctionComponent = ({\r\n mode = 'both',\r\n name = ['currencyCode'],\r\n fieldKey = ['currencyCode'],\r\n required = false,\r\n disabled = false,\r\n label,\r\n style,\r\n noStyle,\r\n placeholder,\r\n ...props\r\n}) => {\r\n const currencies = useSelector(selectCurrencies);\r\n\r\n return (\r\n \r\n \r\n {currencies.map((currency) => (\r\n \r\n \r\n {currency?.alpha3Code}} />\r\n {currency?.name}} />\r\n \r\n {currency?.alpha3Code} ({currency?.name})\r\n \r\n }\r\n />\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\n","import {\r\n useState,\r\n useEffect,\r\n useRef,\r\n FunctionComponent,\r\n ChangeEvent,\r\n FocusEvent,\r\n} from 'react';\r\nimport { Input as AntdInput } from 'antd';\r\nimport { InputProps as AntdInputProps } from 'antd/es/input';\r\n\r\nexport interface InputProps extends AntdInputProps {\r\n value?: string;\r\n mask?: (value: string) => string;\r\n}\r\n\r\nexport const Input: FunctionComponent = ({\r\n value,\r\n mask = (x) => x,\r\n onChange = () => {},\r\n onBlur = () => {},\r\n onFocus = () => {},\r\n ...props\r\n}) => {\r\n const inputRef = useRef(null);\r\n const [internalValue, setInternalValue] = useState('');\r\n const [displayedValue, setDisplayedValue] = useState('');\r\n\r\n const _onChange = (event: ChangeEvent) => {\r\n const value = event?.target?.value || '';\r\n setInternalValue(value);\r\n setDisplayedValue(value);\r\n onChange(event);\r\n };\r\n\r\n const _onFocus = (event: FocusEvent) => {\r\n setDisplayedValue(internalValue);\r\n onFocus(event);\r\n };\r\n\r\n const _onBlur = (event: FocusEvent) => {\r\n setDisplayedValue(mask(internalValue));\r\n onBlur(event);\r\n };\r\n\r\n useEffect(() => {\r\n setInternalValue(value || '');\r\n const isElementFocused = !!inputRef?.current?.state?.focused;\r\n const displayedValue = isElementFocused ? value || '' : mask(value || '');\r\n setDisplayedValue(displayedValue);\r\n }, [value, mask]);\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import { FunctionComponent, ReactNode } from 'react';\r\nimport { SharedColors } from '@fluentui/react';\r\n\r\nexport interface StatusProps {\r\n text?: ReactNode;\r\n color: string;\r\n}\r\n\r\nexport const StatusColor: { [name: string]: string } = {\r\n NoStatus: 'hsl(0, 0%, 80%)',\r\n Processing: SharedColors.cyanBlue10,\r\n Warning: SharedColors.orange10,\r\n Success: SharedColors.greenCyan10,\r\n Error: SharedColors.red10,\r\n Restricted: '#555555',\r\n};\r\n\r\nexport const Status: FunctionComponent = ({ color, text }) => (\r\n
    \r\n \r\n {text}\r\n
    \r\n);\r\n","import { FunctionComponent, ReactNode, CSSProperties } from 'react';\r\nimport { Result } from 'antd';\r\nimport { FontIcon, Text } from '@fluentui/react';\r\n\r\nexport interface SuccessResultProps {\r\n title?: ReactNode;\r\n subTitle?: ReactNode;\r\n extra?: ReactNode;\r\n style?: CSSProperties;\r\n}\r\n\r\nexport const SuccessResult: FunctionComponent = ({\r\n title,\r\n subTitle,\r\n ...props\r\n}) => (\r\n \r\n }\r\n title={{title}}\r\n subTitle={{subTitle}}\r\n {...props}\r\n />\r\n);\r\n","import { FunctionComponent, CSSProperties } from 'react';\r\n\r\nexport interface LayoutContentProps {\r\n verticalScroll?: boolean;\r\n withSidebar?: boolean;\r\n as?: keyof JSX.IntrinsicElements;\r\n className?: string;\r\n style?: CSSProperties;\r\n}\r\n\r\nexport const LayoutContent: FunctionComponent = ({\r\n verticalScroll = true,\r\n withSidebar = true,\r\n as: Element = 'div',\r\n style = {},\r\n ...props\r\n}) => (\r\n \r\n);\r\n","import { FunctionComponent } from 'react';\r\nimport { Text } from '@fluentui/react';\r\nimport { Address as IAddress } from 'integrations/crossborderit';\r\n\r\ninterface Props {\r\n address?: IAddress;\r\n}\r\n\r\nexport const Address: FunctionComponent = ({ address }) =>\r\n !address ? (\r\n <>\r\n ) : (\r\n \r\n {address.addressLine1}\r\n {address.addressLine2}\r\n \r\n {address.city} {address.state} {address.postalCode}\r\n \r\n \r\n );\r\n","import { FunctionComponent, useEffect, useState } from 'react';\r\nimport { AsyncStatus } from 'store';\r\nimport { Switch, Case } from 'components/shared/switch';\r\nimport { useCountries, Country as CountryType } from 'integrations/crossborderit';\r\n\r\ninterface Props {\r\n mode?: 'name' | 'alpha2Code' | 'both';\r\n countryCode?: string;\r\n}\r\n\r\nexport const Country: FunctionComponent = ({\r\n mode = 'name',\r\n countryCode,\r\n}) => {\r\n\r\n const { selectCountryBy, status: countryStatus } = useCountries();\r\n const [country, setCountry] = useState();\r\n\r\n useEffect(() => {\r\n if (countryStatus === AsyncStatus.Success) {\r\n setCountry(selectCountryBy('alpha2Code', countryCode || ''));\r\n }\r\n }, [countryStatus, countryCode, selectCountryBy]);\r\n\r\n return !countryCode || !country ? (\r\n <>\r\n ) : (\r\n \r\n {country?.name}} />\r\n {country?.alpha2Code}} />\r\n \r\n {country?.name} ({country?.alpha2Code})\r\n \r\n }\r\n />\r\n \r\n );\r\n};\r\n","import { FunctionComponent } from 'react';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectCurrency } from 'store';\r\nimport { Switch, Case } from 'components/shared/switch';\r\n\r\ninterface Props {\r\n mode?: 'name' | 'alpha3Code' | 'both';\r\n currencyCode?: string;\r\n}\r\n\r\nexport const Currency: FunctionComponent = ({\r\n mode = 'both',\r\n currencyCode,\r\n}) => {\r\n const currency = useSelector(selectCurrency(currencyCode || ''));\r\n\r\n return !currencyCode || !currency ? (\r\n <>\r\n ) : (\r\n \r\n {currency?.name}} />\r\n {currency?.alpha3Code}} />\r\n \r\n {currency?.name} ({currency?.alpha3Code})\r\n \r\n }\r\n />\r\n \r\n );\r\n};\r\n","import { FunctionComponent } from 'react';\r\n\r\ninterface Props {\r\n timestamp: string;\r\n time?: boolean;\r\n}\r\n\r\nexport const toDisplayDate = (timestamp: string, time: boolean = false) => {\r\n const date = new Date(timestamp);\r\n return time\r\n ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`.trim()\r\n : `${date.toLocaleDateString()}`;\r\n};\r\n\r\nexport const DisplayDate: FunctionComponent = ({\r\n timestamp,\r\n time = false,\r\n}) => <>{!!timestamp && toDisplayDate(timestamp, time)};\r\n","import { FunctionComponent, CSSProperties } from 'react';\r\nimport moment from 'moment';\r\n\r\ninterface Props {\r\n timestamp: string;\r\n style: CSSProperties;\r\n}\r\n\r\nexport const TimeAgo: FunctionComponent = ({\r\n timestamp,\r\n style,\r\n}: any) => {\r\n const getDate = () => moment.utc(timestamp, 'YYYY-MM-DD HH:mm:ss').fromNow();\r\n\r\n return
    {!!timestamp && getDate()}
    ;\r\n};\r\n","import download from 'downloadjs';\r\nimport { DateRange } from '../analytics';\r\nimport { apiFetch, HTTPMethod } from '../fetch';\r\nimport { apiFetchFormData } from '../fetchFormData';\r\nimport { UploadedFile } from '../uploadedFiles';\r\nimport { CustomsStatus, DigitalCustomsArticle, DigitalCustomsArticleAndConsolidation, DigitalCustomsConsolidation, DigitalCustomsConsolidationDocument, DigitalCustomsConsolidationError, DigitalCustomsConsolidationsResendResult, DigitalCustomsMaster, DigitalCustomsMasterPreview, DigitalCustomsOrder, HSCodeCorrection, MasterWaybillDocument } from './interfaces';\r\n\r\nconst queryString = require('query-string');\r\n\r\nexport const getCompanyDigitalCustomsOrdersByDate = (companyId: string, dateRange: DateRange, isTest: boolean = false) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/orders?from=${dateRange.from}&to=${dateRange.to}&isTest=${isTest}`);\r\n\r\nexport const getCompanyDigitalCustomsArticlesByOrderId = (companyId: string, orderId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/articlesByOrderId?orderId=${orderId}`);\r\n\r\nexport const getCompanyDigitalCustomsConsolidationsNotSentToMymo = (companyId: string, isTest: boolean = false, dateRange?: DateRange) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidationsNotSentToMymo?isTest=${isTest}&${queryString.stringify(dateRange)}`);\r\n\r\nexport const getCompanyDigitalCustomsConsolidations = (companyId: string, dateRange: DateRange) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidations?from=${dateRange.from}&to=${dateRange.to}`);\r\n\r\nexport const getCompanyConsolidationsGroupedByMaster = (companyId: string, dateRange: DateRange) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidationsGroupedByMaster?fromDate=${dateRange.from}&toDate=${dateRange.to}`);\r\n\r\nexport const getCompanyConsolidationsByMasterWaybill = (companyId: string, masterwaybill: string, dateRange: DateRange) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidations/masterwaybill/${masterwaybill}?fromDate=${dateRange.from}&toDate=${dateRange.to}`);\r\n\r\nexport const getCompanyDigitalCustomsUploads = (companyId: string, dateRange: DateRange) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/uploads?fromDate=${dateRange.from}&toDate=${dateRange.to}`);\r\n\r\nexport const getCompanyDigitalCustomsOrdersByConsolidationId = (companyId: string, consolidationId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidations/${consolidationId}/orders`);\r\n\r\nexport const getCompanyDigitalCustomsOrdersByMasterWaybill = (companyId: string, masterwaybill: string, customsStatuses: CustomsStatus[], dateRange: DateRange) => {\r\n const statusQueryString = customsStatuses?.map((status, i) => `${i === 0 ? '&' : ''}customsStatus=${status}`).join('&');\r\n return apiFetch(`/DigitalCustoms/${companyId}/consolidations/orders?masterWaybillNumber=${masterwaybill}&fromDate=${dateRange.from}&toDate=${dateRange.to}${statusQueryString}`);\r\n};\r\n\r\nexport const getCorrectionArticles = (companyId: string, isTest: boolean, dateRange?: DateRange) => {\r\n const fromDateQuery = dateRange?.from ? `&fromDate=${dateRange.from}` : '';\r\n const toDateQuery = dateRange?.to ? `&toDate=${dateRange.to}` : '';\r\n return apiFetch(`/DigitalCustoms/${companyId}/article/corrections?isTest=${isTest}${fromDateQuery}${toDateQuery}`);\r\n};\r\n\r\nexport const getCompanyDigitalCustomsArticlesByConsolidationId = (companyId: string, consolidationId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/articlesByConsolidationId?consolidationId=${consolidationId}`);\r\n\r\nexport const putCompanyDigitalCustomsArticle = (companyId: string, articleId: string, article: DigitalCustomsArticle) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/article?articleId=${articleId}`, article, HTTPMethod.PUT);\r\n\r\nexport const putCompanyDigitalCustomsOrder = (companyId: string, orderId: string, order: DigitalCustomsOrder) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/order?orderId=${orderId}`, order, HTTPMethod.PUT);\r\n\r\nexport const sendConsolidationToMymo = (companyId: string, consolidationId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/sendConsolidationToMymo/${consolidationId}`, undefined, HTTPMethod.PUT);\r\n\r\nexport const getNumberOfCorrectionsForCompany = (companyId: string, isTest: boolean = false) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/numberOfConsolidationsCorrections?isTest=${isTest}`);\r\n\r\nexport const getConsolidationErrors = (companyId: string, consolidationId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidation/${consolidationId}/consolidationErrors`);\r\n\r\nexport const getConsolidation = (companyId: string, consolidationId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidation/${consolidationId}`);\r\n\r\nexport const deleteConsolidationsCorrection = (companyId: string, consolidationId: string): Promise =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidation/${consolidationId}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const editConsolidationNotes = (companyId: string, consolidationId: string, note: string): Promise =>\r\n apiFetch(`/DigitalCustoms/${companyId}/consolidation/${consolidationId}/consolidationNotes`, note, HTTPMethod.PUT);\r\n\r\nexport const approveAndSendCorrections = (companyId: string, sendInvalid: boolean, isTest: boolean, dateRange?: DateRange) => {\r\n const fromDateQuery = dateRange?.from ? `&fromDate=${dateRange.from}` : '';\r\n const toDateQuery = dateRange?.to ? `&toDate=${dateRange.to}` : '';\r\n const url = `/DigitalCustoms/${companyId}/ApproveAndSendCorrectionsToBroker?sendInvalid=${sendInvalid}&isTest=${isTest}${fromDateQuery}${toDateQuery}`;\r\n return apiFetch(url, undefined, HTTPMethod.PUT);\r\n};\r\n\r\nexport const getAllDocumentsForConsolidation = (companyId: string, consolidationId: string): Promise =>\r\n apiFetch(`/DigitalCustoms/${companyId}/${consolidationId}/documents`);\r\n\r\nexport const deleteConsolidationsDocument = (companyId: string, consolidationId: string, fileId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/${consolidationId}/documents/${fileId}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const uploadConsolidationsDocument = (companyId: string, consolidationId: string, files: any[]) => {\r\n\r\n const formData = new FormData();\r\n files.forEach(file => formData.append('files', file.originFileObj));\r\n\r\n return apiFetchFormData(\r\n `/DigitalCustoms/${companyId}/consolidations/${consolidationId}/files`,\r\n formData,\r\n HTTPMethod.POST\r\n )\r\n .catch(() => Promise.reject(({\r\n failedToImport: true,\r\n }) as MasterWaybillDocument))\r\n .then((digitalCustomsWaybillFile) => {\r\n\r\n if (digitalCustomsWaybillFile.failedToUpload) {\r\n return Promise.reject(digitalCustomsWaybillFile);\r\n }\r\n });\r\n};\r\n\r\nexport const getCorrectionArticlesInMappings = (companyId: string, articles: DigitalCustomsArticle[]) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/articlesInMappings`, articles, HTTPMethod.POST);\r\n\r\nexport const getHsCodesMappingsByIds = (companyId: string, articlesWithMappingIds: string[]) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/hsCodeCorrectionsByIds`, articlesWithMappingIds, HTTPMethod.POST);\r\n\r\nexport const getMasterFileList = (companyId: string, masterwaybill: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/attachments?masterWaybillNumber=${masterwaybill}`, undefined, HTTPMethod.GET);\r\n\r\nexport const getOrdersFileList = (companyId: string, orderId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/attachments/orders?orderId=${orderId}`, undefined, HTTPMethod.GET);\r\n\r\nexport const getMasterFile = (companyId: string, masterwaybill: string, fileName: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/attachments?masterWaybillNumber=${masterwaybill}&fileName=${fileName}`, undefined, HTTPMethod.GET)\r\n .then(async result => {\r\n const blob = await result.blob();\r\n return { blob };\r\n })\r\n .then(data => download(data.blob, fileName));\r\n\r\nexport const getOrderFile = (companyId: string, orderId: string, fileName: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/attachments/orders?orderId=${orderId}&fileName=${fileName}`, undefined, HTTPMethod.GET)\r\n .then(async result => {\r\n const blob = await result.blob();\r\n return { blob };\r\n })\r\n .then(data => download(data.blob, fileName));\r\n\r\nexport const deleteMasterFile = (companyId: string, masterwaybill: string, fileName: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/attachments?masterWaybillNumber=${masterwaybill}&fileName=${fileName}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const deleteOrderFile = (companyId: string, orderId: string, fileName: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/attachments/orders?orderId=${orderId}&fileName=${fileName}`, undefined, HTTPMethod.DELETE);\r\n\r\nexport const uploadMasterFile = (companyId: string, masterwaybill: string, files: any[]) => {\r\n const formData = new FormData();\r\n files.forEach(file => formData.append('files', file.originFileObj));\r\n return apiFetchFormData(`/DigitalCustoms/${companyId}/attachments?masterWaybillNumber=${masterwaybill}`, formData, HTTPMethod.POST);\r\n};\r\nexport const uploadOrderFile = (companyId: string, orderId: string, files: any[]) => {\r\n const formData = new FormData();\r\n files.forEach(file => formData.append('files', file.originFileObj));\r\n return apiFetchFormData(`/DigitalCustoms/${companyId}/attachments/orders?orderId=${orderId}`, formData, HTTPMethod.POST);\r\n};\r\nexport const resendDigitalCustomConsolidations = (companyId: string, consolidationIds: string[], portOfDestination: string, customsCountry: string) => {\r\n const params = new URLSearchParams({\r\n companyId,\r\n portOfDestination,\r\n customsCountry,\r\n });\r\n\r\n consolidationIds.forEach(id => params.append('consolidationIds', id));\r\n\r\n return apiFetch(`/v0.1/DigitalCustoms/Resend/Consolidations?${params.toString()}`, undefined, HTTPMethod.POST);\r\n};\r\n\r\nexport const getCompanyDigitalCustomsMasterPreviews = (companyId: string, dateRange: DateRange) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/masters?fromDate=${dateRange.from}&toDate=${dateRange.to}`);\r\n\r\nexport const getCompanyDigitalCustomsDetailedMaster = (companyId: string, masterId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/masters/${masterId}`);\r\n\r\nexport const editMaster = (companyId: string, masterId: string, master: Partial) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/masters/${masterId}`, master, HTTPMethod.PUT);\r\n\r\nexport const TriggerImportOrdersOnHoldNotification = (companyId: string, importId: string) =>\r\n apiFetch(`/DigitalCustoms/${companyId}/notification/ImportOrdersOnhold?importId=${importId}`, undefined, HTTPMethod.POST);","import { isEmpty } from 'ramda';\r\n\r\nexport const isObjKeysEmpty = (obj: Object): boolean => {\r\n if (typeof obj !== 'object') return true;\r\n const keys = Object.values(obj);\r\n const nonEmptyValues = keys.filter((key) => {\r\n if (key === null) return false;\r\n if (key === undefined) return false;\r\n if (key === 0) return true;\r\n return !isEmpty(key);\r\n });\r\n\r\n return nonEmptyValues.length === 0;\r\n};\r\n","import { Company, CompanyCategory } from '../integrations/crossborderit';\r\nimport { intersection } from 'ramda';\r\n\r\nexport const hasAnyCategory = (\r\n categories: CompanyCategory[],\r\n company: Company\r\n) => !!intersection(categories, company?.companyCategories || []).length;\r\n","import { CompanySubscription, CompanySubscriptionState, SubscriptionModule, SubscriptionModuleAccess } from '../integrations/crossborderit';\r\nimport { intersection } from 'ramda';\r\n\r\nexport const hasActiveSubscription = (\r\n companySubscriptions: CompanySubscription[],\r\n subscriptionModules: SubscriptionModule[],\r\n subscriptionModuleAccess: SubscriptionModuleAccess[] = []\r\n) => companySubscriptions.some(sub =>\r\n !!intersection(subscriptionModules, sub.modulesInSubscription || []).length\r\n && (!!subscriptionModuleAccess.length ? !!intersection(subscriptionModuleAccess, sub.subscriptionModuleAccess || []).length : true)\r\n && sub.companySubscriptionState === CompanySubscriptionState.Active\r\n);\r\n\r\nexport const hasSubscription = (\r\n companySubscriptions: CompanySubscription[],\r\n subscriptionModules: SubscriptionModule[],\r\n subscriptionModuleAccess: SubscriptionModuleAccess[] = []\r\n) => companySubscriptions.some(sub =>\r\n !!intersection(subscriptionModules, sub.modulesInSubscription || []).length\r\n && (!!subscriptionModuleAccess.length ? !!intersection(subscriptionModuleAccess, sub.subscriptionModuleAccess || []).length : true)\r\n);","export const decapitalize = (x: string) => x[0].toLowerCase() + x.slice(1);\r\n\r\nexport const isGuid = (value: string) => {\r\n const guidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;\r\n return guidRegex.test(value);\r\n};","import moment from 'moment';\r\n\r\nexport const fromUtcToLocalTime = (date: Date, format?: string) => {\r\n const utcDate = moment.utc(date);\r\n const utcToLocal = moment(utcDate).local().format(format);\r\n return moment(utcToLocal).toDate();\r\n};\r\n","export const validateIossNumber = (iossNumber: string | undefined) => {\r\n if (/^[I][M]\\d{10}$/.test(iossNumber!)){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n};","import { FunctionComponent, ReactNode, CSSProperties } from 'react';\r\nimport { Text } from '@fluentui/react';\r\n\r\nexport interface GuideProps {\r\n title: ReactNode;\r\n text?: ReactNode;\r\n extra?: ReactNode;\r\n style?: CSSProperties;\r\n}\r\n\r\nexport const Guide: FunctionComponent = ({\r\n title,\r\n text,\r\n extra,\r\n style = {},\r\n ...props\r\n}) => (\r\n \r\n \r\n {title}\r\n \r\n \r\n {text}\r\n \r\n {extra}\r\n \r\n);\r\n","import { update, findIndex, propEq, curry } from 'ramda';\r\n\r\nexport const replaceBy = curry((prop: string, value: T, list: T[]) => {\r\n if (prop === undefined || prop === null || typeof value !== 'object') {\r\n return list;\r\n }\r\n\r\n const index = findIndex(propEq(prop, value[prop as keyof T]), list);\r\n\r\n return index === -1 ? list : update(index, value, list);\r\n});\r\n","import { memoizeWith, identity, intersection, pathOr } from 'ramda';\r\nimport { AsyncStatus, AsyncResource } from 'store/interfaces';\r\nimport {\r\n User,\r\n UserRole,\r\n Currency,\r\n Company,\r\n CompanyUser,\r\n Invitation,\r\n Agreement,\r\n PageOptions,\r\n CompanyContact,\r\n CompanyUserRole,\r\n} from 'integrations/crossborderit';\r\nimport {\r\n Selector,\r\n SelectorWithArgument,\r\n SelectorWithArguments,\r\n} from './selector';\r\n\r\nexport const selectAppStatus: Selector = (state) =>\r\n state?.status || AsyncStatus.NotInitialized;\r\n\r\nexport const selectCurrencies: Selector = (state) =>\r\n state?.currencies || [];\r\n\r\nexport const selectCurrency: SelectorWithArgument<\r\nstring,\r\nCurrency | undefined\r\n> = (currencyCode) => (state) => {\r\n const currencies = state?.currencies || [];\r\n\r\n const findCurrency = memoizeWith(identity, (id: string):\r\n | Currency\r\n | undefined => currencies.find((currency) => currency.alpha3Code === id));\r\n\r\n return findCurrency(currencyCode);\r\n};\r\n\r\nexport const isUserInRole = (\r\n user?: User,\r\n requiredRoles: string[] = []\r\n): boolean => {\r\n const userRoles = user?.role || [];\r\n return !!intersection(userRoles, requiredRoles).length;\r\n};\r\n\r\nexport const selectIsUserInRole: SelectorWithArgument\r\n = (requiredRole) => (state) =>\r\n isUserInRole(state?.user, [requiredRole]);\r\n\r\nexport const isCompanyUserInRole = (\r\n companyUser?: CompanyUser,\r\n requiredRoles: string[] = []\r\n): boolean => {\r\n const companyUserRoles = companyUser?.companyUserRoles || [];\r\n return !!intersection(companyUserRoles, requiredRoles).length;\r\n};\r\n\r\nexport const selectIsCompanyUserInRole: SelectorWithArguments\r\n = (requiredRole, companyId) => (state) => {\r\n const companyUsers = state?.companyUsers && state?.companyUsers[companyId]?.data && Array.isArray(state?.companyUsers[companyId]?.data)\r\n ? state.companyUsers[companyId].data\r\n : [];\r\n const companyUser = companyUsers && companyUsers.find(user => user.userId === state?.user?.sub);\r\n return isCompanyUserInRole(companyUser, [requiredRole]);\r\n };\r\n\r\nexport const selectCompanyId: Selector<{companyId: string}> = (state) => {\r\n const allCompanyIds = Object.keys(state.companies as {\r\n [companyId: string]: AsyncResource;\r\n });\r\n const companyId = allCompanyIds[allCompanyIds.length - 1];\r\n return { companyId };\r\n};\r\n\r\nexport const selectCompany: SelectorWithArgument<\r\nstring,\r\n{ company: Company; status: AsyncStatus }\r\n> = (companyId) => (state) => {\r\n const asyncCompany = state?.companies?.[companyId];\r\n const status = asyncCompany?.status || AsyncStatus.NotInitialized;\r\n const company = asyncCompany?.data || ({} as Company);\r\n return { status, company };\r\n};\r\n\r\nexport const selectCompanyUsers: SelectorWithArgument<\r\nstring,\r\n{ status: AsyncStatus; users: CompanyUser[] }\r\n> = (companyId) => (state) => {\r\n const asyncUsers = state?.companyUsers?.[companyId];\r\n const status = asyncUsers?.status || AsyncStatus.NotInitialized;\r\n const users = asyncUsers?.data || [];\r\n return { status, users };\r\n};\r\n\r\nexport const selectCompanyContacts: SelectorWithArgument<\r\nstring,\r\n{ status: AsyncStatus; contacts: CompanyContact[] }\r\n> = (companyId) => (state) => {\r\n const asyncContacts = state?.companyContacts?.[companyId];\r\n const status = asyncContacts?.status || AsyncStatus.NotInitialized;\r\n const contacts = asyncContacts?.data || [];\r\n return { status, contacts };\r\n};\r\n\r\nexport const selectAdminData: Selector<{\r\n status: AsyncStatus;\r\n companyInvitations: Invitation[];\r\n}> = (state) => {\r\n const asyncAdminData = state?.admin;\r\n const status = asyncAdminData?.status || AsyncStatus.NotInitialized;\r\n const companyInvitations = asyncAdminData?.companyInvitations || [];\r\n return { status, companyInvitations };\r\n};\r\n\r\nexport const selectPageOptionsData: Selector<{\r\n pageOptions: PageOptions;\r\n}> = (state) => {\r\n const asyncPageOptions = state;\r\n const pageOptions = {\r\n status: asyncPageOptions.pageOptions!.status || AsyncStatus.NotInitialized,\r\n data: asyncPageOptions.pageOptions!.data || [],\r\n };\r\n return { pageOptions };\r\n};\r\n\r\nexport const selectPendingCompanyAgreements: SelectorWithArgument<\r\nstring,\r\n{ status: AsyncStatus; agreements: Agreement[] }\r\n> = (companyId: string) => (state) => {\r\n const asyncAgreements\r\n = state?.companyAgreements?.[companyId]?.pendingAgreements;\r\n const status = asyncAgreements?.status || AsyncStatus.NotInitialized;\r\n const agreements = asyncAgreements?.data || [];\r\n return { status, agreements };\r\n};\r\n\r\nexport const selectSignedCompanyAgreements: SelectorWithArgument<\r\nstring,\r\n{ status: AsyncStatus; agreements: Agreement[] }\r\n> = (companyId: string) => (state) => {\r\n const asyncAgreements\r\n = state?.companyAgreements?.[companyId]?.signedAgreements;\r\n const status = asyncAgreements?.status || AsyncStatus.NotInitialized;\r\n const agreements = asyncAgreements?.data || [];\r\n return { status, agreements };\r\n};\r\n\r\nexport const selectNumberOfCompanyTestCorrections: SelectorWithArgument<\r\nstring,\r\n{ status: AsyncStatus; numberOfCompanyTestCorrections: number }\r\n> = (companyId: string) => (state) => {\r\n const asyncNumberOfCompanyTestCorrections = state?.numberOfCompanyTestCorrections?.[companyId];\r\n const status = asyncNumberOfCompanyTestCorrections?.status || AsyncStatus.NotInitialized;\r\n const numberOfCompanyTestCorrections = asyncNumberOfCompanyTestCorrections?.data || 0;\r\n return { status, numberOfCompanyTestCorrections };\r\n};\r\n\r\nexport const selectNumberOfCompanyCorrections: SelectorWithArgument<\r\nstring,\r\n{ status: AsyncStatus; numberOfCompanyCorrections: number }\r\n> = (companyId: string) => (state) => {\r\n const asyncNumberOfCompanyCorrections = state?.numberOfCompanyCorrections?.[companyId];\r\n const status = asyncNumberOfCompanyCorrections?.status || AsyncStatus.NotInitialized;\r\n const numberOfCompanyCorrections = asyncNumberOfCompanyCorrections?.data || 0;\r\n return { status, numberOfCompanyCorrections };\r\n};\r\n\r\nexport const selectAsyncResource\r\n = (\r\n fallbackData: T,\r\n storePath: (string | number)[]\r\n ): Selector> =>\r\n (state) => {\r\n const fallbackResource = {\r\n status: AsyncStatus.NotInitialized,\r\n data: fallbackData,\r\n };\r\n\r\n const asyncResource: AsyncResource = pathOr(\r\n fallbackResource,\r\n storePath,\r\n state\r\n );\r\n\r\n const status = asyncResource?.status || AsyncStatus.NotInitialized;\r\n const data = asyncResource?.data || fallbackData;\r\n\r\n return { status, data } as {\r\n status: AsyncStatus;\r\n data: T;\r\n };\r\n };","import { FunctionComponent, useState, useEffect } from 'react';\r\nimport { Spinner, SpinnerSize } from '@fluentui/react';\r\nimport { Sidebar } from 'components/shared/sidebar';\r\nimport { Switch, Case } from 'components/shared/switch';\r\nimport { LayoutContent } from './LayoutContent';\r\n\r\nexport interface LayoutLoadingProps {\r\n // aware can be used when there is a sidebar higher up in the tree\r\n // and we want to avoid the loading indicator from changing position\r\n // when the sidebar renders\r\n sidebar?: 'none' | 'visible' | 'aware' | 'center';\r\n loadingLabel?: string;\r\n spinnerFullHeight?: boolean;\r\n}\r\n\r\nexport const LayoutLoading: FunctionComponent = ({\r\n sidebar = 'none',\r\n loadingLabel,\r\n spinnerFullHeight = false,\r\n}) => {\r\n const [windowWidth, setWindowWidth] = useState({\r\n width: 0,\r\n });\r\n\r\n const sidebarWidth = '249px';\r\n\r\n useEffect(() => {\r\n const handleResize = () => {\r\n setWindowWidth({\r\n width: window.innerWidth,\r\n });\r\n };\r\n window.addEventListener('resize', handleResize);\r\n handleResize();\r\n return () => window.removeEventListener('resize', handleResize);\r\n }, []);\r\n\r\n const LoadingSpinner = () => (\r\n \r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
    \r\n \r\n
    \r\n \r\n \r\n \r\n
    \r\n\r\n \r\n 1439 ? `-${sidebarWidth}` : '-0',\r\n }}\r\n >\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n
    \r\n );\r\n};\r\n","import { useEffect, useState, useCallback, ReactNode } from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { useRouteMatch, useLocation } from 'react-router-dom';\r\nimport { AppState, saveIsSidebarCollapsed } from 'store';\r\n\r\nexport interface SidebarItem {\r\n icon?: ReactNode;\r\n text: string;\r\n href: string;\r\n isVisible?: () => boolean;\r\n key?: string;\r\n className?: string;\r\n}\r\n\r\nexport const useSidebar = () => {\r\n const dispatch = useDispatch();\r\n const match = useRouteMatch();\r\n const location = useLocation();\r\n const [selectedKeys, setSelectedKeys] = useState([]);\r\n\r\n const isSidebarCollapsed = useSelector(\r\n (state: AppState) => !!state?.isSidebarCollapsed\r\n );\r\n\r\n const setIsSidebarCollapsed = (collapsed: boolean) => {\r\n dispatch(saveIsSidebarCollapsed(collapsed));\r\n };\r\n\r\n const toggleIsSidebarCollapsed = () => {\r\n setIsSidebarCollapsed(!isSidebarCollapsed);\r\n };\r\n\r\n useEffect(() => {\r\n setSelectedKeys(\r\n location.pathname\r\n .replace(`${match.url}`, '')\r\n .split('/')\r\n .filter((x) => !!x)\r\n );\r\n }, [match, location]);\r\n\r\n const getItemKey = useCallback((item: SidebarItem) =>\r\n item.href.replace(`${match.url}`, '').replace('/', ''), [match]);\r\n\r\n const isSidebarItemVisible = useCallback((item: SidebarItem) => {\r\n if (!item) return false;\r\n const predicate = item?.isVisible || (() => true);\r\n return predicate();\r\n }, []);\r\n\r\n return {\r\n isSidebarCollapsed,\r\n isSidebarItemVisible,\r\n setIsSidebarCollapsed,\r\n toggleIsSidebarCollapsed,\r\n selectedKeys,\r\n getItemKey,\r\n openedSidebarWidth: '249px',\r\n closedSidebarWidth: '80px',\r\n };\r\n};\r\n","/* eslint-disable no-nested-ternary */\r\nimport { FunctionComponent, ReactNode } from 'react';\r\nimport { Menu } from 'antd';\r\nimport { Icon, Stack } from '@fluentui/react';\r\nimport { Link } from 'react-router-dom';\r\nimport { useSidebar, SidebarItem } from './useSidebar';\r\nimport './Sidebar.css';\r\nimport {\r\n ScreenSize,\r\n useScreenSize,\r\n} from 'components/shared/layout/useScreenSize';\r\n\r\ninterface SidebarProps {\r\n loading?: boolean;\r\n menuItems?: MenuItem[];\r\n}\r\ninterface MenuItem {\r\n groupKey?: string;\r\n groupTitle?: string;\r\n groupIcon?: ReactNode;\r\n items?: SidebarItem[];\r\n subMenu?: MenuItem[];\r\n}\r\n\r\nexport const Sidebar: FunctionComponent = (props) => {\r\n const { screenSize } = useScreenSize();\r\n\r\n if (screenSize === ScreenSize.Large) {\r\n return ;\r\n } else if (screenSize === ScreenSize.Medium || screenSize === ScreenSize.Small) {\r\n return ;\r\n } else {\r\n return ;\r\n }\r\n};\r\n\r\nconst renderSubMenu = (\r\n menuItem: MenuItem,\r\n isSidebarItemVisible?: (item: SidebarItem) => boolean,\r\n getItemKey?: (item: SidebarItem) => string\r\n) => {\r\n if (!menuItem.subMenu || menuItem.subMenu.length === 0) {\r\n return null;\r\n }\r\n\r\n if (\r\n isSidebarItemVisible\r\n && menuItem.subMenu\r\n .map((item) => item.items)\r\n .flat()\r\n .every((item) => !isSidebarItemVisible(item!))\r\n ) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {menuItem.subMenu?.map((item) => {\r\n if (item.items?.length === 0) {\r\n return null;\r\n }\r\n\r\n return item.subMenu ? renderSubMenu(item, isSidebarItemVisible, getItemKey)\r\n : isSidebarItemVisible\r\n && item.groupKey\r\n && item.items\r\n && item.items.every((item) => isSidebarItemVisible(item)) ? (\r\n \r\n {renderSubMenu(item, isSidebarItemVisible, getItemKey)}\r\n {item.items.map(\r\n (subItem, i) =>\r\n isSidebarItemVisible\r\n && isSidebarItemVisible(subItem) && (\r\n \r\n {subItem.text}\r\n \r\n )\r\n )}\r\n \r\n ) : (\r\n item.items\r\n && item.items.map(\r\n (subItem, i) =>\r\n isSidebarItemVisible\r\n && isSidebarItemVisible(subItem) && (\r\n \r\n {subItem.text}\r\n \r\n )\r\n )\r\n );\r\n }\r\n )}\r\n \r\n );\r\n};\r\n\r\nconst HorizontalSidebar: FunctionComponent = ({\r\n loading = false,\r\n menuItems = [],\r\n}) => {\r\n const { selectedKeys, isSidebarItemVisible, getItemKey } = useSidebar();\r\n\r\n return (\r\n