@movalib/movalib-commons 1.57.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -42,6 +42,7 @@ export { default as Garage } from './src/models/Garage';
42
42
  export { default as Schedule } from './src/models/Schedule';
43
43
  export { default as Event } from './src/models/Event';
44
44
  export { default as VehicleTire } from './src/models/VehicleTire';
45
+ export { default as CategoryPrestation } from './src/models/CategoryPrestation';
45
46
  export type { APIRequest, APIResponse } from './src/helpers/ApiHelper';
46
47
  export type { DaySchedule, DayInterval } from './src/ScheduleFields';
47
48
  export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval, MovaVehicleForm, AddressFieldName, } from './src/helpers/Types';
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.formatFrenchVehiclePlate = exports.formatVehicleTire = exports.validateField = exports.deleteCookie = exports.readCookie = exports.VehicleTire = exports.Event = exports.Schedule = exports.Garage = exports.Document = exports.Vehicle = exports.Address = exports.Role = exports.User = exports.Customer = exports.Logger = exports.Operation = exports.Prestation = exports.Product = exports.Supplier = exports.Employee = exports.Absence = exports.Subscription = exports.PrintSize = exports.PLVComponent = exports.QrCodePLVContainer = exports.GenderSelector = exports.ConfirmationDialog = exports.MovaVehicleTireField = exports.MovaCopyright = exports.MovaSignUp = exports.MovaLogin = exports.MovaSnackbar = exports.TestButton = exports.VehiclePlateField = exports.QRCode = exports.MovaDialog = exports.Loader = exports.MovaDigitalPassport = exports.VehicleFullCard = exports.ScheduleFields = exports.AddressFields = exports.AccountValidation = exports.GaragePLV = exports.IbanInput = exports.DialogForgotPassword = exports.UserService = exports.GarageService = exports.AuthenticationService = exports.VehicleService = void 0;
8
- exports.openDialogPrint = exports.APIMethod = exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.API_BASE_URL = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.getApplicationsShortLabels = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = exports.capitalizeFirstLetter = exports.getApplicationShortLabel = exports.isEmpty = void 0;
7
+ exports.formatVehicleTire = exports.validateField = exports.deleteCookie = exports.readCookie = exports.CategoryPrestation = exports.VehicleTire = exports.Event = exports.Schedule = exports.Garage = exports.Document = exports.Vehicle = exports.Address = exports.Role = exports.User = exports.Customer = exports.Logger = exports.Operation = exports.Prestation = exports.Product = exports.Supplier = exports.Employee = exports.Absence = exports.Subscription = exports.PrintSize = exports.PLVComponent = exports.QrCodePLVContainer = exports.GenderSelector = exports.ConfirmationDialog = exports.MovaVehicleTireField = exports.MovaCopyright = exports.MovaSignUp = exports.MovaLogin = exports.MovaSnackbar = exports.TestButton = exports.VehiclePlateField = exports.QRCode = exports.MovaDialog = exports.Loader = exports.MovaDigitalPassport = exports.VehicleFullCard = exports.ScheduleFields = exports.AddressFields = exports.AccountValidation = exports.GaragePLV = exports.IbanInput = exports.DialogForgotPassword = exports.UserService = exports.GarageService = exports.AuthenticationService = exports.VehicleService = void 0;
8
+ exports.openDialogPrint = exports.APIMethod = exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.API_BASE_URL = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.getApplicationsShortLabels = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = exports.capitalizeFirstLetter = exports.getApplicationShortLabel = exports.isEmpty = exports.formatFrenchVehiclePlate = void 0;
9
9
  // Export des services
10
10
  var VehicleService_1 = require("./src/services/VehicleService");
11
11
  Object.defineProperty(exports, "VehicleService", { enumerable: true, get: function () { return __importDefault(VehicleService_1).default; } });
@@ -98,6 +98,8 @@ var Event_1 = require("./src/models/Event");
98
98
  Object.defineProperty(exports, "Event", { enumerable: true, get: function () { return __importDefault(Event_1).default; } });
99
99
  var VehicleTire_1 = require("./src/models/VehicleTire");
100
100
  Object.defineProperty(exports, "VehicleTire", { enumerable: true, get: function () { return __importDefault(VehicleTire_1).default; } });
101
+ var CategoryPrestation_1 = require("./src/models/CategoryPrestation");
102
+ Object.defineProperty(exports, "CategoryPrestation", { enumerable: true, get: function () { return __importDefault(CategoryPrestation_1).default; } });
101
103
  // Export des méthodes utilitaires
