@bisondesk/core-sdk 1.0.614 → 1.0.615

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.
@@ -4,6 +4,14 @@ export declare enum VehicleTimelineEventType {
4
4
  Created = "CREATED",
5
5
  Purchased = "PURCHASED",
6
6
  Sold = "SOLD",
7
+ PurchaseAgreed = "PURCHASE_AGREED",
8
+ PurchaseFirstPayment = "PURCHASE_FIRST_PAYMENT",
9
+ PurchaseFullPayment = "PURCHASE_FULL_PAYMENT",
10
+ PurchaseArrived = "PURCHASE_ARRIVED",
11
+ PurchaseCheckedIn = "PURCHASE_CHECKED_IN",
12
+ SaleFirstPayment = "SALE_FIRST_PAYMENT",
13
+ SaleFullPayment = "SALE_FULL_PAYMENT",
14
+ SaleDelivered = "SALE_DELIVERED",
7
15
  LeasingStarted = "LEASING_STARTED",
8
16
  LeasingReturnStarted = "LEASING_RETURN_STARTED",
9
17
  VehicleRetaken = "VEHICLE_RETAKEN"
@@ -1 +1 @@
1
- {"version":3,"file":"vehicle-timeline.d.ts","sourceRoot":"/","sources":["types/vehicle-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAO7C,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,cAAc,oBAAoB;IAElC,oBAAoB,2BAA2B;IAE/C,cAAc,oBAAoB;CACnC;AAED,oBAAY,wBAAwB;IAClC,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,oBAAY,yBAAyB;IACnC,aAAa,mBAAmB;IAChC,WAAW,iBAAiB;IAC5B,SAAS,eAAe;CACzB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC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imelineEventType["Created"] = "CREATED";
4
4
  VehicleTimelineEventType["Purchased"] = "PURCHASED";
5
5
  VehicleTimelineEventType["Sold"] = "SOLD";
6
+ VehicleTimelineEventType["PurchaseAgreed"] = "PURCHASE_AGREED";
7
+ VehicleTimelineEventType["PurchaseFirstPayment"] = "PURCHASE_FIRST_PAYMENT";
8
+ VehicleTimelineEventType["PurchaseFullPayment"] = "PURCHASE_FULL_PAYMENT";
9
+ VehicleTimelineEventType["PurchaseArrived"] = "PURCHASE_ARRIVED";
10
+ VehicleTimelineEventType["PurchaseCheckedIn"] = "PURCHASE_CHECKED_IN";
11
+ VehicleTimelineEventType["SaleFirstPayment"] = "SALE_FIRST_PAYMENT";
12
+ VehicleTimelineEventType["SaleFullPayment"] = "SALE_FULL_PAYMENT";
13
+ VehicleTimelineEventType["SaleDelivered"] = "SALE_DELIVERED";
6
14
  VehicleTimelineEventType["LeasingStarted"] = "LEASING_STARTED";
7
15
  VehicleTimelineEventType["LeasingReturnStarted"] = "LEASING_RETURN_STARTED";
8
16
  VehicleTimelineEventType["VehicleRetaken"] = "VEHICLE_RETAKEN";
@@ -1 +1 @@
1
- {"version":3,"file":"vehicle-timeline.js","sourceRoot":"/","sources":["types/vehicle-timeline.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,wBASX;AATD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,mDAAuB,CAAA;IACvB,yCAAa,CAAA;IACb,8DAAkC,CAAA;IAElC,2EAA+C,CAAA;IAE/C,8DAAkC,CAAA;AACpC,CAAC,EATW,wBAAwB,KAAxB,wBAAwB,QASnC;AAED,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,iDAAqB,CAAA;IACrB,6CAAiB,CAAA;AACnB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AAED,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,6DAAgC,CAAA;IAChC,yDAA4B,CAAA;IAC5B,qDAAwB,CAAA;AAC1B,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC","sourcesContent":["import { ReferenceData } from './utils.js';\nimport { VehicleRoles } from './vehicles.js';\n\n/**\n * The kind of milestone a timeline event represents. The frontend maps each\n * type to its own title, icon and tone (translated client-side); the backend\n * only emits the semantic type plus the data backing it.\n */\nexport enum VehicleTimelineEventType {\n Created = 'CREATED',\n Purchased = 'PURCHASED',\n Sold = 'SOLD',\n LeasingStarted = 'LEASING_STARTED',\n /** The leasing return process was started (contract entered leasing return). */\n LeasingReturnStarted = 'LEASING_RETURN_STARTED',\n /** The vehicle was retaken/recovered from the lessee. */\n VehicleRetaken = 'VEHICLE_RETAKEN',\n}\n\nexport enum VehicleTimelinePartyRole {\n Supplier = 'SUPPLIER',\n Customer = 'CUSTOMER',\n Debtor = 'DEBTOR',\n}\n\nexport enum VehicleTimelineAmountType {\n PurchasePrice = 'PURCHASE_PRICE',\n AskingPrice = 'ASKING_PRICE',\n SalePrice = 'SALE_PRICE',\n}\n\nexport type VehicleTimelineParty = {\n role: VehicleTimelinePartyRole;\n organizationId?: string;\n /** Pre-formatted display name, e.g. \"807576 · GABIANCA EXPRES SRL\". */\n name?: string;\n /** ISO country code used to render the small flag badge. */\n countryCode?: string;\n};\n\nexport type VehicleTimelineAmount = {\n type: VehicleTimelineAmountType;\n value: string;\n currency?: string;\n};\n\n/**\n * Leasing-contract details for a LEASING_STARTED event. The monthly/residual\n * figures come from the contract's current conditions and are absent for\n * contract sources that don't carry inline conditions (e.g. Bisondesk-origin).\n */\nexport type VehicleTimelineLeasing = {\n contractId: string;\n vehicleStockNumber?: string;\n startDate: string;\n endDate?: string;\n /** Headline monthly amount (total, excl. VAT). */\n monthly?: string;\n /** Leasing portion of the monthly amount. */\n monthlyLeasing?: string;\n /** Insurance + taxes + other portion of the monthly amount. */\n monthlyOther?: string;\n residual?: string;\n deposit?: string;\n durationInMonths?: number;\n saleAmount?: string;\n currency?: string;\n};\n\nexport type VehicleTimelineDocument<TDoc = unknown> = {\n doc: TDoc;\n paidAt?: string;\n};\n\nexport type VehicleTimelineRetake = {\n contractId: string;\n contractNumber?: string;\n /** Set on a retake when the vehicle was recovered as a total loss. */\n totalLoss?: boolean;\n};\n\nexport type VehicleTimelineEvent<TDoc = unknown> = {\n id: string;\n type: VehicleTimelineEventType;\n date?: string;\n party?: VehicleTimelineParty;\n /** User id of the person who drove the milestone (bought by / sold by / account manager). */\n personUserId?: string;\n assistedByUserId?: string;\n opportunityId?: string;\n /** Raw deal status of the underlying purchase/sale, rendered as a badge. */\n dealStatus?: string;\n /** Raw logistics status of the underlying purchase/sale, rendered as a badge. */\n logisticStatus?: string;\n amount?: VehicleTimelineAmount;\n leasing?: VehicleTimelineLeasing;\n /** Present on LEASING_RETURNED / VEHICLE_RETAKEN milestones. */\n retake?: VehicleTimelineRetake;\n /** Finance documents that belong to this milestone (nested in its card). */\n documents: VehicleTimelineDocument<TDoc>[];\n};\n\n/**\n * Why a non-original stock record exists in the chain. Mirrors the description\n * stored on the clone's `internal.relatedVehicles` entry pointing back to its\n * predecessor (e.g. \"Sale & lease-back …\", \"Retake …\").\n */\nexport type VehicleTimelineRelation = {\n description: string;\n fromVehicleId?: string;\n fromStockNumber?: string;\n};\n\nexport type VehicleTimelineVehicle = {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n title: string;\n branch: string;\n role: VehicleRoles;\n deleted: boolean;\n createdAt: string;\n imageUrl?: string;\n /** Pre-built spec fragments, joined client-side with \" · \". */\n specs: string[];\n};\n\n/**\n * One stock record in the related-vehicles chain together with everything that\n * happened to it. Groups are ordered original-first; every group after the\n * first carries a `relation` describing the clone that created it.\n */\nexport type VehicleTimelineGroup<TDoc = unknown> = {\n vehicle: VehicleTimelineVehicle;\n /** True for the vehicle whose id was passed to the endpoint. */\n isRequested: boolean;\n relation?: VehicleTimelineRelation;\n events: VehicleTimelineEvent<TDoc>[];\n};\n\nexport type VehicleTimelineSummary = {\n stockRecords: number;\n saleCycles: number;\n daysHeld?: number;\n};\n\n/**\n * `TDoc` is generic because `core-sdk` cannot depend on `documents-sdk`\n * (it would be circular). The backend resolves it to `FinanceDocument`.\n */\nexport type VehicleTimeline<TDoc = unknown> = {\n requestedVehicleId: string;\n groups: VehicleTimelineGroup<TDoc>[];\n summary: VehicleTimelineSummary;\n meta?: ReferenceData;\n};\n"]}
1
+ {"version":3,"file":"vehicle-timeline.js","sourceRoot":"/","sources":["types/vehicle-timeline.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,wBAyBX;AAzBD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,mDAAuB,CAAA;IACvB,yCAAa,CAAA;IAEb,8DAAkC,CAAA;IAElC,2EAA+C,CAAA;IAE/C,yEAA6C,CAAA;IAE7C,gEAAoC,CAAA;IAEpC,qEAAyC,CAAA;IAEzC,mEAAuC,CAAA;IAEvC,iEAAqC,CAAA;IAErC,4DAAgC,CAAA;IAChC,8DAAkC,CAAA;IAElC,2EAA+C,CAAA;IAE/C,8DAAkC,CAAA;AACpC,CAAC,EAzBW,wBAAwB,KAAxB,wBAAwB,QAyBnC;AAED,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,iDAAqB,CAAA;IACrB,6CAAiB,CAAA;AACnB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AAED,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,6DAAgC,CAAA;IAChC,yDAA4B,CAAA;IAC5B,qDAAwB,CAAA;AAC1B,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC","sourcesContent":["import { ReferenceData } from './utils.js';\nimport { VehicleRoles } from './vehicles.js';\n\n/**\n * The kind of milestone a timeline event represents. The frontend maps each\n * type to its own title, icon and tone (translated client-side); the backend\n * only emits the semantic type plus the data backing it.\n */\nexport enum VehicleTimelineEventType {\n Created = 'CREATED',\n Purchased = 'PURCHASED',\n Sold = 'SOLD',\n /** The purchase was agreed with the supplier (purchase deal progressed). */\n PurchaseAgreed = 'PURCHASE_AGREED',\n /** First payment sent to the supplier (purchase deal progressed). */\n PurchaseFirstPayment = 'PURCHASE_FIRST_PAYMENT',\n /** Full payment sent to the supplier (purchase deal progressed). */\n PurchaseFullPayment = 'PURCHASE_FULL_PAYMENT',\n /** The purchased vehicle arrived (purchase logistics). */\n PurchaseArrived = 'PURCHASE_ARRIVED',\n /** The purchased vehicle was checked in (purchase logistics). */\n PurchaseCheckedIn = 'PURCHASE_CHECKED_IN',\n /** First payment received from the customer (sale deal progressed). */\n SaleFirstPayment = 'SALE_FIRST_PAYMENT',\n /** Full payment received from the customer (sale deal progressed). */\n SaleFullPayment = 'SALE_FULL_PAYMENT',\n /** The sold vehicle was delivered to the customer (sale logistics). */\n SaleDelivered = 'SALE_DELIVERED',\n LeasingStarted = 'LEASING_STARTED',\n /** The leasing return process was started (contract entered leasing return). */\n LeasingReturnStarted = 'LEASING_RETURN_STARTED',\n /** The vehicle was retaken/recovered from the lessee. */\n VehicleRetaken = 'VEHICLE_RETAKEN',\n}\n\nexport enum VehicleTimelinePartyRole {\n Supplier = 'SUPPLIER',\n Customer = 'CUSTOMER',\n Debtor = 'DEBTOR',\n}\n\nexport enum VehicleTimelineAmountType {\n PurchasePrice = 'PURCHASE_PRICE',\n AskingPrice = 'ASKING_PRICE',\n SalePrice = 'SALE_PRICE',\n}\n\nexport type VehicleTimelineParty = {\n role: VehicleTimelinePartyRole;\n organizationId?: string;\n /** Pre-formatted display name, e.g. \"807576 · GABIANCA EXPRES SRL\". */\n name?: string;\n /** ISO country code used to render the small flag badge. */\n countryCode?: string;\n};\n\nexport type VehicleTimelineAmount = {\n type: VehicleTimelineAmountType;\n value: string;\n currency?: string;\n};\n\n/**\n * Leasing-contract details for a LEASING_STARTED event. The monthly/residual\n * figures come from the contract's current conditions and are absent for\n * contract sources that don't carry inline conditions (e.g. Bisondesk-origin).\n */\nexport type VehicleTimelineLeasing = {\n contractId: string;\n vehicleStockNumber?: string;\n startDate: string;\n endDate?: string;\n /** Headline monthly amount (total, excl. VAT). */\n monthly?: string;\n /** Leasing portion of the monthly amount. */\n monthlyLeasing?: string;\n /** Insurance + taxes + other portion of the monthly amount. */\n monthlyOther?: string;\n residual?: string;\n deposit?: string;\n durationInMonths?: number;\n saleAmount?: string;\n currency?: string;\n};\n\nexport type VehicleTimelineDocument<TDoc = unknown> = {\n doc: TDoc;\n paidAt?: string;\n};\n\nexport type VehicleTimelineRetake = {\n contractId: string;\n contractNumber?: string;\n /** Set on a retake when the vehicle was recovered as a total loss. */\n totalLoss?: boolean;\n};\n\nexport type VehicleTimelineEvent<TDoc = unknown> = {\n id: string;\n type: VehicleTimelineEventType;\n date?: string;\n party?: VehicleTimelineParty;\n /** User id of the person who drove the milestone (bought by / sold by / account manager). */\n personUserId?: string;\n assistedByUserId?: string;\n opportunityId?: string;\n /** Raw deal status of the underlying purchase/sale, rendered as a badge. */\n dealStatus?: string;\n /** Raw logistics status of the underlying purchase/sale, rendered as a badge. */\n logisticStatus?: string;\n amount?: VehicleTimelineAmount;\n leasing?: VehicleTimelineLeasing;\n /** Present on LEASING_RETURNED / VEHICLE_RETAKEN milestones. */\n retake?: VehicleTimelineRetake;\n /** Finance documents that belong to this milestone (nested in its card). */\n documents: VehicleTimelineDocument<TDoc>[];\n};\n\n/**\n * Why a non-original stock record exists in the chain. Mirrors the description\n * stored on the clone's `internal.relatedVehicles` entry pointing back to its\n * predecessor (e.g. \"Sale & lease-back …\", \"Retake …\").\n */\nexport type VehicleTimelineRelation = {\n description: string;\n fromVehicleId?: string;\n fromStockNumber?: string;\n};\n\nexport type VehicleTimelineVehicle = {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n title: string;\n branch: string;\n role: VehicleRoles;\n deleted: boolean;\n createdAt: string;\n imageUrl?: string;\n /** Pre-built spec fragments, joined client-side with \" · \". */\n specs: string[];\n};\n\n/**\n * One stock record in the related-vehicles chain together with everything that\n * happened to it. Groups are ordered original-first; every group after the\n * first carries a `relation` describing the clone that created it.\n */\nexport type VehicleTimelineGroup<TDoc = unknown> = {\n vehicle: VehicleTimelineVehicle;\n /** True for the vehicle whose id was passed to the endpoint. */\n isRequested: boolean;\n relation?: VehicleTimelineRelation;\n events: VehicleTimelineEvent<TDoc>[];\n};\n\nexport type VehicleTimelineSummary = {\n stockRecords: number;\n saleCycles: number;\n daysHeld?: number;\n};\n\n/**\n * `TDoc` is generic because `core-sdk` cannot depend on `documents-sdk`\n * (it would be circular). The backend resolves it to `FinanceDocument`.\n */\nexport type VehicleTimeline<TDoc = unknown> = {\n requestedVehicleId: string;\n groups: VehicleTimelineGroup<TDoc>[];\n summary: VehicleTimelineSummary;\n meta?: ReferenceData;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.614",
3
+ "version": "1.0.615",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "author": "TheTruckCompany",
@@ -10,6 +10,22 @@ export enum VehicleTimelineEventType {
10
10
  Created = 'CREATED',
11
11
  Purchased = 'PURCHASED',
12
12
  Sold = 'SOLD',
13
+ /** The purchase was agreed with the supplier (purchase deal progressed). */
14
+ PurchaseAgreed = 'PURCHASE_AGREED',
15
+ /** First payment sent to the supplier (purchase deal progressed). */
16
+ PurchaseFirstPayment = 'PURCHASE_FIRST_PAYMENT',
17
+ /** Full payment sent to the supplier (purchase deal progressed). */
18
+ PurchaseFullPayment = 'PURCHASE_FULL_PAYMENT',
19
+ /** The purchased vehicle arrived (purchase logistics). */
20
+ PurchaseArrived = 'PURCHASE_ARRIVED',
21
+ /** The purchased vehicle was checked in (purchase logistics). */
22
+ PurchaseCheckedIn = 'PURCHASE_CHECKED_IN',
23
+ /** First payment received from the customer (sale deal progressed). */
24
+ SaleFirstPayment = 'SALE_FIRST_PAYMENT',
25
+ /** Full payment received from the customer (sale deal progressed). */
26
+ SaleFullPayment = 'SALE_FULL_PAYMENT',
27
+ /** The sold vehicle was delivered to the customer (sale logistics). */
28
+ SaleDelivered = 'SALE_DELIVERED',
13
29
  LeasingStarted = 'LEASING_STARTED',
14
30
  /** The leasing return process was started (contract entered leasing return). */
15
31
  LeasingReturnStarted = 'LEASING_RETURN_STARTED',