@movalib/movalib-commons 1.63.4 → 1.64.0
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/models/Garage.d.ts +2 -1
- package/dist/src/models/Garage.js +2 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/components/vehicle/VehicleFullCard.tsx +80 -5
- package/src/helpers/Enums.ts +2 -1
- package/src/helpers/Types.ts +44 -38
- package/src/models/Event.ts +8 -1
- package/src/models/Garage.ts +10 -2
- package/src/models/Subscription.ts +57 -34
- package/src/models/Vehicle.ts +80 -75
- package/src/services/GarageService.ts +13 -0
- package/src/utils/getQRCodeBase64.tsx +45 -0
|
@@ -59,5 +59,6 @@ export default class Garage {
|
|
|
59
59
|
billingToken?: string;
|
|
60
60
|
billingSimulationActive?: boolean;
|
|
61
61
|
appId?: number;
|
|
62
|
-
|
|
62
|
+
quoteRequestStart?: Date;
|
|
63
|
+
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, quoteRequestStart?: Date);
|
|
63
64
|
}
|
|
@@ -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) {
|
|
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, quoteRequestStart) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.adminId = adminId;
|
|
7
7
|
this.name = name;
|
|
@@ -31,6 +31,7 @@ var Garage = /** @class */ (function () {
|
|
|
31
31
|
this.billingToken = billingToken;
|
|
32
32
|
this.billingSimulationActive = billingSimulationActive;
|
|
33
33
|
this.appId = appId;
|
|
34
|
+
this.quoteRequestStart = quoteRequestStart;
|
|
34
35
|
}
|
|
35
36
|
return Garage;
|
|
36
37
|
}());
|
package/index.ts
CHANGED
|
@@ -120,6 +120,7 @@ export {
|
|
|
120
120
|
|
|
121
121
|
// Export des utils
|
|
122
122
|
export { openDialogPrint } from './src/utils/DialogPrint';
|
|
123
|
+
export { getQrCodeBase64} from './src/utils/getQRCodeBase64';
|
|
123
124
|
|
|
124
125
|
// Export des styles
|
|
125
126
|
export { StyledToggleButton, StyledToggleButtonGroup} from './src/style/styled';
|
package/package.json
CHANGED
|
@@ -37,10 +37,7 @@ import {
|
|
|
37
37
|
MovaAppType,
|
|
38
38
|
} from "../../helpers/Enums";
|
|
39
39
|
import Logger from "../../helpers/Logger";
|
|
40
|
-
import {
|
|
41
|
-
formatVehiclePlate,
|
|
42
|
-
formatVehicleTire,
|
|
43
|
-
} from "../../helpers/Tools";
|
|
40
|
+
import { formatVehiclePlate, formatVehicleTire } from "../../helpers/Tools";
|
|
44
41
|
import { MovaFormField, MovaVehicleForm } from "../../helpers/Types";
|
|
45
42
|
import User from "../../models/User";
|
|
46
43
|
import Vehicle from "../../models/Vehicle";
|
|
@@ -73,6 +70,8 @@ const initialUserFormState = {
|
|
|
73
70
|
tireSpeedIndex: { value: "", isValid: true },
|
|
74
71
|
lastInspectionDate: { value: null, isValid: true },
|
|
75
72
|
lastMaintenanceDate: { value: null, isValid: true },
|
|
73
|
+
tireBrand: { value: "", isValid: true },
|
|
74
|
+
tireProfile: { value: "", isValid: true },
|
|
76
75
|
};
|
|
77
76
|
|
|
78
77
|
const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
@@ -183,6 +182,14 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
183
182
|
: null,
|
|
184
183
|
},
|
|
185
184
|
}));
|
|
185
|
+
setForm((prevForm) => ({
|
|
186
|
+
...prevForm,
|
|
187
|
+
tireBrand: { ...prevForm["tireBrand"], value: vehicle.tireBrand },
|
|
188
|
+
}));
|
|
189
|
+
setForm((prevForm) => ({
|
|
190
|
+
...prevForm,
|
|
191
|
+
tireProfile: { ...prevForm["tireProfile"], value: vehicle.tireProfile },
|
|
192
|
+
}));
|
|
186
193
|
|
|
187
194
|
if (isVehicleTireSizeDefined(vehicle)) {
|
|
188
195
|
setForm((prevForm) => ({
|
|
@@ -350,6 +357,8 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
350
357
|
: undefined,
|
|
351
358
|
lastInspectionDate: form.lastInspectionDate.value,
|
|
352
359
|
lastMaintenanceDate: form.lastMaintenanceDate.value,
|
|
360
|
+
tireBrand: form.tireBrand.value,
|
|
361
|
+
tireProfile: form.tireProfile.value,
|
|
353
362
|
};
|
|
354
363
|
Logger.info(query);
|
|
355
364
|
|
|
@@ -438,7 +447,9 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
438
447
|
color={theme.palette.text.primary}
|
|
439
448
|
sx={{ position: "absolute", top: "8px", left: "76px" }}
|
|
440
449
|
>
|
|
441
|
-
<b>
|
|
450
|
+
<b>
|
|
451
|
+
{formatVehiclePlate(vehicle.plate, vehicle.foreignPlate)}
|
|
452
|
+
</b>
|
|
442
453
|
</Typography>
|
|
443
454
|
</Grid>
|
|
444
455
|
{onDelete && (
|
|
@@ -578,6 +589,35 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
578
589
|
</Grid>
|
|
579
590
|
</Grid>
|
|
580
591
|
)}
|
|
592
|
+
{!localEditMode && (
|
|
593
|
+
<Grid container textAlign="justify" sx={{ pt: 2 }}>
|
|
594
|
+
<Grid item xs={6}>
|
|
595
|
+
<Typography variant="body1" color="text.secondary">
|
|
596
|
+
Marque pneumatiques :
|
|
597
|
+
</Typography>
|
|
598
|
+
</Grid>
|
|
599
|
+
<Grid item xs={6} sx={{ textAlign: "right" }}>
|
|
600
|
+
<Typography variant="body1" color="text.secondary">
|
|
601
|
+
{vehicle.tireBrand ? <b>{vehicle.tireBrand}</b> : "-"}
|
|
602
|
+
</Typography>
|
|
603
|
+
</Grid>
|
|
604
|
+
</Grid>
|
|
605
|
+
)}
|
|
606
|
+
|
|
607
|
+
{!localEditMode && (
|
|
608
|
+
<Grid container textAlign="justify" sx={{ pt: 2 }}>
|
|
609
|
+
<Grid item xs={6}>
|
|
610
|
+
<Typography variant="body1" color="text.secondary">
|
|
611
|
+
Modèle pneumatiques :
|
|
612
|
+
</Typography>
|
|
613
|
+
</Grid>
|
|
614
|
+
<Grid item xs={6} sx={{ textAlign: "right" }}>
|
|
615
|
+
<Typography variant="body1" color="text.secondary">
|
|
616
|
+
{vehicle.tireProfile ? <b>{vehicle.tireProfile}</b> : "-"}
|
|
617
|
+
</Typography>
|
|
618
|
+
</Grid>
|
|
619
|
+
</Grid>
|
|
620
|
+
)}
|
|
581
621
|
|
|
582
622
|
{localEditMode && (
|
|
583
623
|
<Grid item xs={12} sx={{ mt: 1 }}>
|
|
@@ -587,6 +627,41 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
587
627
|
/>
|
|
588
628
|
</Grid>
|
|
589
629
|
)}
|
|
630
|
+
{localEditMode && (
|
|
631
|
+
<Grid item xs={12}>
|
|
632
|
+
<TextField
|
|
633
|
+
label="Modèle pneumatique"
|
|
634
|
+
name="tireProfile"
|
|
635
|
+
variant="outlined"
|
|
636
|
+
value={form.tireProfile.value}
|
|
637
|
+
onChange={(e) => handleInputChange(e)}
|
|
638
|
+
error={Boolean(form.tireProfile.error)}
|
|
639
|
+
sx={{
|
|
640
|
+
width: "100%",
|
|
641
|
+
mt: 2,
|
|
642
|
+
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
643
|
+
}}
|
|
644
|
+
/>
|
|
645
|
+
</Grid>
|
|
646
|
+
)}
|
|
647
|
+
|
|
648
|
+
{localEditMode && (
|
|
649
|
+
<Grid item xs={12}>
|
|
650
|
+
<TextField
|
|
651
|
+
label="Marque pneumatique"
|
|
652
|
+
name="tireBrand"
|
|
653
|
+
variant="outlined"
|
|
654
|
+
value={form.tireBrand.value}
|
|
655
|
+
onChange={(e) => handleInputChange(e)}
|
|
656
|
+
error={Boolean(form.tireBrand.error)}
|
|
657
|
+
sx={{
|
|
658
|
+
width: "100%",
|
|
659
|
+
mt: 2,
|
|
660
|
+
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
661
|
+
}}
|
|
662
|
+
/>
|
|
663
|
+
</Grid>
|
|
664
|
+
)}
|
|
590
665
|
|
|
591
666
|
{!localEditMode && (
|
|
592
667
|
<Grid container textAlign="justify" sx={{ pt: 2 }}>
|
package/src/helpers/Enums.ts
CHANGED
|
@@ -64,6 +64,7 @@ export enum SubscriptionPaymentInterval {
|
|
|
64
64
|
* Paiement 24 Mois
|
|
65
65
|
*/
|
|
66
66
|
TWO_YEARS = "TWO_YEARS",
|
|
67
|
+
THREE_YEARS = "THREE_YEARS",
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
export enum RegistrationState {
|
|
@@ -92,7 +93,7 @@ export enum RegistrationState {
|
|
|
92
93
|
export enum VehiclePlateFormat {
|
|
93
94
|
FRENCH_NEW = "FRENCH_NEW",
|
|
94
95
|
FRENCH_OLD = "FRENCH_OLD",
|
|
95
|
-
FOREIGN = "FOREIGN"
|
|
96
|
+
FOREIGN = "FOREIGN",
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
export enum SlotAlgorithm {
|
package/src/helpers/Types.ts
CHANGED
|
@@ -1,53 +1,59 @@
|
|
|
1
1
|
export type MovaValidationForm = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
password: MovaFormField;
|
|
3
|
+
confirmation: MovaFormField;
|
|
4
|
+
securityCode: MovaFormField;
|
|
5
|
+
phoneNumber: MovaFormField;
|
|
6
|
+
acceptsTerms: MovaFormField;
|
|
7
|
+
};
|
|
8
8
|
|
|
9
|
-
export type AddressFieldName =
|
|
9
|
+
export type AddressFieldName =
|
|
10
|
+
| "streetName"
|
|
11
|
+
| "additional"
|
|
12
|
+
| "postalCode"
|
|
13
|
+
| "cityName";
|
|
10
14
|
|
|
11
15
|
export type MovaVehicleForm = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
currentMileage: MovaFormField; // Integer
|
|
17
|
+
averageMileagePerYear: MovaFormField; // Integer
|
|
18
|
+
tireSize: MovaFormField;
|
|
19
|
+
tireWidth: MovaFormField;
|
|
20
|
+
tireHeight: MovaFormField;
|
|
21
|
+
tireDiameter: MovaFormField;
|
|
22
|
+
tireSpeedIndex: MovaFormField;
|
|
23
|
+
lastInspectionDate: MovaFormField;
|
|
24
|
+
lastMaintenanceDate: MovaFormField;
|
|
25
|
+
tireBrand: MovaFormField;
|
|
26
|
+
tireProfile: MovaFormField;
|
|
27
|
+
};
|
|
22
28
|
|
|
23
29
|
/**
|
|
24
30
|
* Type utilisé pour définir un interval sur une objet Schedule
|
|
25
31
|
*/
|
|
26
32
|
export type MovaInterval = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
startTime: Date | string | null;
|
|
34
|
+
endTime: Date | string | null;
|
|
35
|
+
countryCode: string;
|
|
36
|
+
};
|
|
31
37
|
|
|
32
38
|
export type MovaUserSignUpForm = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
39
|
+
firstname: MovaFormField;
|
|
40
|
+
lastname: MovaFormField;
|
|
41
|
+
email: MovaFormField;
|
|
42
|
+
phoneNumber: MovaFormField;
|
|
43
|
+
password: MovaFormField;
|
|
44
|
+
gender?: MovaFormField;
|
|
45
|
+
birthDate?: MovaFormField;
|
|
46
|
+
acceptsTerms: MovaFormField;
|
|
47
|
+
};
|
|
42
48
|
|
|
43
49
|
export type MovaLoginForm = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
50
|
+
email: MovaFormField;
|
|
51
|
+
password: MovaFormField;
|
|
52
|
+
phoneNumberEmail: MovaFormField;
|
|
53
|
+
};
|
|
48
54
|
|
|
49
55
|
export type MovaFormField = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
56
|
+
value?: any;
|
|
57
|
+
error?: string;
|
|
58
|
+
isValid?: boolean;
|
|
59
|
+
};
|
package/src/models/Event.ts
CHANGED
|
@@ -89,7 +89,8 @@ export default class Event {
|
|
|
89
89
|
origin?: string;
|
|
90
90
|
quoteLastSendingTime?: Date;
|
|
91
91
|
invoiceSendingDate?: Date;
|
|
92
|
-
|
|
92
|
+
vehicleLoanStart?: Date;
|
|
93
|
+
vehicleLoanEnd?: Date; creationDate?: Date;
|
|
93
94
|
updatedDate?: Date;
|
|
94
95
|
quoteFirstSendingTime?: Date;
|
|
95
96
|
lastQuoteCreationDate?: Date;
|
|
@@ -122,6 +123,8 @@ export default class Event {
|
|
|
122
123
|
quoteLastSendingTime?: Date,
|
|
123
124
|
invoiceSendingDate?: Date,
|
|
124
125
|
orders?: order[],
|
|
126
|
+
vehicleLoanStart?: Date,
|
|
127
|
+
vehicleLoanEnd?: Date,
|
|
125
128
|
creationDate?: Date,
|
|
126
129
|
updatedDate?: Date,
|
|
127
130
|
lastQuoteCreationDate?: Date,
|
|
@@ -163,6 +166,10 @@ export default class Event {
|
|
|
163
166
|
? new Date(invoiceSendingDate)
|
|
164
167
|
: undefined;
|
|
165
168
|
this.orders = orders;
|
|
169
|
+
this.vehicleLoanStart = vehicleLoanStart
|
|
170
|
+
? new Date(vehicleLoanStart)
|
|
171
|
+
: undefined;
|
|
172
|
+
this.vehicleLoanEnd = vehicleLoanEnd ? new Date(vehicleLoanEnd) : undefined;
|
|
166
173
|
this.creationDate = creationDate ? new Date(creationDate) : undefined;
|
|
167
174
|
this.updatedDate = updatedDate ? new Date(updatedDate) : undefined;
|
|
168
175
|
this.lastQuoteCreationDate = lastQuoteCreationDate
|
package/src/models/Garage.ts
CHANGED
|
@@ -65,7 +65,9 @@ export default class Garage {
|
|
|
65
65
|
billingToken?: string;
|
|
66
66
|
billingSimulationActive?: boolean;
|
|
67
67
|
appId?: number;
|
|
68
|
-
|
|
68
|
+
quoteRequestStart?: Date;
|
|
69
|
+
companyRegistrationNumber?: string;
|
|
70
|
+
establishmentRegistrationNumber?: string;
|
|
69
71
|
constructor(
|
|
70
72
|
id: string,
|
|
71
73
|
adminId: string,
|
|
@@ -95,7 +97,10 @@ export default class Garage {
|
|
|
95
97
|
billingActive?: boolean,
|
|
96
98
|
billingToken?: string,
|
|
97
99
|
billingSimulationActive?: boolean,
|
|
98
|
-
appId?: number
|
|
100
|
+
appId?: number,
|
|
101
|
+
establishmentRegistrationNumber?: string,
|
|
102
|
+
companyRegistrationNumber?: string,
|
|
103
|
+
quoteRequestStart?: Date
|
|
99
104
|
) {
|
|
100
105
|
this.id = id;
|
|
101
106
|
this.adminId = adminId;
|
|
@@ -126,5 +131,8 @@ export default class Garage {
|
|
|
126
131
|
this.billingToken = billingToken;
|
|
127
132
|
this.billingSimulationActive = billingSimulationActive;
|
|
128
133
|
this.appId = appId;
|
|
134
|
+
this.quoteRequestStart = quoteRequestStart;
|
|
135
|
+
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
136
|
+
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
129
137
|
}
|
|
130
138
|
}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
SubscriptionPaymentInterval,
|
|
3
|
+
SubscriptionState,
|
|
4
|
+
SubscriptionType,
|
|
5
|
+
} from "../helpers/Enums";
|
|
2
6
|
interface roiInterface {
|
|
3
|
-
period: string
|
|
4
|
-
turnover: number
|
|
5
|
-
nbInvoice: number
|
|
6
|
-
nbQuote: number
|
|
7
|
-
nbNoShow: number
|
|
8
|
-
nbLostQuote: number
|
|
9
|
-
moRateOne: number
|
|
10
|
-
moRateTwo: number
|
|
11
|
-
moRateThree: number
|
|
12
|
-
moOne: number
|
|
13
|
-
moTwo: number
|
|
14
|
-
moThree: number
|
|
15
|
-
comment: string
|
|
16
|
-
workforce: number
|
|
17
|
-
workingTimePerEmployee: number
|
|
18
|
-
partialWorkforce:number
|
|
19
|
-
workingTimePerPartialEmployee: number
|
|
7
|
+
period: string;
|
|
8
|
+
turnover: number;
|
|
9
|
+
nbInvoice: number;
|
|
10
|
+
nbQuote: number;
|
|
11
|
+
nbNoShow: number;
|
|
12
|
+
nbLostQuote: number;
|
|
13
|
+
moRateOne: number;
|
|
14
|
+
moRateTwo: number;
|
|
15
|
+
moRateThree: number;
|
|
16
|
+
moOne: number;
|
|
17
|
+
moTwo: number;
|
|
18
|
+
moThree: number;
|
|
19
|
+
comment: string;
|
|
20
|
+
workforce: number;
|
|
21
|
+
workingTimePerEmployee: number;
|
|
22
|
+
partialWorkforce: number;
|
|
23
|
+
workingTimePerPartialEmployee: number;
|
|
24
|
+
smsCampaign: boolean;
|
|
20
25
|
}
|
|
21
26
|
export default class Subscription {
|
|
22
|
-
|
|
23
|
-
|
|
24
27
|
// Properties
|
|
25
28
|
id: string;
|
|
26
29
|
garageId: string;
|
|
@@ -38,24 +41,42 @@ export default class Subscription {
|
|
|
38
41
|
paymentIban: string;
|
|
39
42
|
roi: roiInterface;
|
|
40
43
|
additionalFormationQuantity: number;
|
|
41
|
-
additionalFormationFree: boolean;
|
|
42
44
|
webPage: boolean;
|
|
43
45
|
webcam: boolean;
|
|
44
|
-
|
|
45
|
-
plvFree: boolean;
|
|
46
|
+
billing: boolean;
|
|
46
47
|
trainingOptionalOne: Date;
|
|
47
48
|
trainingOptionalTwo: Date;
|
|
49
|
+
movaPackage: string;
|
|
50
|
+
packInfo: boolean;
|
|
51
|
+
smsCampaign: boolean;
|
|
52
|
+
checkList: any;
|
|
48
53
|
|
|
49
|
-
constructor(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
constructor(
|
|
55
|
+
id: string,
|
|
56
|
+
garageId: string,
|
|
57
|
+
type: SubscriptionType,
|
|
58
|
+
state: SubscriptionState,
|
|
59
|
+
companyName: string,
|
|
60
|
+
companyEmail: string,
|
|
61
|
+
companySiren: string,
|
|
62
|
+
companyLegalForm: string,
|
|
63
|
+
trialDays: number,
|
|
64
|
+
startDate: Date,
|
|
65
|
+
activationDate: Date,
|
|
66
|
+
cancellationDate: Date,
|
|
67
|
+
paymentInterval: SubscriptionPaymentInterval,
|
|
68
|
+
paymentIban: string,
|
|
69
|
+
roi: roiInterface,
|
|
70
|
+
additionalFormationQuantity: number,
|
|
53
71
|
webPage: boolean,
|
|
54
|
-
|
|
55
|
-
plvFree: boolean,
|
|
72
|
+
smsCampaign: boolean,
|
|
56
73
|
trainingOptionalOne: Date,
|
|
57
74
|
trainingOptionalTwo: Date,
|
|
58
|
-
webcam: boolean
|
|
75
|
+
webcam: boolean,
|
|
76
|
+
billing: boolean,
|
|
77
|
+
movaPackage: string,
|
|
78
|
+
packInfo: boolean,
|
|
79
|
+
checkList: any
|
|
59
80
|
) {
|
|
60
81
|
this.id = id;
|
|
61
82
|
this.garageId = garageId;
|
|
@@ -74,11 +95,13 @@ export default class Subscription {
|
|
|
74
95
|
this.roi = roi;
|
|
75
96
|
this.webPage = webPage;
|
|
76
97
|
this.additionalFormationQuantity = additionalFormationQuantity;
|
|
77
|
-
this.additionalFormationFree = additionalFormationFree;
|
|
78
|
-
this.plvQuantity = plvQuantity;
|
|
79
|
-
this.plvFree = plvFree;
|
|
80
98
|
this.webcam = webcam;
|
|
99
|
+
this.billing = billing;
|
|
81
100
|
this.trainingOptionalOne = trainingOptionalOne;
|
|
82
101
|
this.trainingOptionalTwo = trainingOptionalTwo;
|
|
102
|
+
this.movaPackage = movaPackage;
|
|
103
|
+
this.packInfo = packInfo;
|
|
104
|
+
this.smsCampaign = smsCampaign;
|
|
105
|
+
this.checkList = checkList;
|
|
83
106
|
}
|
|
84
|
-
}
|
|
107
|
+
}
|
package/src/models/Vehicle.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DigitalPassportIndex } from
|
|
2
|
-
import Document from
|
|
3
|
-
import VehicleTire from
|
|
1
|
+
import { DigitalPassportIndex } from "../helpers/Enums";
|
|
2
|
+
import Document from "./Document";
|
|
3
|
+
import VehicleTire from "./VehicleTire";
|
|
4
4
|
|
|
5
5
|
/* AUDI A5 Sportback (F5A, F5F)
|
|
6
6
|
Marque : AUDI
|
|
@@ -14,77 +14,82 @@ Cylindrée : 1984 cm3
|
|
|
14
14
|
Puissance : 140 KW (190 HP) */
|
|
15
15
|
|
|
16
16
|
export default class Vehicle {
|
|
17
|
+
// Properties
|
|
18
|
+
id: number;
|
|
19
|
+
ownerId: number;
|
|
20
|
+
averageMileagePerYear: number;
|
|
21
|
+
plate: string;
|
|
22
|
+
brand: string;
|
|
23
|
+
model: string;
|
|
24
|
+
version: string;
|
|
25
|
+
vin: string;
|
|
26
|
+
currentMileage: number;
|
|
27
|
+
digitalPassportIndex: DigitalPassportIndex;
|
|
28
|
+
firstRegistrationDate: Date;
|
|
29
|
+
ktype: string;
|
|
30
|
+
tireDiameter: string;
|
|
31
|
+
tireHeight: string;
|
|
32
|
+
tireSpeedIndex: string;
|
|
33
|
+
tireWidth: string;
|
|
34
|
+
documents: Document[];
|
|
35
|
+
tireSize: VehicleTire;
|
|
36
|
+
lastInspectionDate: Date;
|
|
37
|
+
lastMaintenanceDate: Date;
|
|
38
|
+
foreignPlate: boolean;
|
|
39
|
+
tireBrand?: string;
|
|
40
|
+
tireProfile?: string;
|
|
17
41
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
constructor(
|
|
43
|
+
id: number,
|
|
44
|
+
ownerId: number,
|
|
45
|
+
averageMileagePerYear: number,
|
|
46
|
+
plate: string,
|
|
47
|
+
brand: string,
|
|
48
|
+
model: string,
|
|
49
|
+
version: string,
|
|
50
|
+
vin: string,
|
|
51
|
+
currentMileage: number,
|
|
52
|
+
digitalPassportIndex: DigitalPassportIndex,
|
|
53
|
+
firstRegistrationDate: Date,
|
|
54
|
+
ktype: string,
|
|
55
|
+
tireDiameter: string,
|
|
56
|
+
tireHeight: string,
|
|
57
|
+
tireSpeedIndex: string,
|
|
58
|
+
tireWidth: string,
|
|
59
|
+
documents: Document[],
|
|
60
|
+
tireSize: VehicleTire,
|
|
61
|
+
lastInspectionDate: Date,
|
|
62
|
+
lastMaintenanceDate: Date,
|
|
63
|
+
foreignPlate: boolean,
|
|
64
|
+
tireBrand?: string,
|
|
65
|
+
tireProfile?: string
|
|
66
|
+
) {
|
|
67
|
+
this.id = id;
|
|
68
|
+
this.ownerId = ownerId;
|
|
69
|
+
this.averageMileagePerYear = averageMileagePerYear;
|
|
70
|
+
this.plate = plate;
|
|
71
|
+
this.brand = brand;
|
|
72
|
+
this.model = model;
|
|
73
|
+
this.version = version;
|
|
74
|
+
this.vin = vin;
|
|
75
|
+
this.currentMileage = currentMileage;
|
|
76
|
+
this.digitalPassportIndex = digitalPassportIndex;
|
|
77
|
+
this.firstRegistrationDate = firstRegistrationDate;
|
|
78
|
+
this.ktype = ktype;
|
|
79
|
+
this.tireDiameter = tireDiameter;
|
|
80
|
+
this.tireHeight = tireHeight;
|
|
81
|
+
this.tireSpeedIndex = tireSpeedIndex;
|
|
82
|
+
this.tireWidth = tireWidth;
|
|
83
|
+
this.documents = documents;
|
|
84
|
+
this.tireSize = tireSize;
|
|
85
|
+
this.lastInspectionDate = lastInspectionDate;
|
|
86
|
+
this.lastMaintenanceDate = lastMaintenanceDate;
|
|
87
|
+
this.foreignPlate = foreignPlate;
|
|
88
|
+
this.tireBrand = tireBrand;
|
|
89
|
+
this.tireProfile = tireProfile;
|
|
90
|
+
}
|
|
40
91
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
plate: string,
|
|
46
|
-
brand: string,
|
|
47
|
-
model: string,
|
|
48
|
-
version: string,
|
|
49
|
-
vin: string,
|
|
50
|
-
currentMileage: number,
|
|
51
|
-
digitalPassportIndex: DigitalPassportIndex,
|
|
52
|
-
firstRegistrationDate: Date,
|
|
53
|
-
ktype: string,
|
|
54
|
-
tireDiameter: string,
|
|
55
|
-
tireHeight: string,
|
|
56
|
-
tireSpeedIndex: string,
|
|
57
|
-
tireWidth: string,
|
|
58
|
-
documents: Document[],
|
|
59
|
-
tireSize: VehicleTire,
|
|
60
|
-
lastInspectionDate: Date,
|
|
61
|
-
lastMaintenanceDate: Date,
|
|
62
|
-
foreignPlate: boolean
|
|
63
|
-
) {
|
|
64
|
-
this.id = id;
|
|
65
|
-
this.ownerId = ownerId;
|
|
66
|
-
this.averageMileagePerYear = averageMileagePerYear;
|
|
67
|
-
this.plate = plate;
|
|
68
|
-
this.brand = brand;
|
|
69
|
-
this.model = model;
|
|
70
|
-
this.version = version;
|
|
71
|
-
this.vin = vin;
|
|
72
|
-
this.currentMileage = currentMileage;
|
|
73
|
-
this.digitalPassportIndex = digitalPassportIndex;
|
|
74
|
-
this.firstRegistrationDate = firstRegistrationDate;
|
|
75
|
-
this.ktype = ktype;
|
|
76
|
-
this.tireDiameter = tireDiameter;
|
|
77
|
-
this.tireHeight = tireHeight;
|
|
78
|
-
this.tireSpeedIndex = tireSpeedIndex;
|
|
79
|
-
this.tireWidth = tireWidth;
|
|
80
|
-
this.documents = documents;
|
|
81
|
-
this.tireSize = tireSize;
|
|
82
|
-
this.lastInspectionDate = lastInspectionDate;
|
|
83
|
-
this.lastMaintenanceDate = lastMaintenanceDate;
|
|
84
|
-
this.foreignPlate = foreignPlate
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
getVehicleLabel() {
|
|
88
|
-
return `${this.brand} ${this.model} ${this.version}`
|
|
89
|
-
}
|
|
90
|
-
}
|
|
92
|
+
getVehicleLabel() {
|
|
93
|
+
return `${this.brand} ${this.model} ${this.version}`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -665,6 +665,19 @@ export default class GarageService {
|
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
667
|
|
|
668
|
+
static editGarageVehicleDateEvent(
|
|
669
|
+
garageId: string,
|
|
670
|
+
eventId: string,
|
|
671
|
+
req: any
|
|
672
|
+
): Promise<APIResponse<string>> {
|
|
673
|
+
return request({
|
|
674
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicles/dates`,
|
|
675
|
+
method: APIMethod.PATCH,
|
|
676
|
+
appType: MovaAppType.GARAGE,
|
|
677
|
+
body: JSON.stringify(req),
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
|
|
668
681
|
static deassignGarageVehicleEvent(
|
|
669
682
|
garageId: string,
|
|
670
683
|
eventId: string
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import QRCodeStyling from 'qr-code-styling';
|
|
2
|
+
import QRCodeImage from '../assets/images/leaf_yellow_small.png';
|
|
3
|
+
import { Options } from 'qr-code-styling';
|
|
4
|
+
|
|
5
|
+
export const getQrCodeBase64 = async (url: string, dotsColor: string, cornerColor: string) => {
|
|
6
|
+
|
|
7
|
+
const qrCodeOptions: Options = {
|
|
8
|
+
width: 300,
|
|
9
|
+
height: 300,
|
|
10
|
+
type: 'canvas',
|
|
11
|
+
data: url,
|
|
12
|
+
image: QRCodeImage,
|
|
13
|
+
margin: 10,
|
|
14
|
+
qrOptions: {
|
|
15
|
+
typeNumber: 0,
|
|
16
|
+
mode: 'Byte',
|
|
17
|
+
errorCorrectionLevel: 'Q',
|
|
18
|
+
},
|
|
19
|
+
imageOptions: {
|
|
20
|
+
hideBackgroundDots: true,
|
|
21
|
+
imageSize: 0.4,
|
|
22
|
+
margin: 15,
|
|
23
|
+
},
|
|
24
|
+
dotsOptions: {
|
|
25
|
+
color: dotsColor,
|
|
26
|
+
type: 'square',
|
|
27
|
+
},
|
|
28
|
+
backgroundOptions: {
|
|
29
|
+
color: 'white',
|
|
30
|
+
},
|
|
31
|
+
cornersSquareOptions: {
|
|
32
|
+
color: cornerColor,
|
|
33
|
+
type: 'square',
|
|
34
|
+
},
|
|
35
|
+
cornersDotOptions: {
|
|
36
|
+
color: cornerColor,
|
|
37
|
+
type: 'square',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const qrCode = new QRCodeStyling(qrCodeOptions);
|
|
42
|
+
|
|
43
|
+
const qrCodeBase64 = await qrCode.getRawData("png");
|
|
44
|
+
return qrCodeBase64;
|
|
45
|
+
};
|