@movalib/movalib-commons 1.0.85 → 1.0.87
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/helpers/Enums.d.ts +2 -1
- package/dist/src/helpers/Enums.js +2 -1
- package/dist/src/models/Event.d.ts +4 -1
- package/dist/src/services/GarageService.d.ts +2 -0
- package/dist/src/services/GarageService.js +14 -0
- package/package.json +1 -1
- package/src/helpers/Enums.ts +2 -1
- package/src/models/Event.ts +4 -1
- package/src/services/GarageService.ts +18 -0
|
@@ -4,7 +4,8 @@ exports.RoleType = exports.MovaAppType = exports.DocumentType = exports.Document
|
|
|
4
4
|
var OrderState;
|
|
5
5
|
(function (OrderState) {
|
|
6
6
|
OrderState["NEW"] = "NEW";
|
|
7
|
-
OrderState["
|
|
7
|
+
OrderState["QUOTE_REQUESTED"] = "QUOTE_REQUESTED";
|
|
8
|
+
OrderState["ORDERED"] = "ORDERED";
|
|
8
9
|
OrderState["DONE"] = "DONE";
|
|
9
10
|
OrderState["CANCELLED"] = "CANCELLED";
|
|
10
11
|
})(OrderState = exports.OrderState || (exports.OrderState = {}));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import User from "./User";
|
|
2
|
-
import { EventState, EventType } from "../helpers/Enums";
|
|
2
|
+
import { EventState, EventType, OrderPreference } from "../helpers/Enums";
|
|
3
3
|
import Prestation from "./Prestation";
|
|
4
4
|
import Customer from "./Customer";
|
|
5
5
|
import Vehicle from "./Vehicle";
|
|
6
6
|
import Operation from "./Operation";
|
|
7
7
|
import Product from "./Product";
|
|
8
|
+
import Supplier from "./Supplier";
|
|
8
9
|
export default class Event {
|
|
9
10
|
id: string;
|
|
10
11
|
ownerId: number;
|
|
@@ -35,6 +36,8 @@ export default class Event {
|
|
|
35
36
|
* Eventuel numéro de devis rattaché à l'évent
|
|
36
37
|
*/
|
|
37
38
|
quoteId?: number;
|
|
39
|
+
orderPreference?: OrderPreference;
|
|
40
|
+
supplier?: Supplier;
|
|
38
41
|
constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, state: EventState, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string);
|
|
39
42
|
static getPrestationsList(event: Event): string[];
|
|
40
43
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { APIResponse } from "../helpers/ApiHelper";
|
|
2
2
|
import Garage from "../models/Garage";
|
|
3
3
|
export default class GarageService {
|
|
4
|
+
static updateGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
|
|
5
|
+
static sendSupplierRequest(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
|
|
4
6
|
static deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>>;
|
|
5
7
|
static createGarageSupplier(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
6
8
|
static updateGarage(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
@@ -5,6 +5,20 @@ var Enums_1 = require("../helpers/Enums");
|
|
|
5
5
|
var GarageService = /** @class */ (function () {
|
|
6
6
|
function GarageService() {
|
|
7
7
|
}
|
|
8
|
+
GarageService.updateGarageEvent = function (garageId, eventId, req) {
|
|
9
|
+
return (0, ApiHelper_1.request)({
|
|
10
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId),
|
|
11
|
+
method: Enums_1.APIMethod.PATCH,
|
|
12
|
+
body: JSON.stringify(req)
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
GarageService.sendSupplierRequest = function (garageId, eventId, req) {
|
|
16
|
+
return (0, ApiHelper_1.request)({
|
|
17
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/events/").concat(eventId, "/supplierRequest"),
|
|
18
|
+
method: Enums_1.APIMethod.POST,
|
|
19
|
+
body: JSON.stringify(req)
|
|
20
|
+
});
|
|
21
|
+
};
|
|
8
22
|
GarageService.deleteGarageSupplier = function (garageId, supplierId) {
|
|
9
23
|
return (0, ApiHelper_1.request)({
|
|
10
24
|
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/suppliers/").concat(supplierId),
|
package/package.json
CHANGED
package/src/helpers/Enums.ts
CHANGED
package/src/models/Event.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import User from "./User";
|
|
2
|
-
import { EventState, EventType } from "../helpers/Enums";
|
|
2
|
+
import { EventState, EventType, OrderPreference } from "../helpers/Enums";
|
|
3
3
|
import Prestation from "./Prestation";
|
|
4
4
|
import Customer from "./Customer";
|
|
5
5
|
import Vehicle from "./Vehicle";
|
|
6
6
|
import Operation from "./Operation";
|
|
7
7
|
import Product from "./Product";
|
|
8
|
+
import Supplier from "./Supplier";
|
|
8
9
|
|
|
9
10
|
export default class Event {
|
|
10
11
|
|
|
@@ -38,6 +39,8 @@ export default class Event {
|
|
|
38
39
|
* Eventuel numéro de devis rattaché à l'évent
|
|
39
40
|
*/
|
|
40
41
|
quoteId?: number;
|
|
42
|
+
orderPreference?: OrderPreference;
|
|
43
|
+
supplier?: Supplier;
|
|
41
44
|
|
|
42
45
|
constructor(id: string, ownerId: number, type : EventType, title: string, garageName: string, garageId: number,
|
|
43
46
|
state: EventState, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[],
|
|
@@ -4,6 +4,24 @@ import Garage from "../models/Garage";
|
|
|
4
4
|
|
|
5
5
|
export default class GarageService {
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
static updateGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
|
|
9
|
+
|
|
10
|
+
return request({
|
|
11
|
+
url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}`,
|
|
12
|
+
method: APIMethod.PATCH,
|
|
13
|
+
body: JSON.stringify(req)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static sendSupplierRequest(garageId: string, eventId: string, req: any): Promise<APIResponse<string>> {
|
|
18
|
+
return request({
|
|
19
|
+
url: `${API_BASE_URL}/garage/${garageId}/events/${eventId}/supplierRequest`,
|
|
20
|
+
method: APIMethod.POST,
|
|
21
|
+
body: JSON.stringify(req)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
7
25
|
static deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>> {
|
|
8
26
|
return request({
|
|
9
27
|
url: `${API_BASE_URL}/garage/${garageId}/suppliers/${supplierId}`,
|