@movalib/movalib-commons 1.64.6 → 1.64.8

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
@@ -37,6 +37,7 @@ export { default as Document } from "./src/models/Document";
37
37
  export { default as Employee } from "./src/models/Employee";
38
38
  export { default as Event } from "./src/models/Event";
39
39
  export { default as Garage } from "./src/models/Garage";
40
+ export { default as LoanVehicle } from "./src/models/LoanVehicle";
40
41
  export { default as Operation } from "./src/models/Operation";
41
42
  export { default as Prestation } from "./src/models/Prestation";
42
43
  export { default as Product } from "./src/models/Product";
@@ -56,7 +57,7 @@ export { deleteCookie, readCookie } from "./src/helpers/CookieUtils";
56
57
  export { formatDateByTimezone, getLongFormattedDateTime, } from "./src/helpers/DateUtils";
57
58
  export { capitalizeFirstLetter, findScheduleByDayOfWeek, flexLeftRow, formatPhoneNumber, formatVehiclePlate, formatVehicleTire, getApplicationShortLabel, getApplicationsShortLabels, getDayOfWeekLabel, getFormattedIntervals, getFormattedSchedule, isEmpty, isSafariOniOS, validateField, } from "./src/helpers/Tools";
58
59
  export { validateEmail, validatePhoneNumber, validateText, } from "./src/helpers/Validator";
59
- export { APIMethod, CountryCode, CustomerType, DateFormatTypes, DayOfWeek, DigitalPassportIndex, DocumentState, DocumentType, EventState, EventType, Gender, MovaAppType, OrderPreference, OrderState, PartsApplicationType, PrestationState, PrestationType, ProductType, RegistrationState, RoleType, SecondaryPartsApplicationType, SlotAlgorithm, SubscriptionPaymentInterval, SubscriptionState, SubscriptionType, VehiclePlateFormat as VehiclePlateType, } from "./src/helpers/Enums";
60
+ export { APIMethod, CountryCode, CustomerType, DateFormatTypes, DayOfWeek, DigitalPassportIndex, DocumentState, DocumentType, EventState, EventType, Gender, MovaAppType, OrderPreference, OrderState, PartsApplicationType, PrestationState, PrestationType, ProductType, RegistrationState, RoleType, SlotAlgorithm, SubscriptionPaymentInterval, SubscriptionState, SubscriptionType, VehiclePlateFormat as VehiclePlateType, } from "./src/helpers/Enums";
60
61
  export { openDialogPrint } from "./src/utils/DialogPrint";
61
62
  export { getQrCodeBase64 } from "./src/utils/getQRCodeBase64";
62
63
  export { StyledToggleButton, StyledToggleButtonGroup, } from "./src/style/styled";
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.User = exports.Supplier = exports.Subscription = exports.Schedule = exports.Role = exports.Product = exports.Prestation = exports.Operation = exports.Garage = exports.Event = exports.Employee = exports.Document = exports.Customer = exports.CategoryPrestation = exports.Address = exports.Absence = exports.Logger = exports.TestButton = exports.ScheduleFields = exports.QRCode = exports.MovaVehicleTireField = exports.MovaSnackbar = exports.MovaSignUp = exports.MovaLogin = exports.MovaDigitalPassport = exports.MovaDialog = exports.MovaCopyright = exports.Loader = exports.IbanInput = exports.GenderSelector = exports.GaragePLV = exports.DialogForgotPassword = exports.ConfirmationDialog = exports.regexPlate = exports.oldRegexPlate = exports.VehiclePlateField = exports.VehicleFullCard = exports.ActivateAccount = exports.QrCodePLVContainer = exports.PrintSize = exports.PLVComponent = exports.MovaTableBack = exports.MovaTable = exports.LinkedDocumentDialog = exports.AddressFields = exports.AccountValidation = exports.VehicleService = exports.UserService = exports.GarageService = exports.AuthenticationService = void 0;
8
- exports.SubscriptionState = exports.SubscriptionPaymentInterval = exports.SlotAlgorithm = exports.SecondaryPartsApplicationType = exports.RoleType = exports.RegistrationState = exports.ProductType = exports.PrestationType = exports.PrestationState = exports.PartsApplicationType = exports.OrderState = exports.OrderPreference = exports.MovaAppType = exports.Gender = exports.EventType = exports.EventState = exports.DocumentType = exports.DocumentState = exports.DigitalPassportIndex = exports.DayOfWeek = exports.DateFormatTypes = exports.CustomerType = exports.CountryCode = exports.APIMethod = exports.validateText = exports.validatePhoneNumber = exports.validateEmail = exports.validateField = exports.isSafariOniOS = exports.isEmpty = exports.getFormattedSchedule = exports.getFormattedIntervals = exports.getDayOfWeekLabel = exports.getApplicationsShortLabels = exports.getApplicationShortLabel = exports.formatVehicleTire = exports.formatVehiclePlate = exports.formatPhoneNumber = exports.flexLeftRow = exports.findScheduleByDayOfWeek = exports.capitalizeFirstLetter = exports.getLongFormattedDateTime = exports.formatDateByTimezone = exports.readCookie = exports.deleteCookie = exports.request = exports.API_BASE_URL = exports.VehicleTire = exports.VehicleGarage = exports.Vehicle = void 0;
7
+ exports.Supplier = exports.Subscription = exports.Schedule = exports.Role = exports.Product = exports.Prestation = exports.Operation = exports.LoanVehicle = exports.Garage = exports.Event = exports.Employee = exports.Document = exports.Customer = exports.CategoryPrestation = exports.Address = exports.Absence = exports.Logger = exports.TestButton = exports.ScheduleFields = exports.QRCode = exports.MovaVehicleTireField = exports.MovaSnackbar = exports.MovaSignUp = exports.MovaLogin = exports.MovaDigitalPassport = exports.MovaDialog = exports.MovaCopyright = exports.Loader = exports.IbanInput = exports.GenderSelector = exports.GaragePLV = exports.DialogForgotPassword = exports.ConfirmationDialog = exports.regexPlate = exports.oldRegexPlate = exports.VehiclePlateField = exports.VehicleFullCard = exports.ActivateAccount = exports.QrCodePLVContainer = exports.PrintSize = exports.PLVComponent = exports.MovaTableBack = exports.MovaTable = exports.LinkedDocumentDialog = exports.AddressFields = exports.AccountValidation = exports.VehicleService = exports.UserService = exports.GarageService = exports.AuthenticationService = void 0;
8
+ exports.SubscriptionState = exports.SubscriptionPaymentInterval = exports.SlotAlgorithm = exports.RoleType = exports.RegistrationState = exports.ProductType = exports.PrestationType = exports.PrestationState = exports.PartsApplicationType = exports.OrderState = exports.OrderPreference = exports.MovaAppType = exports.Gender = exports.EventType = exports.EventState = exports.DocumentType = exports.DocumentState = exports.DigitalPassportIndex = exports.DayOfWeek = exports.DateFormatTypes = exports.CustomerType = exports.CountryCode = exports.APIMethod = exports.validateText = exports.validatePhoneNumber = exports.validateEmail = exports.validateField = exports.isSafariOniOS = exports.isEmpty = exports.getFormattedSchedule = exports.getFormattedIntervals = exports.getDayOfWeekLabel = exports.getApplicationsShortLabels = exports.getApplicationShortLabel = exports.formatVehicleTire = exports.formatVehiclePlate = exports.formatPhoneNumber = exports.flexLeftRow = exports.findScheduleByDayOfWeek = exports.capitalizeFirstLetter = exports.getLongFormattedDateTime = exports.formatDateByTimezone = exports.readCookie = exports.deleteCookie = exports.request = exports.API_BASE_URL = exports.VehicleTire = exports.VehicleGarage = exports.Vehicle = exports.User = void 0;
9
9
  exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.getQrCodeBase64 = exports.openDialogPrint = exports.VehiclePlateType = exports.SubscriptionType = void 0;
