@movalib/movalib-commons 1.59.34 → 1.59.36
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/src/models/Event.d.ts +9 -7
- package/dist/src/models/Event.js +13 -4
- package/package.json +1 -1
- package/src/models/Event.ts +135 -101
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import User from "./User";
|
|
2
1
|
import { EventState, EventType, OrderPreference } from "../helpers/Enums";
|
|
3
|
-
import
|
|
2
|
+
import Address from "./Address";
|
|
4
3
|
import Customer from "./Customer";
|
|
5
|
-
import
|
|
4
|
+
import Document from "./Document";
|
|
5
|
+
import Employee from "./Employee";
|
|
6
6
|
import Operation from "./Operation";
|
|
7
|
+
import Prestation from "./Prestation";
|
|
7
8
|
import Product from "./Product";
|
|
8
9
|
import Supplier from "./Supplier";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import Employee from "./Employee";
|
|
10
|
+
import User from "./User";
|
|
11
|
+
import Vehicle from "./Vehicle";
|
|
12
12
|
export default class Event {
|
|
13
13
|
id: string;
|
|
14
14
|
ownerId: number;
|
|
@@ -65,6 +65,8 @@ export default class Event {
|
|
|
65
65
|
garageVehicleId?: number;
|
|
66
66
|
garageVehicleRequest?: boolean;
|
|
67
67
|
origin?: string;
|
|
68
|
-
|
|
68
|
+
quoteLastSendingTime?: Date;
|
|
69
|
+
invoiceSendingDate?: Date;
|
|
70
|
+
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);
|
|
69
71
|
static getPrestationsList(event: Event): string[];
|
|
70
72
|
}
|
package/dist/src/models/Event.js
CHANGED
|
@@ -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, vehicleAvailableNotificationTime, interventionEndTime) {
|
|
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, quoteLastSendingTime, invoiceSendingDate) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.notes = notes;
|
|
7
7
|
this.ownerId = ownerId;
|
|
@@ -25,12 +25,21 @@ var Event = /** @class */ (function () {
|
|
|
25
25
|
this.color = color;
|
|
26
26
|
this.garageVehicleId = garageVehicleId;
|
|
27
27
|
this.garageVehicleRequest = garageVehicleRequest;
|
|
28
|
-
this.vehicleAvailableNotificationTime = vehicleAvailableNotificationTime
|
|
29
|
-
|
|
28
|
+
this.vehicleAvailableNotificationTime = vehicleAvailableNotificationTime
|
|
29
|
+
? new Date(vehicleAvailableNotificationTime)
|
|
30
|
+
: undefined;
|
|
31
|
+
this.interventionEndTime = interventionEndTime
|
|
32
|
+
? new Date(interventionEndTime)
|
|
33
|
+
: undefined;
|
|
34
|
+
this.quoteLastSendingTime = quoteLastSendingTime
|
|
35
|
+
? new Date(quoteLastSendingTime)
|
|
36
|
+
: undefined;
|
|
37
|
+
this.invoiceSendingDate = invoiceSendingDate
|
|
38
|
+
? new Date(invoiceSendingDate)
|
|
39
|
+
: undefined;
|
|
30
40
|
}
|
|
31
41
|
Event.getPrestationsList = function (event) {
|
|
32
42
|
if (event && event.prestations) {
|
|
33
|
-
console.log(event.prestations.map(function (n) { return n.name; }));
|
|
34
43
|
return event.prestations.map(function (n) { return n.name; });
|
|
35
44
|
}
|
|
36
45
|
return [];
|
package/package.json
CHANGED
package/src/models/Event.ts
CHANGED
|
@@ -1,115 +1,149 @@
|
|
|
1
|
-
import User from "./User";
|
|
2
1
|
import { EventState, EventType, OrderPreference } from "../helpers/Enums";
|
|
3
|
-
import
|
|
2
|
+
import Address from "./Address";
|
|
4
3
|
import Customer from "./Customer";
|
|
5
|
-
import
|
|
4
|
+
import Document from "./Document";
|
|
5
|
+
import Employee from "./Employee";
|
|
6
6
|
import Operation from "./Operation";
|
|
7
|
+
import Prestation from "./Prestation";
|
|
7
8
|
import Product from "./Product";
|
|
8
9
|
import Supplier from "./Supplier";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import Employee from "./Employee";
|
|
10
|
+
import User from "./User";
|
|
11
|
+
import Vehicle from "./Vehicle";
|
|
12
12
|
|
|
13
13
|
export default class Event {
|
|
14
|
+
// Properties
|
|
15
|
+
id: string; //UUID
|
|
16
|
+
ownerId: number;
|
|
17
|
+
type: EventType;
|
|
18
|
+
title: string;
|
|
19
|
+
garageName: string;
|
|
20
|
+
garageId: number;
|
|
21
|
+
state: EventState;
|
|
22
|
+
garageAddress?: Address;
|
|
23
|
+
start?: Date;
|
|
24
|
+
end?: Date;
|
|
25
|
+
prestations?: Prestation[];
|
|
26
|
+
operations?: Operation[];
|
|
27
|
+
products?: Product[];
|
|
28
|
+
/**
|
|
29
|
+
* Un tableau d'invités, dans notre cas d'usage nous n'aurons qu'un invité de type Client
|
|
30
|
+
*/
|
|
31
|
+
guestsId?: string[];
|
|
32
|
+
guests?: User[];
|
|
33
|
+
customer?: Customer;
|
|
34
|
+
vehicle?: Vehicle;
|
|
35
|
+
vehicleId?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Une liste de ressources affectées à l'événement, dans notre cas il s'agira de un ou plusieurs Techniciens
|
|
38
|
+
*/
|
|
39
|
+
resources?: number[];
|
|
40
|
+
notes?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Eventuel numéro de devis rattaché à l'évent
|
|
43
|
+
*/
|
|
44
|
+
quoteId?: number;
|
|
45
|
+
orderPreference?: OrderPreference;
|
|
46
|
+
supplier?: Supplier;
|
|
47
|
+
quoteAmount?: number;
|
|
48
|
+
documents?: Document[];
|
|
49
|
+
customerReminders?: number;
|
|
50
|
+
vehicleAvailableNotified?: boolean;
|
|
51
|
+
vehicleAvailableNotificationTime?: Date;
|
|
52
|
+
editable?: boolean;
|
|
53
|
+
vehicleDepositDate?: Date;
|
|
54
|
+
vehicleDepositDateRequest?: Date;
|
|
55
|
+
color?: string;
|
|
56
|
+
interventionEndTime?: Date;
|
|
57
|
+
/** Propriété calculée pas toujours présent, pour savoir si les produits de cet event on été commandé au grossistes */
|
|
58
|
+
hasProductOrdered?: boolean;
|
|
14
59
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type: EventType;
|
|
19
|
-
title: string;
|
|
20
|
-
garageName: string;
|
|
21
|
-
garageId: number;
|
|
22
|
-
state: EventState;
|
|
23
|
-
garageAddress?: Address;
|
|
24
|
-
start?: Date;
|
|
25
|
-
end?: Date;
|
|
26
|
-
prestations?: Prestation[];
|
|
27
|
-
operations?: Operation[];
|
|
28
|
-
products?: Product[];
|
|
29
|
-
/**
|
|
30
|
-
* Un tableau d'invités, dans notre cas d'usage nous n'aurons qu'un invité de type Client
|
|
31
|
-
*/
|
|
32
|
-
guestsId?: string[];
|
|
33
|
-
guests?: User[];
|
|
34
|
-
customer?: Customer;
|
|
35
|
-
vehicle?: Vehicle;
|
|
36
|
-
vehicleId?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Une liste de ressources affectées à l'événement, dans notre cas il s'agira de un ou plusieurs Techniciens
|
|
39
|
-
*/
|
|
40
|
-
resources?: number[];
|
|
41
|
-
notes?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Eventuel numéro de devis rattaché à l'évent
|
|
44
|
-
*/
|
|
45
|
-
quoteId?: number;
|
|
46
|
-
orderPreference?: OrderPreference;
|
|
47
|
-
supplier?: Supplier;
|
|
48
|
-
quoteAmount?: number;
|
|
49
|
-
documents?: Document[];
|
|
50
|
-
customerReminders?: number;
|
|
51
|
-
vehicleAvailableNotified?: boolean;
|
|
52
|
-
vehicleAvailableNotificationTime?:Date
|
|
53
|
-
editable?: boolean;
|
|
54
|
-
vehicleDepositDate?: Date;
|
|
55
|
-
vehicleDepositDateRequest?: Date;
|
|
56
|
-
color?: string;
|
|
57
|
-
interventionEndTime?: Date;
|
|
58
|
-
/** Propriété calculée pas toujours présent, pour savoir si les produits de cet event on été commandé au grossistes */
|
|
59
|
-
hasProductOrdered?: boolean;
|
|
60
|
+
/** Eventuels opérateurs associés à l'event */
|
|
61
|
+
employees?: Employee[];
|
|
62
|
+
resourceId?: number;
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
resourceId?: number;
|
|
64
|
+
/** Quand l'event contient la prestation "Autres" alors ce champs est obligatoire et précise la prestation */
|
|
65
|
+
otherReason?: string;
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
repairOrderNumber?: number;
|
|
68
|
+
orderComment?: string;
|
|
69
|
+
vehicleReceived?: boolean;
|
|
70
|
+
garageVehicleId?: number;
|
|
71
|
+
garageVehicleRequest?: boolean;
|
|
72
|
+
origin?: string;
|
|
73
|
+
quoteLastSendingTime?: Date;
|
|
74
|
+
invoiceSendingDate?: Date;
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
constructor(
|
|
77
|
+
id: string,
|
|
78
|
+
ownerId: number,
|
|
79
|
+
type: EventType,
|
|
80
|
+
title: string,
|
|
81
|
+
garageName: string,
|
|
82
|
+
garageId: number,
|
|
83
|
+
color: string,
|
|
84
|
+
state: EventState,
|
|
85
|
+
garageAddress?: Address,
|
|
86
|
+
start?: Date,
|
|
87
|
+
end?: Date,
|
|
88
|
+
prestations?: Prestation[],
|
|
89
|
+
operations?: Operation[],
|
|
90
|
+
products?: Product[],
|
|
91
|
+
guestsId?: string[],
|
|
92
|
+
vehicleId?: number,
|
|
93
|
+
quoteId?: number,
|
|
94
|
+
notes?: string,
|
|
95
|
+
vehicleAvailableNotified?: boolean,
|
|
96
|
+
editable?: boolean,
|
|
97
|
+
resourceId?: number,
|
|
98
|
+
garageVehicleId?: number,
|
|
99
|
+
garageVehicleRequest?: boolean,
|
|
100
|
+
vehicleAvailableNotificationTime?: Date,
|
|
101
|
+
interventionEndTime?: Date,
|
|
102
|
+
quoteLastSendingTime?: Date,
|
|
103
|
+
invoiceSendingDate?: Date
|
|
104
|
+
) {
|
|
105
|
+
this.id = id;
|
|
106
|
+
this.notes = notes;
|
|
107
|
+
this.ownerId = ownerId;
|
|
108
|
+
this.type = type;
|
|
109
|
+
this.title = title;
|
|
110
|
+
this.garageName = garageName;
|
|
111
|
+
this.garageAddress = garageAddress;
|
|
112
|
+
this.garageId = garageId;
|
|
113
|
+
this.state = state;
|
|
114
|
+
this.start = start ? new Date(start) : undefined;
|
|
115
|
+
this.end = end ? new Date(end) : undefined;
|
|
116
|
+
this.operations = operations;
|
|
117
|
+
this.prestations = prestations;
|
|
118
|
+
this.products = products;
|
|
119
|
+
this.guestsId = guestsId;
|
|
120
|
+
this.vehicleId = vehicleId;
|
|
121
|
+
this.quoteId = quoteId;
|
|
122
|
+
this.vehicleAvailableNotified = vehicleAvailableNotified;
|
|
123
|
+
this.editable = editable;
|
|
124
|
+
this.resourceId = resourceId;
|
|
125
|
+
this.color = color;
|
|
126
|
+
this.garageVehicleId = garageVehicleId;
|
|
127
|
+
this.garageVehicleRequest = garageVehicleRequest;
|
|
128
|
+
this.vehicleAvailableNotificationTime = vehicleAvailableNotificationTime
|
|
129
|
+
? new Date(vehicleAvailableNotificationTime)
|
|
130
|
+
: undefined;
|
|
131
|
+
this.interventionEndTime = interventionEndTime
|
|
132
|
+
? new Date(interventionEndTime)
|
|
133
|
+
: undefined;
|
|
134
|
+
this.quoteLastSendingTime = quoteLastSendingTime
|
|
135
|
+
? new Date(quoteLastSendingTime)
|
|
136
|
+
: undefined;
|
|
137
|
+
this.invoiceSendingDate = invoiceSendingDate
|
|
138
|
+
? new Date(invoiceSendingDate)
|
|
139
|
+
: undefined;
|
|
140
|
+
}
|
|
74
141
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date)
|
|
79
|
-
{
|
|
80
|
-
this.id = id;
|
|
81
|
-
this.notes = notes;
|
|
82
|
-
this.ownerId = ownerId;
|
|
83
|
-
this.type = type;
|
|
84
|
-
this.title = title;
|
|
85
|
-
this.garageName = garageName;
|
|
86
|
-
this.garageAddress = garageAddress;
|
|
87
|
-
this.garageId = garageId;
|
|
88
|
-
this.state = state;
|
|
89
|
-
this.start = start ? new Date(start) : undefined;
|
|
90
|
-
this.end = end ? new Date(end) : undefined;
|
|
91
|
-
this.operations = operations;
|
|
92
|
-
this.prestations = prestations;
|
|
93
|
-
this.products = products;
|
|
94
|
-
this.guestsId = guestsId;
|
|
95
|
-
this.vehicleId = vehicleId;
|
|
96
|
-
this.quoteId = quoteId;
|
|
97
|
-
this.vehicleAvailableNotified = vehicleAvailableNotified;
|
|
98
|
-
this.editable = editable;
|
|
99
|
-
this.resourceId = resourceId;
|
|
100
|
-
this.color = color;
|
|
101
|
-
this.garageVehicleId = garageVehicleId;
|
|
102
|
-
this.garageVehicleRequest = garageVehicleRequest;
|
|
103
|
-
this.vehicleAvailableNotificationTime = vehicleAvailableNotificationTime ? new Date(vehicleAvailableNotificationTime) : undefined;
|
|
104
|
-
this.interventionEndTime = interventionEndTime ? new Date(interventionEndTime) : undefined;
|
|
142
|
+
static getPrestationsList(event: Event): string[] {
|
|
143
|
+
if (event && event.prestations) {
|
|
144
|
+
return event.prestations.map((n) => n.name);
|
|
105
145
|
}
|
|
106
146
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return event.prestations.map(n => n.name);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return [];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
}
|