@movalib/movalib-commons 1.68.6 → 1.68.7
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/devIndex.tsx +1 -1
- package/dist/devIndex.js +1 -1
- package/dist/src/models/Event.d.ts +2 -1
- package/dist/src/models/Event.js +8 -7
- package/dist/src/models/Garage.d.ts +3 -2
- package/dist/src/models/Garage.js +3 -2
- package/package.json +1 -1
- package/src/models/Event.ts +9 -4
- package/src/models/Garage.ts +6 -4
package/devIndex.tsx
CHANGED
|
@@ -77,7 +77,7 @@ const App = () => {
|
|
|
77
77
|
const getQRCodeData = ():string => {
|
|
78
78
|
// On renvoie les données pour le QR Code, l'url change selon l'environnement (variables d'environnement)
|
|
79
79
|
//return `https://app.movalib.com/#/garage/2?redirect=garage`;
|
|
80
|
-
return `https://
|
|
80
|
+
return `https://forms.gle/TabzYcYiaLNfhTu7A`;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const handleScheduleChange = (schedule: DaySchedule[]) => {
|
package/dist/devIndex.js
CHANGED
|
@@ -105,7 +105,7 @@ var App = function () {
|
|
|
105
105
|
var getQRCodeData = function () {
|
|
106
106
|
// On renvoie les données pour le QR Code, l'url change selon l'environnement (variables d'environnement)
|
|
107
107
|
//return `https://app.movalib.com/#/garage/2?redirect=garage`;
|
|
108
|
-
return "https://
|
|
108
|
+
return "https://forms.gle/TabzYcYiaLNfhTu7A";
|
|
109
109
|
};
|
|
110
110
|
var handleScheduleChange = function (schedule) {
|
|
111
111
|
if (schedule) {
|
|
@@ -96,6 +96,7 @@ export default class Event {
|
|
|
96
96
|
orderComment?: string;
|
|
97
97
|
vehicleReceived?: boolean;
|
|
98
98
|
garageVehicleId?: number;
|
|
99
|
+
goodForAgreement?: boolean;
|
|
99
100
|
garageVehicleRequest?: boolean;
|
|
100
101
|
origin?: string;
|
|
101
102
|
quoteLastSendingTime?: Date;
|
|
@@ -106,7 +107,7 @@ export default class Event {
|
|
|
106
107
|
quoteFirstSendingTime?: Date;
|
|
107
108
|
lastQuoteCreationDate?: Date;
|
|
108
109
|
urgent?: boolean;
|
|
109
|
-
constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: Order[], creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date, urgent?: boolean, garageVehicleBookings?: LoanVehicle[]);
|
|
110
|
+
constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: Order[], creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date, urgent?: boolean, garageVehicleBookings?: LoanVehicle[], goodForAgreement?: boolean);
|
|
110
111
|
static getPrestationsList(event: Event): string[];
|
|
111
112
|
static getCurrentQuote(event: Event): Document | null;
|
|
112
113
|
}
|
package/dist/src/models/Event.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Enums_1 = require("../helpers/Enums");
|
|
4
4
|
var Event = /** @class */ (function () {
|
|
5
|
-
function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent, garageVehicleBookings) {
|
|
5
|
+
function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent, garageVehicleBookings, goodForAgreement) {
|
|
6
6
|
this.id = id;
|
|
7
7
|
this.notes = notes;
|
|
8
8
|
this.ownerId = ownerId;
|
|
@@ -49,6 +49,7 @@ var Event = /** @class */ (function () {
|
|
|
49
49
|
: undefined;
|
|
50
50
|
this.urgent = urgent;
|
|
51
51
|
this.garageVehicleBookings = garageVehicleBookings;
|
|
52
|
+
this.goodForAgreement = goodForAgreement;
|
|
52
53
|
}
|
|
53
54
|
Event.getPrestationsList = function (event) {
|
|
54
55
|
if (event && event.prestations) {
|
|
@@ -57,29 +58,29 @@ var Event = /** @class */ (function () {
|
|
|
57
58
|
return [];
|
|
58
59
|
};
|
|
59
60
|
Event.getCurrentQuote = function (event) {
|
|
60
|
-
var _a, _b, _c, _d;
|
|
61
|
+
var _a, _b, _c, _d, _e;
|
|
61
62
|
if (event.documents) {
|
|
62
63
|
var quoteDocument = event.documents.filter(function (doc) { return doc.type === Enums_1.DocumentType.USER_APPOINTMENT_QUOTE; });
|
|
63
64
|
if (event.type === Enums_1.EventType.QUOTE) {
|
|
64
65
|
var state = event.state;
|
|
65
66
|
if (state === Enums_1.QuoteState.QUOTE_DRAFT ||
|
|
66
67
|
state === Enums_1.QuoteState.QUOTE_SENT) {
|
|
67
|
-
return ((_a = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.PENDING; })) !== null && _a !== void 0 ? _a : null);
|
|
68
|
+
return ((_b = (_a = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.PENDING; })) !== null && _a !== void 0 ? _a : quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _b !== void 0 ? _b : null);
|
|
68
69
|
}
|
|
69
70
|
else if (state === Enums_1.QuoteState.QUOTE_REJECTED) {
|
|
70
|
-
return ((
|
|
71
|
+
return ((_c = quoteDocument
|
|
71
72
|
.filter(function (doc) { return doc.state === Enums_1.DocumentState.REJECTED; })
|
|
72
73
|
.sort(function (a, b) {
|
|
73
74
|
return new Date(b.creationDate).getTime() -
|
|
74
75
|
new Date(a.creationDate).getTime();
|
|
75
|
-
})[0]) !== null &&
|
|
76
|
+
})[0]) !== null && _c !== void 0 ? _c : null);
|
|
76
77
|
}
|
|
77
78
|
else if (state === Enums_1.QuoteState.QUOTE_ACCEPTED) {
|
|
78
|
-
return ((
|
|
79
|
+
return ((_d = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _d !== void 0 ? _d : null);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
else {
|
|
82
|
-
return ((
|
|
83
|
+
return ((_e = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _e !== void 0 ? _e : null);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
return null;
|
|
@@ -62,7 +62,6 @@ export default class Garage {
|
|
|
62
62
|
billingSimulationActive?: boolean;
|
|
63
63
|
demoBillingActive?: boolean;
|
|
64
64
|
appId?: number;
|
|
65
|
-
quoteRequestStart?: Date;
|
|
66
65
|
companyRegistrationNumber?: string;
|
|
67
66
|
establishmentRegistrationNumber?: string;
|
|
68
67
|
reopeningDate?: Date;
|
|
@@ -70,6 +69,8 @@ export default class Garage {
|
|
|
70
69
|
onlyBilling?: boolean;
|
|
71
70
|
settings: Settings[];
|
|
72
71
|
newDocumentEditor?: boolean;
|
|
73
|
-
|
|
72
|
+
isOnlineAppointment?: boolean;
|
|
73
|
+
isOnlineQuote?: boolean;
|
|
74
|
+
constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], dayPeriodFastServiceExcluded: boolean, loanerVehicleFastServiceExcluded: boolean, fastServiceThreshold: number, timezone: string, settings: Settings[], vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number, mailCustomization?: boolean, billingActive?: boolean, billingToken?: string, billingSimulationActive?: boolean, appId?: number, establishmentRegistrationNumber?: string, companyRegistrationNumber?: string, reopeningDate?: Date, targetMargin?: number, demoBillingActive?: boolean, onlyBilling?: boolean, newDocumentEditor?: boolean, googleReviewUrl?: string, isOnlineAppointment?: boolean, isOnlineQuote?: boolean);
|
|
74
75
|
}
|
|
75
76
|
export declare function isStockActive(g: Garage): boolean;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isStockActive = void 0;
|
|
4
4
|
var Settings_1 = require("./Settings");
|
|
5
5
|
var Garage = /** @class */ (function () {
|
|
6
|
-
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, settings, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber,
|
|
6
|
+
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, settings, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, reopeningDate, targetMargin, demoBillingActive, onlyBilling, newDocumentEditor, googleReviewUrl, isOnlineAppointment, isOnlineQuote) {
|
|
7
7
|
if (onlyBilling === void 0) { onlyBilling = false; }
|
|
8
8
|
if (newDocumentEditor === void 0) { newDocumentEditor = false; }
|
|
9
9
|
this.id = id;
|
|
@@ -35,7 +35,6 @@ var Garage = /** @class */ (function () {
|
|
|
35
35
|
this.billingToken = billingToken;
|
|
36
36
|
this.billingSimulationActive = billingSimulationActive;
|
|
37
37
|
this.appId = appId;
|
|
38
|
-
this.quoteRequestStart = quoteRequestStart;
|
|
39
38
|
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
40
39
|
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
41
40
|
this.reopeningDate = reopeningDate;
|
|
@@ -45,6 +44,8 @@ var Garage = /** @class */ (function () {
|
|
|
45
44
|
this.googleReviewUrl = googleReviewUrl;
|
|
46
45
|
this.settings = settings;
|
|
47
46
|
this.newDocumentEditor = newDocumentEditor;
|
|
47
|
+
this.isOnlineAppointment = isOnlineAppointment;
|
|
48
|
+
this.isOnlineQuote = isOnlineQuote;
|
|
48
49
|
}
|
|
49
50
|
return Garage;
|
|
50
51
|
}());
|
package/package.json
CHANGED
package/src/models/Event.ts
CHANGED
|
@@ -109,6 +109,7 @@ export default class Event {
|
|
|
109
109
|
orderComment?: string;
|
|
110
110
|
vehicleReceived?: boolean;
|
|
111
111
|
garageVehicleId?: number;
|
|
112
|
+
goodForAgreement?:boolean
|
|
112
113
|
garageVehicleRequest?: boolean;
|
|
113
114
|
origin?: string;
|
|
114
115
|
quoteLastSendingTime?: Date;
|
|
@@ -155,7 +156,8 @@ export default class Event {
|
|
|
155
156
|
lastQuoteCreationDate?: Date,
|
|
156
157
|
quoteFirstSendingTime?: Date,
|
|
157
158
|
urgent?: boolean,
|
|
158
|
-
garageVehicleBookings?: LoanVehicle[]
|
|
159
|
+
garageVehicleBookings?: LoanVehicle[],
|
|
160
|
+
goodForAgreement?:boolean,
|
|
159
161
|
) {
|
|
160
162
|
this.id = id;
|
|
161
163
|
this.notes = notes;
|
|
@@ -204,6 +206,7 @@ export default class Event {
|
|
|
204
206
|
: undefined;
|
|
205
207
|
this.urgent = urgent;
|
|
206
208
|
this.garageVehicleBookings = garageVehicleBookings;
|
|
209
|
+
this.goodForAgreement = goodForAgreement;
|
|
207
210
|
}
|
|
208
211
|
|
|
209
212
|
static getPrestationsList(event: Event): string[] {
|
|
@@ -226,7 +229,7 @@ export default class Event {
|
|
|
226
229
|
) {
|
|
227
230
|
return (
|
|
228
231
|
quoteDocument.find((doc) => doc.state === DocumentState.PENDING) ??
|
|
229
|
-
|
|
232
|
+
quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ?? null
|
|
230
233
|
);
|
|
231
234
|
} else if (state === QuoteState.QUOTE_REJECTED) {
|
|
232
235
|
return (
|
|
@@ -238,13 +241,15 @@ export default class Event {
|
|
|
238
241
|
new Date(a.creationDate!).getTime()
|
|
239
242
|
)[0] ?? null
|
|
240
243
|
);
|
|
241
|
-
}
|
|
244
|
+
}
|
|
245
|
+
else if (state === QuoteState.QUOTE_ACCEPTED) {
|
|
242
246
|
return (
|
|
243
247
|
quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ??
|
|
244
248
|
null
|
|
245
249
|
);
|
|
246
250
|
}
|
|
247
|
-
}
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
248
253
|
return (
|
|
249
254
|
quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ??
|
|
250
255
|
null
|
package/src/models/Garage.ts
CHANGED
|
@@ -63,7 +63,6 @@ export default class Garage {
|
|
|
63
63
|
billingSimulationActive?: boolean;
|
|
64
64
|
demoBillingActive?: boolean;
|
|
65
65
|
appId?: number;
|
|
66
|
-
quoteRequestStart?: Date;
|
|
67
66
|
companyRegistrationNumber?: string;
|
|
68
67
|
establishmentRegistrationNumber?: string;
|
|
69
68
|
reopeningDate?: Date;
|
|
@@ -71,6 +70,8 @@ export default class Garage {
|
|
|
71
70
|
onlyBilling?: boolean;
|
|
72
71
|
settings: Settings[];
|
|
73
72
|
newDocumentEditor?: boolean;
|
|
73
|
+
isOnlineAppointment?:boolean;
|
|
74
|
+
isOnlineQuote?:boolean;
|
|
74
75
|
constructor(
|
|
75
76
|
id: string,
|
|
76
77
|
adminId: string,
|
|
@@ -104,14 +105,14 @@ export default class Garage {
|
|
|
104
105
|
appId?: number,
|
|
105
106
|
establishmentRegistrationNumber?: string,
|
|
106
107
|
companyRegistrationNumber?: string,
|
|
107
|
-
quoteRequestStart?: Date,
|
|
108
108
|
reopeningDate?: Date,
|
|
109
109
|
targetMargin?: number,
|
|
110
110
|
demoBillingActive?: boolean,
|
|
111
111
|
onlyBilling: boolean = false,
|
|
112
112
|
newDocumentEditor: boolean = false,
|
|
113
113
|
googleReviewUrl?:string,
|
|
114
|
-
|
|
114
|
+
isOnlineAppointment?: boolean,
|
|
115
|
+
isOnlineQuote?: boolean,
|
|
115
116
|
) {
|
|
116
117
|
this.id = id;
|
|
117
118
|
this.adminId = adminId;
|
|
@@ -142,7 +143,6 @@ export default class Garage {
|
|
|
142
143
|
this.billingToken = billingToken;
|
|
143
144
|
this.billingSimulationActive = billingSimulationActive;
|
|
144
145
|
this.appId = appId;
|
|
145
|
-
this.quoteRequestStart = quoteRequestStart;
|
|
146
146
|
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
147
147
|
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
148
148
|
this.reopeningDate = reopeningDate;
|
|
@@ -152,6 +152,8 @@ export default class Garage {
|
|
|
152
152
|
this.googleReviewUrl = googleReviewUrl;
|
|
153
153
|
this.settings = settings;
|
|
154
154
|
this.newDocumentEditor = newDocumentEditor;
|
|
155
|
+
this.isOnlineAppointment = isOnlineAppointment;
|
|
156
|
+
this.isOnlineQuote = isOnlineQuote;
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
|