@movalib/movalib-commons 1.64.0 → 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)
@@ -57,7 +57,8 @@ export declare enum SubscriptionPaymentInterval {
57
57
  /**
58
58
  * Paiement 24 Mois
59
59
  */
60
- TWO_YEARS = "TWO_YEARS"
60
+ TWO_YEARS = "TWO_YEARS",
61
+ THREE_YEARS = "THREE_YEARS"
61
62
  }
62
63
  export declare enum RegistrationState {
63
64
  /**
@@ -68,6 +68,7 @@ var SubscriptionPaymentInterval;
68
68
  * Paiement 24 Mois
69
69
  */
70
70
  SubscriptionPaymentInterval["TWO_YEARS"] = "TWO_YEARS";
71
+ SubscriptionPaymentInterval["THREE_YEARS"] = "THREE_YEARS";
71
72
  })(SubscriptionPaymentInterval = exports.SubscriptionPaymentInterval || (exports.SubscriptionPaymentInterval = {}));
72
73
  var RegistrationState;
73
74
  (function (RegistrationState) {
@@ -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
@@ -60,5 +60,7 @@ export default class Garage {
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
+ companyRegistrationNumber?: string;
64
+ establishmentRegistrationNumber?: 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);
64
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, quoteRequestStart) {
4
+ function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, quoteRequestStart) {
5
5
  this.id = id;
6
6
  this.adminId = adminId;
7
7
  this.name = name;
@@ -32,6 +32,8 @@ var Garage = /** @class */ (function () {
32
32
  this.billingSimulationActive = billingSimulationActive;
33
33
  this.appId = appId;
34
34
  this.quoteRequestStart = quoteRequestStart;
35
+ this.companyRegistrationNumber = companyRegistrationNumber;
36
+ this.establishmentRegistrationNumber = establishmentRegistrationNumber;
35
37
  }
36
38
  return Garage;
37
39
  }());
@@ -17,6 +17,7 @@ interface roiInterface {
17
17
  workingTimePerEmployee: number;
18
18
  partialWorkforce: number;
19
19
  workingTimePerPartialEmployee: number;
20
+ smsCampaign: boolean;
20
21
  }
21
22
  export default class Subscription {
22
23
  id: string;
@@ -35,13 +36,15 @@ export default class Subscription {
35
36
  paymentIban: string;
36
37
  roi: roiInterface;
37
38
  additionalFormationQuantity: number;
38
- additionalFormationFree: boolean;
39
39
  webPage: boolean;
40
40
  webcam: boolean;
41
- plvQuantity: number;
42
- plvFree: boolean;
41
+ billing: boolean;
43
42
  trainingOptionalOne: Date;
44
43
  trainingOptionalTwo: Date;
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);
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);
46
49
  }
47
50
  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, additionalFormationFree, webPage, plvQuantity, plvFree, trainingOptionalOne, trainingOptionalTwo, webcam) {
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) {
5
5
  this.id = id;
6
6
  this.garageId = garageId;
7
7
  this.type = type;
@@ -19,12 +19,14 @@ 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;
25
22
  this.webcam = webcam;
23
+ this.billing = billing;
26
24
  this.trainingOptionalOne = trainingOptionalOne;
27
25
  this.trainingOptionalTwo = trainingOptionalTwo;
26
+ this.movaPackage = movaPackage;
27
+ this.packInfo = packInfo;
28
+ this.smsCampaign = smsCampaign;
29
+ this.checkList = checkList;
28
30
  }
29
31
  return Subscription;
30
32
  }());
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.64.0",
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",