@bisondesk/core-sdk 1.0.644 → 1.0.645
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/delivery-settings.d.ts +1 -0
- package/lib/types/delivery-settings.d.ts.map +1 -1
- package/lib/types/delivery-settings.js.map +1 -1
- package/lib/types/internal-events.d.ts +2 -1
- package/lib/types/internal-events.d.ts.map +1 -1
- package/lib/types/internal-events.js +1 -0
- package/lib/types/internal-events.js.map +1 -1
- package/lib/types/journeys.d.ts +1 -0
- package/lib/types/journeys.d.ts.map +1 -1
- package/lib/types/journeys.js.map +1 -1
- package/lib/types/offers.d.ts +1 -0
- package/lib/types/offers.d.ts.map +1 -1
- package/lib/types/offers.js.map +1 -1
- package/lib/types/quotes.d.ts +6 -0
- package/lib/types/quotes.d.ts.map +1 -1
- package/lib/types/quotes.js.map +1 -1
- package/lib/types/transports.d.ts +93 -21
- package/lib/types/transports.d.ts.map +1 -1
- package/lib/types/transports.js +18 -2
- package/lib/types/transports.js.map +1 -1
- package/lib/types/vehicles.d.ts +2 -0
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js.map +1 -1
- package/lib/utils/search.d.ts +4 -2
- package/lib/utils/search.d.ts.map +1 -1
- package/lib/utils/search.js +19 -1
- package/lib/utils/search.js.map +1 -1
- package/lib/utils/transports.d.ts +9 -0
- package/lib/utils/transports.d.ts.map +1 -0
- package/lib/utils/transports.js +15 -0
- package/lib/utils/transports.js.map +1 -0
- package/package.json +1 -1
- package/src/types/comparables.js +2 -0
- package/src/types/comparables.js.map +1 -0
- package/src/types/crm.js +50 -0
- package/src/types/crm.js.map +1 -0
- package/src/types/delivery-settings.ts +1 -0
- package/src/types/fields.js +2 -0
- package/src/types/fields.js.map +1 -0
- package/src/types/insights.js +2 -0
- package/src/types/insights.js.map +1 -0
- package/src/types/internal-events.ts +1 -0
- package/src/types/internet-vehicles.js +2 -0
- package/src/types/internet-vehicles.js.map +1 -0
- package/src/types/journeys.js +2 -0
- package/src/types/journeys.js.map +1 -0
- package/src/types/journeys.ts +5 -0
- package/src/types/leasing-settings.js +7 -0
- package/src/types/leasing-settings.js.map +1 -0
- package/src/types/offers.js +56 -0
- package/src/types/offers.js.map +1 -0
- package/src/types/offers.ts +1 -0
- package/src/types/opportunities.js +106 -0
- package/src/types/opportunities.js.map +1 -0
- package/src/types/payments.js +7 -0
- package/src/types/payments.js.map +1 -0
- package/src/types/quotes.js +42 -0
- package/src/types/quotes.js.map +1 -0
- package/src/types/quotes.ts +6 -0
- package/src/types/reservations.js +5 -0
- package/src/types/reservations.js.map +1 -0
- package/src/types/search.js +2 -0
- package/src/types/search.js.map +1 -0
- package/src/types/tenants.js +20 -0
- package/src/types/tenants.js.map +1 -0
- package/src/types/transports.ts +153 -28
- package/src/types/utils.js +2 -0
- package/src/types/utils.js.map +1 -0
- package/src/types/vehicles.js +94 -0
- package/src/types/vehicles.js.map +1 -0
- package/src/types/vehicles.ts +2 -0
- package/src/utils/opportunities.js +48 -0
- package/src/utils/opportunities.js.map +1 -0
- package/src/utils/search.ts +31 -2
- package/src/utils/transports.ts +37 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journeys.js","sourceRoot":"","sources":["journeys.ts"],"names":[],"mappings":""}
|
package/src/types/journeys.ts
CHANGED
|
@@ -18,6 +18,11 @@ export type JourneyTaskConfig<T> = {
|
|
|
18
18
|
requiredAtStatus?: T; //Required at a given status or higher
|
|
19
19
|
disabled: boolean;
|
|
20
20
|
autoAssignToRequester?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Assign the task to whoever handles the record it hangs off, as the processor for that entity
|
|
23
|
+
* defines it. Ignored when the processor has no such person. `autoAssignToRequester` wins.
|
|
24
|
+
*/
|
|
25
|
+
autoAssignToRecordOwner?: boolean;
|
|
21
26
|
};
|
|
22
27
|
|
|
23
28
|
export type JourneyConfig<T> = {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var LeasingItemsPaymentSplit;
|
|
2
|
+
(function (LeasingItemsPaymentSplit) {
|
|
3
|
+
LeasingItemsPaymentSplit["Customer"] = "customer";
|
|
4
|
+
LeasingItemsPaymentSplit["Split"] = "split";
|
|
5
|
+
LeasingItemsPaymentSplit["Company"] = "company";
|
|
6
|
+
})(LeasingItemsPaymentSplit || (LeasingItemsPaymentSplit = {}));
|
|
7
|
+
//# sourceMappingURL=leasing-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leasing-settings.js","sourceRoot":"","sources":["leasing-settings.ts"],"names":[],"mappings":"AAwCA,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,2CAAe,CAAA;IACf,+CAAmB,CAAA;AACrB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export var OfferActions;
|
|
2
|
+
(function (OfferActions) {
|
|
3
|
+
OfferActions["CREATE_BID"] = "create_bid";
|
|
4
|
+
OfferActions["SET_FINAL_VALUATION"] = "set_final_valuation";
|
|
5
|
+
OfferActions["LOSE"] = "lose";
|
|
6
|
+
OfferActions["REOPEN"] = "reopen";
|
|
7
|
+
OfferActions["SET_DOCUMENTS"] = "set_documents";
|
|
8
|
+
OfferActions["SET_METADATA"] = "set_metadata";
|
|
9
|
+
OfferActions["SEE_SUPPLIER"] = "see_supplier";
|
|
10
|
+
OfferActions["SEE_INSIGHTS"] = "see_insights";
|
|
11
|
+
OfferActions["VIEW_BIDS"] = "view_bids";
|
|
12
|
+
OfferActions["DELETE_FINAL_VALUATION"] = "delete_final_valuation";
|
|
13
|
+
OfferActions["SEE_ASKING_PRICE"] = "see_asking_price";
|
|
14
|
+
OfferActions["ACCEPT_NEGOTIATION"] = "accept_negotiation";
|
|
15
|
+
OfferActions["UNDO_ACCEPT_NEGOTIATION"] = "undo_accept_negotiation";
|
|
16
|
+
OfferActions["SET_SUPPLIER_VEHICLE"] = "set_supplier_vehicle";
|
|
17
|
+
OfferActions["CAN_PURCHASE"] = "can_purchase";
|
|
18
|
+
})(OfferActions || (OfferActions = {}));
|
|
19
|
+
export var OfferBidActions;
|
|
20
|
+
(function (OfferBidActions) {
|
|
21
|
+
OfferBidActions["EDIT_BID"] = "create_bid";
|
|
22
|
+
OfferBidActions["DELETE_BID"] = "delete_bid";
|
|
23
|
+
})(OfferBidActions || (OfferBidActions = {}));
|
|
24
|
+
export var OfferStatus;
|
|
25
|
+
(function (OfferStatus) {
|
|
26
|
+
OfferStatus["PROSPECTION"] = "prospection";
|
|
27
|
+
OfferStatus["VALUATION"] = "valuation";
|
|
28
|
+
OfferStatus["NEGOTIATION"] = "negotiation";
|
|
29
|
+
})(OfferStatus || (OfferStatus = {}));
|
|
30
|
+
export var OfferLostReasonValues;
|
|
31
|
+
(function (OfferLostReasonValues) {
|
|
32
|
+
OfferLostReasonValues["Expensive"] = "expensive";
|
|
33
|
+
OfferLostReasonValues["NoMarket"] = "no_market";
|
|
34
|
+
OfferLostReasonValues["BadExperience"] = "bad_experience";
|
|
35
|
+
OfferLostReasonValues["NoAnswer"] = "supplier_mia";
|
|
36
|
+
OfferLostReasonValues["Other"] = "other";
|
|
37
|
+
OfferLostReasonValues["Automatic"] = "automatic";
|
|
38
|
+
})(OfferLostReasonValues || (OfferLostReasonValues = {}));
|
|
39
|
+
export var OfferBidType;
|
|
40
|
+
(function (OfferBidType) {
|
|
41
|
+
OfferBidType["INTERNAL"] = "internal";
|
|
42
|
+
OfferBidType["EXTERNAL"] = "external";
|
|
43
|
+
})(OfferBidType || (OfferBidType = {}));
|
|
44
|
+
export var OfferWarningsCode;
|
|
45
|
+
(function (OfferWarningsCode) {
|
|
46
|
+
OfferWarningsCode["NO_SUPPLIER"] = "no_supplier";
|
|
47
|
+
})(OfferWarningsCode || (OfferWarningsCode = {}));
|
|
48
|
+
export const OfferStatusOrder = [
|
|
49
|
+
OfferStatus.PROSPECTION,
|
|
50
|
+
OfferStatus.VALUATION,
|
|
51
|
+
OfferStatus.NEGOTIATION,
|
|
52
|
+
];
|
|
53
|
+
export const OfferWonColumnId = 'closed_won';
|
|
54
|
+
export const OfferKanbanColumns = [...OfferStatusOrder, OfferWonColumnId];
|
|
55
|
+
export const OfferKanbanEndColumns = [OfferWonColumnId];
|
|
56
|
+
//# sourceMappingURL=offers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offers.js","sourceRoot":"","sources":["offers.ts"],"names":[],"mappings":"AAeA,MAAM,CAAN,IAAY,YAgBX;AAhBD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,2DAA2C,CAAA;IAC3C,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,+CAA+B,CAAA;IAC/B,6CAA6B,CAAA;IAC7B,6CAA6B,CAAA;IAC7B,6CAA6B,CAAA;IAC7B,uCAAuB,CAAA;IACvB,iEAAiD,CAAA;IACjD,qDAAqC,CAAA;IACrC,yDAAyC,CAAA;IACzC,mEAAmD,CAAA;IACnD,6DAA6C,CAAA;IAC7C,6CAA6B,CAAA;AAC/B,CAAC,EAhBW,YAAY,KAAZ,YAAY,QAgBvB;AAED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;AAC3B,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;AAC7B,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,gDAAuB,CAAA;IACvB,+CAAsB,CAAA;IACtB,yDAAgC,CAAA;IAChC,kDAAyB,CAAA;IACzB,wCAAe,CAAA;IACf,gDAAuB,CAAA;AACzB,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,QAOhC;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM,CAAN,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;AAC7B,CAAC,EAFW,iBAAiB,KAAjB,iBAAiB,QAE5B;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAkB;IAC7C,WAAW,CAAC,WAAW;IACvB,WAAW,CAAC,SAAS;IACrB,WAAW,CAAC,WAAW;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,qBAAqB,GAAa,CAAC,gBAAgB,CAAC,CAAC"}
|
package/src/types/offers.ts
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export var OpportunityActions;
|
|
2
|
+
(function (OpportunityActions) {
|
|
3
|
+
OpportunityActions["ADD_REMARKS"] = "add_remarks";
|
|
4
|
+
OpportunityActions["CREATE_QUOTE"] = "create_quote";
|
|
5
|
+
OpportunityActions["LOSE"] = "lose";
|
|
6
|
+
OpportunityActions["REOPEN"] = "reopen";
|
|
7
|
+
OpportunityActions["START_PREPARATION"] = "start_preparation";
|
|
8
|
+
OpportunityActions["REVERT_PREPARATION"] = "revert_preparation";
|
|
9
|
+
OpportunityActions["START_DELIVERY"] = "start_delivery";
|
|
10
|
+
OpportunityActions["REVERT_DELIVERY"] = "revert_delivery";
|
|
11
|
+
OpportunityActions["SET_CUSTOMER"] = "set_customer";
|
|
12
|
+
OpportunityActions["SET_DOCUMENTS"] = "set_documents";
|
|
13
|
+
OpportunityActions["SET_INTEREST"] = "set_interest";
|
|
14
|
+
OpportunityActions["SET_METADATA"] = "set_metadata";
|
|
15
|
+
OpportunityActions["SET_VEHICLE"] = "set_vehicle";
|
|
16
|
+
OpportunityActions["ADD_ACTIVITY"] = "add_activity";
|
|
17
|
+
OpportunityActions["ADD_PAYMENT"] = "add_payment";
|
|
18
|
+
OpportunityActions["SWITCH_VEHICLE"] = "switch_vehicle";
|
|
19
|
+
OpportunityActions["DELIVER_VEHICLE"] = "deliver_vehicle";
|
|
20
|
+
OpportunityActions["UNDO_DELIVER_VEHICLE"] = "undo_deliver_vehicle";
|
|
21
|
+
OpportunityActions["SET_DEAL_INFO"] = "update_deal_info";
|
|
22
|
+
OpportunityActions["ISSUE_INVOICE"] = "issue_invoice";
|
|
23
|
+
})(OpportunityActions || (OpportunityActions = {}));
|
|
24
|
+
export var OpportunityPaymentStatus;
|
|
25
|
+
(function (OpportunityPaymentStatus) {
|
|
26
|
+
OpportunityPaymentStatus["PARTIAL_PAYMENT"] = "partial_payment";
|
|
27
|
+
OpportunityPaymentStatus["FULL_PAYMENT"] = "full_payment";
|
|
28
|
+
OpportunityPaymentStatus["NO_PAYMENT"] = "no_payment";
|
|
29
|
+
})(OpportunityPaymentStatus || (OpportunityPaymentStatus = {}));
|
|
30
|
+
export var OpportunityStatus;
|
|
31
|
+
(function (OpportunityStatus) {
|
|
32
|
+
OpportunityStatus["PROSPECTION"] = "prospection";
|
|
33
|
+
OpportunityStatus["DISCOVERY"] = "discovery";
|
|
34
|
+
OpportunityStatus["EVALUATION"] = "evaluation";
|
|
35
|
+
OpportunityStatus["REVIEW"] = "review";
|
|
36
|
+
OpportunityStatus["PREPARATION"] = "preparation";
|
|
37
|
+
OpportunityStatus["DELIVERY"] = "delivery";
|
|
38
|
+
})(OpportunityStatus || (OpportunityStatus = {}));
|
|
39
|
+
export const OpportunityStatusOrder = [
|
|
40
|
+
OpportunityStatus.PROSPECTION,
|
|
41
|
+
OpportunityStatus.DISCOVERY,
|
|
42
|
+
OpportunityStatus.EVALUATION,
|
|
43
|
+
OpportunityStatus.REVIEW,
|
|
44
|
+
OpportunityStatus.PREPARATION,
|
|
45
|
+
OpportunityStatus.DELIVERY,
|
|
46
|
+
];
|
|
47
|
+
export var OpportunityRequirementsCode;
|
|
48
|
+
(function (OpportunityRequirementsCode) {
|
|
49
|
+
OpportunityRequirementsCode["VEHICLE_AT_ORIGIN"] = "vehicle_at_origin";
|
|
50
|
+
OpportunityRequirementsCode["LEASING_SL_ACTION"] = "sl_action";
|
|
51
|
+
OpportunityRequirementsCode["TECHNICAL_NOTES_CHANGED"] = "technical_notes_changed";
|
|
52
|
+
})(OpportunityRequirementsCode || (OpportunityRequirementsCode = {}));
|
|
53
|
+
export var OpportunityWarningsCode;
|
|
54
|
+
(function (OpportunityWarningsCode) {
|
|
55
|
+
OpportunityWarningsCode["QUOTE_PENDING_VALIDATION"] = "quote_pending_validation";
|
|
56
|
+
OpportunityWarningsCode["QUOTE_PEDING_MANAGER_APPROVAL"] = "quote_pending_manager_approval";
|
|
57
|
+
OpportunityWarningsCode["CONCURRENT_OPPORTUNITIES"] = "concurrent_opportunities";
|
|
58
|
+
OpportunityWarningsCode["VEHICLE_RESERVED"] = "vehicle_reserved";
|
|
59
|
+
OpportunityWarningsCode["OPPORTUNITY_NEEDS_SWITCH_VEHICLE"] = "opportunity_needs_switch_vehicle";
|
|
60
|
+
OpportunityWarningsCode["VEHICLE_RESERVED_DATE_INFO"] = "vehicle_reserved_date_info";
|
|
61
|
+
OpportunityWarningsCode["VEHICLE_RESERVED_INDEFINITELY"] = "vehicle_reserved_indefinitely";
|
|
62
|
+
OpportunityWarningsCode["QUOTE_MISSING_DELIVERY_DETAILS"] = "quote_missing_delivery_details";
|
|
63
|
+
OpportunityWarningsCode["VEHICLE_TECHNICAL_DETAILS_CHANGED"] = "vehicle_technical_details_changed";
|
|
64
|
+
OpportunityWarningsCode["QUOTE_MISSING_FINANCING_DETAILS"] = "quote_missing_financing_details";
|
|
65
|
+
})(OpportunityWarningsCode || (OpportunityWarningsCode = {}));
|
|
66
|
+
export const OpportunityWonColumnId = 'closed_won';
|
|
67
|
+
export const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];
|
|
68
|
+
export const OpportunityKanbanEndColumns = [OpportunityWonColumnId];
|
|
69
|
+
export var OpportunityLostReasonValues;
|
|
70
|
+
(function (OpportunityLostReasonValues) {
|
|
71
|
+
OpportunityLostReasonValues["Expensive"] = "expensive";
|
|
72
|
+
OpportunityLostReasonValues["AlreadySold"] = "already_sold";
|
|
73
|
+
OpportunityLostReasonValues["BadExperience"] = "bad_experience";
|
|
74
|
+
OpportunityLostReasonValues["IncorrectVehicleCondition"] = "incorrect_vehicle_condition";
|
|
75
|
+
OpportunityLostReasonValues["NoStock"] = "not_enough_stock";
|
|
76
|
+
OpportunityLostReasonValues["SlowDelivery"] = "slow_delivery";
|
|
77
|
+
OpportunityLostReasonValues["HighDeposit"] = "deposit_too_high";
|
|
78
|
+
OpportunityLostReasonValues["NoAnswer"] = "client_not_answered";
|
|
79
|
+
OpportunityLostReasonValues["Automatic"] = "automatic";
|
|
80
|
+
})(OpportunityLostReasonValues || (OpportunityLostReasonValues = {}));
|
|
81
|
+
export var VehicleSaleDealStatus;
|
|
82
|
+
(function (VehicleSaleDealStatus) {
|
|
83
|
+
VehicleSaleDealStatus["SaleAgreed"] = "SALE_AGREED";
|
|
84
|
+
VehicleSaleDealStatus["FirstPaymentReceived"] = "FIRST_PAYMENT_RECEIVED";
|
|
85
|
+
VehicleSaleDealStatus["FullPaymentReceived"] = "FULL_PAYMENT_RECEIVED";
|
|
86
|
+
})(VehicleSaleDealStatus || (VehicleSaleDealStatus = {}));
|
|
87
|
+
export var VehicleSaleLogisticsStatus;
|
|
88
|
+
(function (VehicleSaleLogisticsStatus) {
|
|
89
|
+
VehicleSaleLogisticsStatus["AtOrigin"] = "AT_ORIGIN";
|
|
90
|
+
VehicleSaleLogisticsStatus["Delivered"] = "DELIVERED";
|
|
91
|
+
})(VehicleSaleLogisticsStatus || (VehicleSaleLogisticsStatus = {}));
|
|
92
|
+
export const QUOTE_NEEDS_VALIDATION_NOTIFICATION_ORIGIN = 'quote-validation';
|
|
93
|
+
export const QUOTE_NOT_CREATED_BY_ACCOUNT_MANAGER = 'quote-not-created-by-account-manager';
|
|
94
|
+
export const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validation-feedback';
|
|
95
|
+
export const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';
|
|
96
|
+
export const OPPORTUNITY_VEHICLE_DELIVERY_NOTIFICATION_ORIGIN = 'opportunity-vehicle-delivery';
|
|
97
|
+
export const OPPORTUNITY_VEHICLE_RESERVATION_ABOUT_TO_EXPIRE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-reservation-to-expire';
|
|
98
|
+
export const OPPORTUNITY_VEHICLE_RESERVATION_EXPIRED_NOTIFICATION_ORIGIN = 'opportunity-vehicle-reservation-expired';
|
|
99
|
+
export const OFFER_SET_FINAL_VALUATION_ORIGIN = 'offer-set-final-valuation';
|
|
100
|
+
export const VEHICLE_PRICE_DECREASES_NOTIFICATION_ORIGIN = 'vehicle-price-decreased';
|
|
101
|
+
export const VEHICLE_ARRIVED_NOTIFICATION_ORIGIN = 'vehicle-arrived';
|
|
102
|
+
export const VEHICLE_CHECKEDIN_NOTIFICATION_ORIGIN = 'vehicle-checkedin';
|
|
103
|
+
export const VEHICLE_PURCHASED_NOTIFICATION_ORIGIN = 'vehicle-purchased';
|
|
104
|
+
export const VEHICLE_PRICE_CHANGED_NOTIFICATION_ORIGIN = 'vehicle-price-changed';
|
|
105
|
+
export const VEHICLE_SOLD_NOTIFICATION_ORIGIN = 'vehicle-sold';
|
|
106
|
+
//# sourceMappingURL=opportunities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opportunities.js","sourceRoot":"","sources":["opportunities.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var PaymentActions;
|
|
2
|
+
(function (PaymentActions) {
|
|
3
|
+
PaymentActions["DELETE"] = "delete";
|
|
4
|
+
PaymentActions["EDIT"] = "edit";
|
|
5
|
+
})(PaymentActions || (PaymentActions = {}));
|
|
6
|
+
export const PAYMENT_NOTIFICATION_ORIGIN = 'payment-notification';
|
|
7
|
+
//# sourceMappingURL=payments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.js","sourceRoot":"","sources":["payments.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export var QuoteActions;
|
|
2
|
+
(function (QuoteActions) {
|
|
3
|
+
QuoteActions["ACCEPT"] = "accept";
|
|
4
|
+
QuoteActions["VALIDATE"] = "validate";
|
|
5
|
+
QuoteActions["DONWLOAD_PDFS"] = "download-pdfs";
|
|
6
|
+
QuoteActions["CANCEL"] = "cancel";
|
|
7
|
+
})(QuoteActions || (QuoteActions = {}));
|
|
8
|
+
export var QuoteStatus;
|
|
9
|
+
(function (QuoteStatus) {
|
|
10
|
+
QuoteStatus["CREATED"] = "created";
|
|
11
|
+
QuoteStatus["VALIDATED"] = "validated";
|
|
12
|
+
QuoteStatus["INVALIDATED"] = "invalidated";
|
|
13
|
+
QuoteStatus["ACCEPTED"] = "accepted";
|
|
14
|
+
QuoteStatus["REJECTED"] = "rejected";
|
|
15
|
+
QuoteStatus["CANCELLED"] = "cancelled";
|
|
16
|
+
QuoteStatus["MANAGER_REJECTED"] = "managerRejected";
|
|
17
|
+
QuoteStatus["MANAGER_ACCEPTED"] = "managerAccepted";
|
|
18
|
+
})(QuoteStatus || (QuoteStatus = {}));
|
|
19
|
+
export var QuoteMetricsScore;
|
|
20
|
+
(function (QuoteMetricsScore) {
|
|
21
|
+
QuoteMetricsScore["DANGER"] = "danger";
|
|
22
|
+
QuoteMetricsScore["NEUTRAL"] = "neutral";
|
|
23
|
+
QuoteMetricsScore["GOOD"] = "good";
|
|
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 || (DeliveryTypes = {}));
|
|
31
|
+
export var SpoilerInfo;
|
|
32
|
+
(function (SpoilerInfo) {
|
|
33
|
+
SpoilerInfo["MOUNT"] = "mount";
|
|
34
|
+
SpoilerInfo["UNMOUNT"] = "unmount";
|
|
35
|
+
SpoilerInfo["NO_ACTION"] = "noAction";
|
|
36
|
+
})(SpoilerInfo || (SpoilerInfo = {}));
|
|
37
|
+
export var TransportationMode;
|
|
38
|
+
(function (TransportationMode) {
|
|
39
|
+
TransportationMode["BY_ROAD"] = "byRoad";
|
|
40
|
+
TransportationMode["ON_LOW_BED"] = "onLowBed";
|
|
41
|
+
})(TransportationMode || (TransportationMode = {}));
|
|
42
|
+
//# sourceMappingURL=quotes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"","sources":["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,aAIX;AAJD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;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"}
|
package/src/types/quotes.ts
CHANGED
|
@@ -181,7 +181,13 @@ export type PortDeliverytype = BaseDeliveryType & {
|
|
|
181
181
|
portDestination?: string;
|
|
182
182
|
shippingCompany?: string;
|
|
183
183
|
portToPortCostPrice: string;
|
|
184
|
+
parkToPortCostPrice?: string;
|
|
184
185
|
portToPortMargin: string;
|
|
186
|
+
ets?: string;
|
|
187
|
+
eta?: string;
|
|
188
|
+
etd?: string;
|
|
189
|
+
bookingRef?: string;
|
|
190
|
+
deliveryLocation?: string;
|
|
185
191
|
};
|
|
186
192
|
|
|
187
193
|
// Sent by the Frontend to bootstrap the calculator
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservations.js","sourceRoot":"","sources":["reservations.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,kEAA4C,CAAA;AAC9C,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["search.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export var TenantModule;
|
|
2
|
+
(function (TenantModule) {
|
|
3
|
+
TenantModule["Administration"] = "administration";
|
|
4
|
+
TenantModule["App"] = "app";
|
|
5
|
+
TenantModule["CRM"] = "crm";
|
|
6
|
+
TenantModule["Docs"] = "docs";
|
|
7
|
+
TenantModule["Leads"] = "leads";
|
|
8
|
+
TenantModule["Leasing"] = "leasing";
|
|
9
|
+
TenantModule["Insights"] = "insights";
|
|
10
|
+
TenantModule["Opportunities"] = "opportunities";
|
|
11
|
+
TenantModule["Offers"] = "offers";
|
|
12
|
+
TenantModule["VehiclesMasterData"] = "vehicles_master_data";
|
|
13
|
+
TenantModule["Vehicles"] = "vehicles";
|
|
14
|
+
TenantModule["Tasks"] = "tasks";
|
|
15
|
+
TenantModule["TrackAndTrace"] = "track_and_trace";
|
|
16
|
+
TenantModule["Bootstrap"] = "bootstrap";
|
|
17
|
+
TenantModule["WhatsappNotifications"] = "whatsapp_notifications";
|
|
18
|
+
TenantModule["Hexon"] = "hexon";
|
|
19
|
+
})(TenantModule || (TenantModule = {}));
|
|
20
|
+
//# sourceMappingURL=tenants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"","sources":["tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,iDAAiC,CAAA;IACjC,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,2DAA2C,CAAA;IAC3C,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,gEAAgD,CAAA;IAChD,+BAAe,CAAA;AACjB,CAAC,EAjBW,YAAY,KAAZ,YAAY,QAiBvB"}
|
package/src/types/transports.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GPSCoord, NextList, PaginatedList } from '@bisondesk/commons-sdk/types';
|
|
2
2
|
import { Organization } from './crm.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { BaseEvent } from './internal-events.js';
|
|
4
|
+
import { Opportunity, OpportunityPaymentStatus } from './opportunities.js';
|
|
5
|
+
import {
|
|
6
|
+
AddressDeliveryType,
|
|
7
|
+
DeliveryTypes,
|
|
8
|
+
PickUpDeliveryType,
|
|
9
|
+
PortDeliverytype,
|
|
10
|
+
} from './quotes.js';
|
|
5
11
|
import { BaseSearchRequest, SortOrder } from './search.js';
|
|
6
|
-
import { ReferenceData } from './utils.js';
|
|
12
|
+
import { DataRecord, ReferenceData } from './utils.js';
|
|
7
13
|
import { Vehicle, VehiclePurchase } from './vehicles.js';
|
|
8
14
|
|
|
9
15
|
export enum TransportType {
|
|
@@ -42,49 +48,66 @@ export enum TransportPriority {
|
|
|
42
48
|
Urgent = 'URGENT',
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
export const
|
|
51
|
+
export const TransportSalesDeliveryType = {
|
|
46
52
|
Address: DeliveryTypes.ADDRESS,
|
|
47
53
|
Port: DeliveryTypes.PORT,
|
|
48
54
|
PortAndShip: DeliveryTypes.PORT_AND_SHIP,
|
|
55
|
+
PickUp: DeliveryTypes.PICK_UP,
|
|
49
56
|
} as const;
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
/**
|
|
59
|
+
* The customer collects the vehicle. Nothing is driven anywhere, but the papers still have to be
|
|
60
|
+
* arranged and paid for — transit plates, technical control, insurance — which is why it is a
|
|
61
|
+
* delivery type administration reviews rather than the absence of one.
|
|
62
|
+
*
|
|
63
|
+
* `dateOfPickUpByCustomer` is dropped from the quote's shape: the transport's own `date` is the
|
|
64
|
+
* collection day, and two fields for one date only ever disagree.
|
|
65
|
+
*/
|
|
66
|
+
export type TransportPickUpDeliveryType = Omit<PickUpDeliveryType, 'dateOfPickUpByCustomer'>;
|
|
67
|
+
|
|
68
|
+
export type TransportSalesDeliveryType = (
|
|
69
|
+
| PortDeliverytype
|
|
70
|
+
| AddressDeliveryType
|
|
71
|
+
| TransportPickUpDeliveryType
|
|
72
|
+
) & {
|
|
73
|
+
cleaningNeeded?: boolean;
|
|
74
|
+
driver?: string;
|
|
75
|
+
transportCompany?: string;
|
|
76
|
+
date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)
|
|
77
|
+
adminCost?: string; // user-entered administrative cost summed into totalCostExclVat
|
|
78
|
+
stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type TransportPurchaseDeliveryType = AddressDeliveryType & {
|
|
82
|
+
cleaningNeeded?: boolean;
|
|
83
|
+
driver?: string;
|
|
84
|
+
transportCompany?: string;
|
|
85
|
+
date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)
|
|
86
|
+
adminCost?: string; // user-entered administrative cost summed into totalCostExclVat
|
|
87
|
+
stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings
|
|
88
|
+
};
|
|
53
89
|
|
|
54
90
|
export type Transport = {
|
|
55
91
|
id: string;
|
|
56
92
|
vehicleId: string;
|
|
57
93
|
opportunityId?: string;
|
|
58
94
|
|
|
59
|
-
type: TransportType;
|
|
60
|
-
deliveryType: TransportDeliveryType;
|
|
61
95
|
status: TransportStatus;
|
|
62
|
-
|
|
63
96
|
priority: TransportPriority;
|
|
64
97
|
|
|
65
98
|
// administrative fields
|
|
66
99
|
adminApproved: boolean;
|
|
67
|
-
|
|
100
|
+
adminApprovedAt?: string;
|
|
101
|
+
adminApprovedBy?: string;
|
|
102
|
+
transportWithoutPayment?: boolean;
|
|
68
103
|
notes?: string;
|
|
69
104
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
port?: {
|
|
76
|
-
sourcePort?: string;
|
|
77
|
-
destinationPort?: string;
|
|
78
|
-
|
|
79
|
-
deliveryLocation?: string;
|
|
80
|
-
bookingRef?: string;
|
|
81
|
-
shippingCompany?: string;
|
|
82
|
-
ets?: string;
|
|
83
|
-
eta?: string;
|
|
105
|
+
totals: {
|
|
106
|
+
totalRetailAmountExclVat: string;
|
|
107
|
+
totalCostExclVat: string;
|
|
108
|
+
estimatedTotalCostExclVat?: string;
|
|
84
109
|
};
|
|
85
110
|
|
|
86
|
-
address?: LocationValue;
|
|
87
|
-
|
|
88
111
|
log: Array<{
|
|
89
112
|
status: TransportStatus;
|
|
90
113
|
completedAt: string;
|
|
@@ -100,7 +123,16 @@ export type Transport = {
|
|
|
100
123
|
createdBy: string;
|
|
101
124
|
updatedAt: string;
|
|
102
125
|
updatedBy: string;
|
|
103
|
-
}
|
|
126
|
+
} & (
|
|
127
|
+
| {
|
|
128
|
+
type: TransportType.PurchasePickUp;
|
|
129
|
+
delivery: TransportPurchaseDeliveryType;
|
|
130
|
+
}
|
|
131
|
+
| {
|
|
132
|
+
type: TransportType.SaleDelivery;
|
|
133
|
+
delivery: TransportSalesDeliveryType;
|
|
134
|
+
}
|
|
135
|
+
);
|
|
104
136
|
|
|
105
137
|
export enum TransportWarningCode {
|
|
106
138
|
PurchaseLogisticsNotReady = 'purchase_logistics_not_ready',
|
|
@@ -111,15 +143,108 @@ export type TransportWarning = {
|
|
|
111
143
|
details?: Record<string, string | number | boolean>;
|
|
112
144
|
};
|
|
113
145
|
|
|
146
|
+
export type TransportCost = Pick<Transport, 'totals'>;
|
|
147
|
+
|
|
148
|
+
export type TransportRecord = DataRecord<Transport>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* What a requester may change on a transport, field group by field group. The server filters an
|
|
152
|
+
* update through these and returns the ones granted on the record, so the drawer disables what the
|
|
153
|
+
* user cannot touch instead of deciding for itself from the user's roles.
|
|
154
|
+
*/
|
|
155
|
+
export enum TransportActions {
|
|
156
|
+
/** The route: addresses, ports, dates, costs. */
|
|
157
|
+
SetDelivery = 'set_delivery',
|
|
158
|
+
SetNotes = 'set_notes',
|
|
159
|
+
/** The administrative sign-off, and the clearance to move before the payment. */
|
|
160
|
+
SetApproval = 'set_approval',
|
|
161
|
+
/** The board column. */
|
|
162
|
+
SetStatus = 'set_status',
|
|
163
|
+
SetPriority = 'set_priority',
|
|
164
|
+
SetBookingRef = 'set_booking_ref',
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Every field a write may set, in one shape. `delivery` is replaced whole when it is sent — there is
|
|
169
|
+
* no partial merge into the stored one — which is why `bookingRef` rides alongside as a scalar the
|
|
170
|
+
* server writes into the delivery it ends up with.
|
|
171
|
+
*/
|
|
172
|
+
export type TransportUpdate = {
|
|
173
|
+
delivery?: TransportSalesDeliveryType | TransportPurchaseDeliveryType;
|
|
174
|
+
notes?: string | null;
|
|
175
|
+
adminApproved?: boolean;
|
|
176
|
+
transportWithoutPayment?: boolean;
|
|
177
|
+
status?: TransportStatus;
|
|
178
|
+
priority?: TransportPriority;
|
|
179
|
+
bookingRef?: string | null;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
type BaseTransportEvent = {
|
|
183
|
+
actionAt: string;
|
|
184
|
+
userId: string;
|
|
185
|
+
tenantId: string;
|
|
186
|
+
transportId: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export type TransportCreateEvent = BaseTransportEvent & {
|
|
190
|
+
action: 'create';
|
|
191
|
+
data: Transport;
|
|
192
|
+
previousData?: undefined;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export type TransportUpdateEvent = BaseTransportEvent & {
|
|
196
|
+
action: 'update';
|
|
197
|
+
data: Transport;
|
|
198
|
+
previousData: Transport;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/** Published whenever a transport is written. Carries both sides so subscribers judge relevance. */
|
|
202
|
+
export type TransportEvent = BaseEvent & (TransportCreateEvent | TransportUpdateEvent);
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Where the money stands on the record the transport serves: the customer's payments on the
|
|
206
|
+
* opportunity for a sale delivery, ours to the supplier for a purchase pick-up. Denormalised at
|
|
207
|
+
* indexing time so the board can show it without joining.
|
|
208
|
+
*/
|
|
209
|
+
export type TransportPayment = {
|
|
210
|
+
status: OpportunityPaymentStatus;
|
|
211
|
+
/** Only a sale delivery knows the ratio — a pick-up has milestones, not a running total. */
|
|
212
|
+
percentagePaid?: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
/** Which address the map pin came from, so the UI can tell an exact pin from an approximate one. */
|
|
216
|
+
export enum TransportLocationSource {
|
|
217
|
+
DeliveryAddress = 'delivery_address',
|
|
218
|
+
OriginPort = 'origin_port',
|
|
219
|
+
OrgAddress = 'org_address',
|
|
220
|
+
}
|
|
221
|
+
|
|
114
222
|
export type SearchTransport = {
|
|
115
223
|
transport: Transport;
|
|
116
224
|
vehicle: Vehicle;
|
|
117
225
|
org: Organization;
|
|
118
226
|
opportunity?: Opportunity;
|
|
119
227
|
purchase: VehiclePurchase;
|
|
228
|
+
tasks: {
|
|
229
|
+
totalTasks: number;
|
|
230
|
+
openTasks: number;
|
|
231
|
+
nextDueAt?: string;
|
|
232
|
+
};
|
|
120
233
|
custom: {
|
|
121
234
|
commercialUserIds: string[];
|
|
122
235
|
warnings: TransportWarning[];
|
|
236
|
+
priorityOrdinal: number;
|
|
237
|
+
payment: TransportPayment;
|
|
238
|
+
/**
|
|
239
|
+
* Where the transport happens: the delivery address, or the origin port for a shipped delivery.
|
|
240
|
+
* Denormalised into one field because the map clusters over a single geo_point, and a port
|
|
241
|
+
* delivery carries no address of its own.
|
|
242
|
+
*
|
|
243
|
+
* Deliberately narrower than `GPSCoord`: a geo_point field rejects any key beyond lat/lon, so
|
|
244
|
+
* the map zoom the coordinates picker stores must not reach the index.
|
|
245
|
+
*/
|
|
246
|
+
location?: Pick<GPSCoord, 'lat' | 'lon'>;
|
|
247
|
+
locationSource?: TransportLocationSource;
|
|
123
248
|
};
|
|
124
249
|
};
|
|
125
250
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|