@movalib/movalib-commons 1.63.5 → 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.
@@ -57,8 +57,7 @@ export declare enum SubscriptionPaymentInterval {
57
57
  /**
58
58
  * Paiement 24 Mois
59
59
  */
60
- TWO_YEARS = "TWO_YEARS",
61
- THREE_YEARS = "THREE_YEARS"
60
+ TWO_YEARS = "TWO_YEARS"
62
61
  }
63
62
  export declare enum RegistrationState {
64
63
  /**
@@ -68,7 +68,6 @@ var SubscriptionPaymentInterval;
68
68
  * Paiement 24 Mois
69
69
  */
70
70
  SubscriptionPaymentInterval["TWO_YEARS"] = "TWO_YEARS";
71
- SubscriptionPaymentInterval["THREE_YEARS"] = "THREE_YEARS";
72
71
  })(SubscriptionPaymentInterval = exports.SubscriptionPaymentInterval || (exports.SubscriptionPaymentInterval = {}));
73
72
  var RegistrationState;
74
73
  (function (RegistrationState) {
@@ -59,7 +59,6 @@ export default class Garage {
59
59
  billingToken?: string;
60
60
  billingSimulationActive?: boolean;
61
61
  appId?: number;
62
- companyRegistrationNumber?: string;
63
- establishmentRegistrationNumber?: string;
64
- 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);
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);
65
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, establishmentRegistrationNumber, companyRegistrationNumber) {
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,8 +31,7 @@ var Garage = /** @class */ (function () {
31
31
  this.billingToken = billingToken;
32
32
  this.billingSimulationActive = billingSimulationActive;
33
33
  this.appId = appId;
34
- this.companyRegistrationNumber = companyRegistrationNumber;
35
- this.establishmentRegistrationNumber = establishmentRegistrationNumber;
34
+ this.quoteRequestStart = quoteRequestStart;
36
35
  }
37
36
  return Garage;
38
37
  }());
@@ -17,7 +17,6 @@ interface roiInterface {
17
17
  workingTimePerEmployee: number;
18
18
  partialWorkforce: number;
19
19
  workingTimePerPartialEmployee: number;
20
- smsCampaign: boolean;
21
20
  }
22
21
  export default class Subscription {
23
22
  id: string;
@@ -36,15 +35,13 @@ export default class Subscription {
36
35
  paymentIban: string;
37
36
  roi: roiInterface;
38
37
  additionalFormationQuantity: number;
38
+ additionalFormationFree: boolean;
39
39
  webPage: boolean;
40
40
  webcam: boolean;
41
- billing: boolean;
41
+ plvQuantity: number;
42
+ plvFree: boolean;
42
43
  trainingOptionalOne: Date;
43
44
  trainingOptionalTwo: Date;
44
- movaPackage: string;
45
- packInfo: boolean;
46
- smsCampaign: boolean;
47
- checkList: any;
48
- constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date, cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban: string, roi: roiInterface, additionalFormationQuantity: number, webPage: boolean, smsCampaign: boolean, trainingOptionalOne: Date, trainingOptionalTwo: Date, webcam: boolean, billing: boolean, movaPackage: string, packInfo: boolean, checkList: any);
45
+ constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date, cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban: string, roi: roiInterface, additionalFormationQuantity: number, additionalFormationFree: boolean, webPage: boolean, plvQuantity: number, plvFree: boolean, trainingOptionalOne: Date, trainingOptionalTwo: Date, webcam: boolean);
49
46
  }
50
47
  export {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Subscription = /** @class */ (function () {
4
- function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban, roi, additionalFormationQuantity, webPage, smsCampaign, trainingOptionalOne, trainingOptionalTwo, webcam, billing, movaPackage, packInfo, checkList) {
4
+ function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban, roi, additionalFormationQuantity, additionalFormationFree, webPage, plvQuantity, plvFree, trainingOptionalOne, trainingOptionalTwo, webcam) {
5
5
  this.id = id;
6
6
  this.garageId = garageId;
7
7
  this.type = type;
@@ -19,14 +19,12 @@ var Subscription = /** @class */ (function () {
19
19
  this.roi = roi;
20
20
  this.webPage = webPage;
21
21
  this.additionalFormationQuantity = additionalFormationQuantity;
22
+ this.additionalFormationFree = additionalFormationFree;
23
+ this.plvQuantity = plvQuantity;
24
+ this.plvFree = plvFree;
22
25
  this.webcam = webcam;
23
- this.billing = billing;
24
26
  this.trainingOptionalOne = trainingOptionalOne;
25
27
  this.trainingOptionalTwo = trainingOptionalTwo;
26
- this.movaPackage = movaPackage;
27
- this.packInfo = packInfo;
28
- this.smsCampaign = smsCampaign;
29
- this.checkList = checkList;
30
28
  }
31
29
  return Subscription;
32
30
  }());
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.63.5",
3
+ "version": "1.64.0",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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>{formatVehiclePlate(vehicle.plate, vehicle.foreignPlate)}</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 }}>
@@ -1,53 +1,59 @@
1
1
  export type MovaValidationForm = {
2
- password: MovaFormField,
3
- confirmation: MovaFormField,
4
- securityCode: MovaFormField,
5
- phoneNumber: MovaFormField,
6
- acceptsTerms: MovaFormField,
7
- }
2
+ password: MovaFormField;
3
+ confirmation: MovaFormField;
4
+ securityCode: MovaFormField;
5
+ phoneNumber: MovaFormField;
6
+ acceptsTerms: MovaFormField;
7
+ };
8
8
 
