@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,116 +1,127 @@
|
|
|
1
|
-
import { TextField } from
|
|
2
|
-
import { useState, type FC
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { TextField } from "@mui/material";
|
|
2
|
+
import { useEffect, useState, type FC } from "react";
|
|
3
|
+
import { formatVehicleTire } from "./helpers/Tools";
|
|
4
|
+
import VehicleTire from "./models/VehicleTire";
|
|
5
5
|
|
|
6
6
|
interface MovaVehicleTireFieldProps {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
label?: string;
|
|
8
|
+
vehicleTire?: VehicleTire;
|
|
9
|
+
onChangeVehicleTire: (vehicleTire: VehicleTire, isValid: boolean) => void;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
// Regex pour une taille de pneumatique Française
|
|
12
13
|
const regex = /^[A-Za-z0-9]{7}/;
|
|
13
14
|
|
|
14
|
-
const MovaVehicleTireField: FC<MovaVehicleTireFieldProps> = ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
15
|
+
const MovaVehicleTireField: FC<MovaVehicleTireFieldProps> = ({
|
|
16
|
+
vehicleTire,
|
|
17
|
+
onChangeVehicleTire,
|
|
18
|
+
label,
|
|
19
|
+
}) => {
|
|
20
|
+
const [tireInfo, setTireInfo] = useState("");
|
|
21
|
+
const [error, setError] = useState<boolean>(false);
|
|
22
|
+
const [lastLength, setLastLength] = useState<number>(0); // Ajout d'un état pour stocker la longueur précédente
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (vehicleTire) {
|
|
26
|
+
setTireInfo(formatVehicleTire(vehicleTire));
|
|
27
|
+
}
|
|
28
|
+
}, [vehicleTire]);
|
|
29
|
+
|
|
30
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
const rawValue = e.target.value;
|
|
33
|
+
// 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".
|
|
34
|
+
// On ne peut saisir que 10 caractères maximum (ex : 245551791V)
|
|
35
|
+
let value = rawValue
|
|
36
|
+
.toUpperCase()
|
|
37
|
+
.replace(/[^0-9A-QS-Za-qs-z]/g, "")
|
|
38
|
+
.slice(0, 15);
|
|
39
|
+
|
|
40
|
+
// On valide la saisie (le champ n'est pas obligatoire)
|
|
41
|
+
let isValid = value.length == 0 || (value.length > 0 && regex.test(value));
|
|
42
|
+
setError(!regex.test(value));
|
|
43
|
+
|
|
44
|
+
// Vérifier si l'utilisateur est en train de supprimer un caractère
|
|
45
|
+
const isDeleting = rawValue.length < lastLength;
|
|
46
|
+
// Ajout du " / "
|
|
47
|
+
if (value.length >= 3 && !(rawValue.length == 5 && isDeleting)) {
|
|
48
|
+
value = `${value.substring(0, 3)} / ${value.substring(3)}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Ajout du " R"
|
|
52
|
+
if (value.length >= 8 && !(rawValue.length == 9 && isDeleting)) {
|
|
53
|
+
value = `${value.substring(0, 8)} R${value.substring(8)}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let additonalChar = false;
|
|
57
|
+
|
|
58
|
+
if (value[12] && /^[A-Z]$/.test(value[12])) {
|
|
59
|
+
if (rawValue.length === 14 && isDeleting) {
|
|
60
|
+
value = `${value.substring(0, 12)}`;
|
|
61
|
+
} else {
|
|
62
|
+
additonalChar = true;
|
|
63
|
+
value = `${value.substring(0, 13)} ${value.substring(13)}`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Ajout d'un espace après la saisie du diamètre des pneus
|
|
68
|
+
if (value.length >= 12 && !(rawValue.length <= 12 && isDeleting)) {
|
|
69
|
+
value = `${value.substring(0, 12)} ${value.substring(12)}`;
|
|
70
|
+
}
|
|
71
|
+
//console.log('2 valeu',JSON.stringify(value));
|
|
72
|
+
if (additonalChar) {
|
|
73
|
+
let endString = rawValue.substring(15);
|
|
74
|
+
value =
|
|
75
|
+
value.substring(0, 15) + (endString !== undefined ? endString : "");
|
|
76
|
+
console.log(rawValue.split(" ")[5]);
|
|
77
|
+
} else {
|
|
78
|
+
let endString = rawValue.substring(12);
|
|
79
|
+
if (endString && endString.length > 1) {
|
|
80
|
+
value = value.substring(0, 13) + endString.trimStart();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const parts = value.split(" ");
|
|
85
|
+
|
|
86
|
+
setTireInfo(value);
|
|
87
|
+
if (value.length >= 16) {
|
|
88
|
+
let [width, _separator, height, diameter, speedIndex] = parts;
|
|
89
|
+
speedIndex = value.substring(13);
|
|
90
|
+
const vehicleTire = new VehicleTire(width, height, diameter, speedIndex);
|
|
91
|
+
onChangeVehicleTire(vehicleTire, isValid);
|
|
92
|
+
} else {
|
|
93
|
+
let [width, _separator, height, diameter, speedIndex] = parts;
|
|
94
|
+
speedIndex = value.substring(13);
|
|
95
|
+
const vehicleTire = new VehicleTire(
|
|
96
|
+
width ?? "",
|
|
97
|
+
height ?? "",
|
|
98
|
+
diameter ?? "",
|
|
99
|
+
speedIndex ?? ""
|
|
100
|
+
);
|
|
101
|
+
onChangeVehicleTire(vehicleTire, isValid);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setLastLength(value.length); // Mettre à jour la longueur précédente
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<TextField
|
|
109
|
+
label={
|
|
110
|
+
label ? `Taille des pneumatiques ${label}` : "Taille des pneumatiques"
|
|
111
|
+
}
|
|
112
|
+
variant="outlined"
|
|
113
|
+
value={tireInfo}
|
|
114
|
+
onChange={handleChange}
|
|
115
|
+
fullWidth
|
|
116
|
+
placeholder="XXX XX RXX XXX"
|
|
117
|
+
sx={{
|
|
118
|
+
width: "100%",
|
|
119
|
+
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
120
|
+
}}
|
|
121
|
+
error={error && tireInfo.length > 0}
|
|
122
|
+
helperText={error && tireInfo.length > 0 ? "Saisie invalide" : ""}
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
115
126
|
|
|
116
127
|
export default MovaVehicleTireField;
|
|
@@ -72,6 +72,11 @@ const initialUserFormState = {
|
|
|
72
72
|
lastMaintenanceDate: { value: null, isValid: true },
|
|
73
73
|
tireBrand: { value: "", isValid: true },
|
|
74
74
|
tireProfile: { value: "", isValid: true },
|
|
75
|
+
secondaryTireDiameter: { value: "", isValid: true },
|
|
76
|
+
secondaryTireHeight: { value: "", isValid: true },
|
|
77
|
+
secondaryTireSpeedIndex: { value: "", isValid: true },
|
|
78
|
+
secondaryTireWidth: { value: "", isValid: true },
|
|
79
|
+
secondaryTireSize: { value: null, isValid: true },
|
|
75
80
|
};
|
|
76
81
|
|
|
77
82
|
const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
@@ -127,79 +132,75 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
127
132
|
}, [vehicle]);
|
|
128
133
|
|
|
129
134
|
const initForm = () => {
|
|
130
|
-
if (vehicle)
|
|
131
|
-
|
|
135
|
+
if (!vehicle) return;
|
|
136
|
+
console.log("vehicle", vehicle);
|
|
137
|
+
setForm((prevForm) => {
|
|
138
|
+
const updatedForm = {
|
|
132
139
|
...prevForm,
|
|
133
140
|
currentMileage: {
|
|
134
|
-
...prevForm
|
|
141
|
+
...prevForm.currentMileage,
|
|
135
142
|
value: vehicle.currentMileage,
|
|
136
143
|
},
|
|
137
|
-
}));
|
|
138
|
-
setForm((prevForm) => ({
|
|
139
|
-
...prevForm,
|
|
140
144
|
averageMileagePerYear: {
|
|
141
|
-
...prevForm
|
|
145
|
+
...prevForm.averageMileagePerYear,
|
|
142
146
|
value: vehicle.averageMileagePerYear,
|
|
143
147
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
...prevForm,
|
|
147
|
-
tireWidth: { ...prevForm["tireWidth"], value: vehicle.tireWidth },
|
|
148
|
-
}));
|
|
149
|
-
setForm((prevForm) => ({
|
|
150
|
-
...prevForm,
|
|
151
|
-
tireHeight: { ...prevForm["tireHeight"], value: vehicle.tireHeight },
|
|
152
|
-
}));
|
|
153
|
-
setForm((prevForm) => ({
|
|
154
|
-
...prevForm,
|
|
155
|
-
tireDiameter: {
|
|
156
|
-
...prevForm["tireDiameter"],
|
|
157
|
-
value: vehicle.tireDiameter,
|
|
158
|
-
},
|
|
159
|
-
}));
|
|
160
|
-
setForm((prevForm) => ({
|
|
161
|
-
...prevForm,
|
|
148
|
+
tireWidth: { ...prevForm.tireWidth, value: vehicle.tireWidth },
|
|
149
|
+
tireHeight: { ...prevForm.tireHeight, value: vehicle.tireHeight },
|
|
150
|
+
tireDiameter: { ...prevForm.tireDiameter, value: vehicle.tireDiameter },
|
|
162
151
|
tireSpeedIndex: {
|
|
163
|
-
...prevForm
|
|
152
|
+
...prevForm.tireSpeedIndex,
|
|
164
153
|
value: vehicle.tireSpeedIndex,
|
|
165
154
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
155
|
+
secondaryTireWidth: {
|
|
156
|
+
...prevForm.secondaryTireWidth,
|
|
157
|
+
value: vehicle.secondaryTireWidth,
|
|
158
|
+
},
|
|
159
|
+
secondaryTireHeight: {
|
|
160
|
+
...prevForm.secondaryTireHeight,
|
|
161
|
+
value: vehicle.secondaryTireHeight,
|
|
162
|
+
},
|
|
163
|
+
secondaryTireDiameter: {
|
|
164
|
+
...prevForm.secondaryTireDiameter,
|
|
165
|
+
value: vehicle.secondaryTireDiameter,
|
|
166
|
+
},
|
|
167
|
+
secondaryTireSpeedIndex: {
|
|
168
|
+
...prevForm.secondaryTireSpeedIndex,
|
|
169
|
+
value: vehicle.secondaryTireSpeedIndex,
|
|
170
|
+
},
|
|
169
171
|
lastInspectionDate: {
|
|
170
|
-
...prevForm
|
|
172
|
+
...prevForm.lastInspectionDate,
|
|
171
173
|
value: vehicle.lastInspectionDate
|
|
172
174
|
? new Date(vehicle.lastInspectionDate)
|
|
173
175
|
: null,
|
|
174
176
|
},
|
|
175
|
-
}));
|
|
176
|
-
setForm((prevForm) => ({
|
|
177
|
-
...prevForm,
|
|
178
177
|
lastMaintenanceDate: {
|
|
179
|
-
...prevForm
|
|
178
|
+
...prevForm.lastMaintenanceDate,
|
|
180
179
|
value: vehicle.lastMaintenanceDate
|
|
181
180
|
? new Date(vehicle.lastMaintenanceDate)
|
|
182
181
|
: null,
|
|
183
182
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
tireBrand: { ...prevForm["tireBrand"], value: vehicle.tireBrand },
|
|
188
|
-
}));
|
|
189
|
-
setForm((prevForm) => ({
|
|
190
|
-
...prevForm,
|
|
191
|
-
tireProfile: { ...prevForm["tireProfile"], value: vehicle.tireProfile },
|
|
192
|
-
}));
|
|
183
|
+
tireBrand: { ...prevForm.tireBrand, value: vehicle.tireBrand },
|
|
184
|
+
tireProfile: { ...prevForm.tireProfile, value: vehicle.tireProfile },
|
|
185
|
+
};
|
|
193
186
|
|
|
194
187
|
if (isVehicleTireSizeDefined(vehicle)) {
|
|
195
|
-
|
|
196
|
-
...prevForm,
|
|
197
|
-
|
|
198
|
-
}
|
|
188
|
+
updatedForm.tireSize = {
|
|
189
|
+
...prevForm.tireSize,
|
|
190
|
+
value: vehicle.tireSize,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (isVehicleSecondaryTireSizeDefined(vehicle)) {
|
|
194
|
+
updatedForm.secondaryTireSize = {
|
|
195
|
+
...prevForm.secondaryTireSize,
|
|
196
|
+
value: vehicle.secondaryTireSize,
|
|
197
|
+
};
|
|
199
198
|
}
|
|
200
199
|
|
|
201
|
-
|
|
202
|
-
}
|
|
200
|
+
return updatedForm;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
Logger.info(form);
|
|
203
204
|
};
|
|
204
205
|
|
|
205
206
|
const toggleShowLinkedDocument = (docType: DocumentType | null) => {
|
|
@@ -217,6 +218,13 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
217
218
|
vehicle.tireSize && vehicle.tireSize.diameter && vehicle.tireSize.height
|
|
218
219
|
);
|
|
219
220
|
};
|
|
221
|
+
const isVehicleSecondaryTireSizeDefined = (vehicle: Vehicle) => {
|
|
222
|
+
return (
|
|
223
|
+
vehicle.secondaryTireSize &&
|
|
224
|
+
vehicle.secondaryTireSize.diameter &&
|
|
225
|
+
vehicle.secondaryTireSize.height
|
|
226
|
+
);
|
|
227
|
+
};
|
|
220
228
|
|
|
221
229
|
const validateForm = () => {
|
|
222
230
|
let newForm: MovaVehicleForm = { ...form };
|
|
@@ -316,6 +324,20 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
316
324
|
}));
|
|
317
325
|
};
|
|
318
326
|
|
|
327
|
+
const handleOnChangeVehicleSecondaryTire = (
|
|
328
|
+
vehicleTire: VehicleTire,
|
|
329
|
+
isValid: boolean
|
|
330
|
+
) => {
|
|
331
|
+
setForm((prevForm) => ({
|
|
332
|
+
...prevForm,
|
|
333
|
+
secondaryTireSize: {
|
|
334
|
+
...prevForm["secondaryTireSize"],
|
|
335
|
+
value: vehicleTire,
|
|
336
|
+
isValid: isValid,
|
|
337
|
+
},
|
|
338
|
+
}));
|
|
339
|
+
};
|
|
340
|
+
|
|
319
341
|
const handleOnClickDeleteVehicle = (
|
|
320
342
|
e: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
|
321
343
|
) => {
|
|
@@ -355,6 +377,23 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
355
377
|
form.tireSize.isValid && form.tireSize.value
|
|
356
378
|
? (form.tireSize.value as VehicleTire).speedIndex
|
|
357
379
|
: undefined,
|
|
380
|
+
secondaryTireWidth:
|
|
381
|
+
form.secondaryTireSize && form.secondaryTireSize.value
|
|
382
|
+
? (form.secondaryTireSize.value as VehicleTire).width
|
|
383
|
+
: undefined,
|
|
384
|
+
secondaryTireHeight:
|
|
385
|
+
form.secondaryTireSize && form.secondaryTireSize.value
|
|
386
|
+
? (form.secondaryTireSize.value as VehicleTire).height
|
|
387
|
+
: undefined,
|
|
388
|
+
secondaryTireDiameter:
|
|
389
|
+
form.secondaryTireSize && form.secondaryTireSize.value
|
|
390
|
+
? (form.secondaryTireSize.value as VehicleTire).diameter
|
|
391
|
+
: undefined,
|
|
392
|
+
secondaryTireSpeedIndex:
|
|
393
|
+
form.secondaryTireSize && form.secondaryTireSize.value
|
|
394
|
+
? (form.secondaryTireSize.value as VehicleTire).speedIndex
|
|
395
|
+
: undefined,
|
|
396
|
+
|
|
358
397
|
lastInspectionDate: form.lastInspectionDate.value,
|
|
359
398
|
lastMaintenanceDate: form.lastMaintenanceDate.value,
|
|
360
399
|
tireBrand: form.tireBrand.value,
|
|
@@ -572,22 +611,47 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
572
611
|
)}
|
|
573
612
|
|
|
574
613
|
{!localEditMode && (
|
|
575
|
-
|
|
576
|
-
<Grid
|
|
577
|
-
<
|
|
578
|
-
|
|
579
|
-
|
|
614
|
+
<>
|
|
615
|
+
<Grid container textAlign="justify" sx={{ pt: 2 }}>
|
|
616
|
+
<Grid item xs={6}>
|
|
617
|
+
<Typography variant="body1" color="text.secondary">
|
|
618
|
+
Pneumatiques{" "}
|
|
619
|
+
{isVehicleSecondaryTireSizeDefined(vehicle) ? "AV" : ""}{" "}
|
|
620
|
+
:
|
|
621
|
+
</Typography>
|
|
622
|
+
</Grid>
|
|
623
|
+
<Grid item xs={6} sx={{ textAlign: "right" }}>
|
|
624
|
+
<Typography variant="body1" color="text.secondary">
|
|
625
|
+
{isVehicleTireSizeDefined(vehicle) ? (
|
|
626
|
+
<b>{formatVehicleTire(vehicle.tireSize)}</b>
|
|
627
|
+
) : (
|
|
628
|
+
"-"
|
|
629
|
+
)}
|
|
630
|
+
</Typography>
|
|
631
|
+
</Grid>
|
|
580
632
|
</Grid>
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
633
|
+
|
|
634
|
+
{isVehicleSecondaryTireSizeDefined(vehicle) && (
|
|
635
|
+
<Grid container textAlign="justify" sx={{ pt: 2 }}>
|
|
636
|
+
<Grid item xs={6}>
|
|
637
|
+
<Typography variant="body1" color="text.secondary">
|
|
638
|
+
Pneumatiques AR:
|
|
639
|
+
</Typography>
|
|
640
|
+
</Grid>
|
|
641
|
+
<Grid item xs={6} sx={{ textAlign: "right" }}>
|
|
642
|
+
<Typography variant="body1" color="text.secondary">
|
|
643
|
+
{isVehicleSecondaryTireSizeDefined(vehicle) ? (
|
|
644
|
+
<b>
|
|
645
|
+
{formatVehicleTire(vehicle.secondaryTireSize)}
|
|
646
|
+
</b>
|
|
647
|
+
) : (
|
|
648
|
+
"-"
|
|
649
|
+
)}
|
|
650
|
+
</Typography>
|
|
651
|
+
</Grid>
|
|
652
|
+
</Grid>
|
|
653
|
+
)}
|
|
654
|
+
</>
|
|
591
655
|
)}
|
|
592
656
|
{!localEditMode && (
|
|
593
657
|
<Grid container textAlign="justify" sx={{ pt: 2 }}>
|
|
@@ -620,12 +684,22 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
620
684
|
)}
|
|
621
685
|
|
|
622
686
|
{localEditMode && (
|
|
623
|
-
|
|
624
|
-
<
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
687
|
+
<>
|
|
688
|
+
<Grid item xs={12} sx={{ mt: 1 }}>
|
|
689
|
+
<MovaVehicleTireField
|
|
690
|
+
label="AV"
|
|
691
|
+
vehicleTire={form.tireSize.value}
|
|
692
|
+
onChangeVehicleTire={handleOnChangeVehicleTire}
|
|
693
|
+
/>
|
|
694
|
+
</Grid>
|
|
695
|
+
<Grid item xs={12} sx={{ mt: 1 }}>
|
|
696
|
+
<MovaVehicleTireField
|
|
697
|
+
label="AR"
|
|
698
|
+
vehicleTire={form.secondaryTireSize.value}
|
|
699
|
+
onChangeVehicleTire={handleOnChangeVehicleSecondaryTire}
|
|
700
|
+
/>
|
|
701
|
+
</Grid>
|
|
702
|
+
</>
|
|
629
703
|
)}
|
|
630
704
|
{localEditMode && (
|
|
631
705
|
<Grid item xs={12}>
|
package/src/helpers/Enums.ts
CHANGED
package/src/helpers/Types.ts
CHANGED
|
@@ -24,6 +24,11 @@ export type MovaVehicleForm = {
|
|
|
24
24
|
lastMaintenanceDate: MovaFormField;
|
|
25
25
|
tireBrand: MovaFormField;
|
|
26
26
|
tireProfile: MovaFormField;
|
|
27
|
+
secondaryTireSize: MovaFormField;
|
|
28
|
+
secondaryTireWidth: MovaFormField;
|
|
29
|
+
secondaryTireHeight: MovaFormField;
|
|
30
|
+
secondaryTireDiameter: MovaFormField;
|
|
31
|
+
secondaryTireSpeedIndex: MovaFormField;
|
|
27
32
|
};
|
|
28
33
|
|
|
29
34
|
/**
|
package/src/models/Garage.ts
CHANGED
|
@@ -68,6 +68,7 @@ export default class Garage {
|
|
|
68
68
|
quoteRequestStart?: Date;
|
|
69
69
|
companyRegistrationNumber?: string;
|
|
70
70
|
establishmentRegistrationNumber?: string;
|
|
71
|
+
reopeningDate?: Date;
|
|
71
72
|
constructor(
|
|
72
73
|
id: string,
|
|
73
74
|
adminId: string,
|
|
@@ -100,7 +101,8 @@ export default class Garage {
|
|
|
100
101
|
appId?: number,
|
|
101
102
|
establishmentRegistrationNumber?: string,
|
|
102
103
|
companyRegistrationNumber?: string,
|
|
103
|
-
quoteRequestStart?: Date
|
|
104
|
+
quoteRequestStart?: Date,
|
|
105
|
+
reopeningDate?: Date
|
|
104
106
|
) {
|
|
105
107
|
this.id = id;
|
|
106
108
|
this.adminId = adminId;
|
|
@@ -134,5 +136,6 @@ export default class Garage {
|
|
|
134
136
|
this.quoteRequestStart = quoteRequestStart;
|
|
135
137
|
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
136
138
|
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
139
|
+
this.reopeningDate = reopeningDate;
|
|
137
140
|
}
|
|
138
141
|
}
|
package/src/models/Prestation.ts
CHANGED
|
@@ -25,6 +25,7 @@ export default class Prestation {
|
|
|
25
25
|
* La notion de position (ou d'ordre) peut être utile à l'affichage d'une liste de prestation par exemple
|
|
26
26
|
*/
|
|
27
27
|
position: number;
|
|
28
|
+
availableOnline: boolean;
|
|
28
29
|
|
|
29
30
|
active:boolean;
|
|
30
31
|
|
|
@@ -37,7 +38,7 @@ export default class Prestation {
|
|
|
37
38
|
|
|
38
39
|
constructor(id:number, code: string, name:string, description: string, category:string,
|
|
39
40
|
downtime:number, appointmentDelay: number, position: number, active: boolean, state: PrestationState,
|
|
40
|
-
multipleApplication: boolean, operationsVisible: boolean,categoryCode: string, operations?: Operation[]) {
|
|
41
|
+
multipleApplication: boolean, operationsVisible: boolean,categoryCode: string, availableOnline:boolean, operations?: Operation[]) {
|
|
41
42
|
this.id = id;
|
|
42
43
|
this.code = code;
|
|
43
44
|
this.name = name;
|
|
@@ -52,5 +53,6 @@ export default class Prestation {
|
|
|
52
53
|
this.operations = operations;
|
|
53
54
|
this.state = state;
|
|
54
55
|
this.categoryCode = categoryCode;
|
|
56
|
+
this.availableOnline = availableOnline;
|
|
55
57
|
}
|
|
56
58
|
}
|