shared-ritm 1.2.134 → 1.2.135

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,18 +1,18 @@
1
1
  import ApiService from '../settings/ApiService';
2
- import { Api_Schedule_Add_Shift, Api_Schedule_Complete_Brigade, Api_Schedule_Config, Api_Schedule_Edit_Shifts, Api_Schedule_Swap_Shifts, Api_Schedule_Table_Brigade } from '@/api/types/Api_Schedule';
2
+ import { Api_Schedule_Add_Shift, Api_Schedule_Complete_Brigade, Api_Schedule_Config, Api_Schedule_Edit_Shifts, Api_Schedule_Item, Api_Schedule_Swap_Shifts, Api_Schedule_Table_Brigade } from '@/api/types/Api_Schedule';
3
3
  declare class ScheduleService extends ApiService {
4
4
  fetchScheduleConfig(): Promise<Api_Schedule_Config>;
5
- fetchSchedule(id: string): Promise<any>;
6
- fetchScheduleTable(id: string): Promise<any>;
5
+ fetchSchedule(id: string): Promise<Api_Schedule_Item[]>;
6
+ fetchScheduleTable(id: string): Promise<Api_Schedule_Table_Brigade[]>;
7
7
  completeBrigadeSchedule(id: string, body: Api_Schedule_Complete_Brigade): Promise<Api_Schedule_Table_Brigade>;
8
8
  autocompleteBrigadesSchedule(id: string, body: {
9
9
  shifts: string[];
10
- }): Promise<any>;
11
- addBrigadeShift(id: string, body: Api_Schedule_Add_Shift): Promise<any>;
12
- swapBrigadeShifts(id: string, body: Api_Schedule_Swap_Shifts): Promise<any>;
10
+ }): Promise<Api_Schedule_Item[]>;
11
+ addBrigadeShift(id: string, body: Api_Schedule_Add_Shift): Promise<Api_Schedule_Item[]>;
12
+ swapBrigadeShifts(id: string, body: Api_Schedule_Swap_Shifts): Promise<Api_Schedule_Item[]>;
13
13
  editBrigadeShifts(id: string, body: Api_Schedule_Edit_Shifts): Promise<any>;
14
14
  deleteBrigadeShifts(id: string, shift_ids: string[]): Promise<any>;
15
- deleteBrigadesFromSchedule(id: string, brigade_ids: string[]): Promise<any>;
15
+ deleteBrigadesFromSchedule(id: string, brigade_ids: string[]): Promise<string>;
16
16
  }
17
17
  export default function useScheduleService(): ScheduleService;
18
18
  export {};
@@ -48,6 +48,7 @@ export type Api_Project_Dto = {
48
48
  status: Api_Project_Status;
49
49
  category: Api_Project_Category;
50
50
  repair: Api_Project_Repair | null;
51
+ schedule_id: string | null;
51
52
  };