9
- export type AddressFieldName = 'streetName' | 'additional' | 'postalCode' | 'cityName';
9
+ export type AddressFieldName =
10
+ | "streetName"
11
+ | "additional"
12
+ | "postalCode"
13
+ | "cityName";
10
14
 
11
15
  export type MovaVehicleForm = {
12
- currentMileage: MovaFormField, // Integer
13
- averageMileagePerYear: MovaFormField, // Integer
14
- tireSize: MovaFormField,
15
- tireWidth: MovaFormField,
16
- tireHeight: MovaFormField,
17
- tireDiameter: MovaFormField,
18
- tireSpeedIndex: MovaFormField,
19
- lastInspectionDate: MovaFormField,
20
- lastMaintenanceDate: MovaFormField,
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
- startTime: Date | string | null,
28
- endTime: Date | string | null,
29
- countryCode: string
30
- }
33
+ startTime: Date | string | null;
34
+ endTime: Date | string | null;
35
+ countryCode: string;
36
+ };
31
37
 
32
38
  export type MovaUserSignUpForm = {
33
- firstname: MovaFormField,
34
- lastname: MovaFormField,
35
- email: MovaFormField,
36
- phoneNumber: MovaFormField,
37
- password: MovaFormField,
38
- gender?: MovaFormField,
39
- birthDate?: MovaFormField,
40
- acceptsTerms: MovaFormField
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
- email: MovaFormField,
45
- password: MovaFormField,
46
- phoneNumberEmail: MovaFormField
47
- }
50
+ email: MovaFormField;
51
+ password: MovaFormField;
52
+ phoneNumberEmail: MovaFormField;
53
+ };
48
54
 
49
55
  export type MovaFormField = {
50
- value?: any,
51
- error?: string,
52
- isValid?: boolean
53
- }
56
+ value?: any;
57
+ error?: string;
58
+ isValid?: boolean;
59
+ };
@@ -89,7 +89,8 @@ export default class Event {
89
89
  origin?: string;
90
90
  quoteLastSendingTime?: Date;
91
91
  invoiceSendingDate?: Date;
92
- creationDate?: Date;
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
@@ -65,6 +65,7 @@ export default class Garage {
65
65
  billingToken?: string;
66
66
  billingSimulationActive?: boolean;
67
67
  appId?: number;
68
+ quoteRequestStart?: Date;
68
69
  companyRegistrationNumber?: string;
69
70
  establishmentRegistrationNumber?: string;
70
71
  constructor(
@@ -98,7 +99,8 @@ export default class Garage {
98
99
  billingSimulationActive?: boolean,
99
100
  appId?: number,
100
101
  establishmentRegistrationNumber?: string,
101
- companyRegistrationNumber?: string
102
+ companyRegistrationNumber?: string,
103
+ quoteRequestStart?: Date
102
104
  ) {
103
105
  this.id = id;
104
106
  this.adminId = adminId;
@@ -129,6 +131,7 @@ export default class Garage {
129
131
  this.billingToken = billingToken;
130
132
  this.billingSimulationActive = billingSimulationActive;
131
133
  this.appId = appId;
134
+ this.quoteRequestStart = quoteRequestStart;
132
135
  this.companyRegistrationNumber = companyRegistrationNumber;
133
136
  this.establishmentRegistrationNumber = establishmentRegistrationNumber;
134
137
  }
@@ -1,6 +1,6 @@
1
- import { DigitalPassportIndex } from '../helpers/Enums';
2
- import Document from './Document';
3
- import VehicleTire from './VehicleTire';
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
- // Properties
19
- id: number;
20
- ownerId: number;
21
- averageMileagePerYear: number;
22
- plate: string;
23
- brand: string;
24
- model: string;
25
- version: string;
26
- vin: string;
27
- currentMileage: number;
28
- digitalPassportIndex: DigitalPassportIndex;
29
- firstRegistrationDate: Date;
30
- ktype: string;
31
- tireDiameter: string;
32
- tireHeight: string;
33
- tireSpeedIndex: string;
34
- tireWidth: string;
35
- documents : Document[];
36
- tireSize: VehicleTire;
37
- lastInspectionDate: Date;
38
- lastMaintenanceDate: Date;
39
- foreignPlate: boolean;
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
- constructor(
42
- id: number,
43
- ownerId: number,
44
- averageMileagePerYear: number,
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
+ };