@movalib/movalib-commons 1.0.80 → 1.0.82
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.
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { OrderPreference, ProductType } from "../helpers/Enums";
|
|
2
|
+
import Operation from "./Operation";
|
|
2
3
|
export default class Product {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
type: ProductType;
|
|
6
7
|
orderPreference?: OrderPreference;
|
|
7
8
|
originReferences?: string[];
|
|
9
|
+
operation?: Operation;
|
|
8
10
|
constructor(id: string, code: string, name: string, type: ProductType, orderPreference: OrderPreference, originReferences: string[]);
|
|
9
11
|
}
|
|
@@ -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 deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>>;
|
|
5
|
+
static createGarageSupplier(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
4
6
|
static updateGarage(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
5
7
|
static getAdministratedGarages(): Promise<APIResponse<Garage[]>>;
|
|
6
8
|
}
|
|
@@ -5,6 +5,19 @@ var Enums_1 = require("../helpers/Enums");
|
|
|
5
5
|
var GarageService = /** @class */ (function () {
|
|
6
6
|
function GarageService() {
|
|
7
7
|
}
|
|
8
|
+
GarageService.deleteGarageSupplier = function (garageId, supplierId) {
|
|
9
|
+
return (0, ApiHelper_1.request)({
|
|
10
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/suppliers/").concat(supplierId),
|
|
11
|
+
method: Enums_1.APIMethod.DELETE
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
GarageService.createGarageSupplier = function (garageId, req) {
|
|
15
|
+
return (0, ApiHelper_1.request)({
|
|
16
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/suppliers"),
|
|
17
|
+
method: Enums_1.APIMethod.POST,
|
|
18
|
+
body: JSON.stringify(req)
|
|
19
|
+
});
|
|
20
|
+
};
|
|
8
21
|
GarageService.updateGarage = function (garageId, req) {
|
|
9
22
|
return (0, ApiHelper_1.request)({
|
|
10
23
|
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId),
|
package/package.json
CHANGED
package/src/models/Product.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OrderPreference, ProductType } from "../helpers/Enums";
|
|
2
|
+
import Operation from "./Operation";
|
|
2
3
|
|
|
3
4
|
export default class Product {
|
|
4
5
|
|
|
@@ -8,6 +9,8 @@ export default class Product {
|
|
|
8
9
|
type: ProductType;
|
|
9
10
|
orderPreference?: OrderPreference;
|
|
10
11
|
originReferences?: string[];
|
|
12
|
+
// Eventuelle opération associée au produit
|
|
13
|
+
operation?: Operation;
|
|
11
14
|
|
|
12
15
|
constructor(id:string, code: string, name:string, type: ProductType, orderPreference: OrderPreference, originReferences: string[]) {
|
|
13
16
|
this.id = id;
|
|
@@ -4,6 +4,21 @@ import Garage from "../models/Garage";
|
|
|
4
4
|
|
|
5
5
|
export default class GarageService {
|
|
6
6
|
|
|
7
|
+
static deleteGarageSupplier(garageId: string, supplierId: string): Promise<APIResponse<string>> {
|
|
8
|
+
return request({
|
|
9
|
+
url: `${API_BASE_URL}/garage/${garageId}/suppliers/${supplierId}`,
|
|
10
|
+
method: APIMethod.DELETE
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static createGarageSupplier(garageId: string, req: any): Promise<APIResponse<string>> {
|
|
15
|
+
return request({
|
|
16
|
+
url: `${API_BASE_URL}/garage/${garageId}/suppliers`,
|
|
17
|
+
method: APIMethod.POST,
|
|
18
|
+
body: JSON.stringify(req)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
7
22
|
static updateGarage(garageId: string, req: any): Promise<APIResponse<string>> {
|
|
8
23
|
return request({
|
|
9
24
|
url: `${API_BASE_URL}/garage/${garageId}`,
|