@movalib/movalib-commons 1.59.20 → 1.59.22

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.
@@ -17,12 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var material_1 = require("@mui/material");
19
19
  var react_1 = require("react");
20
- var car_figure_png_1 = __importDefault(require("../../assets/images/car_figure.png"));
21
20
  var MovaVehicleTireField_1 = __importDefault(require("../../MovaVehicleTireField"));
22
21
  var ConfirmationDialog_1 = __importDefault(require("../../ConfirmationDialog"));
23
22
  var Enums_1 = require("../../helpers/Enums");
24
23
  var Tools_1 = require("../../helpers/Tools");
25
- var MovaDigitalPassport_1 = __importDefault(require("../../MovaDigitalPassport"));
26
24
  var DateUtils_1 = require("../../helpers/DateUtils");
27
25
  var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
28
26
  var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
@@ -30,6 +28,7 @@ var CloseRounded_2 = __importDefault(require("@mui/icons-material/CloseRounded")
30
28
  var Logger_1 = __importDefault(require("../../helpers/Logger"));
31
29
  var icons_material_1 = require("@mui/icons-material");
32
30
  var LinkedDocumentDialog_1 = require("../LinkedDocumentDialog");
31
+ var car_plate_bg_png_1 = __importDefault(require("../../assets/images/car_plate_bg.png"));
33
32
  var initialUserFormState = {
34
33
  currentMileage: { value: null, isValid: true },
35
34
  averageMileagePerYear: { value: null, isValid: true },
@@ -224,16 +223,10 @@ var VehicleFullCard = function (_a) {
224
223
  };
225
224
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [vehicle &&
226
225
  (0, jsx_runtime_1.jsxs)(material_1.Card, __assign({ variant: 'outlined', sx: {
227
- maxWidth: fullwidth ? '80%' : 345,
226
+ maxWidth: fullwidth ? '80%' : 500,
228
227
  backgroundColor: focused ? theme.palette.primary.light : 'white',
229
228
  overflow: 'visible', mt: 4, pb: 1
230
- } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: car_figure_png_1.default, style: {
231
- position: 'relative',
232
- width: '40%',
233
- top: '-25px',
234
- left: '-15px',
235
- zIndex: 200
236
- }, alt: 'Icone Voiture' }), (0, jsx_runtime_1.jsx)(MovaDigitalPassport_1.default, { digitalPassportIndex: vehicle.digitalPassportIndex }), (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.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.primary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatFrenchVehiclePlate)(vehicle.plate) }) })) })), !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: {
229
+ } }, { 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' } }, { 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.formatFrenchVehiclePlate)(vehicle.plate) }) }))] })), onDelete && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, style: { display: 'flex', alignItems: 'center', justifyContent: 'center' } }, { 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: {
237
230
  width: '100%',
238
231
  mt: 2,
239
232
  '& input': { textTransform: 'uppercase' } // CSS pour forcer les majuscules dans l'input
@@ -241,10 +234,6 @@ var VehicleFullCard = function (_a) {
241
234
  ? form.currentMileage.error : "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 ?
242
235
  String(form.averageMileagePerYear.value) : '', 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)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mt: 3, mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: "CARNET DU V\u00C9HICULE" })) })), vehicle.documents && ((_b = vehicle.documents) === null || _b === void 0 ? void 0 : _b.map(function (invoice, index) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: { justifyContent: 'space-between', alignItems: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 11, sx: { textAlign: 'left' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, __assign({ title: invoice.originalFileName }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ color: (0, material_1.darken)('#F29ABA', 0.2), href: invoice.fileSignedUrl, target: "_blank", rel: "noopener" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1" }, { children: invoice.fileName + ' ' + (0, DateUtils_1.formatDateByCountryCode)(invoice.creationDate, 'fr', Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) })) })) })) }), (index + 1) * 50), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 1, sx: { textAlign: 'right' } }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ disabled: !(invoice.ownerId.toString() == currentUser.id), onClick: function (e) { return handleDeleteDocument(e, invoice === null || invoice === void 0 ? void 0 : invoice.id); } }, { children: (0, jsx_runtime_1.jsx)(CloseRounded_2.default, {}) })) }), (index + 1) * 100)] }), index + 1)); })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 2, textAlign: 'center' } }, { children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("input", { accept: "image/*, application/pdf", type: "file", style: { display: 'none' }, ref: invoiceInputRef, id: "raised-button-invoice", onChange: function (e) { return handleFileChange(e, docTypeCurrent.current); } }), (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ size: 'large', disabled: currentUpload, onClick: function () { return setShowLinkedDocument(true); }, component: "span", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(icons_material_1.AttachFile, {}), sx: { alignItems: 'center', width: '90%', mt: 2, mb: 1, height: '50px', p: 1, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) } }, { children: "Ajouter un document" })), currentUpload && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body2', sx: { animation: 'blink 1.5s infinite' } }, { children: "Document en cours d'importation..." })), sizeLimit && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body1', sx: { animation: 'blink 1.5s infinite' }, color: theme.palette.warning.dark }, { children: "Echec de l'importation car la taille du fichier d\u00E9passe 10Mo" })), !sizeLimit && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body2' }, { children: "Taille maximale du fichier : 10Mo" }))] }) })) }))] })] })), (0, jsx_runtime_1.jsxs)(material_1.CardActions, __assign({ sx: { mt: 3, justifyContent: localEditMode ? 'center' : 'end' } }, { children: [!localEditMode &&
243
236
  (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickEdit, color: "inherit", sx: { width: '45%' }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "MODIFIER"] })) }), localEditMode &&
244
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickCancel, sx: { width: '45%', color: theme.palette.text.secondary }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { mr: 1 } }), "ANNULER"] })), (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickValidate, sx: { width: '45%', color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "VALIDER"] }))] })] }))] })), isShowLinkedDocument && (0, jsx_runtime_1.jsx)(LinkedDocumentDialog_1.LinkedDocumentDialog, { isVehicle: true, isShowLinkedDocument: isShowLinkedDocument, appType: appType, toggleShowLinkedDocument: toggleShowLinkedDocument, message: messageRGPD }), localEditMode && onDelete &&
245
- (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ onClick: function (e) { return handleOnClickDeleteVehicle(e); }, sx: {
246
- width: '90', mt: 4, color: theme.palette.error.light,
247
- borderColor: theme.palette.error.light
248
- }, variant: 'outlined' }, { children: "Supprimer le v\u00E9hicule" })), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmDocumentDelete, onClose: handleCloseConfirmDocumentDelete, onConfirm: handleConfirmDocumentDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce document ?" }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmVehicleDelete, onClose: handleCloseConfirmVehicleDelete, onConfirm: handleConfirmVehicleDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce v\u00E9hicule ?" })] }));
237
+ (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickCancel, sx: { width: '45%', color: theme.palette.text.secondary }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { mr: 1 } }), "ANNULER"] })), (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickValidate, sx: { width: '45%', color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "VALIDER"] }))] })] }))] })), isShowLinkedDocument && (0, jsx_runtime_1.jsx)(LinkedDocumentDialog_1.LinkedDocumentDialog, { isVehicle: true, isShowLinkedDocument: isShowLinkedDocument, appType: appType, toggleShowLinkedDocument: toggleShowLinkedDocument, message: messageRGPD }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmDocumentDelete, onClose: handleCloseConfirmDocumentDelete, onConfirm: handleConfirmDocumentDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce document ?" }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmVehicleDelete, onClose: handleCloseConfirmVehicleDelete, onConfirm: handleConfirmVehicleDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce v\u00E9hicule ?" })] }));
249
238
  };
250
239
  exports.default = VehicleFullCard;
@@ -191,7 +191,8 @@ export declare enum EventState {
191
191
  export declare enum EventType {
192
192
  APPOINTMENT = "APPOINTMENT",
193
193
  UNAVAILABILITY = "UNAVAILABILITY",
194
- NOTE = "NOTE"
194
+ NOTE = "NOTE",
195
+ PENDING_APPOINTMENT = "PENDING_APPOINTMENT"
195
196
  }
196
197
  export declare enum DayOfWeek {
197
198
  MONDAY = "MONDAY",
@@ -215,6 +215,7 @@ var EventType;
215
215
  EventType["APPOINTMENT"] = "APPOINTMENT";
216
216
  EventType["UNAVAILABILITY"] = "UNAVAILABILITY";
217
217
  EventType["NOTE"] = "NOTE";
218
+ EventType["PENDING_APPOINTMENT"] = "PENDING_APPOINTMENT";
218
219
  })(EventType = exports.EventType || (exports.EventType = {}));
219
220
  var DayOfWeek;
220
221
  (function (DayOfWeek) {
@@ -62,6 +62,7 @@ export default class Event {
62
62
  vehicleReceived?: boolean;
63
63
  garageVehicleId?: number;
64
64
  garageVehicleRequest?: boolean;
65
+ origin?: string;
65
66
  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);
66
67
  static getPrestationsList(event: Event): string[];
67
68
  }
@@ -20,6 +20,9 @@ export default class Garage {
20
20
  prestationCategories: CategoryPrestation[];
21
21
  prestations: Prestation[];
22
22
  schedules: Schedule[];
23
+ dayPeriodFastServiceExcluded: boolean;
24
+ loanerVehicleFastServiceExcluded: boolean;
25
+ fastServiceThreshold: number;
23
26
  vehicles?: VehicleGarage[];
24
27
  countryCode?: string;
25
28
  contactEmail?: string;
@@ -52,5 +55,5 @@ export default class Garage {
52
55
  paymentAuthorizationActive?: boolean;
53
56
  paymentAuthorizationMinDowntime?: number;
54
57
  customStyle?: string;
55
- constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number);
58
+ 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, vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number);
56
59
  }
@@ -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, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce) {
4
+ function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce) {
5
5
  this.id = id;
6
6
  this.adminId = adminId;
7
7
  this.name = name;
@@ -21,6 +21,9 @@ var Garage = /** @class */ (function () {
21
21
  this.loanerVehicleRequestActive = loanerVehicleRequestActive;
22
22
  this.subscription = subscription;
23
23
  this.partialWorkforce = partialWorkforce;
24
+ this.dayPeriodFastServiceExcluded = dayPeriodFastServiceExcluded;
25
+ this.loanerVehicleFastServiceExcluded = loanerVehicleFastServiceExcluded;
26
+ this.fastServiceThreshold = fastServiceThreshold;
24
27
  this.customStyle = customStyle;
25
28
  }
26
29
  return Garage;
@@ -54,6 +54,9 @@ export default class GarageService {
54
54
  static addCustomerVehicle({ garageId, customerId, ...payload }: AddCustomerVehicleParams): Promise<APIResponse<string>>;
55
55
  static deleteCustomerVehicle({ garageId, customerId, vehicleId, }: DeleteCustomerVehicleParams): Promise<APIResponse<string>>;
56
56
  static toogleGarageLoanerVehicleRequest(garageId: string, req: any): Promise<APIResponse<string>>;
57
+ static toogleGarageLoanerVehicleFastServiceExclusion(garageId: string): Promise<APIResponse<string>>;
58
+ static updateFastServiceThresholdRequest(garageId: string, value: any): Promise<APIResponse<string>>;
59
+ static updateSlotAlogrithm(garageId: string, req: any): Promise<APIResponse<string>>;
57
60
  static toogleGarageLoanerVehicle(garageId: string): Promise<APIResponse<string>>;
58
61
  static addGarageVehicle({ garageId, req, }: {
59
62
  garageId: string;
@@ -359,6 +359,28 @@ var GarageService = /** @class */ (function () {
359
359
  body: JSON.stringify(req),
360
360
  });
361
361
  };
362
+ GarageService.toogleGarageLoanerVehicleFastServiceExclusion = function (garageId) {
363
+ return (0, ApiHelper_1.request)({
364
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/loaner-vehicle-fast-service-exclusion"),
365
+ method: Enums_1.APIMethod.PATCH,
366
+ appType: Enums_1.MovaAppType.GARAGE,
367
+ });
368
+ };
369
+ GarageService.updateFastServiceThresholdRequest = function (garageId, value) {
370
+ return (0, ApiHelper_1.request)({
371
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/fast-service-threshold?fastServiceThreshold=").concat(encodeURIComponent(value)),
372
+ method: Enums_1.APIMethod.PATCH,
373
+ appType: Enums_1.MovaAppType.GARAGE,
374
+ });
375
+ };
376
+ GarageService.updateSlotAlogrithm = function (garageId, req) {
377
+ return (0, ApiHelper_1.request)({
378
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/slot-algorithm"),
379
+ method: Enums_1.APIMethod.PATCH,
380
+ appType: Enums_1.MovaAppType.GARAGE,
381
+ body: JSON.stringify(req),
382
+ });
383
+ };
362
384
  GarageService.toogleGarageLoanerVehicle = function (garageId) {
363
385
  return (0, ApiHelper_1.request)({
364
386
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/loaner-vehicle"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.59.20",
3
+ "version": "1.59.22",
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",
@@ -22,6 +22,7 @@ import Logger from '../../helpers/Logger';
22
22
  import { AttachFile } from '@mui/icons-material';
23
23
  import { LinkedDocumentDialog } from '../LinkedDocumentDialog';
24
24
  import User from '../../models/User';
25
+ import CatPlateBg from '../../assets/images/car_plate_bg.png';
25
26
 
26
27
  interface VehicleFullCardProps {
27
28
  currentUser: User,
@@ -94,7 +95,8 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
94
95
  setForm(prevForm => (
95
96
  { ...prevForm, ['tireSpeedIndex']: { ...prevForm['tireSpeedIndex'], value: vehicle.tireSpeedIndex } }));
96
97
 
97
- if (isVehicleTireSizeDefined(vehicle)) {
98
+ if (isVehicleTireSizeDefined(vehicle))
99
+ {
98
100
  setForm(prevForm => (
99
101
  { ...prevForm, ['tireSize']: { ...prevForm['tireSize'], value: vehicle.tireSize } }));
100
102
  }
@@ -265,22 +267,11 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
265
267
  <>
266
268
  {vehicle &&
267
269
  <Card variant='outlined' sx={{
268
- maxWidth: fullwidth ? '80%' : 345,
270
+ maxWidth: fullwidth ? '80%' : 500,
269
271
  backgroundColor: focused ? theme.palette.primary.light : 'white',
270
272
  overflow: 'visible', mt: 4, pb: 1
271
273
  }}
272
274
  >
273
- <img src={CarFigure} style={{
274
- position: 'relative',
275
- width: '40%',
276
- top: '-25px',
277
- left: '-15px',
278
- zIndex: 200
279
- }} alt='Icone Voiture'>
280
- </img>
281
-
282
- <MovaDigitalPassport digitalPassportIndex={vehicle.digitalPassportIndex} />
283
-
284
275
  <CardContent sx={{ pt: 0, pb: 0 }}>
285
276
  <Typography variant="h6" component="div" align="center" sx={{ mb: 1 }} color={darken(theme.palette.primary.main, 0.2)}>
286
277
  {vehicle.brand && `${vehicle.brand} `}
@@ -289,10 +280,26 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
289
280
  </Typography>
290
281
  <Grid container justifyContent="space-between">
291
282
 
292
- <Grid item xs={12}>
293
- <Typography variant="body1" color="text.primary">
294
- <b>{formatFrenchVehiclePlate(vehicle.plate)}</b>
295
- </Typography>
283
+ <Grid container sx={{ mb: 1, alignItems: 'center', justifyContent: 'center' }}>
284
+ <Grid item xs={6} sx={{ position: 'relative'}}>
285
+ <img
286
+ src={CatPlateBg}
287
+ alt="Plaque d'immatriculation"
288
+ style={{ height: '50px', position: 'relative', }}
289
+ />
290
+ <Typography
291
+ variant='h6'
292
+ color={theme.palette.text.primary}
293
+ sx={{ position: 'absolute', top: '8px', left: '76px' }}
294
+ >
295
+ <b>{formatFrenchVehiclePlate(vehicle.plate)}</b>
296
+ </Typography>
297
+ </Grid>
298
+ {onDelete && <Grid item xs={6} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
299
+ <Button variant='contained' color='error' onClick={(e) => handleOnClickDeleteVehicle(e)}>
300
+ Supprimer
301
+ </Button>
302
+ </Grid>}
296
303
  </Grid>
297
304
 
298
305
  {!localEditMode && <Grid container textAlign='justify' sx={{ pt: 2 }}>
@@ -522,15 +529,6 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
522
529
  message={messageRGPD}
523
530
  />}
524
531
 
525
- {localEditMode && onDelete &&
526
- <Button onClick={(e) => handleOnClickDeleteVehicle(e)} sx={{
527
- width: '90', mt: 4, color: theme.palette.error.light,
528
- borderColor: theme.palette.error.light
529
- }} variant='outlined'>
530
- Supprimer le véhicule
531
- </Button>
532
- }
533
-
534
532
  <ConfirmationDialog
535
533
  open={openConfirmDocumentDelete}
536
534
  onClose={handleCloseConfirmDocumentDelete}
@@ -213,6 +213,7 @@ export enum EventType {
213
213
  APPOINTMENT = "APPOINTMENT",
214
214
  UNAVAILABILITY = "UNAVAILABILITY",
215
215
  NOTE = "NOTE",
216
+ PENDING_APPOINTMENT = "PENDING_APPOINTMENT"
216
217
  }
217
218
 
218
219
  export enum DayOfWeek {
@@ -69,6 +69,7 @@ export default class Event {
69
69
  vehicleReceived?: boolean;
70
70
  garageVehicleId?: number;
71
71
  garageVehicleRequest?: boolean;
72
+ origin?: string;
72
73
 
73
74
  constructor(id: string, ownerId: number, type : EventType, title: string, garageName: string, garageId: number,color: string,
74
75
  state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[],
@@ -22,6 +22,9 @@ export default class Garage {
22
22
  prestationCategories: CategoryPrestation[];
23
23
  prestations: Prestation[];
24
24
  schedules: Schedule[];
25
+ dayPeriodFastServiceExcluded: boolean;
26
+ loanerVehicleFastServiceExcluded: boolean;
27
+ fastServiceThreshold: number;
25
28
  vehicles?: VehicleGarage[];
26
29
  countryCode?: string;
27
30
  contactEmail?: string;
@@ -53,6 +56,7 @@ export default class Garage {
53
56
  loanerVehicleRequestActive?: boolean;
54
57
  paymentAuthorizationActive?: boolean;
55
58
  paymentAuthorizationMinDowntime?: number;
59
+
56
60
  customStyle?: string;
57
61
 
58
62
  constructor(
@@ -65,6 +69,9 @@ export default class Garage {
65
69
  schedules: Schedule[],
66
70
  contactPhone: string,
67
71
  prestationCategories: CategoryPrestation[],
72
+ dayPeriodFastServiceExcluded: boolean,
73
+ loanerVehicleFastServiceExcluded: boolean,
74
+ fastServiceThreshold: number,
68
75
  vehicles?: VehicleGarage[],
69
76
  contactEmail?: string,
70
77
  logo?:string,
@@ -96,6 +103,9 @@ export default class Garage {
96
103
  this.loanerVehicleRequestActive = loanerVehicleRequestActive;
97
104
  this.subscription = subscription;
98
105
  this.partialWorkforce = partialWorkforce;
106
+ this.dayPeriodFastServiceExcluded = dayPeriodFastServiceExcluded;
107
+ this.loanerVehicleFastServiceExcluded = loanerVehicleFastServiceExcluded;
108
+ this.fastServiceThreshold = fastServiceThreshold;
99
109
  this.customStyle = customStyle;
100
110
  }
101
111
  }
@@ -507,6 +507,39 @@ export default class GarageService {
507
507
  });
508
508
  }
509
509
 
510
+ static toogleGarageLoanerVehicleFastServiceExclusion(
511
+ garageId: string,
512
+ ): Promise<APIResponse<string>> {
513
+ return request({
514
+ url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle-fast-service-exclusion`,
515
+ method: APIMethod.PATCH,
516
+ appType: MovaAppType.GARAGE,
517
+ });
518
+ }
519
+
520
+ static updateFastServiceThresholdRequest(
521
+ garageId: string,
522
+ value: any,
523
+ ): Promise<APIResponse<string>> {
524
+ return request({
525
+ url: `${API_BASE_URL}/garage/${garageId}/settings/fast-service-threshold?fastServiceThreshold=${encodeURIComponent(value)}`,
526
+ method: APIMethod.PATCH,
527
+ appType: MovaAppType.GARAGE,
528
+ });
529
+ }
530
+
531
+ static updateSlotAlogrithm(
532
+ garageId: string,
533
+ req: any,
534
+ ): Promise<APIResponse<string>> {
535
+ return request({
536
+ url: `${API_BASE_URL}/garage/${garageId}/settings/slot-algorithm`,
537
+ method: APIMethod.PATCH,
538
+ appType: MovaAppType.GARAGE,
539
+ body: JSON.stringify(req),
540
+ });
541
+ }
542
+
510
543
  static toogleGarageLoanerVehicle(
511
544
  garageId: string,
512
545
  ): Promise<APIResponse<string>> {