@movalib/movalib-commons 1.63.5 → 1.64.1

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/index.d.ts CHANGED
@@ -58,4 +58,5 @@ export { formatDateByTimezone, getLongFormattedDateTime } from './src/helpers/Da
58
58
  export { request, API_BASE_URL } from './src/helpers/ApiHelper';
59
59
  export { CustomerType, RoleType, MovaAppType, DayOfWeek, EventState, EventType, DocumentType, DigitalPassportIndex, DocumentState, Gender, DateFormatTypes, PartsApplicationType, ProductType, OrderPreference, OrderState, SlotAlgorithm, VehiclePlateFormat as VehiclePlateType, SubscriptionPaymentInterval, RegistrationState, PrestationType, PrestationState, CountryCode, SubscriptionState, SubscriptionType, APIMethod, } from './src/helpers/Enums';
60
60
  export { openDialogPrint } from './src/utils/DialogPrint';
61
+ export { getQrCodeBase64 } from './src/utils/getQRCodeBase64';
61
62
  export { StyledToggleButton, StyledToggleButtonGroup } from './src/style/styled';
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.Schedule = exports.VehicleGarage = exports.Garage = exports.Document = exports.Vehicle = exports.Address = exports.Role = exports.User = exports.Customer = exports.Logger = exports.Operation = exports.Prestation = exports.Product = exports.Supplier = exports.Employee = exports.Absence = exports.Subscription = exports.MovaTableBack = exports.MovaTable = exports.LinkedDocumentDialog = exports.PrintSize = exports.PLVComponent = exports.QrCodePLVContainer = exports.ActivateAccount = exports.GenderSelector = exports.ConfirmationDialog = exports.MovaVehicleTireField = exports.MovaCopyright = exports.MovaSignUp = exports.MovaLogin = exports.MovaSnackbar = exports.TestButton = exports.oldRegexPlate = exports.regexPlate = exports.VehiclePlateField = exports.QRCode = exports.MovaDialog = exports.Loader = exports.MovaDigitalPassport = exports.VehicleFullCard = exports.ScheduleFields = exports.AddressFields = exports.AccountValidation = exports.GaragePLV = exports.IbanInput = exports.DialogForgotPassword = exports.UserService = exports.GarageService = exports.AuthenticationService = exports.VehicleService = void 0;
8
8
  exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.CustomerType = exports.API_BASE_URL = exports.request = exports.getLongFormattedDateTime = exports.formatDateByTimezone = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.getApplicationsShortLabels = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = exports.capitalizeFirstLetter = exports.getApplicationShortLabel = exports.isEmpty = exports.formatVehiclePlate = exports.formatVehicleTire = exports.validateField = exports.deleteCookie = exports.readCookie = exports.CategoryPrestation = exports.VehicleTire = exports.Event = void 0;
9
- exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.openDialogPrint = exports.APIMethod = void 0;
9
+ exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.getQrCodeBase64 = exports.openDialogPrint = exports.APIMethod = void 0;
10
10
  // Export des services
11
11
  var VehicleService_1 = require("./src/services/VehicleService");
12
12
  Object.defineProperty(exports, "VehicleService", { enumerable: true, get: function () { return __importDefault(VehicleService_1).default; } });
