@bisondesk/commons-sdk 1.0.660 → 1.0.662
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 +1 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +1 -0
- package/lib/constants.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 +2 -0
- 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",
|
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,kBAAk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AACxF,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,kCAAkC,8BAA8B,CAAC;AAC9E,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";
|
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;IACzC,qDAAyC,CAAA;IACzC,6DAAiD,CAAA;IACjD,kDAAsC,C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J,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,mCAAuB,CAAA;IACvB,0CAA8B,CAAA;IAC9B,qDAAyC,CAAA;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I;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 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"]}
|
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":"/","sources":["tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzD,eAAO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,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',
|
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
|
+
};
|
package/src/vat.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A VAT number reduced to its comparable form: uppercase, with every separator (dots, spaces,
|
|
3
|
+
* dashes) stripped, so `be0762.732.774` and `BE 0762 732 774` both become `BE0762732774`.
|
|
4
|
+
*
|
|
5
|
+
* We normalise the same way for every country, on the assumption that a VAT number is only ever
|
|
6
|
+
* uppercase letters and digits.
|
|
7
|
+
*/
|
|
8
|
+
export const normalizeVat = (input: string): string =>
|
|
9
|
+
input.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();
|