10
10
  // Export des services
11
11
  var AuthenticationService_1 = require("./src/services/AuthenticationService");
@@ -91,6 +91,8 @@ var Event_1 = require("./src/models/Event");
91
91
  Object.defineProperty(exports, "Event", { enumerable: true, get: function () { return __importDefault(Event_1).default; } });
92
92
  var Garage_1 = require("./src/models/Garage");
93
93
  Object.defineProperty(exports, "Garage", { enumerable: true, get: function () { return __importDefault(Garage_1).default; } });
94
+ var LoanVehicle_1 = require("./src/models/LoanVehicle");
95
+ Object.defineProperty(exports, "LoanVehicle", { enumerable: true, get: function () { return __importDefault(LoanVehicle_1).default; } });
94
96
  var Operation_1 = require("./src/models/Operation");
95
97
  Object.defineProperty(exports, "Operation", { enumerable: true, get: function () { return __importDefault(Operation_1).default; } });
96
98
  var Prestation_1 = require("./src/models/Prestation");
@@ -164,7 +166,6 @@ Object.defineProperty(exports, "PrestationType", { enumerable: true, get: functi
164
166
  Object.defineProperty(exports, "ProductType", { enumerable: true, get: function () { return Enums_1.ProductType; } });
165
167
  Object.defineProperty(exports, "RegistrationState", { enumerable: true, get: function () { return Enums_1.RegistrationState; } });
166
168
  Object.defineProperty(exports, "RoleType", { enumerable: true, get: function () { return Enums_1.RoleType; } });
167
- Object.defineProperty(exports, "SecondaryPartsApplicationType", { enumerable: true, get: function () { return Enums_1.SecondaryPartsApplicationType; } });
168
169
  Object.defineProperty(exports, "SlotAlgorithm", { enumerable: true, get: function () { return Enums_1.SlotAlgorithm; } });
169
170
  Object.defineProperty(exports, "SubscriptionPaymentInterval", { enumerable: true, get: function () { return Enums_1.SubscriptionPaymentInterval; } });
170
171
  Object.defineProperty(exports, "SubscriptionState", { enumerable: true, get: function () { return Enums_1.SubscriptionState; } });
@@ -10,6 +10,42 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
13
49
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
51
  };
@@ -258,11 +294,33 @@ var VehicleFullCard = function (_a) {
258
294
  overflow: "visible",
259
295
  mt: 4,
260
296
  pb: 1,
261
- } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.CardContent, __assign({ sx: { pt: 0, pb: 0 } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: [vehicle.brand && "".concat(vehicle.brand, " "), vehicle.model && "".concat(vehicle.model, " "), vehicle.version && "".concat(vehicle.version)] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: { mb: 1, alignItems: "center", justifyContent: "center" } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ item: true, xs: 6, sx: { position: "relative", minWidth: "234px" } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: car_plate_bg_png_1.default, alt: "Plaque d'immatriculation", style: { height: "50px", position: "relative" } }), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "h6", color: theme.palette.text.primary, sx: { position: "absolute", top: "8px", left: "76px" } }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehiclePlate)(vehicle.plate, vehicle.foreignPlate) }) }))] })), onDelete && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, style: {
297
+ } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.CardContent, __assign({ sx: { pt: 0, pb: 0 } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: [vehicle.brand && "".concat(vehicle.brand, " "), vehicle.model && "".concat(vehicle.model, " "), vehicle.version && "".concat(vehicle.version)] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: { mb: 1, alignItems: "center", justifyContent: "center" } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ item: true, xs: 6, sx: { position: "relative", minWidth: "234px" } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: car_plate_bg_png_1.default, alt: "Plaque d'immatriculation", style: { height: "50px", position: "relative" } }), (0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "h6", color: theme.palette.text.primary, sx: {
298
+ position: "absolute",
299
+ top: "8px",
300
+ left: "76px",
301
+ display: "flex",
302
+ } }, { children: [(0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehiclePlate)(vehicle.plate, vehicle.foreignPlate) }), (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ sx: { ml: 1 }, onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
303
+ return __generator(this, function (_a) {
304
+ switch (_a.label) {
305
+ case 0: return [4 /*yield*/, navigator.clipboard.writeText((0, Tools_1.formatVehiclePlate)(vehicle.plate, vehicle.foreignPlate))];
306
+ case 1: return [2 /*return*/, _a.sent()];
307
+ }
308
+ });
309
+ }); }, size: "small", "aria-label": "Copier le VIN" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { fontSize: "small" }) }))] }))] })), onDelete && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, style: {
262
310
  display: "flex",
263
311
  alignItems: "center",
264
312
  justifyContent: "center",
265
- } }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ variant: "contained", color: "error", onClick: function (e) { return handleOnClickDeleteVehicle(e); } }, { children: "Supprimer" })) })))] })), !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 actuel :" })) })), (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.currentMileage, " km"] }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Kilom\u00E9trage actuel", name: "currentMileage", variant: "outlined", type: "number", required: true, value: form.currentMileage.value, onChange: function (e) { return handleInputChange(e); }, error: Boolean(form.currentMileage.error), sx: {
313
+ } }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ variant: "contained", color: "error", onClick: function (e) { return handleOnClickDeleteVehicle(e); } }, { children: "Supprimer" })) })))] })), !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 actuel :" })) })), (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.currentMileage, " km"] }) })) }))] }))), !localEditMode && vehicle.vin && ((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: "Vin :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary", sx: {
314
+ display: "flex",
315
+ flexDirection: "row",
316
+ alignItems: "center",
317
+ justifyContent: "flex-end",
318
+ } }, { children: [(0, jsx_runtime_1.jsx)("b", { children: vehicle.vin }), (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ sx: { ml: 1, height: "24px" }, onClick: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
319
+ switch (_a.label) {
320
+ case 0: return [4 /*yield*/, navigator.clipboard.writeText(vehicle.vin)];
321
+ case 1: return [2 /*return*/, _a.sent()];
322
+ }
323
+ }); }); }, size: "small", "aria-label": "Copier le VIN" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { fontSize: "small" }) }))] })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Kilom\u00E9trage actuel", name: "currentMileage", variant: "outlined", type: "number", required: true, value: form.currentMileage.value, onChange: function (e) { return handleInputChange(e); }, error: Boolean(form.currentMileage.error), sx: {
266
324
  width: "100%",
