@movalib/movalib-commons 1.68.35 → 1.68.37
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 +1 -1
- package/dist/index.js +4 -3
- package/dist/src/components/vehicle/VehicleFullCard.js +11 -8
- package/dist/src/helpers/Enums.d.ts +10 -1
- package/dist/src/helpers/Enums.js +9 -0
- package/dist/src/helpers/Tools.d.ts +1 -1
- package/dist/src/helpers/Tools.js +18 -0
- package/dist/src/models/Customer.d.ts +11 -1
- package/dist/src/models/Customer.js +15 -1
- package/dist/src/models/Settings.d.ts +2 -1
- package/dist/src/models/Settings.js +1 -0
- package/dist/src/models/Vehicle.d.ts +1 -0
- package/dist/src/services/GarageService.d.ts +1 -1
- package/dist/src/services/GarageService.js +7 -1
- package/dist/src/style/styled.js +0 -1
- package/dist/src/style/styled.ts +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/components/vehicle/VehicleFullCard.tsx +30 -0
- package/src/helpers/Enums.ts +9 -0
- package/src/helpers/Tools.ts +21 -8
- package/src/models/Customer.ts +22 -1
- package/src/models/Settings.ts +2 -0
- package/src/models/Vehicle.ts +1 -0
- package/src/services/GarageService.ts +8 -2
- package/src/style/styled.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { default as Logger } from "./src/helpers/Logger";
|
|
|
32
32
|
export { default as Absence } from "./src/models/Absence";
|
|
33
33
|
export { default as Address } from "./src/models/Address";
|
|
34
34
|
export { default as CategoryPrestation } from "./src/models/CategoryPrestation";
|
|
35
|
-
export { default as Customer } from "./src/models/Customer";
|
|
35
|
+
export { default as Customer, Contact } from "./src/models/Customer";
|
|
36
36
|
export type { EmailVerification } from "./src/models/EmailVerification";
|
|
37
37
|
export { default as Document } from "./src/models/Document";
|
|
38
38
|
export { default as Employee } from "./src/models/Employee";
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ 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.
|
|
8
|
-
exports.
|
|
9
|
-
exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.getSetting = exports.isStockActive = exports.getQrCodeBase64 = exports.openDialogPrint = exports.VehiclePlateType = exports.SubscriptionType = exports.SubscriptionState = exports.SubscriptionPaymentInterval = void 0;
|
|
7
|
+
exports.Subscription = exports.Schedule = exports.Role = exports.Product = exports.Prestation = exports.Operation = exports.LoanVehicle = exports.Garage = exports.Event = exports.Employee = exports.Document = exports.Contact = 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.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.LoanVehicleLightAgreement = exports.VehicleTire = exports.VehicleGarage = exports.Vehicle = exports.User = exports.Supplier = void 0;
|
|
9
|
+
exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.getSetting = exports.isStockActive = exports.getQrCodeBase64 = exports.openDialogPrint = exports.VehiclePlateType = exports.SubscriptionType = exports.SubscriptionState = exports.SubscriptionPaymentInterval = exports.SlotAlgorithm = void 0;
|
|
10
10
|
// Export des services
|
|
11
11
|
var AuthenticationService_1 = require("./src/services/AuthenticationService");
|
|
12
12
|
Object.defineProperty(exports, "AuthenticationService", { enumerable: true, get: function () { return __importDefault(AuthenticationService_1).default; } });
|
|
@@ -83,6 +83,7 @@ var CategoryPrestation_1 = require("./src/models/CategoryPrestation");
|
|
|
83
83
|
Object.defineProperty(exports, "CategoryPrestation", { enumerable: true, get: function () { return __importDefault(CategoryPrestation_1).default; } });
|
|
84
84
|
var Customer_1 = require("./src/models/Customer");
|
|
85
85
|
Object.defineProperty(exports, "Customer", { enumerable: true, get: function () { return __importDefault(Customer_1).default; } });
|
|
86
|
+
Object.defineProperty(exports, "Contact", { enumerable: true, get: function () { return Customer_1.Contact; } });
|
|
86
87
|
var Document_1 = require("./src/models/Document");
|
|
87
88
|
Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return __importDefault(Document_1).default; } });
|
|
88
89
|
var Employee_1 = require("./src/models/Employee");
|
|
@@ -54,6 +54,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
54
54
|
var icons_material_1 = require("@mui/icons-material");
|
|
55
55
|
var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
56
56
|
var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
|
|
57
|
+
var NoteAlt_1 = __importDefault(require("@mui/icons-material/NoteAlt"));
|
|
57
58
|
var material_1 = require("@mui/material");
|
|
58
59
|
var x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
59
60
|
var moment_1 = __importDefault(require("moment"));
|
|
@@ -98,21 +99,23 @@ var VehicleFullCard = function (_a) {
|
|
|
98
99
|
var _b, _c, _d, _e;
|
|
99
100
|
var vehicle = _a.vehicle, fullwidth = _a.fullwidth, onError = _a.onError, onUploadDocument = _a.onUploadDocument, onDeleteDocument = _a.onDeleteDocument, appType = _a.appType, _f = _a.editMode, editMode = _f === void 0 ? false : _f, _g = _a.focused, focused = _g === void 0 ? false : _g, onUpdate = _a.onUpdate, onDelete = _a.onDelete, currentUpload = _a.currentUpload, currentUser = _a.currentUser;
|
|
100
101
|
var theme = (0, material_1.useTheme)();
|
|
102
|
+
var isDesktop = (0, material_1.useMediaQuery)(theme.breakpoints.up('md'));
|
|
103
|
+
var _h = (0, react_1.useState)(null), notesAnchorEl = _h[0], setNotesAnchorEl = _h[1];
|
|
101
104
|
var sectionTitleSx = {
|
|
102
105
|
fontWeight: "bold",
|
|
103
106
|
textTransform: "uppercase",
|
|
104
107
|
mb: 1,
|
|
105
108
|
color: theme.palette.primary.main
|
|
106
109
|
};
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
var
|
|
110
|
+
var _j = (0, react_1.useState)(editMode), localEditMode = _j[0], setLocalEditMode = _j[1];
|
|
111
|
+
var _k = (0, react_1.useState)(false), openConfirmDocumentDelete = _k[0], setOpenConfirmDocumentDelete = _k[1];
|
|
112
|
+
var _l = (0, react_1.useState)(false), openConfirmVehicleDelete = _l[0], setOpenConfirmVehicleDelete = _l[1];
|
|
113
|
+
var _m = (0, react_1.useState)(""), documentToDelete = _m[0], setDocumentToDelete = _m[1];
|
|
114
|
+
var _o = (0, react_1.useState)(false), sizeLimit = _o[0], setSizeLimit = _o[1];
|
|
115
|
+
var _p = (0, react_1.useState)(initialUserFormState), form = _p[0], setForm = _p[1];
|
|
113
116
|
var invoiceInputRef = (0, react_1.useRef)(null);
|
|
114
117
|
var tirePictureInputRef = (0, react_1.useRef)(null);
|
|
115
|
-
var
|
|
118
|
+
var _q = (0, react_1.useState)(false), isShowLinkedDocument = _q[0], setShowLinkedDocument = _q[1];
|
|
116
119
|
var docTypeCurrent = (0, react_1.useRef)();
|
|
117
120
|
var messageRGPD = appType === Enums_1.MovaAppType.INDIVIDUAL ? ((0, jsx_runtime_1.jsx)(material_1.Box, {})) : ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { mt: 2 }, children: (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "warning", children: "Vous \u00EAtes responsable des documents que vous importez, en ajoutant un document vous reconnaissez disposer du consentement explicite du client pour le stockage de ses donn\u00E9es conform\u00E9ment \u00E0 la r\u00E9glementation RGPD." }) }));
|
|
118
121
|
(0, react_1.useEffect)(function () {
|
|
@@ -280,7 +283,7 @@ var VehicleFullCard = function (_a) {
|
|
|
280
283
|
case 1: return [2 /*return*/, _a.sent()];
|
|
281
284
|
}
|
|
282
285
|
});
|
|
283
|
-
}); }, "aria-label": "Copier la plaque", children: (0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { sx: { fontSize: 14, color: "text.disabled" } }) })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", flexDirection: "row", alignItems: "flex-end", gap: 1 }, children: [onDelete && ((0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", color: "error", size: "small", onClick: function (e) { return handleOnClickDeleteVehicle(e); }, children: "Supprimer" })), !localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleOnClickEdit, size: "small", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { fontSize: "14px !important" } }), sx: {
|
|
286
|
+
}); }, "aria-label": "Copier la plaque", children: (0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { sx: { fontSize: 14, color: "text.disabled" } }) })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", flexDirection: "row", alignItems: "flex-end", gap: 1 }, children: [vehicle.notes && appType !== Enums_1.MovaAppType.INDIVIDUAL && (isDesktop ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: vehicle.notes.length > 500 ? vehicle.notes.slice(0, 500) + '…' : vehicle.notes, children: (0, jsx_runtime_1.jsx)(NoteAlt_1.default, { sx: { color: '#F59E0B', fontSize: 22, cursor: 'default', alignSelf: 'center' } }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", onClick: function (e) { return setNotesAnchorEl(e.currentTarget); }, sx: { p: 0.5, alignSelf: 'center' }, children: (0, jsx_runtime_1.jsx)(NoteAlt_1.default, { sx: { color: '#F59E0B', fontSize: 22 } }) }), (0, jsx_runtime_1.jsx)(material_1.Popover, { open: Boolean(notesAnchorEl), anchorEl: notesAnchorEl, onClose: function () { return setNotesAnchorEl(null); }, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { p: 2, maxWidth: 280, fontSize: 13 }, children: vehicle.notes.length > 500 ? vehicle.notes.slice(0, 500) + '…' : vehicle.notes }) })] }))), onDelete && ((0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", color: "error", size: "small", onClick: function (e) { return handleOnClickDeleteVehicle(e); }, children: "Supprimer" })), !localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleOnClickEdit, size: "small", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { fontSize: "14px !important" } }), sx: {
|
|
284
287
|
fontSize: 12,
|
|
285
288
|
borderColor: "divider",
|
|
286
289
|
}, children: "Modifier" }))] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { px: 2, py: 1.5, borderBottom: "0.5px solid", borderColor: "divider" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: sectionTitleSx, children: "Kilom\u00E9trage" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { bgcolor: "grey.50", borderRadius: 1, p: 1.25 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", color: "text.secondary", display: "block", children: "Actuel" }), !localEditMode ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body1", fontWeight: 500, children: [(_b = vehicle.currentMileage) !== null && _b !== void 0 ? _b : "-", " ", (0, jsx_runtime_1.jsx)(material_1.Typography, { component: "span", variant: "caption", color: "text.secondary", children: "km" })] })) : ((0, jsx_runtime_1.jsx)(material_1.TextField, { name: "currentMileage", variant: "standard", type: "number", required: true, value: (_c = form.currentMileage.value) !== null && _c !== void 0 ? _c : "", onChange: handleInputChange, error: Boolean(form.currentMileage.error), helperText: Boolean(form.currentMileage.error && form.currentMileage.value > 0)
|
|
@@ -138,7 +138,16 @@ export declare enum PartsApplicationType {
|
|
|
138
138
|
FRONT_LEFT = "FTLT",
|
|
139
139
|
FRONT_RIGHT = "FTRT",
|
|
140
140
|
REAR_LEFT = "RRLT",
|
|
141
|
-
REAR_RIGHT = "RRRT"
|
|
141
|
+
REAR_RIGHT = "RRRT",
|
|
142
|
+
ENG = "ENG",
|
|
143
|
+
TRA = "TRA",
|
|
144
|
+
OIL = "OIL",
|
|
145
|
+
BRK = "BRK",
|
|
146
|
+
COOL = "COOL",
|
|
147
|
+
PS = "PS",
|
|
148
|
+
FUEL = "FUEL",
|
|
149
|
+
TRAOIL = "TRAOIL",
|
|
150
|
+
AC = "AC"
|
|
142
151
|
}
|
|
143
152
|
export declare enum APIMethod {
|
|
144
153
|
GET = "GET",
|
|
@@ -157,6 +157,15 @@ var PartsApplicationType;
|
|
|
157
157
|
PartsApplicationType["FRONT_RIGHT"] = "FTRT";
|
|
158
158
|
PartsApplicationType["REAR_LEFT"] = "RRLT";
|
|
159
159
|
PartsApplicationType["REAR_RIGHT"] = "RRRT";
|
|
160
|
+
PartsApplicationType["ENG"] = "ENG";
|
|
161
|
+
PartsApplicationType["TRA"] = "TRA";
|
|
162
|
+
PartsApplicationType["OIL"] = "OIL";
|
|
163
|
+
PartsApplicationType["BRK"] = "BRK";
|
|
164
|
+
PartsApplicationType["COOL"] = "COOL";
|
|
165
|
+
PartsApplicationType["PS"] = "PS";
|
|
166
|
+
PartsApplicationType["FUEL"] = "FUEL";
|
|
167
|
+
PartsApplicationType["TRAOIL"] = "TRAOIL";
|
|
168
|
+
PartsApplicationType["AC"] = "AC";
|
|
160
169
|
})(PartsApplicationType || (exports.PartsApplicationType = PartsApplicationType = {}));
|
|
161
170
|
var APIMethod;
|
|
162
171
|
(function (APIMethod) {
|
|
@@ -21,7 +21,7 @@ export declare const getDayOfWeek: (index: number) => DayOfWeek | undefined;
|
|
|
21
21
|
export declare const getFrenchDayLabel: (day: DayOfWeek | undefined) => "Lundi" | "Mardi" | "Mercredi" | "Jeudi" | "Vendredi" | "Samedi" | "Dimanche" | undefined;
|
|
22
22
|
export declare const flexLeftRow: CSSProperties;
|
|
23
23
|
export declare const capitalizeFirstLetter: (str: string) => string;
|
|
24
|
-
export declare const getApplicationShortLabel: (application: PartsApplicationType | undefined) => "" | "AVG" | "AVD" | "ARG" | "ARD" | "AV" | "AR" | "G" | "D" | "AV + AR" | "G + D";
|
|
24
|
+
export declare const getApplicationShortLabel: (application: PartsApplicationType | undefined) => "" | "AVG" | "AVD" | "ARG" | "ARD" | "AV" | "AR" | "G" | "D" | "AV + AR" | "G + D" | "Liq. frein" | "Moteur" | "Transm." | "HUILE" | "Liq. refroid." | "Direct. assistée" | "Carburant" | "Huile boîte" | "Clim.";
|
|
25
25
|
export declare const getApplicationSecondaryLabel: (secondaryApplication: SecondaryPartsApplicationType) => string;
|
|
26
26
|
export declare const flexEnd: CSSProperties;
|
|
27
27
|
export declare const flexCenter: CSSProperties;
|
|
@@ -259,6 +259,24 @@ var getApplicationShortLabel = function (application) {
|
|
|
259
259
|
return "ARG";
|
|
260
260
|
case Enums_1.PartsApplicationType.REAR_RIGHT:
|
|
261
261
|
return "ARD";
|
|
262
|
+
case Enums_1.PartsApplicationType.BRK:
|
|
263
|
+
return "Liq. frein";
|
|
264
|
+
case Enums_1.PartsApplicationType.ENG:
|
|
265
|
+
return "Moteur";
|
|
266
|
+
case Enums_1.PartsApplicationType.TRA:
|
|
267
|
+
return "Transm.";
|
|
268
|
+
case Enums_1.PartsApplicationType.OIL:
|
|
269
|
+
return "HUILE";
|
|
270
|
+
case Enums_1.PartsApplicationType.COOL:
|
|
271
|
+
return "Liq. refroid.";
|
|
272
|
+
case Enums_1.PartsApplicationType.PS:
|
|
273
|
+
return "Direct. assistée";
|
|
274
|
+
case Enums_1.PartsApplicationType.FUEL:
|
|
275
|
+
return "Carburant";
|
|
276
|
+
case Enums_1.PartsApplicationType.TRAOIL:
|
|
277
|
+
return "Huile boîte";
|
|
278
|
+
case Enums_1.PartsApplicationType.AC:
|
|
279
|
+
return "Clim.";
|
|
262
280
|
}
|
|
263
281
|
}
|
|
264
282
|
return "";
|
|
@@ -4,6 +4,14 @@ import { EmailVerification } from "./EmailVerification";
|
|
|
4
4
|
import Role from "./Role";
|
|
5
5
|
import User from "./User";
|
|
6
6
|
import Vehicle from "./Vehicle";
|
|
7
|
+
export declare class Contact {
|
|
8
|
+
id: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
phoneNumber?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
emailVerification?: EmailVerification;
|
|
13
|
+
constructor(id: number, name?: string, phoneNumber?: string, email?: string, emailVerification?: EmailVerification);
|
|
14
|
+
}
|
|
7
15
|
export default class Customer extends User {
|
|
8
16
|
vehicles: Vehicle[];
|
|
9
17
|
turnover: {
|
|
@@ -41,8 +49,10 @@ export default class Customer extends User {
|
|
|
41
49
|
drivingLicenseNumber?: string;
|
|
42
50
|
drivingLicenseObtainedAt?: Date;
|
|
43
51
|
drivingLicensePlace?: string;
|
|
52
|
+
contacts?: Contact[];
|
|
53
|
+
deliveryNotePriced?: boolean;
|
|
44
54
|
constructor(id: string, roles: Role[] | undefined, firstname: string | undefined, lastname: string | undefined, avatar: string | undefined, addresses: Address[] | undefined, vehicles: Vehicle[], email: string | undefined, turnover: {
|
|
45
55
|
key: string;
|
|
46
56
|
value: number;
|
|
47
|
-
}[], type: CustomerType, companyName: string, companyPhoneNumber: string, billingAddress: Address | undefined, notes: string, siren?: string, vatId?: string, contactId?: number, establishmentId?: number, paymentMethods?: string, paymentPeriod?: number, discountRate?: number, billingEmail?: string, additionalEmails?: string, seCode?: string, drivingLicenseNumber?: string, drivingLicenseObtainedAt?: Date, drivingLicensePlace?: string);
|
|
57
|
+
}[], type: CustomerType, companyName: string, companyPhoneNumber: string, billingAddress: Address | undefined, notes: string, siren?: string, vatId?: string, contactId?: number, establishmentId?: number, paymentMethods?: string, paymentPeriod?: number, discountRate?: number, billingEmail?: string, additionalEmails?: string, seCode?: string, drivingLicenseNumber?: string, drivingLicenseObtainedAt?: Date, drivingLicensePlace?: string, contacts?: Contact[], deliveryNotePriced?: boolean);
|
|
48
58
|
}
|
|
@@ -18,10 +18,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.Contact = void 0;
|
|
21
22
|
var User_1 = __importDefault(require("./User"));
|
|
23
|
+
var Contact = /** @class */ (function () {
|
|
24
|
+
function Contact(id, name, phoneNumber, email, emailVerification) {
|
|
25
|
+
this.id = id;
|
|
26
|
+
this.name = name;
|
|
27
|
+
this.phoneNumber = phoneNumber;
|
|
28
|
+
this.email = email;
|
|
29
|
+
this.emailVerification = emailVerification;
|
|
30
|
+
}
|
|
31
|
+
return Contact;
|
|
32
|
+
}());
|
|
33
|
+
exports.Contact = Contact;
|
|
22
34
|
var Customer = /** @class */ (function (_super) {
|
|
23
35
|
__extends(Customer, _super);
|
|
24
|
-
function Customer(id, roles, firstname, lastname, avatar, addresses, vehicles, email, turnover, type, companyName, companyPhoneNumber, billingAddress, notes, siren, vatId, contactId, establishmentId, paymentMethods, paymentPeriod, discountRate, billingEmail, additionalEmails, seCode, drivingLicenseNumber, drivingLicenseObtainedAt, drivingLicensePlace) {
|
|
36
|
+
function Customer(id, roles, firstname, lastname, avatar, addresses, vehicles, email, turnover, type, companyName, companyPhoneNumber, billingAddress, notes, siren, vatId, contactId, establishmentId, paymentMethods, paymentPeriod, discountRate, billingEmail, additionalEmails, seCode, drivingLicenseNumber, drivingLicenseObtainedAt, drivingLicensePlace, contacts, deliveryNotePriced) {
|
|
25
37
|
if (roles === void 0) { roles = []; }
|
|
26
38
|
if (firstname === void 0) { firstname = ""; }
|
|
27
39
|
if (lastname === void 0) { lastname = ""; }
|
|
@@ -52,6 +64,8 @@ var Customer = /** @class */ (function (_super) {
|
|
|
52
64
|
_this.drivingLicenseNumber = drivingLicenseNumber;
|
|
53
65
|
_this.drivingLicenseObtainedAt = drivingLicenseObtainedAt;
|
|
54
66
|
_this.drivingLicensePlace = drivingLicensePlace;
|
|
67
|
+
_this.contacts = contacts;
|
|
68
|
+
_this.deliveryNotePriced = deliveryNotePriced;
|
|
55
69
|
return _this;
|
|
56
70
|
}
|
|
57
71
|
return Customer;
|
|
@@ -3,7 +3,8 @@ export declare enum SettingsEnumCode {
|
|
|
3
3
|
NO_PHONE_CUSTOMER_CREATION = "NO_PHONE_CUSTOMER_CREATION",
|
|
4
4
|
DOCUMENT_PRODUCT_CREATION = "DOCUMENT_PRODUCT_CREATION",
|
|
5
5
|
DOCUMENT_PRODUCT_UPDATE = "DOCUMENT_PRODUCT_UPDATE",
|
|
6
|
-
DOCUMENT_MILEAGE_OPTIONAL = "DOCUMENT_MILEAGE_OPTIONAL"
|
|
6
|
+
DOCUMENT_MILEAGE_OPTIONAL = "DOCUMENT_MILEAGE_OPTIONAL",
|
|
7
|
+
DEFAULT_QUOTE_EMAIL_COMMENT = "DEFAULT_QUOTE_EMAIL_COMMENT"
|
|
7
8
|
}
|
|
8
9
|
export default class Settings {
|
|
9
10
|
code: SettingsEnumCode;
|
|
@@ -8,6 +8,7 @@ var SettingsEnumCode;
|
|
|
8
8
|
SettingsEnumCode["DOCUMENT_PRODUCT_CREATION"] = "DOCUMENT_PRODUCT_CREATION";
|
|
9
9
|
SettingsEnumCode["DOCUMENT_PRODUCT_UPDATE"] = "DOCUMENT_PRODUCT_UPDATE";
|
|
10
10
|
SettingsEnumCode["DOCUMENT_MILEAGE_OPTIONAL"] = "DOCUMENT_MILEAGE_OPTIONAL";
|
|
11
|
+
SettingsEnumCode["DEFAULT_QUOTE_EMAIL_COMMENT"] = "DEFAULT_QUOTE_EMAIL_COMMENT";
|
|
11
12
|
})(SettingsEnumCode || (exports.SettingsEnumCode = SettingsEnumCode = {}));
|
|
12
13
|
var Settings = /** @class */ (function () {
|
|
13
14
|
function Settings(code, valueBoolean, valueText, valueNumber) {
|
|
@@ -34,6 +34,7 @@ export default class Vehicle {
|
|
|
34
34
|
gearboxCode: string;
|
|
35
35
|
gearboxType: string;
|
|
36
36
|
energy: string;
|
|
37
|
+
notes?: string;
|
|
37
38
|
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, secondaryTireDiameter: string, secondaryTireHeight: string, secondaryTireSpeedIndex: string, secondaryTireWidth: string, secondaryTireSize: VehicleTire, engineCode: string, gearboxCode: string, gearboxType: string, energy: string, tireBrand?: string, tireProfile?: string);
|
|
38
39
|
getVehicleLabel(): string;
|
|
39
40
|
}
|
|
@@ -28,7 +28,7 @@ export default class GarageService {
|
|
|
28
28
|
}): Promise<APIResponse<Garage>>;
|
|
29
29
|
static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>>;
|
|
30
30
|
static sendInterventionEnd(garageId: string, eventId: string): Promise<APIResponse<string>>;
|
|
31
|
-
static sendAppointmentVehicleAvailable(garageId: string, eventId: string): Promise<APIResponse<string>>;
|
|
31
|
+
static sendAppointmentVehicleAvailable(garageId: string, eventId: string, contactId?: number): Promise<APIResponse<string>>;
|
|
32
32
|
static enableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
|
|
33
33
|
static disableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
|
|
34
34
|
static getEmployeeDetails(garageId: string, employeeId: string): Promise<APIResponse<Employee>>;
|
|
@@ -174,9 +174,15 @@ var GarageService = /** @class */ (function () {
|
|
|
174
174
|
appType: Enums_1.MovaAppType.GARAGE,
|
|
175
175
|
});
|
|
176
176
|
};
|
|
177
|
-
GarageService.sendAppointmentVehicleAvailable = function (garageId, eventId) {
|
|
177
|
+
GarageService.sendAppointmentVehicleAvailable = function (garageId, eventId, contactId) {
|
|
178
|
+
var body;
|
|
179
|
+
if (contactId !== undefined) {
|
|
180
|
+
body = new FormData();
|
|
181
|
+
body.append('contactId', contactId.toString());
|
|
182
|
+
}
|
|
178
183
|
return (0, ApiHelper_1.request)({
|
|
179
184
|
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/vehicle-available"),
|
|
185
|
+
body: body,
|
|
180
186
|
method: Enums_1.APIMethod.POST,
|
|
181
187
|
appType: Enums_1.MovaAppType.GARAGE,
|
|
182
188
|
});
|
package/dist/src/style/styled.js
CHANGED
package/dist/src/style/styled.ts
CHANGED
|
@@ -75,4 +75,4 @@ export const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) =>
|
|
|
75
75
|
backgroundColor: theme.palette.primary.light, // Modifier la couleur de fond au survol
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
-
}))as React.ComponentType<ToggleButtonGroupProps
|
|
78
|
+
}))as React.ComponentType<ToggleButtonGroupProps>;
|
package/index.ts
CHANGED
|
@@ -46,7 +46,7 @@ export { default as Logger } from "./src/helpers/Logger";
|
|
|
46
46
|
export { default as Absence } from "./src/models/Absence";
|
|
47
47
|
export { default as Address } from "./src/models/Address";
|
|
48
48
|
export { default as CategoryPrestation } from "./src/models/CategoryPrestation";
|
|
49
|
-
export { default as Customer } from "./src/models/Customer";
|
|
49
|
+
export { default as Customer, Contact } from "./src/models/Customer";
|
|
50
50
|
export type { EmailVerification } from "./src/models/EmailVerification";
|
|
51
51
|
export { default as Document } from "./src/models/Document";
|
|
52
52
|
export { default as Employee } from "./src/models/Employee";
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
default as CloseIcon,
|
|
5
5
|
} from "@mui/icons-material/CloseRounded";
|
|
6
6
|
import EditIcon from "@mui/icons-material/EditRounded";
|
|
7
|
+
import NoteAltIcon from "@mui/icons-material/NoteAlt";
|
|
7
8
|
import {
|
|
8
9
|
Alert,
|
|
9
10
|
Box,
|
|
@@ -19,12 +20,14 @@ import {
|
|
|
19
20
|
InputLabel,
|
|
20
21
|
Link,
|
|
21
22
|
MenuItem,
|
|
23
|
+
Popover,
|
|
22
24
|
Select,
|
|
23
25
|
SelectChangeEvent,
|
|
24
26
|
TextField,
|
|
25
27
|
Tooltip,
|
|
26
28
|
Typography,
|
|
27
29
|
darken,
|
|
30
|
+
useMediaQuery,
|
|
28
31
|
useTheme,
|
|
29
32
|
} from "@mui/material";
|
|
30
33
|
import { DatePicker } from "@mui/x-date-pickers";
|
|
@@ -109,6 +112,8 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
109
112
|
currentUser,
|
|
110
113
|
}) => {
|
|
111
114
|
const theme = useTheme();
|
|
115
|
+
const isDesktop = useMediaQuery(theme.breakpoints.up('md'));
|
|
116
|
+
const [notesAnchorEl, setNotesAnchorEl] = useState<HTMLElement | null>(null);
|
|
112
117
|
const sectionTitleSx = {
|
|
113
118
|
fontWeight: "bold",
|
|
114
119
|
textTransform: "uppercase" as const,
|
|
@@ -399,6 +404,31 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
399
404
|
{/* Bouton modifier / supprimer */}
|
|
400
405
|
<Box sx={{ display: "flex", flexDirection: "row", alignItems: "flex-end", gap: 1 }}>
|
|
401
406
|
|
|
407
|
+
{vehicle.notes && appType !== MovaAppType.INDIVIDUAL && (
|
|
408
|
+
isDesktop ? (
|
|
409
|
+
<Tooltip title={vehicle.notes.length > 500 ? vehicle.notes.slice(0, 500) + '…' : vehicle.notes}>
|
|
410
|
+
<NoteAltIcon sx={{ color: '#F59E0B', fontSize: 22, cursor: 'default', alignSelf: 'center' }} />
|
|
411
|
+
</Tooltip>
|
|
412
|
+
) : (
|
|
413
|
+
<>
|
|
414
|
+
<IconButton size="small" onClick={(e) => setNotesAnchorEl(e.currentTarget)} sx={{ p: 0.5, alignSelf: 'center' }}>
|
|
415
|
+
<NoteAltIcon sx={{ color: '#F59E0B', fontSize: 22 }} />
|
|
416
|
+
</IconButton>
|
|
417
|
+
<Popover
|
|
418
|
+
open={Boolean(notesAnchorEl)}
|
|
419
|
+
anchorEl={notesAnchorEl}
|
|
420
|
+
onClose={() => setNotesAnchorEl(null)}
|
|
421
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
|
|
422
|
+
transformOrigin={{ vertical: 'top', horizontal: 'right' }}
|
|
423
|
+
>
|
|
424
|
+
<Typography sx={{ p: 2, maxWidth: 280, fontSize: 13 }}>
|
|
425
|
+
{vehicle.notes.length > 500 ? vehicle.notes.slice(0, 500) + '…' : vehicle.notes}
|
|
426
|
+
</Typography>
|
|
427
|
+
</Popover>
|
|
428
|
+
</>
|
|
429
|
+
)
|
|
430
|
+
)}
|
|
431
|
+
|
|
402
432
|
{onDelete && (
|
|
403
433
|
<Button
|
|
404
434
|
variant="outlined"
|
package/src/helpers/Enums.ts
CHANGED
|
@@ -151,6 +151,15 @@ export enum PartsApplicationType {
|
|
|
151
151
|
FRONT_RIGHT = "FTRT",
|
|
152
152
|
REAR_LEFT = "RRLT",
|
|
153
153
|
REAR_RIGHT = "RRRT",
|
|
154
|
+
ENG = "ENG",
|
|
155
|
+
TRA = "TRA",
|
|
156
|
+
OIL = "OIL",
|
|
157
|
+
BRK = "BRK",
|
|
158
|
+
COOL= "COOL",
|
|
159
|
+
PS = "PS",
|
|
160
|
+
FUEL = "FUEL",
|
|
161
|
+
TRAOIL = "TRAOIL",
|
|
162
|
+
AC = "AC"
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
export enum APIMethod {
|
package/src/helpers/Tools.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import parsePhoneNumberFromString from "libphonenumber-js/max";
|
|
2
|
-
import {
|
|
2
|
+
import {CSSProperties} from "react";
|
|
3
3
|
import Operation from "../models/Operation";
|
|
4
4
|
import Schedule from "../models/Schedule";
|
|
5
5
|
import VehicleTire from "../models/VehicleTire";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
PartsApplicationType,
|
|
9
|
-
SecondaryPartsApplicationType,
|
|
10
|
-
VehiclePlateFormat,
|
|
11
|
-
} from "./Enums";
|
|
12
|
-
import { MovaFormField, MovaInterval } from "./Types";
|
|
6
|
+
import {DayOfWeek, PartsApplicationType, SecondaryPartsApplicationType, VehiclePlateFormat,} from "./Enums";
|
|
7
|
+
import {MovaFormField, MovaInterval} from "./Types";
|
|
13
8
|
|
|
14
9
|
export const getApplicationsShortLabels = (
|
|
15
10
|
applications: PartsApplicationType[] | undefined
|
|
@@ -279,6 +274,24 @@ export const getApplicationShortLabel = (
|
|
|
279
274
|
return "ARG";
|
|
280
275
|
case PartsApplicationType.REAR_RIGHT:
|
|
281
276
|
return "ARD";
|
|
277
|
+
case PartsApplicationType.BRK:
|
|
278
|
+
return "Liq. frein";
|
|
279
|
+
case PartsApplicationType.ENG:
|
|
280
|
+
return "Moteur" ;
|
|
281
|
+
case PartsApplicationType.TRA:
|
|
282
|
+
return "Transm.";
|
|
283
|
+
case PartsApplicationType.OIL:
|
|
284
|
+
return "HUILE";
|
|
285
|
+
case PartsApplicationType.COOL:
|
|
286
|
+
return "Liq. refroid.";
|
|
287
|
+
case PartsApplicationType.PS:
|
|
288
|
+
return "Direct. assistée";
|
|
289
|
+
case PartsApplicationType.FUEL:
|
|
290
|
+
return "Carburant";
|
|
291
|
+
case PartsApplicationType.TRAOIL:
|
|
292
|
+
return "Huile boîte";
|
|
293
|
+
case PartsApplicationType.AC:
|
|
294
|
+
return "Clim.";
|
|
282
295
|
}
|
|
283
296
|
}
|
|
284
297
|
return "";
|
package/src/models/Customer.ts
CHANGED
|
@@ -5,6 +5,21 @@ import Role from "./Role";
|
|
|
5
5
|
import User from "./User";
|
|
6
6
|
import Vehicle from "./Vehicle";
|
|
7
7
|
|
|
8
|
+
export class Contact {
|
|
9
|
+
id: number;
|
|
10
|
+
name?: string;
|
|
11
|
+
phoneNumber?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
emailVerification?: EmailVerification;
|
|
14
|
+
constructor(id:number, name?:string, phoneNumber?:string, email?: string, emailVerification?: EmailVerification) {
|
|
15
|
+
this.id = id;
|
|
16
|
+
this.name = name;
|
|
17
|
+
this.phoneNumber = phoneNumber;
|
|
18
|
+
this.email = email;
|
|
19
|
+
this.emailVerification = emailVerification;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
8
23
|
export default class Customer extends User {
|
|
9
24
|
// Properties
|
|
10
25
|
vehicles: Vehicle[];
|
|
@@ -43,6 +58,8 @@ export default class Customer extends User {
|
|
|
43
58
|
drivingLicenseNumber?: string;
|
|
44
59
|
drivingLicenseObtainedAt?: Date;
|
|
45
60
|
drivingLicensePlace?: string;
|
|
61
|
+
contacts?: Contact[];
|
|
62
|
+
deliveryNotePriced?:boolean;
|
|
46
63
|
constructor(
|
|
47
64
|
id: string,
|
|
48
65
|
roles: Role[] = [],
|
|
@@ -70,7 +87,9 @@ export default class Customer extends User {
|
|
|
70
87
|
seCode?:string,
|
|
71
88
|
drivingLicenseNumber?:string,
|
|
72
89
|
drivingLicenseObtainedAt?:Date,
|
|
73
|
-
drivingLicensePlace?:string
|
|
90
|
+
drivingLicensePlace?:string,
|
|
91
|
+
contacts?:Contact[],
|
|
92
|
+
deliveryNotePriced?:boolean
|
|
74
93
|
) {
|
|
75
94
|
super(id, roles, firstname, lastname, avatar, email);
|
|
76
95
|
|
|
@@ -94,5 +113,7 @@ export default class Customer extends User {
|
|
|
94
113
|
this.drivingLicenseNumber = drivingLicenseNumber;
|
|
95
114
|
this.drivingLicenseObtainedAt = drivingLicenseObtainedAt;
|
|
96
115
|
this.drivingLicensePlace = drivingLicensePlace;
|
|
116
|
+
this.contacts =contacts;
|
|
117
|
+
this.deliveryNotePriced = deliveryNotePriced;
|
|
97
118
|
}
|
|
98
119
|
}
|
package/src/models/Settings.ts
CHANGED
|
@@ -4,6 +4,8 @@ export enum SettingsEnumCode {
|
|
|
4
4
|
DOCUMENT_PRODUCT_CREATION = "DOCUMENT_PRODUCT_CREATION",
|
|
5
5
|
DOCUMENT_PRODUCT_UPDATE ="DOCUMENT_PRODUCT_UPDATE",
|
|
6
6
|
DOCUMENT_MILEAGE_OPTIONAL="DOCUMENT_MILEAGE_OPTIONAL",
|
|
7
|
+
DEFAULT_QUOTE_EMAIL_COMMENT="DEFAULT_QUOTE_EMAIL_COMMENT"
|
|
8
|
+
|
|
7
9
|
}
|
|
8
10
|
export default class Settings {
|
|
9
11
|
|
package/src/models/Vehicle.ts
CHANGED
|
@@ -250,15 +250,21 @@ export default class GarageService {
|
|
|
250
250
|
|
|
251
251
|
static sendAppointmentVehicleAvailable(
|
|
252
252
|
garageId: string,
|
|
253
|
-
eventId: string
|
|
253
|
+
eventId: string,
|
|
254
|
+
contactId?: number
|
|
254
255
|
): Promise<APIResponse<string>> {
|
|
256
|
+
let body: FormData | undefined;
|
|
257
|
+
if (contactId !== undefined) {
|
|
258
|
+
body = new FormData();
|
|
259
|
+
body.append('contactId', contactId.toString());
|
|
260
|
+
}
|
|
255
261
|
return request({
|
|
256
262
|
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/vehicle-available`,
|
|
263
|
+
body,
|
|
257
264
|
method: APIMethod.POST,
|
|
258
265
|
appType: MovaAppType.GARAGE,
|
|
259
266
|
});
|
|
260
267
|
}
|
|
261
|
-
|
|
262
268
|
static enableGaragePrestation(
|
|
263
269
|
garageId: string,
|
|
264
270
|
prestationId: string
|
package/src/style/styled.ts
CHANGED
|
@@ -75,4 +75,4 @@ export const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) =>
|
|
|
75
75
|
backgroundColor: theme.palette.primary.light, // Modifier la couleur de fond au survol
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
-
}))as React.ComponentType<ToggleButtonGroupProps
|
|
78
|
+
}))as React.ComponentType<ToggleButtonGroupProps>;
|