{"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","components/shared/button/index.ts","integrations/crossborderit/fetchFormData.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","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","getMasterFile","deleteMasterFile","uploadMasterFile","files","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,w5VCgBHC,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,IAAMK,EAAYC,mBAAQ,iBAAM,CAAC,UAAWN,KAAY,CAACA,IACjDhC,EAAQD,cAARC,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gCCZT,kD,+GCSal1D,EAAgB,uCAAG,WAAU+nC,EAAkBC,GAA5B,2CAAAxwB,EAAA,6DAAwCywB,EAAxC,+BAA6D7mC,IAAW+L,IAEhGioD,EAAwB,SAACC,GAC7B,QAAI,qEAAqEra,KAAKqa,IACrE,gCAJmB,SAQAt0B,IAAYW,kBARZ,sCASF,CAAEh/B,OAAQolC,IAAWnG,kBATnB,uBAWVZ,IAAYoH,iBAXF,cAWxB3kC,EAXwB,OAYxByb,EAZwB,UAYf/a,GAZe,eAYc6jC,GAZd,UAcJ9jC,MAAMgb,EAAK,CACnCgpB,SACAD,OACAI,QAAS,CACPE,cAAc,UAAD,OAAY9kC,MAlBC,YAcxB+kC,EAdwB,QAsBd7lC,SAAW6T,IAAWiyB,aAtBR,sBAuBtB,CAAE9lC,OAAQolC,IAAWnG,kBAvBC,YAwBnB4G,EAAYjzB,GAxBO,2CAyBV,OAAXizB,QAAW,IAAXA,GAAA,UAAAA,EAAaH,eAAb,mBAAsBkB,IAAI,uBAA1B,eAA2CjjC,SAAS,qBACvDkiC,EAAYnkC,OACZmkC,GA3BwB,yBA6BHA,EAAY1V,OA7BT,cA6BxBwiC,EA7BwB,OA8BxBD,EAAsBC,GACxBA,EAAeD,EAAsBC,KAE7BA,IAA4B,QAAZ,EAAAA,SAAA,eAAczmD,QAAS,OAC/CymD,EAAY,6DAAyDp2C,IAEjE,IAAI7b,MAAMiyD,GApCY,4CAAH,0D","file":"static/js/main.0e86a5d1.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}\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 offset?: number;\r\n count?: number;\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}\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}\r\n\r\nexport const productListBackendModelToPartialProducts = (productListFromBackEnd: productBackEndModel[]) => {\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 }));\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}\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,iVBORw0KGgoAAAANSUhEUgAAAPEAAAC1CAYAAACOAhlzAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAA8aADAAQAAAABAAAAtQAAAADhlR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gQgYr3qC96CgEIAIlaQIAAE9CIAEetVX/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 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 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 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\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