@movalib/movalib-commons 1.0.31 → 1.0.33

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.
@@ -8,6 +8,7 @@ export default class Event {
8
8
  ownerId: number;
9
9
  type: EventType;
10
10
  title: string;
11
+ garageName: string;
11
12
  startDate?: Date;
12
13
  endDate?: Date;
13
14
  state: EventState;
@@ -33,12 +34,13 @@ export default class Event {
33
34
  * MVP : pour l'instant les références sont transmises sous cette forme classique
34
35
  */
35
36
  originReferences?: [string, string][];
36
- constructor({ id, notes, ownerId, type, title, state, startDate, endDate, prestations, guestsId, vehicleId, quoteId, originReferences }: {
37
+ constructor({ id, notes, ownerId, type, title, garageName, state, startDate, endDate, prestations, guestsId, vehicleId, quoteId, originReferences }: {
37
38
  id: string;
38
39
  notes?: string;
39
40
  ownerId: number;
40
41
  type: EventType;
41
42
  title: string;
43
+ garageName: string;
42
44
  state: EventState;
43
45
  startDate?: Date;
44
46
  endDate?: Date;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Event = /** @class */ (function () {
4
4
  function Event(_a) {
5
- var id = _a.id, notes = _a.notes, ownerId = _a.ownerId, type = _a.type, title = _a.title, state = _a.state, startDate = _a.startDate, endDate = _a.endDate, prestations = _a.prestations, guestsId = _a.guestsId, vehicleId = _a.vehicleId, quoteId = _a.quoteId, originReferences = _a.originReferences;
5
+ var id = _a.id, notes = _a.notes, ownerId = _a.ownerId, type = _a.type, title = _a.title, garageName = _a.garageName, state = _a.state, startDate = _a.startDate, endDate = _a.endDate, prestations = _a.prestations, guestsId = _a.guestsId, vehicleId = _a.vehicleId, quoteId = _a.quoteId, originReferences = _a.originReferences;
6
6
  this.id = id;
7
7
  this.notes = notes;
8
8
  this.ownerId = ownerId;
9
9
  this.type = type;
10
10
  this.title = title;
11
+ this.garageName = garageName;
11
12
  this.state = state;
12
13
  this.startDate = startDate ? new Date(startDate) : undefined;
13
14
  this.endDate = endDate ? new Date(endDate) : undefined;
@@ -18,4 +18,5 @@ export default class Vehicle {
18
18
  tireWidth: string;
19
19
  documents: Document[];
20
20
  constructor(id: number, ownerId: number, averageMileagePerYear: number, plate: string, brand: string, model: string, version: string, vin: string, currentMileage: number, digitalPassportIndex: string, firstRegistrationDate: Date, ktype: string, tireDiameter: string, tireHeight: string, tireSpeedIndex: string, tireWidth: string, documents: Document[]);
21
+ getVehicleLabel: () => string;
21
22
  }
@@ -12,6 +12,10 @@ Cylindrée : 1984 cm3
12
12
  Puissance : 140 KW (190 HP) */
13
13
  var Vehicle = /** @class */ (function () {
14
14
  function Vehicle(id, ownerId, averageMileagePerYear, plate, brand, model, version, vin, currentMileage, digitalPassportIndex, firstRegistrationDate, ktype, tireDiameter, tireHeight, tireSpeedIndex, tireWidth, documents) {
15
+ var _this = this;
16
+ this.getVehicleLabel = function () {
17
+ return "".concat(_this.brand, " ").concat(_this.model, " ").concat(_this.version);
18
+ };
15
19
  this.id = id;
16
20
  this.ownerId = ownerId;
17
21
  this.averageMileagePerYear = averageMileagePerYear;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
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",
@@ -11,6 +11,7 @@ export default class Event {
11
11
  ownerId: number;
12
12
  type: EventType;
13
13
  title: string;
14
+ garageName: string;
14
15
  startDate?: Date;
15
16
  endDate?: Date;
16
17
  state: EventState;
@@ -38,8 +39,8 @@ export default class Event {
38
39
  */
39
40
  originReferences?: [string, string][];
40
41
 
41
- constructor({ id, notes, ownerId, type, title, state, startDate, endDate, prestations, guestsId, vehicleId, quoteId, originReferences }
42
- : { id: string; notes?: string; ownerId: number; type : EventType; title: string;
42
+ constructor({ id, notes, ownerId, type, title, garageName, state, startDate, endDate, prestations, guestsId, vehicleId, quoteId, originReferences }
43
+ : { id: string; notes?: string; ownerId: number; type : EventType; title: string; garageName: string;
43
44
  state: EventState; startDate?: Date; endDate?: Date, prestations?: Prestation[],
44
45
  guestsId?: string[], vehicleId?: number, quoteId?: number, originReferences?: [string, string][]})
45
46
  {
@@ -48,6 +49,7 @@ export default class Event {
48
49
  this.ownerId = ownerId;
49
50
  this.type = type;
50
51
  this.title = title;
52
+ this.garageName = garageName;
51
53
  this.state = state;
52
54
  this.startDate = startDate ? new Date(startDate) : undefined;
53
55
  this.endDate = endDate ? new Date(endDate) : undefined;
@@ -69,4 +69,8 @@ export default class Vehicle {
69
69
  this.tireWidth = tireWidth;
70
70
  this.documents = documents;
71
71
  }
72
+
73
+ getVehicleLabel = () => {
74
+ return `${this.brand} ${this.model} ${this.version}`
75
+ }
72
76
  }