@bisondesk/core-sdk 1.0.263 → 1.0.264

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 (136) hide show
  1. package/lib/apis/crm.js +198 -0
  2. package/lib/apis/crm.js.map +1 -0
  3. package/lib/apis/documents.js +54 -0
  4. package/lib/apis/documents.js.map +1 -0
  5. package/lib/apis/internet-vehicles.js +24 -0
  6. package/lib/apis/internet-vehicles.js.map +1 -0
  7. package/lib/apis/leasing-administration.js +46 -0
  8. package/lib/apis/leasing-administration.js.map +1 -0
  9. package/lib/apis/leasing.js +181 -0
  10. package/lib/apis/leasing.js.map +1 -0
  11. package/lib/apis/opportunities.js +66 -0
  12. package/lib/apis/opportunities.js.map +1 -0
  13. package/lib/apis/picklists.js +41 -0
  14. package/lib/apis/picklists.js.map +1 -0
  15. package/lib/apis/tenants.js +77 -0
  16. package/lib/apis/tenants.js.map +1 -0
  17. package/lib/apis/users.js +23 -0
  18. package/lib/apis/users.js.map +1 -0
  19. package/lib/apis/utils.js +23 -0
  20. package/lib/apis/utils.js.map +1 -0
  21. package/lib/apis/vehicles.js +183 -0
  22. package/lib/apis/vehicles.js.map +1 -0
  23. package/lib/cjs/apis/vehicles.js +12 -1
  24. package/lib/cjs/apis/vehicles.js.map +1 -1
  25. package/lib/cjs/types/opportunities.js.map +1 -1
  26. package/lib/cjs/types/quotes.js.map +1 -1
  27. package/lib/cjs/types/roi-ratings.js +8 -0
  28. package/lib/cjs/types/roi-ratings.js.map +1 -0
  29. package/lib/cjs/types/vehicles.js +1 -0
  30. package/lib/cjs/types/vehicles.js.map +1 -1
  31. package/lib/constants.js +932 -0
  32. package/lib/constants.js.map +1 -0
  33. package/lib/ddb-entities.js +5 -0
  34. package/lib/ddb-entities.js.map +1 -0
  35. package/lib/esm/apis/vehicles.js +10 -0
  36. package/lib/esm/apis/vehicles.js.map +1 -1
  37. package/lib/esm/types/opportunities.js.map +1 -1
  38. package/lib/esm/types/quotes.js.map +1 -1
  39. package/lib/esm/types/roi-ratings.js +5 -0
  40. package/lib/esm/types/roi-ratings.js.map +1 -0
  41. package/lib/esm/types/vehicles.js +1 -0
  42. package/lib/esm/types/vehicles.js.map +1 -1
  43. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  44. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  45. package/lib/types/activities.js +16 -0
  46. package/lib/types/activities.js.map +1 -0
  47. package/lib/types/apis/vehicles.d.ts +1 -0
  48. package/lib/types/apis/vehicles.d.ts.map +1 -1
  49. package/lib/types/crm.js +19 -0
  50. package/lib/types/crm.js.map +1 -0
  51. package/lib/types/definitions.js +3 -0
  52. package/lib/types/definitions.js.map +1 -0
  53. package/lib/types/delivery-settings.js +9 -0
  54. package/lib/types/delivery-settings.js.map +1 -0
  55. package/lib/types/documents.js +3 -0
  56. package/lib/types/documents.js.map +1 -0
  57. package/lib/types/events.js +10 -0
  58. package/lib/types/events.js.map +1 -0
  59. package/lib/types/fields.js +29 -0
  60. package/lib/types/fields.js.map +1 -0
  61. package/lib/types/internet-vehicles.js +3 -0
  62. package/lib/types/internet-vehicles.js.map +1 -0
  63. package/lib/types/leads.js +3 -0
  64. package/lib/types/leads.js.map +1 -0
  65. package/lib/types/leasing-administration.js +3 -0
  66. package/lib/types/leasing-administration.js.map +1 -0
  67. package/lib/types/leasing-debtors.js +3 -0
  68. package/lib/types/leasing-debtors.js.map +1 -0
  69. package/lib/types/leasing-search.js +3 -0
  70. package/lib/types/leasing-search.js.map +1 -0
  71. package/lib/types/leasing-settings.js +10 -0
  72. package/lib/types/leasing-settings.js.map +1 -0
  73. package/lib/types/leasing.js +24 -0
  74. package/lib/types/leasing.js.map +1 -0
  75. package/lib/types/machines.js +3 -0
  76. package/lib/types/machines.js.map +1 -0
  77. package/lib/types/opportunities.js +84 -0
  78. package/lib/types/opportunities.js.map +1 -0
  79. package/lib/types/payments.js +9 -0
  80. package/lib/types/payments.js.map +1 -0
  81. package/lib/types/picklists.js +3 -0
  82. package/lib/types/picklists.js.map +1 -0
  83. package/lib/types/quotes.js +46 -0
  84. package/lib/types/quotes.js.map +1 -0
  85. package/lib/types/recently-viewed.js +3 -0
  86. package/lib/types/recently-viewed.js.map +1 -0
  87. package/lib/types/roi-ratings.js +8 -0
  88. package/lib/types/roi-ratings.js.map +1 -0
  89. package/lib/types/saved-filters.js +12 -0
  90. package/lib/types/saved-filters.js.map +1 -0
  91. package/lib/types/search.js +36 -0
  92. package/lib/types/search.js.map +1 -0
  93. package/lib/types/settings.js +3 -0
  94. package/lib/types/settings.js.map +1 -0
  95. package/lib/types/storage.js +4 -0
  96. package/lib/types/storage.js.map +1 -0
  97. package/lib/types/templates.js +3 -0
  98. package/lib/types/templates.js.map +1 -0
  99. package/lib/types/tenants.js +16 -0
  100. package/lib/types/tenants.js.map +1 -0
  101. package/lib/types/types/opportunities.d.ts +0 -1
  102. package/lib/types/types/opportunities.d.ts.map +1 -1
  103. package/lib/types/types/quotes.d.ts +7 -2
  104. package/lib/types/types/quotes.d.ts.map +1 -1
  105. package/lib/types/types/roi-ratings.d.ts +42 -0
  106. package/lib/types/types/roi-ratings.d.ts.map +1 -0
  107. package/lib/types/types/vehicles.d.ts +1 -0
  108. package/lib/types/types/vehicles.d.ts.map +1 -1
  109. package/lib/types/users.js +3 -0
  110. package/lib/types/users.js.map +1 -0
  111. package/lib/types/utils.js +9 -0
  112. package/lib/types/utils.js.map +1 -0
  113. package/lib/types/vehicles.js +69 -0
  114. package/lib/types/vehicles.js.map +1 -0
  115. package/lib/types/website.js +3 -0
  116. package/lib/types/website.js.map +1 -0
  117. package/lib/utils/forms.js +30 -0
  118. package/lib/utils/forms.js.map +1 -0
  119. package/lib/utils/leasing.js +8 -0
  120. package/lib/utils/leasing.js.map +1 -0
  121. package/lib/utils/opportunities.js +60 -0
  122. package/lib/utils/opportunities.js.map +1 -0
  123. package/lib/utils/slug.js +20 -0
  124. package/lib/utils/slug.js.map +1 -0
  125. package/lib/utils/tenants.js +21 -0
  126. package/lib/utils/tenants.js.map +1 -0
  127. package/lib/utils/vehicles.js +72 -0
  128. package/lib/utils/vehicles.js.map +1 -0
  129. package/package.json +1 -1
  130. package/src/apis/vehicles.ts +14 -0
  131. package/src/types/opportunities.ts +0 -1
  132. package/src/types/quotes.ts +11 -3
  133. package/src/types/roi-ratings.ts +46 -0
  134. package/src/types/vehicles.ts +1 -0
  135. package/tsconfig.json +1 -0
  136. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-settings.js","sourceRoot":"/","sources":["types/delivery-settings.ts"],"names":[],"mappings":";;;AAGA,IAAkB,qBAGjB;AAHD,WAAkB,qBAAqB;IACrC,kCAAS,CAAA;IACT,kCAAS,CAAA;AACX,CAAC,EAHiB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGtC","sourcesContent":["import { LocationValue } from '@bisondesk/commons-sdk/types';\nimport { Categories } from '../constants';\n\nexport const enum TransitPlateCountries {\n BE = 'be',\n AT = 'at',\n}\n\ntype BaseDeliveryPort = {\n name: string;\n address: LocationValue;\n};\n\nexport type NewDeliveryPort = BaseDeliveryPort & {\n id: undefined;\n};\n\nexport type DeliveryPort = BaseDeliveryPort & {\n id: string;\n};\n\ntype BaseTransportationToPort = {\n portId: string;\n branchId: string;\n retailPrice: string;\n costPrice: string;\n};\n\nexport type NewTransportationToPort = BaseTransportationToPort & {\n id?: undefined;\n};\n\nexport type TransportationToPort = BaseTransportationToPort & {\n id: string;\n};\n\nexport type CurrencyInput = {\n currency: string;\n conversionRate: string;\n};\n\nexport type DeliveryParams = {\n id: string;\n modifiedAt: string;\n port: {\n supplementDestinationPortCosts: string;\n cleaningCosts: string;\n looseTrailerCosts: string;\n portToPortMargin: string;\n };\n address: {\n priceKmCost: string;\n priceKmRetail: string;\n };\n services: {\n spoilerMountCost: string;\n spoilerMountRetailPrice: string;\n spoilerUnmountCost: string;\n spoilerUnmountRetailPrice: string;\n stackingVehicleCost: string;\n stackingVehicleRetailPrice: string;\n technicalControl: {\n [vehicleCategory in Categories]?: { cost: string; retailPrice: string };\n };\n transitPlate: {\n [country in TransitPlateCountries]?: { cost: string; retailPrice: string };\n };\n };\n};\n\nexport type DeliverySettings = {\n transportationToPort: TransportationToPort;\n originPort: DeliveryPort;\n destinationPort?: DeliveryPort;\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents.js","sourceRoot":"/","sources":["types/documents.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue, SearchPermissions } from '@bisondesk/commons-sdk/types';\nimport { Organization } from './crm';\nimport { PublicSearchDefinition } from './definitions';\n\nexport type FinanceLine = {\n associations: {\n others: { vehicleId: string; label: string }[];\n sales: { id: string; vehicleId: string; label: string }[];\n purchases: { id: string; vehicleId: string; label: string }[];\n };\n description: string;\n id: string;\n lineCode: string;\n quantity: string;\n unitPriceExclusive: string;\n vatCode: string;\n vatCoefficient: string;\n};\n\nexport type FinanceDocument = {\n id: string;\n branchId: string;\n\n type: 'Sale Finance' | 'Purchase Finance';\n subtype: 'Invoice' | 'Credit Note' | 'Proforma' | 'Purchase Order';\n reference: string;\n\n attachment: AttachmentValue;\n lines: FinanceLine[];\n notes?: string;\n\n createdAt: string;\n createdBy: string;\n issueDate: string;\n\n organizationSummary?: {\n id: string;\n code: string;\n name: string;\n country: string;\n vatNumber?: string;\n\n addressLine1?: string;\n addressLine2?: string;\n addressLine3?: string;\n postcode?: string;\n city?: string;\n\n email?: string;\n phone?: string;\n fax?: string;\n };\n};\n\nexport type FinanceDocumentEvent = {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n type: 'Sale Finance' | 'Purchase Finance';\n subtype: string; // Invoice, Credit Note, etc.\n};\n\nexport type FinanceBookingEvent = {\n id: string;\n branchId: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n type: 'Sale Finance' | 'Purchase Finance';\n};\n\nexport type FinanceBooking = {\n branchId: string; // same tenantId can have different companies\n bookingNumber: string; // same booking number can and will exist across different \"branches\"\n documentId: string;\n\n booked: true;\n journal?: string;\n amount?: string;\n reportingPeriod?: number;\n reportingYear?: number;\n paid: boolean;\n\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n};\n\nexport type SearchDocumentVehicleRef = {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n};\n\nexport type SearchFinanceDocument = {\n org?: Organization;\n doc: FinanceDocument;\n booking?: FinanceBooking;\n vehicle?: SearchDocumentVehicleRef[];\n};\n\nexport type InputSearchFinanceDocument = SearchFinanceDocument & {\n permissions: SearchPermissions;\n};\n\nexport type DocsSearchDefinitions = {\n searchFinanceDoc: PublicSearchDefinition;\n};\n"]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordAction = void 0;
4
+ var RecordAction;
5
+ (function (RecordAction) {
6
+ RecordAction["Create"] = "content.records.create";
7
+ RecordAction["Update"] = "content.records.update";
8
+ RecordAction["Delete"] = "content.records.delete";
9
+ })(RecordAction = exports.RecordAction || (exports.RecordAction = {}));
10
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"/","sources":["types/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAKX;AALD,WAAY,YAAY;IAEtB,iDAAiC,CAAA;IACjC,iDAAiC,CAAA;IACjC,iDAAiC,CAAA;AACnC,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["export enum RecordAction {\n // if you rename this, you also need to adjust the SNS subscription filters\n Create = 'content.records.create',\n Update = 'content.records.update',\n Delete = 'content.records.delete',\n}\n\nexport type ActionMessage = {\n id: string;\n action: RecordAction;\n actionAt: string;\n userId: string;\n tenantId: string;\n businessEntityId: string;\n recordId: string;\n fieldIds?: string[];\n};\n"]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateGranularity = exports.FieldTypes = void 0;
4
+ var FieldTypes;
5
+ (function (FieldTypes) {
6
+ FieldTypes["attachment"] = "attachment";
7
+ FieldTypes["checkbox"] = "checkbox";
8
+ FieldTypes["collaborator"] = "collaborator";
9
+ FieldTypes["date"] = "date";
10
+ FieldTypes["email"] = "email";
11
+ FieldTypes["image"] = "image";
12
+ FieldTypes["link"] = "link";
13
+ FieldTypes["location"] = "location";
14
+ FieldTypes["multilang"] = "multilang";
15
+ FieldTypes["multiline"] = "multiline";
16
+ FieldTypes["number"] = "number";
17
+ FieldTypes["phoneNumber"] = "phoneNumber";
18
+ FieldTypes["picklist"] = "picklist";
19
+ FieldTypes["rating"] = "rating";
20
+ FieldTypes["text"] = "text";
21
+ })(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));
22
+ var DateGranularity;
23
+ (function (DateGranularity) {
24
+ DateGranularity["year"] = "year";
25
+ DateGranularity["yearMonth"] = "yearMonth";
26
+ DateGranularity["yearMonthDay"] = "yearMonthDay";
27
+ DateGranularity["yearMonthDayTime"] = "yearMonthDayTime";
28
+ })(DateGranularity = exports.DateGranularity || (exports.DateGranularity = {}));
29
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"/","sources":["types/fields.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAgBX;AAhBD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2CAA6B,CAAA;IAC7B,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACf,CAAC,EAhBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgBrB;AAKD,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,0CAAuB,CAAA;IACvB,gDAA6B,CAAA;IAC7B,wDAAqC,CAAA;AACvC,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B","sourcesContent":["export enum FieldTypes {\n attachment = 'attachment',\n checkbox = 'checkbox',\n collaborator = 'collaborator',\n date = 'date',\n email = 'email',\n image = 'image',\n link = 'link',\n location = 'location',\n multilang = 'multilang',\n multiline = 'multiline',\n number = 'number',\n phoneNumber = 'phoneNumber',\n picklist = 'picklist',\n rating = 'rating',\n text = 'text',\n}\n\n//\n// Field values\n//\nexport enum DateGranularity {\n year = 'year',\n yearMonth = 'yearMonth',\n yearMonthDay = 'yearMonthDay',\n yearMonthDayTime = 'yearMonthDayTime',\n}\n\n//\n// Field metas\n//\ntype BaseMeta = {};\n\ntype NumberUnit =\n | 'acre'\n | 'bit'\n | 'byte'\n | 'celsius'\n | 'centimeter'\n | 'day'\n | 'degree'\n | 'fahrenheit'\n | 'fluid-ounce'\n | 'foot'\n | 'gallon'\n | 'gigabit'\n | 'gigabyte'\n | 'gram'\n | 'hectare'\n | 'hour'\n | 'inch'\n | 'kilobit'\n | 'kilobyte'\n | 'kilogram'\n | 'kilometer'\n | 'liter'\n | 'megabit'\n | 'megabyte'\n | 'meter'\n | 'mile'\n | 'mile-scandinavian'\n | 'milliliter'\n | 'millimeter'\n | 'millisecond'\n | 'minute'\n | 'month'\n | 'ounce'\n | 'percent'\n | 'petabyte'\n | 'pound'\n | 'second'\n | 'stone'\n | 'terabit'\n | 'terabyte'\n | 'week'\n | 'yard'\n | 'year';\n\ntype BaseNumberMeta = {\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n useGrouping?: boolean;\n} & (\n | {\n style: 'unit';\n unit: NumberUnit;\n }\n | {\n style?: 'currency' | 'decimal' | 'percent';\n unit?: NumberUnit;\n }\n);\n\nexport type NumberMeta = BaseMeta & BaseNumberMeta;\n\nexport type DateMeta = BaseMeta & {\n granularity: DateGranularity;\n};\n\nexport type RatingMeta = BaseMeta & {\n max: number;\n};\n\nexport type PicklistMeta = BaseMeta & {\n picklistId: string;\n};\n\nexport type FieldTypeInfo =\n | { type: FieldTypes.attachment }\n | { type: FieldTypes.checkbox }\n | { type: FieldTypes.date; meta: DateMeta }\n | { type: FieldTypes.email }\n | { type: FieldTypes.image }\n | { type: FieldTypes.link }\n | { type: FieldTypes.location }\n | { type: FieldTypes.multilang }\n | { type: FieldTypes.multiline }\n | { type: FieldTypes.number; meta: NumberMeta }\n | { type: FieldTypes.phoneNumber }\n | { type: FieldTypes.picklist; meta: PicklistMeta }\n | { type: FieldTypes.rating; meta: RatingMeta }\n | { type: FieldTypes.text }\n | { type: FieldTypes.collaborator };\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=internet-vehicles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internet-vehicles.js","sourceRoot":"/","sources":["types/internet-vehicles.ts"],"names":[],"mappings":"","sourcesContent":["import { LocationValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types';\nimport { PublicSearchDefinition } from './definitions';\nimport { AggregationRequest } from './search';\nimport { Vehicle } from './vehicles';\n\nexport type InternetVehicleInternalInfo = {\n createdAt: string;\n updatedAt: string;\n description: {\n title: string;\n remarks?: string;\n };\n};\n\nexport type InternetVehiclePublicSearchDefinitions = {\n searchInternetVehicle: PublicSearchDefinition;\n};\n\nexport type InternetVehicleSellerType = 'Dealer' | 'Private';\n\nexport type PriceChange = {\n price: string | undefined;\n priceAt: string;\n};\n\nexport type InternetVehiclePortal = {\n name: string;\n originalUrl: string;\n pingedAt: string;\n available: boolean;\n};\n\nexport type InternetVehicleSeller = {\n id: string;\n name?: string;\n address: LocationValue;\n type?: InternetVehicleSellerType;\n gps?: {\n lat: number;\n lon: number;\n };\n phones: PhoneNumberValue[];\n};\n\nexport type InternetVehicle = Vehicle<InternetVehicleInternalInfo>;\n\nexport type SearchInternetVehicle = {\n vehicle: InternetVehicle;\n seller: InternetVehicleSeller;\n alternativeIds: string[];\n priceEvolution: PriceChange[];\n portal: InternetVehiclePortal;\n custom: {\n features: string[];\n };\n};\n\nexport type AnalysisResponse = {\n [sellerId: string]: { x: string; y: number }[];\n all: { x: string; y: number }[];\n};\n\nexport type AnalysisRequest = AggregationRequest & {\n sellerIds: string[];\n range: '1M' | '3M' | '6M' | '1y';\n granularity: '1w' | '1M';\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=leads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leads.js","sourceRoot":"/","sources":["types/leads.ts"],"names":[],"mappings":"","sourcesContent":["import {\n PhoneNumberRawValue,\n PhoneNumberValue,\n SearchPermissions,\n} from '@bisondesk/commons-sdk/types';\nimport { PublicSearchDefinition } from './definitions';\nimport { ReferenceData } from './utils';\nimport { SearchVehicle } from './vehicles';\n\nexport type SearchLead = Lead;\n\nexport type InputSearchLead = SearchLead & {\n permissions: SearchPermissions;\n};\n\nexport type RankedSearchLead = SearchLead & { score: number };\n\nexport type LeadPublicSearchDefinitions = {\n searchLead: PublicSearchDefinition;\n};\n\nexport type LeadEvent = {\n id: string;\n action: 'upsert' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type LeadContact = {\n accountManager?: string;\n companyName?: string;\n country: string;\n email?: string;\n name: string;\n phone?: PhoneNumberValue | PhoneNumberRawValue;\n remarks?: string;\n\n // Fields used to link lead to existing org and contact.\n organizationId?: string;\n contactId?: string;\n orgNumber?: number;\n};\n\nexport type LeadScore = {\n leadId: string;\n score: number;\n scores: { name: string; value: number }[];\n};\n\nexport type VehicleScore = {\n vehicleId: string;\n score: number;\n};\n\nexport type LeadVehicles = {\n vehicles: VehicleScore[];\n};\n\nexport type VehicleLeads = {\n leads: LeadScore[];\n};\n\nexport type VehicleLeadsResponse = VehicleLeads & {\n leadsById: { [leadId: string]: Lead };\n};\n\nexport type LeadVehiclesResponse = LeadVehicles & {\n vehiclesById: { [vehicleId: string]: SearchVehicle };\n};\n\nexport type LeadStats = {\n lastClientConversation?: string;\n lastClientTx?: string;\n clientTxs?: number;\n};\n\nexport type LeadVehicle = {\n createdAt: string;\n vehicleId: string;\n saleId?: string;\n};\n\nexport type Lead = {\n id: string;\n createdAt: string;\n contact: LeadContact;\n interests: Interest[];\n vehicles: LeadVehicle[];\n stats?: LeadStats;\n};\n\nexport type InterestVersion = {\n make: string;\n models?: string[];\n};\n\nexport type Interest = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n extended?: string[];\n heightened?: string[];\n adr?: boolean;\n age?: number;\n axleConfigurations?: string[];\n bodystyle?: string;\n cabins?: string[];\n category: string;\n crane?: boolean;\n damaged?: boolean;\n euronorms?: string[];\n horsepower?: number;\n used?: boolean;\n kilometers?: number;\n versions?: InterestVersion[];\n price?: number;\n leasing?: boolean;\n retarderIntarder?: boolean;\n suspensions?: string[];\n tailgate?: boolean;\n transmissions?: string[];\n autoGenerated?: boolean;\n\n remarks?: string;\n};\n\nexport type InterestResponse = {\n interest: Interest;\n meta: ReferenceData;\n};\n\nexport type InterestSearchRequest = { interest: Interest; offset: number; limit: number };\n\nexport type VehicleLeadsSearchRequest = { vehicleId: string };\n\nexport type InterestAutocompleteRequest = { vehicleId: string };\n\nexport type LeadVehiclesSearchRequest = { leadId: string };\n\nexport type SimilarVehiclesRequest = {\n offset: number;\n limit: number;\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=leasing-administration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-administration.js","sourceRoot":"/","sources":["types/leasing-administration.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\nimport { LeasingAdminUploadHandlers } from '../constants';\n\nexport type LeasingAdminUploadStatus = 'success' | 'processing' | 'error';\n\nexport type LeasingAdminUploadMetadata = { [key in string]?: unknown };\nexport type LeasingAdminUploadAttachments = { [key in string]?: AttachmentValue };\n\nexport type LeasingAdminUploadEvent<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = LeasingAdminUpload<M, A> & { tenantId: string };\n\nexport type LeasingAdminUpload<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = {\n id: string;\n updatedAt: string;\n createdAt: string;\n createdBy: string;\n\n status: LeasingAdminUploadStatus;\n attachments: A;\n metadata: M;\n handlerId: LeasingAdminUploadHandlers;\n};\n\nexport type NewLeasingAdminUploadRequest<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = {\n attachments: A;\n metadata: M;\n handlerId: LeasingAdminUploadHandlers;\n};\n\nexport type DhondtAttachments = {\n json: AttachmentValue;\n};\n\nexport type BelfiusAttachments = {\n xlsx: AttachmentValue;\n json?: AttachmentValue; // json version of the xlsx file\n};\n\nexport type BelfiusMetadata = {\n totalLines: number;\n totalIncludingVat: string;\n};\n\nexport type DhondtMetadata = {\n invoiceNumber: string;\n invoiceDate: string;\n};\n\nexport type DhondtInvoiceLine = {\n BrutoPremie: number;\n Chassisnummer: string;\n Datum: string;\n NettoPremie: number;\n Plaatnummer: string;\n Taksen: number;\n VoertuigVlootNummer: string | undefined;\n};\n\nexport type INGMetadata = {\n capital: string;\n emailId: string;\n interest: string;\n invoiceDate: string;\n invoiceNumber: string;\n pdfUrl: string;\n stockNumber: string;\n};\n\nexport type INGAttachments = {\n email: AttachmentValue;\n};\n\nexport type DiffableDhondtInvoiceLine = DhondtInvoiceLine;\n\nexport type BelfiusRawInvoiceLine = {\n 'Additional info': string;\n Amortization: number;\n 'Amount including tax': number;\n Avenant: number;\n Contract: number;\n Currency: string;\n Customer: string;\n Description: string;\n 'Due date': Date;\n 'Interest Amount': number;\n 'Invoice Date': Date;\n 'Invoice Number': number;\n 'Rent amount': number;\n 'VAT amount': number;\n 'VAT number': string;\n 'VAT rate': number;\n};\n\nexport type BelfiusInvoiceLine = {\n capital: string;\n contractNr: string;\n interest: string;\n invoiceNr: string;\n invoiceDate: string;\n rentExcl: string;\n rentIncl: string;\n vatAmount: string;\n vehicleId: string;\n stockNumber: string;\n};\n\nexport type DiffableBelfiusInvoiceLine = Omit<\n BelfiusInvoiceLine,\n 'invoiceNr' | 'invoiceDate' | 'capital' | 'interest'\n>;\n\nexport type LineDiff<T> = {\n [Property in keyof T]: {\n value: T[Property];\n before: T[Property];\n };\n};\n\nexport type Diff<T> = {\n added: T[];\n removed: T[];\n changed: LineDiff<T>[];\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=leasing-debtors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-debtors.js","sourceRoot":"/","sources":["types/leasing-debtors.ts"],"names":[],"mappings":"","sourcesContent":["import { Organization } from './crm';\n\nexport type MonthData = {\n activeContractIds: string[];\n date: string; // YYYY-MM\n overdueAmount: string;\n unpaidAmount: string;\n overdueContractIds: string[];\n overdueInvoiceIds: string[];\n riskLevel: number;\n};\n\nexport type DebtorInfo = {\n clientId: string;\n months: MonthData[];\n\n // properties related to the current month\n activeContracts: number;\n overdueAmount: string;\n unpaidAmount: string;\n overdueContracts: number;\n riskLevel: number;\n};\n\nexport type SearchDebtorInfo = {\n org: Organization;\n debtor: DebtorInfo;\n custom: {\n riskLevelLabel: string;\n };\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=leasing-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-search.js","sourceRoot":"/","sources":["types/leasing-search.ts"],"names":[],"mappings":"","sourcesContent":["import { InsuranceEntry } from '@bisondesk/commons-sdk/insurance';\nimport { SearchPermissions } from '@bisondesk/commons-sdk/types';\nimport { Organization } from './crm';\nimport { PublicSearchDefinition } from './definitions';\nimport { LeasingContract } from './leasing';\nimport { Vehicle } from './vehicles';\n\nexport type LeasingPublicSearchDefinitions = {\n searchLeasingContract: PublicSearchDefinition;\n};\n\nexport type LeasingDebtorsSearchDefinitions = {\n debtors: PublicSearchDefinition;\n};\n\nexport type SearchLeasingContract = {\n contract: LeasingContract;\n org: Organization;\n debt: LeasingContractDebtInfo;\n vehicle: Vehicle;\n custom: {\n active: boolean;\n insurance?: InsuranceEntry;\n };\n};\n\nexport type LeasingContractDebtInfo = {\n overdueSince?: string;\n overdueInvoices: number;\n overdueAmount: string;\n unpaidInvoices: number;\n unpaidAmount: string;\n};\n\nexport type InputSearchLeasingContract = SearchLeasingContract & {\n permissions: SearchPermissions;\n};\n"]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeasingItemsPaymentSplit = void 0;
4
+ var LeasingItemsPaymentSplit;
5
+ (function (LeasingItemsPaymentSplit) {
6
+ LeasingItemsPaymentSplit["Customer"] = "customer";
7
+ LeasingItemsPaymentSplit["Split"] = "split";
8
+ LeasingItemsPaymentSplit["Company"] = "company";
9
+ })(LeasingItemsPaymentSplit = exports.LeasingItemsPaymentSplit || (exports.LeasingItemsPaymentSplit = {}));
10
+ //# sourceMappingURL=leasing-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-settings.js","sourceRoot":"/","sources":["types/leasing-settings.ts"],"names":[],"mappings":";;;AAsFA,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,2CAAe,CAAA;IACf,+CAAmB,CAAA;AACrB,CAAC,EAJW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAInC","sourcesContent":["import { MultiLangValue } from '@bisondesk/commons-sdk/types';\nimport { Categories, OpportunityType } from '../constants';\nimport { SortFilter } from './search';\n\nexport type LeasingQuoteParams = { id: string; name: string; modifiedAt: string } & {\n countryCode: 'be';\n insurance: {\n allRisksCost: string;\n allRisksTax: string;\n allRisksFees: string;\n allRisksMinimumCost: string;\n specialTechnicalInsuranceCost: string;\n specialTechnicalInsuranceTax: string;\n specialTechnicalInsuranceFees: string;\n civilLiabilitiesCost: string;\n civilLiabilitiesTax: string;\n civilLiabilitiesFees: string;\n roadAssistanceMonthlySalesPrice: string; // monthly Price\n roadAssistanceMonthlyCostPrice: string; // monthly Price\n margin: string;\n allRisksCheckedForLocalClients: boolean;\n specialTechnicalInsuranceCheckedForLocalClients: boolean;\n civilLiabilitiesCheckedForLocalClients: boolean;\n roadAssistanceCheckedForLocalClients: boolean;\n };\n leasing: {\n leasingInterestRate: string;\n leasingDuration: number;\n leasingStartupFeePercentage: string;\n leasingDepositPercentage: string;\n leasingResidualValuePercentage: string;\n };\n taxes: {\n oneTimeRoadTax: string;\n yearlyRoadTax: string;\n oneTimeRoadCheckedForLocalClients: boolean;\n yearlyRoadCheckedForLocalClients: boolean;\n margin: string;\n };\n costs: {\n bankDepositPercentage: string;\n bankInterestRate: string;\n bankResidualValuePercentage: string;\n trackAndTrace24Cost: string;\n trackAndTrace36Cost: string;\n trackAndTrace48Cost: string;\n trackAndTraceMaxCost: string;\n };\n};\n\ntype BaseQuoteExtraSettings = {\n referenceCode: string;\n active: boolean;\n costPrice: string;\n countryCode: string;\n deliveryPackage: boolean;\n displayByDefault: boolean;\n hint?: MultiLangValue;\n name: MultiLangValue;\n salesPrice: string;\n vehicleCategoryRestrictions: Categories[];\n departments: string[];\n departmentTitles?: { [department: string]: string };\n opportunityTypeRestrictions: OpportunityType[];\n};\n\nexport type BaseQuoteExtraInput = {\n agreedPrice: string;\n costPrice: string;\n hint?: MultiLangValue;\n name: MultiLangValue;\n referenceCode: string;\n quantity: number;\n id: string;\n departments: string[];\n departmentTitles?: { [department: string]: string };\n};\n\nexport type NewQuoteExtraSettings = BaseQuoteExtraSettings & {\n id?: undefined;\n};\n\nexport type QuoteExtraSettings = BaseQuoteExtraSettings & {\n id: string;\n};\n\nexport enum LeasingItemsPaymentSplit {\n Customer = 'customer',\n Split = 'split',\n Company = 'company',\n}\n\nexport type LeasingDeliveryPackageInput = BaseQuoteExtraInput & { salesPrice: string };\n\nexport type CustomLeasingQuoteExtraInput = BaseQuoteExtraInput & {\n paymentSplit: LeasingItemsPaymentSplit;\n leasingPercentage: string;\n};\n\nexport type LeasingQuoteExtraInput = BaseQuoteExtraInput & {\n salesPrice: string;\n paymentSplit: LeasingItemsPaymentSplit;\n leasingPercentage: string;\n};\n\nexport type QuoteExtrasRequest = {\n deliveryPackage?: boolean;\n displayByDefault?: boolean;\n vehicleCategory?: Categories;\n country: string;\n name?: string;\n active?: boolean;\n offset?: number;\n limit?: number;\n sortBy?: SortFilter;\n opportunityType?: OpportunityType;\n};\n\nexport type SalesQuoteExtraInput = BaseQuoteExtraInput & {\n salesPrice: string;\n vatPercentage: string;\n};\n\nexport type CustomSalesQuoteExtraInput = BaseQuoteExtraInput & {\n vatPercentage: string;\n};\n"]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeasingRemindersSortableColumns = exports.LeasingContractStatus = exports.LeasingContractSource = void 0;
4
+ var LeasingContractSource;
5
+ (function (LeasingContractSource) {
6
+ LeasingContractSource["HYPERPORTAL"] = "hyperportal";
7
+ LeasingContractSource["BISONDESK"] = "bisondesk";
8
+ })(LeasingContractSource = exports.LeasingContractSource || (exports.LeasingContractSource = {}));
9
+ var LeasingContractStatus;
10
+ (function (LeasingContractStatus) {
11
+ LeasingContractStatus["DRAFT"] = "draft";
12
+ LeasingContractStatus["DISCARDED"] = "discarded";
13
+ LeasingContractStatus["PAUSED"] = "paused";
14
+ LeasingContractStatus["ACTIVE"] = "active";
15
+ LeasingContractStatus["ENDED"] = "ended";
16
+ })(LeasingContractStatus = exports.LeasingContractStatus || (exports.LeasingContractStatus = {}));
17
+ var LeasingRemindersSortableColumns;
18
+ (function (LeasingRemindersSortableColumns) {
19
+ LeasingRemindersSortableColumns["NextActionAt"] = "next_action_at";
20
+ LeasingRemindersSortableColumns["OrganizationName"] = "organization_name";
21
+ LeasingRemindersSortableColumns["RemindersCount"] = "reminders_count";
22
+ LeasingRemindersSortableColumns["Status"] = "status";
23
+ })(LeasingRemindersSortableColumns = exports.LeasingRemindersSortableColumns || (exports.LeasingRemindersSortableColumns = {}));
24
+ //# sourceMappingURL=leasing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing.js","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":";;;AAyDA,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oDAA2B,CAAA;IAC3B,gDAAuB,CAAA;AACzB,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC;AAED,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,wCAAe,CAAA;AACjB,CAAC,EANW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAMhC;AAqOD,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,kEAA+B,CAAA;IAC/B,yEAAsC,CAAA;IACtC,qEAAkC,CAAA;IAClC,oDAAiB,CAAA;AACnB,CAAC,EALW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAK1C","sourcesContent":["import { EmailMessage } from '@bisondesk/commons-sdk/messages';\nimport { AttachmentValue, Document, LinkValue, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { SortFilter } from './search';\nimport { ReferenceData } from './utils';\n\nexport type LeasingContractEvent = {\n id: string;\n action: 'create' | 'update' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n contract: LeasingContract;\n};\n\nexport type LeasingContractImportEvent = {\n tenantId: string;\n};\n\nexport type LeasingConditionEvent = {\n id: string;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OverdueDossier = {\n id: string;\n organizationId: string;\n organizationName: string;\n status: 'ONGOING' | 'ERROR' | 'SUCCESS' | 'EXPIRED';\n emails: EmailMessage[];\n createdAt: string;\n modifiedAt: string;\n completedAt?: string;\n nextActionAt: string;\n riskLevel: number;\n};\n\nexport type LeasingContractClient = {\n organizationId: string;\n contactIds: string[];\n email?: string;\n since: string;\n takeoverId?: string;\n country: string;\n beEntityType?: 'Legal Person' | 'Natural Person';\n beForeignEntity?: boolean;\n\n /**\n * Used to overwrite the startDate in the context of a Becris declaration. This might be necessary\n * when due to some data-quality issue we do not report the contract at the right period and it is no\n * longer possible to resend the declaration for the corresponding month.\n */\n becrisStartDate?: string;\n};\n\nexport enum LeasingContractSource {\n HYPERPORTAL = 'hyperportal',\n BISONDESK = 'bisondesk',\n}\n\nexport enum LeasingContractStatus {\n DRAFT = 'draft',\n DISCARDED = 'discarded',\n PAUSED = 'paused',\n ACTIVE = 'active',\n ENDED = 'ended',\n}\n\nexport type LeasingContractHyperportal = {\n source: LeasingContractSource.HYPERPORTAL;\n /** oldest first **/\n conditions: ConditionsRef[];\n opportunities?: undefined;\n};\n\nexport type LeasingContractBisondesk = {\n source: LeasingContractSource.BISONDESK;\n conditions?: undefined;\n /** oldest first **/\n opportunities: OpportunityRef[];\n};\n\nexport type LeasingContract<T = LeasingContractHyperportal | LeasingContractBisondesk> = {\n id: string;\n createdAt: string;\n updatedAt: string;\n contractNumber?: string;\n startDate: string;\n deliveryDate?: string;\n endDate?: string;\n slbPartner?: string;\n links?: LinkValue[];\n accountManager?: string;\n clients: LeasingContractClient[];\n vehicle: {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n };\n status: LeasingContractStatus;\n documents: Document[];\n} & T;\n\nexport type NextLeasingRentRowRequest = {\n vehicleId: string;\n organizationId: string;\n issueDate: string;\n};\n\nexport type NextLeasingRentRowResponse = {\n capital: string;\n contract: string;\n insurance?: string;\n interest: string;\n other?: string; // insurance + taxes + others\n period: number;\n taxes?: string;\n total: string;\n};\n\ntype BaseRef = {\n id: string;\n depositAmount: string;\n durationInMonths: number;\n taxesAmount?: string;\n insuranceAmount?: string;\n saleAmount: string; // includes the extras\n interestRate: string; //TODO: In LC from BD value is percentage, in LC from HP value is decimal\n residualAmount: string;\n leasingMonthlyAmount: string; // excluding VAT\n otherMonthlyAmounts: string; // insurance + taxes + others (excluding VAT)\n totalMonthlyAmount: string; // excluding VAT\n};\n\nexport type ConditionsRef = BaseRef & {\n validSince: string;\n};\n\nexport type OpportunityRef = BaseRef & {\n createdAt: string;\n quoteId: string;\n //Since VAT is client specific and contracts can be transferred between clients, we always handle values without VAT\n};\n\nexport type ListOverdueRemindersResponse = PaginatedList<OverdueDossier, ReferenceData>;\nexport type ListOverdueRemindersRequest = {\n offset: number;\n limit: number;\n sortBy: SortFilter;\n};\n\nexport type NewLeasingConditions = {\n parameters: {\n yearlyRoadTax: string;\n civilLiability: string;\n oneTimeRoadTax: string;\n specialInsurance: string;\n allRisksPercentage: string;\n allRisksTaxPercentage: string;\n };\n\n inputs: {\n deposit: string;\n salesPrice: string;\n bankDeposit: string;\n purchasePrice: string;\n residualValue: string;\n insuranceAmount: string;\n durationInMonths: number;\n includesAllRisks: boolean;\n marginPercentage: string;\n bankResidualValue: string;\n bankDurationInMonths: number;\n startupFeePercentage: string;\n includesYearlyRoadTax: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n interestRatePercentage: string;\n includesSpecialInsurance: boolean;\n monthlyAdministrationFee: string;\n bankInterestRatePercentage: string;\n };\n\n outputs: {\n ROI: string;\n ROITarget: string;\n ROIPerYear: string;\n cashDeficit: string;\n totalProfit: string;\n ROIDifference: string;\n leasingAmount: string;\n leasingProfit: string;\n vehicleProfit: string;\n oneTimeTaxCost: string;\n financingAmount: string;\n bankContractValue: string;\n bankLeasingAmount: string;\n totalMonthlyPayment: string;\n leasingContractValue: string;\n monthlyTaxRetailPrice: string;\n allRisksInsuranceAmount: string;\n };\n\n cashIn: Array<{\n time: string;\n cashIn: string;\n deposit: string;\n startupFee: string;\n taxPayment: string;\n residualValue: string;\n cumulativeCash: string;\n insurancePayment: string;\n monthlyAdministrationFee: string;\n leasingAmountWithoutAdminFee: string;\n }>;\n\n cashOut: Array<{\n time: string;\n cashOut: string;\n deposit: string;\n taxPayment: string;\n leasingAmount: string;\n residualValue: string;\n cumulativeCash: string;\n insurancePayment: string;\n }>;\n};\n\nexport type LeasingConditions = NewLeasingConditions & {\n id: string;\n createdAt: string;\n createdBy: string;\n amortization: AmortizationTable;\n};\n\nexport type AmortizationRow = {\n period: number;\n /* An estimate of the date in which the period will happen\n based on the contract start date. Empty for period zero. */\n expectedPeriodDate?: string;\n buyOff: string;\n payment: string;\n capital: string;\n interest: string;\n totalInterest: string;\n balance: string;\n};\n\nexport type AmortizationTable = {\n annualInterestRate?: string;\n monthlyInterestRate?: string;\n rows: AmortizationRow[];\n};\n\nexport type AmortizationDocsEvent = {\n contractId: string;\n changedDocumentIds: string[];\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type AmortizationDocs = {\n contractId: string;\n period: number;\n documents: AmortizationDoc[];\n};\n\nexport type AmortizationDoc = {\n amount: string;\n bookingNumber: string;\n branchId: string;\n documentId: string;\n issueDate: string;\n subtype: 'Invoice' | 'Credit Note';\n clientExternalId: number;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type LeasingReportingSettings = {\n active: boolean;\n branchId: string;\n tenantId: string;\n};\n\nexport enum LeasingRemindersSortableColumns {\n NextActionAt = 'next_action_at',\n OrganizationName = 'organization_name',\n RemindersCount = 'reminders_count',\n Status = 'status',\n}\n\nexport type AmortizationTableRequest = {\n leasingAmount: string; // monthly amount\n deposit: string;\n salesPrice: string;\n duration: number; // in months\n residual: string;\n monthlyInterestRate: string; // the annual interest rate divided by 12\n startDate?: string; // should be filled in if you want an amortization table with expected period dates\n};\n\nexport type AmortizationTableTemplateData = {\n opportunity: {\n id: string;\n };\n v: {\n make: string;\n model: string;\n category: string;\n type?: string;\n vin: string;\n year?: string | number;\n stockNumber: string;\n };\n c: {\n clientNumber: number;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n leasing: {\n salesPrice: string;\n salesPriceVat: string;\n salesPriceExclVat: string;\n deposit: string;\n depositExclVat: string;\n depositVat: string;\n installment: string;\n installmentVat: string;\n installmentExclVat: string;\n duration: number;\n monthlyInsurance: string;\n monthlyTax: string;\n monthlyTaxesInsurance: string;\n residual: string;\n residualVat: string;\n residualExclVat: string;\n offerNumber: string;\n contractNumber: string;\n vatPercentage: string;\n };\n amortization: {\n period: number;\n periodStartDate: string;\n periodEndDate: string;\n deposit: string;\n startUpFee: string;\n monthlyAmount: string;\n insurance: string;\n expirationDate: string;\n total: string;\n }[];\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=machines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machines.js","sourceRoot":"/","sources":["types/machines.ts"],"names":[],"mappings":"","sourcesContent":["export type Machine = {\n axlesConfiguration?: string;\n bodywork?: string;\n category: string;\n vin?: string;\n cocPvg?: string;\n emptyWeightKg?: number;\n euronorm?: string;\n firstRegistration?: string;\n gearbox?: string;\n kilometers?: number;\n make?: string;\n makeModel?: string;\n makeModelText?: string;\n makeModelType?: string;\n makeModelTypeText?: string;\n powerHp?: number;\n productionYear?: number;\n suspension?: string;\n totalWeightKg?: number;\n wheelbaseCm?: number;\n\n references: MachineReference[];\n id: string;\n};\n\nexport type MachineReference = {\n administrativeNumber?: string;\n metaId: string;\n stockNumber: string;\n tenantId: string;\n vehicleId: string;\n};\n\nexport type MachineEvent = {\n machine: Machine;\n action: 'upsert' | 'delete';\n actionAt: string;\n namespace: string;\n};\n"]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = exports.OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = exports.QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = exports.QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = exports.QUOTE_CREATED_NOTIFICATION_ORIGIN = exports.OpportunityLostReasonValues = exports.OpportunityKanbanEndColumns = exports.OpportunityKanbanColumns = exports.OpportunityWonColumnId = exports.OpportunityWarningsCode = exports.OpportunityRequirementsCode = exports.OpportunityLogisticStatus = exports.OpportunityStatusOrder = exports.OpportunityStatus = exports.OpportunityDealStatus = exports.OpportunityActions = void 0;
4
+ var OpportunityActions;
5
+ (function (OpportunityActions) {
6
+ OpportunityActions["CREATE_QUOTE"] = "create_quote";
7
+ OpportunityActions["LOSE"] = "lose";
8
+ OpportunityActions["REOPEN"] = "reopen";
9
+ OpportunityActions["START_PREPARATION"] = "start_preparation";
10
+ OpportunityActions["REVERT_PREPARATION"] = "revert_preparation";
11
+ OpportunityActions["START_DELIVERY"] = "start_delivery";
12
+ OpportunityActions["REVERT_DELIVERY"] = "revert_delivery";
13
+ OpportunityActions["SET_CUSTOMER"] = "set_customer";
14
+ OpportunityActions["SET_DOCUMENTS"] = "set_documents";
15
+ OpportunityActions["SET_INTEREST"] = "set_interest";
16
+ OpportunityActions["SET_METADATA"] = "set_metadata";
17
+ OpportunityActions["SET_VEHICLE"] = "set_vehicle";
18
+ OpportunityActions["ADD_ACTIVITY"] = "add_activity";
19
+ OpportunityActions["ADD_PAYMENT"] = "add_payment";
20
+ OpportunityActions["SWITCH_VEHICLE"] = "switch_vehicle";
21
+ OpportunityActions["DELIVER_VEHICLE"] = "deliver_vehicle";
22
+ OpportunityActions["UNDO_DELIVER_VEHICLE"] = "undo_deliver_vehicle";
23
+ OpportunityActions["SET_DEAL_INFO"] = "update_deal_info";
24
+ })(OpportunityActions = exports.OpportunityActions || (exports.OpportunityActions = {}));
25
+ var OpportunityDealStatus;
26
+ (function (OpportunityDealStatus) {
27
+ OpportunityDealStatus["SALES_AGREED"] = "sales_agreed";
28
+ OpportunityDealStatus["FIRST_PAYMENT"] = "first_payment";
29
+ OpportunityDealStatus["FULL_PAYMENT"] = "full_payment";
30
+ })(OpportunityDealStatus = exports.OpportunityDealStatus || (exports.OpportunityDealStatus = {}));
31
+ var OpportunityStatus;
32
+ (function (OpportunityStatus) {
33
+ OpportunityStatus["PROSPECTION"] = "prospection";
34
+ OpportunityStatus["DISCOVERY"] = "discovery";
35
+ OpportunityStatus["EVALUATION"] = "evaluation";
36
+ OpportunityStatus["REVIEW"] = "review";
37
+ OpportunityStatus["PREPARATION"] = "preparation";
38
+ OpportunityStatus["DELIVERY"] = "delivery";
39
+ })(OpportunityStatus = exports.OpportunityStatus || (exports.OpportunityStatus = {}));
40
+ exports.OpportunityStatusOrder = [
41
+ OpportunityStatus.PROSPECTION,
42
+ OpportunityStatus.DISCOVERY,
43
+ OpportunityStatus.EVALUATION,
44
+ OpportunityStatus.REVIEW,
45
+ OpportunityStatus.PREPARATION,
46
+ OpportunityStatus.DELIVERY,
47
+ ];
48
+ var OpportunityLogisticStatus;
49
+ (function (OpportunityLogisticStatus) {
50
+ OpportunityLogisticStatus["AT_ORIGIN"] = "at_origin";
51
+ OpportunityLogisticStatus["DELIVERED"] = "delivered";
52
+ })(OpportunityLogisticStatus = exports.OpportunityLogisticStatus || (exports.OpportunityLogisticStatus = {}));
53
+ var OpportunityRequirementsCode;
54
+ (function (OpportunityRequirementsCode) {
55
+ OpportunityRequirementsCode["VEHICLE_AT_ORIGIN"] = "vehicle_at_origin";
56
+ })(OpportunityRequirementsCode = exports.OpportunityRequirementsCode || (exports.OpportunityRequirementsCode = {}));
57
+ var OpportunityWarningsCode;
58
+ (function (OpportunityWarningsCode) {
59
+ OpportunityWarningsCode["QUOTE_PENDING_VALIDATION"] = "quote_pending_validation";
60
+ OpportunityWarningsCode["QUOTE_PEDING_MANAGER_APPROVAL"] = "quote_pending_manager_approval";
61
+ OpportunityWarningsCode["CONCURRENT_OPPORTUNITIES"] = "concurrent_opportunities";
62
+ OpportunityWarningsCode["VEHICLE_RESERVED"] = "vehicle_reserved";
63
+ OpportunityWarningsCode["OPPORTUNITY_NEEDS_SWITCH_VEHICLE"] = "opportunity_needs_switch_vehicle";
64
+ })(OpportunityWarningsCode = exports.OpportunityWarningsCode || (exports.OpportunityWarningsCode = {}));
65
+ exports.OpportunityWonColumnId = 'closed_won';
66
+ exports.OpportunityKanbanColumns = [...exports.OpportunityStatusOrder, exports.OpportunityWonColumnId];
67
+ exports.OpportunityKanbanEndColumns = [exports.OpportunityWonColumnId];
68
+ var OpportunityLostReasonValues;
69
+ (function (OpportunityLostReasonValues) {
70
+ OpportunityLostReasonValues["Expensive"] = "expensive";
71
+ OpportunityLostReasonValues["AlreadySold"] = "already_sold";
72
+ OpportunityLostReasonValues["BadExperience"] = "bad_experience";
73
+ OpportunityLostReasonValues["IncorrectVehicleCondition"] = "incorrect_vehicle_condition";
74
+ OpportunityLostReasonValues["NoStock"] = "not_enough_stock";
75
+ OpportunityLostReasonValues["SlowDelivery"] = "slow_delivery";
76
+ OpportunityLostReasonValues["HighDeposit"] = "deposit_too_high";
77
+ OpportunityLostReasonValues["NoAnswer"] = "client_not_answered";
78
+ })(OpportunityLostReasonValues = exports.OpportunityLostReasonValues || (exports.OpportunityLostReasonValues = {}));
79
+ exports.QUOTE_CREATED_NOTIFICATION_ORIGIN = 'quote-created';
80
+ exports.QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validator-feedback';
81
+ exports.QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-customer-feedback';
82
+ exports.OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = 'opportunity-closed';
83
+ exports.OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';
84
+ //# sourceMappingURL=opportunities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opportunities.js","sourceRoot":"/","sources":["types/opportunities.ts"],"names":[],"mappings":";;;AASA,IAAY,kBAmBX;AAnBD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,6DAAuC,CAAA;IACvC,+DAAyC,CAAA;IACzC,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mDAA6B,CAAA;IAC7B,qDAA+B,CAAA;IAC/B,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,wDAAkC,CAAA;AACpC,CAAC,EAnBW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAmB7B;AAED,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sDAA6B,CAAA;IAC7B,wDAA+B,CAAA;IAC/B,sDAA6B,CAAA;AAC/B,CAAC,EAJW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAIhC;AAED,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;AACvB,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B;AAEY,QAAA,sBAAsB,GAAwB;IACzD,iBAAiB,CAAC,WAAW;IAC7B,iBAAiB,CAAC,SAAS;IAC3B,iBAAiB,CAAC,UAAU;IAC5B,iBAAiB,CAAC,MAAM;IACxB,iBAAiB,CAAC,WAAW;IAC7B,iBAAiB,CAAC,QAAQ;CAC3B,CAAC;AAEF,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,oDAAuB,CAAA;IACvB,oDAAuB,CAAA;AACzB,CAAC,EAHW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAGpC;AAED,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,sEAAuC,CAAA;AACzC,CAAC,EAFW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAEtC;AAED,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,gFAAqD,CAAA;IACrD,2FAAgE,CAAA;IAChE,gFAAqD,CAAA;IACrD,gEAAqC,CAAA;IACrC,gGAAqE,CAAA;AACvE,CAAC,EANW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAMlC;AAEY,QAAA,sBAAsB,GAAG,YAAY,CAAC;AAEtC,QAAA,wBAAwB,GAAG,CAAC,GAAG,8BAAsB,EAAE,8BAAsB,CAAC,CAAC;AAE/E,QAAA,2BAA2B,GAAa,CAAC,8BAAsB,CAAC,CAAC;AAE9E,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC,sDAAuB,CAAA;IACvB,2DAA4B,CAAA;IAC5B,+DAAgC,CAAA;IAChC,wFAAyD,CAAA;IACzD,2DAA4B,CAAA;IAC5B,6DAA8B,CAAA;IAC9B,+DAAgC,CAAA;IAChC,+DAAgC,CAAA;AAClC,CAAC,EATW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAStC;AAkMY,QAAA,iCAAiC,GAAG,eAAe,CAAC;AACpD,QAAA,4CAA4C,GAAG,0BAA0B,CAAC;AAC1E,QAAA,2CAA2C,GAAG,yBAAyB,CAAC;AACxE,QAAA,sCAAsC,GAAG,oBAAoB,CAAC;AAC9D,QAAA,iDAAiD,GAAG,+BAA+B,CAAC","sourcesContent":["import { Document } from '@bisondesk/commons-sdk/types';\nimport { BusinessEntityIds, OpportunityType, WarningHints } from '../constants';\nimport { Contact, Organization } from './crm';\nimport { Interest } from './leads';\nimport { Payment } from './payments';\nimport { Quote, QuoteStatus } from './quotes';\nimport { DataRecord, ReferenceData } from './utils';\nimport { Vehicle } from './vehicles';\n\nexport enum OpportunityActions {\n CREATE_QUOTE = 'create_quote',\n LOSE = 'lose',\n REOPEN = 'reopen',\n START_PREPARATION = 'start_preparation',\n REVERT_PREPARATION = 'revert_preparation',\n START_DELIVERY = 'start_delivery',\n REVERT_DELIVERY = 'revert_delivery',\n SET_CUSTOMER = 'set_customer',\n SET_DOCUMENTS = 'set_documents',\n SET_INTEREST = 'set_interest',\n SET_METADATA = 'set_metadata',\n SET_VEHICLE = 'set_vehicle',\n ADD_ACTIVITY = 'add_activity',\n ADD_PAYMENT = 'add_payment',\n SWITCH_VEHICLE = 'switch_vehicle',\n DELIVER_VEHICLE = 'deliver_vehicle',\n UNDO_DELIVER_VEHICLE = 'undo_deliver_vehicle',\n SET_DEAL_INFO = 'update_deal_info',\n}\n\nexport enum OpportunityDealStatus {\n SALES_AGREED = 'sales_agreed',\n FIRST_PAYMENT = 'first_payment',\n FULL_PAYMENT = 'full_payment',\n}\n\nexport enum OpportunityStatus {\n PROSPECTION = 'prospection',\n DISCOVERY = 'discovery',\n EVALUATION = 'evaluation',\n REVIEW = 'review',\n PREPARATION = 'preparation',\n DELIVERY = 'delivery',\n}\n\nexport const OpportunityStatusOrder: OpportunityStatus[] = [\n OpportunityStatus.PROSPECTION,\n OpportunityStatus.DISCOVERY,\n OpportunityStatus.EVALUATION,\n OpportunityStatus.REVIEW,\n OpportunityStatus.PREPARATION,\n OpportunityStatus.DELIVERY,\n];\n\nexport enum OpportunityLogisticStatus {\n AT_ORIGIN = 'at_origin',\n DELIVERED = 'delivered',\n}\n\nexport enum OpportunityRequirementsCode {\n VEHICLE_AT_ORIGIN = 'vehicle_at_origin',\n}\n\nexport enum OpportunityWarningsCode {\n QUOTE_PENDING_VALIDATION = 'quote_pending_validation',\n QUOTE_PEDING_MANAGER_APPROVAL = 'quote_pending_manager_approval',\n CONCURRENT_OPPORTUNITIES = 'concurrent_opportunities',\n VEHICLE_RESERVED = 'vehicle_reserved',\n OPPORTUNITY_NEEDS_SWITCH_VEHICLE = 'opportunity_needs_switch_vehicle',\n}\n\nexport const OpportunityWonColumnId = 'closed_won';\n\nexport const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];\n\nexport const OpportunityKanbanEndColumns: string[] = [OpportunityWonColumnId];\n\nexport enum OpportunityLostReasonValues {\n Expensive = 'expensive',\n AlreadySold = 'already_sold',\n BadExperience = 'bad_experience',\n IncorrectVehicleCondition = 'incorrect_vehicle_condition',\n NoStock = 'not_enough_stock',\n SlowDelivery = 'slow_delivery',\n HighDeposit = 'deposit_too_high',\n NoAnswer = 'client_not_answered',\n}\n\ntype BaseBid = {\n vehicleId: string;\n opportunityId?: string;\n contactId: string;\n amount: string;\n};\n\nexport type NewBid = BaseBid & {};\n\nexport type Bid = BaseBid & {\n id: string;\n createdAt: string;\n createdBy: string;\n};\n\ntype BaseOpportunity = {\n accountManager?: string;\n administrativePerson?: string;\n type: OpportunityType;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n source?: string; // e.g. website, autoscout, mobile...\n branch: string;\n inquiry?: string;\n branchCountry: string;\n};\n\nexport type NewOpportunity = BaseOpportunity & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n};\n\nexport type Opportunity = BaseOpportunity & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validatedAt?: string;\n validatedBy?: string;\n acceptedAt?: string;\n acceptedBy?: string;\n lastActivityAt?: string; // last time we reached out to the customer, regardless of medium\n reviewedAt?: string;\n reviewedBy?: string;\n reviewExpiredAt?: string;\n preparedAt?: string;\n preparedBy?: string;\n lostAt?: string;\n lostBy?: string;\n wonAt?: string;\n lostReason?: OpportunityLostReasonValues;\n deliveredAt?: string;\n deliveredBy?: string;\n status: OpportunityStatus;\n dealStatus?: OpportunityDealStatus;\n logisticStatus?: OpportunityLogisticStatus;\n activeQuoteId?: string;\n amount?: string;\n interest?: Interest;\n documents?: Document[];\n leasingContractId?: string;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityUpdate = {\n vehicleId?: string | null;\n accountManager?: string | null;\n administrativePerson?: string | null;\n contactId?: string | null;\n activeQuoteId?: string | null;\n interest?: Interest | null;\n reviewed?: boolean;\n prepared?: boolean;\n lost?: boolean;\n delivered?: boolean;\n lostReason?: OpportunityLostReasonValues;\n documents?: Document[];\n branch?: string;\n branchCountry?: string;\n type?: OpportunityType;\n lastActivityAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n reviewExpiredAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n source?: string | null;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type PaymentSummary = {\n total: string;\n paid: string;\n entries: DataRecord<Payment>[];\n};\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n otherRelatedVehicleIds: string[];\n};\n\nexport type OpportunityStatusRequirement = { code: OpportunityRequirementsCode; title?: string };\n\nexport type OpportunityWarning = {\n code: OpportunityWarningsCode;\n title: string;\n description: string;\n level: WarningHints;\n businessEntityId?: BusinessEntityIds;\n recordId?: string;\n};\n\nexport type OpportunityBffMeta = ReferenceData & {\n requirements: OpportunityStatusRequirement[];\n warnings: OpportunityWarning[];\n};\n\nexport type OpportunityBFF = {\n opportunity: DataRecord<Opportunity, OpportunityBffMeta>;\n vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;\n bids: DataRecord<Bid>[];\n quotes: DataRecord<Quote>[];\n activeQuote?: DataRecord<Quote>;\n payments: PaymentSummary | undefined;\n customer?: {\n contact: DataRecord<Contact>;\n org?: DataRecord<Organization>;\n };\n};\n\ntype BaseOpportunityEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OpportunityCreateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity?: undefined;\n action: 'create';\n};\n\nexport type OpportunityUpdateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity: Opportunity;\n action: 'update';\n};\n\nexport type OpportunityDeleteEvent = BaseOpportunityEvent & {\n opportunity?: undefined;\n previousOpportunity: Opportunity;\n action: 'delete';\n};\n\nexport type OpportunityEvent =\n | OpportunityCreateEvent\n | OpportunityUpdateEvent\n | OpportunityDeleteEvent;\n\nexport type QuoteEvent = {\n quote: Quote;\n opportunity: Opportunity;\n action: 'create' | 'update' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\n/* Quote summary with information that should be common to different types of quotes */\nexport type QuoteInfo = {\n status: QuoteStatus;\n roi: string;\n id: string;\n};\n\nexport type SearchOpportunity = {\n contact?: Contact;\n opportunity: Opportunity;\n org?: Organization;\n vehicle?: Vehicle;\n quote?: QuoteInfo;\n custom: {\n unassigned: boolean;\n assignees: string[];\n };\n};\n\nexport const QUOTE_CREATED_NOTIFICATION_ORIGIN = 'quote-created';\nexport const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validator-feedback';\nexport const QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-customer-feedback';\nexport const OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = 'opportunity-closed';\nexport const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';\n\nexport type OpportunityNotificationData = {\n quoteVersion?: number;\n};\n\nexport type LeasingQuoteTemplateData = {\n opportunity: {\n id: string;\n };\n currentDate: string;\n vehicle: {\n make: string;\n model: string;\n type?: string;\n km: string | number;\n vin: string;\n mainImage: string;\n localLicensePlate: boolean;\n description: string;\n year?: string | number;\n stockNumber?: string;\n };\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n customer: {\n company: string;\n fullName: string;\n vatNumber?: string;\n address?: string;\n };\n settingId: string;\n leasing: {\n deposit: string;\n startupFee: string;\n totalExtras: string;\n totalBeforeDeliveryExclVat: string;\n totalBeforeDelivery: string;\n installment: string;\n duration: number;\n monthlyInsurance: string;\n monthlyTax: string;\n monthlyTaxesInsurance: string;\n residual: string;\n offerNumber: string;\n extras: { name: string }[];\n };\n};\n\nexport type LineItemPdfTemplate = {\n description: string;\n vat: string;\n quantity: number;\n unitPriceExclVat: string;\n amount: string;\n amountExclVat: string;\n};\n\nexport type LeasingProformaTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n displayVatMessage: boolean;\n total: string;\n monthly: string;\n monthlyExclVat: string;\n residual: string;\n residualExclVat: string;\n duration: number;\n };\n};\n\nexport type SalesProformaTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n expirationDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n total: string;\n };\n};\n\nexport type SalesAgreementTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n total: string;\n };\n};\n\nexport type OpportunitiesKanbanColumn = {\n status: string;\n results: SearchOpportunity[];\n totalCount: number;\n totalValue: string;\n};\n\nexport type HpLeasingDealRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n leasingContractOwner: string;\n foreseenDeliveryDate?: string;\n deliveryAddressLeasing?: string;\n nameSalesPerson: string;\n durationLeasingInMonths: number;\n vanCourier: boolean;\n newVehicle?: boolean;\n newTrailer?: boolean;\n registrationOnTtcoBe?: string;\n yearOfConstruction?: number;\n chassisnumber?: string;\n vehicleModel?: string;\n vehicleCategory2?: string;\n licencePlate?: string;\n vatPercentage?: number;\n\n opportunityContractId: string;\n opportunityId: string;\n\n company?: string;\n customerNumber?: number; //bisondesk external id\n //MrLease fields\n vehicle?: string;\n salesPriceEur: string;\n depositFullAmountExclVat: string;\n depositToBePrepaidExclVat: string;\n vehicleMake3?: string;\n\n //TTC fields\n vehicleOriginalReference?: string;\n salesPrice: string;\n depositFullAmount: string;\n depositAmountToBePrepaid: string;\n make?: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n administrationExtrasCodes: string[];\n logisticExtrasCodes: string[];\n customRequestDescriptions: string[];\n };\n};\n\nexport type HpLeasingDealResponse = {\n entityId: string;\n id: string;\n status: string;\n leasingContractNumber?: string;\n};\n\nexport type HpLeasingContractRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n company?: string;\n vehicle?: string;\n ldNumber: number;\n vanCourier: boolean;\n startDate: number;\n opportunityContractId: string;\n data: {\n leasingParameter: {\n allRisksPercentage: number;\n allRisksTaxPercentage: number;\n civilLiability: number;\n entityId: string;\n oneTimeRoadTax: number;\n specialInsurance: number;\n yearlyRoadTax: number;\n countries: string[];\n vehicleCategory: string;\n };\n\n calculatorRequest: {\n bankDeposit: number;\n bankDurationInMonths: number;\n bankInterestRatePercentage: number;\n bankResidualValue: number;\n deposit: number;\n durationInMonths: number;\n includesAllRisks: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n includesSpecialInsurance: boolean;\n includesYearlyRoadTax: boolean;\n insuranceAmount: number;\n interestRatePercentage: number;\n marginPercentage: number;\n monthlyAdministrationFee: 0;\n purchasePrice: number;\n residualValue: number;\n salesPrice: number;\n startupFeePercentage: number;\n };\n\n calculatorResponse: {\n ROI: number;\n ROIDifference: number;\n ROIPerYear: number;\n ROITarget: number;\n allRisksInsuranceAmount: number;\n bankContractValue: number;\n bankLeasingAmount: number;\n cashDeficit: number;\n financingAmount: number;\n leasingAmount: number;\n leasingContractValue: number;\n leasingProfit: number;\n monthlyTaxRetailPrice: number;\n oneTimeTaxCost: number;\n totalMonthlyPayment: number;\n totalProfit: number;\n vehicleProfit: number;\n };\n\n cashInValues: CashInRow[];\n\n cashOutValues: CashOutRow[];\n };\n };\n};\n\nexport type HpLeasingContractResponse = {\n entityId: string;\n id: string;\n status: string;\n createdAt: string;\n updatedAt: string;\n dateOfFinalSettlement: string;\n startDate: string;\n email: string;\n contractNumber: string;\n};\n\nexport type CashInRow = {\n time: number;\n deposit: number;\n monthlyAdministrationFee: 0; //Legacy field - Should always be 0\n residualValue: number;\n startupFee: number;\n leasingAmountWithoutAdminFee: number;\n insurancePayment: number;\n taxPayment: number;\n cashIn: number;\n cumulativeCash: number;\n};\n\nexport type CashOutRow = {\n time: number;\n deposit: number;\n residualValue: number;\n leasingAmount: number;\n insurancePayment: number;\n taxPayment: number;\n cashOut: number;\n cumulativeCash: number;\n};\n\nexport type HpIsaProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n\n company?: string; //entityId\n proofOfSaleCustomerAgreement?: string; //entityId\n\n vehicle?: string; //entityId\n bodywork?: string; //entityId\n vehicleCategory: string; //entityId\n\n amountOfCommissionPaid: number;\n dealValidated: boolean;\n dealCancelled: boolean;\n opportunityId: string;\n deliveryType: string; //entity Id\n stackingVehicle?: boolean;\n detailsOfStacking?: string;\n\n //PickUP Delivery\n urgentDelivery?: boolean;\n dateOfPickUpByCustomer?: number;\n modeOfTransportPickUpByCustomer?: string; //entity Id\n detailsOfBorderCrossing?: string;\n technicalControlNeeded?: boolean;\n insuranceNeeded?: boolean;\n transitPlateBelgiumNeeded?: boolean;\n transitPlateAustriaNeeded?: boolean;\n licensePlateNeeded?: boolean;\n\n //Address Delivery\n addressOfDelivery?: string;\n kmToAddressOfDelivery?: number;\n\n //To Port Delivery\n portOfDelivery?: string; //entity Id\n shippingCompany?: string; //string Id\n destinationPort?: string;\n cleaningDegassingNeeded?: boolean;\n agreedPrice?: string;\n\n //Extras\n garageExtrasCodes: string[];\n logisticsExtrasCodes: string[];\n administrationExtrasCodes: string[];\n allExtrasDescriptions: string[];\n customRequestDescriptions: string[];\n infoSpoiler: string; // entity Id\n };\n};\n\nexport type HpIsaProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type SwitchOpportunityVehicleRequest = {\n opportunityId: string;\n newVehicleId: string;\n};\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentActions = void 0;
4
+ var PaymentActions;
5
+ (function (PaymentActions) {
6
+ PaymentActions["DELETE"] = "delete";
7
+ PaymentActions["EDIT"] = "edit";
8
+ })(PaymentActions = exports.PaymentActions || (exports.PaymentActions = {}));
9
+ //# sourceMappingURL=payments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.js","sourceRoot":"/","sources":["types/payments.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB","sourcesContent":["export enum PaymentActions {\n DELETE = 'delete',\n EDIT = 'edit',\n}\n\ntype BasePayment = {\n opportunityId: string;\n amount: string;\n description?: string;\n vehicleId: string;\n organizationId: string;\n};\n\nexport type NewPayment = BasePayment & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n deletedAt?: undefined;\n deletedBy?: undefined;\n paidAt: string;\n};\n\nexport type Payment = BasePayment & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n deletedAt?: string;\n deletedBy?: string;\n paidAt?: string;\n};\n\nexport type PaymentUpdate = {\n description?: string;\n amount?: string;\n paidAt?: string;\n};\n\nexport type PaymentCreateEvent = {\n payment: Payment;\n previousPayment?: undefined;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type PaymentUpdateEvent = {\n payment: Payment;\n previousPayment: Payment;\n action: 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type PaymentDeleteEvent = {\n payment?: undefined;\n previousPayment: Payment;\n action: 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type PaymentEvent = PaymentCreateEvent | PaymentUpdateEvent | PaymentDeleteEvent;\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=picklists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"picklists.js","sourceRoot":"/","sources":["types/picklists.ts"],"names":[],"mappings":"","sourcesContent":["import { MultiLangValue } from '@bisondesk/commons-sdk/types';\n\nexport type PicklistValueUpdateRequest = {\n picklistId: string;\n value: PicklistValue | NewPicklistValue;\n};\n\nexport type NewPicklistValue<T = Record<string, string>> = {\n color?: string;\n sortPriority?: number;\n titles: MultiLangValue;\n dependency?: PicklistValueDependency;\n meta?: T;\n};\n\nexport type PicklistValue<T = any> = NewPicklistValue<T> & {\n id: string;\n system?: boolean;\n};\n\nexport type PicklistValueListRequest = {\n picklistId: string;\n limit: number;\n offset: number;\n dependencies?: PicklistValueDependency[];\n};\n\nexport type PicklistValueRequest = {\n picklistId: string;\n valueId: string;\n};\n\nexport type AdHocPicklistValues<T = any> = {\n [picklistId: string]: {\n [valueId: string]: PicklistValue<T>;\n };\n};\n\nexport type AdHocPicklistRequest = {\n requests: PicklistValueRequest[];\n preferredLang: string;\n tenantLang: string;\n};\n\nexport type AdHocPicklistValueDisplay = {\n [picklistId: string]: {\n [valueId: string]: {\n color?: string;\n title: string;\n };\n };\n};\n\nexport type PicklistOptionsRequest = {\n picklistId: string;\n dependencies?: PicklistValueDependency[];\n lang: string;\n};\n\nexport type QuickAddPicklistValue = {\n sortPriority?: number;\n titles: MultiLangValue;\n};\n\nexport type NewPicklist = {\n id?: undefined;\n titles: MultiLangValue;\n values: QuickAddPicklistValue[];\n customSort?: boolean;\n};\n\nexport type BasePicklist = {\n customSort?: boolean;\n id: string;\n system?: boolean;\n titles: MultiLangValue;\n};\n\nexport type PicklistInfo = BasePicklist & {\n count: number;\n modifiedAt: string;\n};\nexport type PicklistValueDependency = {\n picklistId: string;\n values: string[];\n};\n\nexport type PicklistCollection = (BasePicklist & { data: PicklistValue[] })[];\n"]}
@@ -0,0 +1,46 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=recently-viewed.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,36 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ __exportStar(require("@bisondesk/commons-sdk/storage"), exports);
4
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"/","sources":["types/storage.ts"],"names":[],"mappings":";;AAAA,iEAA+C","sourcesContent":["export * from '@bisondesk/commons-sdk/storage';\n"]}