@movalib/movalib-commons 1.0.27 → 1.0.28

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/index.d.ts CHANGED
@@ -9,6 +9,6 @@ export { default as Role } from './src/models/Role';
9
9
  export { default as Address } from './src/models/Address';
10
10
  export { default as Vehicle } from './src/models/Vehicle';
11
11
  export { default as Document } from './src/models/Document';
12
- export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm } from './src/helpers/Types';
12
+ export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval } from './src/helpers/Types';
13
13
  export { validateField } from './src/helpers/Tools';
14
14
  export { RoleType, MovaAppType } from './src/helpers/Enums';
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Type utilisé pour définir un interval sur une objet Schedule
3
+ */
4
+ export type MovaInterval = {
5
+ start: Date | string | null;
6
+ end: Date | string | null;
7
+ };
1
8
  export type MovaUserSignUpForm = {
2
9
  firstname: MovaFormField;
3
10
  lastname: MovaFormField;
@@ -0,0 +1,15 @@
1
+ import Address from "./Address";
2
+ import Schedule from "./Schedule";
3
+ import Prestation from "./Prestation";
4
+ export default class Garage {
5
+ id: string;
6
+ adminId: string;
7
+ name: string;
8
+ address: Address;
9
+ contactPhone: string;
10
+ prestations: Prestation[];
11
+ schedules: Schedule[];
12
+ contactEmail?: string;
13
+ logo?: string;
14
+ constructor(id: string, adminId: string, name: string, address: Address, prestations: Prestation[], schedules: Schedule[], contactPhone: string, contactEmail?: string, logo?: string);
15
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Garage = /** @class */ (function () {
4
+ function Garage(id, adminId, name, address, prestations, schedules, contactPhone, contactEmail, logo) {
5
+ this.id = id;
6
+ this.adminId = adminId;
7
+ this.name = name;
8
+ this.address = address;
9
+ this.prestations = prestations;
10
+ this.schedules = schedules;
11
+ this.contactPhone = contactPhone;
12
+ this.contactEmail = contactEmail;
13
+ this.logo = logo;
14
+ }
15
+ return Garage;
16
+ }());
17
+ exports.default = Garage;
@@ -0,0 +1,15 @@
1
+ export default class Prestation {
2
+ id: number;
3
+ name: string;
4
+ description: string;
5
+ category: string;
6
+ /**
7
+ * Temps d'immobilisation pour ce service (en H)
8
+ */
9
+ downtime: number;
10
+ /**
11
+ * Options éventuelles selon le service (AV / AR / Géométrie, etc..)
12
+ */
13
+ options?: string[];
14
+ constructor(id: number, name: string, description: string, category: string, downtime: number, options?: string[]);
15
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Prestation = /** @class */ (function () {
4
+ /* cost: number; // Le coût de chaque service
5
+ parts: [ // Les pièces nécessaires pour ce service
6
+ {
7
+ id: number,
8
+ name: string,
9
+ cost: number, // Le coût de chaque pièce
10
+ // autres informations sur la pièce...
11
+ }; */
12
+ function Prestation(id, name, description, category, downtime, options) {
13
+ this.id = id;
14
+ this.name = name;
15
+ this.description = description;
16
+ this.category = category;
17
+ this.downtime = downtime;
18
+ this.options = options;
19
+ }
20
+ return Prestation;
21
+ }());
22
+ exports.default = Prestation;
@@ -0,0 +1,6 @@
1
+ import { MovaInterval } from "../helpers/Types";
2
+ export default class Schedule {
3
+ day: number;
4
+ intervals: MovaInterval[];
5
+ constructor(day: number, intervals: MovaInterval[]);
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Schedule = /** @class */ (function () {
4
+ function Schedule(day, intervals) {
5
+ this.day = day;
6
+ this.intervals = intervals;
7
+ }
8
+ return Schedule;
9
+ }());
10
+ exports.default = Schedule;
package/index.ts CHANGED
@@ -16,7 +16,7 @@ export { default as Vehicle } from './src/models/Vehicle';
16
16
  export { default as Document } from './src/models/Document';
17
17
 
18
18
  // Export des types
19
- export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm } from './src/helpers/Types';
19
+ export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval } from './src/helpers/Types';
20
20
 
21
21
  // Export des méthodes utilitaires
22
22
  export { validateField } from './src/helpers/Tools';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
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,3 +1,12 @@
1
+
2
+ /**
3
+ * Type utilisé pour définir un interval sur une objet Schedule
4
+ */
5
+ export type MovaInterval = {
6
+ start: Date | string | null,
7
+ end: Date | string | null
8
+ }
9
+
1
10
  export type MovaUserSignUpForm = {
2
11
  firstname: MovaFormField,
3
12
  lastname: MovaFormField,
@@ -0,0 +1,38 @@
1
+ import Address from "./Address";
2
+ import Schedule from "./Schedule";
3
+ import Prestation from "./Prestation";
4
+
5
+ export default class Garage {
6
+
7
+ id:string;
8
+ adminId:string;
9
+ name:string;
10
+ address:Address;
11
+ contactPhone: string;
12
+ prestations: Prestation[];
13
+ schedules: Schedule[];
14
+ contactEmail?: string;
15
+ logo?: string;
16
+
17
+ constructor(
18
+ id:string,
19
+ adminId:string,
20
+ name:string,
21
+ address:Address,
22
+ prestations: Prestation[],
23
+ schedules: Schedule[],
24
+ contactPhone: string,
25
+ contactEmail?: string,
26
+ logo?:string
27
+ ) {
28
+ this.id = id;
29
+ this.adminId = adminId;
30
+ this.name = name;
31
+ this.address = address;
32
+ this.prestations = prestations;
33
+ this.schedules = schedules;
34
+ this.contactPhone = contactPhone;
35
+ this.contactEmail = contactEmail;
36
+ this.logo = logo;
37
+ }
38
+ }
@@ -0,0 +1,35 @@
1
+ export default class Prestation {
2
+
3
+ // Properties
4
+ id: number;
5
+ name: string;
6
+ description: string;
7
+ category: string;
8
+ /**
9
+ * Temps d'immobilisation pour ce service (en H)
10
+ */
11
+ downtime: number;
12
+ /**
13
+ * Options éventuelles selon le service (AV / AR / Géométrie, etc..)
14
+ */
15
+ options?: string[];
16
+
17
+ /* cost: number; // Le coût de chaque service
18
+ parts: [ // Les pièces nécessaires pour ce service
19
+ {
20
+ id: number,
21
+ name: string,
22
+ cost: number, // Le coût de chaque pièce
23
+ // autres informations sur la pièce...
24
+ }; */
25
+
26
+ constructor(id:number, name:string, description: string, category:string,
27
+ downtime:number, options?:string[]) {
28
+ this.id = id;
29
+ this.name = name;
30
+ this.description = description;
31
+ this.category = category;
32
+ this.downtime = downtime;
33
+ this.options = options;
34
+ }
35
+ }
@@ -0,0 +1,13 @@
1
+ import { MovaInterval } from "../helpers/Types";
2
+
3
+ export default class Schedule {
4
+
5
+ // Properties
6
+ day: number;
7
+ intervals: MovaInterval[];
8
+
9
+ constructor(day: number, intervals: MovaInterval[]) {
10
+ this.day = day;
11
+ this.intervals = intervals;
12
+ }
13
+ }