102
104
  var CookieUtils_1 = require("./src/helpers/CookieUtils");
103
105
  Object.defineProperty(exports, "readCookie", { enumerable: true, get: function () { return CookieUtils_1.readCookie; } });
@@ -0,0 +1,11 @@
1
+ export default class CategoryPrestation {
2
+ color: string;
3
+ code: string;
4
+ name: string;
5
+ description: string;
6
+ position: number;
7
+ /**
8
+ *
9
+ */
10
+ constructor(color: string, code: string, name: string, description: string, position: number);
11
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var CategoryPrestation = /** @class */ (function () {
4
+ /**
5
+ *
6
+ */
7
+ function CategoryPrestation(color, code, name, description, position) {
8
+ this.color = color;
9
+ this.code = code;
10
+ this.name = name;
11
+ this.description = description;
12
+ this.position = position;
13
+ }
14
+ return CategoryPrestation;
15
+ }());
16
+ exports.default = CategoryPrestation;
@@ -49,6 +49,7 @@ export default class Event {
49
49
  editable?: boolean;
50
50
  vehicleDepositDate?: Date;
51
51
  vehicleDepositDateRequest?: Date;
52
+ color?: string;
52
53
  /** Propriété calculée pas toujours présent, pour savoir si les produits de cet event on été commandé au grossistes */
53
54
  hasProductOrdered?: boolean;
54
55
  /** Eventuels opérateurs associés à l'event */
@@ -58,6 +59,6 @@ export default class Event {
58
59
  otherReason?: string;
59
60
  repairOrderNumber?: number;
60
61
  orderComment?: string;
61
- constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, 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);
62
+ 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);
62
63
  static getPrestationsList(event: Event): string[];
63
64
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Event = /** @class */ (function () {
4
- function Event(id, ownerId, type, title, garageName, garageId, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId) {
4
+ function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId) {
5
5
  this.id = id;
6
6
  this.notes = notes;
7
7
  this.ownerId = ownerId;
@@ -22,6 +22,7 @@ var Event = /** @class */ (function () {
22
22
  this.vehicleAvailableNotified = vehicleAvailableNotified;
23
23
  this.editable = editable;
24
24
  this.resourceId = resourceId;
25
+ this.color = color;
25
26
  }
26
27
  Event.getPrestationsList = function (event) {
27
28
  if (event && event.prestations) {
@@ -7,6 +7,7 @@ import { OrderPreference, RegistrationState, SlotAlgorithm, SubscriptionPaymentI
7
7
  import User from "./User";
8
8
  import Subscription from "./Subscription";
9
9
  import Employee from "./Employee";
10
+ import CategoryPrestation from "./CategoryPrestation";
10
11
  export default class Garage {
11
12
  id: string;
12
13
  adminId: string;
@@ -14,6 +15,7 @@ export default class Garage {
14
15
  address: Address;
15
16
  workforce: number;
16
17
  contactPhone: string;
18
+ prestationCategories: CategoryPrestation[];
17
19
  prestations: Prestation[];
18
20
  schedules: Schedule[];
19
21
  countryCode?: string;
@@ -41,5 +43,5 @@ export default class Garage {
41
43
  operatorsActive?: boolean;
42
44
  employees?: Employee[];
43
45
  defaultView?: string;
44
- constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[]);
46
+ constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[]);
45
47
  }
@@ -1,12 +1,13 @@
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, contactEmail, logo, suppliers, documents, subscriptions) {
4
+ function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, contactEmail, logo, suppliers, documents, subscriptions) {
5
5
  this.id = id;
6
6
  this.adminId = adminId;
7
7
  this.name = name;
8
8
  this.address = address;
9
9
  this.workforce = workforce;
10
+ this.prestationCategories = prestationCategories;
10
11
  this.prestations = prestations;
11
12
  this.schedules = schedules;
12
13
  this.contactPhone = contactPhone;
@@ -26,5 +26,6 @@ export default class Prestation {
26
26
  state: PrestationState;
27
27
  multipleApplication: boolean;
28
28
  operationsVisible: boolean;
29
- 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, operations?: Operation[]);
29
+ categoryCode: string;
30
+ 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, operations?: Operation[]);
30
31
  }
@@ -1,7 +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, operations) {
4
+ function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operationsVisible, categoryCode, operations) {
5
5
  this.id = id;
6
6
  this.code = code;
7
7
  this.name = name;
@@ -15,6 +15,7 @@ var Prestation = /** @class */ (function () {
15
15
  this.operationsVisible = operationsVisible;
16
16
  this.operations = operations;
17
17
  this.state = state;
18
+ this.categoryCode = categoryCode;
18
19
  }
19
20
  return Prestation;
20
21
  }());
@@ -3,9 +3,11 @@ import Employee from "../models/Employee";
3
3
  import Garage from "../models/Garage";
4
4
  import { AddCustomerVehicleParams, DeleteCustomerVehicleParams } from "./GarageService.types";
5
5
  export default class GarageService {
6
+ static toogleEventVehicleReceived(garageId: string, eventId: string): Promise<APIResponse<string>>;
6
7
  static setOrderedEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
7
8
  static deleteEventEmployee(garageId: string, eventId: string): Promise<APIResponse<string>>;
8
9
  static updateEventEmployee(garageId: string, eventId: string, employeeId: string): Promise<APIResponse<string>>;
10
+ static updateColorPrestationCategory(garageId: string, categoryCode: string, color: string): Promise<APIResponse<string>>;
9
11
  static updateVehicleGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
10
12
  static sendGarageMandate(garageId: string): Promise<APIResponse<string>>;
11
13
  static getGarageAllData(garageId: string): Promise<APIResponse<Garage>>;
@@ -16,6 +16,13 @@ var Enums_1 = require("../helpers/Enums");
16
16
  var GarageService = /** @class */ (function () {
17
17
  function GarageService() {
18
18
  }
19
+ GarageService.toogleEventVehicleReceived = function (garageId, eventId) {
20
+ return (0, ApiHelper_1.request)({
21
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/events/").concat(eventId, "/vehicle-received"),
22
+ method: Enums_1.APIMethod.PATCH,
23
+ appType: Enums_1.MovaAppType.GARAGE
24
+ });
25
+ };
19
26
  GarageService.setOrderedEvent = function (garageId, eventId, req) {
20
27
  return (0, ApiHelper_1.request)({
21
28
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/events/").concat(eventId, "/ordered"),
@@ -38,6 +45,14 @@ var GarageService = /** @class */ (function () {
38
45
  appType: Enums_1.MovaAppType.GARAGE
39
46
  });
40
47
  };
48
+ GarageService.updateColorPrestationCategory = function (garageId, categoryCode, color) {
49
+ return (0, ApiHelper_1.request)({
50
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/prestation-category/").concat(categoryCode, "/color"),
51
+ method: Enums_1.APIMethod.PATCH,
52
+ appType: Enums_1.MovaAppType.GARAGE,
53
+ body: JSON.stringify({ color: color })
54
+ });
55
+ };
41
56
  GarageService.updateVehicleGarageEvent = function (garageId, eventId, req) {
42
57
  return (0, ApiHelper_1.request)({
43
58
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/vehicle"),
package/index.ts CHANGED
@@ -49,7 +49,7 @@ export { default as Garage } from './src/models/Garage';
49
49
  export { default as Schedule } from './src/models/Schedule';
50
50
  export { default as Event } from './src/models/Event';
51
51
  export { default as VehicleTire } from './src/models/VehicleTire';
52
-
52
+ export {default as CategoryPrestation} from './src/models/CategoryPrestation';
53
53
  // Export des types
54
54
  export type { APIRequest, APIResponse } from './src/helpers/ApiHelper';
55
55
  export type { DaySchedule, DayInterval } from './src/ScheduleFields';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.57.0",
3
+ "version": "1.59.0",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,22 @@
1
+
2
+ export default class CategoryPrestation {
3
+
4
+ // Properties
5
+ color: string;
6
+ code: string;
7
+ name: string;
8
+ description: string;
9
+ position: number
10
+
11
+
12
+ /**
13
+ *
14
+ */
15
+ constructor(color: string, code: string, name:string, description: string, position: number) {
16
+ this.color = color;
17
+ this.code = code;
18
+ this.name = name;
19
+ this.description = description;
20
+ this.position = position;
21
+ }
22
+ }
@@ -52,6 +52,7 @@ export default class Event {
52
52
  editable?: boolean;
53
53
  vehicleDepositDate?: Date;
54
54
  vehicleDepositDateRequest?: Date;
55
+ color?: string;
55
56
 
56
57
  /** Propriété calculée pas toujours présent, pour savoir si les produits de cet event on été commandé au grossistes */
57
58
  hasProductOrdered?: boolean;
@@ -66,7 +67,7 @@ export default class Event {
66
67
  repairOrderNumber?: number;
67
68
  orderComment?: string;
68
69
 
69
- constructor(id: string, ownerId: number, type : EventType, title: string, garageName: string, garageId: number,
70
+ constructor(id: string, ownerId: number, type : EventType, title: string, garageName: string, garageId: number,color: string,
70
71
  state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[],
71
72
  guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number)
72
73
  {
@@ -90,6 +91,7 @@ export default class Event {
90
91
  this.vehicleAvailableNotified = vehicleAvailableNotified;
91
92
  this.editable = editable;
92
93
  this.resourceId = resourceId;
94
+ this.color = color;
93
95
  }
94
96
 
95
97
  static getPrestationsList(event: Event) : string[] {
@@ -7,6 +7,7 @@ import { OrderPreference, RegistrationState, SlotAlgorithm, SubscriptionPaymentI
7
7
  import User from "./User";
8
8
  import Subscription from "./Subscription";
9
9
  import Employee from "./Employee";
10
+ import CategoryPrestation from "./CategoryPrestation";
10
11
 
11
12
  export default class Garage {
12
13
 
@@ -16,6 +17,7 @@ export default class Garage {
16
17
  address:Address;
17
18
  workforce: number;
18
19
  contactPhone: string;
20
+ prestationCategories: CategoryPrestation[];
19
21
  prestations: Prestation[];
20
22
  schedules: Schedule[];
21
23
  countryCode?: string;
@@ -53,6 +55,7 @@ export default class Garage {
53
55
  prestations: Prestation[],
54
56
  schedules: Schedule[],
55
57
  contactPhone: string,
58
+ prestationCategories: CategoryPrestation[],
56
59
  contactEmail?: string,
57
60
  logo?:string,
58
61
  suppliers?: Supplier[],
@@ -64,6 +67,7 @@ export default class Garage {
64
67
  this.name = name;
65
68
  this.address = address;
66
69
  this.workforce = workforce;
70
+ this.prestationCategories = prestationCategories;
67
71
  this.prestations = prestations;
68
72
  this.schedules = schedules;
69
73
  this.contactPhone = contactPhone;
@@ -33,10 +33,11 @@ export default class Prestation {
33
33
  multipleApplication: boolean;
34
34
 
35
35
  operationsVisible: boolean;
36
+ categoryCode: string;
36
37
 
37
38
  constructor(id:number, code: string, name:string, description: string, category:string,
38
39
  downtime:number, appointmentDelay: number, position: number, active: boolean, state: PrestationState,
39
- multipleApplication: boolean, operationsVisible: boolean, operations?: Operation[]) {
40
+ multipleApplication: boolean, operationsVisible: boolean,categoryCode: string, operations?: Operation[]) {
40
41
  this.id = id;
41
42
  this.code = code;
42
43
  this.name = name;
@@ -50,5 +51,6 @@ export default class Prestation {
50
51
  this.operationsVisible = operationsVisible;
51
52
  this.operations = operations;
52
53
  this.state = state;
54
+ this.categoryCode = categoryCode;
53
55
  }
54
56
  }
@@ -6,6 +6,14 @@ import {AddCustomerVehicleParams, DeleteCustomerVehicleParams} from "./GarageSer
6
6
 
7
7
  export default class GarageService {
8
8
 
9
+ static toogleEventVehicleReceived(garageId: string, eventId: string): Promise<APIResponse<string>> {
10
+ return request({
11
+ url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/vehicle-received`,
12
+ method: APIMethod.PATCH,
13
+ appType: MovaAppType.GARAGE
14
+ });
15
+ }
16
+
9
17
  static setOrderedEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
10
18
  return request({
11
19
  url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/ordered`,
@@ -31,6 +39,15 @@ export default class GarageService {
31
39
  });
32
40
  }
33
41
 
42
+ static updateColorPrestationCategory(garageId: string, categoryCode: string, color: string): Promise<APIResponse<string>> {
43
+ return request({
44
+ url: `${API_BASE_URL}/garage/${garageId}/prestation-category/${categoryCode}/color`,
45
+ method: APIMethod.PATCH,
46
+ appType: MovaAppType.GARAGE,
47
+ body: JSON.stringify({ color })
48
+ });
49
+ }
50
+
34
51
  static updateVehicleGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
35
52
 
36
53
  return request({