@movalib/movalib-commons 1.59.36 → 1.59.37
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/dist/src/components/vehicle/VehicleFullCard.d.ts +5 -5
- package/dist/src/components/vehicle/VehicleFullCard.js +101 -82
- package/dist/src/helpers/Enums.d.ts +7 -6
- package/dist/src/helpers/Enums.js +6 -5
- package/dist/src/models/Document.d.ts +2 -1
- package/dist/src/models/Document.js +3 -5
- package/dist/src/models/Event.d.ts +12 -1
- package/dist/src/models/Event.js +2 -1
- package/dist/src/models/Product.d.ts +2 -1
- package/dist/src/models/Product.js +2 -1
- package/dist/src/services/GarageService.d.ts +3 -1
- package/dist/src/services/GarageService.js +18 -4
- package/package.json +1 -1
- package/src/components/vehicle/VehicleFullCard.tsx +847 -559
- package/src/helpers/Enums.ts +216 -217
- package/src/models/Document.ts +42 -37
- package/src/models/Event.ts +13 -1
- package/src/models/Product.ts +40 -26
- package/src/services/GarageService.ts +667 -621
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type FC } from
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { type FC } from "react";
|
|
2
|
+
import { MovaAppType } from "../../helpers/Enums";
|
|
3
|
+
import { MovaVehicleForm } from "../../helpers/Types";
|
|
4
|
+
import User from "../../models/User";
|
|
5
|
+
import Vehicle from "../../models/Vehicle";
|
|
6
6
|
interface VehicleFullCardProps {
|
|
7
7
|
currentUser: User;
|
|
8
8
|
vehicle: Vehicle;
|
|
@@ -15,31 +15,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var icons_material_1 = require("@mui/icons-material");
|
|
19
|
+
var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
20
|
+
var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
|
|
18
21
|
var material_1 = require("@mui/material");
|
|
22
|
+
var x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
19
23
|
var react_1 = require("react");
|
|
20
|
-
var
|
|
24
|
+
var car_plate_bg_png_1 = __importDefault(require("../../assets/images/car_plate_bg.png"));
|
|
21
25
|
var ConfirmationDialog_1 = __importDefault(require("../../ConfirmationDialog"));
|
|
22
|
-
var Enums_1 = require("../../helpers/Enums");
|
|
23
|
-
var Tools_1 = require("../../helpers/Tools");
|
|
24
26
|
var DateUtils_1 = require("../../helpers/DateUtils");
|
|
25
|
-
var
|
|
26
|
-
var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
|
|
27
|
-
var CloseRounded_2 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
27
|
+
var Enums_1 = require("../../helpers/Enums");
|
|
28
28
|
var Logger_1 = __importDefault(require("../../helpers/Logger"));
|
|
29
|
-
var
|
|
29
|
+
var Tools_1 = require("../../helpers/Tools");
|
|
30
|
+
var MovaVehicleTireField_1 = __importDefault(require("../../MovaVehicleTireField"));
|
|
30
31
|
var LinkedDocumentDialog_1 = require("../LinkedDocumentDialog");
|
|
31
|
-
var car_plate_bg_png_1 = __importDefault(require("../../assets/images/car_plate_bg.png"));
|
|
32
|
-
var x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
33
32
|
var initialUserFormState = {
|
|
34
33
|
currentMileage: { value: null, isValid: true },
|
|
35
34
|
averageMileagePerYear: { value: null, isValid: true },
|
|
36
35
|
tireSize: { value: null, isValid: true },
|
|
37
|
-
tireWidth: { value:
|
|
38
|
-
tireHeight: { value:
|
|
39
|
-
tireDiameter: { value:
|
|
40
|
-
tireSpeedIndex: { value:
|
|
36
|
+
tireWidth: { value: "", isValid: true },
|
|
37
|
+
tireHeight: { value: "", isValid: true },
|
|
38
|
+
tireDiameter: { value: "", isValid: true },
|
|
39
|
+
tireSpeedIndex: { value: "", isValid: true },
|
|
41
40
|
lastInspectionDate: { value: null, isValid: true },
|
|
42
|
-
lastMaintenanceDate: { value: null, isValid: true }
|
|
41
|
+
lastMaintenanceDate: { value: null, isValid: true },
|
|
43
42
|
};
|
|
44
43
|
var VehicleFullCard = function (_a) {
|
|
45
44
|
var _b;
|
|
@@ -48,7 +47,7 @@ var VehicleFullCard = function (_a) {
|
|
|
48
47
|
var _e = (0, react_1.useState)(editMode), localEditMode = _e[0], setLocalEditMode = _e[1];
|
|
49
48
|
var _f = (0, react_1.useState)(false), openConfirmDocumentDelete = _f[0], setOpenConfirmDocumentDelete = _f[1];
|
|
50
49
|
var _g = (0, react_1.useState)(false), openConfirmVehicleDelete = _g[0], setOpenConfirmVehicleDelete = _g[1];
|
|
51
|
-
var _h = (0, react_1.useState)(
|
|
50
|
+
var _h = (0, react_1.useState)(""), documentToDelete = _h[0], setDocumentToDelete = _h[1];
|
|
52
51
|
var _j = (0, react_1.useState)(false), sizeLimit = _j[0], setSizeLimit = _j[1];
|
|
53
52
|
// Formulaire utilisé pour les modifications d'informations sur le véhicule
|
|
54
53
|
var _k = (0, react_1.useState)(initialUserFormState), form = _k[0], setForm = _k[1];
|
|
@@ -57,7 +56,7 @@ var VehicleFullCard = function (_a) {
|
|
|
57
56
|
var tirePictureInputRef = (0, react_1.useRef)(null);
|
|
58
57
|
var _l = (0, react_1.useState)(false), isShowLinkedDocument = _l[0], setShowLinkedDocument = _l[1];
|
|
59
58
|
var docTypeCurrent = (0, react_1.useRef)();
|
|
60
|
-
var messageRGPD = appType === Enums_1.MovaAppType.INDIVIDUAL ? (0, jsx_runtime_1.jsx)(material_1.Box, {}) : (0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { mt: 2 } }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity:
|
|
59
|
+
var messageRGPD = appType === Enums_1.MovaAppType.INDIVIDUAL ? ((0, jsx_runtime_1.jsx)(material_1.Box, {})) : ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { mt: 2 } }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: "warning" }, { children: "Vous \u00EAtes responsable des documents que vous importez, en ajoutant un document vous reconnaissez disposer du consentement explicite du client pour le stockage de ses donn\u00E9es conform\u00E9ment \u00E0 la r\u00E9glementation RGPD." })) })));
|
|
61
60
|
(0, react_1.useEffect)(function () {
|
|
62
61
|
setLocalEditMode(editMode);
|
|
63
62
|
}, [editMode]);
|
|
@@ -66,43 +65,20 @@ var VehicleFullCard = function (_a) {
|
|
|
66
65
|
}, [vehicle]);
|
|
67
66
|
var initForm = function () {
|
|
68
67
|
if (vehicle) {
|
|
69
|
-
setForm(function (prevForm) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
setForm(function (prevForm) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
setForm(function (prevForm) {
|
|
82
|
-
var _a;
|
|
83
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['tireHeight'] = __assign(__assign({}, prevForm['tireHeight']), { value: vehicle.tireHeight }), _a)));
|
|
84
|
-
});
|
|
85
|
-
setForm(function (prevForm) {
|
|
86
|
-
var _a;
|
|
87
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['tireDiameter'] = __assign(__assign({}, prevForm['tireDiameter']), { value: vehicle.tireDiameter }), _a)));
|
|
88
|
-
});
|
|
89
|
-
setForm(function (prevForm) {
|
|
90
|
-
var _a;
|
|
91
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['tireSpeedIndex'] = __assign(__assign({}, prevForm['tireSpeedIndex']), { value: vehicle.tireSpeedIndex }), _a)));
|
|
92
|
-
});
|
|
93
|
-
setForm(function (prevForm) {
|
|
94
|
-
var _a;
|
|
95
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['lastInspectionDate'] = __assign(__assign({}, prevForm['lastInspectionDate']), { value: vehicle.lastInspectionDate ? new Date(vehicle.lastInspectionDate) : null }), _a)));
|
|
96
|
-
});
|
|
97
|
-
setForm(function (prevForm) {
|
|
98
|
-
var _a;
|
|
99
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['lastMaintenanceDate'] = __assign(__assign({}, prevForm['lastMaintenanceDate']), { value: vehicle.lastMaintenanceDate ? new Date(vehicle.lastMaintenanceDate) : null }), _a)));
|
|
100
|
-
});
|
|
68
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { currentMileage: __assign(__assign({}, prevForm["currentMileage"]), { value: vehicle.currentMileage }) })); });
|
|
69
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { averageMileagePerYear: __assign(__assign({}, prevForm["averageMileagePerYear"]), { value: vehicle.averageMileagePerYear }) })); });
|
|
70
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireWidth: __assign(__assign({}, prevForm["tireWidth"]), { value: vehicle.tireWidth }) })); });
|
|
71
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireHeight: __assign(__assign({}, prevForm["tireHeight"]), { value: vehicle.tireHeight }) })); });
|
|
72
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireDiameter: __assign(__assign({}, prevForm["tireDiameter"]), { value: vehicle.tireDiameter }) })); });
|
|
73
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireSpeedIndex: __assign(__assign({}, prevForm["tireSpeedIndex"]), { value: vehicle.tireSpeedIndex }) })); });
|
|
74
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { lastInspectionDate: __assign(__assign({}, prevForm["lastInspectionDate"]), { value: vehicle.lastInspectionDate
|
|
75
|
+
? new Date(vehicle.lastInspectionDate)
|
|
76
|
+
: null }) })); });
|
|
77
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { lastMaintenanceDate: __assign(__assign({}, prevForm["lastMaintenanceDate"]), { value: vehicle.lastMaintenanceDate
|
|
78
|
+
? new Date(vehicle.lastMaintenanceDate)
|
|
79
|
+
: null }) })); });
|
|
101
80
|
if (isVehicleTireSizeDefined(vehicle)) {
|
|
102
|
-
setForm(function (prevForm) {
|
|
103
|
-
var _a;
|
|
104
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['tireSize'] = __assign(__assign({}, prevForm['tireSize']), { value: vehicle.tireSize }), _a)));
|
|
105
|
-
});
|
|
81
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireSize: __assign(__assign({}, prevForm["tireSize"]), { value: vehicle.tireSize }) })); });
|
|
106
82
|
}
|
|
107
83
|
Logger_1.default.info(form);
|
|
108
84
|
}
|
|
@@ -118,16 +94,22 @@ var VehicleFullCard = function (_a) {
|
|
|
118
94
|
}
|
|
119
95
|
};
|
|
120
96
|
var isVehicleTireSizeDefined = function (vehicle) {
|
|
121
|
-
return vehicle.tireSize &&
|
|
97
|
+
return (vehicle.tireSize &&
|
|
98
|
+
vehicle.tireSize.diameter &&
|
|
99
|
+
vehicle.tireSize.height &&
|
|
100
|
+
vehicle.tireSize.speedIndex &&
|
|
101
|
+
vehicle.tireSize.width);
|
|
122
102
|
};
|
|
123
103
|
var validateForm = function () {
|
|
124
104
|
var newForm = __assign({}, form);
|
|
125
105
|
// Validator pour les champs obligatoires
|
|
126
|
-
newForm.currentMileage =
|
|
127
|
-
newForm.averageMileagePerYear =
|
|
106
|
+
// newForm.currentMileage = validateField(form.currentMileage, value => !!value, 'Champ obligatoire');
|
|
107
|
+
// newForm.averageMileagePerYear = validateField(form.averageMileagePerYear, value => !!value, 'Champ obligatoire');
|
|
128
108
|
// La validation de la saisie des pneumatiques se fait dans le composant "MovaVehicleTireField", traitée dans le callback "handleOnChangeVehicleTire"
|
|
129
109
|
setForm(newForm);
|
|
130
|
-
return newForm.currentMileage.isValid &&
|
|
110
|
+
return (newForm.currentMileage.isValid &&
|
|
111
|
+
newForm.averageMileagePerYear.isValid &&
|
|
112
|
+
newForm.tireSize.isValid);
|
|
131
113
|
};
|
|
132
114
|
var handleInputChange = function (e) {
|
|
133
115
|
handleChange(e.target.name, e.target.value);
|
|
@@ -138,7 +120,9 @@ var VehicleFullCard = function (_a) {
|
|
|
138
120
|
var handleChange = function (fieldName, fieldValue) {
|
|
139
121
|
var _a;
|
|
140
122
|
console.log(fieldName, fieldValue);
|
|
141
|
-
var newField = (_a = {},
|
|
123
|
+
var newField = (_a = {},
|
|
124
|
+
_a[fieldName] = { value: fieldValue, isValid: true },
|
|
125
|
+
_a);
|
|
142
126
|
setForm(__assign(__assign({}, form), newField));
|
|
143
127
|
};
|
|
144
128
|
var uploadVehicleDocument = function (document, documentType) {
|
|
@@ -151,7 +135,7 @@ var VehicleFullCard = function (_a) {
|
|
|
151
135
|
var formData = new FormData();
|
|
152
136
|
formData.append("documentType", documentType);
|
|
153
137
|
// Ajouter la facture à FormData
|
|
154
|
-
formData.append(
|
|
138
|
+
formData.append("file", document);
|
|
155
139
|
// Appel du callback correspondant
|
|
156
140
|
if (onUploadDocument)
|
|
157
141
|
onUploadDocument(formData);
|
|
@@ -164,7 +148,10 @@ var VehicleFullCard = function (_a) {
|
|
|
164
148
|
*/
|
|
165
149
|
var handleFileChange = function (event, docType) {
|
|
166
150
|
event.preventDefault();
|
|
167
|
-
if (event &&
|
|
151
|
+
if (event &&
|
|
152
|
+
event.target.files &&
|
|
153
|
+
event.target.files.length > 0 &&
|
|
154
|
+
docType) {
|
|
168
155
|
uploadVehicleDocument(event.target.files[0], docType);
|
|
169
156
|
}
|
|
170
157
|
};
|
|
@@ -173,10 +160,7 @@ var VehicleFullCard = function (_a) {
|
|
|
173
160
|
setLocalEditMode(true);
|
|
174
161
|
};
|
|
175
162
|
var handleOnChangeVehicleTire = function (vehicleTire, isValid) {
|
|
176
|
-
setForm(function (prevForm) {
|
|
177
|
-
var _a;
|
|
178
|
-
return (__assign(__assign({}, prevForm), (_a = {}, _a['tireSize'] = __assign(__assign({}, prevForm['tireSize']), { value: vehicleTire, isValid: isValid }), _a)));
|
|
179
|
-
});
|
|
163
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireSize: __assign(__assign({}, prevForm["tireSize"]), { value: vehicleTire, isValid: isValid }) })); });
|
|
180
164
|
};
|
|
181
165
|
var handleOnClickDeleteVehicle = function (e) {
|
|
182
166
|
e.preventDefault();
|
|
@@ -193,10 +177,18 @@ var VehicleFullCard = function (_a) {
|
|
|
193
177
|
var query = {
|
|
194
178
|
currentMileage: form.currentMileage.value,
|
|
195
179
|
averageMileagePerYear: form.averageMileagePerYear.value,
|
|
196
|
-
tireWidth: form.tireSize.isValid && form.tireSize.value
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
180
|
+
tireWidth: form.tireSize.isValid && form.tireSize.value
|
|
181
|
+
? form.tireSize.value.width
|
|
182
|
+
: undefined,
|
|
183
|
+
tireHeight: form.tireSize.isValid && form.tireSize.value
|
|
184
|
+
? form.tireSize.value.height
|
|
185
|
+
: undefined,
|
|
186
|
+
tireDiameter: form.tireSize.isValid && form.tireSize.value
|
|
187
|
+
? form.tireSize.value.diameter
|
|
188
|
+
: undefined,
|
|
189
|
+
tireSpeedIndex: form.tireSize.isValid && form.tireSize.value
|
|
190
|
+
? form.tireSize.value.speedIndex
|
|
191
|
+
: undefined,
|
|
200
192
|
lastInspectionDate: form.lastInspectionDate.value,
|
|
201
193
|
lastMaintenanceDate: form.lastMaintenanceDate.value,
|
|
202
194
|
};
|
|
@@ -212,7 +204,7 @@ var VehicleFullCard = function (_a) {
|
|
|
212
204
|
};
|
|
213
205
|
var handleCloseConfirmDocumentDelete = function () {
|
|
214
206
|
setOpenConfirmDocumentDelete(false);
|
|
215
|
-
setDocumentToDelete(
|
|
207
|
+
setDocumentToDelete("");
|
|
216
208
|
};
|
|
217
209
|
var handleCloseConfirmVehicleDelete = function () {
|
|
218
210
|
setOpenConfirmVehicleDelete(false);
|
|
@@ -235,19 +227,46 @@ var VehicleFullCard = function (_a) {
|
|
|
235
227
|
onDelete();
|
|
236
228
|
}
|
|
237
229
|
};
|
|
238
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [vehicle &&
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
230
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [vehicle && ((0, jsx_runtime_1.jsxs)(material_1.Card, __assign({ variant: "outlined", sx: {
|
|
231
|
+
maxWidth: fullwidth ? "80%" : 500,
|
|
232
|
+
backgroundColor: focused ? theme.palette.primary.light : "white",
|
|
233
|
+
overflow: "visible",
|
|
234
|
+
mt: 4,
|
|
235
|
+
pb: 1,
|
|
236
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)(material_1.CardContent, __assign({ sx: { pt: 0, pb: 0 } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: [vehicle.brand && "".concat(vehicle.brand, " "), vehicle.model && "".concat(vehicle.model, " "), vehicle.version && "".concat(vehicle.version)] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: { mb: 1, alignItems: "center", justifyContent: "center" } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ item: true, xs: 6, sx: { position: "relative", minWidth: "234px" } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: car_plate_bg_png_1.default, alt: "Plaque d'immatriculation", style: { height: "50px", position: "relative" } }), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "h6", color: theme.palette.text.primary, sx: { position: "absolute", top: "8px", left: "76px" } }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatFrenchVehiclePlate)(vehicle.plate) }) }))] })), onDelete && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, style: {
|
|
237
|
+
display: "flex",
|
|
238
|
+
alignItems: "center",
|
|
239
|
+
justifyContent: "center",
|
|
240
|
+
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ variant: "contained", color: "error", onClick: function (e) { return handleOnClickDeleteVehicle(e); } }, { children: "Supprimer" })) })))] })), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Km actuel :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [vehicle.currentMileage, " km"] }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Kilom\u00E9trage actuel", name: "currentMileage", variant: "outlined", type: "number", required: true, value: form.currentMileage.value, onChange: function (e) { return handleInputChange(e); }, error: Boolean(form.currentMileage.error), sx: {
|
|
241
|
+
width: "100%",
|
|
242
|
+
mt: 2,
|
|
243
|
+
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
244
|
+
}, helperText: Boolean(form.currentMileage.error &&
|
|
245
|
+
form.currentMileage.value > 0)
|
|
246
|
+
? form.currentMileage.error
|
|
247
|
+
: "Sur votre tableau de bord 😉" }) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Km moyen annuel :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [vehicle.averageMileagePerYear, " km"] }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, __assign({ fullWidth: true, margin: "normal", error: Boolean(form.averageMileagePerYear.error) }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, __assign({ id: "averageMileagePerYear-label" }, { children: "Kilom\u00E9trage moyen annuel" })), (0, jsx_runtime_1.jsxs)(material_1.Select, __assign({ labelId: "averageMileagePerYear-label", id: "averageMileagePerYear", name: "averageMileagePerYear", value: form.averageMileagePerYear.value
|
|
248
|
+
? String(form.averageMileagePerYear.value)
|
|
249
|
+
: "", onChange: function (e) { return handleSelectChange(e); }, label: "Kilom\u00E9trage moyen annuel" }, { children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 5000 }, { children: "5 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 10000 }, { children: "10 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 15000 }, { children: "15 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 20000 }, { children: "20 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 25000 }, { children: "25 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 30000 }, { children: "30 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 50000 }, { children: "50 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 75000 }, { children: "75 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 100000 }, { children: "100 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 999999 }, { children: "+100 000" }))] })), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: form.averageMileagePerYear.error })] })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Pneumatiques :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: isVehicleTireSizeDefined(vehicle) ? ((0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehicleTire)(vehicle.tireSize) })) : ("-") })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: (0, jsx_runtime_1.jsx)(MovaVehicleTireField_1.default, { vehicleTire: form.tireSize.value, onChangeVehicleTire: handleOnChangeVehicleTire }) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier contr\u00F4le technique :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
|
|
250
|
+
? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
|
|
251
|
+
: "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier contrôle technique", name: "lastInspectionDate", value: form.lastInspectionDate.value, format: "dd/MM/yyyy", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) { return handleChange("lastInspectionDate", e); } }) })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier entretien :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
|
|
252
|
+
? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
|
|
253
|
+
: "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier entretien", name: "lastMaintenanceDate", value: form.lastMaintenanceDate.value, format: "dd/MM/yyyy", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) { return handleChange("lastMaintenanceDate", e); } }) })) })))] })), !localEditMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mt: 3, mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: "CARNET DU V\u00C9HICULE" })) })), vehicle.documents &&
|
|
254
|
+
((_b = vehicle.documents) === null || _b === void 0 ? void 0 : _b.map(function (invoice, index) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: {
|
|
255
|
+
justifyContent: "space-between",
|
|
256
|
+
alignItems: "center",
|
|
257
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 11, sx: { textAlign: "left" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, __assign({ title: invoice.originalFileName }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ color: (0, material_1.darken)("#F29ABA", 0.2), href: invoice.fileSignedUrl, target: "_blank", rel: "noopener" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1" }, { children: invoice.fileName })) })) })) }), (index + 1) * 50), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 1, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ disabled: !(invoice.ownerId.toString() == currentUser.id), onClick: function (e) { return handleDeleteDocument(e, invoice === null || invoice === void 0 ? void 0 : invoice.id); } }, { children: (0, jsx_runtime_1.jsx)(CloseRounded_1.default, {}) })) }), (index + 1) * 100)] }), index + 1)); })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 2, textAlign: "center" } }, { children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("input", { accept: "image/*, application/pdf", type: "file", style: { display: "none" }, ref: invoiceInputRef, id: "raised-button-invoice", onChange: function (e) {
|
|
258
|
+
return handleFileChange(e, docTypeCurrent.current);
|
|
259
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ size: "large", disabled: currentUpload, onClick: function () { return setShowLinkedDocument(true); }, component: "span", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(icons_material_1.AttachFile, {}), sx: {
|
|
260
|
+
alignItems: "center",
|
|
261
|
+
width: "90%",
|
|
262
|
+
mt: 2,
|
|
263
|
+
mb: 1,
|
|
264
|
+
height: "50px",
|
|
265
|
+
p: 1,
|
|
266
|
+
color: (0, material_1.darken)(theme.palette.primary.main, 0.2),
|
|
267
|
+
} }, { children: "Ajouter un document" })), currentUpload && ((0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body2", sx: { animation: "blink 1.5s infinite" } }, { children: "Document en cours d'importation..." }))), sizeLimit && ((0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", sx: { animation: "blink 1.5s infinite" }, color: theme.palette.warning.dark }, { children: "Echec de l'importation car la taille du fichier d\u00E9passe 10Mo" }))), !sizeLimit && ((0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body2" }, { children: "Taille maximale du fichier : 10Mo" })))] }) })) }))] }))] })), (0, jsx_runtime_1.jsxs)(material_1.CardActions, __assign({ sx: { mt: 3, justifyContent: localEditMode ? "center" : "end" } }, { children: [!localEditMode && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickEdit, color: "inherit", sx: { width: "45%" }, variant: "text" }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "MODIFIER"] })) })), localEditMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickCancel, sx: { width: "45%", color: theme.palette.text.secondary }, variant: "text" }, { children: [(0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { mr: 1 } }), "ANNULER"] })), (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickValidate, sx: {
|
|
268
|
+
width: "45%",
|
|
269
|
+
color: (0, material_1.darken)(theme.palette.primary.main, 0.2),
|
|
270
|
+
}, variant: "text" }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "VALIDER"] }))] }))] }))] }))), isShowLinkedDocument && ((0, jsx_runtime_1.jsx)(LinkedDocumentDialog_1.LinkedDocumentDialog, { isVehicle: true, isShowLinkedDocument: isShowLinkedDocument, appType: appType, toggleShowLinkedDocument: toggleShowLinkedDocument, message: messageRGPD })), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmDocumentDelete, onClose: handleCloseConfirmDocumentDelete, onConfirm: handleConfirmDocumentDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce document ?" }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmVehicleDelete, onClose: handleCloseConfirmVehicleDelete, onConfirm: handleConfirmVehicleDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce v\u00E9hicule ?" })] }));
|
|
252
271
|
};
|
|
253
272
|
exports.default = VehicleFullCard;
|
|
@@ -153,7 +153,7 @@ export declare enum DigitalPassportIndex {
|
|
|
153
153
|
export declare enum EventState {
|
|
154
154
|
/**
|
|
155
155
|
* Demande d'empreinte bancaire (pour validation de la demande de RDV)
|
|
156
|
-
|
|
156
|
+
*/
|
|
157
157
|
REQUIRES_PAYMENT_AUTHORIZATION = "REQUIRES_PAYMENT_AUTHORIZATION",
|
|
158
158
|
/**
|
|
159
159
|
* Nouvelle demande de rendez-vous (origine client OU centre)
|
|
@@ -192,7 +192,8 @@ export declare enum EventType {
|
|
|
192
192
|
APPOINTMENT = "APPOINTMENT",
|
|
193
193
|
UNAVAILABILITY = "UNAVAILABILITY",
|
|
194
194
|
NOTE = "NOTE",
|
|
195
|
-
PENDING_APPOINTMENT = "PENDING_APPOINTMENT"
|
|
195
|
+
PENDING_APPOINTMENT = "PENDING_APPOINTMENT",
|
|
196
|
+
WAITING_VEHICLE = "WAITING_VEHICLE"
|
|
196
197
|
}
|
|
197
198
|
export declare enum DayOfWeek {
|
|
198
199
|
MONDAY = "MONDAY",
|
|
@@ -222,12 +223,12 @@ export declare enum DocumentType {
|
|
|
222
223
|
}
|
|
223
224
|
export declare enum MovaAppType {
|
|
224
225
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
* Application Garagiste
|
|
227
|
+
*/
|
|
227
228
|
GARAGE = "GARAGE",
|
|
228
229
|
/**
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
* Application Utilisateur (automobiliste)
|
|
231
|
+
*/
|
|
231
232
|
INDIVIDUAL = "INDIVIDUAL",
|
|
232
233
|
/**
|
|
233
234
|
* Application Administrateur (MovaTeam)
|
|
@@ -175,7 +175,7 @@ var EventState;
|
|
|
175
175
|
(function (EventState) {
|
|
176
176
|
/**
|
|
177
177
|
* Demande d'empreinte bancaire (pour validation de la demande de RDV)
|
|
178
|
-
|
|
178
|
+
*/
|
|
179
179
|
EventState["REQUIRES_PAYMENT_AUTHORIZATION"] = "REQUIRES_PAYMENT_AUTHORIZATION";
|
|
180
180
|
/**
|
|
181
181
|
* Nouvelle demande de rendez-vous (origine client OU centre)
|
|
@@ -216,6 +216,7 @@ var EventType;
|
|
|
216
216
|
EventType["UNAVAILABILITY"] = "UNAVAILABILITY";
|
|
217
217
|
EventType["NOTE"] = "NOTE";
|
|
218
218
|
EventType["PENDING_APPOINTMENT"] = "PENDING_APPOINTMENT";
|
|
219
|
+
EventType["WAITING_VEHICLE"] = "WAITING_VEHICLE";
|
|
219
220
|
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
220
221
|
var DayOfWeek;
|
|
221
222
|
(function (DayOfWeek) {
|
|
@@ -249,12 +250,12 @@ var DocumentType;
|
|
|
249
250
|
var MovaAppType;
|
|
250
251
|
(function (MovaAppType) {
|
|
251
252
|
/**
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
* Application Garagiste
|
|
254
|
+
*/
|
|
254
255
|
MovaAppType["GARAGE"] = "GARAGE";
|
|
255
256
|
/**
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
* Application Utilisateur (automobiliste)
|
|
258
|
+
*/
|
|
258
259
|
MovaAppType["INDIVIDUAL"] = "INDIVIDUAL";
|
|
259
260
|
/**
|
|
260
261
|
* Application Administrateur (MovaTeam)
|
|
@@ -12,6 +12,7 @@ export default class Document {
|
|
|
12
12
|
updateDate?: Date;
|
|
13
13
|
reference?: string;
|
|
14
14
|
rejectReason?: string;
|
|
15
|
-
|
|
15
|
+
validateToken?: string;
|
|
16
|
+
constructor(id: string, ownerId: number, state: DocumentState, fileName: string, originalFileName: string, fileType: string, fileSignedUrl: string, type: DocumentType, creationDate?: Date, updateDate?: Date, reference?: string, validateToken?: string);
|
|
16
17
|
static findByTypeAndReference(documents: Document[], type: DocumentType, reference: string): Document | undefined;
|
|
17
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Document = /** @class */ (function () {
|
|
4
|
-
function Document(id, ownerId, state, fileName, originalFileName, fileType, fileSignedUrl, type, creationDate, updateDate, reference) {
|
|
4
|
+
function Document(id, ownerId, state, fileName, originalFileName, fileType, fileSignedUrl, type, creationDate, updateDate, reference, validateToken) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.state = state;
|
|
7
7
|
this.ownerId = ownerId;
|
|
@@ -13,13 +13,11 @@ var Document = /** @class */ (function () {
|
|
|
13
13
|
this.creationDate = creationDate;
|
|
14
14
|
this.updateDate = updateDate;
|
|
15
15
|
this.reference = reference;
|
|
16
|
+
this.validateToken = validateToken;
|
|
16
17
|
}
|
|
17
18
|
Document.findByTypeAndReference = function (documents, type, reference) {
|
|
18
19
|
if (documents && type && reference) {
|
|
19
|
-
return documents.find(function (document) {
|
|
20
|
-
return document.type === type &&
|
|
21
|
-
document.reference === reference;
|
|
22
|
-
});
|
|
20
|
+
return documents.find(function (document) { return document.type === type && document.reference === reference; });
|
|
23
21
|
}
|
|
24
22
|
return undefined;
|
|
25
23
|
};
|
|
@@ -9,6 +9,15 @@ import Product from "./Product";
|
|
|
9
9
|
import Supplier from "./Supplier";
|
|
10
10
|
import User from "./User";
|
|
11
11
|
import Vehicle from "./Vehicle";
|
|
12
|
+
interface order {
|
|
13
|
+
id: string;
|
|
14
|
+
supplier: Supplier;
|
|
15
|
+
orderPreference: string;
|
|
16
|
+
orderType: string;
|
|
17
|
+
orderDate: Date;
|
|
18
|
+
comment: string;
|
|
19
|
+
deliveryDate: Date | null;
|
|
20
|
+
}
|
|
12
21
|
export default class Event {
|
|
13
22
|
id: string;
|
|
14
23
|
ownerId: number;
|
|
@@ -23,6 +32,7 @@ export default class Event {
|
|
|
23
32
|
prestations?: Prestation[];
|
|
24
33
|
operations?: Operation[];
|
|
25
34
|
products?: Product[];
|
|
35
|
+
orders?: order[];
|
|
26
36
|
/**
|
|
27
37
|
* Un tableau d'invités, dans notre cas d'usage nous n'aurons qu'un invité de type Client
|
|
28
38
|
*/
|
|
@@ -67,6 +77,7 @@ export default class Event {
|
|
|
67
77
|
origin?: string;
|
|
68
78
|
quoteLastSendingTime?: Date;
|
|
69
79
|
invoiceSendingDate?: Date;
|
|
70
|
-
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);
|
|
80
|
+
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[]);
|
|
71
81
|
static getPrestationsList(event: Event): string[];
|
|
72
82
|
}
|
|
83
|
+
export {};
|
package/dist/src/models/Event.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Event = /** @class */ (function () {
|
|
4
|
-
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) {
|
|
4
|
+
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) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.notes = notes;
|
|
7
7
|
this.ownerId = ownerId;
|
|
@@ -37,6 +37,7 @@ var Event = /** @class */ (function () {
|
|
|
37
37
|
this.invoiceSendingDate = invoiceSendingDate
|
|
38
38
|
? new Date(invoiceSendingDate)
|
|
39
39
|
: undefined;
|
|
40
|
+
this.orders = orders;
|
|
40
41
|
}
|
|
41
42
|
Event.getPrestationsList = function (event) {
|
|
42
43
|
if (event && event.prestations) {
|
|
@@ -6,11 +6,12 @@ export default class Product {
|
|
|
6
6
|
name: string;
|
|
7
7
|
code: string;
|
|
8
8
|
type: ProductType;
|
|
9
|
+
order?: String;
|
|
9
10
|
orderPreference?: OrderPreference;
|
|
10
11
|
originReferences?: string[];
|
|
11
12
|
operation?: Operation;
|
|
12
13
|
orderState?: OrderState;
|
|
13
14
|
supplier?: Supplier;
|
|
14
15
|
application?: PartsApplicationType;
|
|
15
|
-
constructor(id: string, code: string, name: string, type: ProductType, orderPreference: OrderPreference, originReferences: string[]);
|
|
16
|
+
constructor(id: string, code: string, name: string, type: ProductType, orderPreference: OrderPreference, originReferences: string[], order?: string);
|
|
16
17
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Product = /** @class */ (function () {
|
|
4
|
-
function Product(id, code, name, type, orderPreference, originReferences) {
|
|
4
|
+
function Product(id, code, name, type, orderPreference, originReferences, order) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.name = name;
|
|
7
7
|
this.code = code;
|
|
8
8
|
this.type = type;
|
|
9
9
|
this.orderPreference = orderPreference;
|
|
10
10
|
this.originReferences = originReferences;
|
|
11
|
+
this.order = order;
|
|
11
12
|
}
|
|
12
13
|
return Product;
|
|
13
14
|
}());
|
|
@@ -19,7 +19,7 @@ export default class GarageService {
|
|
|
19
19
|
static sendGarageMandate(garageId: string): Promise<APIResponse<string>>;
|
|
20
20
|
static getGarageAllData(garageId: string): Promise<APIResponse<Garage>>;
|
|
21
21
|
static createGaragePrestationRequest(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
22
|
-
static getGarageSettings({ garageId }: {
|
|
22
|
+
static getGarageSettings({ garageId, }: {
|
|
23
23
|
garageId: string;
|
|
24
24
|
}): Promise<APIResponse<Garage>>;
|
|
25
25
|
static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>>;
|
|
@@ -44,6 +44,8 @@ export default class GarageService {
|
|
|
44
44
|
static sendCustomerReminder(garageId: string, eventId: string, message: string): Promise<APIResponse<string>>;
|
|
45
45
|
static updateGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
|
|
46
46
|
static sendSupplierRequest(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
|
|
47
|
+
static deleteSupplierRequest(orderId: string): Promise<APIResponse<string>>;
|
|
48
|
+
static receiveSupplierRequest(orderId: string): Promise<APIResponse<string>>;
|
|
47
49
|
static deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>>;
|
|
48
50
|
static createGarageSupplier(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
49
51
|
static updateGarageSupplier(garageId: string, supplierId: number, req: any): Promise<APIResponse<string>>;
|