@movalib/movalib-commons 1.49.0 → 1.51.0

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,11 +1,13 @@
1
- import { PrestationType } from "../helpers/Enums";
2
1
  import Absence from "./Absence";
2
+ import Prestation from "./Prestation";
3
3
  import Role from "./Role";
4
4
  import Schedule from "./Schedule";
5
5
  import User from "./User";
6
6
  export default class Employee extends User {
7
+ firstname: string;
8
+ lastname: string;
7
9
  absences: Absence[];
8
- prestationTypes: PrestationType[];
10
+ prestations: Prestation[];
9
11
  schedules: Schedule[];
10
- constructor(id: string, roles: Role[] | undefined, firstname: string | undefined, lastname: string | undefined, avatar: string | undefined, absences: Absence[], prestationTypes?: PrestationType[], schedules?: Schedule[]);
12
+ constructor(id: string, roles: Role[] | undefined, firstname: string | undefined, lastname: string | undefined, avatar: string | undefined, absences: Absence[], prestations?: Prestation[], schedules?: Schedule[]);
11
13
  }
@@ -21,16 +21,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  var User_1 = __importDefault(require("./User"));
22
22
  var Employee = /** @class */ (function (_super) {
23
23
  __extends(Employee, _super);
24
- function Employee(id, roles, firstname, lastname, avatar, absences, prestationTypes, schedules) {
24
+ function Employee(id, roles, firstname, lastname, avatar, absences, prestations, schedules) {
25
25
  if (roles === void 0) { roles = []; }
26
26
  if (firstname === void 0) { firstname = ''; }
27
27
  if (lastname === void 0) { lastname = ''; }
28
28
  if (avatar === void 0) { avatar = ''; }
29
- if (prestationTypes === void 0) { prestationTypes = []; }
29
+ if (prestations === void 0) { prestations = []; }
30
30
  if (schedules === void 0) { schedules = []; }
31
31
  var _this = _super.call(this, id, roles, firstname, lastname, avatar) || this;
32
+ _this.firstname = '';
33
+ _this.lastname = '';
32
34
  _this.absences = absences;
33
- _this.prestationTypes = prestationTypes;
35
+ _this.prestations = prestations;
34
36
  _this.schedules = schedules;
35
37
  return _this;
36
38
  }
@@ -37,5 +37,6 @@ export default class Garage {
37
37
  documents?: Document[];
38
38
  subscriptions?: Subscription[];
39
39
  supportPhoneNumber?: string;
40
+ operatorsActive?: boolean;
40
41
  constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[]);
41
42
  }
@@ -14,9 +14,9 @@ export default class GarageService {
14
14
  static disableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
15
15
  static getEmployeeDetails(garageId: string, employeeId: string): Promise<APIResponse<Employee>>;
16
16
  static updateGaragePrestation(garageId: string, prestationId: string, req: any): Promise<APIResponse<string>>;
17
- static deleteGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
18
- static createGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
19
- static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
17
+ static deleteGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>>;
18
+ static createGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>>;
19
+ static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, absenceId: string): Promise<APIResponse<string>>;
20
20
  static createGarageEmployeeAbsence(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
21
21
  static updateGarageEmployeeSchedules(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
22
22
  static deleteGarageEmployee(garageId: string, req: any): Promise<APIResponse<string>>;
@@ -97,28 +97,25 @@ var GarageService = /** @class */ (function () {
97
97
  body: JSON.stringify(req)
98
98
  });
99
99
  };
100
- GarageService.deleteGarageEmployeePrestationType = function (garageId, employeeId, req) {
100
+ GarageService.deleteGarageEmployeePrestation = function (garageId, employeeId, prestationId) {
101
101
  return (0, ApiHelper_1.request)({
102
- url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/prestations-type"),
102
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/prestations/").concat(prestationId),
103
103
  method: Enums_1.APIMethod.DELETE,
104
- appType: Enums_1.MovaAppType.GARAGE,
105
- body: JSON.stringify(req)
104
+ appType: Enums_1.MovaAppType.GARAGE
106
105
  });
107
106
  };
108
- GarageService.createGarageEmployeePrestationType = function (garageId, employeeId, req) {
107
+ GarageService.createGarageEmployeePrestation = function (garageId, employeeId, prestationId) {
109
108
  return (0, ApiHelper_1.request)({
110
- url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/prestations-type"),
109
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/prestations/").concat(prestationId),
111
110
  method: Enums_1.APIMethod.POST,
112
- appType: Enums_1.MovaAppType.GARAGE,
113
- body: JSON.stringify(req)
111
+ appType: Enums_1.MovaAppType.GARAGE
114
112
  });
115
113
  };
116
- GarageService.deleteGarageEmployeeAbsence = function (garageId, employeeId, req) {
114
+ GarageService.deleteGarageEmployeeAbsence = function (garageId, employeeId, absenceId) {
117
115
  return (0, ApiHelper_1.request)({
118
- url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/absences"),
116
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/absences/").concat(absenceId),
119
117
  method: Enums_1.APIMethod.DELETE,
120
- appType: Enums_1.MovaAppType.GARAGE,
121
- body: JSON.stringify(req)
118
+ appType: Enums_1.MovaAppType.GARAGE
122
119
  });
123
120
  };
124
121
  GarageService.createGarageEmployeeAbsence = function (garageId, employeeId, req) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.49.0",
3
+ "version": "1.51.0",
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",
@@ -1,17 +1,19 @@
1
1
  import { PrestationType } from "../helpers/Enums";
2
2
  import Absence from "./Absence";
3
3
  import Address from "./Address";
4
+ import Prestation from "./Prestation";
4
5
  import Role from "./Role";
5
6
  import Schedule from "./Schedule";
6
7
  import User from "./User";
7
8
 
8
9
 
9
10
  export default class Employee extends User {
10
-
11
+ firstname: string = '';
12
+ lastname: string = '';
11
13
  // Liste des périodes de congés du collab
12
14
  absences: Absence[];
13
15
  // Listes des types de prestation qu'il peut réaliser
14
- prestationTypes: PrestationType[];
16
+ prestations: Prestation[];
15
17
  // Horaires de travail
16
18
  schedules: Schedule[];
17
19
 
@@ -22,13 +24,13 @@ export default class Employee extends User {
22
24
  lastname: string = '',
23
25
  avatar: string = '',
24
26
  absences: Absence[],
25
- prestationTypes: PrestationType[] = [],
27
+ prestations: Prestation[] = [],
26
28
  schedules: Schedule [] = []) {
27
29
 
28
30
  super(id, roles, firstname, lastname, avatar);
29
31
 
30
32
  this.absences = absences;
31
- this.prestationTypes = prestationTypes;
33
+ this.prestations = prestations;
32
34
  this.schedules = schedules;
33
35
  }
34
36
  }
@@ -39,6 +39,7 @@ export default class Garage {
39
39
  documents?: Document[];
40
40
  subscriptions?: Subscription[];
41
41
  supportPhoneNumber?: string;
42
+ operatorsActive?: boolean;
42
43
 
43
44
  constructor(
44
45
  id:string,
@@ -101,30 +101,27 @@ export default class GarageService {
101
101
  });
102
102
  }
103
103
 
104
- static deleteGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
104
+ static deleteGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>> {
105
105
  return request({
106
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations-type`,
106
+ url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations/${prestationId}`,
107
107
  method: APIMethod.DELETE,
108
- appType: MovaAppType.GARAGE,
109
- body: JSON.stringify(req)
108
+ appType: MovaAppType.GARAGE
110
109
  });
111
110
  }
112
111
 
113
- static createGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
112
+ static createGarageEmployeePrestation(garageId: string, employeeId: string, prestationId: string): Promise<APIResponse<string>> {
114
113
  return request({
115
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations-type`,
114
+ url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations/${prestationId}`,
116
115
  method: APIMethod.POST,
117
- appType: MovaAppType.GARAGE,
118
- body: JSON.stringify(req)
116
+ appType: MovaAppType.GARAGE
119
117
  });
120
118
  }
121
119
 
122
- static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
120
+ static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, absenceId: string): Promise<APIResponse<string>> {
123
121
  return request({
124
- url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/absences`,
122
+ url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/absences/${absenceId}`,
125
123
  method: APIMethod.DELETE,
126
- appType: MovaAppType.GARAGE,
127
- body: JSON.stringify(req)
124
+ appType: MovaAppType.GARAGE
128
125
  });
129
126
  }
130
127