{"version":3,"sources":["integrations/crossborderit/useCrossborderitApi.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","components/shared/layout/useScreenSize.ts","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","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","store/actions/createAction.ts","store/actions/agreements.ts","store/actions/setAsyncResource.ts","store/actions/index.ts","store/rootReducer.ts","store/storeSetup.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","utility/stringToColor.ts","integrations/crossborderit/fetchFormData.ts","components/shared/button/index.ts"],"names":["useCrossborderitApi","api","apiFetch","apiFormData","apiFetchFormData","AgreementType","ApiAccess","getAgreements","getAllAgreements","postAgreement","agreement","formData","FormData","append","upload","file","originFileObj","agreementType","JSON","stringify","companyCategories","name","description","updateSummary","HTTPMethod","POST","putAgreement","PUT","deleteAgreement","agreementId","undefined","DELETE","getPendingCompanyAgreements","companyId","getSignedCompanyAgreements","signCompanyAgreement","Environment","useApiKeys","storePath","useMemo","dispatch","useDispatch","useSelector","selectAsyncResource","data","apiKeys","status","AsyncStatus","NotInitialized","loadApiKeys","useCallback","setAsyncResource","Loading","then","Success","catch","Error","createApiKey","apiKey","newApiKey","token","updateKeyDescription","apiKeyId","updatedKey","replaceBy","revokeApiKey","revokedKey","useEffect","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","useState","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","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","theme","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","toggleMobileSidebar","history","useHistory","authenticationStatus","useAuthenticationStatus","isCbitAdmin","selectIsUserInRole","Employee","location","useLocation","isCompanyPage","startsWith","path","setPath","screenSize","useScreenSize","ScreenSize","Mobile","marginBottom","Authentication","Authenticated","tokens","childrenGap","Login","Desktop","DesktopSmall","marginLeft","flex","flexDirection","TooltipHost","content","styles","root","setScreenSize","useTheme","getScreenSize","window","innerWidth","breakpoints","desktop","mobile","addEventListener","removeEventListener","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","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","obj","isEmpty","hasAnyCategory","categories","intersection","hasActiveSubscription","companySubscriptions","subscriptionModules","subscriptionModuleAccess","modulesInSubscription","companySubscriptionState","Active","hasSubscription","decapitalize","toLowerCase","fromUtcToLocalTime","utcDate","utcToLocal","validateIossNumber","test","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","large","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","MobileSidebar","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","selectProps","Layout","mobileSidebarOpen","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","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","createAction","fn","assign","loadPendingCompanyAgreements","setPendingCompanyAgreements","loadSignedCompanyAgreements","setSignedCompanyAgreements","loadAppData","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","setupStore","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","PageState","AppDataLoader","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","CbitAdminModule","lazy","OnboardingModule","WorkspaceModule","initializeIcons","i18n","use","initReactI18next","init","lng","keySeparator","interpolation","escapeValue","store","baseUrl","getElementsByTagName","getAttribute","App","ThemeProvider","basename","exact","fallback","rootElement","getElementById","ReactDOM","str","charCodeAt","colour","substr","errorMessageConverter","errorMessage"],"mappings":"4IAAA,qDAGaA,EAAsB,iBAAO,CACxCC,IAAKC,IACLC,YAAaC,O,47VCgBHC,ECFAC,E,eCfCC,EAAgB,kBAA4BL,YAAS,gBAErDM,EAAmB,kBAA4BN,YAAS,oBAExDO,EAAgB,SAACC,GAC5B,IAAMC,EAAW,IAAIC,SAOrB,OANAD,EAASE,OAAO,OAAQH,EAAUI,OAAOC,KAAKC,eAC9CL,EAASE,OAAO,gBAAiBH,EAAUO,eAC3CN,EAASE,OAAO,oBAAqBK,KAAKC,UAAUT,EAAUU,oBAC9DT,EAASE,OAAO,OAAQH,EAAUW,MAClCV,EAASE,OAAO,cAAeH,EAAUY,aACzCX,EAASE,OAAO,gBAAiBH,EAAUa,eAAiB,IACrDnB,YAAiB,cAAeO,EAAUa,IAAWC,OAGjDC,EAAe,SAAChB,GAAD,OAC1BR,YAAS,cAAeQ,EAAWc,IAAWG,MAEnCC,EAAkB,SAACC,GAAD,OAC7B3B,YAAS,eAAD,OAAgB2B,QAAeC,EAAWN,IAAWO,SAElDC,EAA8B,SAACC,GAAD,OACzC/B,YAAQ,qBAA4B+B,EAA5B,yBAEGC,EAA6B,SAACD,GAAD,OACxC/B,YAAQ,qBAA4B+B,EAA5B,wBAEGE,EAAuB,SAACF,EAAmBJ,GAApB,OAClC3B,YAAS,cAAD,OAAe+B,EAAf,4BAA4CJ,M,SFX1CxB,K,wCAAAA,E,kCAAAA,E,4BAAAA,E,eAAAA,M,cCFAC,K,0BAAAA,E,4BAAAA,E,YAAAA,E,gCAAAA,E,gCAAAA,E,sBAAAA,E,0BAAAA,E,2CAAAA,M,SEdA8B,E,mECGCC,EAAa,SAACJ,GACzB,IA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oD,EAAwB,SAACC,GAC7B,QAAI,qEAAqEra,KAAKqa,IACrE,gCAJmB,SAQA10B,IAAYW,kBARZ,sCASF,CAAEr/B,OAAQylC,IAAWnG,kBATnB,uBAWVZ,IAAYoH,iBAXF,cAWxBhlC,EAXwB,OAYxB8b,EAZwB,UAYfpb,GAZe,eAYckkC,GAZd,UAcJnkC,MAAMqb,EAAK,CACnCgpB,SACAD,OACAI,QAAS,CACPE,cAAc,UAAD,OAAYnlC,MAlBC,YAcxBolC,EAdwB,QAsBdlmC,SAAW6T,IAAWsyB,aAtBR,sBAuBtB,CAAEnmC,OAAQylC,IAAWnG,kBAvBC,YAwBnB4G,EAAYtzB,GAxBO,2CAyBV,OAAXszB,QAAW,IAAXA,GAAA,UAAAA,EAAaH,eAAb,mBAAsBkB,IAAI,uBAA1B,eAA2CtjC,SAAS,qBACvDuiC,EAAYxkC,OACZwkC,GA3BwB,yBA6BHA,EAAY1V,OA7BT,cA6BxB4iC,EA7BwB,OA8BxBD,EAAsBC,GACxBA,EAAeD,EAAsBC,KAE7BA,IAA4B,QAAZ,EAAAA,SAAA,eAAclnD,QAAS,OAC/CknD,EAAY,6DAAyDx2C,IAEjE,IAAIlc,MAAM0yD,GApCY,4CAAH,yD,gCCT7B,mD","file":"static/js/main.9a920a41.chunk.js","sourcesContent":["import { apiFetch } from 'integrations/crossborderit/fetch';\r\nimport { apiFetchFormData } from 'integrations/crossborderit/fetchFormData';\r\n\r\nexport const useCrossborderitApi = () => ({\r\n api: apiFetch,\r\n apiFormData: apiFetchFormData,\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}\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);","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 toggleMobileSidebar?: () => 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 toggleMobileSidebar = () => { },\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 toggleMobileSidebar();\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","import { useCallback, useEffect, useState } from 'react';\r\nimport { useTheme } from 'styles';\r\n\r\nexport const enum ScreenSize{\r\n Desktop,\r\n DesktopSmall,\r\n Mobile,\r\n}\r\n\r\nexport const useScreenSize = () => {\r\n const [screenSize, setScreenSize] = useState(ScreenSize.Desktop);\r\n const theme = useTheme();\r\n\r\n const getScreenSize = useCallback(() => {\r\n if (window.innerWidth > theme.breakpoints.desktop) {\r\n setScreenSize(ScreenSize.Desktop);\r\n }\r\n else if (window.innerWidth >= theme.breakpoints.mobile && window.innerWidth <= theme.breakpoints.desktop ) {\r\n setScreenSize(ScreenSize.DesktopSmall);\r\n }\r\n else {\r\n setScreenSize(ScreenSize.Mobile);\r\n }\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};","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 desktop: number;\r\n mobile: 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 desktop: 1440,\r\n mobile: 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\n \r\n \r\n \r\n \r\n \r\n ),\r\n },\r\n });\r\n}","export default \"data:image/png;base64,iVBOR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zwtIdeOfDDBOV2tGpmyx2vcqznGH+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}`);","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","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.Desktop) {\r\n return ;\r\n } else if (screenSize === ScreenSize.DesktopSmall) {\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\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