@movalib/movalib-commons 1.64.4 → 1.64.6
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 +61 -61
- package/dist/index.js +102 -101
- package/dist/src/helpers/Enums.d.ts +10 -0
- package/dist/src/helpers/Enums.js +12 -1
- package/dist/src/helpers/Tools.d.ts +2 -1
- package/dist/src/helpers/Tools.js +22 -1
- package/dist/src/models/Garage.d.ts +1 -2
- package/dist/src/models/Garage.js +1 -2
- package/dist/src/models/Operation.d.ts +3 -2
- package/dist/src/models/Operation.js +2 -1
- package/dist/src/models/Prestation.d.ts +2 -1
- package/dist/src/models/Prestation.js +3 -1
- package/dist/src/models/User.d.ts +3 -3
- package/dist/src/models/User.js +7 -7
- package/dist/src/services/GarageService.d.ts +0 -1
- package/dist/src/services/GarageService.js +0 -7
- package/index.ts +105 -87
- package/package.json +1 -1
- package/src/helpers/Enums.ts +11 -2
- package/src/helpers/Tools.ts +34 -5
- package/src/models/Operation.ts +31 -19
- package/src/models/Prestation.ts +65 -49
|
@@ -1,13 +1,14 @@
|
|
|
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, secondaryApplication) {
|
|
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;
|
|
11
12
|
}
|
|
12
13
|
return Operation;
|
|
13
14
|
}());
|
|
@@ -28,5 +28,6 @@ export default class Prestation {
|
|
|
28
28
|
multipleApplication: boolean;
|
|
29
29
|
operationsVisible: boolean;
|
|
30
30
|
categoryCode: string;
|
|
31
|
-
|
|
31
|
+
secondaryMultipleApplication: boolean;
|
|
32
|
+
constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operationsVisible: boolean, categoryCode: string, availableOnline: boolean, operations?: Operation[], secondaryMultipleApplication?: boolean);
|
|
32
33
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
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) {
|
|
4
|
+
function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operationsVisible, categoryCode, availableOnline, operations, secondaryMultipleApplication) {
|
|
5
|
+
if (secondaryMultipleApplication === void 0) { secondaryMultipleApplication = false; }
|
|
5
6
|
this.id = id;
|
|
6
7
|
this.code = code;
|
|
7
8
|
this.name = name;
|
|
@@ -17,6 +18,7 @@ var Prestation = /** @class */ (function () {
|
|
|
17
18
|
this.state = state;
|
|
18
19
|
this.categoryCode = categoryCode;
|
|
19
20
|
this.availableOnline = availableOnline;
|
|
21
|
+
this.secondaryMultipleApplication = secondaryMultipleApplication;
|
|
20
22
|
}
|
|
21
23
|
return Prestation;
|
|
22
24
|
}());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Gender } from "../helpers/Enums";
|
|
2
|
-
import Address from
|
|
2
|
+
import Address from "./Address";
|
|
3
3
|
import Garage from "./Garage";
|
|
4
4
|
import Role from "./Role";
|
|
5
5
|
import Vehicle from "./Vehicle";
|
|
@@ -11,16 +11,16 @@ export default class User {
|
|
|
11
11
|
avatar: string;
|
|
12
12
|
password: string;
|
|
13
13
|
created: Date;
|
|
14
|
+
billingAddress?: Address;
|
|
14
15
|
email?: string;
|
|
15
16
|
gender?: Gender;
|
|
16
17
|
birthDate?: Date;
|
|
17
|
-
addresses?: Address[];
|
|
18
18
|
phoneNumber?: string;
|
|
19
19
|
vehicles?: Vehicle[];
|
|
20
20
|
isActive?: Boolean;
|
|
21
21
|
hasPassword?: Boolean;
|
|
22
22
|
garages?: Garage[];
|
|
23
|
-
constructor(id: string, roles: Role[], firstname?: string, lastname?: string, avatar?: string, password?: string, created?: Date, email?: string, gender?: Gender, birthDate?: Date,
|
|
23
|
+
constructor(id: string, roles: Role[], firstname?: string, lastname?: string, avatar?: string, password?: string, created?: Date, billingAddress?: Address, email?: string, gender?: Gender, birthDate?: Date, phoneNumber?: string, vehicles?: Vehicle[], isActive?: Boolean, hasPassword?: Boolean, garages?: Garage[]);
|
|
24
24
|
static getFirstLetter: (user: User) => string;
|
|
25
25
|
static isGarageCustomer: (user: User) => boolean;
|
|
26
26
|
static isGarageTechnician: (user: User) => boolean;
|
package/dist/src/models/User.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Enums_1 = require("../helpers/Enums");
|
|
4
4
|
var User = /** @class */ (function () {
|
|
5
|
-
function User(id, roles, firstname, lastname, avatar, password, created, email, gender, birthDate,
|
|
6
|
-
if (firstname === void 0) { firstname =
|
|
7
|
-
if (lastname === void 0) { lastname =
|
|
8
|
-
if (avatar === void 0) { avatar =
|
|
9
|
-
if (password === void 0) { password =
|
|
5
|
+
function User(id, roles, firstname, lastname, avatar, password, created, billingAddress, email, gender, birthDate, phoneNumber, vehicles, isActive, hasPassword, garages) {
|
|
6
|
+
if (firstname === void 0) { firstname = ""; }
|
|
7
|
+
if (lastname === void 0) { lastname = ""; }
|
|
8
|
+
if (avatar === void 0) { avatar = ""; }
|
|
9
|
+
if (password === void 0) { password = ""; }
|
|
10
10
|
if (created === void 0) { created = new Date(); }
|
|
11
11
|
this.id = id;
|
|
12
12
|
this.roles = roles;
|
|
@@ -18,7 +18,7 @@ var User = /** @class */ (function () {
|
|
|
18
18
|
this.created = created;
|
|
19
19
|
this.gender = gender;
|
|
20
20
|
this.birthDate = birthDate;
|
|
21
|
-
this.
|
|
21
|
+
this.billingAddress = billingAddress;
|
|
22
22
|
this.phoneNumber = phoneNumber;
|
|
23
23
|
this.vehicles = vehicles;
|
|
24
24
|
this.isActive = isActive;
|
|
@@ -27,7 +27,7 @@ var User = /** @class */ (function () {
|
|
|
27
27
|
}
|
|
28
28
|
User.getFirstLetter = function (user) {
|
|
29
29
|
var firstLetter = user.lastname[0].toUpperCase();
|
|
30
|
-
return /[0-9]/.test(firstLetter) ?
|
|
30
|
+
return /[0-9]/.test(firstLetter) ? "0-9" : firstLetter;
|
|
31
31
|
};
|
|
32
32
|
User.isGarageCustomer = function (user) {
|
|
33
33
|
if (!user || !user.roles)
|
|
@@ -8,7 +8,6 @@ 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>>;
|
|
12
11
|
static toogleEventVehicleReceived(garageId: string, eventId: string): Promise<APIResponse<string>>;
|
|
13
12
|
static setOrderedEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
|
|
14
13
|
static deleteEventEmployee(garageId: string, eventId: string): Promise<APIResponse<string>>;
|
|
@@ -38,13 +38,6 @@ 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
|
-
};
|
|
48
41
|
GarageService.toogleEventVehicleReceived = function (garageId, eventId) {
|
|
49
42
|
return (0, ApiHelper_1.request)({
|
|
50
43
|
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/events/").concat(eventId, "/vehicle-received"),
|
package/index.ts
CHANGED
|
@@ -2,125 +2,143 @@
|
|
|
2
2
|
|
|
3
3
|
// Export des services
|
|
4
4
|
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
5
|
+
export { default as AuthenticationService } from "./src/services/AuthenticationService";
|
|
6
|
+
export { default as GarageService } from "./src/services/GarageService";
|
|
7
|
+
export { default as UserService } from "./src/services/UserService";
|
|
8
|
+
export { default as VehicleService } from "./src/services/VehicleService";
|
|
9
9
|
// Export des composants
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export {
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
29
|
-
export { default as
|
|
30
|
-
export { default as
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export { default as
|
|
35
|
-
export {default as
|
|
10
|
+
export { default as AccountValidation } from "./src/AccountValidation";
|
|
11
|
+
export { default as AddressFields } from "./src/AddressFields";
|
|
12
|
+
export { LinkedDocumentDialog } from "./src/components/LinkedDocumentDialog";
|
|
13
|
+
export { default as MovaTable } from "./src/components/MovaTable/MovaTable";
|
|
14
|
+
export { default as MovaTableBack } from "./src/components/MovaTableBack/MovaTableBack";
|
|
15
|
+
export {
|
|
16
|
+
PLVComponent,
|
|
17
|
+
PrintSize,
|
|
18
|
+
} from "./src/components/QrCodePLVContainer/PLVComponent";
|
|
19
|
+
export { QrCodePLVContainer } from "./src/components/QrCodePLVContainer/QrCodePLVContainer";
|
|
20
|
+
export { default as ActivateAccount } from "./src/components/singup/ActivateAccount";
|
|
21
|
+
export { default as VehicleFullCard } from "./src/components/vehicle/VehicleFullCard";
|
|
22
|
+
export {
|
|
23
|
+
default as VehiclePlateField,
|
|
24
|
+
oldRegexPlate,
|
|
25
|
+
regexPlate,
|
|
26
|
+
} from "./src/components/vehicle/VehiclePlateField";
|
|
27
|
+
export { default as ConfirmationDialog } from "./src/ConfirmationDialog";
|
|
28
|
+
export { default as DialogForgotPassword } from "./src/DialogForgotPassword";
|
|
29
|
+
export { default as GaragePLV } from "./src/GaragePLV";
|
|
30
|
+
export { default as GenderSelector } from "./src/GenderSelector";
|
|
31
|
+
export { default as IbanInput } from "./src/IbanInput";
|
|
32
|
+
export { default as Loader } from "./src/Loader";
|
|
33
|
+
export { default as MovaCopyright } from "./src/MovaCopyright";
|
|
34
|
+
export { default as MovaDialog } from "./src/MovaDialog";
|
|
35
|
+
export { default as MovaDigitalPassport } from "./src/MovaDigitalPassport";
|
|
36
|
+
export { default as MovaLogin } from "./src/MovaLogin";
|
|
37
|
+
export { default as MovaSignUp } from "./src/MovaSignUp";
|
|
38
|
+
export { default as MovaSnackbar } from "./src/MovaSnackbar";
|
|
39
|
+
export { default as MovaVehicleTireField } from "./src/MovaVehicleTireField";
|
|
40
|
+
export { default as QRCode } from "./src/QRCode";
|
|
41
|
+
export { default as ScheduleFields } from "./src/ScheduleFields";
|
|
42
|
+
export { default as TestButton } from "./src/TestButton";
|
|
36
43
|
|
|
37
44
|
// Export des classes
|
|
38
|
-
export { default as
|
|
39
|
-
export { default as Absence } from
|
|
40
|
-
export { default as
|
|
41
|
-
export { default as
|
|
42
|
-
export { default as
|
|
43
|
-
export { default as
|
|
44
|
-
export { default as
|
|
45
|
-
export { default as
|
|
46
|
-
export { default as
|
|
47
|
-
export { default as
|
|
48
|
-
export { default as
|
|
49
|
-
export { default as
|
|
50
|
-
export { default as
|
|
51
|
-
export { default as
|
|
52
|
-
export { default as
|
|
53
|
-
export { default as
|
|
54
|
-
export { default as
|
|
55
|
-
export { default as
|
|
56
|
-
export { default as
|
|
57
|
-
export {default as
|
|
45
|
+
export { default as Logger } from "./src/helpers/Logger";
|
|
46
|
+
export { default as Absence } from "./src/models/Absence";
|
|
47
|
+
export { default as Address } from "./src/models/Address";
|
|
48
|
+
export { default as CategoryPrestation } from "./src/models/CategoryPrestation";
|
|
49
|
+
export { default as Customer } from "./src/models/Customer";
|
|
50
|
+
export { default as Document } from "./src/models/Document";
|
|
51
|
+
export { default as Employee } from "./src/models/Employee";
|
|
52
|
+
export { default as Event } from "./src/models/Event";
|
|
53
|
+
export { default as Garage } from "./src/models/Garage";
|
|
54
|
+
export { default as Operation } from "./src/models/Operation";
|
|
55
|
+
export { default as Prestation } from "./src/models/Prestation";
|
|
56
|
+
export { default as Product } from "./src/models/Product";
|
|
57
|
+
export { default as Role } from "./src/models/Role";
|
|
58
|
+
export { default as Schedule } from "./src/models/Schedule";
|
|
59
|
+
export { default as Subscription } from "./src/models/Subscription";
|
|
60
|
+
export { default as Supplier } from "./src/models/Supplier";
|
|
61
|
+
export { default as User } from "./src/models/User";
|
|
62
|
+
export { default as Vehicle } from "./src/models/Vehicle";
|
|
63
|
+
export { default as VehicleGarage } from "./src/models/VehicleGarage";
|
|
64
|
+
export { default as VehicleTire } from "./src/models/VehicleTire";
|
|
58
65
|
// Export des types
|
|
59
|
-
export type { APIRequest, APIResponse } from
|
|
60
|
-
export type { DaySchedule, DayInterval } from './src/ScheduleFields';
|
|
66
|
+
export type { APIRequest, APIResponse } from "./src/helpers/ApiHelper";
|
|
61
67
|
export type {
|
|
68
|
+
AddressFieldName,
|
|
62
69
|
MovaFormField,
|
|
70
|
+
MovaInterval,
|
|
63
71
|
MovaLoginForm,
|
|
64
72
|
MovaUserSignUpForm,
|
|
65
|
-
MovaInterval,
|
|
66
73
|
MovaVehicleForm,
|
|
67
|
-
|
|
68
|
-
} from
|
|
74
|
+
} from "./src/helpers/Types";
|
|
75
|
+
export type { DayInterval, DaySchedule } from "./src/ScheduleFields";
|
|
69
76
|
|
|
70
77
|
// Export des méthodes utilitaires
|
|
71
|
-
export {
|
|
78
|
+
export { API_BASE_URL, request } from "./src/helpers/ApiHelper";
|
|
79
|
+
export { deleteCookie, readCookie } from "./src/helpers/CookieUtils";
|
|
80
|
+
export {
|
|
81
|
+
formatDateByTimezone,
|
|
82
|
+
getLongFormattedDateTime,
|
|
83
|
+
} from "./src/helpers/DateUtils";
|
|
72
84
|
export {
|
|
73
|
-
validateField,
|
|
74
|
-
formatVehicleTire,
|
|
75
|
-
formatVehiclePlate,
|
|
76
|
-
isEmpty,
|
|
77
|
-
getApplicationShortLabel,
|
|
78
85
|
capitalizeFirstLetter,
|
|
86
|
+
findScheduleByDayOfWeek,
|
|
79
87
|
flexLeftRow,
|
|
80
88
|
formatPhoneNumber,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
formatVehiclePlate,
|
|
90
|
+
formatVehicleTire,
|
|
91
|
+
getApplicationShortLabel,
|
|
92
|
+
getApplicationsShortLabels,
|
|
84
93
|
getDayOfWeekLabel,
|
|
94
|
+
getFormattedIntervals,
|
|
95
|
+
getFormattedSchedule,
|
|
96
|
+
isEmpty,
|
|
85
97
|
isSafariOniOS,
|
|
86
|
-
|
|
87
|
-
} from
|
|
88
|
-
export {
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
validateField,
|
|
99
|
+
} from "./src/helpers/Tools";
|
|
100
|
+
export {
|
|
101
|
+
validateEmail,
|
|
102
|
+
validatePhoneNumber,
|
|
103
|
+
validateText,
|
|
104
|
+
} from "./src/helpers/Validator";
|
|
91
105
|
|
|
92
106
|
// Export des enums
|
|
93
107
|
export {
|
|
108
|
+
APIMethod,
|
|
109
|
+
CountryCode,
|
|
94
110
|
CustomerType,
|
|
95
|
-
|
|
96
|
-
MovaAppType,
|
|
111
|
+
DateFormatTypes,
|
|
97
112
|
DayOfWeek,
|
|
98
|
-
EventState,
|
|
99
|
-
EventType,
|
|
100
|
-
DocumentType,
|
|
101
113
|
DigitalPassportIndex,
|
|
102
114
|
DocumentState,
|
|
115
|
+
DocumentType,
|
|
116
|
+
EventState,
|
|
117
|
+
EventType,
|
|
103
118
|
Gender,
|
|
104
|
-
|
|
105
|
-
PartsApplicationType,
|
|
106
|
-
ProductType,
|
|
119
|
+
MovaAppType,
|
|
107
120
|
OrderPreference,
|
|
108
121
|
OrderState,
|
|
122
|
+
PartsApplicationType,
|
|
123
|
+
PrestationState,
|
|
124
|
+
PrestationType,
|
|
125
|
+
ProductType,
|
|
126
|
+
RegistrationState,
|
|
127
|
+
RoleType,
|
|
128
|
+
SecondaryPartsApplicationType,
|
|
109
129
|
SlotAlgorithm,
|
|
110
|
-
VehiclePlateFormat as VehiclePlateType,
|
|
111
130
|
SubscriptionPaymentInterval,
|
|
112
|
-
RegistrationState,
|
|
113
|
-
PrestationType,
|
|
114
|
-
PrestationState,
|
|
115
|
-
CountryCode,
|
|
116
131
|
SubscriptionState,
|
|
117
132
|
SubscriptionType,
|
|
118
|
-
|
|
119
|
-
} from
|
|
133
|
+
VehiclePlateFormat as VehiclePlateType,
|
|
134
|
+
} from "./src/helpers/Enums";
|
|
120
135
|
|
|
121
136
|
// Export des utils
|
|
122
|
-
export { openDialogPrint } from
|
|
123
|
-
export { getQrCodeBase64} from
|
|
137
|
+
export { openDialogPrint } from "./src/utils/DialogPrint";
|
|
138
|
+
export { getQrCodeBase64 } from "./src/utils/getQRCodeBase64";
|
|
124
139
|
|
|
125
140
|
// Export des styles
|
|
126
|
-
export {
|
|
141
|
+
export {
|
|
142
|
+
StyledToggleButton,
|
|
143
|
+
StyledToggleButtonGroup,
|
|
144
|
+
} from "./src/style/styled";
|
package/package.json
CHANGED
package/src/helpers/Enums.ts
CHANGED
|
@@ -14,7 +14,16 @@ export enum SubscriptionState {
|
|
|
14
14
|
PAUSED = "PAUSED",
|
|
15
15
|
CANCELED = "CANCELED",
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
export enum SecondaryPartsApplicationType {
|
|
18
|
+
HOOD = "HOOD",
|
|
19
|
+
ROOF = "ROOF",
|
|
20
|
+
DOOR = "DOOR",
|
|
21
|
+
FENDER = "FENDER",
|
|
22
|
+
JAMB = "JAMB",
|
|
23
|
+
UNDERBODY = "UNDERBODY",
|
|
24
|
+
BUMPER = "BUMPER",
|
|
25
|
+
TRUNK = "TRUNK",
|
|
26
|
+
}
|
|
18
27
|
export enum CountryCode {
|
|
19
28
|
FR = "FR",
|
|
20
29
|
}
|
|
@@ -239,7 +248,7 @@ export enum QuoteState {
|
|
|
239
248
|
QUOTE_SENT = "QUOTE_SENT",
|
|
240
249
|
QUOTE_ACCEPTED = "QUOTE_ACCEPTED",
|
|
241
250
|
QUOTE_REJECTED = "QUOTE_REJECTED",
|
|
242
|
-
QUOTE_CANCELLED = "CANCELLED"
|
|
251
|
+
QUOTE_CANCELLED = "CANCELLED",
|
|
243
252
|
}
|
|
244
253
|
|
|
245
254
|
export enum DocumentType {
|
package/src/helpers/Tools.ts
CHANGED
|
@@ -2,7 +2,12 @@ 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 {
|
|
5
|
+
import {
|
|
6
|
+
DayOfWeek,
|
|
7
|
+
PartsApplicationType,
|
|
8
|
+
SecondaryPartsApplicationType,
|
|
9
|
+
VehiclePlateFormat,
|
|
10
|
+
} from "./Enums";
|
|
6
11
|
import { MovaFormField, MovaInterval } from "./Types";
|
|
7
12
|
|
|
8
13
|
export const getApplicationsShortLabels = (
|
|
@@ -278,6 +283,29 @@ export const getApplicationShortLabel = (
|
|
|
278
283
|
return "";
|
|
279
284
|
};
|
|
280
285
|
|
|
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
|
+
|
|
281
309
|
export const flexEnd: CSSProperties = {
|
|
282
310
|
display: "flex",
|
|
283
311
|
justifyContent: "end",
|
|
@@ -294,12 +322,14 @@ export const isEmpty = (data: Object): boolean => {
|
|
|
294
322
|
return Object.keys(data).length === 0;
|
|
295
323
|
};
|
|
296
324
|
|
|
297
|
-
export const formatVehiclePlate = (
|
|
325
|
+
export const formatVehiclePlate = (
|
|
326
|
+
input: string | undefined,
|
|
327
|
+
isForeignPlate: boolean
|
|
328
|
+
): string => {
|
|
298
329
|
if (input) {
|
|
299
|
-
|
|
300
330
|
let plateFormat: VehiclePlateFormat | null = null;
|
|
301
331
|
|
|
302
|
-
if(isForeignPlate) {
|
|
332
|
+
if (isForeignPlate) {
|
|
303
333
|
// Plaque étrangère
|
|
304
334
|
plateFormat = VehiclePlateFormat.FOREIGN;
|
|
305
335
|
} else if (/^[A-Za-z]/.test(input)) {
|
|
@@ -338,7 +368,6 @@ export const formatVehiclePlate = (input: string | undefined, isForeignPlate: bo
|
|
|
338
368
|
|
|
339
369
|
case VehiclePlateFormat.FOREIGN: {
|
|
340
370
|
// On retourne la plaque telle qu'enregistrée par l'utilisateur, ras
|
|
341
|
-
|
|
342
371
|
}
|
|
343
372
|
}
|
|
344
373
|
return cleanedInput;
|
package/src/models/Operation.ts
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
PartsApplicationType,
|
|
3
|
+
SecondaryPartsApplicationType,
|
|
4
|
+
} from "../helpers/Enums";
|
|
2
5
|
import Product from "./Product";
|
|
3
6
|
|
|
4
7
|
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;
|
|
5
17
|
|
|
6
|
-
|
|
7
|
-
id: number
|
|
8
|
-
code: string
|
|
9
|
-
name: string
|
|
10
|
-
description: string
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
18
|
+
constructor(
|
|
19
|
+
id: number,
|
|
20
|
+
code: string,
|
|
21
|
+
name: string,
|
|
22
|
+
description: string,
|
|
23
|
+
application: PartsApplicationType,
|
|
24
|
+
products: Product[],
|
|
25
|
+
secondaryApplication?: SecondaryPartsApplicationType
|
|
26
|
+
) {
|
|
27
|
+
this.id = id;
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.name = name;
|
|
30
|
+
this.description = description;
|
|
31
|
+
this.application = application;
|
|
32
|
+
this.products = products;
|
|
33
|
+
this.secondaryApplication = secondaryApplication;
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/models/Prestation.ts
CHANGED
|
@@ -2,57 +2,73 @@ 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;
|
|
5
28
|
|
|
6
|
-
|
|
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;
|
|
29
|
+
active: boolean;
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
state: PrestationState;
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
multipleApplication: boolean;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
operationsVisible: boolean;
|
|
36
|
+
categoryCode: string;
|
|
37
|
+
secondaryMultipleApplication: boolean;
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
constructor(
|
|
40
|
+
id: number,
|
|
41
|
+
code: string,
|
|
42
|
+
name: string,
|
|
43
|
+
description: string,
|
|
44
|
+
category: string,
|
|
45
|
+
downtime: number,
|
|
46
|
+
appointmentDelay: number,
|
|
47
|
+
position: number,
|
|
48
|
+
active: boolean,
|
|
49
|
+
state: PrestationState,
|
|
50
|
+
multipleApplication: boolean,
|
|
51
|
+
operationsVisible: boolean,
|
|
52
|
+
categoryCode: string,
|
|
53
|
+
availableOnline: boolean,
|
|
54
|
+
operations?: Operation[],
|
|
55
|
+
secondaryMultipleApplication: boolean = false
|
|
56
|
+
) {
|
|
57
|
+
this.id = id;
|
|
58
|
+
this.code = code;
|
|
59
|
+
this.name = name;
|
|
60
|
+
this.description = description;
|
|
61
|
+
this.category = category;
|
|
62
|
+
this.downtime = downtime;
|
|
63
|
+
this.appointmentDelay = appointmentDelay;
|
|
64
|
+
this.position = position;
|
|
65
|
+
this.active = active;
|
|
66
|
+
this.multipleApplication = multipleApplication;
|
|
67
|
+
this.operationsVisible = operationsVisible;
|
|
68
|
+
this.operations = operations;
|
|
69
|
+
this.state = state;
|
|
70
|
+
this.categoryCode = categoryCode;
|
|
71
|
+
this.availableOnline = availableOnline;
|
|
72
|
+
this.secondaryMultipleApplication = secondaryMultipleApplication;
|
|
73
|
+
}
|
|
74
|
+
}
|