@movalib/movalib-commons 1.64.6 → 1.64.7
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 +2 -1
- package/dist/index.js +4 -3
- package/dist/src/helpers/Enums.d.ts +0 -10
- package/dist/src/helpers/Enums.js +1 -12
- package/dist/src/helpers/Tools.d.ts +1 -2
- package/dist/src/helpers/Tools.js +1 -22
- package/dist/src/models/Event.d.ts +3 -3
- package/dist/src/models/Event.js +2 -5
- package/dist/src/models/Garage.d.ts +2 -1
- package/dist/src/models/Garage.js +2 -1
- package/dist/src/models/LoanVehicle.d.ts +8 -0
- package/dist/src/models/LoanVehicle.js +13 -0
- package/dist/src/models/Operation.d.ts +2 -3
- package/dist/src/models/Operation.js +1 -2
- package/dist/src/models/Prestation.d.ts +1 -2
- package/dist/src/models/Prestation.js +1 -3
- package/dist/src/services/GarageService.d.ts +1 -0
- package/dist/src/services/GarageService.js +7 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/helpers/Enums.ts +2 -11
- package/src/helpers/Tools.ts +5 -34
- package/src/models/Event.ts +10 -10
- package/src/models/Garage.ts +4 -1
- package/src/models/LoanVehicle.ts +22 -0
- package/src/models/Operation.ts +19 -31
- package/src/models/Prestation.ts +49 -65
- package/src/services/GarageService.ts +14 -2
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,
|
|
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.
|
|
8
|
-
exports.SubscriptionState = exports.SubscriptionPaymentInterval = exports.SlotAlgorithm = exports.
|
|
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; } });
|
|
@@ -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.
|
|
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
|
|
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.
|
|
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
|
-
|
|
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[],
|
|
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
|
}
|
package/dist/src/models/Event.js
CHANGED
|
@@ -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,
|
|
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,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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
package/src/helpers/Enums.ts
CHANGED
|
@@ -14,16 +14,7 @@ export enum SubscriptionState {
|
|
|
14
14
|
PAUSED = "PAUSED",
|
|
15
15
|
CANCELED = "CANCELED",
|
|
16
16
|
}
|
|
17
|
-
|
|
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 {
|
package/src/helpers/Tools.ts
CHANGED
|
@@ -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
|
|
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;
|
package/src/models/Event.ts
CHANGED
|
@@ -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
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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[] {
|
package/src/models/Garage.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/models/Operation.ts
CHANGED
|
@@ -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
|
-
|
|
19
|
-
id: number
|
|
20
|
-
code: string
|
|
21
|
-
name: string
|
|
22
|
-
description: string
|
|
23
|
-
application
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
+
}
|
package/src/models/Prestation.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
30
|
+
active:boolean;
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
state: PrestationState;
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
categoryCode: string;
|
|
37
|
-
secondaryMultipleApplication: boolean;
|
|
34
|
+
multipleApplication: boolean;
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
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
|