52
53
  export type Api_Project_Add_Root_Intervals_Payload = {
53
54
  history: number;
@@ -38,3 +38,16 @@ export type Api_Schedule_Edit_Shifts = {
38
38
  shift_ids: string[];
39
39
  shift_template_id: string;
40
40
  };
41
+ export type Api_Schedule_Shift = {
42
+ id: string;
43
+ from: string;
44
+ to: string;
45
+ shift_template: Api_Schedule_Shift_Template;
46
+ };
47
+ export type Api_Schedule_Item = {
48
+ brigade: Api_Schedule_Table_Brigade;
49
+ shifts: {
50
+ date: string;
51
+ shift: Api_Schedule_Shift;
52
+ }[];
53
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.134",
3
+ "version": "1.2.135",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -4,6 +4,7 @@ import {
4
4
  Api_Schedule_Complete_Brigade,
5
5
  Api_Schedule_Config,
6
6
  Api_Schedule_Edit_Shifts,
7
+ Api_Schedule_Item,
7
8
  Api_Schedule_Swap_Shifts,
8
9
  Api_Schedule_Table_Brigade,
9
10
  } from '@/api/types/Api_Schedule'
@@ -13,12 +14,12 @@ class ScheduleService extends ApiService {
13
14
  return this.get<Api_Schedule_Config>('schedule/config')
14
15
  }
15
16
 
16
- public fetchSchedule(id: string): Promise<any> {
17
- return this.get<any>(`schedule/${id}`)
17
+ public fetchSchedule(id: string): Promise<Api_Schedule_Item[]> {
18
+ return this.get<Api_Schedule_Item[]>(`schedule/${id}`)
18
19
  }
19
20
 
20
- public fetchScheduleTable(id: string): Promise<any> {
21
- return this.get<any>(`schedule/${id}/get_brigades_table`)
21
+ public fetchScheduleTable(id: string): Promise<Api_Schedule_Table_Brigade[]> {
22
+ return this.get<Api_Schedule_Table_Brigade[]>(`schedule/${id}/get_brigades_table`)
22
23
  }
23
24
 
24
25
  public completeBrigadeSchedule(id: string, body: Api_Schedule_Complete_Brigade): Promise<Api_Schedule_Table_Brigade> {
@@ -28,15 +29,15 @@ class ScheduleService extends ApiService {
28
29
  )
29
30
  }
30
31
 
31
- public autocompleteBrigadesSchedule(id: string, body: { shifts: string[] }): Promise<any> {
32
+ public autocompleteBrigadesSchedule(id: string, body: { shifts: string[] }): Promise<Api_Schedule_Item[]> {
32
33
  return this.post(`schedule/${id}/autocomplete`, body)
33
34
  }
34
35
 
35
- public addBrigadeShift(id: string, body: Api_Schedule_Add_Shift): Promise<any> {
36
+ public addBrigadeShift(id: string, body: Api_Schedule_Add_Shift): Promise<Api_Schedule_Item[]> {
36
37
  return this.post(`schedule/${id}/shifts`, body)
37
38
  }
38
39
 
39
- public swapBrigadeShifts(id: string, body: Api_Schedule_Swap_Shifts): Promise<any> {
40
+ public swapBrigadeShifts(id: string, body: Api_Schedule_Swap_Shifts): Promise<Api_Schedule_Item[]> {
40
41
  return this.patch(`schedule/${id}/shifts/switch_shift_templates`, body)
41
42
  }
42
43
 
@@ -48,7 +49,7 @@ class ScheduleService extends ApiService {
48
49
  return this.delete(`schedule/${id}/shifts`, { data: { shift_ids } })
49
50
  }
50
51
 
51
- public deleteBrigadesFromSchedule(id: string, brigade_ids: string[]): Promise<any> {
52
+ public deleteBrigadesFromSchedule(id: string, brigade_ids: string[]): Promise<string> {
52
53
  return this.patch(`schedule/${id}/delete_brigades`, { brigade_ids })
53
54
  }
54
55
  }
@@ -52,6 +52,7 @@ export type Api_Project_Dto = {
52
52
  status: Api_Project_Status
53
53
  category: Api_Project_Category
54
54
  repair: Api_Project_Repair | null
55
+ schedule_id: string | null
55
56
  }
56
57
 
57
58
  export type Api_Project_Add_Root_Intervals_Payload = {
@@ -44,3 +44,15 @@ export type Api_Schedule_Edit_Shifts = {
44
44
  shift_ids: string[]
45
45
  shift_template_id: string
46
46
  }
47
+
48
+ export type Api_Schedule_Shift = {
49
+ id: string
50
+ from: string
51
+ to: string
52
+ shift_template: Api_Schedule_Shift_Template
53
+ }
54
+
55
+ export type Api_Schedule_Item = {
56
+ brigade: Api_Schedule_Table_Brigade
57
+ shifts: { date: string; shift: Api_Schedule_Shift }[]
58
+ }