@@ -172,6 +172,8 @@ Object.defineProperty(exports, "APIMethod", { enumerable: true, get: function ()
172
172
  // Export des utils
173
173
  var DialogPrint_1 = require("./src/utils/DialogPrint");
174
174
  Object.defineProperty(exports, "openDialogPrint", { enumerable: true, get: function () { return DialogPrint_1.openDialogPrint; } });
175
+ var getQRCodeBase64_1 = require("./src/utils/getQRCodeBase64");
176
+ Object.defineProperty(exports, "getQrCodeBase64", { enumerable: true, get: function () { return getQRCodeBase64_1.getQrCodeBase64; } });
175
177
  // Export des styles
176
178
  var styled_1 = require("./src/style/styled");
177
179
  Object.defineProperty(exports, "StyledToggleButton", { enumerable: true, get: function () { return styled_1.StyledToggleButton; } });
@@ -39,6 +39,8 @@ var initialUserFormState = {
39
39
  tireSpeedIndex: { value: "", isValid: true },
40
40
  lastInspectionDate: { value: null, isValid: true },
41
41
  lastMaintenanceDate: { value: null, isValid: true },
42
+ tireBrand: { value: "", isValid: true },
43
+ tireProfile: { value: "", isValid: true },
42
44
  };
43
45
  var VehicleFullCard = function (_a) {
44
46
  var _b;
@@ -77,6 +79,8 @@ var VehicleFullCard = function (_a) {
77
79
  setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { lastMaintenanceDate: __assign(__assign({}, prevForm["lastMaintenanceDate"]), { value: vehicle.lastMaintenanceDate
78
80
  ? new Date(vehicle.lastMaintenanceDate)
79
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 }) })); });
80
84
  if (isVehicleTireSizeDefined(vehicle)) {
81
85
  setForm(function (prevForm) { return (__assign(__assign({}, prevForm), { tireSize: __assign(__assign({}, prevForm["tireSize"]), { value: vehicle.tireSize }) })); });
82
86
  }
@@ -187,6 +191,8 @@ var VehicleFullCard = function (_a) {
187
191
  : undefined,
188
192
  lastInspectionDate: form.lastInspectionDate.value,
189
193
  lastMaintenanceDate: form.lastMaintenanceDate.value,
194
+ tireBrand: form.tireBrand.value,
195
+ tireProfile: form.tireProfile.value,
190
196
  };
191
197
  Logger_1.default.info(query);
192
198
  // Appel du callback correspondant
@@ -242,7 +248,15 @@ var VehicleFullCard = function (_a) {
242
248
  ? form.currentMileage.error
243
249
  : "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
244
250
  ? String(form.averageMileagePerYear.value)
245
- : "", onChange: function (e) { return handleSelectChange(e); }, label: "Kilom\u00E9trage moyen annuel" }, { children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 5000 }, { children: "5 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 10000 }, { children: "10 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 15000 }, { children: "15 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 20000 }, { children: "20 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 25000 }, { children: "25 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 30000 }, { children: "30 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 50000 }, { children: "50 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 75000 }, { children: "75 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 100000 }, { children: "100 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 999999 }, { children: "+100 000" }))] })), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: form.averageMileagePerYear.error })] })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Pneumatiques :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: isVehicleTireSizeDefined(vehicle) ? ((0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehicleTire)(vehicle.tireSize) })) : ("-") })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: (0, jsx_runtime_1.jsx)(MovaVehicleTireField_1.default, { vehicleTire: form.tireSize.value, onChangeVehicleTire: handleOnChangeVehicleTire }) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier contr\u00F4le technique :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
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.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Pneumatiques :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: isVehicleTireSizeDefined(vehicle) ? ((0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehicleTire)(vehicle.tireSize) })) : ("-") })) }))] }))), !localEditMode && ((0, jsx_runtime_1.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.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: (0, jsx_runtime_1.jsx)(MovaVehicleTireField_1.default, { vehicleTire: form.tireSize.value, onChangeVehicleTire: handleOnChangeVehicleTire }) }))), localEditMode && ((0, jsx_runtime_1.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
+ width: "100%",
253
+ mt: 2,
254
+ "& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
255
+ } }) }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Marque pneumatique", name: "tireBrand", variant: "outlined", value: form.tireBrand.value, onChange: function (e) { return handleInputChange(e); }, error: Boolean(form.tireBrand.error), sx: {
256
+ width: "100%",
257
+ mt: 2,
258
+ "& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
259
+ } }) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier contr\u00F4le technique :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
246
260
  ? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
247
261
  : "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier contrôle technique", name: "lastInspectionDate", value: form.lastInspectionDate.value, format: "dd/MM/yyyy", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) { return handleChange("lastInspectionDate", e); } }) })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier entretien :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
248
262
  ? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
@@ -5,7 +5,7 @@ export type MovaValidationForm = {
5
5
  phoneNumber: MovaFormField;
6
6
  acceptsTerms: MovaFormField;
7
7
  };
