@bisondesk/core-sdk 1.0.269 → 1.0.271

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.
Files changed (115) hide show
  1. package/lib/cjs/constants.js +3 -2
  2. package/lib/cjs/constants.js.map +1 -1
  3. package/lib/cjs/types/quotes.js.map +1 -1
  4. package/lib/esm/constants.js +1 -0
  5. package/lib/esm/constants.js.map +1 -1
  6. package/lib/esm/types/quotes.js.map +1 -1
  7. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  8. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  9. package/lib/types/constants.d.ts +1 -0
  10. package/lib/types/constants.d.ts.map +1 -1
  11. package/lib/types/types/quotes.d.ts +1 -1
  12. package/lib/types/types/quotes.d.ts.map +1 -1
  13. package/package.json +1 -1
  14. package/src/types/quotes.ts +1 -1
  15. package/lib/apis/crm.js +0 -198
  16. package/lib/apis/crm.js.map +0 -1
  17. package/lib/apis/documents.js +0 -54
  18. package/lib/apis/documents.js.map +0 -1
  19. package/lib/apis/internet-vehicles.js +0 -24
  20. package/lib/apis/internet-vehicles.js.map +0 -1
  21. package/lib/apis/leasing-administration.js +0 -46
  22. package/lib/apis/leasing-administration.js.map +0 -1
  23. package/lib/apis/leasing.js +0 -181
  24. package/lib/apis/leasing.js.map +0 -1
  25. package/lib/apis/opportunities.js +0 -66
  26. package/lib/apis/opportunities.js.map +0 -1
  27. package/lib/apis/picklists.js +0 -41
  28. package/lib/apis/picklists.js.map +0 -1
  29. package/lib/apis/tenants.js +0 -77
  30. package/lib/apis/tenants.js.map +0 -1
  31. package/lib/apis/users.js +0 -23
  32. package/lib/apis/users.js.map +0 -1
  33. package/lib/apis/utils.js +0 -23
  34. package/lib/apis/utils.js.map +0 -1
  35. package/lib/apis/vehicles.js +0 -183
  36. package/lib/apis/vehicles.js.map +0 -1
  37. package/lib/constants.js +0 -932
  38. package/lib/constants.js.map +0 -1
  39. package/lib/ddb-entities.js +0 -5
  40. package/lib/ddb-entities.js.map +0 -1
  41. package/lib/types/activities.js +0 -16
  42. package/lib/types/activities.js.map +0 -1
  43. package/lib/types/crm.js +0 -19
  44. package/lib/types/crm.js.map +0 -1
  45. package/lib/types/definitions.js +0 -3
  46. package/lib/types/definitions.js.map +0 -1
  47. package/lib/types/delivery-settings.js +0 -9
  48. package/lib/types/delivery-settings.js.map +0 -1
  49. package/lib/types/documents.js +0 -3
  50. package/lib/types/documents.js.map +0 -1
  51. package/lib/types/events.js +0 -10
  52. package/lib/types/events.js.map +0 -1
  53. package/lib/types/fields.js +0 -29
  54. package/lib/types/fields.js.map +0 -1
  55. package/lib/types/internet-vehicles.js +0 -3
  56. package/lib/types/internet-vehicles.js.map +0 -1
  57. package/lib/types/leads.js +0 -3
  58. package/lib/types/leads.js.map +0 -1
  59. package/lib/types/leasing-administration.js +0 -3
  60. package/lib/types/leasing-administration.js.map +0 -1
  61. package/lib/types/leasing-debtors.js +0 -3
  62. package/lib/types/leasing-debtors.js.map +0 -1
  63. package/lib/types/leasing-search.js +0 -3
  64. package/lib/types/leasing-search.js.map +0 -1
  65. package/lib/types/leasing-settings.js +0 -10
  66. package/lib/types/leasing-settings.js.map +0 -1
  67. package/lib/types/leasing.js +0 -24
  68. package/lib/types/leasing.js.map +0 -1
  69. package/lib/types/machines.js +0 -3
  70. package/lib/types/machines.js.map +0 -1
  71. package/lib/types/opportunities.js +0 -84
  72. package/lib/types/opportunities.js.map +0 -1
  73. package/lib/types/payments.js +0 -9
  74. package/lib/types/payments.js.map +0 -1
  75. package/lib/types/picklists.js +0 -3
  76. package/lib/types/picklists.js.map +0 -1
  77. package/lib/types/quotes.js +0 -46
  78. package/lib/types/quotes.js.map +0 -1
  79. package/lib/types/recently-viewed.js +0 -3
  80. package/lib/types/recently-viewed.js.map +0 -1
  81. package/lib/types/roi-ratings.js +0 -8
  82. package/lib/types/roi-ratings.js.map +0 -1
  83. package/lib/types/saved-filters.js +0 -12
  84. package/lib/types/saved-filters.js.map +0 -1
  85. package/lib/types/search.js +0 -36
  86. package/lib/types/search.js.map +0 -1
  87. package/lib/types/settings.js +0 -3
  88. package/lib/types/settings.js.map +0 -1
  89. package/lib/types/storage.js +0 -4
  90. package/lib/types/storage.js.map +0 -1
  91. package/lib/types/templates.js +0 -3
  92. package/lib/types/templates.js.map +0 -1
  93. package/lib/types/tenants.js +0 -17
  94. package/lib/types/tenants.js.map +0 -1
  95. package/lib/types/users.js +0 -3
  96. package/lib/types/users.js.map +0 -1
  97. package/lib/types/utils.js +0 -9
  98. package/lib/types/utils.js.map +0 -1
  99. package/lib/types/vehicles.js +0 -68
  100. package/lib/types/vehicles.js.map +0 -1
  101. package/lib/types/website.js +0 -3
  102. package/lib/types/website.js.map +0 -1
  103. package/lib/utils/forms.js +0 -30
  104. package/lib/utils/forms.js.map +0 -1
  105. package/lib/utils/leasing.js +0 -8
  106. package/lib/utils/leasing.js.map +0 -1
  107. package/lib/utils/opportunities.js +0 -60
  108. package/lib/utils/opportunities.js.map +0 -1
  109. package/lib/utils/slug.js +0 -20
  110. package/lib/utils/slug.js.map +0 -1
  111. package/lib/utils/tenants.js +0 -21
  112. package/lib/utils/tenants.js.map +0 -1
  113. package/lib/utils/vehicles.js +0 -72
  114. package/lib/utils/vehicles.js.map +0 -1
  115. package/tsconfig.tsbuildinfo +0 -1
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TransportationMode = exports.SpoilerInfo = exports.DeliveryTypes = exports.QuoteMetricsScore = exports.QuoteStatus = exports.QuoteActions = void 0;
4
- var QuoteActions;
5
- (function (QuoteActions) {
6
- QuoteActions["ACCEPT"] = "accept";
7
- QuoteActions["VALIDATE"] = "validate";
8
- QuoteActions["DONWLOAD_PDFS"] = "download-pdfs";
9
- QuoteActions["CANCEL"] = "cancel";
10
- QuoteActions["COMMERCIAL_REVIEW"] = "commercial-review";
11
- })(QuoteActions = exports.QuoteActions || (exports.QuoteActions = {}));
12
- var QuoteStatus;
13
- (function (QuoteStatus) {
14
- QuoteStatus["CREATED"] = "created";
15
- QuoteStatus["VALIDATED"] = "validated";
16
- QuoteStatus["INVALIDATED"] = "invalidated";
17
- QuoteStatus["ACCEPTED"] = "accepted";
18
- QuoteStatus["REJECTED"] = "rejected";
19
- QuoteStatus["CANCELLED"] = "cancelled";
20
- QuoteStatus["MANAGER_REJECTED"] = "managerRejected";
21
- QuoteStatus["MANAGER_ACCEPTED"] = "managerAccepted";
22
- })(QuoteStatus = exports.QuoteStatus || (exports.QuoteStatus = {}));
23
- var QuoteMetricsScore;
24
- (function (QuoteMetricsScore) {
25
- QuoteMetricsScore["DANGER"] = "danger";
26
- QuoteMetricsScore["NEUTRAL"] = "neutral";
27
- QuoteMetricsScore["GOOD"] = "good";
28
- })(QuoteMetricsScore = exports.QuoteMetricsScore || (exports.QuoteMetricsScore = {}));
29
- var DeliveryTypes;
30
- (function (DeliveryTypes) {
31
- DeliveryTypes["PICK_UP"] = "pickUp";
32
- DeliveryTypes["ADDRESS"] = "address";
33
- DeliveryTypes["PORT"] = "port";
34
- })(DeliveryTypes = exports.DeliveryTypes || (exports.DeliveryTypes = {}));
35
- var SpoilerInfo;
36
- (function (SpoilerInfo) {
37
- SpoilerInfo["MOUNT"] = "mount";
38
- SpoilerInfo["UNMOUNT"] = "unmount";
39
- SpoilerInfo["NO_ACTION"] = "noAction";
40
- })(SpoilerInfo = exports.SpoilerInfo || (exports.SpoilerInfo = {}));
41
- var TransportationMode;
42
- (function (TransportationMode) {
43
- TransportationMode["BY_ROAD"] = "byRoad";
44
- TransportationMode["ON_LOW_BED"] = "onLowBed";
45
- })(TransportationMode = exports.TransportationMode || (exports.TransportationMode = {}));
46
- //# sourceMappingURL=quotes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":";;;AAcA,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,uDAAuC,CAAA;AACzC,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB;AAED,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAStB;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AACD,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,qCAAsB,CAAA;AACxB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,wCAAkB,CAAA;IAClB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAG7B","sourcesContent":["import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants';\nimport { DeliveryParams } from './delivery-settings';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n LeasingQuoteParams,\n SalesQuoteExtraInput,\n} from './leasing-settings';\nimport { MatchingRuleValue } from './roi-ratings';\nimport { PricePercentageMode } from './utils';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n COMMERCIAL_REVIEW = 'commercial-review',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum DeliveryTypes {\n PICK_UP = 'pickUp',\n ADDRESS = 'address',\n PORT = 'port',\n}\n\nexport enum SpoilerInfo {\n MOUNT = 'mount',\n UNMOUNT = 'unmount',\n NO_ACTION = 'noAction',\n}\n\nexport enum TransportationMode {\n BY_ROAD = 'byRoad',\n ON_LOW_BED = 'onLowBed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branch: string;\n branchCountry: string;\n customerCountry: string;\n vehicleCategory: string;\n currency: string;\n bodywork?: string;\n};\n\nexport type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n salesPrice: string;\n purchasePrice: string;\n deliveryPackage?: LeasingQuoteExtraInput;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n vanCourier: boolean;\n leasing: {\n salesPrice: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n interestRate: string;\n purchasePrice: string;\n duration: number;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n };\n taxes: {\n yearlyRoadTax: boolean;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\ntype BaseDeliveryType = {\n agreedPrice: string;\n spoiler?: SpoilerInfo;\n stackingVehicleNeeded?: boolean;\n detailsStacking?: string;\n};\n\nexport type PickUpDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.PICK_UP;\n urgent: boolean;\n transportationMode?: TransportationMode;\n detailsBorderCrossing?: string;\n technicalControlNeeded: boolean;\n insuranceNeeded: boolean;\n transitPlateBelgiumNeeded: boolean;\n transitPlateAustriaNeeded: boolean;\n licensePlateNeeded: boolean;\n dateOfPickUpByCustomer?: string;\n};\n\nexport type AddressDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.ADDRESS;\n address: LocationValue;\n distanceKm: string;\n};\n\nexport type PortDeliverytype = BaseDeliveryType & {\n type: DeliveryTypes.PORT;\n portOriginId: string;\n portDestination?: string;\n shippingCompany?: string;\n portToPortCostPrice: string;\n portToPortMargin: string;\n};\n\nexport type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n vehicle: {\n agreedPrice: string;\n comissionCost: string;\n id: string;\n };\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: {\n vatRate: string;\n agreedPrice: string;\n comissionCost: string;\n id: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type LeasingCalculatorOutput = {\n vatApplicable: boolean;\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDelivery: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmount: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n };\n insurance: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n trackAndTrace: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: { value: string; score: QuoteMetricsScore };\n delivery: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type UsedVehiclesSalesParams = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n countryCode: 'be';\n name: string;\n profitabilityDealGap: string;\n conglomerateProfitabilityDealGap: string;\n exaDocumentCosts: string;\n delivery?: DeliveryParams;\n};\n\nexport type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;\n\nexport type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {\n addressLine1: string;\n city: string;\n};\n\nexport type DeliveryRoutesRequest = {\n origin: DeliveryLocationValue;\n destination: DeliveryLocationValue;\n};\n\nexport type ComissionRequest = {\n branchId: string;\n opportunityId: string;\n vehicleId: string;\n stockNumber: string;\n paidAmount: string;\n estimatedAmount: string;\n currency: string;\n notes?: string;\n paidAt?: string;\n estimatedPaidAt?: string;\n};\n\nexport type Commission = ComissionRequest & {\n modifiedAt: string;\n modifiedBy: string;\n};\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=recently-viewed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recently-viewed.js","sourceRoot":"/","sources":["types/recently-viewed.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue, Requester } from '@bisondesk/commons-sdk/types';\nimport { BusinessEntityIds } from '../constants';\n\nexport type ViewedItemsRequest = {\n businessEntity?: string;\n id?: string;\n};\n\nexport type NewViewedItem = {\n businessEntity: BusinessEntityIds;\n id: string;\n viewedAt: string;\n};\n\nexport type ViewedItemMeta = {\n title: string;\n subtitle: string;\n thumbnail?: AttachmentValue | null; // null signals that it can have a thumbnail, it is just not available\n};\n\nexport type ViewedItem = ViewedItemMeta & {\n viewedAt: string;\n id: string;\n actions: string[];\n};\n\nexport type RawViewedItem = {\n id: string;\n viewedAt: string;\n};\n\nexport type ViewedItemHandler = (\n requester: Requester,\n req: ViewedItemsRequest,\n itemsBusinessEntity: BusinessEntityIds,\n items: RawViewedItem[]\n) => Promise<ViewedItem[]>;\n\nexport type ViewedItemsContextHandlers = {\n [entity in BusinessEntityIds]?: ViewedItemHandler;\n};\n\nexport type ViewedItemsHandlersCollection = {\n [entity in BusinessEntityIds]?: ViewedItemsContextHandlers;\n};\n"]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DisplayType = void 0;
4
- var DisplayType;
5
- (function (DisplayType) {
6
- DisplayType["StarsRating"] = "stars-rating";
7
- })(DisplayType = exports.DisplayType || (exports.DisplayType = {}));
8
- //# sourceMappingURL=roi-ratings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roi-ratings.js","sourceRoot":"/","sources":["types/roi-ratings.ts"],"names":[],"mappings":";;;AAIA,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,2CAA4B,CAAA;AAC9B,CAAC,EAFW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAEtB","sourcesContent":["import { AdditionalOperation, RulesLogic } from 'json-logic-js';\nimport { OpportunityType } from '../constants';\nimport { FieldTypeInfo } from './fields';\n\nexport enum DisplayType {\n StarsRating = 'stars-rating',\n}\n\nexport type ROIRule = {\n conditions: RulesLogic<AdditionalOperation>;\n value: number;\n};\n\nexport type MatchingRuleValue = {\n value: number;\n createdAt: string;\n type: DisplayType;\n ruleIdx: number;\n opportunityType: OpportunityType;\n};\n\ntype BaseROIRatings = {\n type: DisplayType;\n opportunityType: OpportunityType;\n rules: ROIRule[];\n};\n\nexport type ROIRatings = BaseROIRatings & {\n readonly createdAt: string;\n readonly createdBy: string;\n readonly fields: DataFields;\n};\n\nexport type NewROIRatings = BaseROIRatings & {\n readonly createdAt?: undefined;\n readonly createdBy?: undefined;\n readonly fields?: DataFields;\n};\n\nexport type Field = {\n titles: { [lang: string]: string };\n} & FieldTypeInfo;\n\nexport type DataFields = {\n [key: string]: Field;\n};\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SavedFiltersActions = void 0;
4
- var SavedFiltersActions;
5
- (function (SavedFiltersActions) {
6
- SavedFiltersActions["Share"] = "share";
7
- SavedFiltersActions["Update"] = "update";
8
- SavedFiltersActions["Delete"] = "delete";
9
- SavedFiltersActions["SetPersonalDefault"] = "set_own_default";
10
- SavedFiltersActions["SetGlobalDefault"] = "set_global_default";
11
- })(SavedFiltersActions = exports.SavedFiltersActions || (exports.SavedFiltersActions = {}));
12
- //# sourceMappingURL=saved-filters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"saved-filters.js","sourceRoot":"/","sources":["types/saved-filters.ts"],"names":[],"mappings":";;;AAsBA,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,6DAAsC,CAAA;IACtC,8DAAuC,CAAA;AACzC,CAAC,EANW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAM9B","sourcesContent":["import { BusinessEntityIds } from '../constants';\nimport { ComplexFilter } from './search';\n\ntype SavedFilterQuery = {\n conditions: {\n [fieldId: string]: ComplexFilter;\n };\n fullText?: string;\n};\n\nexport type SavedFilter = SavedFilterQuery & {\n id: string;\n businessEntityId: BusinessEntityIds;\n name: string;\n userId: string;\n shared: boolean;\n};\n\nexport type SavedFilterView = SavedFilter & { personalDefault?: boolean; globalDefault?: boolean };\n\nexport type NewSavedFilterRequest = Omit<SavedFilter, 'id' | 'userId'>;\n\nexport enum SavedFiltersActions {\n Share = 'share',\n Update = 'update',\n Delete = 'delete',\n SetPersonalDefault = 'set_own_default',\n SetGlobalDefault = 'set_global_default',\n}\n\nexport type SaveDefaultFilterRequest = {\n filterId: string;\n};\n"]}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AggregationType = exports.SortOrder = exports.FILTER_RANGE_SEPARATOR = exports.ElasticsearchOperator = exports.ConditionType = void 0;
4
- var ConditionType;
5
- (function (ConditionType) {
6
- ConditionType["and"] = "AND";
7
- ConditionType["or"] = "OR";
8
- })(ConditionType = exports.ConditionType || (exports.ConditionType = {}));
9
- var ElasticsearchOperator;
10
- (function (ElasticsearchOperator) {
11
- ElasticsearchOperator["empty"] = "EMPTY";
12
- ElasticsearchOperator["notEmpty"] = "NOT_EMPTY";
13
- ElasticsearchOperator["is"] = "IS";
14
- ElasticsearchOperator["isNot"] = "IS_NOT";
15
- ElasticsearchOperator["greaterThanOrEqual"] = "GTE";
16
- ElasticsearchOperator["greaterThan"] = "GT";
17
- ElasticsearchOperator["lessThanEqual"] = "LTE";
18
- ElasticsearchOperator["lessThan"] = "LT";
19
- ElasticsearchOperator["between"] = "BETWEEN";
20
- ElasticsearchOperator["contains"] = "CONTAINS";
21
- ElasticsearchOperator["notContains"] = "NOT_CONTAINS";
22
- ElasticsearchOperator["startsWith"] = "STARTS_WITH";
23
- ElasticsearchOperator["endsWith"] = "ENDS_WITH";
24
- })(ElasticsearchOperator = exports.ElasticsearchOperator || (exports.ElasticsearchOperator = {}));
25
- exports.FILTER_RANGE_SEPARATOR = '__';
26
- var SortOrder;
27
- (function (SortOrder) {
28
- SortOrder["asc"] = "asc";
29
- SortOrder["desc"] = "desc";
30
- })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
31
- var AggregationType;
32
- (function (AggregationType) {
33
- AggregationType["term"] = "TERM";
34
- AggregationType["range"] = "RANGE";
35
- })(AggregationType = exports.AggregationType || (exports.AggregationType = {}));
36
- //# sourceMappingURL=search.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.js","sourceRoot":"/","sources":["types/search.ts"],"names":[],"mappings":";;;AAOA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,0BAAS,CAAA;AACX,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAE/B,wCAAe,CAAA;IACf,+CAAsB,CAAA;IACtB,kCAAS,CAAA;IACT,yCAAgB,CAAA;IAEhB,mDAA0B,CAAA;IAC1B,2CAAkB,CAAA;IAClB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,4CAAmB,CAAA;IAEnB,8CAAqB,CAAA;IACrB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,+CAAsB,CAAA;AACxB,CAAC,EAjBW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAiBhC;AA8CY,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AAyCD,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B","sourcesContent":["///////////////////////////////////////////////////////\n// Generic stuff\n///////////////////////////////////////////////////////\n\nimport { MultiLangValue } from '@bisondesk/commons-sdk/types';\nimport { FieldTypes, NumberMeta } from './fields';\n\nexport enum ConditionType {\n and = 'AND',\n or = 'OR',\n}\n\nexport enum ElasticsearchOperator {\n // all properties\n empty = 'EMPTY',\n notEmpty = 'NOT_EMPTY',\n is = 'IS',\n isNot = 'IS_NOT',\n // number, date properties\n greaterThanOrEqual = 'GTE',\n greaterThan = 'GT',\n lessThanEqual = 'LTE',\n lessThan = 'LT',\n between = 'BETWEEN',\n // string properties\n contains = 'CONTAINS',\n notContains = 'NOT_CONTAINS',\n startsWith = 'STARTS_WITH',\n endsWith = 'ENDS_WITH',\n}\n\nexport type Filter<OP = ElasticsearchOperator> = {\n data: string;\n fieldId: string;\n operator: OP;\n};\n\nexport type ComplexFilter<OP = ElasticsearchOperator> = {\n condition: ConditionType;\n filters: Array<Filter<OP> | ComplexFilter<OP>>;\n};\n\nexport type SearchResponse<T = any> = {\n took: number;\n timed_out: boolean;\n _scroll_id?: string;\n _shards: unknown;\n hits: {\n total: {\n value: number;\n relation: 'eq' | 'gte';\n };\n max_score: number;\n hits: Array<{\n _index: string;\n _type: string;\n _id: string;\n _score: number;\n _source?: T;\n _version?: number;\n _explanation?: unknown;\n fields?: any;\n highlight?: any;\n inner_hits?: any;\n matched_queries?: string[];\n sort?: Array<string | number>;\n }>;\n };\n aggregations?: { [aggName: string]: object };\n};\n\n///////////////////////////////////////////////////////\n// Search\n///////////////////////////////////////////////////////\n\nexport const FILTER_RANGE_SEPARATOR = '__';\n\nexport enum SortOrder {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport type SortFilter = {\n fieldId: string;\n order: SortOrder;\n};\n\nexport type SearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n} & (\n | {\n infinite?: false;\n offset?: number;\n }\n | {\n infinite: true;\n nextToken?: string;\n }\n);\n\nexport type PublicSearchRequest = {\n limit: number;\n offset?: number;\n query?: ComplexFilter;\n sortBy?: SortFilter[];\n};\n\n///////////////////////////////////////////////////////\n// Aggregations\n///////////////////////////////////////////////////////\n\nexport type AggFilterOperator =\n | ElasticsearchOperator.is\n | ElasticsearchOperator.greaterThan\n | ElasticsearchOperator.lessThan\n | ElasticsearchOperator.greaterThanOrEqual\n | ElasticsearchOperator.lessThanEqual;\n\nexport enum AggregationType {\n term = 'TERM',\n range = 'RANGE',\n}\n\nexport type TermAggregation = {\n titles: MultiLangValue;\n fieldId: string;\n type: AggregationType.term;\n\n orderBy?: 'count' | 'field';\n} & (\n | {\n fieldType: FieldTypes.picklist;\n picklistId: string;\n }\n | {\n fieldType: FieldTypes.number;\n meta?: NumberMeta;\n }\n | {\n fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;\n }\n);\n\nexport type Range =\n | {\n start: number;\n end?: number;\n }\n | {\n start?: number;\n end: number;\n }\n | {\n start: number;\n end: number;\n };\n\nexport type RangeAggregation = {\n titles: MultiLangValue;\n fieldId: string;\n type: AggregationType.range;\n step: number;\n ranges: Range[];\n format?: NumberMeta;\n};\n\nexport type Aggregation = TermAggregation | RangeAggregation;\n\nexport type AggregationRequest = {\n fullText?: string;\n filters: ComplexFilter<AggFilterOperator>[];\n};\n\nexport type AggregationResult = {\n value: string;\n count: number;\n from?: number;\n to?: number;\n};\n\nexport type AggregationResultSet = {\n [field: string]: AggregationResult[];\n};\n\nexport type AggregationResponse<M = {}> = {\n results: AggregationResultSet;\n meta: M;\n};\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=settings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"/","sources":["types/settings.ts"],"names":[],"mappings":"","sourcesContent":["export type WebsiteSettings = {\n contacts: {\n destinations: string[];\n };\n leasing?: {\n interestRate: number;\n initialValues: {\n residual: number;\n deposit: number;\n periods: number;\n };\n maxPeriods: number;\n };\n gatsbyCloud?: {\n webhook: string;\n };\n};\n\nexport type HyperportalSettings = {\n hcTenantId: string;\n crm: {\n active: boolean;\n };\n vehicles: {\n active: boolean;\n ignoreBeforeDate?: string; // do not modify vehicles created before this date;\n };\n leasing: {\n active: boolean;\n contractTransferDefinitionId: string;\n contractDealDefinitionId: string;\n contractOwner: { [countryCode: string]: string };\n };\n sales: {\n active: boolean;\n isaProcessDefinitionId: string;\n };\n};\n\nexport type HyperportalMachinesSettings = {\n hcTenantId: string;\n active: boolean;\n};\n\nexport type LeasingCreditorBranch = {\n bciNumber: string;\n vatNumber: string;\n licenceDate: string;\n becrisFirstReportDate: string;\n becrisStartDate: string;\n};\n\nexport type LeasingCreditorSettings = {\n [branchId: string]: LeasingCreditorBranch;\n};\n"]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- __exportStar(require("@bisondesk/commons-sdk/storage"), exports);
4
- //# sourceMappingURL=storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"/","sources":["types/storage.ts"],"names":[],"mappings":";;AAAA,iEAA+C","sourcesContent":["export * from '@bisondesk/commons-sdk/storage';\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=templates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["export type TemplateContent = {\n subject: string;\n content: {\n html: string;\n design: any;\n };\n};\n\nexport type NewTemplateRequest = {\n id?: string;\n country: string;\n tags?: any;\n name: string;\n} & TemplateContent;\n\nexport type Template = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n tags?: any;\n\n country: string;\n name: string;\n} & TemplateContent;\n\nexport type TemplateInfo = {\n id: string;\n countries: string[];\n modifiedAt: string;\n name: string;\n tags?: any;\n};\n\nexport type UpdateTemplateInfoRequest = {\n name: string;\n tags?: any;\n};\n"]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TenantModule = void 0;
4
- var TenantModule;
5
- (function (TenantModule) {
6
- TenantModule["App"] = "app";
7
- TenantModule["CRM"] = "crm";
8
- TenantModule["Docs"] = "docs";
9
- TenantModule["Leads"] = "leads";
10
- TenantModule["Leasing"] = "leasing";
11
- TenantModule["Market"] = "market";
12
- TenantModule["Opportunities"] = "opportunities";
13
- TenantModule["VehiclesMasterData"] = "vehicles_master_data";
14
- TenantModule["Vehicles"] = "vehicles";
15
- TenantModule["TrackAndTrace"] = "track_and_trace";
16
- })(TenantModule = exports.TenantModule || (exports.TenantModule = {}));
17
- //# sourceMappingURL=tenants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":";;;AAgBA,IAAY,YAWX;AAXD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,+CAA+B,CAAA;IAC/B,2DAA2C,CAAA;IAC3C,qCAAqB,CAAA;IACrB,iDAAiC,CAAA;AACnC,CAAC,EAXW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAWvB","sourcesContent":["import { LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants';\n\nexport type PublicTenant = {\n defaultCountry: string;\n defaultCurrency: string;\n defaultLanguage: string;\n id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team\n name: string;\n region: Region;\n subdomain: string;\n\n // Pay attention to what information is added here since\n // the tenant can be obtained without authentication\n};\n\nexport enum TenantModule {\n App = 'app',\n CRM = 'crm',\n Docs = 'docs',\n Leads = 'leads',\n Leasing = 'leasing',\n Market = 'market',\n Opportunities = 'opportunities',\n VehiclesMasterData = 'vehicles_master_data',\n Vehicles = 'vehicles',\n TrackAndTrace = 'track_and_trace',\n}\n\nexport type Tenant = PublicTenant & {\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n exactAccounting?: boolean;\n trackAndTrace?: boolean;\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n opportunities: {\n types: OpportunityType[];\n };\n};\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n exactAccounting?: boolean;\n currency: string;\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n};\n\nexport type HdmsVehiclesSync = {\n active: boolean;\n};\n\nexport type HdmsCrmSync = {\n active: boolean;\n};\n\nexport type TenantSyncSettings = {\n tenantId: string;\n hdmsVehicles: HdmsVehiclesSync | undefined;\n hdmsCrm: HdmsCrmSync | undefined;\n};\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=users.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"users.js","sourceRoot":"/","sources":["types/users.ts"],"names":[],"mappings":"","sourcesContent":["import { AppRoles, TopLevelActions } from '@bisondesk/commons-sdk/constants';\nimport {\n AttachmentValue,\n PhoneNumberRawValue,\n PhoneNumberValue,\n} from '@bisondesk/commons-sdk/types';\n\nexport type NewUserRequest = {\n email: string;\n firstName: string;\n language: string;\n lastName: string;\n phone: PhoneNumberRawValue;\n picture?: AttachmentValue;\n roles: AppRoles[];\n};\n\nexport type ValidNewUserRequest = Omit<NewUserRequest, 'phone'> & {\n phone: PhoneNumberValue;\n};\n\nexport type UpdateUserRequest = Omit<User, 'phone'> & {\n phone: PhoneNumberRawValue | PhoneNumberValue;\n};\n\nexport type User = {\n active: boolean;\n createdAt: string;\n email: string;\n firstName: string;\n id: string;\n language: string;\n lastName: string;\n phone: PhoneNumberValue;\n picture?: AttachmentValue;\n roles: AppRoles[];\n roleActions: TopLevelActions[];\n updatedAt: string;\n};\n\n// Short version of the User entity, with only the properties\n// that should be available to any app user.\nexport type UserSummary = {\n firstName: string;\n id: string;\n lastName: string;\n picture?: AttachmentValue;\n};\n"]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PricePercentageMode = void 0;
4
- var PricePercentageMode;
5
- (function (PricePercentageMode) {
6
- PricePercentageMode["CURRENCY"] = "currency";
7
- PricePercentageMode["PERCENTAGE"] = "percentage";
8
- })(PricePercentageMode = exports.PricePercentageMode || (exports.PricePercentageMode = {}));
9
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"/","sources":["types/utils.ts"],"names":[],"mappings":";;;AAgDA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;AAC3B,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B","sourcesContent":["import { MultiLangValue } from '@bisondesk/commons-sdk/types';\nimport { AdHocPicklistValueDisplay } from './picklists';\n\nexport type CountryInfo = {\n code: string; // code is ISO 3166-1 alpha-2\n name: string;\n labels: {\n city: string;\n state: string;\n postalCode?: string;\n };\n required: {\n city: boolean;\n state: boolean;\n postalCode: boolean;\n };\n dialCode: number;\n currencyCode: string;\n states?: {\n [code: string]: string; // code is ISO 3166-2\n };\n postalCodeFormat?: string;\n postalCodeEx?: string;\n};\n\nexport type Country = {\n code: string;\n name: string;\n dialCode: number;\n};\n\nexport type ReferenceData = {\n recordTitles: AdHocRecordTitles;\n picklistTitles: AdHocPicklistValueDisplay;\n};\n\nexport type AdHocRecordTitles = {\n [businessEntityId: string]: {\n [recordId: string]: string | MultiLangValue;\n };\n};\n\nexport type DataRecord<T, M = undefined> = {\n record: T;\n meta?: M; // typically ReferenceData\n actions: string[];\n};\n\nexport enum PricePercentageMode {\n CURRENCY = 'currency',\n PERCENTAGE = 'percentage',\n}\n"]}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PurchaseActions = exports.VehicleActions = exports.VehiclePurchaseDeliveryType = exports.VehiclePurchaseLogisticsStatus = exports.VehicleSaleLogisticsStatus = exports.VehiclePurchaseDealStatus = exports.VehicleSaleDealStatus = exports.CustomSearchState = void 0;
4
- var CustomSearchState;
5
- (function (CustomSearchState) {
6
- CustomSearchState["Available"] = "available";
7
- CustomSearchState["Expected"] = "expected";
8
- CustomSearchState["Reserved"] = "reserved";
9
- })(CustomSearchState = exports.CustomSearchState || (exports.CustomSearchState = {}));
10
- var VehicleSaleDealStatus;
11
- (function (VehicleSaleDealStatus) {
12
- VehicleSaleDealStatus["SaleAgreed"] = "SALE_AGREED";
13
- VehicleSaleDealStatus["FirstPaymentReceived"] = "FIRST_PAYMENT_RECEIVED";
14
- VehicleSaleDealStatus["FullPaymentReceived"] = "FULL_PAYMENT_RECEIVED";
15
- VehicleSaleDealStatus["NotSold"] = "NOT_SOLD";
16
- })(VehicleSaleDealStatus = exports.VehicleSaleDealStatus || (exports.VehicleSaleDealStatus = {}));
17
- var VehiclePurchaseDealStatus;
18
- (function (VehiclePurchaseDealStatus) {
19
- VehiclePurchaseDealStatus["PurchaseEvaluation"] = "PURCHASE_EVALUATION";
20
- VehiclePurchaseDealStatus["PurchaseAgreed"] = "PURCHASE_AGREED";
21
- VehiclePurchaseDealStatus["FirstPaymentAllowed"] = "FIRST_PAYMENT_ALLOWED";
22
- VehiclePurchaseDealStatus["FirstPaymentSent"] = "FIRST_PAYMENT_SENT";
23
- VehiclePurchaseDealStatus["FullPaymentAllowed"] = "FULL_PAYMENT_ALLOWED";
24
- VehiclePurchaseDealStatus["FullPaymentSent"] = "FULL_PAYMENT_SENT";
25
- })(VehiclePurchaseDealStatus = exports.VehiclePurchaseDealStatus || (exports.VehiclePurchaseDealStatus = {}));
26
- var VehicleSaleLogisticsStatus;
27
- (function (VehicleSaleLogisticsStatus) {
28
- VehicleSaleLogisticsStatus["AtOrigin"] = "AT_ORIGIN";
29
- VehicleSaleLogisticsStatus["Delivered"] = "DELIVERED";
30
- })(VehicleSaleLogisticsStatus = exports.VehicleSaleLogisticsStatus || (exports.VehicleSaleLogisticsStatus = {}));
31
- var VehiclePurchaseLogisticsStatus;
32
- (function (VehiclePurchaseLogisticsStatus) {
33
- VehiclePurchaseLogisticsStatus["AtOrigin"] = "AT_ORIGIN";
34
- VehiclePurchaseLogisticsStatus["Arrived"] = "ARRIVED";
35
- VehiclePurchaseLogisticsStatus["CheckedIn"] = "CHECKED_IN";
36
- })(VehiclePurchaseLogisticsStatus = exports.VehiclePurchaseLogisticsStatus || (exports.VehiclePurchaseLogisticsStatus = {}));
37
- var VehiclePurchaseDeliveryType;
38
- (function (VehiclePurchaseDeliveryType) {
39
- VehiclePurchaseDeliveryType["PickUp"] = "PICK_UP";
40
- VehiclePurchaseDeliveryType["DropOff"] = "DROP_OFF";
41
- })(VehiclePurchaseDeliveryType = exports.VehiclePurchaseDeliveryType || (exports.VehiclePurchaseDeliveryType = {}));
42
- var VehicleActions;
43
- (function (VehicleActions) {
44
- VehicleActions["EditAdminDocs"] = "edit_admin_docs";
45
- VehicleActions["EditEngineeringDocs"] = "edit_engineering_docs";
46
- VehicleActions["EditMarketing"] = "edit_marketing";
47
- VehicleActions["EditMedia"] = "edit_media";
48
- VehicleActions["EditPictures"] = "edit_pictures";
49
- VehicleActions["EditPrices"] = "edit_prices";
50
- VehicleActions["EditPurchaseDeal"] = "edit_purchase_deal";
51
- VehicleActions["EditPurchaseLogistics"] = "edit_purchase_logistics";
52
- VehicleActions["EditSpecs"] = "edit_specs";
53
- VehicleActions["EditVideos"] = "edit_videos";
54
- VehicleActions["ViewLeads"] = "view_leads";
55
- VehicleActions["ViewSimilarOnline"] = "view_similar_online";
56
- VehicleActions["ViewPurchase"] = "view_purchase";
57
- })(VehicleActions = exports.VehicleActions || (exports.VehicleActions = {}));
58
- var PurchaseActions;
59
- (function (PurchaseActions) {
60
- PurchaseActions["ViewDeal"] = "view_deal";
61
- PurchaseActions["ViewSupplierOrganization"] = "view_supplier_organization";
62
- PurchaseActions["ViewContact"] = "view_contact";
63
- PurchaseActions["ViewLegalAddress"] = "view_legal_address";
64
- PurchaseActions["ViewPickupAddress"] = "view_pickup_address";
65
- PurchaseActions["ViewEstimatedCosts"] = "view_estimated_costs";
66
- PurchaseActions["ViewFinanceDocuments"] = "view_finance_documents";
67
- })(PurchaseActions = exports.PurchaseActions || (exports.PurchaseActions = {}));
68
- //# sourceMappingURL=vehicles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vehicles.js","sourceRoot":"/","sources":["types/vehicles.ts"],"names":[],"mappings":";;;AA2JA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,4CAAuB,CAAA;IACvB,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;AACvB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B;AA6RD,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,mDAA0B,CAAA;IAC1B,wEAA+C,CAAA;IAC/C,sEAA6C,CAAA;IAC7C,6CAAoB,CAAA;AACtB,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC;AAED,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,uEAA0C,CAAA;IAC1C,+DAAkC,CAAA;IAClC,0EAA6C,CAAA;IAC7C,oEAAuC,CAAA;IACvC,wEAA2C,CAAA;IAC3C,kEAAqC,CAAA;AACvC,CAAC,EAPW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAOpC;AAED,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,oDAAsB,CAAA;IACtB,qDAAuB,CAAA;AACzB,CAAC,EAHW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAGrC;AAED,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACxC,wDAAsB,CAAA;IACtB,qDAAmB,CAAA;IACnB,0DAAwB,CAAA;AAC1B,CAAC,EAJW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAIzC;AAED,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,iDAAkB,CAAA;IAClB,mDAAoB,CAAA;AACtB,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC;AA6GD,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB,mDAAiC,CAAA;IACjC,+DAA6C,CAAA;IAC7C,kDAAgC,CAAA;IAChC,0CAAwB,CAAA;IACxB,gDAA8B,CAAA;IAC9B,4CAA0B,CAAA;IAC1B,yDAAuC,CAAA;IACvC,mEAAiD,CAAA;IACjD,0CAAwB,CAAA;IACxB,4CAA0B,CAAA;IAC1B,0CAAwB,CAAA;IACxB,2DAAyC,CAAA;IACzC,gDAA8B,CAAA;AAChC,CAAC,EAdW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAczB;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,yCAAsB,CAAA;IACtB,0EAAuD,CAAA;IACvD,+CAA4B,CAAA;IAC5B,0DAAuC,CAAA;IACvC,4DAAyC,CAAA;IACzC,8DAA2C,CAAA;IAC3C,kEAA+C,CAAA;AACjD,CAAC,EARW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAQ1B","sourcesContent":["import { EmailDestination } from '@bisondesk/commons-sdk/messages';\nimport {\n AttachmentValue,\n Document,\n LocationValue,\n MultiLangValue,\n SearchPermissions,\n} from '@bisondesk/commons-sdk/types';\n\ntype BaseVehicleEvent = {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\ntype VehicleSuperstructure = {\n carCapacity?: number;\n compartmentCount?: number;\n counter?: boolean;\n crane?: {\n make?: string;\n model?: string;\n position?: 'Behind the cabin' | 'Rear';\n present?: boolean;\n year?: number;\n };\n dimensions?: {\n height?: number;\n length?: number;\n width?: number;\n extended?: string; // L1, L2, ...\n heightened?: string; // H1, H2, ...\n };\n baseVehicle?: SuperstructureBaseVehicle;\n extendable?: boolean;\n highPressurePump?: boolean;\n loadingPlatformHeight?: number;\n pump?: boolean;\n slidingRoof?: boolean;\n tailgate?: {\n capacity?: number;\n make?: string;\n model?: string;\n present?: boolean;\n type?: 'slider_lift' | 'cantilever' | 'column_lift';\n };\n tank?: {\n capacity: number;\n };\n temperatureControl?: {\n engineType?: 'diesel' | 'electric' | 'diesel+electric' | 'engine';\n make?: string;\n runningHours?: {\n diesel?: number;\n electric?: number;\n };\n };\n tipper?: {\n tipsBack?: boolean;\n tipsLeft?: boolean;\n tipsRight?: boolean;\n };\n};\nexport type NewVehicleRequest = {\n branch: string;\n count: number;\n specs: VehicleExternalInfo;\n description: {\n remarks?: string;\n technicalRemarks?: string;\n };\n logistics: {\n vehicleRole: VehicleInternalInfo['role'];\n parking: string;\n deliveryType: VehiclePurchaseDeliveryType;\n availableDate: string;\n pickupAddress?: LocationValue;\n };\n prices: {\n minimum?: string;\n premium?: string;\n internet?: string;\n };\n media: {\n internalPictures: AttachmentValue[];\n pictures: AttachmentValue[];\n videos: AttachmentValue[];\n docs: Document[];\n engineeringDocs: Document[];\n };\n vinList?: string;\n deal: {\n stockNumber?: string;\n contactId: string;\n orgId: string;\n purchasedBy: string;\n dealStatus:\n | VehiclePurchaseDealStatus.PurchaseEvaluation\n | VehiclePurchaseDealStatus.PurchaseAgreed;\n costs: {\n purchase: string;\n purchaseVatPercentage: string;\n commission?: string;\n externalTransport?: string;\n internalTransport?: string;\n externalGarage?: string;\n internalGarage?: string;\n other?: string;\n };\n };\n};\n\nexport type VehicleCreateEvent = BaseVehicleEvent & {\n action: 'create';\n vehicle: Vehicle;\n previousVehicle?: undefined;\n};\n\nexport type VehicleUpdateEvent = BaseVehicleEvent & {\n action: 'update';\n vehicle: Vehicle;\n previousVehicle: Vehicle;\n};\n\nexport type VehicleDeleteEvent = BaseVehicleEvent & {\n action: 'delete';\n vehicle?: undefined;\n previousVehicle: Vehicle;\n};\n\nexport type VehicleEvent = VehicleCreateEvent | VehicleUpdateEvent | VehicleDeleteEvent;\n\nexport type VehicleMarketingEvent = {\n actionAt: string;\n data: VehicleMarketing;\n tenantId: string;\n userId: string;\n vehicleId: string;\n};\n\nexport type UpdateVehiclesPricesEvent = {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n priceList: AttachmentValue;\n};\n\nexport type PublicVehicle = Pick<Vehicle, 'external' | 'id'>;\n\nexport type PublicSearchVehicle = {\n vehicle: PublicVehicle;\n};\n\nexport enum CustomSearchState {\n Available = 'available',\n Expected = 'expected',\n Reserved = 'reserved',\n}\n\nexport type SearchVehicle = {\n custom: {\n features: string[];\n state: CustomSearchState[];\n };\n purchase?: {\n supplierStockNumber?: string;\n };\n vehicle: Vehicle;\n};\n\nexport type InputSearchVehicle = SearchVehicle & {\n permissions: SearchPermissions;\n};\n\nexport type VehicleInternalInfo = {\n createdAt: string;\n description: {\n title: string;\n remarks?: string;\n technicalRemarks?: string;\n };\n parkingName?: string;\n identification: {\n administrativeNumber?: string;\n stockNumber: string;\n branch: string;\n\n /**\n * This ID is used to link different vehicle objects that represent the same real world asset.\n * Ideally the chassis number could be used, but in some cases it is not available yet.\n */\n metaId: string;\n };\n documents: Document[];\n pictures: AttachmentValue[];\n engineeringDocs: Document[];\n pricing: {\n premium?: string;\n minimum?: string;\n currency?: string;\n };\n role: 'SALE' | 'OWN_USE' | 'RENTAL' | 'BUILD' | 'UNKNOWN';\n status: VehicleStatus;\n updatedAt: string;\n /* use this property to store additional terms that you want the vehicle to be found with when doing a full text search */\n keywords?: string[];\n};\n\nexport type VehicleOriginalInfo = {\n tenantId: string;\n identification: {\n id: string;\n stockNumber: string;\n hyperdmsTenantId?: string;\n metaId?: string;\n };\n salesConditions: {\n leasing?: boolean;\n expected?: boolean;\n reserved?: boolean;\n price?: string;\n currency?: string;\n };\n};\n\nexport type VehicleAxlesInfo = {\n details: VehicleAxle[];\n configuration?: string;\n count?: number;\n poweredAxlesCount?: number;\n wheelbase?: number;\n suspension?: 'Air' | 'Air/Steel' | 'Steel';\n};\n\nexport type SuperstructureBaseVehicle = {\n category: string;\n make: string;\n model?: string;\n type?: string;\n axlesConfiguration?: string;\n emissionsClass?: string;\n transmissionType?: 'Automatic' | 'Manual' | 'Semi-Automatic';\n vin?: string;\n currentRegistration?: {\n country?: string;\n };\n suspension?: 'Air' | 'Air/Steel' | 'Steel';\n constructionYear?: number;\n firstRegistration?: string;\n odometerKm?: number;\n powerHp?: number;\n bodystyle?: string;\n accessories: VehicleExternalInfo['accessories'];\n superstructure?: Pick<VehicleSuperstructure, 'crane' | 'tailgate'>;\n};\n\n// mostly inspired by the Hexon data model\nexport type VehicleExternalInfo = {\n body?: {\n cabin?: {\n type: 'Day' | 'Sleep / Small' | 'Sleep / Medium' | 'Sleep / Large';\n model?: string;\n };\n colour?: string;\n dimensions?: {\n height?: number;\n length?: number;\n width?: number;\n };\n doorCount?: number;\n interior?: {\n bedCount?: number;\n seatCount?: number;\n };\n };\n mainPicture?: AttachmentValue;\n pictures?: AttachmentValue[];\n videos?: AttachmentValue[];\n condition?: {\n damaged?: boolean;\n odometer?: {\n km?: number;\n };\n used?: boolean;\n };\n general: {\n bodystyle?: string;\n category: string;\n make?: string;\n model?: string;\n modelName?: string;\n type?: string;\n typeName?: string;\n };\n history?: {\n advertisingYear?: number;\n constructionYear?: number;\n currentRegistration?: {\n country?: string;\n technicalInspectionEndDate?: string;\n };\n firstRegistration?: string;\n cocPvg?: string;\n };\n identification: {\n licensePlate?: string;\n stockNumber?: string;\n vin?: string;\n buildStockNumber?: string;\n };\n powertrain?: {\n axles?: VehicleAxlesInfo;\n emissions?: {\n class?: string;\n };\n engine?: {\n cylinderCount?: number;\n energy?: string;\n power?: {\n hp?: number;\n };\n displacement?: number;\n };\n transmission?: {\n gearCount?: number;\n make?: string;\n model?: string;\n type?: 'Automatic' | 'Manual' | 'Semi-Automatic';\n };\n };\n salesConditions: {\n leasing?: boolean;\n expected?: boolean;\n reserved?: boolean;\n price?: string | undefined;\n currency?: string | undefined;\n };\n superstructure?: VehicleSuperstructure;\n weights?: {\n gvw?: number;\n massEmpty?: number;\n };\n accessories: {\n abs?: boolean;\n adr?: boolean;\n airco?: boolean;\n alloyWheels?: boolean;\n aluminiumFuelTank?: boolean;\n cdPlayer?: boolean;\n centralLocking?: boolean;\n centralLubrication?: boolean;\n cruiseControl?: boolean;\n electricDoorMirrors?: boolean;\n electricWindows?: boolean;\n engineBrake?: boolean;\n forklift?: boolean;\n navigationSystem?: boolean;\n hydraulicTipperKit?: boolean;\n lowDeck?: boolean;\n lowNoise?: boolean;\n parkingHeater?: boolean;\n particleFilter?: boolean;\n powerTakeOff?: boolean;\n refrigerator?: boolean;\n retarderIntarder?: boolean;\n reversingCamera?: boolean;\n roofSpoiler?: boolean;\n sideSkirts?: boolean;\n spareKey?: boolean;\n spareWheel?: boolean;\n speedLimiter?: boolean;\n spoilers?: boolean;\n spotlights?: boolean;\n stabilityControl?: boolean;\n standardAirco?: boolean;\n television?: boolean;\n toolbox?: boolean;\n trailerCoupling?: boolean;\n twinFuelTank?: boolean;\n visor?: boolean;\n xenonLights?: boolean;\n };\n};\n\ntype BaseVehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = {\n internal: I;\n external: E;\n original?: VehicleOriginalInfo;\n};\n\nexport type NewVehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = BaseVehicle<I, E> & {\n id?: undefined;\n};\n\nexport type Vehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = BaseVehicle<I, E> & {\n id: string;\n};\n\nexport type VehiclesByChassisNumberRequest = {\n tenantIds: string[];\n chassisNumber: string;\n};\n\nexport type VehiclesByMetaIdRequest = {\n tenantIds: string[];\n metaId: string;\n};\n\nexport type VehicleAxle = {\n make?: string;\n alloyWheels?: boolean;\n brakes?: 'Disc' | 'Drum';\n differentialLock?: boolean;\n liftAxle?: boolean;\n maxLoad?: number;\n nr: number;\n position?: string;\n powered?: boolean;\n reduction?: string;\n steering?: boolean;\n suspension?: 'Steel' | 'Air' | 'Hydraulic';\n twinWheels?: boolean;\n tyreConditionPercLeftInside?: number;\n tyreConditionPercLeftOutside?: number;\n tyreConditionPercRightInside?: number;\n tyreConditionPercRightOutside?: number;\n tyreSize?: string;\n};\n\nexport type VehicleMarketing = {\n titles: MultiLangValue;\n remarks?: MultiLangValue;\n marketingPlatforms: string[];\n videos: AttachmentValue[];\n overrides?: {\n marketingPlatforms?: boolean;\n remarks?: boolean;\n titles?: boolean;\n videos?: boolean;\n };\n};\n\nexport enum VehicleSaleDealStatus {\n SaleAgreed = 'SALE_AGREED',\n FirstPaymentReceived = 'FIRST_PAYMENT_RECEIVED',\n FullPaymentReceived = 'FULL_PAYMENT_RECEIVED',\n NotSold = 'NOT_SOLD',\n}\n\nexport enum VehiclePurchaseDealStatus {\n PurchaseEvaluation = 'PURCHASE_EVALUATION', // used for vehicle consignation\n PurchaseAgreed = 'PURCHASE_AGREED',\n FirstPaymentAllowed = 'FIRST_PAYMENT_ALLOWED',\n FirstPaymentSent = 'FIRST_PAYMENT_SENT',\n FullPaymentAllowed = 'FULL_PAYMENT_ALLOWED',\n FullPaymentSent = 'FULL_PAYMENT_SENT',\n}\n\nexport enum VehicleSaleLogisticsStatus {\n AtOrigin = 'AT_ORIGIN',\n Delivered = 'DELIVERED',\n}\n\nexport enum VehiclePurchaseLogisticsStatus {\n AtOrigin = 'AT_ORIGIN',\n Arrived = 'ARRIVED',\n CheckedIn = 'CHECKED_IN',\n}\n\nexport enum VehiclePurchaseDeliveryType {\n PickUp = 'PICK_UP',\n DropOff = 'DROP_OFF',\n}\n\nexport type VehicleStatus = {\n deleted?: boolean;\n option?: {\n id: string;\n expirationDate: number;\n };\n sale: {\n id?: string;\n dealStatus: VehicleSaleDealStatus;\n logisticsStatus?: VehicleSaleLogisticsStatus;\n };\n purchase: {\n purchasedBy?: string;\n dealStatus: VehiclePurchaseDealStatus;\n logisticsStatus: VehiclePurchaseLogisticsStatus;\n };\n};\n\nexport type VehiclePriceList = {\n uploadedAt: string;\n uploadedBy: string;\n priceList: AttachmentValue;\n id: string;\n};\n\nexport type UpdateVehiclesPricesRequest = {\n priceList: AttachmentValue;\n};\n\nexport type VehiclePriceListLine = {\n reference: string;\n internet?: string;\n premium?: string;\n minimum?: string;\n};\n\nexport type VehiclePriceUpdateError = {\n data: VehiclePriceListLine;\n line: number;\n error: {\n fieldId: keyof VehiclePriceListLine;\n msg: string;\n };\n};\n\nexport type VehiclePriceUpdateResponse =\n | {\n success: true;\n }\n | {\n success: false;\n errors: VehiclePriceUpdateError[];\n };\n\nexport type VehiclePurchase = {\n organizationId: string;\n contactId: string;\n supplierStockNumber?: string;\n purchasedBy: string;\n\n log: {\n evaluationStartedAt?: string;\n evaluationStartedBy?: string;\n\n purchaseAgreedAt?: string;\n purchaseAgreedBy?: string;\n\n firstPaymentAllowedAt?: string;\n firstPaymentAllowedBy?: string;\n firstPaymentSentAt?: string;\n firstPaymentSentBy?: string;\n\n fullPaymentAllowedAt?: string;\n fullPaymentAllowedBy?: string;\n fullPaymentSentAt?: string;\n fullPaymentSentBy?: string;\n\n arrivedAt?: string;\n arrivedBy?: string;\n checkedInAt?: string;\n checkedInBy?: string;\n };\n\n deal: {\n status: VehiclePurchaseDealStatus;\n\n askingPrice?: string;\n purchaseVatRate?: string;\n purchase?: string; // exclusive VAT\n\n commission?: string;\n externalTransport?: string;\n internalTransport?: string;\n externalGarage?: string;\n internalGarage?: string;\n other?: string;\n };\n\n logistics: {\n parkingName?: string;\n status: VehiclePurchaseLogisticsStatus;\n deliveryType?: VehiclePurchaseDeliveryType;\n pickupAddress?: LocationValue;\n availableWeek?: string; // ISOWEEK, e.g. 2016-W02\n };\n};\n\nexport enum VehicleActions {\n EditAdminDocs = 'edit_admin_docs',\n EditEngineeringDocs = 'edit_engineering_docs',\n EditMarketing = 'edit_marketing',\n EditMedia = 'edit_media',\n EditPictures = 'edit_pictures',\n EditPrices = 'edit_prices',\n EditPurchaseDeal = 'edit_purchase_deal',\n EditPurchaseLogistics = 'edit_purchase_logistics',\n EditSpecs = 'edit_specs',\n EditVideos = 'edit_videos',\n ViewLeads = 'view_leads',\n ViewSimilarOnline = 'view_similar_online',\n ViewPurchase = 'view_purchase',\n}\n\nexport enum PurchaseActions {\n ViewDeal = 'view_deal',\n ViewSupplierOrganization = 'view_supplier_organization',\n ViewContact = 'view_contact',\n ViewLegalAddress = 'view_legal_address',\n ViewPickupAddress = 'view_pickup_address',\n ViewEstimatedCosts = 'view_estimated_costs',\n ViewFinanceDocuments = 'view_finance_documents',\n}\n\nexport type VehicleShareEmailRequest = {\n country: string; // Lowercase ISO 3166-1 alpha-2 code, e.g. 'be'\n to: EmailDestination[];\n message: string;\n subject: string;\n pictures: AttachmentValue[];\n attachments?: AttachmentValue[];\n};\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=website.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"website.js","sourceRoot":"/","sources":["types/website.ts"],"names":[],"mappings":"","sourcesContent":["import { PhoneNumberRawValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types';\n\nexport type ContactFormRequest = {\n email: string;\n name: string;\n message: string;\n phone: PhoneNumberRawValue;\n};\n\nexport type ValidContactFormRequest = Omit<ContactFormRequest, 'phone'> & {\n phone: PhoneNumberValue;\n};\n\nexport type ContactFormEvent = {\n tenantId: string;\n payload: ValidContactFormRequest;\n};\n\nexport type LeasingSimulationRequest = {\n deposit: number;\n residual: number;\n durationInMonths: number;\n vehicleId: string;\n};\n\nexport type LeasingSimulationResponse = {\n monthly: string;\n};\n"]}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.computePricePercentage = void 0;
4
- const decimal_js_1 = __importDefault(require("decimal.js"));
5
- const utils_1 = require("../types/utils");
6
- const computePricePercentage = (totalAmount, percentage, partialAmount = '0', mode = utils_1.PricePercentageMode.PERCENTAGE) => {
7
- const output = {
8
- percentageAmount: percentage,
9
- currencyAmount: partialAmount,
10
- };
11
- if (mode === utils_1.PricePercentageMode.PERCENTAGE) {
12
- output.currencyAmount = new decimal_js_1.default(totalAmount)
13
- .mul(percentage)
14
- .div(100)
15
- .toDecimalPlaces(2)
16
- .clamp(0, totalAmount)
17
- .toString();
18
- }
19
- else {
20
- output.percentageAmount = new decimal_js_1.default(partialAmount)
21
- .mul(100)
22
- .div(totalAmount)
23
- .toDecimalPlaces(4)
24
- .clamp(0, 100)
25
- .toString();
26
- }
27
- return output;
28
- };
29
- exports.computePricePercentage = computePricePercentage;
30
- //# sourceMappingURL=forms.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forms.js","sourceRoot":"/","sources":["utils/forms.ts"],"names":[],"mappings":";;;AAAA,4DAAiC;AACjC,0CAAqD;AAE9C,MAAM,sBAAsB,GAAG,CACpC,WAAmB,EACnB,UAAkB,EAClB,gBAAwB,GAAG,EAC3B,OAA4B,2BAAmB,CAAC,UAAU,EACJ,EAAE;IACxD,MAAM,MAAM,GAAyD;QACnE,gBAAgB,EAAE,UAAU;QAC5B,cAAc,EAAE,aAAa;KAC9B,CAAC;IAEF,IAAI,IAAI,KAAK,2BAAmB,CAAC,UAAU,EAAE;QAC3C,MAAM,CAAC,cAAc,GAAG,IAAI,oBAAO,CAAC,WAAW,CAAC;aAC7C,GAAG,CAAC,UAAU,CAAC;aACf,GAAG,CAAC,GAAG,CAAC;aACR,eAAe,CAAC,CAAC,CAAC;aAClB,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC;aACrB,QAAQ,EAAE,CAAC;KACf;SAAM;QACL,MAAM,CAAC,gBAAgB,GAAG,IAAI,oBAAO,CAAC,aAAa,CAAC;aACjD,GAAG,CAAC,GAAG,CAAC;aACR,GAAG,CAAC,WAAW,CAAC;aAChB,eAAe,CAAC,CAAC,CAAC;aAClB,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;aACb,QAAQ,EAAE,CAAC;KACf;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA5BW,QAAA,sBAAsB,0BA4BjC","sourcesContent":["import Decimal from 'decimal.js';\nimport { PricePercentageMode } from '../types/utils';\n\nexport const computePricePercentage = (\n totalAmount: string,\n percentage: string,\n partialAmount: string = '0',\n mode: PricePercentageMode = PricePercentageMode.PERCENTAGE\n): { percentageAmount: string; currencyAmount: string } => {\n const output: { percentageAmount: string; currencyAmount: string } = {\n percentageAmount: percentage,\n currencyAmount: partialAmount,\n };\n\n if (mode === PricePercentageMode.PERCENTAGE) {\n output.currencyAmount = new Decimal(totalAmount)\n .mul(percentage)\n .div(100)\n .toDecimalPlaces(2)\n .clamp(0, totalAmount)\n .toString();\n } else {\n output.percentageAmount = new Decimal(partialAmount)\n .mul(100)\n .div(totalAmount)\n .toDecimalPlaces(4)\n .clamp(0, 100)\n .toString();\n }\n\n return output;\n};\n"]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sortContractClients = void 0;
4
- const dayjs_utils_1 = require("@bisondesk/commons-sdk/dayjs-utils");
5
- const lodash_1 = require("lodash");
6
- const sortContractClients = (clients) => (0, lodash_1.sortBy)((0, lodash_1.map)((0, lodash_1.uniqBy)(clients, (c) => c.takeoverId), (c) => ({ ...c, since: (0, dayjs_utils_1.utc)(c.since).format('YYYY-MM-DD') })), (cli) => cli.since, (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0));
7
- exports.sortContractClients = sortContractClients;
8
- //# sourceMappingURL=leasing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"leasing.js","sourceRoot":"/","sources":["utils/leasing.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AACzD,mCAA6C;AAItC,MAAM,mBAAmB,GAAG,CAAC,OAAgC,EAA2B,EAAE,CAC/F,IAAA,eAAM,EACJ,IAAA,YAAG,EACD,IAAA,eAAM,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EACpC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,IAAA,iBAAG,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAC5D,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAClB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAChF,CAAC;AARS,QAAA,mBAAmB,uBAQ5B","sourcesContent":["import { utc } from '@bisondesk/commons-sdk/dayjs-utils';\nimport { map, sortBy, uniqBy } from 'lodash';\nimport { LeasingContractClient } from '../types/leasing';\n\n/* sort from oldest to most recent client */\nexport const sortContractClients = (clients: LeasingContractClient[]): LeasingContractClient[] =>\n sortBy(\n map(\n uniqBy(clients, (c) => c.takeoverId),\n (c) => ({ ...c, since: utc(c.since).format('YYYY-MM-DD') }) // doing a map to also fix legacy data\n ),\n (cli) => cli.since,\n (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0)\n );\n"]}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isOpportunityReserved = exports.getOpportunityReservedStatus = exports.isOpportunityLost = exports.isBeforeReferenceOpportunityStatus = exports.isSameOrBeforeReferenceOpportunityStatus = exports.isAfterReferenceOpportunityStatus = exports.isSameOrAfterReferenceOpportunityStatus = exports.getNextStatus = exports.getPreviousStatus = void 0;
4
- const opportunities_1 = require("../types/opportunities");
5
- const compareOpportunityStatus = (input) => {
6
- const { currentStatus, referenceStatus } = input;
7
- const currentStatusIdx = opportunities_1.OpportunityStatusOrder.indexOf(currentStatus);
8
- const referenceStatusIdx = opportunities_1.OpportunityStatusOrder.indexOf(referenceStatus);
9
- return {
10
- currentStatusIdx,
11
- referenceStatusIdx,
12
- };
13
- };
14
- const getPreviousStatus = (currentStatus) => {
15
- const currentIndex = opportunities_1.OpportunityStatusOrder.indexOf(currentStatus);
16
- if (currentIndex === 0) {
17
- return;
18
- }
19
- return opportunities_1.OpportunityStatusOrder[currentIndex - 1];
20
- };
21
- exports.getPreviousStatus = getPreviousStatus;
22
- const getNextStatus = (currentStatus) => {
23
- const statusIndex = opportunities_1.OpportunityStatusOrder.indexOf(currentStatus);
24
- if (statusIndex >= opportunities_1.OpportunityStatusOrder.length - 1) {
25
- return;
26
- }
27
- return opportunities_1.OpportunityStatusOrder[statusIndex + 1];
28
- };
29
- exports.getNextStatus = getNextStatus;
30
- const isSameOrAfterReferenceOpportunityStatus = (input) => {
31
- const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
32
- return currentStatusIdx >= referenceStatusIdx;
33
- };
34
- exports.isSameOrAfterReferenceOpportunityStatus = isSameOrAfterReferenceOpportunityStatus;
35
- const isAfterReferenceOpportunityStatus = (input) => {
36
- const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
37
- return currentStatusIdx > referenceStatusIdx;
38
- };
39
- exports.isAfterReferenceOpportunityStatus = isAfterReferenceOpportunityStatus;
40
- const isSameOrBeforeReferenceOpportunityStatus = (input) => {
41
- const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
42
- return currentStatusIdx <= referenceStatusIdx;
43
- };
44
- exports.isSameOrBeforeReferenceOpportunityStatus = isSameOrBeforeReferenceOpportunityStatus;
45
- const isBeforeReferenceOpportunityStatus = (input) => {
46
- const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);
47
- return currentStatusIdx < referenceStatusIdx;
48
- };
49
- exports.isBeforeReferenceOpportunityStatus = isBeforeReferenceOpportunityStatus;
50
- const isOpportunityLost = (input) => input.lostAt != null;
51
- exports.isOpportunityLost = isOpportunityLost;
52
- const getOpportunityReservedStatus = () => [
53
- opportunities_1.OpportunityStatus.REVIEW,
54
- opportunities_1.OpportunityStatus.PREPARATION,
55
- opportunities_1.OpportunityStatus.DELIVERY,
56
- ];
57
- exports.getOpportunityReservedStatus = getOpportunityReservedStatus;
58
- const isOpportunityReserved = (input) => (0, exports.getOpportunityReservedStatus)().includes(input.status);
59
- exports.isOpportunityReserved = isOpportunityReserved;
60
- //# sourceMappingURL=opportunities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"opportunities.js","sourceRoot":"/","sources":["utils/opportunities.ts"],"names":[],"mappings":";;;AAAA,0DAAgG;AAOhG,MAAM,wBAAwB,GAAG,CAAC,KAAmB,EAAE,EAAE;IACvD,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAEjD,MAAM,gBAAgB,GAAG,sCAAsB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,sCAAsB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAE3E,OAAO;QACL,gBAAgB;QAChB,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAC/B,aAAgC,EACD,EAAE;IACjC,MAAM,YAAY,GAAG,sCAAsB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACnE,IAAI,YAAY,KAAK,CAAC,EAAE;QACtB,OAAO;KACR;IACD,OAAO,sCAAsB,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B;AAEK,MAAM,aAAa,GAAG,CAAC,aAAgC,EAAiC,EAAE;IAC/F,MAAM,WAAW,GAAG,sCAAsB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAClE,IAAI,WAAW,IAAI,sCAAsB,CAAC,MAAM,GAAG,CAAC,EAAE;QACpD,OAAO;KACR;IACD,OAAO,sCAAsB,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB;AAEK,MAAM,uCAAuC,GAAG,CAAC,KAAmB,EAAW,EAAE;IACtF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,IAAI,kBAAkB,CAAC;AAChD,CAAC,CAAC;AAJW,QAAA,uCAAuC,2CAIlD;AAEK,MAAM,iCAAiC,GAAG,CAAC,KAAmB,EAAW,EAAE;IAChF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,GAAG,kBAAkB,CAAC;AAC/C,CAAC,CAAC;AAJW,QAAA,iCAAiC,qCAI5C;AAEK,MAAM,wCAAwC,GAAG,CAAC,KAAmB,EAAW,EAAE;IACvF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,IAAI,kBAAkB,CAAC;AAChD,CAAC,CAAC;AAJW,QAAA,wCAAwC,4CAInD;AAEK,MAAM,kCAAkC,GAAG,CAAC,KAAmB,EAAW,EAAE;IACjF,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEjF,OAAO,gBAAgB,GAAG,kBAAkB,CAAC;AAC/C,CAAC,CAAC;AAJW,QAAA,kCAAkC,sCAI7C;AAEK,MAAM,iBAAiB,GAAG,CAAC,KAAkB,EAAW,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;AAA1E,QAAA,iBAAiB,qBAAyD;AAEhF,MAAM,4BAA4B,GAAG,GAAwB,EAAE,CAAC;IACrE,iCAAiB,CAAC,MAAM;IACxB,iCAAiB,CAAC,WAAW;IAC7B,iCAAiB,CAAC,QAAQ;CAC3B,CAAC;AAJW,QAAA,4BAA4B,gCAIvC;AAEK,MAAM,qBAAqB,GAAG,CAAC,KAAkB,EAAW,EAAE,CACnE,IAAA,oCAA4B,GAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAD3C,QAAA,qBAAqB,yBACsB","sourcesContent":["import { Opportunity, OpportunityStatus, OpportunityStatusOrder } from '../types/opportunities';\n\ntype CompareInput = {\n currentStatus: OpportunityStatus;\n referenceStatus: OpportunityStatus;\n};\n\nconst compareOpportunityStatus = (input: CompareInput) => {\n const { currentStatus, referenceStatus } = input;\n\n const currentStatusIdx = OpportunityStatusOrder.indexOf(currentStatus);\n const referenceStatusIdx = OpportunityStatusOrder.indexOf(referenceStatus);\n\n return {\n currentStatusIdx,\n referenceStatusIdx,\n };\n};\n\nexport const getPreviousStatus = (\n currentStatus: OpportunityStatus\n): OpportunityStatus | undefined => {\n const currentIndex = OpportunityStatusOrder.indexOf(currentStatus);\n if (currentIndex === 0) {\n return;\n }\n return OpportunityStatusOrder[currentIndex - 1];\n};\n\nexport const getNextStatus = (currentStatus: OpportunityStatus): OpportunityStatus | undefined => {\n const statusIndex = OpportunityStatusOrder.indexOf(currentStatus);\n if (statusIndex >= OpportunityStatusOrder.length - 1) {\n return;\n }\n return OpportunityStatusOrder[statusIndex + 1];\n};\n\nexport const isSameOrAfterReferenceOpportunityStatus = (input: CompareInput): boolean => {\n const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);\n\n return currentStatusIdx >= referenceStatusIdx;\n};\n\nexport const isAfterReferenceOpportunityStatus = (input: CompareInput): boolean => {\n const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);\n\n return currentStatusIdx > referenceStatusIdx;\n};\n\nexport const isSameOrBeforeReferenceOpportunityStatus = (input: CompareInput): boolean => {\n const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);\n\n return currentStatusIdx <= referenceStatusIdx;\n};\n\nexport const isBeforeReferenceOpportunityStatus = (input: CompareInput): boolean => {\n const { currentStatusIdx, referenceStatusIdx } = compareOpportunityStatus(input);\n\n return currentStatusIdx < referenceStatusIdx;\n};\n\nexport const isOpportunityLost = (input: Opportunity): boolean => input.lostAt != null;\n\nexport const getOpportunityReservedStatus = (): OpportunityStatus[] => [\n OpportunityStatus.REVIEW,\n OpportunityStatus.PREPARATION,\n OpportunityStatus.DELIVERY,\n];\n\nexport const isOpportunityReserved = (input: Opportunity): boolean =>\n getOpportunityReservedStatus().includes(input.status);\n"]}
package/lib/utils/slug.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVehicleSlug = void 0;
4
- const slugify_1 = __importDefault(require("slugify"));
5
- const getVehicleSlug = (vehicle) => {
6
- return (0, slugify_1.default)([
7
- vehicle.external.identification.stockNumber ?? vehicle.internal.identification.stockNumber,
8
- vehicle.external.general.make,
9
- vehicle.external.general.modelName,
10
- vehicle.external.general.typeName,
11
- `${vehicle.external.history?.advertisingYear}`,
12
- vehicle.external.general.category,
13
- vehicle.external.general.bodystyle,
14
- vehicle.external.powertrain?.axles?.configuration,
15
- ]
16
- .filter((f) => !!f)
17
- .join(' '));
18
- };
19
- exports.getVehicleSlug = getVehicleSlug;
20
- //# sourceMappingURL=slug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slug.js","sourceRoot":"/","sources":["utils/slug.ts"],"names":[],"mappings":";;;AAAA,sDAA8B;AAGvB,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAU,EAAE;IACzD,OAAO,IAAA,iBAAO,EACZ;QACE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW;QAC1F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;QAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS;QAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;QACjC,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE;QAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;QACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS;QAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,aAAa;KAClD;SACE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAClB,IAAI,CAAC,GAAG,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB","sourcesContent":["import slugify from 'slugify';\nimport { Vehicle } from '../types/vehicles';\n\nexport const getVehicleSlug = (vehicle: Vehicle): string => {\n return slugify(\n [\n vehicle.external.identification.stockNumber ?? vehicle.internal.identification.stockNumber,\n vehicle.external.general.make,\n vehicle.external.general.modelName,\n vehicle.external.general.typeName,\n `${vehicle.external.history?.advertisingYear}`,\n vehicle.external.general.category,\n vehicle.external.general.bodystyle,\n vehicle.external.powertrain?.axles?.configuration,\n ]\n .filter((f) => !!f)\n .join(' ')\n );\n};\n"]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBranchStandardVatRate = exports.getDefaultBranch = exports.getBranch = void 0;
4
- const errors_1 = require("@bisondesk/commons-sdk/errors");
5
- const lodash_1 = require("lodash");
6
- const getBranch = (tenant, branchId) => {
7
- const branch = tenant.branches.find((branch) => branch.id === branchId);
8
- if (branch == null) {
9
- throw new errors_1.XError('tenants.branch-not-found', { tenantId: tenant.id, branchId });
10
- }
11
- return branch;
12
- };
13
- exports.getBranch = getBranch;
14
- const getDefaultBranch = (tenant) => (0, lodash_1.first)(tenant.branches);
15
- exports.getDefaultBranch = getDefaultBranch;
16
- const getBranchStandardVatRate = (tenant, branchId) => {
17
- const branch = (0, exports.getBranch)(tenant, branchId);
18
- return branch.vatRates.standard;
19
- };
20
- exports.getBranchStandardVatRate = getBranchStandardVatRate;
21
- //# sourceMappingURL=tenants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["utils/tenants.ts"],"names":[],"mappings":";;;AAAA,0DAAuD;AACvD,mCAA+B;AAGxB,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACpE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAChF,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,MAAM,IAAI,eAAM,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;KACjF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAPW,QAAA,SAAS,aAOpB;AAEK,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,IAAA,cAAK,EAAC,MAAM,CAAC,QAAQ,CAAE,CAAC;AAAvE,QAAA,gBAAgB,oBAAuD;AAE7E,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACnF,MAAM,MAAM,GAAW,IAAA,iBAAS,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAClC,CAAC,CAAC;AAHW,QAAA,wBAAwB,4BAGnC","sourcesContent":["import { XError } from '@bisondesk/commons-sdk/errors';\nimport { first } from 'lodash';\nimport { Branch, Tenant } from '../types/tenants';\n\nexport const getBranch = (tenant: Tenant, branchId: string): Branch => {\n const branch = tenant.branches.find((branch: Branch) => branch.id === branchId);\n if (branch == null) {\n throw new XError('tenants.branch-not-found', { tenantId: tenant.id, branchId });\n }\n\n return branch;\n};\n\nexport const getDefaultBranch = (tenant: Tenant): Branch => first(tenant.branches)!;\n\nexport const getBranchStandardVatRate = (tenant: Tenant, branchId: string): string => {\n const branch: Branch = getBranch(tenant, branchId);\n return branch.vatRates.standard;\n};\n"]}