@movalib/movalib-commons 1.59.30 → 1.59.31

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.
@@ -46,10 +46,12 @@ export default class Event {
46
46
  documents?: Document[];
47
47
  customerReminders?: number;
48
48
  vehicleAvailableNotified?: boolean;
49
+ vehicleAvailableNotificationTime?: Date;
49
50
  editable?: boolean;
50
51
  vehicleDepositDate?: Date;
51
52
  vehicleDepositDateRequest?: Date;
52
53
  color?: string;
54
+ interventionEndTime?: Date;
53
55
  /** Propriété calculée pas toujours présent, pour savoir si les produits de cet event on été commandé au grossistes */
54
56
  hasProductOrdered?: boolean;
55
57
  /** Eventuels opérateurs associés à l'event */
@@ -63,6 +65,6 @@ export default class Event {
63
65
  garageVehicleId?: number;
64
66
  garageVehicleRequest?: boolean;
65
67
  origin?: string;
66
- constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean);
68
+ 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);
67
69
  static getPrestationsList(event: Event): string[];
68
70
  }
@@ -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, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest) {
4
+ 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) {
5
5
  this.id = id;
6
6
  this.notes = notes;
7
7
  this.ownerId = ownerId;
@@ -25,6 +25,8 @@ var Event = /** @class */ (function () {
25
25
  this.color = color;
26
26
  this.garageVehicleId = garageVehicleId;
27
27
  this.garageVehicleRequest = garageVehicleRequest;
28
+ this.vehicleAvailableNotificationTime = vehicleAvailableNotificationTime ? new Date(vehicleAvailableNotificationTime) : undefined;
29
+ this.interventionEndTime = interventionEndTime ? new Date(interventionEndTime) : undefined;
28
30
  }
29
31
  Event.getPrestationsList = function (event) {
30
32
  if (event && event.prestations) {
@@ -23,6 +23,7 @@ export default class GarageService {
23
23
  garageId: string;
24
24
  }): Promise<APIResponse<Garage>>;
25
25
  static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>>;
26
+ static sendInterventionEnd(garageId: string, eventId: string): Promise<APIResponse<string>>;
26
27
  static sendAppointmentVehicleAvailable(garageId: string, eventId: string): Promise<APIResponse<string>>;
27
28
  static enableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
28
29
  static disableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
@@ -137,6 +137,13 @@ var GarageService = /** @class */ (function () {
137
137
  body: formData,
138
138
  });
139
139
  };
140
+ GarageService.sendInterventionEnd = function (garageId, eventId) {
141
+ return (0, ApiHelper_1.request)({
142
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/intervention-end"),
143
+ method: Enums_1.APIMethod.POST,
144
+ appType: Enums_1.MovaAppType.GARAGE,
145
+ });
146
+ };
140
147
  GarageService.sendAppointmentVehicleAvailable = function (garageId, eventId) {
141
148
  return (0, ApiHelper_1.request)({
142
149
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/vehicle-available"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.59.30",
3
+ "version": "1.59.31",
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",
@@ -49,11 +49,12 @@ export default class Event {
49
49
  documents?: Document[];
50
50
  customerReminders?: number;
51
51
  vehicleAvailableNotified?: boolean;
52
+ vehicleAvailableNotificationTime?:Date
52
53
  editable?: boolean;
53
54
  vehicleDepositDate?: Date;
54
55
  vehicleDepositDateRequest?: Date;
55
56
  color?: string;
56
-
57
+ interventionEndTime?: Date;
57
58
  /** Propriété calculée pas toujours présent, pour savoir si les produits de cet event on été commandé au grossistes */
58
59
  hasProductOrdered?: boolean;
59
60
 
@@ -74,7 +75,7 @@ export default class Event {
74
75
  constructor(id: string, ownerId: number, type : EventType, title: string, garageName: string, garageId: number,color: string,
75
76
  state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[],
76
77
  guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean,
77
- resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean)
78
+ resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date)
78
79
  {
79
80
  this.id = id;
80
81
  this.notes = notes;
@@ -99,6 +100,8 @@ export default class Event {
99
100
  this.color = color;
100
101
  this.garageVehicleId = garageVehicleId;
101
102
  this.garageVehicleRequest = garageVehicleRequest;
103
+ this.vehicleAvailableNotificationTime = vehicleAvailableNotificationTime ? new Date(vehicleAvailableNotificationTime) : undefined;
104
+ this.interventionEndTime = interventionEndTime ? new Date(interventionEndTime) : undefined;
102
105
  }
103
106
 
104
107
  static getPrestationsList(event: Event) : string[] {
@@ -171,6 +171,17 @@ export default class GarageService {
171
171
  });
172
172
  }
173
173
 
174
+ static sendInterventionEnd(
175
+ garageId: string,
176
+ eventId: string,
177
+ ): Promise<APIResponse<string>> {
178
+ return request({
179
+ url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/intervention-end`,
180
+ method: APIMethod.POST,
181
+ appType: MovaAppType.GARAGE,
182
+ });
183
+ }
184
+
174
185
  static sendAppointmentVehicleAvailable(
175
186
  garageId: string,
176
187
  eventId: string,