@movalib/movalib-commons 1.64.2 → 1.64.4
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/MovaVehicleTireField.d.ts +3 -2
- package/dist/src/MovaVehicleTireField.js +15 -11
- package/dist/src/components/vehicle/VehicleFullCard.js +40 -17
- package/dist/src/helpers/Enums.d.ts +2 -1
- package/dist/src/helpers/Enums.js +1 -0
- package/dist/src/helpers/Types.d.ts +5 -0
- package/dist/src/models/Garage.d.ts +3 -1
- package/dist/src/models/Garage.js +3 -1
- package/dist/src/models/Prestation.d.ts +2 -1
- package/dist/src/models/Prestation.js +2 -1
- package/dist/src/models/Vehicle.d.ts +6 -1
- package/dist/src/models/Vehicle.js +6 -1
- package/dist/src/services/GarageService.d.ts +1 -0
- package/dist/src/services/GarageService.js +7 -0
- package/dist/src/services/GarageService.types.d.ts +4 -0
- package/package.json +1 -1
- package/src/MovaVehicleTireField.tsx +118 -107
- package/src/components/vehicle/VehicleFullCard.tsx +144 -70
- package/src/helpers/Enums.ts +1 -0
- package/src/helpers/Types.ts +5 -0
- package/src/models/Garage.ts +4 -1
- package/src/models/Prestation.ts +3 -1
- package/src/models/User.ts +98 -98
- package/src/models/Vehicle.ts +15 -0
- package/src/services/GarageService.types.ts +31 -27
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type FC } from
|
|
2
|
-
import VehicleTire from
|
|
1
|
+
import { type FC } from "react";
|
|
2
|
+
import VehicleTire from "./models/VehicleTire";
|
|
3
3
|
interface MovaVehicleTireFieldProps {
|
|
4
|
+
label?: string;
|
|
4
5
|
vehicleTire?: VehicleTire;
|
|
5
6
|
onChangeVehicleTire: (vehicleTire: VehicleTire, isValid: boolean) => void;
|
|
6
7
|
}
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
var material_1 = require("@mui/material");
|
|
8
8
|
var react_1 = require("react");
|
|
9
|
-
var VehicleTire_1 = __importDefault(require("./models/VehicleTire"));
|
|
10
9
|
var Tools_1 = require("./helpers/Tools");
|
|
10
|
+
var VehicleTire_1 = __importDefault(require("./models/VehicleTire"));
|
|
11
11
|
// Regex pour une taille de pneumatique Française
|
|
12
12
|
var regex = /^[A-Za-z0-9]{7}/;
|
|
13
13
|
var MovaVehicleTireField = function (_a) {
|
|
14
|
-
var vehicleTire = _a.vehicleTire, onChangeVehicleTire = _a.onChangeVehicleTire;
|
|
15
|
-
var _b = (0, react_1.useState)(
|
|
14
|
+
var vehicleTire = _a.vehicleTire, onChangeVehicleTire = _a.onChangeVehicleTire, label = _a.label;
|
|
15
|
+
var _b = (0, react_1.useState)(""), tireInfo = _b[0], setTireInfo = _b[1];
|
|
16
16
|
var _c = (0, react_1.useState)(false), error = _c[0], setError = _c[1];
|
|
17
17
|
var _d = (0, react_1.useState)(0), lastLength = _d[0], setLastLength = _d[1]; // Ajout d'un état pour stocker la longueur précédente
|
|
18
18
|
(0, react_1.useEffect)(function () {
|
|
@@ -25,7 +25,10 @@ var MovaVehicleTireField = function (_a) {
|
|
|
25
25
|
var rawValue = e.target.value;
|
|
26
26
|
// Cette expression régulière supprimera tous les caractères qui ne sont pas des chiffres ou des lettres alphabétiques, à l'exception de "R" et "r".
|
|
27
27
|
// On ne peut saisir que 10 caractères maximum (ex : 245551791V)
|
|
28
|
-
var value = rawValue
|
|
28
|
+
var value = rawValue
|
|
29
|
+
.toUpperCase()
|
|
30
|
+
.replace(/[^0-9A-QS-Za-qs-z]/g, "")
|
|
31
|
+
.slice(0, 15);
|
|
29
32
|
// On valide la saisie (le champ n'est pas obligatoire)
|
|
30
33
|
var isValid = value.length == 0 || (value.length > 0 && regex.test(value));
|
|
31
34
|
setError(!regex.test(value));
|
|
@@ -56,8 +59,9 @@ var MovaVehicleTireField = function (_a) {
|
|
|
56
59
|
//console.log('2 valeu',JSON.stringify(value));
|
|
57
60
|
if (additonalChar) {
|
|
58
61
|
var endString = rawValue.substring(15);
|
|
59
|
-
value =
|
|
60
|
-
|
|
62
|
+
value =
|
|
63
|
+
value.substring(0, 15) + (endString !== undefined ? endString : "");
|
|
64
|
+
console.log(rawValue.split(" ")[5]);
|
|
61
65
|
}
|
|
62
66
|
else {
|
|
63
67
|
var endString = rawValue.substring(12);
|
|
@@ -76,14 +80,14 @@ var MovaVehicleTireField = function (_a) {
|
|
|
76
80
|
else {
|
|
77
81
|
var width = parts[0], _separator = parts[1], height = parts[2], diameter = parts[3], speedIndex = parts[4];
|
|
78
82
|
speedIndex = value.substring(13);
|
|
79
|
-
var vehicleTire_2 = new VehicleTire_1.default(width !== null && width !== void 0 ? width :
|
|
83
|
+
var vehicleTire_2 = new VehicleTire_1.default(width !== null && width !== void 0 ? width : "", height !== null && height !== void 0 ? height : "", diameter !== null && diameter !== void 0 ? diameter : "", speedIndex !== null && speedIndex !== void 0 ? speedIndex : "");
|
|
80
84
|
onChangeVehicleTire(vehicleTire_2, isValid);
|
|
81
85
|
}
|
|
82
86
|
setLastLength(value.length); // Mettre à jour la longueur précédente
|
|
83
87
|
};
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Taille des pneumatiques", variant: "outlined", value: tireInfo, onChange: handleChange, fullWidth: true, placeholder:
|
|
85
|
-
width:
|
|
86
|
-
|
|
87
|
-
}, error: error && tireInfo.length > 0, helperText: error && tireInfo.length > 0 ? "Saisie invalide" :
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TextField, { label: label ? "Taille des pneumatiques ".concat(label) : "Taille des pneumatiques", variant: "outlined", value: tireInfo, onChange: handleChange, fullWidth: true, placeholder: "XXX XX RXX XXX", sx: {
|
|
89
|
+
width: "100%",
|
|
90
|
+
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
91
|
+
}, error: error && tireInfo.length > 0, helperText: error && tireInfo.length > 0 ? "Saisie invalide" : "" }));
|
|
88
92
|
};
|
|
89
93
|
exports.default = MovaVehicleTireField;
|
|
@@ -41,6 +41,11 @@ var initialUserFormState = {
|
|
|
41
41
|
lastMaintenanceDate: { value: null, isValid: true },
|
|
42
42
|
tireBrand: { value: "", isValid: true },
|
|
43
43
|
tireProfile: { value: "", isValid: true },
|
|
44
|
+
secondaryTireDiameter: { value: "", isValid: true },
|
|
45
|
+
secondaryTireHeight: { value: "", isValid: true },
|
|
46
|
+
secondaryTireSpeedIndex: { value: "", isValid: true },
|
|
47
|
+
secondaryTireWidth: { value: "", isValid: true },
|
|
48
|
+
secondaryTireSize: { value: null, isValid: true },
|
|
44
49
|
};
|
|
45
50
|
var VehicleFullCard = function (_a) {
|
|
46
51
|
var _b;
|
|
@@ -66,26 +71,24 @@ var VehicleFullCard = function (_a) {
|
|
|
66
71
|
initForm();
|
|
67
72
|
}, [vehicle]);
|
|
68
73
|
var initForm = function () {
|
|
69
|
-
if (vehicle)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireDiameter: __assign(__assign({}, prevForm["tireDiameter"]), { value: vehicle.tireDiameter }) })); });
|
|
75
|
-
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireSpeedIndex: __assign(__assign({}, prevForm["tireSpeedIndex"]), { value: vehicle.tireSpeedIndex }) })); });
|
|
76
|
-
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { lastInspectionDate: __assign(__assign({}, prevForm["lastInspectionDate"]), { value: vehicle.lastInspectionDate
|
|
74
|
+
if (!vehicle)
|
|
75
|
+
return;
|
|
76
|
+
console.log("vehicle", vehicle);
|
|
77
|
+
setForm(function (prevForm) {
|
|
78
|
+
var updatedForm = __assign(__assign({}, prevForm), { currentMileage: __assign(__assign({}, prevForm.currentMileage), { value: vehicle.currentMileage }), averageMileagePerYear: __assign(__assign({}, prevForm.averageMileagePerYear), { value: vehicle.averageMileagePerYear }), tireWidth: __assign(__assign({}, prevForm.tireWidth), { value: vehicle.tireWidth }), tireHeight: __assign(__assign({}, prevForm.tireHeight), { value: vehicle.tireHeight }), tireDiameter: __assign(__assign({}, prevForm.tireDiameter), { value: vehicle.tireDiameter }), tireSpeedIndex: __assign(__assign({}, prevForm.tireSpeedIndex), { value: vehicle.tireSpeedIndex }), secondaryTireWidth: __assign(__assign({}, prevForm.secondaryTireWidth), { value: vehicle.secondaryTireWidth }), secondaryTireHeight: __assign(__assign({}, prevForm.secondaryTireHeight), { value: vehicle.secondaryTireHeight }), secondaryTireDiameter: __assign(__assign({}, prevForm.secondaryTireDiameter), { value: vehicle.secondaryTireDiameter }), secondaryTireSpeedIndex: __assign(__assign({}, prevForm.secondaryTireSpeedIndex), { value: vehicle.secondaryTireSpeedIndex }), lastInspectionDate: __assign(__assign({}, prevForm.lastInspectionDate), { value: vehicle.lastInspectionDate
|
|
77
79
|
? new Date(vehicle.lastInspectionDate)
|
|
78
|
-
: null }) })
|
|
79
|
-
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { lastMaintenanceDate: __assign(__assign({}, prevForm["lastMaintenanceDate"]), { value: vehicle.lastMaintenanceDate
|
|
80
|
+
: null }), lastMaintenanceDate: __assign(__assign({}, prevForm.lastMaintenanceDate), { value: vehicle.lastMaintenanceDate
|
|
80
81
|
? new Date(vehicle.lastMaintenanceDate)
|
|
81
|
-
: null }) }))
|
|
82
|
-
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireBrand: __assign(__assign({}, prevForm["tireBrand"]), { value: vehicle.tireBrand }) })); });
|
|
83
|
-
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireProfile: __assign(__assign({}, prevForm["tireProfile"]), { value: vehicle.tireProfile }) })); });
|
|
82
|
+
: null }), tireBrand: __assign(__assign({}, prevForm.tireBrand), { value: vehicle.tireBrand }), tireProfile: __assign(__assign({}, prevForm.tireProfile), { value: vehicle.tireProfile }) });
|
|
84
83
|
if (isVehicleTireSizeDefined(vehicle)) {
|
|
85
|
-
|
|
84
|
+
updatedForm.tireSize = __assign(__assign({}, prevForm.tireSize), { value: vehicle.tireSize });
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
if (isVehicleSecondaryTireSizeDefined(vehicle)) {
|
|
87
|
+
updatedForm.secondaryTireSize = __assign(__assign({}, prevForm.secondaryTireSize), { value: vehicle.secondaryTireSize });
|
|
88
|
+
}
|
|
89
|
+
return updatedForm;
|
|
90
|
+
});
|
|
91
|
+
Logger_1.default.info(form);
|
|
89
92
|
};
|
|
90
93
|
var toggleShowLinkedDocument = function (docType) {
|
|
91
94
|
setShowLinkedDocument(!isShowLinkedDocument);
|
|
@@ -100,6 +103,11 @@ var VehicleFullCard = function (_a) {
|
|
|
100
103
|
var isVehicleTireSizeDefined = function (vehicle) {
|
|
101
104
|
return (vehicle.tireSize && vehicle.tireSize.diameter && vehicle.tireSize.height);
|
|
102
105
|
};
|
|
106
|
+
var isVehicleSecondaryTireSizeDefined = function (vehicle) {
|
|
107
|
+
return (vehicle.secondaryTireSize &&
|
|
108
|
+
vehicle.secondaryTireSize.diameter &&
|
|
109
|
+
vehicle.secondaryTireSize.height);
|
|
110
|
+
};
|
|
103
111
|
var validateForm = function () {
|
|
104
112
|
var newForm = __assign({}, form);
|
|
105
113
|
// Validator pour les champs obligatoires
|
|
@@ -162,6 +170,9 @@ var VehicleFullCard = function (_a) {
|
|
|
162
170
|
var handleOnChangeVehicleTire = function (vehicleTire, isValid) {
|
|
163
171
|
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireSize: __assign(__assign({}, prevForm["tireSize"]), { value: vehicleTire, isValid: isValid }) })); });
|
|
164
172
|
};
|
|
173
|
+
var handleOnChangeVehicleSecondaryTire = function (vehicleTire, isValid) {
|
|
174
|
+
setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { secondaryTireSize: __assign(__assign({}, prevForm["secondaryTireSize"]), { value: vehicleTire, isValid: isValid }) })); });
|
|
175
|
+
};
|
|
165
176
|
var handleOnClickDeleteVehicle = function (e) {
|
|
166
177
|
e.preventDefault();
|
|
167
178
|
setOpenConfirmVehicleDelete(true);
|
|
@@ -189,6 +200,18 @@ var VehicleFullCard = function (_a) {
|
|
|
189
200
|
tireSpeedIndex: form.tireSize.isValid && form.tireSize.value
|
|
190
201
|
? form.tireSize.value.speedIndex
|
|
191
202
|
: undefined,
|
|
203
|
+
secondaryTireWidth: form.secondaryTireSize && form.secondaryTireSize.value
|
|
204
|
+
? form.secondaryTireSize.value.width
|
|
205
|
+
: undefined,
|
|
206
|
+
secondaryTireHeight: form.secondaryTireSize && form.secondaryTireSize.value
|
|
207
|
+
? form.secondaryTireSize.value.height
|
|
208
|
+
: undefined,
|
|
209
|
+
secondaryTireDiameter: form.secondaryTireSize && form.secondaryTireSize.value
|
|
210
|
+
? form.secondaryTireSize.value.diameter
|
|
211
|
+
: undefined,
|
|
212
|
+
secondaryTireSpeedIndex: form.secondaryTireSize && form.secondaryTireSize.value
|
|
213
|
+
? form.secondaryTireSize.value.speedIndex
|
|
214
|
+
: undefined,
|
|
192
215
|
lastInspectionDate: form.lastInspectionDate.value,
|
|
193
216
|
lastMaintenanceDate: form.lastMaintenanceDate.value,
|
|
194
217
|
tireBrand: form.tireBrand.value,
|
|
@@ -248,7 +271,7 @@ var VehicleFullCard = function (_a) {
|
|
|
248
271
|
? form.currentMileage.error
|
|
249
272
|
: "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
|
|
250
273
|
? String(form.averageMileagePerYear.value)
|
|
251
|
-
: "", 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.
|
|
274
|
+
: "", 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)(jsx_runtime_1.Fragment, { children: [(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.jsxs)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: ["Pneumatiques", " ", isVehicleSecondaryTireSizeDefined(vehicle) ? "AV" : "", " ", ":"] })) })), (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) })) : ("-") })) }))] })), isVehicleSecondaryTireSizeDefined(vehicle) && ((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 AR:" })) })), (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: isVehicleSecondaryTireSizeDefined(vehicle) ? ((0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehicleTire)(vehicle.secondaryTireSize) })) : ("-") })) }))] })))] })), !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: "Marque 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: vehicle.tireBrand ? (0, jsx_runtime_1.jsx)("b", { children: vehicle.tireBrand }) : "-" })) }))] }))), !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: "Mod\u00E8le 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: vehicle.tireProfile ? (0, jsx_runtime_1.jsx)("b", { children: vehicle.tireProfile }) : "-" })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(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, { label: "AV", vehicleTire: form.tireSize.value, onChangeVehicleTire: handleOnChangeVehicleTire }) })), (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, { label: "AR", vehicleTire: form.secondaryTireSize.value, onChangeVehicleTire: handleOnChangeVehicleSecondaryTire }) }))] })), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Mod\u00E8le pneumatique", name: "tireProfile", variant: "outlined", value: form.tireProfile.value, onChange: function (e) { return handleInputChange(e); }, error: Boolean(form.tireProfile.error), sx: {
|
|
252
275
|
width: "100%",
|
|
253
276
|
mt: 2,
|
|
254
277
|
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
@@ -216,7 +216,8 @@ export declare enum QuoteState {
|
|
|
216
216
|
QUOTE_DRAFT = "QUOTE_DRAFT",
|
|
217
217
|
QUOTE_SENT = "QUOTE_SENT",
|
|
218
218
|
QUOTE_ACCEPTED = "QUOTE_ACCEPTED",
|
|
219
|
-
QUOTE_REJECTED = "QUOTE_REJECTED"
|
|
219
|
+
QUOTE_REJECTED = "QUOTE_REJECTED",
|
|
220
|
+
QUOTE_CANCELLED = "CANCELLED"
|
|
220
221
|
}
|
|
221
222
|
export declare enum DocumentType {
|
|
222
223
|
USER_BANK_DETAILS = "USER_BANK_DETAILS",
|
|
@@ -243,6 +243,7 @@ var QuoteState;
|
|
|
243
243
|
QuoteState["QUOTE_SENT"] = "QUOTE_SENT";
|
|
244
244
|
QuoteState["QUOTE_ACCEPTED"] = "QUOTE_ACCEPTED";
|
|
245
245
|
QuoteState["QUOTE_REJECTED"] = "QUOTE_REJECTED";
|
|
246
|
+
QuoteState["QUOTE_CANCELLED"] = "CANCELLED";
|
|
246
247
|
})(QuoteState = exports.QuoteState || (exports.QuoteState = {}));
|
|
247
248
|
var DocumentType;
|
|
248
249
|
(function (DocumentType) {
|
|
@@ -18,6 +18,11 @@ export type MovaVehicleForm = {
|
|
|
18
18
|
lastMaintenanceDate: MovaFormField;
|
|
19
19
|
tireBrand: MovaFormField;
|
|
20
20
|
tireProfile: MovaFormField;
|
|
21
|
+
secondaryTireSize: MovaFormField;
|
|
22
|
+
secondaryTireWidth: MovaFormField;
|
|
23
|
+
secondaryTireHeight: MovaFormField;
|
|
24
|
+
secondaryTireDiameter: MovaFormField;
|
|
25
|
+
secondaryTireSpeedIndex: MovaFormField;
|
|
21
26
|
};
|
|
22
27
|
/**
|
|
23
28
|
* Type utilisé pour définir un interval sur une objet Schedule
|
|
@@ -58,9 +58,11 @@ export default class Garage {
|
|
|
58
58
|
billingActive?: boolean;
|
|
59
59
|
billingToken?: string;
|
|
60
60
|
billingSimulationActive?: boolean;
|
|
61
|
+
demoBillingActive?: boolean;
|
|
61
62
|
appId?: number;
|
|
62
63
|
quoteRequestStart?: Date;
|
|
63
64
|
companyRegistrationNumber?: string;
|
|
64
65
|
establishmentRegistrationNumber?: string;
|
|
65
|
-
|
|
66
|
+
reopeningDate?: Date;
|
|
67
|
+
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, 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, quoteRequestStart?: Date, reopeningDate?: Date, demoBillingActive?: boolean);
|
|
66
68
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Garage = /** @class */ (function () {
|
|
4
|
-
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, quoteRequestStart) {
|
|
4
|
+
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, quoteRequestStart, reopeningDate, demoBillingActive) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.adminId = adminId;
|
|
7
7
|
this.name = name;
|
|
@@ -34,6 +34,8 @@ var Garage = /** @class */ (function () {
|
|
|
34
34
|
this.quoteRequestStart = quoteRequestStart;
|
|
35
35
|
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
36
36
|
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
37
|
+
this.reopeningDate = reopeningDate;
|
|
38
|
+
this.demoBillingActive = demoBillingActive;
|
|
37
39
|
}
|
|
38
40
|
return Garage;
|
|
39
41
|
}());
|
|
@@ -22,10 +22,11 @@ export default class Prestation {
|
|
|
22
22
|
* La notion de position (ou d'ordre) peut être utile à l'affichage d'une liste de prestation par exemple
|
|
23
23
|
*/
|
|
24
24
|
position: number;
|
|
25
|
+
availableOnline: boolean;
|
|
25
26
|
active: boolean;
|
|
26
27
|
state: PrestationState;
|
|
27
28
|
multipleApplication: boolean;
|
|
28
29
|
operationsVisible: boolean;
|
|
29
30
|
categoryCode: string;
|
|
30
|
-
constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operationsVisible: boolean, categoryCode: string, operations?: Operation[]);
|
|
31
|
+
constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operationsVisible: boolean, categoryCode: string, availableOnline: boolean, operations?: Operation[]);
|
|
31
32
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Prestation = /** @class */ (function () {
|
|
4
|
-
function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operationsVisible, categoryCode, operations) {
|
|
4
|
+
function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operationsVisible, categoryCode, availableOnline, operations) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.code = code;
|
|
7
7
|
this.name = name;
|
|
@@ -16,6 +16,7 @@ var Prestation = /** @class */ (function () {
|
|
|
16
16
|
this.operations = operations;
|
|
17
17
|
this.state = state;
|
|
18
18
|
this.categoryCode = categoryCode;
|
|
19
|
+
this.availableOnline = availableOnline;
|
|
19
20
|
}
|
|
20
21
|
return Prestation;
|
|
21
22
|
}());
|
|
@@ -25,6 +25,11 @@ export default class Vehicle {
|
|
|
25
25
|
foreignPlate: boolean;
|
|
26
26
|
tireBrand?: string;
|
|
27
27
|
tireProfile?: string;
|
|
28
|
-
|
|
28
|
+
secondaryTireDiameter: string;
|
|
29
|
+
secondaryTireHeight: string;
|
|
30
|
+
secondaryTireSpeedIndex: string;
|
|
31
|
+
secondaryTireWidth: string;
|
|
32
|
+
secondaryTireSize: VehicleTire;
|
|
33
|
+
constructor(id: number, ownerId: number, averageMileagePerYear: number, plate: string, brand: string, model: string, version: string, vin: string, currentMileage: number, digitalPassportIndex: DigitalPassportIndex, firstRegistrationDate: Date, ktype: string, tireDiameter: string, tireHeight: string, tireSpeedIndex: string, tireWidth: string, documents: Document[], tireSize: VehicleTire, lastInspectionDate: Date, lastMaintenanceDate: Date, foreignPlate: boolean, secondaryTireDiameter: string, secondaryTireHeight: string, secondaryTireSpeedIndex: string, secondaryTireWidth: string, secondaryTireSize: VehicleTire, tireBrand?: string, tireProfile?: string);
|
|
29
34
|
getVehicleLabel(): string;
|
|
30
35
|
}
|
|
@@ -11,7 +11,7 @@ Carburant : Essence
|
|
|
11
11
|
Cylindrée : 1984 cm3
|
|
12
12
|
Puissance : 140 KW (190 HP) */
|
|
13
13
|
var Vehicle = /** @class */ (function () {
|
|
14
|
-
function Vehicle(id, ownerId, averageMileagePerYear, plate, brand, model, version, vin, currentMileage, digitalPassportIndex, firstRegistrationDate, ktype, tireDiameter, tireHeight, tireSpeedIndex, tireWidth, documents, tireSize, lastInspectionDate, lastMaintenanceDate, foreignPlate, tireBrand, tireProfile) {
|
|
14
|
+
function Vehicle(id, ownerId, averageMileagePerYear, plate, brand, model, version, vin, currentMileage, digitalPassportIndex, firstRegistrationDate, ktype, tireDiameter, tireHeight, tireSpeedIndex, tireWidth, documents, tireSize, lastInspectionDate, lastMaintenanceDate, foreignPlate, secondaryTireDiameter, secondaryTireHeight, secondaryTireSpeedIndex, secondaryTireWidth, secondaryTireSize, tireBrand, tireProfile) {
|
|
15
15
|
this.id = id;
|
|
16
16
|
this.ownerId = ownerId;
|
|
17
17
|
this.averageMileagePerYear = averageMileagePerYear;
|
|
@@ -35,6 +35,11 @@ var Vehicle = /** @class */ (function () {
|
|
|
35
35
|
this.foreignPlate = foreignPlate;
|
|
36
36
|
this.tireBrand = tireBrand;
|
|
37
37
|
this.tireProfile = tireProfile;
|
|
38
|
+
this.secondaryTireDiameter = secondaryTireDiameter;
|
|
39
|
+
this.secondaryTireHeight = secondaryTireHeight;
|
|
40
|
+
this.secondaryTireSpeedIndex = secondaryTireSpeedIndex;
|
|
41
|
+
this.secondaryTireWidth = secondaryTireWidth;
|
|
42
|
+
this.secondaryTireSize = secondaryTireSize;
|
|
38
43
|
}
|
|
39
44
|
Vehicle.prototype.getVehicleLabel = function () {
|
|
40
45
|
return "".concat(this.brand, " ").concat(this.model, " ").concat(this.version);
|
|
@@ -8,6 +8,7 @@ export default class GarageService {
|
|
|
8
8
|
static toogleUrgentQuote(garageId: string, quoteId: string): Promise<APIResponse<string>>;
|
|
9
9
|
static updatePaymentAuthorization(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
10
10
|
static toogleGaragePaymentAuthorization(garageId: string): Promise<APIResponse<string>>;
|
|
11
|
+
static toogleGarageSimulationDemoBilling(garageId: string): Promise<APIResponse<string>>;
|
|
11
12
|
static toogleEventVehicleReceived(garageId: string, eventId: string): Promise<APIResponse<string>>;
|
|
12
13
|
static setOrderedEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
|
|
13
14
|
static deleteEventEmployee(garageId: string, eventId: string): Promise<APIResponse<string>>;
|
|
@@ -38,6 +38,13 @@ var GarageService = /** @class */ (function () {
|
|
|
38
38
|
appType: Enums_1.MovaAppType.GARAGE,
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
+
GarageService.toogleGarageSimulationDemoBilling = function (garageId) {
|
|
42
|
+
return (0, ApiHelper_1.request)({
|
|
43
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/demo-billing/toggle"),
|
|
44
|
+
method: Enums_1.APIMethod.PATCH,
|
|
45
|
+
appType: Enums_1.MovaAppType.GARAGE,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
41
48
|
GarageService.toogleEventVehicleReceived = function (garageId, eventId) {
|
|
42
49
|
return (0, ApiHelper_1.request)({
|
|
43
50
|
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/events/").concat(eventId, "/vehicle-received"),
|
|
@@ -14,6 +14,10 @@ export type AddCustomerVehicleParams = {
|
|
|
14
14
|
tireHeight?: string;
|
|
15
15
|
tireDiameter?: string;
|
|
16
16
|
tireSpeedIndex?: string;
|
|
17
|
+
secondaryTireWidth?: string;
|
|
18
|
+
secondaryTireHeight?: string;
|
|
19
|
+
secondaryTireDiameter?: string;
|
|
20
|
+
secondaryTireSpeedIndex?: string;
|
|
17
21
|
lastMaintenanceDate?: string;
|
|
18
22
|
lastInspectionDate?: string;
|
|
19
23
|
isForeignPlate?: boolean;
|