@bisondesk/commons-sdk 1.0.661 → 1.0.663
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants.d.ts +2 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +2 -0
- package/lib/constants.js.map +1 -1
- package/lib/document-layouts.d.ts +12 -0
- package/lib/document-layouts.d.ts.map +1 -0
- package/lib/document-layouts.js +2 -0
- package/lib/document-layouts.js.map +1 -0
- package/lib/location-utils.d.ts +2 -0
- package/lib/location-utils.d.ts.map +1 -1
- package/lib/location-utils.js +10 -12
- package/lib/location-utils.js.map +1 -1
- package/lib/tasks.d.ts +55 -0
- package/lib/tasks.d.ts.map +1 -1
- package/lib/tasks.js +21 -0
- package/lib/tasks.js.map +1 -1
- package/lib/vat.d.ts +2 -0
- package/lib/vat.d.ts.map +1 -0
- package/lib/vat.js +2 -0
- package/lib/vat.js.map +1 -0
- package/package.json +1 -1
- package/src/constants.ts +3 -0
- package/src/document-layouts.ts +22 -0
- package/src/location-utils.ts +17 -18
- package/src/tasks.ts +100 -0
- package/src/vat.ts +9 -0
- package/tsconfig.tsbuildinfo +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare enum TopLevelActions {
|
|
|
50
50
|
SettingsAll = "settings:*",
|
|
51
51
|
VehicleCreate = "vehicle:create",
|
|
52
52
|
TasksAll = "tasks:*",
|
|
53
|
+
TasksReadAll = "tasks:read-all",
|
|
53
54
|
TrackAndTraceDevices = "tt:devices:*",
|
|
54
55
|
TrackAndTraceDevicesExport = "tt:devices:export",
|
|
55
56
|
ManageStocklists = "stocklists:manage",
|
|
@@ -106,6 +107,7 @@ export declare const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = "sales_quote_profo
|
|
|
106
107
|
export declare const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = "sales_quote_agreement_template";
|
|
107
108
|
export declare const SALES_INVOICE_TEMPLATE_GROUP_ID = "sales_invoice_template";
|
|
108
109
|
export declare const VEHICLES_STICKER_TEMPLATE_GROUP_ID = "vehicles_sticker_template";
|
|
110
|
+
export declare const TRANSPORT_ITR_TEMPLATE_GROUP_ID = "transport_itr_template";
|
|
109
111
|
export declare const EXTERNAL_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID = "external_delivery_confirmation";
|
|
110
112
|
export declare const EU_VAT_COUNTRY_CODES: string[];
|
|
111
113
|
export declare const HEXON_LANG_CODES: [string, ...string[]];
|
package/lib/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAKxD,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,KAAK,WAAW;IAChB,cAAc,mBAAmB;IACjC,UAAU,gBAAgB;IAC1B,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,iBAAiB,uBAAuB;IACxC,iBAAiB,uBAAuB;IACxC,cAAc,oBAAoB;IAClC,uBAAuB,8BAA8B;IACrD,aAAa,mBAAmB;IAChC,SAAS,cAAc;IACvB,YAAY,kBAAkB;IAC9B,iBAAiB,wBAAwB;IACzC,iBAAiB,wBAAwB;IACzC,qBAAqB,4BAA4B;IACjD,gBAAgB,sBAAsB;IACtC,oBAAoB,4BAA4B;CACjD;AAED,eAAO,MAAM,SAAS,YAKrB,CAAC;AAEF,oBAAY,eAAe;IACzB,iBAAiB,YAAY;IAC7B,sBAAsB,wBAAwB;IAC9C,6BAA6B,8BAA8B;IAC3D,qBAAqB,qBAAqB;IAC1C,6BAA6B,+BAA+B;IAC5D,QAAQ,YAAY;IACpB,aAAa,oBAAoB;IACjC,iBAAiB,wBAAwB;IACzC,oBAAoB,uBAAuB;IAC3C,sBAAsB,sCAAsC;IAC5D,oBAAoB,2BAA2B;IAC/C,kBAAkB,yBAAyB;IAC3C,mBAAmB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WAAW;IACjB,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,kBAAkB;IAC9B,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;IACrC,kBAAkB,yBAAyB;IAC3C,OAAO,YAAY;IACnB,cAAc,oBAAoB;IAClC,cAAc,oBAAoB;IAClC,oBAAoB,4BAA4B;IAChD,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,UAAU,eAAe;CAC1B;AAKD,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,wCAAwC,oCAAoC,CAAC;AAC1F,eAAO,MAAM,+CAA+C,2CAClB,CAAC;AAC3C,eAAO,MAAM,6DAA6D,yDAClB,CAAC;AACzD,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AACjF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AACpF,eAAO,MAAM,sDAAsD,kDAClB,CAAC;AAClD,eAAO,MAAM,gDAAgD,4CAClB,CAAC;AAC5C,eAAO,MAAM,wDAAwD,oDAClB,CAAC;AACpD,eAAO,MAAM,sCAAsC,kCAAkC,CAAC;AACtF,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AACxF,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,kCAAkC,8BAA8B,CAAC;AAC9E,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,gDAAgD,mCAAmC,CAAC;AAKjG,eAAO,MAAM,oBAAoB,UA8BhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAalD,CAAC;AAEF,eAAO,MAAM,mBAAmB,oBAAoB,CAAC"}
|
package/lib/constants.js
CHANGED
|
@@ -57,6 +57,7 @@ export var TopLevelActions;
|
|
|
57
57
|
TopLevelActions["SettingsAll"] = "settings:*";
|
|
58
58
|
TopLevelActions["VehicleCreate"] = "vehicle:create";
|
|
59
59
|
TopLevelActions["TasksAll"] = "tasks:*";
|
|
60
|
+
TopLevelActions["TasksReadAll"] = "tasks:read-all";
|
|
60
61
|
TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
|
|
61
62
|
TopLevelActions["TrackAndTraceDevicesExport"] = "tt:devices:export";
|
|
62
63
|
TopLevelActions["ManageStocklists"] = "stocklists:manage";
|
|
@@ -122,6 +123,7 @@ export const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_temp
|
|
|
122
123
|
export const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
|
|
123
124
|
export const SALES_INVOICE_TEMPLATE_GROUP_ID = 'sales_invoice_template';
|
|
124
125
|
export const VEHICLES_STICKER_TEMPLATE_GROUP_ID = 'vehicles_sticker_template';
|
|
126
|
+
export const TRANSPORT_ITR_TEMPLATE_GROUP_ID = 'transport_itr_template';
|
|
125
127
|
export const EXTERNAL_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID = 'external_delivery_confirmation';
|
|
126
128
|
export const EU_VAT_COUNTRY_CODES = [
|
|
127
129
|
'at',
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAKxD,MAAM,CAAN,IAAY,QAmBX;AAnBD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,sCAA0B,CAAA;IAC1B,2BAAe,CAAA;IACf,qCAAyB,CAAA;IACzB,oDAAwC,CAAA;IACxC,oDAAwC,CAAA;IACxC,8CAAkC,CAAA;IAClC,iEAAqD,CAAA;IACrD,4CAAgC,CAAA;IAChC,mCAAuB,CAAA;IACvB,0CAA8B,CAAA;IAC9B,qDAAyC,CAAA;IACz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I;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["/**\n * Carries a record's version between server and client: the server answers with it on a read,\n * and a client hands it back on a write so the write only lands while the row still stands\n * there. Successor to the older `x-record-modified-at`.\n */\nexport const RECORD_VERSION_HEADER = 'x-record-version';\n\n//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n AppManager = 'app_manager',\n Board = 'board',\n Commercial = 'commercial',\n InboundCommercial = 'inbound_commercial',\n LeasingCommercial = 'leasing_commercial',\n GeneralManager = 'general_manager',\n GeneralManagerAssistant = 'general_manager_assistant',\n ParkLogistics = 'park_logistics',\n Purchaser = 'purchaser',\n SalesManager = 'sales_manager',\n SalesPriceManager = 'sales_price_manager',\n SalesStockManager = 'sales_stock_manager',\n SalesMarketingManager = 'sales_marketing_manager',\n SeniorAccountant = 'senior_accountant',\n TrackAndTraceManager = 'track_and_trace_manager',\n}\n\nexport const TOP_ROLES = [\n AppRoles.Admin,\n AppRoles.Board,\n AppRoles.GeneralManager,\n AppRoles.SeniorAccountant,\n];\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsFinanceBrowse = 'docs:finance:browse',\n DocumentsFinanceIssueProforma = 'docs:finance:new:proforma',\n DocumentsFinanceIssue = 'docs:finance:new',\n DocumentsAdministrativeBrowse = 'docs:administrative:browse',\n LeadsAll = 'leads:*',\n CrmOrgsBrowse = 'crm:orgs:browse',\n CrmContactsBrowse = 'crm:contacts:browse',\n BrowseDocumentDrafts = 'docs:drafts:browse',\n BrowsePurchasePayments = 'vehicles:purchase-payments:browse',\n BrowsePendingRemarks = 'remarks:pending:browse',\n LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingContractsBrowse = 'leasing:contracts:browse',\n LeasingContractsRsExport = 'leasing:contracts:rs:export-rs', // rs stands for rental solutions\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketInsights = 'insights:market',\n MarketingAll = 'marketing:*',\n OffersBrowse = 'offers:browse',\n OpportunitiesBrowseAll = 'opps:browse',\n OpportunitiesBrowseAssigned = 'opps:browse:assigned',\n IntercompanyPaymentsBrowse = 'opps:intercompany-payments:browse',\n VehicleInsights = 'insights:vehicle',\n SaveBankAccounts = 'settings:bank-accounts:save',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TasksAll = 'tasks:*',\n TrackAndTraceDevices = 'tt:devices:*',\n TrackAndTraceDevicesExport = 'tt:devices:export',\n ManageStocklists = 'stocklists:manage',\n TransportsBrowse = 'transports:browse',\n TransportsManage = 'transports:manage',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'] as const;\n\n//\n// Headers\n//\nexport const TENANT_ID_ADMIN_HEADER = 'tenant-id';\nexport const SERVICE_ID_ADMIN_HEADER = 'service-id';\n\n//\n// AUTH\n//\nexport const NO_TENANT_ID_VALUE = 'notenant';\nexport const SYSTEM_USER_ID = 'system';\nexport const CROSS_TENANT_USER_ID = 'cross-tenant-sync';\nexport const WHATSAPP_TEMPLATE_SYNC_USER_ID = 'whatsapp-template-sync';\n\n/** The registry of synthetic (non-human) user ids — behavior checks key on this list. */\nexport const SYNTHETIC_USER_IDS: readonly string[] = [\n SYSTEM_USER_ID,\n CROSS_TENANT_USER_ID,\n WHATSAPP_TEMPLATE_SYNC_USER_ID,\n];\n\n/** Display labels for the synthetic user ids — a projection of the registry above. */\nexport const SYNTHETIC_USER_LABELS: Record<string, string> = {\n [SYSTEM_USER_ID]: 'System',\n [CROSS_TENANT_USER_ID]: 'Tenant-sync',\n [WHATSAPP_TEMPLATE_SYNC_USER_ID]: 'Template-sync',\n};\n\n//\n// Business Entity IDs\n//\nexport enum BusinessEntityIds {\n BecrisDeclarations = 'becris_declarations',\n Contacts = 'contacts',\n Emails = 'emails',\n ExternalVehicleSale = 'external_vehicle_sale',\n Documents = 'documents',\n FinanceDocuments = 'finance_documents',\n AdministrativeDocuments = 'administrative_documents',\n InternetVehicles = 'internet-vehicles',\n LeasingContracts = 'leasing_contracts',\n LeasingUploadAutomation = 'leasing_upload_automation',\n Offers = 'offers',\n Opportunities = 'opportunities',\n Organizations = 'organizations',\n PdfTemplates = 'pdf_templates',\n Users = 'users',\n Vehicles = 'vehicles',\n VehiclesPurchase = 'vehicle_purchase',\n VehiclesPriceLists = 'vehicles_price_lists',\n Debtors = 'debtors',\n DebtorsDossier = 'debtor-dossiers',\n DocumentDrafts = 'document_drafts',\n TrackAndTraceDevices = 'track_and_trace_devices',\n Interests = 'interests',\n Prospects = 'prospects',\n Stocklists = 'stocklists',\n Transports = 'transports',\n}\n\n//\n// PDF Templates IDs\n//\nexport const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';\nexport const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_amortization_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID =\n 'leasing_contract_amortization_print_version_template';\nexport const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';\nexport const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';\nexport const LEASING_CONTRACT_SPECIFIC_CONDITIONS_TEMPLATE_GROUP_ID =\n 'leasing_contract_specific_conditions_template';\nexport const LEASING_CONTRACT_CAUTIONNEMENT_TEMPLATE_GROUP_ID =\n 'leasing_contract_cautionnement_template';\nexport const LEASING_CONTRACT_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_delivery_confirmation_template';\nexport const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';\nexport const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';\nexport const SALES_INVOICE_TEMPLATE_GROUP_ID = 'sales_invoice_template';\nexport const VEHICLES_STICKER_TEMPLATE_GROUP_ID = 'vehicles_sticker_template';\nexport const EXTERNAL_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID = 'external_delivery_confirmation';\n\n//\n// VAT Prefixes for EU Countries and Great Britain & Northern Ireland\n//\nexport const EU_VAT_COUNTRY_CODES = [\n 'at',\n 'be',\n 'bg',\n 'hr',\n 'cy',\n 'cz',\n 'dk',\n 'ee',\n 'fi',\n 'fr',\n 'de',\n 'gr', // greece has EL prefix but the country code is GR\n 'el',\n 'hu',\n 'ie',\n 'it',\n 'lv',\n 'lt',\n 'lu',\n 'mt',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'sk',\n 'si',\n 'es',\n 'se',\n 'xi', // Northern Ireland\n];\n\nexport const HEXON_LANG_CODES: [string, ...string[]] = [\n 'en',\n 'nl',\n 'de',\n 'fr',\n 'es',\n 'pt',\n 'it',\n 'pl',\n 'ru',\n 'ro',\n 'el',\n 'bg',\n];\n\nexport const DEFAULT_SLB_PARTNER = 'To be announced';\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAKxD,MAAM,CAAN,IAAY,QAmBX;AAnBD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,sCAA0B,CAAA;IAC1B,2BAAe,CAAA;IACf,qCAAyB,CAAA;IACzB,oDAAwC,CAAA;IACxC,oDAAwC,CAAA;IACxC,8CAAkC,CAAA;IAClC,iEAAqD,CAAA;IACrD,4CAAgC,CAAA;IAChC,mCA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L,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA0B;IACrD,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["/**\n * Carries a record's version between server and client: the server answers with it on a read,\n * and a client hands it back on a write so the write only lands while the row still stands\n * there. Successor to the older `x-record-modified-at`.\n */\nexport const RECORD_VERSION_HEADER = 'x-record-version';\n\n//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n AppManager = 'app_manager',\n Board = 'board',\n Commercial = 'commercial',\n InboundCommercial = 'inbound_commercial',\n LeasingCommercial = 'leasing_commercial',\n GeneralManager = 'general_manager',\n GeneralManagerAssistant = 'general_manager_assistant',\n ParkLogistics = 'park_logistics',\n Purchaser = 'purchaser',\n SalesManager = 'sales_manager',\n SalesPriceManager = 'sales_price_manager',\n SalesStockManager = 'sales_stock_manager',\n SalesMarketingManager = 'sales_marketing_manager',\n SeniorAccountant = 'senior_accountant',\n TrackAndTraceManager = 'track_and_trace_manager',\n}\n\nexport const TOP_ROLES = [\n AppRoles.Admin,\n AppRoles.Board,\n AppRoles.GeneralManager,\n AppRoles.SeniorAccountant,\n];\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsFinanceBrowse = 'docs:finance:browse',\n DocumentsFinanceIssueProforma = 'docs:finance:new:proforma',\n DocumentsFinanceIssue = 'docs:finance:new',\n DocumentsAdministrativeBrowse = 'docs:administrative:browse',\n LeadsAll = 'leads:*',\n CrmOrgsBrowse = 'crm:orgs:browse',\n CrmContactsBrowse = 'crm:contacts:browse',\n BrowseDocumentDrafts = 'docs:drafts:browse',\n BrowsePurchasePayments = 'vehicles:purchase-payments:browse',\n BrowsePendingRemarks = 'remarks:pending:browse',\n LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingContractsBrowse = 'leasing:contracts:browse',\n LeasingContractsRsExport = 'leasing:contracts:rs:export-rs', // rs stands for rental solutions\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketInsights = 'insights:market',\n MarketingAll = 'marketing:*',\n OffersBrowse = 'offers:browse',\n OpportunitiesBrowseAll = 'opps:browse',\n OpportunitiesBrowseAssigned = 'opps:browse:assigned',\n IntercompanyPaymentsBrowse = 'opps:intercompany-payments:browse',\n VehicleInsights = 'insights:vehicle',\n SaveBankAccounts = 'settings:bank-accounts:save',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TasksAll = 'tasks:*',\n /** Read tasks that are not your own: the unassigned pool, a colleague's list, everyone's. */\n TasksReadAll = 'tasks:read-all',\n TrackAndTraceDevices = 'tt:devices:*',\n TrackAndTraceDevicesExport = 'tt:devices:export',\n ManageStocklists = 'stocklists:manage',\n TransportsBrowse = 'transports:browse',\n TransportsManage = 'transports:manage',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'] as const;\n\n//\n// Headers\n//\nexport const TENANT_ID_ADMIN_HEADER = 'tenant-id';\nexport const SERVICE_ID_ADMIN_HEADER = 'service-id';\n\n//\n// AUTH\n//\nexport const NO_TENANT_ID_VALUE = 'notenant';\nexport const SYSTEM_USER_ID = 'system';\nexport const CROSS_TENANT_USER_ID = 'cross-tenant-sync';\nexport const WHATSAPP_TEMPLATE_SYNC_USER_ID = 'whatsapp-template-sync';\n\n/** The registry of synthetic (non-human) user ids — behavior checks key on this list. */\nexport const SYNTHETIC_USER_IDS: readonly string[] = [\n SYSTEM_USER_ID,\n CROSS_TENANT_USER_ID,\n WHATSAPP_TEMPLATE_SYNC_USER_ID,\n];\n\n/** Display labels for the synthetic user ids — a projection of the registry above. */\nexport const SYNTHETIC_USER_LABELS: Record<string, string> = {\n [SYSTEM_USER_ID]: 'System',\n [CROSS_TENANT_USER_ID]: 'Tenant-sync',\n [WHATSAPP_TEMPLATE_SYNC_USER_ID]: 'Template-sync',\n};\n\n//\n// Business Entity IDs\n//\nexport enum BusinessEntityIds {\n BecrisDeclarations = 'becris_declarations',\n Contacts = 'contacts',\n Emails = 'emails',\n ExternalVehicleSale = 'external_vehicle_sale',\n Documents = 'documents',\n FinanceDocuments = 'finance_documents',\n AdministrativeDocuments = 'administrative_documents',\n InternetVehicles = 'internet-vehicles',\n LeasingContracts = 'leasing_contracts',\n LeasingUploadAutomation = 'leasing_upload_automation',\n Offers = 'offers',\n Opportunities = 'opportunities',\n Organizations = 'organizations',\n PdfTemplates = 'pdf_templates',\n Users = 'users',\n Vehicles = 'vehicles',\n VehiclesPurchase = 'vehicle_purchase',\n VehiclesPriceLists = 'vehicles_price_lists',\n Debtors = 'debtors',\n DebtorsDossier = 'debtor-dossiers',\n DocumentDrafts = 'document_drafts',\n TrackAndTraceDevices = 'track_and_trace_devices',\n Interests = 'interests',\n Prospects = 'prospects',\n Stocklists = 'stocklists',\n Transports = 'transports',\n}\n\n//\n// PDF Templates IDs\n//\nexport const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';\nexport const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_amortization_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID =\n 'leasing_contract_amortization_print_version_template';\nexport const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';\nexport const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';\nexport const LEASING_CONTRACT_SPECIFIC_CONDITIONS_TEMPLATE_GROUP_ID =\n 'leasing_contract_specific_conditions_template';\nexport const LEASING_CONTRACT_CAUTIONNEMENT_TEMPLATE_GROUP_ID =\n 'leasing_contract_cautionnement_template';\nexport const LEASING_CONTRACT_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_delivery_confirmation_template';\nexport const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';\nexport const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';\nexport const SALES_INVOICE_TEMPLATE_GROUP_ID = 'sales_invoice_template';\nexport const VEHICLES_STICKER_TEMPLATE_GROUP_ID = 'vehicles_sticker_template';\nexport const TRANSPORT_ITR_TEMPLATE_GROUP_ID = 'transport_itr_template';\nexport const EXTERNAL_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID = 'external_delivery_confirmation';\n\n//\n// VAT Prefixes for EU Countries and Great Britain & Northern Ireland\n//\nexport const EU_VAT_COUNTRY_CODES = [\n 'at',\n 'be',\n 'bg',\n 'hr',\n 'cy',\n 'cz',\n 'dk',\n 'ee',\n 'fi',\n 'fr',\n 'de',\n 'gr', // greece has EL prefix but the country code is GR\n 'el',\n 'hu',\n 'ie',\n 'it',\n 'lv',\n 'lt',\n 'lu',\n 'mt',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'sk',\n 'si',\n 'es',\n 'se',\n 'xi', // Northern Ireland\n];\n\nexport const HEXON_LANG_CODES: [string, ...string[]] = [\n 'en',\n 'nl',\n 'de',\n 'fr',\n 'es',\n 'pt',\n 'it',\n 'pl',\n 'ru',\n 'ro',\n 'el',\n 'bg',\n];\n\nexport const DEFAULT_SLB_PARTNER = 'To be announced';\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type DocumentLayoutBranch = {
|
|
2
|
+
branchId: string;
|
|
3
|
+
branchName: string;
|
|
4
|
+
language: string;
|
|
5
|
+
letterhead: 'stationery' | 'drawn' | 'default';
|
|
6
|
+
terms: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type DocumentLayout = {
|
|
9
|
+
groupId: string;
|
|
10
|
+
branches: DocumentLayoutBranch[];
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=document-layouts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-layouts.d.ts","sourceRoot":"/","sources":["document-layouts.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;IAC/C,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAOF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-layouts.js","sourceRoot":"/","sources":["document-layouts.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * What a built-in layout prints on one branch in one language: the letterhead the custom tree\n * gives the branch, and whether the branch has a terms page in that language.\n */\nexport type DocumentLayoutBranch = {\n branchId: string;\n branchName: string;\n language: string;\n /** Full-page stationery images, a drawn logo and footer, or the default drawn from the records. */\n letterhead: 'stationery' | 'drawn' | 'default';\n terms: boolean;\n};\n\n/**\n * A pdf-gen template group that is a built-in layout now, rendered in code rather than from a\n * DOCX. `branches` lists what the custom tree dresses each branch with, per language; it is\n * empty when every branch prints the same (the transport ITR, the vehicle sticker).\n */\nexport type DocumentLayout = {\n groupId: string;\n branches: DocumentLayoutBranch[];\n};\n"]}
|
package/lib/location-utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { LocationValue } from './types.js';
|
|
2
|
+
export declare const listAddressLines: (address: LocationValue) => string[];
|
|
2
3
|
export declare const getAddressText: (address: LocationValue, joinBy?: string) => string | undefined;
|
|
4
|
+
export declare const listCustomsAddressLines: (address: LocationValue) => string[];
|
|
3
5
|
export declare const getCustomsAdressText: (address: LocationValue, joinBy?: string) => string | undefined;
|
|
4
6
|
export declare const getFormatedAddressFromLocationValue: (location: LocationValue) => string | undefined;
|
|
5
7
|
export declare const generateGoogleMapsLink: (location: LocationValue) => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location-utils.d.ts","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"location-utils.d.ts","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAgB3C,eAAO,MAAM,gBAAgB,YAAa,aAAa,KAAG,MAAM,EAM/D,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,aAAa,WACd,MAAM,KACb,MAAM,GAAG,SAGX,CAAC;AAGF,eAAO,MAAM,uBAAuB,YAAa,aAAa,KAAG,MAAM,EACY,CAAC;AAEpF,eAAO,MAAM,oBAAoB,YACtB,aAAa,WACd,MAAM,KACb,MAAM,GAAG,SAGX,CAAC;AAEF,eAAO,MAAM,mCAAmC,aACpC,aAAa,KACtB,MAAM,GAAG,SAKX,CAAC;AAWF,eAAO,MAAM,sBAAsB,aAAc,aAAa,KAAG,MAAM,GAAG,SAezE,CAAC;AAMF,eAAO,MAAM,gCAAgC,WACnC,aAAa,GAAG,SAAS,eACpB,aAAa,KACzB,MAAM,GAAG,SAYX,CAAC"}
|
package/lib/location-utils.js
CHANGED
|
@@ -9,22 +9,20 @@ const COUNTRY_TO_CUSTOMS_CODE = {
|
|
|
9
9
|
const getCountryCustomsCode = (country) => {
|
|
10
10
|
return COUNTRY_TO_CUSTOMS_CODE[country.toUpperCase()] ?? country.toUpperCase();
|
|
11
11
|
};
|
|
12
|
-
export const
|
|
13
|
-
const
|
|
12
|
+
export const listAddressLines = (address) => {
|
|
13
|
+
const regionLine = [address.postalCode, address.city, address.country]
|
|
14
14
|
.filter((n) => !!n)
|
|
15
15
|
.join(', ');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
16
|
+
return [address.addressLine1, address.addressLine2, regionLine].filter((n) => !!n);
|
|
17
|
+
};
|
|
18
|
+
export const getAddressText = (address, joinBy = '<br>') => {
|
|
19
|
+
const lines = listAddressLines(address);
|
|
20
|
+
return lines.length === 0 ? undefined : lines.join(joinBy);
|
|
21
21
|
};
|
|
22
|
+
export const listCustomsAddressLines = (address) => listAddressLines({ ...address, country: getCountryCustomsCode(address.country) });
|
|
22
23
|
export const getCustomsAdressText = (address, joinBy = '<br>') => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
country: getCountryCustomsCode(address.country),
|
|
26
|
-
};
|
|
27
|
-
return getAddressText(customsAddress, joinBy);
|
|
24
|
+
const lines = listCustomsAddressLines(address);
|
|
25
|
+
return lines.length === 0 ? undefined : lines.join(joinBy);
|
|
28
26
|
};
|
|
29
27
|
export const getFormatedAddressFromLocationValue = (location) => {
|
|
30
28
|
const PARTS_JOINER = ', ';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG;IAC9B,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACT,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAU,EAAE;IACxD,OAAO,uBAAuB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;AAC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,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACvB,IAAI,QAAQ,CAAC,GAAG,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YACnC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,0BAA0B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AACvD,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,MAAiC,EACjC,WAA0B,EACN,EAAE;IACtB,MAAM,EAAE,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IACpC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,OAAO,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IAChF,OAAO,oCAAoC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AACjE,CAAC,CAAC","sourcesContent":["import { LocationValue } from './types.js';\n\nconst COUNTRY_TO_CUSTOMS_CODE = {\n RS: 'XS', // Serbia\n MC: 'FR', // Monaco\n SM: 'IT', // San Marino\n AD: 'ES', // Andorra\n GL: 'DK', // Greenland\n FO: 'DK', // Faroe Islands\n};\n\nconst getCountryCustomsCode = (country: string): string => {\n return COUNTRY_TO_CUSTOMS_CODE[country.toUpperCase()] ?? country.toUpperCase();\n};\n\n/** The address as lines: street, second street line, \"postcode, city, country\"; empty parts left out. */\nexport const listAddressLines = (address: LocationValue): string[] => {\n const regionLine = [address.postalCode, address.city, address.country]\n .filter((n) => !!n)\n .join(', ');\n\n return [address.addressLine1, address.addressLine2, regionLine].filter((n): n is string => !!n);\n};\n\nexport const getAddressText = (\n address: LocationValue,\n joinBy: string = '<br>',\n): string | undefined => {\n const lines = listAddressLines(address);\n return lines.length === 0 ? undefined : lines.join(joinBy);\n};\n\n/** `listAddressLines` with the country as customs write it. */\nexport const listCustomsAddressLines = (address: LocationValue): string[] =>\n listAddressLines({ ...address, country: getCountryCustomsCode(address.country) });\n\nexport const getCustomsAdressText = (\n address: LocationValue,\n joinBy: string = '<br>',\n): string | undefined => {\n const lines = listCustomsAddressLines(address);\n return lines.length === 0 ? undefined : lines.join(joinBy);\n};\n\nexport const getFormatedAddressFromLocationValue = (\n location: LocationValue,\n): string | undefined => {\n const PARTS_JOINER = ', ';\n const address = getAddressText(location, PARTS_JOINER);\n\n return address;\n};\n\n/** A place as Google Maps accepts it: coordinates when geocoded, else the postal address. */\nconst toMapsPoint = (location: LocationValue): string | undefined => {\n if (location.gps != null) {\n return `${location.gps.lat},${location.gps.lon}`;\n }\n return getFormatedAddressFromLocationValue(location) || undefined;\n};\n\n/** Google Maps centred on one address, or nothing when the address is empty. */\nexport const generateGoogleMapsLink = (location: LocationValue): string | undefined => {\n const q = toMapsPoint(location);\n if (q == null) {\n return;\n }\n\n const search = new URLSearchParams({ q });\n if (location.gps != null) {\n search.append('ll', q);\n if (location.gps.gMapsZoom != null) {\n search.append('z', location.gps.gMapsZoom.toString());\n }\n }\n\n return `http://maps.google.com?${search.toString()}`;\n};\n\n/**\n * Google Maps directions between two addresses, both pinned. Falls back to the destination\n * alone when the origin is empty; nothing when the destination is.\n */\nexport const generateGoogleMapsDirectionsLink = (\n origin: LocationValue | undefined,\n destination: LocationValue,\n): string | undefined => {\n const to = toMapsPoint(destination);\n if (to == null) {\n return;\n }\n const from = origin != null ? toMapsPoint(origin) : undefined;\n if (from == null) {\n return generateGoogleMapsLink(destination);\n }\n\n const search = new URLSearchParams({ api: '1', origin: from, destination: to });\n return `https://www.google.com/maps/dir/?${search.toString()}`;\n};\n"]}
|
package/lib/tasks.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BusinessEntityIds } from './constants.js';
|
|
|
2
2
|
import { MultiLangValue, NextRequest } from './types.js';
|
|
3
3
|
export declare const TASK_REMINDER_ORIGIN = "task-reminder";
|
|
4
4
|
export declare const TASK_UPDATED_ORIGIN = "task-updated";
|
|
5
|
+
export declare const TASK_ASSIGNED_ORIGIN = "task-assigned";
|
|
5
6
|
export declare enum TaskPriority {
|
|
6
7
|
Normal = 30,
|
|
7
8
|
High = 20,
|
|
@@ -15,6 +16,7 @@ type RecordData = {
|
|
|
15
16
|
businessEntityId: BusinessEntityIds;
|
|
16
17
|
recordId: string;
|
|
17
18
|
recordTitle?: string;
|
|
19
|
+
branchId?: string;
|
|
18
20
|
};
|
|
19
21
|
type JourneyData = {
|
|
20
22
|
journeyVersionId?: undefined;
|
|
@@ -34,10 +36,12 @@ type BaseTask = {
|
|
|
34
36
|
status: TaskStatus;
|
|
35
37
|
title: string;
|
|
36
38
|
autocompleted?: boolean;
|
|
39
|
+
completedAt?: string;
|
|
37
40
|
};
|
|
38
41
|
export type TaskUpdate = Partial<Omit<BaseTask, 'assignee' | 'dueDate'> & {
|
|
39
42
|
assignee?: string | null;
|
|
40
43
|
dueDate?: string | null;
|
|
44
|
+
branchId?: string | null;
|
|
41
45
|
}>;
|
|
42
46
|
export type NewTask = BaseTask & RecordData & JourneyData & {
|
|
43
47
|
createdAt?: undefined;
|
|
@@ -67,5 +71,56 @@ export type AssigneeTasksBetweenDatesQuery = {
|
|
|
67
71
|
start: string;
|
|
68
72
|
end: string;
|
|
69
73
|
};
|
|
74
|
+
export declare enum TaskScope {
|
|
75
|
+
Mine = "mine",
|
|
76
|
+
Unassigned = "unassigned",
|
|
77
|
+
Users = "users",
|
|
78
|
+
Everyone = "everyone"
|
|
79
|
+
}
|
|
80
|
+
export declare enum TaskDueBucket {
|
|
81
|
+
Overdue = "overdue",
|
|
82
|
+
Today = "today",
|
|
83
|
+
Week = "week",
|
|
84
|
+
Later = "later",
|
|
85
|
+
Undated = "undated"
|
|
86
|
+
}
|
|
87
|
+
export declare enum TaskSort {
|
|
88
|
+
Priority = "priority",
|
|
89
|
+
Assignee = "assignee"
|
|
90
|
+
}
|
|
91
|
+
export type TaskSearchQuery = {
|
|
92
|
+
scope?: TaskScope;
|
|
93
|
+
sort?: TaskSort;
|
|
94
|
+
assignee?: string[];
|
|
95
|
+
includeUnassigned?: boolean;
|
|
96
|
+
branchId?: string[];
|
|
97
|
+
businessEntityId?: BusinessEntityIds[];
|
|
98
|
+
taskConfigId?: string[];
|
|
99
|
+
status?: TaskStatus;
|
|
100
|
+
q?: string;
|
|
101
|
+
dueFrom?: string;
|
|
102
|
+
dueTo?: string;
|
|
103
|
+
overdue?: boolean;
|
|
104
|
+
undated?: boolean;
|
|
105
|
+
} & NextRequest;
|
|
106
|
+
export type TaskFacets = {
|
|
107
|
+
businessEntityId: Record<string, number>;
|
|
108
|
+
branchId: Record<string, number>;
|
|
109
|
+
status: Record<string, number>;
|
|
110
|
+
assignee: Record<string, number>;
|
|
111
|
+
taskConfigId: Record<string, number>;
|
|
112
|
+
bucket: Record<TaskDueBucket, number>;
|
|
113
|
+
};
|
|
114
|
+
export type TaskSearchResult = {
|
|
115
|
+
results: Task[];
|
|
116
|
+
nextToken?: string;
|
|
117
|
+
totalCount: number;
|
|
118
|
+
facets: TaskFacets;
|
|
119
|
+
};
|
|
120
|
+
export type TaskCounts = {
|
|
121
|
+
overdue: number;
|
|
122
|
+
dueToday: number;
|
|
123
|
+
open: number;
|
|
124
|
+
};
|
|
70
125
|
export {};
|
|
71
126
|
//# sourceMappingURL=tasks.d.ts.map
|
package/lib/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":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C,MAAM,EAAE,MAAM,CAAC,CAAC;IAQjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,IAAI,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
package/lib/tasks.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const TASK_REMINDER_ORIGIN = 'task-reminder';
|
|
2
2
|
export const TASK_UPDATED_ORIGIN = 'task-updated';
|
|
3
|
+
export const TASK_ASSIGNED_ORIGIN = 'task-assigned';
|
|
3
4
|
export var TaskPriority;
|
|
4
5
|
(function (TaskPriority) {
|
|
5
6
|
TaskPriority[TaskPriority["Normal"] = 30] = "Normal";
|
|
@@ -11,4 +12,24 @@ export var TaskStatus;
|
|
|
11
12
|
TaskStatus["Open"] = "open";
|
|
12
13
|
TaskStatus["Done"] = "done";
|
|
13
14
|
})(TaskStatus || (TaskStatus = {}));
|
|
15
|
+
export var TaskScope;
|
|
16
|
+
(function (TaskScope) {
|
|
17
|
+
TaskScope["Mine"] = "mine";
|
|
18
|
+
TaskScope["Unassigned"] = "unassigned";
|
|
19
|
+
TaskScope["Users"] = "users";
|
|
20
|
+
TaskScope["Everyone"] = "everyone";
|
|
21
|
+
})(TaskScope || (TaskScope = {}));
|
|
22
|
+
export var TaskDueBucket;
|
|
23
|
+
(function (TaskDueBucket) {
|
|
24
|
+
TaskDueBucket["Overdue"] = "overdue";
|
|
25
|
+
TaskDueBucket["Today"] = "today";
|
|
26
|
+
TaskDueBucket["Week"] = "week";
|
|
27
|
+
TaskDueBucket["Later"] = "later";
|
|
28
|
+
TaskDueBucket["Undated"] = "undated";
|
|
29
|
+
})(TaskDueBucket || (TaskDueBucket = {}));
|
|
30
|
+
export var TaskSort;
|
|
31
|
+
(function (TaskSort) {
|
|
32
|
+
TaskSort["Priority"] = "priority";
|
|
33
|
+
TaskSort["Assignee"] = "assignee";
|
|
34
|
+
})(TaskSort || (TaskSort = {}));
|
|
14
35
|
//# sourceMappingURL=tasks.js.map
|
package/lib/tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEpD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,oDAAW,CAAA;IACX,gDAAS,CAAA;IACT,oDAAW,CAAA;AACb,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAyFD,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,sCAAyB,CAAA;IACzB,4BAAe,CAAA;IACf,kCAAqB,CAAA;AACvB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAGD,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,oCAAmB,CAAA;AACrB,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AAMD,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;AACvB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB","sourcesContent":["import { BusinessEntityIds } from './constants.js';\nimport { MultiLangValue, NextRequest } from './types.js';\n\nexport const TASK_REMINDER_ORIGIN = 'task-reminder';\nexport const TASK_UPDATED_ORIGIN = 'task-updated';\nexport const TASK_ASSIGNED_ORIGIN = 'task-assigned';\n\nexport enum TaskPriority {\n Normal = 30,\n High = 20,\n Urgent = 10,\n}\n\nexport enum TaskStatus {\n Open = 'open',\n Done = 'done',\n}\n\ntype RecordData = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n /**\n * The branch the task belongs to, defaulted from the record it hangs off and editable after.\n * Optional because a record need not have one: an organization is used by several branches, and\n * a task can outlive the record's own branch changing.\n */\n branchId?: string;\n};\n\ntype JourneyData =\n | {\n journeyVersionId?: undefined;\n taskConfigId?: undefined;\n tag?: undefined;\n description?: undefined;\n }\n | {\n journeyVersionId: string;\n taskConfigId: string;\n tag?: string;\n description?: MultiLangValue;\n };\n\ntype BaseTask = {\n assignee?: string;\n dueDate?: string;\n priority: TaskPriority;\n status: TaskStatus;\n title: string;\n autocompleted?: boolean;\n /** When the task was last marked done. Cleared on reopen, so it always matches `status`. */\n completedAt?: string;\n};\n\nexport type TaskUpdate = Partial<\n Omit<BaseTask, 'assignee' | 'dueDate'> & {\n assignee?: string | null;\n dueDate?: string | null;\n branchId?: string | null;\n }\n>;\n\nexport type NewTask = BaseTask &\n RecordData &\n JourneyData & {\n createdAt?: undefined;\n createdBy?: undefined;\n id?: undefined;\n };\n\nexport type Task = BaseTask &\n RecordData &\n JourneyData & {\n createdAt: string;\n createdBy: string;\n deletedAt?: string;\n id: string;\n };\n\nexport type TaskAudit = Partial<Task> & {\n changedAt: string;\n changedBy: string;\n};\n\nexport type TaskNotificationData = {\n snippet?: string;\n taskId: string;\n};\n\nexport type TasksQuery = {\n assignee?: string;\n showDone?: boolean;\n} & NextRequest;\n\nexport type AssigneeTasksBetweenDatesQuery = {\n assignee: string;\n start: string;\n end: string;\n};\n\n/**\n * Whose tasks a search covers. Anything other than `Mine` needs `TopLevelActions.TasksReadAll`,\n * which is checked server-side — the scope is the permission boundary, not the assignee list.\n */\nexport enum TaskScope {\n Mine = 'mine',\n Unassigned = 'unassigned',\n Users = 'users',\n Everyone = 'everyone',\n}\n\n/** How a task's due date reads relative to today. Drives the list's grouping and the nav badge. */\nexport enum TaskDueBucket {\n Overdue = 'overdue',\n Today = 'today',\n Week = 'week',\n Later = 'later',\n Undated = 'undated',\n}\n\n/**\n * `Assignee` keeps each person's tasks contiguous so a list grouped by owner can page without a\n * person's rows being split across two pages. Unassigned tasks sort first under it.\n */\nexport enum TaskSort {\n Priority = 'priority',\n Assignee = 'assignee',\n}\n\nexport type TaskSearchQuery = {\n scope?: TaskScope;\n sort?: TaskSort;\n /** Only read when `scope` is `Users`. */\n assignee?: string[];\n /**\n * Widen `TaskScope.Users` to take in the unassigned pool as well — \"these people, plus anything\n * nobody has picked up\", which is what triage actually looks like. Ignored by other scopes.\n */\n includeUnassigned?: boolean;\n branchId?: string[];\n businessEntityId?: BusinessEntityIds[];\n /** Narrow to automatic tasks raised by these journey configs. */\n taskConfigId?: string[];\n status?: TaskStatus;\n q?: string;\n dueFrom?: string;\n dueTo?: string;\n overdue?: boolean;\n /** Only tasks with no due date — what the calendar's \"N tasks with no due date\" link opens. */\n undated?: boolean;\n} & NextRequest;\n\n/**\n * Counts for the whole result set, not the current page, and each one ignores its own filter — the\n * entity counts are what you would get with the entity filter cleared. That is what lets the filter\n * bar show \"Vehicles (4)\" next to an unselected option.\n */\nexport type TaskFacets = {\n businessEntityId: Record<string, number>;\n branchId: Record<string, number>;\n status: Record<string, number>;\n /**\n * Who has tasks here, ignoring any assignee selection — which is what lets the picker offer\n * people who are not currently shown. Unassigned tasks are counted under the empty key.\n */\n assignee: Record<string, number>;\n /**\n * Automatic tasks by the journey config that raises them. Manual tasks are not counted.\n *\n * The key is the config id and nothing else. A task's own title is not a label for the config:\n * `buildTaskTitle` resolves `{{...}}` placeholders per record, so one config can produce as many\n * distinct titles as it has tasks (\"BONUS INVOICE - € 1501\"). The client translates the id.\n */\n taskConfigId: Record<string, number>;\n bucket: Record<TaskDueBucket, number>;\n};\n\nexport type TaskSearchResult = {\n results: Task[];\n nextToken?: string;\n totalCount: number;\n facets: TaskFacets;\n};\n\nexport type TaskCounts = {\n overdue: number;\n dueToday: number;\n open: number;\n};\n"]}
|
package/lib/vat.d.ts
ADDED
package/lib/vat.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vat.d.ts","sourceRoot":"/","sources":["vat.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,MACK,CAAC"}
|
package/lib/vat.js
ADDED
package/lib/vat.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vat.js","sourceRoot":"/","sources":["vat.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE,CACpD,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/**\n * A VAT number reduced to its comparable form: uppercase, with every separator (dots, spaces,\n * dashes) stripped, so `be0762.732.774` and `BE 0762 732 774` both become `BE0762732774`.\n *\n * We normalise the same way for every country, on the assumption that a VAT number is only ever\n * uppercase letters and digits.\n */\nexport const normalizeVat = (input: string): string =>\n input.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();\n"]}
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -66,6 +66,8 @@ export enum TopLevelActions {
|
|
|
66
66
|
SettingsAll = 'settings:*',
|
|
67
67
|
VehicleCreate = 'vehicle:create',
|
|
68
68
|
TasksAll = 'tasks:*',
|
|
69
|
+
/** Read tasks that are not your own: the unassigned pool, a colleague's list, everyone's. */
|
|
70
|
+
TasksReadAll = 'tasks:read-all',
|
|
69
71
|
TrackAndTraceDevices = 'tt:devices:*',
|
|
70
72
|
TrackAndTraceDevicesExport = 'tt:devices:export',
|
|
71
73
|
ManageStocklists = 'stocklists:manage',
|
|
@@ -159,6 +161,7 @@ export const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_temp
|
|
|
159
161
|
export const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
|
|
160
162
|
export const SALES_INVOICE_TEMPLATE_GROUP_ID = 'sales_invoice_template';
|
|
161
163
|
export const VEHICLES_STICKER_TEMPLATE_GROUP_ID = 'vehicles_sticker_template';
|
|
164
|
+
export const TRANSPORT_ITR_TEMPLATE_GROUP_ID = 'transport_itr_template';
|
|
162
165
|
export const EXTERNAL_DELIVERY_CONFIRMATION_TEMPLATE_GROUP_ID = 'external_delivery_confirmation';
|
|
163
166
|
|
|
164
167
|
//
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a built-in layout prints on one branch in one language: the letterhead the custom tree
|
|
3
|
+
* gives the branch, and whether the branch has a terms page in that language.
|
|
4
|
+
*/
|
|
5
|
+
export type DocumentLayoutBranch = {
|
|
6
|
+
branchId: string;
|
|
7
|
+
branchName: string;
|
|
8
|
+
language: string;
|
|
9
|
+
/** Full-page stationery images, a drawn logo and footer, or the default drawn from the records. */
|
|
10
|
+
letterhead: 'stationery' | 'drawn' | 'default';
|
|
11
|
+
terms: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A pdf-gen template group that is a built-in layout now, rendered in code rather than from a
|
|
16
|
+
* DOCX. `branches` lists what the custom tree dresses each branch with, per language; it is
|
|
17
|
+
* empty when every branch prints the same (the transport ITR, the vehicle sticker).
|
|
18
|
+
*/
|
|
19
|
+
export type DocumentLayout = {
|
|
20
|
+
groupId: string;
|
|
21
|
+
branches: DocumentLayoutBranch[];
|
|
22
|
+
};
|
package/src/location-utils.ts
CHANGED
|
@@ -13,34 +13,33 @@ const getCountryCustomsCode = (country: string): string => {
|
|
|
13
13
|
return COUNTRY_TO_CUSTOMS_CODE[country.toUpperCase()] ?? country.toUpperCase();
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
): string | undefined => {
|
|
20
|
-
const regionLines = [address.postalCode, address.city, address.country]
|
|
16
|
+
/** The address as lines: street, second street line, "postcode, city, country"; empty parts left out. */
|
|
17
|
+
export const listAddressLines = (address: LocationValue): string[] => {
|
|
18
|
+
const regionLine = [address.postalCode, address.city, address.country]
|
|
21
19
|
.filter((n) => !!n)
|
|
22
20
|
.join(', ');
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
22
|
+
return [address.addressLine1, address.addressLine2, regionLine].filter((n): n is string => !!n);
|
|
23
|
+
};
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
export const getAddressText = (
|
|
26
|
+
address: LocationValue,
|
|
27
|
+
joinBy: string = '<br>',
|
|
28
|
+
): string | undefined => {
|
|
29
|
+
const lines = listAddressLines(address);
|
|
30
|
+
return lines.length === 0 ? undefined : lines.join(joinBy);
|
|
32
31
|
};
|
|
33
32
|
|
|
33
|
+
/** `listAddressLines` with the country as customs write it. */
|
|
34
|
+
export const listCustomsAddressLines = (address: LocationValue): string[] =>
|
|
35
|
+
listAddressLines({ ...address, country: getCountryCustomsCode(address.country) });
|
|
36
|
+
|
|
34
37
|
export const getCustomsAdressText = (
|
|
35
38
|
address: LocationValue,
|
|
36
39
|
joinBy: string = '<br>',
|
|
37
40
|
): string | undefined => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
country: getCountryCustomsCode(address.country),
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return getAddressText(customsAddress, joinBy);
|
|
41
|
+
const lines = listCustomsAddressLines(address);
|
|
42
|
+
return lines.length === 0 ? undefined : lines.join(joinBy);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
export const getFormatedAddressFromLocationValue = (
|
package/src/tasks.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { MultiLangValue, NextRequest } from './types.js';
|
|
|
3
3
|
|
|
4
4
|
export const TASK_REMINDER_ORIGIN = 'task-reminder';
|
|
5
5
|
export const TASK_UPDATED_ORIGIN = 'task-updated';
|
|
6
|
+
export const TASK_ASSIGNED_ORIGIN = 'task-assigned';
|
|
6
7
|
|
|
7
8
|
export enum TaskPriority {
|
|
8
9
|
Normal = 30,
|
|
@@ -19,6 +20,12 @@ type RecordData = {
|
|
|
19
20
|
businessEntityId: BusinessEntityIds;
|
|
20
21
|
recordId: string;
|
|
21
22
|
recordTitle?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The branch the task belongs to, defaulted from the record it hangs off and editable after.
|
|
25
|
+
* Optional because a record need not have one: an organization is used by several branches, and
|
|
26
|
+
* a task can outlive the record's own branch changing.
|
|
27
|
+
*/
|
|
28
|
+
branchId?: string;
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
type JourneyData =
|
|
@@ -42,12 +49,15 @@ type BaseTask = {
|
|
|
42
49
|
status: TaskStatus;
|
|
43
50
|
title: string;
|
|
44
51
|
autocompleted?: boolean;
|
|
52
|
+
/** When the task was last marked done. Cleared on reopen, so it always matches `status`. */
|
|
53
|
+
completedAt?: string;
|
|
45
54
|
};
|
|
46
55
|
|
|
47
56
|
export type TaskUpdate = Partial<
|
|
48
57
|
Omit<BaseTask, 'assignee' | 'dueDate'> & {
|
|
49
58
|
assignee?: string | null;
|
|
50
59
|
dueDate?: string | null;
|
|
60
|
+
branchId?: string | null;
|
|
51
61
|
}
|
|
52
62
|
>;
|
|
53
63
|
|
|
@@ -88,3 +98,93 @@ export type AssigneeTasksBetweenDatesQuery = {
|
|
|
88
98
|
start: string;
|
|
89
99
|
end: string;
|
|
90
100
|
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Whose tasks a search covers. Anything other than `Mine` needs `TopLevelActions.TasksReadAll`,
|
|
104
|
+
* which is checked server-side — the scope is the permission boundary, not the assignee list.
|
|
105
|
+
*/
|
|
106
|
+
export enum TaskScope {
|
|
107
|
+
Mine = 'mine',
|
|
108
|
+
Unassigned = 'unassigned',
|
|
109
|
+
Users = 'users',
|
|
110
|
+
Everyone = 'everyone',
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** How a task's due date reads relative to today. Drives the list's grouping and the nav badge. */
|
|
114
|
+
export enum TaskDueBucket {
|
|
115
|
+
Overdue = 'overdue',
|
|
116
|
+
Today = 'today',
|
|
117
|
+
Week = 'week',
|
|
118
|
+
Later = 'later',
|
|
119
|
+
Undated = 'undated',
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* `Assignee` keeps each person's tasks contiguous so a list grouped by owner can page without a
|
|
124
|
+
* person's rows being split across two pages. Unassigned tasks sort first under it.
|
|
125
|
+
*/
|
|
126
|
+
export enum TaskSort {
|
|
127
|
+
Priority = 'priority',
|
|
128
|
+
Assignee = 'assignee',
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type TaskSearchQuery = {
|
|
132
|
+
scope?: TaskScope;
|
|
133
|
+
sort?: TaskSort;
|
|
134
|
+
/** Only read when `scope` is `Users`. */
|
|
135
|
+
assignee?: string[];
|
|
136
|
+
/**
|
|
137
|
+
* Widen `TaskScope.Users` to take in the unassigned pool as well — "these people, plus anything
|
|
138
|
+
* nobody has picked up", which is what triage actually looks like. Ignored by other scopes.
|
|
139
|
+
*/
|
|
140
|
+
includeUnassigned?: boolean;
|
|
141
|
+
branchId?: string[];
|
|
142
|
+
businessEntityId?: BusinessEntityIds[];
|
|
143
|
+
/** Narrow to automatic tasks raised by these journey configs. */
|
|
144
|
+
taskConfigId?: string[];
|
|
145
|
+
status?: TaskStatus;
|
|
146
|
+
q?: string;
|
|
147
|
+
dueFrom?: string;
|
|
148
|
+
dueTo?: string;
|
|
149
|
+
overdue?: boolean;
|
|
150
|
+
/** Only tasks with no due date — what the calendar's "N tasks with no due date" link opens. */
|
|
151
|
+
undated?: boolean;
|
|
152
|
+
} & NextRequest;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Counts for the whole result set, not the current page, and each one ignores its own filter — the
|
|
156
|
+
* entity counts are what you would get with the entity filter cleared. That is what lets the filter
|
|
157
|
+
* bar show "Vehicles (4)" next to an unselected option.
|
|
158
|
+
*/
|
|
159
|
+
export type TaskFacets = {
|
|
160
|
+
businessEntityId: Record<string, number>;
|
|
161
|
+
branchId: Record<string, number>;
|
|
162
|
+
status: Record<string, number>;
|
|
163
|
+
/**
|
|
164
|
+
* Who has tasks here, ignoring any assignee selection — which is what lets the picker offer
|
|
165
|
+
* people who are not currently shown. Unassigned tasks are counted under the empty key.
|
|
166
|
+
*/
|
|
167
|
+
assignee: Record<string, number>;
|
|
168
|
+
/**
|
|
169
|
+
* Automatic tasks by the journey config that raises them. Manual tasks are not counted.
|
|
170
|
+
*
|
|
171
|
+
* The key is the config id and nothing else. A task's own title is not a label for the config:
|
|
172
|
+
* `buildTaskTitle` resolves `{{...}}` placeholders per record, so one config can produce as many
|
|
173
|
+
* distinct titles as it has tasks ("BONUS INVOICE - € 1501"). The client translates the id.
|
|
174
|
+
*/
|
|
175
|
+
taskConfigId: Record<string, number>;
|
|
176
|
+
bucket: Record<TaskDueBucket, number>;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export type TaskSearchResult = {
|
|
180
|
+
results: Task[];
|
|
181
|
+
nextToken?: string;
|
|
182
|
+
totalCount: number;
|
|
183
|
+
facets: TaskFacets;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export type TaskCounts = {
|
|
187
|
+
overdue: number;
|
|
188
|
+
dueToday: number;
|
|
189
|
+
open: number;
|
|
190
|
+
};
|