267
325
  mt: 2,
268
326
  "& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
@@ -12,16 +12,6 @@ export declare enum SubscriptionState {
12
12
  PAUSED = "PAUSED",
13
13
  CANCELED = "CANCELED"
14
14
  }
15
- export declare enum SecondaryPartsApplicationType {
16
- HOOD = "HOOD",
17
- ROOF = "ROOF",
18
- DOOR = "DOOR",
19
- FENDER = "FENDER",
20
- JAMB = "JAMB",
21
- UNDERBODY = "UNDERBODY",
22
- BUMPER = "BUMPER",
23
- TRUNK = "TRUNK"
24
- }
25
15
  export declare enum CountryCode {
26
16
  FR = "FR"
27
17
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RoleType = exports.MovaAppType = exports.DocumentType = exports.QuoteState = exports.DocumentState = exports.DayOfWeek = exports.EventType = exports.EventState = exports.DigitalPassportIndex = exports.Gender = exports.DateFormatTypes = exports.APIMethod = exports.PartsApplicationType = exports.ProductType = exports.OrderPreference = exports.OrderState = exports.SlotAlgorithm = exports.VehiclePlateFormat = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.PrestationType = exports.PrestationState = exports.CountryCode = exports.SecondaryPartsApplicationType = exports.SubscriptionState = exports.SubscriptionType = exports.CustomerType = void 0;
3
+ exports.RoleType = exports.MovaAppType = exports.DocumentType = exports.QuoteState = exports.DocumentState = exports.DayOfWeek = exports.EventType = exports.EventState = exports.DigitalPassportIndex = exports.Gender = exports.DateFormatTypes = exports.APIMethod = exports.PartsApplicationType = exports.ProductType = exports.OrderPreference = exports.OrderState = exports.SlotAlgorithm = exports.VehiclePlateFormat = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.PrestationType = exports.PrestationState = exports.CountryCode = exports.SubscriptionState = exports.SubscriptionType = exports.CustomerType = void 0;
4
4
  var CustomerType;
5
5
  (function (CustomerType) {
6
6
  CustomerType["INDIVIDUAL"] = "INDIVIDUAL";
@@ -18,17 +18,6 @@ var SubscriptionState;
18
18
  SubscriptionState["PAUSED"] = "PAUSED";
19
19
  SubscriptionState["CANCELED"] = "CANCELED";
20
20
  })(SubscriptionState = exports.SubscriptionState || (exports.SubscriptionState = {}));
21
- var SecondaryPartsApplicationType;
22
- (function (SecondaryPartsApplicationType) {
23
- SecondaryPartsApplicationType["HOOD"] = "HOOD";
24
- SecondaryPartsApplicationType["ROOF"] = "ROOF";
25
- SecondaryPartsApplicationType["DOOR"] = "DOOR";
26
- SecondaryPartsApplicationType["FENDER"] = "FENDER";
27
- SecondaryPartsApplicationType["JAMB"] = "JAMB";
28
- SecondaryPartsApplicationType["UNDERBODY"] = "UNDERBODY";
29
- SecondaryPartsApplicationType["BUMPER"] = "BUMPER";
30
- SecondaryPartsApplicationType["TRUNK"] = "TRUNK";
31
- })(SecondaryPartsApplicationType = exports.SecondaryPartsApplicationType || (exports.SecondaryPartsApplicationType = {}));
32
21
  var CountryCode;
33
22
  (function (CountryCode) {
34
23
  CountryCode["FR"] = "FR";
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from "react";
2
2
  import Schedule from "../models/Schedule";
3
3
  import VehicleTire from "../models/VehicleTire";
4
- import { DayOfWeek, PartsApplicationType, SecondaryPartsApplicationType } from "./Enums";
4
+ import { DayOfWeek, PartsApplicationType } from "./Enums";
5
5
  import { MovaFormField, MovaInterval } from "./Types";
6
6
  export declare const getApplicationsShortLabels: (applications: PartsApplicationType[] | undefined) => string;
7
7
  export declare const flexStart: CSSProperties;
@@ -21,7 +21,6 @@ export declare const getFrenchDayLabel: (day: DayOfWeek | undefined) => "Lundi"
21
21
  export declare const flexLeftRow: CSSProperties;
22
22
  export declare const capitalizeFirstLetter: (str: string) => string;
23
23
  export declare const getApplicationShortLabel: (application: PartsApplicationType | undefined) => "" | "AV" | "AR" | "AV + AR" | "G" | "D" | "G + D" | "AVG" | "AVD" | "ARG" | "ARD";
24
- export declare const getApplicationSecondaryLabel: (secondaryApplication: SecondaryPartsApplicationType) => string;
25
24
  export declare const flexEnd: CSSProperties;
26
25
  export declare const flexCenter: CSSProperties;
27
26
  export declare const isEmpty: (data: Object) => boolean;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = exports.getApplicationSecondaryLabel = exports.getApplicationShortLabel = exports.capitalizeFirstLetter = exports.flexLeftRow = exports.getFrenchDayLabel = exports.getDayOfWeek = exports.findScheduleByDayOfWeek = exports.formatTime = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.getDayOfWeekIndex = exports.getDayOfWeekLabel = exports.FR_WEEK_DAYS = exports.isInvalidPhoneNumber = exports.isInvalidMobileNumber = exports.isSafariOniOS = exports.flexStart = exports.getApplicationsShortLabels = void 0;
6
+ exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = exports.getApplicationShortLabel = exports.capitalizeFirstLetter = exports.flexLeftRow = exports.getFrenchDayLabel = exports.getDayOfWeek = exports.findScheduleByDayOfWeek = exports.formatTime = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.getDayOfWeekIndex = exports.getDayOfWeekLabel = exports.FR_WEEK_DAYS = exports.isInvalidPhoneNumber = exports.isInvalidMobileNumber = exports.isSafariOniOS = exports.flexStart = exports.getApplicationsShortLabels = void 0;
7
7
  var max_1 = __importDefault(require("libphonenumber-js/max"));
8
8
  var Enums_1 = require("./Enums");
9
9
  var getApplicationsShortLabels = function (applications) {
@@ -252,27 +252,6 @@ var getApplicationShortLabel = function (application) {
252
252
  return "";
253
253
  };
254
254
  exports.getApplicationShortLabel = getApplicationShortLabel;
255
- var getApplicationSecondaryLabel = function (secondaryApplication) {
256
- switch (secondaryApplication) {
257
- case Enums_1.SecondaryPartsApplicationType.HOOD:
258
- return "Capot";
259
- case Enums_1.SecondaryPartsApplicationType.ROOF:
260
- return "Toit";
261
- case Enums_1.SecondaryPartsApplicationType.DOOR:
262
- return "Portière";
263
- case Enums_1.SecondaryPartsApplicationType.TRUNK:
264
- return "Coffre";
265
- case Enums_1.SecondaryPartsApplicationType.FENDER:
266
- return "Aile";
267
- case Enums_1.SecondaryPartsApplicationType.JAMB:
268
- return "Montant";
269
- case Enums_1.SecondaryPartsApplicationType.UNDERBODY:
270
- return "Bas de caisse";
271
- case Enums_1.SecondaryPartsApplicationType.BUMPER:
272
- return "Pare-chocs";
273
- }
274
- };
275
- exports.getApplicationSecondaryLabel = getApplicationSecondaryLabel;
276
255
  exports.flexEnd = {
277
256
  display: "flex",
278
257
  justifyContent: "end",
@@ -3,6 +3,7 @@ import Address from "./Address";
3
3
  import Customer from "./Customer";
4
4
  import Document from "./Document";
5
5
  import Employee from "./Employee";
6
+ import LoanVehicle from "./LoanVehicle";
6
7
  import Operation from "./Operation";
7
8
  import Prestation from "./Prestation";
8
9
  import Product from "./Product";
@@ -77,14 +78,13 @@ export default class Event {
77
78
  origin?: string;
78
79
  quoteLastSendingTime?: Date;
79
80
  invoiceSendingDate?: Date;
80
- vehicleLoanStart?: Date;
81
- vehicleLoanEnd?: Date;
81
+ garageVehicleBookings?: LoanVehicle[];
82
82
  creationDate?: Date;
83
83
  updatedDate?: Date;
84
84
  quoteFirstSendingTime?: Date;
85
85
  lastQuoteCreationDate?: Date;
86
86
  urgent?: boolean;
87
- 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, urgent?: boolean);
87
+ 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, urgent?: boolean, garageVehicleBookings?: LoanVehicle[]);
88
88
  static getPrestationsList(event: Event): string[];
89
89
  static getCurrentQuote(event: Event): Document | null;
90
90
  }
@@ -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, vehicleLoanStart, vehicleLoanEnd, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent) {
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, urgent, garageVehicleBookings) {
6
6
  this.id = id;
7
7
  this.notes = notes;
8
8
  this.ownerId = ownerId;
@@ -39,10 +39,6 @@ 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;
46
42
  this.creationDate = creationDate ? new Date(creationDate) : undefined;
47
43
  this.updatedDate = updatedDate ? new Date(updatedDate) : undefined;
48
44
  this.lastQuoteCreationDate = lastQuoteCreationDate
@@ -52,6 +48,7 @@ var Event = /** @class */ (function () {
52
48
  ? new Date(quoteFirstSendingTime)
53
49
  : undefined;
54
50
  this.urgent = urgent;
51
+ this.garageVehicleBookings = garageVehicleBookings;
55
52
  }
56
53
  Event.getPrestationsList = function (event) {
57
54
  if (event && event.prestations) {
@@ -58,10 +58,11 @@ export default class Garage {
58
58
  billingActive?: boolean;
59
59
  billingToken?: string;
60
60
  billingSimulationActive?: boolean;
61
+ demoBillingActive?: boolean;
61
62
  appId?: number;
62
63
  quoteRequestStart?: Date;
63
64
  companyRegistrationNumber?: string;
64
65
  establishmentRegistrationNumber?: string;
65
66
  reopeningDate?: Date;
66
- 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, reopeningDate?: Date);
67
+ 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, reopeningDate?: Date, demoBillingActive?: boolean);
67
68
  }
@@ -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, quoteRequestStart, reopeningDate) {
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, reopeningDate, demoBillingActive) {
5
5
  this.id = id;
6
6
  this.adminId = adminId;
7
7
  this.name = name;
@@ -35,6 +35,7 @@ var Garage = /** @class */ (function () {
35
35
  this.companyRegistrationNumber = companyRegistrationNumber;
36
36
  this.establishmentRegistrationNumber = establishmentRegistrationNumber;
37
37
  this.reopeningDate = reopeningDate;
38
+ this.demoBillingActive = demoBillingActive;
38
39
  }
39
40
  return Garage;
40
41
  }());
@@ -0,0 +1,8 @@
1
+ export default class LoanVehicle {
2
+ id: number;
3
+ eventId: string;
4
+ garageVehicleId: number;
5
+ vehicleLoanEnd: Date;
6
+ vehicleLoanStart: Date;
7
+ constructor(id: number, eventId: string, garageVehicleId: number, vehicleLoanStart: Date, vehicleLoanEnd: Date);
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var LoanVehicle = /** @class */ (function () {
4
+ function LoanVehicle(id, eventId, garageVehicleId, vehicleLoanStart, vehicleLoanEnd) {
5
+ this.id = id;
6
+ this.eventId = eventId;
7
+ this.garageVehicleId = garageVehicleId;
8
+ this.vehicleLoanStart = new Date(vehicleLoanStart);
9
+ this.vehicleLoanEnd = new Date(vehicleLoanEnd);
10
+ }
11
+ return LoanVehicle;
12
+ }());
13
+ exports.default = LoanVehicle;
@@ -1,4 +1,4 @@
1
- import { PartsApplicationType, SecondaryPartsApplicationType } from "../helpers/Enums";
1
+ import { PartsApplicationType } from "../helpers/Enums";
2
2
  import Product from "./Product";
3
3
  export default class Operation {
4
4
  id: number;
@@ -7,6 +7,5 @@ export default class Operation {
7
7
  description: string;
8
8
  application?: PartsApplicationType;
9
9
  products?: Product[];
10
- secondaryApplication?: SecondaryPartsApplicationType;
11
- constructor(id: number, code: string, name: string, description: string, application: PartsApplicationType, products: Product[], secondaryApplication?: SecondaryPartsApplicationType);
10
+ constructor(id: number, code: string, name: string, description: string, application: PartsApplicationType, products: Product[]);
12
11
  }
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Operation = /** @class */ (function () {
4
- function Operation(id, code, name, description, application, products, secondaryApplication) {
4
+ function Operation(id, code, name, description, application, products) {
5
5
  this.id = id;
6
6
  this.code = code;
7
7
  this.name = name;
8
8
  this.description = description;
9
9
  this.application = application;
10
10
  this.products = products;
11
- this.secondaryApplication = secondaryApplication;
12
11
  }
13
12
  return Operation;
14
13
  }());
@@ -28,6 +28,5 @@ export default class Prestation {
28
28
  multipleApplication: boolean;
29
29
  operationsVisible: boolean;
30
30
  categoryCode: string;
31
- secondaryMultipleApplication: boolean;
32
- constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operationsVisible: boolean, categoryCode: string, availableOnline: boolean, operations?: Operation[], secondaryMultipleApplication?: boolean);
31
+ constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operationsVisible: boolean, categoryCode: string, availableOnline: boolean, operations?: Operation[]);
33
32
  }
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Prestation = /** @class */ (function () {
4
- function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operationsVisible, categoryCode, availableOnline, operations, secondaryMultipleApplication) {
5
- if (secondaryMultipleApplication === void 0) { secondaryMultipleApplication = false; }
4
+ function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operationsVisible, categoryCode, availableOnline, operations) {
6
5
  this.id = id;
7
6
  this.code = code;
8
7
  this.name = name;
@@ -18,7 +17,6 @@ var Prestation = /** @class */ (function () {
18
17
  this.state = state;
19
18
  this.categoryCode = categoryCode;
20
19
  this.availableOnline = availableOnline;
21
- this.secondaryMultipleApplication = secondaryMultipleApplication;
22
20
  }
23
21
  return Prestation;
24
22
  }());
@@ -8,6 +8,7 @@ export default class GarageService {
8
8
  static toogleUrgentQuote(garageId: string, quoteId: string): Promise<APIResponse<string>>;
9
9
  static updatePaymentAuthorization(garageId: string, req: any): Promise<APIResponse<string>>;
10
10
  static toogleGaragePaymentAuthorization(garageId: string): Promise<APIResponse<string>>;
11
+ static toogleGarageSimulationDemoBilling(garageId: string): Promise<APIResponse<string>>;
11
12
  static toogleEventVehicleReceived(garageId: string, eventId: string): Promise<APIResponse<string>>;
12
13
  static setOrderedEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
13
14
  static deleteEventEmployee(garageId: string, eventId: string): Promise<APIResponse<string>>;
@@ -38,6 +38,13 @@ var GarageService = /** @class */ (function () {
38
38
  appType: Enums_1.MovaAppType.GARAGE,
39
39
  });
40
40
  };
41
+ GarageService.toogleGarageSimulationDemoBilling = function (garageId) {
42
+ return (0, ApiHelper_1.request)({
43
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/demo-billing/toggle"),
44
+ method: Enums_1.APIMethod.PATCH,
45
+ appType: Enums_1.MovaAppType.GARAGE,
46
+ });
47
+ };
41
48
  GarageService.toogleEventVehicleReceived = function (garageId, eventId) {
42
49
  return (0, ApiHelper_1.request)({
43
50
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/events/").concat(eventId, "/vehicle-received"),
package/index.ts CHANGED
@@ -51,6 +51,7 @@ export { default as Document } from "./src/models/Document";
51
51
  export { default as Employee } from "./src/models/Employee";
52
52
  export { default as Event } from "./src/models/Event";
53
53
  export { default as Garage } from "./src/models/Garage";
54
+ export { default as LoanVehicle } from "./src/models/LoanVehicle";
54
55
  export { default as Operation } from "./src/models/Operation";
55
56
  export { default as Prestation } from "./src/models/Prestation";
56
57
  export { default as Product } from "./src/models/Product";
@@ -125,7 +126,6 @@ export {
125
126
  ProductType,
126
127
  RegistrationState,
127
128
  RoleType,
128
- SecondaryPartsApplicationType,
129
129
  SlotAlgorithm,
130
130
  SubscriptionPaymentInterval,
131
131
  SubscriptionState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.64.6",
3
+ "version": "1.64.8",
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",
@@ -1,4 +1,4 @@
1
- import { AttachFile } from "@mui/icons-material";
1
+ import { AttachFile, ContentCopy } from "@mui/icons-material";
2
2
  import {
3
3
  default as CancelIcon,
4
4
  default as CloseIcon,
@@ -484,11 +484,31 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
484
484
  <Typography
485
485
  variant="h6"
486
486
  color={theme.palette.text.primary}
487
- sx={{ position: "absolute", top: "8px", left: "76px" }}
487
+ sx={{
488
+ position: "absolute",
489
+ top: "8px",
490
+ left: "76px",
491
+ display: "flex",
492
+ }}
488
493
  >
489
494
  <b>
490
495
  {formatVehiclePlate(vehicle.plate, vehicle.foreignPlate)}
491
496
  </b>
497
+ <IconButton
498
+ sx={{ ml: 1 }}
499
+ onClick={async () =>
500
+ await navigator.clipboard.writeText(
501
+ formatVehiclePlate(
502
+ vehicle.plate,
503
+ vehicle.foreignPlate
504
+ )
505
+ )
506
+ }
507
+ size="small"
508
+ aria-label="Copier le VIN"
509
+ >
510
+ <ContentCopy fontSize="small" />
511
+ </IconButton>
492
512
  </Typography>
493
513
  </Grid>
494
514
  {onDelete && (
@@ -527,6 +547,40 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
527
547
  </Grid>
528
548
  )}
529
549
 
550
+ {!localEditMode && vehicle.vin && (
551
+ <Grid container textAlign="justify" sx={{ pt: 2 }}>
552
+ <Grid item xs={6}>
553
+ <Typography variant="body1" color="text.secondary">
554
+ Vin :
555
+ </Typography>
556
+ </Grid>
557
+ <Grid item xs={6} sx={{ textAlign: "right" }}>
558
+ <Typography
559
+ variant="body1"
560
+ color="text.secondary"
561
+ sx={{
562
+ display: "flex",
563
+ flexDirection: "row",
564
+ alignItems: "center",
565
+ justifyContent: "flex-end",
566
+ }}
567
+ >
568
+ <b>{vehicle.vin}</b>
569
+ <IconButton
570
+ sx={{ ml: 1, height: "24px" }}
571
+ onClick={async () =>
572
+ await navigator.clipboard.writeText(vehicle.vin)
573
+ }
574
+ size="small"
575
+ aria-label="Copier le VIN"
576
+ >
577
+ <ContentCopy fontSize="small" />
578
+ </IconButton>
579
+ </Typography>
580
+ </Grid>
581
+ </Grid>
582
+ )}
583
+
530
584
  {localEditMode && (
531
585
  <Grid item xs={12}>
532
586
  <TextField
@@ -14,16 +14,7 @@ export enum SubscriptionState {
14
14
  PAUSED = "PAUSED",
15
15
  CANCELED = "CANCELED",
16
16
  }
17
- export enum SecondaryPartsApplicationType {
18
- HOOD = "HOOD",
19
- ROOF = "ROOF",
20
- DOOR = "DOOR",
21
- FENDER = "FENDER",
22
- JAMB = "JAMB",
23
- UNDERBODY = "UNDERBODY",
24
- BUMPER = "BUMPER",
25
- TRUNK = "TRUNK",
26
- }
17
+
27
18
  export enum CountryCode {
28
19
  FR = "FR",
29
20
  }
@@ -248,7 +239,7 @@ export enum QuoteState {
248
239
  QUOTE_SENT = "QUOTE_SENT",
249
240
  QUOTE_ACCEPTED = "QUOTE_ACCEPTED",
250
241
  QUOTE_REJECTED = "QUOTE_REJECTED",
251
- QUOTE_CANCELLED = "CANCELLED",
242
+ QUOTE_CANCELLED = "CANCELLED"
252
243
  }
253
244
 
254
245
  export enum DocumentType {
@@ -2,12 +2,7 @@ import parsePhoneNumberFromString from "libphonenumber-js/max";
2
2
  import { CSSProperties } from "react";
3
3
  import Schedule from "../models/Schedule";
4
4
  import VehicleTire from "../models/VehicleTire";
5
- import {
6
- DayOfWeek,
7
- PartsApplicationType,
8
- SecondaryPartsApplicationType,
9
- VehiclePlateFormat,
10
- } from "./Enums";
5
+ import { DayOfWeek, PartsApplicationType, VehiclePlateFormat } from "./Enums";
11
6
  import { MovaFormField, MovaInterval } from "./Types";
12
7
 
13
8
  export const getApplicationsShortLabels = (
@@ -283,29 +278,6 @@ export const getApplicationShortLabel = (
283
278
  return "";
284
279
  };
285
280
 
286
- export const getApplicationSecondaryLabel = (
287
- secondaryApplication: SecondaryPartsApplicationType
288
- ): string => {
289
- switch (secondaryApplication) {
290
- case SecondaryPartsApplicationType.HOOD:
291
- return "Capot";
292
- case SecondaryPartsApplicationType.ROOF:
293
- return "Toit";
294
- case SecondaryPartsApplicationType.DOOR:
295
- return "Portière";
296
- case SecondaryPartsApplicationType.TRUNK:
297
- return "Coffre";
298
- case SecondaryPartsApplicationType.FENDER:
299
- return "Aile";
300
- case SecondaryPartsApplicationType.JAMB:
301
- return "Montant";
302
- case SecondaryPartsApplicationType.UNDERBODY:
303
- return "Bas de caisse";
304
- case SecondaryPartsApplicationType.BUMPER:
305
- return "Pare-chocs";
306
- }
307
- };
308
-
309
281
  export const flexEnd: CSSProperties = {
310
282
  display: "flex",
311
283
  justifyContent: "end",
@@ -322,14 +294,12 @@ export const isEmpty = (data: Object): boolean => {
322
294
  return Object.keys(data).length === 0;
323
295
  };
324
296
 
325
- export const formatVehiclePlate = (
326
- input: string | undefined,
327
- isForeignPlate: boolean
328
- ): string => {
297
+ export const formatVehiclePlate = (input: string | undefined, isForeignPlate: boolean): string => {
329
298
  if (input) {
299
+
330
300
  let plateFormat: VehiclePlateFormat | null = null;
331
301
 
332
- if (isForeignPlate) {
302
+ if(isForeignPlate) {
333
303
  // Plaque étrangère
334
304
  plateFormat = VehiclePlateFormat.FOREIGN;
335
305
  } else if (/^[A-Za-z]/.test(input)) {
@@ -368,6 +338,7 @@ export const formatVehiclePlate = (
368
338
 
369
339
  case VehiclePlateFormat.FOREIGN: {
370
340
  // On retourne la plaque telle qu'enregistrée par l'utilisateur, ras
341
+
371
342
  }
372
343
  }
373
344
  return cleanedInput;
@@ -10,6 +10,7 @@ import Address from "./Address";
10
10
  import Customer from "./Customer";
11
11
  import Document from "./Document";
12
12
  import Employee from "./Employee";
13
+ import LoanVehicle from "./LoanVehicle";
13
14
  import Operation from "./Operation";
14
15
  import Prestation from "./Prestation";
15
16
  import Product from "./Product";
@@ -89,8 +90,10 @@ export default class Event {
89
90
  origin?: string;
90
91
  quoteLastSendingTime?: Date;
91
92
  invoiceSendingDate?: Date;
92
- vehicleLoanStart?: Date;
93
- vehicleLoanEnd?: Date; creationDate?: Date;
93
+
94
+ garageVehicleBookings?: LoanVehicle[];
95
+
96
+ creationDate?: Date;
94
97
  updatedDate?: Date;
95
98
  quoteFirstSendingTime?: Date;
96
99
  lastQuoteCreationDate?: Date;
@@ -124,13 +127,12 @@ export default class Event {
124
127
  quoteLastSendingTime?: Date,
125
128
  invoiceSendingDate?: Date,
126
129
  orders?: order[],
127
- vehicleLoanStart?: Date,
128
- vehicleLoanEnd?: Date,
129
130
  creationDate?: Date,
130
131
  updatedDate?: Date,
131
132
  lastQuoteCreationDate?: Date,
132
133
  quoteFirstSendingTime?: Date,
133
- urgent?: boolean
134
+ urgent?: boolean,
135
+ garageVehicleBookings?: LoanVehicle[]
134
136
  ) {
135
137
  this.id = id;
136
138
  this.notes = notes;
@@ -168,10 +170,7 @@ export default class Event {
168
170
  ? new Date(invoiceSendingDate)
169
171
  : undefined;
170
172
  this.orders = orders;
171
- this.vehicleLoanStart = vehicleLoanStart
172
- ? new Date(vehicleLoanStart)
173
- : undefined;
174
- this.vehicleLoanEnd = vehicleLoanEnd ? new Date(vehicleLoanEnd) : undefined;
173
+
175
174
  this.creationDate = creationDate ? new Date(creationDate) : undefined;
176
175
  this.updatedDate = updatedDate ? new Date(updatedDate) : undefined;
177
176
  this.lastQuoteCreationDate = lastQuoteCreationDate
@@ -180,7 +179,8 @@ export default class Event {
180
179
  this.quoteFirstSendingTime = quoteFirstSendingTime
181
180
  ? new Date(quoteFirstSendingTime)
182
181
  : undefined;
183
- this.urgent = urgent
182
+ this.urgent = urgent;
183
+ this.garageVehicleBookings = garageVehicleBookings;
184
184
  }
185
185
 
186
186
  static getPrestationsList(event: Event): string[] {
@@ -64,6 +64,7 @@ export default class Garage {
64
64
  billingActive?: boolean;
65
65
  billingToken?: string;
66
66
  billingSimulationActive?: boolean;
67
+ demoBillingActive?: boolean;
67
68
  appId?: number;
68
69
  quoteRequestStart?: Date;
69
70
  companyRegistrationNumber?: string;
@@ -102,7 +103,8 @@ export default class Garage {
102
103
  establishmentRegistrationNumber?: string,
103
104
  companyRegistrationNumber?: string,
104
105
  quoteRequestStart?: Date,
105
- reopeningDate?: Date
106
+ reopeningDate?: Date,
107
+ demoBillingActive?: boolean
106
108
  ) {
107
109
  this.id = id;
108
110
  this.adminId = adminId;
@@ -137,5 +139,6 @@ export default class Garage {
137
139
  this.companyRegistrationNumber = companyRegistrationNumber;
138
140
  this.establishmentRegistrationNumber = establishmentRegistrationNumber;
139
141
  this.reopeningDate = reopeningDate;
142
+ this.demoBillingActive = demoBillingActive;
140
143
  }
141
144
  }
@@ -0,0 +1,22 @@
1
+ export default class LoanVehicle {
2
+ id: number; //UUID
3
+ eventId: string; //UUID
4
+ garageVehicleId: number;
5
+
6
+ vehicleLoanEnd: Date;
7
+ vehicleLoanStart: Date;
8
+
9
+ constructor(
10
+ id: number,
11
+ eventId: string,
12
+ garageVehicleId: number,
13
+ vehicleLoanStart: Date,
14
+ vehicleLoanEnd: Date
15
+ ) {
16
+ this.id = id;
17
+ this.eventId = eventId;
18
+ this.garageVehicleId = garageVehicleId;
19
+ this.vehicleLoanStart = new Date(vehicleLoanStart);
20
+ this.vehicleLoanEnd = new Date(vehicleLoanEnd);
21
+ }
22
+ }
@@ -1,35 +1,23 @@
1
- import {
2
- PartsApplicationType,
3
- SecondaryPartsApplicationType,
4
- } from "../helpers/Enums";
1
+ import { PartsApplicationType } from "../helpers/Enums";
5
2
  import Product from "./Product";
6
3
 
7
4
  export default class Operation {
8
- // Properties
9
- id: number;
10
- code: string;
11
- name: string;
12
- description: string;
13
- // Eventuelle application de l'opération (avant, arrière)
14
- application?: PartsApplicationType;
15
- products?: Product[];
16
- secondaryApplication?: SecondaryPartsApplicationType;
17
5
 
18
- constructor(
19
- id: number,
20
- code: string,
21
- name: string,
22
- description: string,
23
- application: PartsApplicationType,
24
- products: Product[],
25
- secondaryApplication?: SecondaryPartsApplicationType
26
- ) {
27
- this.id = id;
28
- this.code = code;
29
- this.name = name;
30
- this.description = description;
31
- this.application = application;
32
- this.products = products;
33
- this.secondaryApplication = secondaryApplication;
34
- }
35
- }
6
+ // Properties
7
+ id: number;
8
+ code: string;
9
+ name: string;
10
+ description: string;
11
+ // Eventuelle application de l'opération (avant, arrière)
12
+ application?: PartsApplicationType;
13
+ products?: Product[];
14
+
15
+ constructor(id:number, code: string, name:string, description: string, application: PartsApplicationType, products: Product[]) {
16
+ this.id = id;
17
+ this.code = code;
18
+ this.name = name;
19
+ this.description = description;
20
+ this.application = application;
21
+ this.products = products;
22
+ }
23
+ }
@@ -2,73 +2,57 @@ import { PrestationState } from "../helpers/Enums";
2
2
  import Operation from "./Operation";
3
3
 
4
4
  export default class Prestation {
5
- // Properties
6
- id: number;
7
- code: string;
8
- name: string;
9
- description: string;
10
- category: string;
11
- /**
12
- * Durée d'immobilisation pour cette prestation (en jours)
13
- */
14
- downtime: number;
15
- /**
16
- * Délai avant prise de rendez-vous pour cette prestation (en jours)
17
- */
18
- appointmentDelay: number;
19
- /**
20
- * Opérations inhérentes à cette prestation
21
- */
22
- operations?: Operation[];
23
- /**
24
- * La notion de position (ou d'ordre) peut être utile à l'affichage d'une liste de prestation par exemple
25
- */
26
- position: number;
27
- availableOnline: boolean;
28
5
 
29
- active: boolean;
6
+ // Properties
7
+ id: number;
8
+ code: string;
9
+ name: string;
10
+ description: string;
11
+ category: string;
12
+ /**
13
+ * Durée d'immobilisation pour cette prestation (en jours)
14
+ */
15
+ downtime: number;
16
+ /**
17
+ * Délai avant prise de rendez-vous pour cette prestation (en jours)
18
+ */
19
+ appointmentDelay: number;
20
+ /**
21
+ * Opérations inhérentes à cette prestation
22
+ */
23
+ operations?: Operation[];
24
+ /**
25
+ * La notion de position (ou d'ordre) peut être utile à l'affichage d'une liste de prestation par exemple
26
+ */
27
+ position: number;
28
+ availableOnline: boolean;
30
29
 
31
- state: PrestationState;
30
+ active:boolean;
32
31
 
33
- multipleApplication: boolean;
32
+ state: PrestationState;
34
33
 
35
- operationsVisible: boolean;
36
- categoryCode: string;
37
- secondaryMultipleApplication: boolean;
34
+ multipleApplication: boolean;
38
35
 
39
- constructor(
40
- id: number,
41
- code: string,
42
- name: string,
43
- description: string,
44
- category: string,
45
- downtime: number,
46
- appointmentDelay: number,
47
- position: number,
48
- active: boolean,
49
- state: PrestationState,
50
- multipleApplication: boolean,
51
- operationsVisible: boolean,
52
- categoryCode: string,
53
- availableOnline: boolean,
54
- operations?: Operation[],
55
- secondaryMultipleApplication: boolean = false
56
- ) {
57
- this.id = id;
58
- this.code = code;
59
- this.name = name;
60
- this.description = description;
61
- this.category = category;
62
- this.downtime = downtime;
63
- this.appointmentDelay = appointmentDelay;
64
- this.position = position;
65
- this.active = active;
66
- this.multipleApplication = multipleApplication;
67
- this.operationsVisible = operationsVisible;
68
- this.operations = operations;
69
- this.state = state;
70
- this.categoryCode = categoryCode;
71
- this.availableOnline = availableOnline;
72
- this.secondaryMultipleApplication = secondaryMultipleApplication;
73
- }
74
- }
36
+ operationsVisible: boolean;
37
+ categoryCode: string;
38
+
39
+ constructor(id:number, code: string, name:string, description: string, category:string,
40
+ downtime:number, appointmentDelay: number, position: number, active: boolean, state: PrestationState,
41
+ multipleApplication: boolean, operationsVisible: boolean,categoryCode: string, availableOnline:boolean, operations?: Operation[]) {
42
+ this.id = id;
43
+ this.code = code;
44
+ this.name = name;
45
+ this.description = description;
46
+ this.category = category;
47
+ this.downtime = downtime;
48
+ this.appointmentDelay = appointmentDelay;
49
+ this.position = position;
50
+ this.active = active;
51
+ this.multipleApplication = multipleApplication;
52
+ this.operationsVisible = operationsVisible;
53
+ this.operations = operations;
54
+ this.state = state;
55
+ this.categoryCode = categoryCode;
56
+ this.availableOnline = availableOnline;
57
+ }
58
+ }
@@ -10,8 +10,10 @@ import {
10
10
  } from "./GarageService.types";
11
11
 
12
12
  export default class GarageService {
13
-
14
- static toogleUrgentQuote(garageId: string, quoteId: string): Promise<APIResponse<string>> {
13
+ static toogleUrgentQuote(
14
+ garageId: string,
15
+ quoteId: string
16
+ ): Promise<APIResponse<string>> {
15
17
  return request({
16
18
  url: `${API_BASE_URL}/garage/${garageId}/quotes/${quoteId}/urgent`,
17
19
  method: APIMethod.PATCH,
@@ -41,6 +43,16 @@ export default class GarageService {
41
43
  });
42
44
  }
43
45
 
46
+ static toogleGarageSimulationDemoBilling(
47
+ garageId: string
48
+ ): Promise<APIResponse<string>> {
49
+ return request({
50
+ url: `${API_BASE_URL}/garage/${garageId}/demo-billing/toggle`,
51
+ method: APIMethod.PATCH,
52
+ appType: MovaAppType.GARAGE,
53
+ });
54
+ }
55
+
44
56
  static toogleEventVehicleReceived(
45
57
  garageId: string,
46
58
  eventId: string