8
- export type AddressFieldName = 'streetName' | 'additional' | 'postalCode' | 'cityName';
8
+ export type AddressFieldName = "streetName" | "additional" | "postalCode" | "cityName";
9
9
  export type MovaVehicleForm = {
10
10
  currentMileage: MovaFormField;
11
11
  averageMileagePerYear: MovaFormField;
@@ -16,6 +16,8 @@ export type MovaVehicleForm = {
16
16
  tireSpeedIndex: MovaFormField;
17
17
  lastInspectionDate: MovaFormField;
18
18
  lastMaintenanceDate: MovaFormField;
19
+ tireBrand: MovaFormField;
20
+ tireProfile: MovaFormField;
19
21
  };
20
22
  /**
21
23
  * Type utilisé pour définir un interval sur une objet Schedule
@@ -77,11 +77,13 @@ export default class Event {
77
77
  origin?: string;
78
78
  quoteLastSendingTime?: Date;
79
79
  invoiceSendingDate?: Date;
80
+ vehicleLoanStart?: Date;
81
+ vehicleLoanEnd?: Date;
80
82
  creationDate?: Date;
81
83
  updatedDate?: Date;
82
84
  quoteFirstSendingTime?: Date;
83
85
  lastQuoteCreationDate?: Date;
84
- constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: order[], creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date);
86
+ constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: order[], vehicleLoanStart?: Date, vehicleLoanEnd?: Date, creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date);
85
87
  static getPrestationsList(event: Event): string[];
86
88
  static getCurrentQuote(event: Event): Document | null;
87
89
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Enums_1 = require("../helpers/Enums");
4
4
  var Event = /** @class */ (function () {
5
- function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime) {
5
+ function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, vehicleLoanStart, vehicleLoanEnd, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime) {
6
6
  this.id = id;
7
7
  this.notes = notes;
8
8
  this.ownerId = ownerId;
@@ -39,6 +39,10 @@ var Event = /** @class */ (function () {
39
39
  ? new Date(invoiceSendingDate)
40
40
  : undefined;
41
41
  this.orders = orders;
42
+ this.vehicleLoanStart = vehicleLoanStart
43
+ ? new Date(vehicleLoanStart)
44
+ : undefined;
45
+ this.vehicleLoanEnd = vehicleLoanEnd ? new Date(vehicleLoanEnd) : undefined;
42
46
  this.creationDate = creationDate ? new Date(creationDate) : undefined;
43
47
  this.updatedDate = updatedDate ? new Date(updatedDate) : undefined;
44
48
  this.lastQuoteCreationDate = lastQuoteCreationDate
@@ -59,7 +59,8 @@ export default class Garage {
59
59
  billingToken?: string;
60
60
  billingSimulationActive?: boolean;
61
61
  appId?: number;
62
+ quoteRequestStart?: Date;
62
63
  companyRegistrationNumber?: string;
63
64
  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);
65
+ 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);
65
66
  }
@@ -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, establishmentRegistrationNumber, companyRegistrationNumber, 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
  this.companyRegistrationNumber = companyRegistrationNumber;
35
36
  this.establishmentRegistrationNumber = establishmentRegistrationNumber;
36
37
  }
@@ -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
  export default class Vehicle {
5
5
  id: number;
6
6
  ownerId: number;
@@ -23,6 +23,8 @@ export default class Vehicle {
23
23
  lastInspectionDate: Date;
24
24
  lastMaintenanceDate: Date;
25
25
  foreignPlate: boolean;
26
- 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);
26
+ tireBrand?: string;
27
+ tireProfile?: string;
28
+ 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, tireBrand?: string, tireProfile?: string);
27
29
  getVehicleLabel(): string;
28
30
  }
@@ -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) {
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) {
15
15
  this.id = id;
16
16
  this.ownerId = ownerId;
17
17
  this.averageMileagePerYear = averageMileagePerYear;
@@ -33,6 +33,8 @@ var Vehicle = /** @class */ (function () {
33
33
  this.lastInspectionDate = lastInspectionDate;
34
34
  this.lastMaintenanceDate = lastMaintenanceDate;
35
35
  this.foreignPlate = foreignPlate;
36
+ this.tireBrand = tireBrand;
37
+ this.tireProfile = tireProfile;
36
38
  }
37
39
  Vehicle.prototype.getVehicleLabel = function () {
38
40
  return "".concat(this.brand, " ").concat(this.model, " ").concat(this.version);
@@ -76,6 +76,7 @@ export default class GarageService {
76
76
  static getAllGarageVehicles(garageId: string): Promise<APIResponse<any>>;
77
77
  static getOneGarageVehicle(garageId: string, vehicleId: number): Promise<APIResponse<any>>;
78
78
  static assignGarageVehicleEvent(garageId: string, eventId: string, vehicleId: number): Promise<APIResponse<string>>;
79
+ static editGarageVehicleDateEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
79
80
  static deassignGarageVehicleEvent(garageId: string, eventId: string): Promise<APIResponse<string>>;
80
81
  static getGaragesCsm(): Promise<APIResponse<Garage[]>>;
81
82
  static getOneGarageCsm(garageId: string): Promise<APIResponse<Garage[]>>;
@@ -447,6 +447,14 @@ var GarageService = /** @class */ (function () {
447
447
  appType: Enums_1.MovaAppType.GARAGE,
448
448
  });
449
449
  };
450
+ GarageService.editGarageVehicleDateEvent = function (garageId, eventId, req) {
451
+ return (0, ApiHelper_1.request)({
452
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/vehicles/dates"),
453
+ method: Enums_1.APIMethod.PATCH,
454
+ appType: Enums_1.MovaAppType.GARAGE,
455
+ body: JSON.stringify(req),
456
+ });
457
+ };
450
458
  GarageService.deassignGarageVehicleEvent = function (garageId, eventId) {
451
459
  return (0, ApiHelper_1.request)({
452
460
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/vehicles"),
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ export declare const getQrCodeBase64: (url: string, dotsColor: string, cornerColor: string) => Promise<Blob | Buffer | null>;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.getQrCodeBase64 = void 0;
43
+ var qr_code_styling_1 = __importDefault(require("qr-code-styling"));
44
+ var leaf_yellow_small_png_1 = __importDefault(require("../assets/images/leaf_yellow_small.png"));
45
+ var getQrCodeBase64 = function (url, dotsColor, cornerColor) { return __awaiter(void 0, void 0, void 0, function () {
46
+ var qrCodeOptions, qrCode, qrCodeBase64;
47
+ return __generator(this, function (_a) {
48
+ switch (_a.label) {
49
+ case 0:
50
+ qrCodeOptions = {
51
+ width: 300,
52
+ height: 300,
53
+ type: 'canvas',
54
+ data: url,
55
+ image: leaf_yellow_small_png_1.default,
56
+ margin: 10,
57
+ qrOptions: {
58
+ typeNumber: 0,
59
+ mode: 'Byte',
60
+ errorCorrectionLevel: 'Q',
61
+ },
62
+ imageOptions: {
63
+ hideBackgroundDots: true,
64
+ imageSize: 0.4,
65
+ margin: 15,
66
+ },
67
+ dotsOptions: {
68
+ color: dotsColor,
69
+ type: 'square',
70
+ },
71
+ backgroundOptions: {
72
+ color: 'white',
73
+ },
74
+ cornersSquareOptions: {
75
+ color: cornerColor,
76
+ type: 'square',
77
+ },
78
+ cornersDotOptions: {
79
+ color: cornerColor,
80
+ type: 'square',
81
+ },
82
+ };
83
+ qrCode = new qr_code_styling_1.default(qrCodeOptions);
84
+ return [4 /*yield*/, qrCode.getRawData("png")];
85
+ case 1:
86
+ qrCodeBase64 = _a.sent();
87
+ return [2 /*return*/, qrCodeBase64];
88
+ }
89
+ });
90
+ }); };
91
+ exports.getQrCodeBase64 = getQrCodeBase64;
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.1",
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
+ };