@bisondesk/core-sdk 1.0.653 → 1.0.654
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/types/quotes.d.ts +65 -5
- package/lib/types/quotes.d.ts.map +1 -1
- package/lib/types/quotes.js +18 -1
- package/lib/types/quotes.js.map +1 -1
- package/lib/types/templates.d.ts +0 -22
- package/lib/types/templates.d.ts.map +1 -1
- package/lib/types/templates.js.map +1 -1
- package/lib/types/transports.d.ts +15 -10
- package/lib/types/transports.d.ts.map +1 -1
- package/lib/types/transports.js +5 -5
- package/lib/types/transports.js.map +1 -1
- package/lib/types/vehicle-sales.d.ts +2 -3
- package/lib/types/vehicle-sales.d.ts.map +1 -1
- package/lib/types/vehicle-sales.js.map +1 -1
- package/lib/utils/organizations.d.ts +3 -0
- package/lib/utils/organizations.d.ts.map +1 -0
- package/lib/utils/organizations.js +15 -0
- package/lib/utils/organizations.js.map +1 -0
- package/lib/utils/transports.d.ts +1 -1
- package/lib/utils/transports.d.ts.map +1 -1
- package/lib/utils/transports.js.map +1 -1
- package/package.json +1 -1
- package/src/types/quotes.ts +73 -17
- package/src/types/templates.ts +0 -27
- package/src/types/transports.ts +24 -24
- package/src/types/vehicle-sales.ts +2 -3
- package/src/utils/organizations.ts +30 -0
- package/src/utils/transports.ts +5 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/types/deliveries.d.ts +0 -74
- package/lib/types/deliveries.d.ts.map +0 -1
- package/lib/types/deliveries.js +0 -24
- package/lib/types/deliveries.js.map +0 -1
- package/lib/utils/deliveries.d.ts +0 -3
- package/lib/utils/deliveries.d.ts.map +0 -1
- package/lib/utils/deliveries.js +0 -3
- package/lib/utils/deliveries.js.map +0 -1
- package/lib/utils/deliveries.test.d.ts +0 -2
- package/lib/utils/deliveries.test.d.ts.map +0 -1
- package/lib/utils/deliveries.test.js +0 -34
- package/lib/utils/deliveries.test.js.map +0 -1
- package/src/types/activities.js +0 -13
- package/src/types/activities.js.map +0 -1
- package/src/types/comparables.js +0 -2
- package/src/types/comparables.js.map +0 -1
- package/src/types/crm.js +0 -58
- package/src/types/crm.js.map +0 -1
- package/src/types/dashboard.js +0 -2
- package/src/types/dashboard.js.map +0 -1
- package/src/types/definitions.js +0 -2
- package/src/types/definitions.js.map +0 -1
- package/src/types/deliveries.ts +0 -92
- package/src/types/fields.js +0 -2
- package/src/types/fields.js.map +0 -1
- package/src/types/insights.js +0 -2
- package/src/types/insights.js.map +0 -1
- package/src/types/interests.js +0 -6
- package/src/types/interests.js.map +0 -1
- package/src/types/internal-events.js +0 -18
- package/src/types/internal-events.js.map +0 -1
- package/src/types/internet-opportunities.js +0 -2
- package/src/types/internet-opportunities.js.map +0 -1
- package/src/types/internet-vehicles.js +0 -2
- package/src/types/internet-vehicles.js.map +0 -1
- package/src/types/leasing-administration.js +0 -2
- package/src/types/leasing-administration.js.map +0 -1
- package/src/types/leasing-debtors.js +0 -2
- package/src/types/leasing-debtors.js.map +0 -1
- package/src/types/leasing-search.js +0 -2
- package/src/types/leasing-search.js.map +0 -1
- package/src/types/leasing-settings.js +0 -7
- package/src/types/leasing-settings.js.map +0 -1
- package/src/types/leasing.js +0 -38
- package/src/types/leasing.js.map +0 -1
- package/src/types/marketing.js +0 -35
- package/src/types/marketing.js.map +0 -1
- package/src/types/offers.js +0 -56
- package/src/types/opportunities.js +0 -107
- package/src/types/opportunities.js.map +0 -1
- package/src/types/payments.js +0 -7
- package/src/types/picklists.js +0 -2
- package/src/types/picklists.js.map +0 -1
- package/src/types/quotes.js +0 -42
- package/src/types/recently-viewed.js +0 -2
- package/src/types/recently-viewed.js.map +0 -1
- package/src/types/reservations.js +0 -5
- package/src/types/reservations.js.map +0 -1
- package/src/types/roi-ratings.js +0 -5
- package/src/types/roi-ratings.js.map +0 -1
- package/src/types/saved-filters.js +0 -9
- package/src/types/saved-filters.js.map +0 -1
- package/src/types/search.js +0 -2
- package/src/types/search.js.map +0 -1
- package/src/types/settings.js +0 -2
- package/src/types/settings.js.map +0 -1
- package/src/types/templates.js +0 -2
- package/src/types/templates.js.map +0 -1
- package/src/types/tenants.js +0 -21
- package/src/types/tenants.js.map +0 -1
- package/src/types/user-performance.js +0 -7
- package/src/types/user-performance.js.map +0 -1
- package/src/types/utils.js +0 -2
- package/src/types/validation.js +0 -2
- package/src/types/validation.js.map +0 -1
- package/src/types/vehicle-sales.js +0 -6
- package/src/types/vehicle-sales.js.map +0 -1
- package/src/types/vehicles.js +0 -98
- package/src/types/vehicles.js.map +0 -1
- package/src/utils/deliveries.test.ts +0 -50
- package/src/utils/deliveries.ts +0 -13
- package/src/utils/leasing.js +0 -6
- package/src/utils/leasing.js.map +0 -1
- package/src/utils/opportunities.js +0 -48
- package/src/utils/opportunities.js.map +0 -1
package/lib/types/quotes.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AttachmentValue } from '@bisondesk/commons-sdk/types';
|
|
1
|
+
import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';
|
|
2
2
|
import { OpportunityType } from '../constants.js';
|
|
3
|
-
import { SalesDeliveryType } from './deliveries.js';
|
|
4
3
|
import { CustomLeasingQuoteExtraInput, CustomSalesQuoteExtraInput, LeasingDeliveryPackageInput, LeasingQuoteExtraInput, SalesQuoteExtraInput } from './leasing-settings.js';
|
|
5
4
|
import { MatchingRuleValue } from './roi-ratings.js';
|
|
6
5
|
import { PricePercentageMode } from './utils.js';
|
|
@@ -25,6 +24,21 @@ export declare enum QuoteMetricsScore {
|
|
|
25
24
|
NEUTRAL = "neutral",
|
|
26
25
|
GOOD = "good"
|
|
27
26
|
}
|
|
27
|
+
export declare enum DeliveryTypes {
|
|
28
|
+
PICK_UP = "pickUp",
|
|
29
|
+
ADDRESS = "address",
|
|
30
|
+
PORT = "port",
|
|
31
|
+
PORT_AND_SHIP = "portAndShip"
|
|
32
|
+
}
|
|
33
|
+
export declare enum SpoilerInfo {
|
|
34
|
+
MOUNT = "mount",
|
|
35
|
+
UNMOUNT = "unmount",
|
|
36
|
+
NO_ACTION = "noAction"
|
|
37
|
+
}
|
|
38
|
+
export declare enum TransportationMode {
|
|
39
|
+
BY_ROAD = "byRoad",
|
|
40
|
+
ON_LOW_BED = "onLowBed"
|
|
41
|
+
}
|
|
28
42
|
export declare enum SelfFinancingType {
|
|
29
43
|
OWN_FINANCING = "own_financing",
|
|
30
44
|
ALREADY_FINANCED = "already_financed"
|
|
@@ -119,6 +133,45 @@ export type LeasingCalculatorInput = BaseQuoteCalculatorInput & {
|
|
|
119
133
|
extras: LeasingQuoteExtraInput[];
|
|
120
134
|
customRequests: CustomLeasingQuoteExtraInput[];
|
|
121
135
|
};
|
|
136
|
+
type BaseDeliveryType = {
|
|
137
|
+
agreedPrice: string;
|
|
138
|
+
spoiler?: SpoilerInfo;
|
|
139
|
+
stackingVehicleNeeded?: boolean;
|
|
140
|
+
detailsStacking?: string;
|
|
141
|
+
};
|
|
142
|
+
export type PickUpDeliveryType = BaseDeliveryType & {
|
|
143
|
+
type: DeliveryTypes.PICK_UP;
|
|
144
|
+
urgent: boolean;
|
|
145
|
+
transportationMode?: TransportationMode;
|
|
146
|
+
detailsBorderCrossing?: string;
|
|
147
|
+
technicalControlNeeded: boolean;
|
|
148
|
+
insuranceNeeded: boolean;
|
|
149
|
+
transitPlateBelgiumNeeded: boolean;
|
|
150
|
+
transitPlateAustriaNeeded: boolean;
|
|
151
|
+
licensePlateNeeded: boolean;
|
|
152
|
+
dateOfPickUpByCustomer?: string;
|
|
153
|
+
};
|
|
154
|
+
export type AddressDeliveryType = BaseDeliveryType & {
|
|
155
|
+
type: DeliveryTypes.ADDRESS;
|
|
156
|
+
address: LocationValue;
|
|
157
|
+
distanceKm: string;
|
|
158
|
+
technicalControlNeeded: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type PortDeliverytype = BaseDeliveryType & {
|
|
161
|
+
type: DeliveryTypes.PORT | DeliveryTypes.PORT_AND_SHIP;
|
|
162
|
+
portOriginId: string;
|
|
163
|
+
portDestination?: string;
|
|
164
|
+
shippingCompany?: string;
|
|
165
|
+
portToPortCostPrice: string;
|
|
166
|
+
parkToPortCostPrice?: string;
|
|
167
|
+
portToPortMargin: string;
|
|
168
|
+
ets?: string;
|
|
169
|
+
eta?: string;
|
|
170
|
+
etd?: string;
|
|
171
|
+
shipClosingDate?: string;
|
|
172
|
+
bookingRef?: string;
|
|
173
|
+
deliveryLocation?: string;
|
|
174
|
+
};
|
|
122
175
|
export type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {
|
|
123
176
|
vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;
|
|
124
177
|
extras: SalesQuoteExtraInput[];
|
|
@@ -132,7 +185,7 @@ export type SalesCalculatorInput = BaseQuoteCalculatorInput & {
|
|
|
132
185
|
internetPrice?: string;
|
|
133
186
|
comissionCost: string;
|
|
134
187
|
};
|
|
135
|
-
delivery?:
|
|
188
|
+
delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;
|
|
136
189
|
extras: SalesQuoteExtraInput[];
|
|
137
190
|
customRequests: CustomSalesQuoteExtraInput[];
|
|
138
191
|
financing?: {
|
|
@@ -329,6 +382,14 @@ export type CalculatorSalesIO = {
|
|
|
329
382
|
rating?: MatchingRuleValue;
|
|
330
383
|
};
|
|
331
384
|
export type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;
|
|
385
|
+
export type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {
|
|
386
|
+
addressLine1: string;
|
|
387
|
+
city: string;
|
|
388
|
+
};
|
|
389
|
+
export type DeliveryRoutesRequest = {
|
|
390
|
+
origin: DeliveryLocationValue;
|
|
391
|
+
destination: DeliveryLocationValue;
|
|
392
|
+
};
|
|
332
393
|
export type NewQuoteValidator = {
|
|
333
394
|
userId: string;
|
|
334
395
|
countryCode: string;
|
|
@@ -341,6 +402,5 @@ export type QuoteValidator = NewQuoteValidator & {
|
|
|
341
402
|
export type QuoteValidatorUpdate = {
|
|
342
403
|
canValidateOwn: boolean;
|
|
343
404
|
};
|
|
344
|
-
export
|
|
345
|
-
export { SalesDeliveryTypes as DeliveryTypes, SpoilerInfo, TransportationMode, } from './deliveries.js';
|
|
405
|
+
export {};
|
|
346
406
|
//# sourceMappingURL=quotes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.d.ts","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,MAAM,WAAW;CAClB;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,gBAAgB,oBAAoB;IACpC,gBAAgB,oBAAoB;CACrC;AAED,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AACD,oBAAY,iBAAiB;IAC3B,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;CACtC;AAED,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE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AAE,iBAAiB,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,GAAG,MAAM,CAAC,GAAG;IACjF,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,WAAW,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAC/C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC"}
|
package/lib/types/quotes.js
CHANGED
|
@@ -22,10 +22,27 @@ export var QuoteMetricsScore;
|
|
|
22
22
|
QuoteMetricsScore["NEUTRAL"] = "neutral";
|
|
23
23
|
QuoteMetricsScore["GOOD"] = "good";
|
|
24
24
|
})(QuoteMetricsScore || (QuoteMetricsScore = {}));
|
|
25
|
+
export var DeliveryTypes;
|
|
26
|
+
(function (DeliveryTypes) {
|
|
27
|
+
DeliveryTypes["PICK_UP"] = "pickUp";
|
|
28
|
+
DeliveryTypes["ADDRESS"] = "address";
|
|
29
|
+
DeliveryTypes["PORT"] = "port";
|
|
30
|
+
DeliveryTypes["PORT_AND_SHIP"] = "portAndShip";
|
|
31
|
+
})(DeliveryTypes || (DeliveryTypes = {}));
|
|
32
|
+
export var SpoilerInfo;
|
|
33
|
+
(function (SpoilerInfo) {
|
|
34
|
+
SpoilerInfo["MOUNT"] = "mount";
|
|
35
|
+
SpoilerInfo["UNMOUNT"] = "unmount";
|
|
36
|
+
SpoilerInfo["NO_ACTION"] = "noAction";
|
|
37
|
+
})(SpoilerInfo || (SpoilerInfo = {}));
|
|
38
|
+
export var TransportationMode;
|
|
39
|
+
(function (TransportationMode) {
|
|
40
|
+
TransportationMode["BY_ROAD"] = "byRoad";
|
|
41
|
+
TransportationMode["ON_LOW_BED"] = "onLowBed";
|
|
42
|
+
})(TransportationMode || (TransportationMode = {}));
|
|
25
43
|
export var SelfFinancingType;
|
|
26
44
|
(function (SelfFinancingType) {
|
|
27
45
|
SelfFinancingType["OWN_FINANCING"] = "own_financing";
|
|
28
46
|
SelfFinancingType["ALREADY_FINANCED"] = "already_financed";
|
|
29
47
|
})(SelfFinancingType || (SelfFinancingType = {}));
|
|
30
|
-
export { SalesDeliveryTypes as DeliveryTypes, SpoilerInfo, TransportationMode, } from './deliveries.js';
|
|
31
48
|
//# sourceMappingURL=quotes.js.map
|
package/lib/types/quotes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,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,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0DAAqC,CAAA;AACvC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAwVD,OAAO,EACL,kBAAkB,IAAI,aAAa,EACnC,WAAW,EACX,kBAAkB,GACnB,MAAM,iBAAiB,CAAC","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport { SalesDeliveryType } from './deliveries.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\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 SelfFinancingType {\n OWN_FINANCING = 'own_financing',\n ALREADY_FINANCED = 'already_financed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n alternativeCurrency?: string;\n exchangeRate?: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n vatRate: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n deliveryPackage?: LeasingQuoteExtraInput;\n settingsId: string;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n externalDelivery: boolean;\n settingsId: string;\n isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\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 /** Returnable security deposit (dépôt de garantie): VAT-free, never financed. Not the advance (`deposit`). */\n guaranteeDeposit?: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\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 internalDealBranchId?: string;\n } & (\n | { selfFinancing: true; selfFinancingType?: SelfFinancingType; financing?: undefined }\n | {\n selfFinancing: false;\n selfFinancingType?: undefined;\n financing?: { bankAccountOrganizationId: string; amount: string };\n }\n );\n taxes: {\n yearlyRoadTax: boolean;\n yearlyRoadTaxCustomAmount: string;\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 initialFractionPercentage: string;\n insuredAmount?: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n premiumPrice?: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: SalesDeliveryType;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n financing?: {\n organizationId: string;\n };\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice?: number;\n internetPrice?: number;\n premiumPrice?: number;\n agreedPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n /** Portion of beforeDelivery that is the returnable guarantee deposit (VAT-free, not financed). */\n guaranteeDeposit?: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: 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 profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n vehicle: {\n purchasePrice: string; //incl vat\n agreedPrice: string; // incl vat\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n profitOverMin?: {\n // deprecated\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\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 type: OpportunityType.NEW_TRAILER | OpportunityType.NEW_TRAILER_NEW_PRODUCTION;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type:\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_OUTSOURCING\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_INSOURCING;\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 technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n externalQuote?: boolean;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: 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 NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n\nexport type {\n AddressDeliveryType,\n DeliveryLocationValue,\n DeliveryRoutesRequest,\n PickUpDeliveryType,\n PortDeliverytype,\n} from './deliveries.js';\n/** @deprecated Import delivery types from ./deliveries.js. */\nexport {\n SalesDeliveryTypes as DeliveryTypes,\n SpoilerInfo,\n TransportationMode,\n} from './deliveries.js';\n"]}
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,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,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,8CAA6B,CAAA;AAC/B,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,qCAAsB,CAAA;AACxB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,wCAAkB,CAAA;IAClB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0DAAqC,CAAA;AACvC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B","sourcesContent":["import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\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 PORT_AND_SHIP = 'portAndShip',\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\nexport enum SelfFinancingType {\n OWN_FINANCING = 'own_financing',\n ALREADY_FINANCED = 'already_financed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n alternativeCurrency?: string;\n exchangeRate?: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n vatRate: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n deliveryPackage?: LeasingQuoteExtraInput;\n settingsId: string;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n externalDelivery: boolean;\n settingsId: string;\n isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\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 /** Returnable security deposit (dépôt de garantie): VAT-free, never financed. Not the advance (`deposit`). */\n guaranteeDeposit?: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\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 internalDealBranchId?: string;\n } & (\n | { selfFinancing: true; selfFinancingType?: SelfFinancingType; financing?: undefined }\n | {\n selfFinancing: false;\n selfFinancingType?: undefined;\n financing?: { bankAccountOrganizationId: string; amount: string };\n }\n );\n taxes: {\n yearlyRoadTax: boolean;\n yearlyRoadTaxCustomAmount: string;\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 initialFractionPercentage: string;\n insuredAmount?: string;\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 technicalControlNeeded: boolean;\n};\n\nexport type PortDeliverytype = BaseDeliveryType & {\n type: DeliveryTypes.PORT | DeliveryTypes.PORT_AND_SHIP;\n portOriginId: string;\n portDestination?: string;\n shippingCompany?: string;\n portToPortCostPrice: string;\n parkToPortCostPrice?: string;\n portToPortMargin: string;\n ets?: string;\n eta?: string;\n etd?: string;\n shipClosingDate?: string;\n bookingRef?: string;\n deliveryLocation?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n premiumPrice?: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n financing?: {\n organizationId: string;\n };\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice?: number;\n internetPrice?: number;\n premiumPrice?: number;\n agreedPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n /** Portion of beforeDelivery that is the returnable guarantee deposit (VAT-free, not financed). */\n guaranteeDeposit?: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: 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 profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n vehicle: {\n purchasePrice: string; //incl vat\n agreedPrice: string; // incl vat\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n profitOverMin?: {\n // deprecated\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\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 type: OpportunityType.NEW_TRAILER | OpportunityType.NEW_TRAILER_NEW_PRODUCTION;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type:\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_OUTSOURCING\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_INSOURCING;\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 technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n externalQuote?: boolean;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: 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 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 NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n"]}
|
package/lib/types/templates.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { EmailContent, EmailRequest } from '@bisondesk/commons-sdk/messages';
|
|
2
1
|
export type TemplateContent = {
|
|
3
2
|
subject: string;
|
|
4
3
|
content: {
|
|
@@ -31,25 +30,4 @@ export type UpdateTemplateInfoRequest = {
|
|
|
31
30
|
name: string;
|
|
32
31
|
tags?: any;
|
|
33
32
|
};
|
|
34
|
-
export type CodeEmailTemplateInfo = Pick<TemplateInfo, 'id' | 'name' | 'countries'> & {
|
|
35
|
-
format: 'react-email';
|
|
36
|
-
};
|
|
37
|
-
export type TemplateCatalogueEntry = (TemplateInfo & {
|
|
38
|
-
format: 'html';
|
|
39
|
-
}) | CodeEmailTemplateInfo;
|
|
40
|
-
export type TemplateEmailRequest<T extends Record<string, unknown> = Record<string, unknown>> = Omit<EmailRequest, 'subject' | 'body'> & {
|
|
41
|
-
templateId: string;
|
|
42
|
-
country: string;
|
|
43
|
-
fallbackCountry?: string;
|
|
44
|
-
data: T;
|
|
45
|
-
subject?: string;
|
|
46
|
-
};
|
|
47
|
-
export type EmailTemplatePreviewRequest = {
|
|
48
|
-
data?: Record<string, unknown>;
|
|
49
|
-
subject?: string;
|
|
50
|
-
};
|
|
51
|
-
export type EmailTemplatePreview = {
|
|
52
|
-
content: EmailContent;
|
|
53
|
-
data: Record<string, unknown>;
|
|
54
|
-
};
|
|
55
33
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["export type TemplateContent = {\n subject: string;\n content: {\n html: string;\n design: any;\n };\n};\n\nexport type NewTemplateRequest = {\n id?: string;\n country: string;\n tags?: any;\n name: string;\n} & TemplateContent;\n\nexport type Template = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n tags?: any;\n\n country: string;\n name: string;\n} & TemplateContent;\n\nexport type TemplateInfo = {\n id: string;\n countries: string[];\n modifiedAt: string;\n name: string;\n tags?: any;\n};\n\nexport type UpdateTemplateInfoRequest = {\n name: string;\n tags?: any;\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GPSCoord, NextList, PaginatedList } from '@bisondesk/commons-sdk/types';
|
|
2
2
|
import { Organization } from './crm.js';
|
|
3
|
-
import { AddressDeliveryType, PickUpDeliveryType, PortDeliverytype, PurchaseDeliveryType, SalesDeliveryTypes } from './deliveries.js';
|
|
4
3
|
import { BaseEvent } from './internal-events.js';
|
|
5
4
|
import { Opportunity, OpportunityPaymentStatus } from './opportunities.js';
|
|
5
|
+
import { AddressDeliveryType, DeliveryTypes, PickUpDeliveryType, PortDeliverytype } from './quotes.js';
|
|
6
6
|
import { BaseSearchRequest, SortOrder } from './search.js';
|
|
7
7
|
import { DataRecord, ReferenceData } from './utils.js';
|
|
8
8
|
import { Vehicle, VehiclePurchase } from './vehicles.js';
|
|
@@ -31,8 +31,14 @@ export declare enum TransportPriority {
|
|
|
31
31
|
High = "HIGH",
|
|
32
32
|
Urgent = "URGENT"
|
|
33
33
|
}
|
|
34
|
+
export declare const TransportSalesDeliveryType: {
|
|
35
|
+
readonly Address: DeliveryTypes.ADDRESS;
|
|
36
|
+
readonly Port: DeliveryTypes.PORT;
|
|
37
|
+
readonly PortAndShip: DeliveryTypes.PORT_AND_SHIP;
|
|
38
|
+
readonly PickUp: DeliveryTypes.PICK_UP;
|
|
39
|
+
};
|
|
34
40
|
export type TransportPickUpDeliveryType = Omit<PickUpDeliveryType, 'dateOfPickUpByCustomer'>;
|
|
35
|
-
type
|
|
41
|
+
export type TransportSalesDeliveryType = (PortDeliverytype | AddressDeliveryType | TransportPickUpDeliveryType) & {
|
|
36
42
|
cleaningNeeded?: boolean;
|
|
37
43
|
driver?: string;
|
|
38
44
|
transportCompany?: string;
|
|
@@ -40,13 +46,13 @@ type TransportDeliveryExtras = {
|
|
|
40
46
|
adminCost?: string;
|
|
41
47
|
stackingVehicleCostPrice?: string;
|
|
42
48
|
};
|
|
43
|
-
export type
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
export type TransportPurchaseDeliveryType = AddressDeliveryType & {
|
|
50
|
+
cleaningNeeded?: boolean;
|
|
51
|
+
driver?: string;
|
|
52
|
+
transportCompany?: string;
|
|
53
|
+
date?: string;
|
|
54
|
+
adminCost?: string;
|
|
55
|
+
stackingVehicleCostPrice?: string;
|
|
50
56
|
};
|
|
51
57
|
export type Transport = {
|
|
52
58
|
id: string;
|
|
@@ -102,7 +108,6 @@ export declare enum TransportActions {
|
|
|
102
108
|
SetBookingRef = "set_booking_ref"
|
|
103
109
|
}
|
|
104
110
|
export type TransportUpdate = {
|
|
105
|
-
type?: TransportPurchaseType;
|
|
106
111
|
delivery?: TransportSalesDeliveryType | TransportPurchaseDeliveryType;
|
|
107
112
|
notes?: string | null;
|
|
108
113
|
adminApproved?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.d.ts","sourceRoot":"/","sources":["types/transports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"transports.d.ts","sourceRoot":"/","sources":["types/transports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEzD,oBAAY,aAAa;IACvB,cAAc,qBAAqB;IACnC,eAAe,sBAAsB;IACrC,YAAY,kBAAkB;CAC/B;AAGD,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,cAAc,GAAG,aAAa,CAAC,eAAe,CAAC;AAEjG,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,EAGzD,CAAC;AAEF,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb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IAC1C,MAAM,EAAE,qBAAqB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,GAAG;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC,eAAe,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC,CAAC;CACjF,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,QAAQ,CAAC,qBAAqB,EAAE,aAAa,CAAC,EAC9C,WAAW,CACZ,GAAG;IACF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACjD,CAAC"}
|
package/lib/types/transports.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeliveryTypes, } from './quotes.js';
|
|
2
2
|
export var TransportType;
|
|
3
3
|
(function (TransportType) {
|
|
4
4
|
TransportType["PurchasePickUp"] = "PURCHASE_PICK_UP";
|
|
@@ -40,10 +40,10 @@ export var TransportPriority;
|
|
|
40
40
|
TransportPriority["Urgent"] = "URGENT";
|
|
41
41
|
})(TransportPriority || (TransportPriority = {}));
|
|
42
42
|
export const TransportSalesDeliveryType = {
|
|
43
|
-
Address:
|
|
44
|
-
Port:
|
|
45
|
-
PortAndShip:
|
|
46
|
-
PickUp:
|
|
43
|
+
Address: DeliveryTypes.ADDRESS,
|
|
44
|
+
Port: DeliveryTypes.PORT,
|
|
45
|
+
PortAndShip: DeliveryTypes.PORT_AND_SHIP,
|
|
46
|
+
PickUp: DeliveryTypes.PICK_UP,
|
|
47
47
|
};
|
|
48
48
|
export var TransportWarningCode;
|
|
49
49
|
(function (TransportWarningCode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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EAAE,kBAAkB,CAAC,OAAO;IACnC,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,WAAW,EAAE,kBAAkB,CAAC,aAAa;IAC7C,MAAM,EAAE,kBAAkB,CAAC,OAAO;CAC1B,CAAC;AAiDX,MAAM,CAAN,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC9B,kFAA0D,CAAA;AAC5D,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,QAE/B;AAgBD,MAAM,CAAN,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAE1B,gDAA4B,CAAA;IAC5B,0CAAsB,CAAA;IAEtB,gDAA4B,CAAA;IAE5B,4CAAwB,CAAA;IACxB,gDAA4B,CAAA;IAC5B,qDAAiC,CAAA;AACnC,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,QAU3B;AAyCD,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,iEAAuC,CAAA;IACvC,kDAAwB,CAAA;IACxB,6EAAmD,CAAA;IACnD,uEAA6C,CAAA;IAC7C,qEAA2C,CAAA;IAC3C,+DAAqC,CAAA;AACvC,CAAC,EAPW,sBAAsB,KAAtB,sBAAsB,QAOjC;AAcD,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,+DAAoC,CAAA;IACpC,qDAA0B,CAAA;IAC1B,qDAA0B,CAAA;AAC5B,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","sourcesContent":["import { GPSCoord, NextList, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { Organization } from './crm.js';\nimport {\n AddressDeliveryType,\n PickUpDeliveryType,\n PortDeliverytype,\n PurchaseDeliveryType,\n SalesDeliveryTypes,\n} from './deliveries.js';\nimport { BaseEvent } from './internal-events.js';\nimport { Opportunity, OpportunityPaymentStatus } from './opportunities.js';\nimport { BaseSearchRequest, SortOrder } from './search.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { Vehicle, VehiclePurchase } from './vehicles.js';\n\nexport enum TransportType {\n PurchasePickUp = 'PURCHASE_PICK_UP',\n PurchaseDropOff = 'PURCHASE_DROP_OFF',\n SaleDelivery = 'SALE_DELIVERY',\n}\n\n/** Both inbound journeys, whoever drives them. Mirrors the purchase's own delivery type. */\nexport type TransportPurchaseType = TransportType.PurchasePickUp | TransportType.PurchaseDropOff;\n\nexport const TransportPurchaseTypes: TransportPurchaseType[] = [\n TransportType.PurchasePickUp,\n TransportType.PurchaseDropOff,\n];\n\nexport enum TransportStatus {\n Todo = 'TODO',\n Planning = 'PLANNING',\n Ready = 'READY',\n ScheduledExternal = 'SCHEDULED_EXTERNAL',\n OngoingInternal = 'ONGOING_INTERNAL',\n OngoingShip = 'ONGOING_SHIP',\n Done = 'DONE',\n}\n\nexport const TransportStatusOrder: TransportStatus[] = [\n TransportStatus.Todo,\n TransportStatus.Planning,\n TransportStatus.Ready,\n TransportStatus.ScheduledExternal,\n TransportStatus.OngoingInternal,\n TransportStatus.OngoingShip,\n];\n\nexport const TransportDoneColumnId = TransportStatus.Done;\n\nexport const TransportKanbanEndColumns: TransportStatus[] = [TransportDoneColumnId];\nexport const TransportKanbanColumns: TransportStatus[] = [\n ...TransportStatusOrder,\n ...TransportKanbanEndColumns,\n];\n\nexport enum TransportPriority {\n Normal = 'NORMAL',\n High = 'HIGH',\n Urgent = 'URGENT',\n}\n\n/**\n * The customer collects the vehicle. Nothing is driven anywhere, but the papers still have to be\n * arranged and paid for — transit plates, technical control, insurance — which is why it is a\n * delivery type administration reviews rather than the absence of one.\n *\n * `dateOfPickUpByCustomer` is dropped from the quote's shape: the transport's own `date` is the\n * collection day, and two fields for one date only ever disagree.\n */\nexport type TransportPickUpDeliveryType = Omit<PickUpDeliveryType, 'dateOfPickUpByCustomer'>;\n\ntype TransportDeliveryExtras = {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type TransportSalesDeliveryType = (\n | PortDeliverytype\n | AddressDeliveryType\n | TransportPickUpDeliveryType\n) &\n TransportDeliveryExtras;\n\nexport type TransportPurchaseDeliveryType = PurchaseDeliveryType & TransportDeliveryExtras;\n\n/** @deprecated Use SalesDeliveryTypes from ./deliveries.js. */\nexport const TransportSalesDeliveryType = {\n Address: SalesDeliveryTypes.ADDRESS,\n Port: SalesDeliveryTypes.PORT,\n PortAndShip: SalesDeliveryTypes.PORT_AND_SHIP,\n PickUp: SalesDeliveryTypes.PICK_UP,\n} as const;\n\nexport type Transport = {\n id: string;\n vehicleId: string;\n opportunityId?: string;\n\n status: TransportStatus;\n priority: TransportPriority;\n\n // administrative fields\n adminApproved: boolean;\n adminApprovedAt?: string;\n adminApprovedBy?: string;\n transportWithoutPayment?: boolean;\n notes?: string;\n\n totals: {\n totalRetailAmountExclVat: string;\n totalCostExclVat: string;\n estimatedTotalCostExclVat?: string;\n };\n\n log: Array<{\n status: TransportStatus;\n completedAt: string;\n completedBy: string;\n }>;\n\n doneAt?: string;\n doneBy?: string;\n canceledAt?: string;\n canceledBy?: string;\n\n createdAt: string;\n createdBy: string;\n updatedAt: string;\n updatedBy: string;\n} & (\n | {\n type: TransportPurchaseType;\n delivery: TransportPurchaseDeliveryType;\n }\n | {\n type: TransportType.SaleDelivery;\n delivery: TransportSalesDeliveryType;\n }\n);\n\nexport enum TransportWarningCode {\n PurchaseLogisticsNotReady = 'purchase_logistics_not_ready',\n}\n\nexport type TransportWarning = {\n code: TransportWarningCode;\n details?: Record<string, string | number | boolean>;\n};\n\nexport type TransportCost = Pick<Transport, 'totals'>;\n\nexport type TransportRecord = DataRecord<Transport>;\n\n/**\n * What a requester may change on a transport, field group by field group. The server filters an\n * update through these and returns the ones granted on the record, so the drawer disables what the\n * user cannot touch instead of deciding for itself from the user's roles.\n */\nexport enum TransportActions {\n /** The route: addresses, ports, dates, costs. */\n SetDelivery = 'set_delivery',\n SetNotes = 'set_notes',\n /** The administrative sign-off, and the clearance to move before the payment. */\n SetApproval = 'set_approval',\n /** The board column. */\n SetStatus = 'set_status',\n SetPriority = 'set_priority',\n SetBookingRef = 'set_booking_ref',\n}\n\n/**\n * Every field a write may set, in one shape. `delivery` is replaced whole when it is sent — there is\n * no partial merge into the stored one — which is why `bookingRef` rides alongside as a scalar the\n * server writes into the delivery it ends up with.\n */\nexport type TransportUpdate = {\n /** Changes the purchase method and the purchase agreement together. */\n type?: TransportPurchaseType;\n delivery?: TransportSalesDeliveryType | TransportPurchaseDeliveryType;\n notes?: string | null;\n adminApproved?: boolean;\n transportWithoutPayment?: boolean;\n status?: TransportStatus;\n priority?: TransportPriority;\n bookingRef?: string | null;\n};\n\ntype BaseTransportEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n transportId: string;\n};\n\nexport type TransportCreateEvent = BaseTransportEvent & {\n action: 'create';\n data: Transport;\n previousData?: undefined;\n};\n\nexport type TransportUpdateEvent = BaseTransportEvent & {\n action: 'update';\n data: Transport;\n previousData: Transport;\n};\n\n/** Published whenever a transport is written. Carries both sides so subscribers judge relevance. */\nexport type TransportEvent = BaseEvent & (TransportCreateEvent | TransportUpdateEvent);\n\nexport enum TransportPaymentStatus {\n PaymentNotNeeded = 'payment_not_needed',\n NoPayment = 'no_payment',\n PartialPaymentReceived = 'partial_payment_received',\n FullPaymentReceived = 'full_payment_received',\n PartialPaymentSent = 'partial_payment_sent',\n FullPaymentSent = 'full_payment_sent',\n}\n\n/**\n * Where the money stands on the record the transport serves: the customer's payments on the\n * opportunity for a sale delivery, ours to the supplier for a purchase pick-up. Denormalised at\n * indexing time so the board can show it without joining.\n */\nexport type TransportPayment = {\n status: OpportunityPaymentStatus;\n /** Only a sale delivery knows the ratio — a pick-up has milestones, not a running total. */\n percentagePaid?: string;\n};\n\n/** Which address the map pin came from, so the UI can tell an exact pin from an approximate one. */\nexport enum TransportLocationSource {\n DeliveryAddress = 'delivery_address',\n OriginPort = 'origin_port',\n OrgAddress = 'org_address',\n}\n\nexport type SearchTransport = {\n transport: Transport;\n vehicle: Vehicle;\n org: Organization;\n opportunity?: Opportunity;\n purchase: VehiclePurchase;\n tasks: {\n totalTasks: number;\n openTasks: number;\n nextDueAt?: string;\n };\n custom: {\n commercialUserIds: string[];\n warnings: TransportWarning[];\n priorityOrdinal: number;\n payment: TransportPayment;\n paymentStatus: TransportPaymentStatus;\n /**\n * Where the transport happens: the delivery address, or the origin port for a shipped delivery.\n * Denormalised into one field because the map clusters over a single geo_point, and a port\n * delivery carries no address of its own.\n *\n * Deliberately narrower than `GPSCoord`: a geo_point field rejects any key beyond lat/lon, so\n * the map zoom the coordinates picker stores must not reach the index.\n */\n location?: Pick<GPSCoord, 'lat' | 'lon'>;\n locationSource?: TransportLocationSource;\n };\n};\n\nexport type SearchTransportList = PaginatedList<SearchTransport, ReferenceData>;\n\nexport type TransportKanbanColumn = {\n status: TransportStatus;\n results: SearchTransport[];\n totalCount: number;\n};\n\nexport type MSearchTransportsKanbanColumn = {\n column: TransportKanbanColumn;\n nextToken?: string;\n};\n\nexport type KanbanTransportsSearchRequest = BaseSearchRequest & {\n nextTokens?: Record<string, string | undefined>;\n statusSortBy?: Record<TransportStatus, { fieldId: string; order: SortOrder }[]>;\n};\n\nexport type KanbanTransportsNextList = Omit<\n NextList<TransportKanbanColumn, ReferenceData>,\n 'nextToken'\n> & {\n nextTokens?: Record<string, string | undefined>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"transports.js","sourceRoot":"/","sources":["types/transports.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,aAAa,GAGd,MAAM,aAAa,CAAC;AAKrB,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oDAAmC,CAAA;IACnC,sDAAqC,CAAA;IACrC,+CAA8B,CAAA;AAChC,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAKD,MAAM,CAAC,MAAM,sBAAsB,GA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;AAVD,WAAY,gBAAgB;IAE1B,gDAA4B,CAAA;IAC5B,0CAAsB,CAAA;IAEtB,gDAA4B,CAAA;IAE5B,4CAAwB,CAAA;IACxB,gDAA4B,CAAA;IAC5B,qDAAiC,CAAA;AACnC,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,QAU3B;AAuCD,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,iEAAuC,CAAA;IACvC,kDAAwB,CAAA;IACxB,6EAAmD,CAAA;IACnD,uEAA6C,CAAA;IAC7C,qEAA2C,CAAA;IAC3C,+DAAqC,CAAA;AACvC,CAAC,EAPW,sBAAsB,KAAtB,sBAAsB,QAOjC;AAcD,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,+DAAoC,CAAA;IACpC,qDAA0B,CAAA;IAC1B,qDAA0B,CAAA;AAC5B,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","sourcesContent":["import { GPSCoord, NextList, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { Organization } from './crm.js';\nimport { BaseEvent } from './internal-events.js';\nimport { Opportunity, OpportunityPaymentStatus } from './opportunities.js';\nimport {\n AddressDeliveryType,\n DeliveryTypes,\n PickUpDeliveryType,\n PortDeliverytype,\n} from './quotes.js';\nimport { BaseSearchRequest, SortOrder } from './search.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { Vehicle, VehiclePurchase } from './vehicles.js';\n\nexport enum TransportType {\n PurchasePickUp = 'PURCHASE_PICK_UP',\n PurchaseDropOff = 'PURCHASE_DROP_OFF',\n SaleDelivery = 'SALE_DELIVERY',\n}\n\n/** Both inbound journeys, whoever drives them. Mirrors the purchase's own delivery type. */\nexport type TransportPurchaseType = TransportType.PurchasePickUp | TransportType.PurchaseDropOff;\n\nexport const TransportPurchaseTypes: TransportPurchaseType[] = [\n TransportType.PurchasePickUp,\n TransportType.PurchaseDropOff,\n];\n\nexport enum TransportStatus {\n Todo = 'TODO',\n Planning = 'PLANNING',\n Ready = 'READY',\n ScheduledExternal = 'SCHEDULED_EXTERNAL',\n OngoingInternal = 'ONGOING_INTERNAL',\n OngoingShip = 'ONGOING_SHIP',\n Done = 'DONE',\n}\n\nexport const TransportStatusOrder: TransportStatus[] = [\n TransportStatus.Todo,\n TransportStatus.Planning,\n TransportStatus.Ready,\n TransportStatus.ScheduledExternal,\n TransportStatus.OngoingInternal,\n TransportStatus.OngoingShip,\n];\n\nexport const TransportDoneColumnId = TransportStatus.Done;\n\nexport const TransportKanbanEndColumns: TransportStatus[] = [TransportDoneColumnId];\nexport const TransportKanbanColumns: TransportStatus[] = [\n ...TransportStatusOrder,\n ...TransportKanbanEndColumns,\n];\n\nexport enum TransportPriority {\n Normal = 'NORMAL',\n High = 'HIGH',\n Urgent = 'URGENT',\n}\n\nexport const TransportSalesDeliveryType = {\n Address: DeliveryTypes.ADDRESS,\n Port: DeliveryTypes.PORT,\n PortAndShip: DeliveryTypes.PORT_AND_SHIP,\n PickUp: DeliveryTypes.PICK_UP,\n} as const;\n\n/**\n * The customer collects the vehicle. Nothing is driven anywhere, but the papers still have to be\n * arranged and paid for — transit plates, technical control, insurance — which is why it is a\n * delivery type administration reviews rather than the absence of one.\n *\n * `dateOfPickUpByCustomer` is dropped from the quote's shape: the transport's own `date` is the\n * collection day, and two fields for one date only ever disagree.\n */\nexport type TransportPickUpDeliveryType = Omit<PickUpDeliveryType, 'dateOfPickUpByCustomer'>;\n\nexport type TransportSalesDeliveryType = (\n | PortDeliverytype\n | AddressDeliveryType\n | TransportPickUpDeliveryType\n) & {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type TransportPurchaseDeliveryType = AddressDeliveryType & {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type Transport = {\n id: string;\n vehicleId: string;\n opportunityId?: string;\n\n status: TransportStatus;\n priority: TransportPriority;\n\n // administrative fields\n adminApproved: boolean;\n adminApprovedAt?: string;\n adminApprovedBy?: string;\n transportWithoutPayment?: boolean;\n notes?: string;\n\n totals: {\n totalRetailAmountExclVat: string;\n totalCostExclVat: string;\n estimatedTotalCostExclVat?: string;\n };\n\n log: Array<{\n status: TransportStatus;\n completedAt: string;\n completedBy: string;\n }>;\n\n doneAt?: string;\n doneBy?: string;\n canceledAt?: string;\n canceledBy?: string;\n\n createdAt: string;\n createdBy: string;\n updatedAt: string;\n updatedBy: string;\n} & (\n | {\n type: TransportPurchaseType;\n delivery: TransportPurchaseDeliveryType;\n }\n | {\n type: TransportType.SaleDelivery;\n delivery: TransportSalesDeliveryType;\n }\n);\n\nexport enum TransportWarningCode {\n PurchaseLogisticsNotReady = 'purchase_logistics_not_ready',\n}\n\nexport type TransportWarning = {\n code: TransportWarningCode;\n details?: Record<string, string | number | boolean>;\n};\n\nexport type TransportCost = Pick<Transport, 'totals'>;\n\nexport type TransportRecord = DataRecord<Transport>;\n\n/**\n * What a requester may change on a transport, field group by field group. The server filters an\n * update through these and returns the ones granted on the record, so the drawer disables what the\n * user cannot touch instead of deciding for itself from the user's roles.\n */\nexport enum TransportActions {\n /** The route: addresses, ports, dates, costs. */\n SetDelivery = 'set_delivery',\n SetNotes = 'set_notes',\n /** The administrative sign-off, and the clearance to move before the payment. */\n SetApproval = 'set_approval',\n /** The board column. */\n SetStatus = 'set_status',\n SetPriority = 'set_priority',\n SetBookingRef = 'set_booking_ref',\n}\n\n/**\n * Every field a write may set, in one shape. `delivery` is replaced whole when it is sent — there is\n * no partial merge into the stored one — which is why `bookingRef` rides alongside as a scalar the\n * server writes into the delivery it ends up with.\n */\nexport type TransportUpdate = {\n delivery?: TransportSalesDeliveryType | TransportPurchaseDeliveryType;\n notes?: string | null;\n adminApproved?: boolean;\n transportWithoutPayment?: boolean;\n status?: TransportStatus;\n priority?: TransportPriority;\n bookingRef?: string | null;\n};\n\ntype BaseTransportEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n transportId: string;\n};\n\nexport type TransportCreateEvent = BaseTransportEvent & {\n action: 'create';\n data: Transport;\n previousData?: undefined;\n};\n\nexport type TransportUpdateEvent = BaseTransportEvent & {\n action: 'update';\n data: Transport;\n previousData: Transport;\n};\n\n/** Published whenever a transport is written. Carries both sides so subscribers judge relevance. */\nexport type TransportEvent = BaseEvent & (TransportCreateEvent | TransportUpdateEvent);\n\nexport enum TransportPaymentStatus {\n PaymentNotNeeded = 'payment_not_needed',\n NoPayment = 'no_payment',\n PartialPaymentReceived = 'partial_payment_received',\n FullPaymentReceived = 'full_payment_received',\n PartialPaymentSent = 'partial_payment_sent',\n FullPaymentSent = 'full_payment_sent',\n}\n\n/**\n * Where the money stands on the record the transport serves: the customer's payments on the\n * opportunity for a sale delivery, ours to the supplier for a purchase pick-up. Denormalised at\n * indexing time so the board can show it without joining.\n */\nexport type TransportPayment = {\n status: OpportunityPaymentStatus;\n /** Only a sale delivery knows the ratio — a pick-up has milestones, not a running total. */\n percentagePaid?: string;\n};\n\n/** Which address the map pin came from, so the UI can tell an exact pin from an approximate one. */\nexport enum TransportLocationSource {\n DeliveryAddress = 'delivery_address',\n OriginPort = 'origin_port',\n OrgAddress = 'org_address',\n}\n\nexport type SearchTransport = {\n transport: Transport;\n vehicle: Vehicle;\n org: Organization;\n opportunity?: Opportunity;\n purchase: VehiclePurchase;\n tasks: {\n totalTasks: number;\n openTasks: number;\n nextDueAt?: string;\n };\n custom: {\n commercialUserIds: string[];\n warnings: TransportWarning[];\n priorityOrdinal: number;\n payment: TransportPayment;\n paymentStatus: TransportPaymentStatus;\n /**\n * Where the transport happens: the delivery address, or the origin port for a shipped delivery.\n * Denormalised into one field because the map clusters over a single geo_point, and a port\n * delivery carries no address of its own.\n *\n * Deliberately narrower than `GPSCoord`: a geo_point field rejects any key beyond lat/lon, so\n * the map zoom the coordinates picker stores must not reach the index.\n */\n location?: Pick<GPSCoord, 'lat' | 'lon'>;\n locationSource?: TransportLocationSource;\n };\n};\n\nexport type SearchTransportList = PaginatedList<SearchTransport, ReferenceData>;\n\nexport type TransportKanbanColumn = {\n status: TransportStatus;\n results: SearchTransport[];\n totalCount: number;\n};\n\nexport type MSearchTransportsKanbanColumn = {\n column: TransportKanbanColumn;\n nextToken?: string;\n};\n\nexport type KanbanTransportsSearchRequest = BaseSearchRequest & {\n nextTokens?: Record<string, string | undefined>;\n statusSortBy?: Record<TransportStatus, { fieldId: string; order: SortOrder }[]>;\n};\n\nexport type KanbanTransportsNextList = Omit<\n NextList<TransportKanbanColumn, ReferenceData>,\n 'nextToken'\n> & {\n nextTokens?: Record<string, string | undefined>;\n};\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { LocationValue } from '@bisondesk/commons-sdk/locations';
|
|
2
2
|
import { Organization } from './crm.js';
|
|
3
|
-
import { SalesDeliveryType } from './deliveries.js';
|
|
4
3
|
import { BaseEvent } from './internal-events.js';
|
|
5
4
|
import { Opportunity, VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';
|
|
6
|
-
import { Quote } from './quotes.js';
|
|
5
|
+
import { DeliveryTypes, Quote } from './quotes.js';
|
|
7
6
|
import { DataRecord } from './utils.js';
|
|
8
7
|
export declare enum VehicleSaleInfoActions {
|
|
9
8
|
VIEW_COSTS = "canSeeCosts",
|
|
@@ -29,7 +28,7 @@ export type VehicleSaleInfoBff = {
|
|
|
29
28
|
client?: Organization;
|
|
30
29
|
delivery?: {
|
|
31
30
|
address?: LocationValue;
|
|
32
|
-
type:
|
|
31
|
+
type: DeliveryTypes;
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
34
|
type BaseExternalVehicleSale = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle-sales.d.ts","sourceRoot":"/","sources":["types/vehicle-sales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"vehicle-sales.d.ts","sourceRoot":"/","sources":["types/vehicle-sales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,oBAAY,sBAAsB;IAChC,UAAU,gBAAgB;IAC1B,aAAa,mBAAmB;CACjC;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,qBAAqB,CAAC;IAClC,cAAc,EAAE,0BAA0B,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IAClC,eAAe,CAAC,EAAE;QAChB,WAAW,EAAE,WAAW,CAAC;QACzB,WAAW,EAAE,KAAK,CAAC;KACpB,CAAC;IACF,YAAY,CAA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/","sources":["types/vehicle-sales.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,oDAA0B,CAAA;IAC1B,0DAAgC,CAAA;AAClC,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC","sourcesContent":["import { LocationValue } from '@bisondesk/commons-sdk/locations';\nimport { Organization } from './crm.js';\nimport { BaseEvent } from './internal-events.js';\nimport { Opportunity, VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';\nimport { DeliveryTypes, Quote } from './quotes.js';\nimport { DataRecord } from './utils.js';\n\nexport enum VehicleSaleInfoActions {\n VIEW_COSTS = 'canSeeCosts',\n VIEW_CUSTOMER = 'canSeeCustomer',\n}\n\nexport type VehicleSaleInfo = {\n externalSaleId?: string;\n opportunityId?: string;\n sold: true;\n soldAt?: string;\n soldBy?: string;\n sellers: string[];\n dealStatus: VehicleSaleDealStatus;\n logisticStatus: VehicleSaleLogisticsStatus;\n};\n\nexport type VehicleSaleInfoBff = {\n info: DataRecord<VehicleSaleInfo>;\n opportunitySale?: {\n opportunity: Opportunity;\n activeQuote: Quote;\n };\n externalSale?: ExternalVehicleSale;\n client?: Organization;\n delivery?: {\n address?: LocationValue;\n type: DeliveryTypes;\n };\n};\n\ntype BaseExternalVehicleSale = {\n log?: {\n deliveredDate?: string;\n deliveredReporter?: string;\n saleAgreedDate?: string;\n saleAgreedReporter?: string;\n firstPaymentReceivedDate?: string;\n firstPaymentReceivedReporter?: string;\n fullPaymentReceivedDate?: string;\n fullPaymentReceivedReporter?: string;\n deletedDate?: string;\n deletedReporter?: string;\n };\n source: 'HDMS' | 'Hexon' | 'Bisondesk';\n deleted?: boolean;\n status: VehicleSaleDealStatus;\n vehicleId: string;\n saleAmount?: number;\n totalRevenue?: number;\n vatPercentage?: number;\n logisticsStatus: VehicleSaleLogisticsStatus;\n saleAmountTaxable?: number;\n organizationSummary?: {\n contactId: string;\n organizationId: string;\n };\n deal?: {\n internalTransportCost?: number;\n externalTransportCost?: number;\n internalGarageCost?: number;\n externalGarageCost?: number;\n carwashCost?: number;\n spoilerMountingCost?: number;\n loadStackCost?: number;\n otherCosts?: number;\n };\n};\n\nexport type ExternalVehicleSale = BaseExternalVehicleSale & {\n id: string;\n createdAt: string;\n createdBy: string;\n};\n\nexport type NewExternalVehicleSale = BaseExternalVehicleSale;\n\nexport type ExternalVehicleSaleEvent = BaseEvent &\n (\n | ExternalVehicleSaleCreateEvent\n | ExternalVehicleSaleUpdateEvent\n | ExternalVehicleSaleDeleteEvent\n );\n\ntype BaseExternalVehicleSaleEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type ExternalVehicleSaleCreateEvent = BaseExternalVehicleSaleEvent & {\n action: 'create';\n data: ExternalVehicleSale;\n previousData?: undefined;\n};\n\nexport type ExternalVehicleSaleUpdateEvent = BaseExternalVehicleSaleEvent & {\n action: 'update';\n data: ExternalVehicleSale;\n previousData: ExternalVehicleSale;\n};\n\nexport type ExternalVehicleSaleDeleteEvent = BaseExternalVehicleSaleEvent & {\n action: 'delete';\n data: undefined;\n previousData?: ExternalVehicleSale;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"/","sources":["utils/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAoB5D,eAAO,MAAM,mBAAmB,cACnB,MAAM,GAAG,SAAS,UACtB,QAAQ,EAAE,KAChB,OAMF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AppRoles } from '@bisondesk/commons-sdk/constants';
|
|
2
|
+
import { addMonths, isBefore } from 'date-fns';
|
|
3
|
+
const ORG_IDENTITY_LOCK_MONTHS = 1;
|
|
4
|
+
const ORG_IDENTITY_EDIT_ROLES = [
|
|
5
|
+
AppRoles.Administrative,
|
|
6
|
+
AppRoles.GeneralManager,
|
|
7
|
+
AppRoles.Admin,
|
|
8
|
+
];
|
|
9
|
+
export const isOrgIdentityLocked = (createdAt, roles = []) => {
|
|
10
|
+
if (createdAt == null || roles.some((role) => ORG_IDENTITY_EDIT_ROLES.includes(role))) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return isBefore(addMonths(new Date(createdAt), ORG_IDENTITY_LOCK_MONTHS), new Date());
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"/","sources":["utils/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,MAAM,uBAAuB,GAAe;IAC1C,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,KAAK;CACf,CAAC;AAWF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,SAA6B,EAC7B,KAAK,GAAe,EAAE,EACb,EAAE;IACX,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACtF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,wBAAwB,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;AACxF,CAAC,CAAC","sourcesContent":["import { AppRoles } from '@bisondesk/commons-sdk/constants';\nimport { addMonths, isBefore } from 'date-fns';\n\nconst ORG_IDENTITY_LOCK_MONTHS = 1;\n\nconst ORG_IDENTITY_EDIT_ROLES: AppRoles[] = [\n AppRoles.Administrative,\n AppRoles.GeneralManager,\n AppRoles.Admin,\n];\n\n/**\n * An organization's name and VAT number are its legal identity: the values invoices and contracts\n * are issued against. They stay open for correction right after creation, then freeze for everyone\n * except ORG_IDENTITY_EDIT_ROLES — by then they are already printed on legal documents.\n *\n * Shared so the server guard and the form's disabled state read one rule. Fails open on a missing\n * createdAt: the org update path doubles as a create path for HyperDMS, and an org with no stored\n * date must not be frozen out of its own first write.\n */\nexport const isOrgIdentityLocked = (\n createdAt: string | undefined,\n roles: AppRoles[] = [],\n): boolean => {\n if (createdAt == null || roles.some((role) => ORG_IDENTITY_EDIT_ROLES.includes(role))) {\n return false;\n }\n\n return isBefore(addMonths(new Date(createdAt), ORG_IDENTITY_LOCK_MONTHS), new Date());\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Opportunity } from '../types/opportunities.js';
|
|
2
2
|
import { SearchTransport, Transport } from '../types/transports.js';
|
|
3
3
|
import { VehiclePurchase } from '../types/vehicles.js';
|
|
4
|
-
export declare const isPurchaseTransport: (transport:
|
|
4
|
+
export declare const isPurchaseTransport: (transport: Transport) => boolean;
|
|
5
5
|
export declare const isTransportCompleted: (transport: Transport, context: {
|
|
6
6
|
opportunity?: Opportunity;
|
|
7
7
|
purchase?: VehiclePurchase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.d.ts","sourceRoot":"/","sources":["utils/transports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"transports.d.ts","sourceRoot":"/","sources":["utils/transports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AASvD,eAAO,MAAM,mBAAmB,cAAe,SAAS,KAAG,OACZ,CAAC;AAchD,eAAO,MAAM,oBAAoB,cACpB,SAAS,WACX;IAAE,WAAW,CAAC,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;CAAE,KACjE,OAMF,CAAC;AAGF,eAAO,MAAM,0BAA0B,WAAY,eAAe,KAAG,OAIjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.js","sourceRoot":"/","sources":["utils/transports.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"transports.js","sourceRoot":"/","sources":["utils/transports.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAQnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAoB,EAAW,EAAE,CACnE,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,YAAY,CAAC;AAchD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,SAAoB,EACpB,OAAkE,EACzD,EAAE;IACX,IAAI,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,YAAY,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,WAAW,EAAE,WAAW,IAAI,IAAI,CAAC;IAClD,CAAC;IAED,OAAO,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC1E,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAAuB,EAAW,EAAE,CAC7E,oBAAoB,CAAC,MAAM,CAAC,SAAS,EAAE;IACrC,WAAW,EAAE,MAAM,CAAC,WAAW;IAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;CAC1B,CAAC,CAAC","sourcesContent":["import { Opportunity } from '../types/opportunities.js';\nimport { SearchTransport, Transport, TransportType } from '../types/transports.js';\nimport { VehiclePurchase } from '../types/vehicles.js';\nimport { hasPurchaseArrived } from './vehicles.js';\n\n/**\n * Which side of the trade the transport serves. Both purchase types answer yes: a pick-up we drive\n * and a drop-off the supplier drives differ only in who is behind the wheel, and every rule that\n * asks this question — what it costs, whose money moved, which papers it needs — is the same for\n * both.\n */\nexport const isPurchaseTransport = (transport: Transport): boolean =>\n transport.type !== TransportType.SaleDelivery;\n\n/**\n * A transport is finished when the journey it describes has demonstrably happened: the customer has\n * the vehicle for a sale delivery, the vehicle is on our park for a purchase. From then on\n * the record is history and the server refuses edits to it.\n *\n * Not the same thing as the transport's own `doneAt`. Delivery can be declared on the opportunity\n * (a CMR, a delivery confirmation) and arrival on the purchase, without the transport ever being\n * moved — and reversing either of those is what unlocks the transport again, which a status stamped\n * on the transport itself could not express.\n *\n * Shared so the board, the drawer and the server all answer the question the same way.\n */\nexport const isTransportCompleted = (\n transport: Transport,\n context: { opportunity?: Opportunity; purchase?: VehiclePurchase },\n): boolean => {\n if (transport.type === TransportType.SaleDelivery) {\n return context.opportunity?.deliveredAt != null;\n }\n\n return context.purchase != null && hasPurchaseArrived(context.purchase);\n};\n\n/** The same question asked of a search document, which already carries both sides. */\nexport const isSearchTransportCompleted = (record: SearchTransport): boolean =>\n isTransportCompleted(record.transport, {\n opportunity: record.opportunity,\n purchase: record.purchase,\n });\n"]}
|