shared-ritm 1.1.46 → 1.1.47

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.
@@ -4,6 +4,7 @@ declare class RepairsService extends ApiService {
4
4
  fetchFilters(fullParams: string): Promise<OptionFilters>;
5
5
  fetchRepairs(isQuery: boolean, queries?: string, hasTeams?: boolean | string, teamsFilter?: string, typeFilter?: string): Promise<ResponseApi<Api_Repair_Dto[]>>;
6
6
  fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>>;
7
+ fetchEquipmentPagination(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>>;
7
8
  createRepair(payload: Api_Create_Repair_With_Equipments): Promise<any>;
8
9
  startRepair(id: string): Promise<void>;
9
10
  finishRepair(id: string): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.1.46",
3
+ "version": "1.1.47",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,98 +1,102 @@
1
- import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
- import {
3
- Api_Create_Repair_With_Equipments,
4
- Api_Equipment_Full_Dto,
5
- Api_Repair_Dto,
6
- Api_Update_Repair,
7
- OptionFilters,
8
- } from '@/api/types/Api_Repairs'
9
-
10
- class RepairsService extends ApiService {
11
- public fetchFilters(fullParams: string): Promise<OptionFilters> {
12
- return this.get(`get_list_repair?smart=1&${fullParams}`)
13
- }
14
-
15
- public fetchRepairs(
16
- isQuery: boolean,
17
- queries?: string,
18
- hasTeams?: boolean | string,
19
- teamsFilter?: string,
20
- typeFilter?: string,
21
- ): Promise<ResponseApi<Api_Repair_Dto[]>> {
22
- return this.get(
23
- 'get_list_repair' +
24
- (isQuery
25
- ? `${queries}&per_page=100000${typeFilter ? '&' + typeFilter : ''}&${!hasTeams ? teamsFilter : ''}`
26
- : `?per_page=100000${typeFilter ? '&' + typeFilter : ''}&${teamsFilter}`),
27
- )
28
- }
29
-
30
- public fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
31
- return this.get('repairs/equipment/list?per_page=100000')
32
- }
33
-
34
- public createRepair(payload: Api_Create_Repair_With_Equipments) {
35
- return this.post<Api_Create_Repair_With_Equipments, any>('/repairs/equipments', payload)
36
- }
37
-
38
- public startRepair(id: string): Promise<void> {
39
- return this.post<null, void>(`/repairs/${id}/start`, null)
40
- }
41
-
42
- public finishRepair(id: string) {
43
- return this.post<null, void>(`/repairs/${id}/finish`, null)
44
- }
45
-
46
- public finishPreparationProject(id: string) {
47
- return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
48
- }
49
-
50
- public moveRepairToCurrent(id: string) {
51
- return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
52
- repairs: [id],
53
- })
54
- }
55
-
56
- public moveArchiveToCurrent(id: string) {
57
- return this.post<any, void>(`/repairs/transfer_repair_archive_to_current`, {
58
- repairs_ids: [id],
59
- })
60
- }
61
-
62
- public moveRepairToApr(id: string) {
63
- return this.post<any, void>(`/repairs/transfer_repair_current_to_plan`, {
64
- repairs: [id],
65
- })
66
- }
67
-
68
- public moveRepairToArchive(id: string) {
69
- return this.post<any, void>(`/repairs/transfer_repair_current_to_archive`, {
70
- repairs_ids: [id],
71
- })
72
- }
73
-
74
- public restoreRepair(id: string) {
75
- return this.post<any, void>(`/restore_repair`, {
76
- repairs_ids: [id],
77
- })
78
- }
79
-
80
- public updateRepair(payload: Api_Update_Repair, id: string) {
81
- return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
82
- }
83
-
84
- public copyRepair(id: string) {
85
- return this.post<null, any>(`/repairs/${id}/clone`, null)
86
- }
87
-
88
- public deleteRepair(id: string) {
89
- return this.delete<any>(`/repairs/${id}`)
90
- }
91
- }
92
-
93
- let api: RepairsService
94
-
95
- export default function useRepairsService() {
96
- if (!api) api = new RepairsService()
97
- return api
98
- }
1
+ import ApiService, { ResponseApi } from '@/api/settings/ApiService'
2
+ import {
3
+ Api_Create_Repair_With_Equipments,
4
+ Api_Equipment_Full_Dto,
5
+ Api_Repair_Dto,
6
+ Api_Update_Repair,
7
+ OptionFilters,
8
+ } from '@/api/types/Api_Repairs'
9
+
10
+ class RepairsService extends ApiService {
11
+ public fetchFilters(fullParams: string): Promise<OptionFilters> {
12
+ return this.get(`get_list_repair?smart=1&${fullParams}`)
13
+ }
14
+
15
+ public fetchRepairs(
16
+ isQuery: boolean,
17
+ queries?: string,
18
+ hasTeams?: boolean | string,
19
+ teamsFilter?: string,
20
+ typeFilter?: string,
21
+ ): Promise<ResponseApi<Api_Repair_Dto[]>> {
22
+ return this.get(
23
+ 'get_list_repair' +
24
+ (isQuery
25
+ ? `${queries}&per_page=100000${typeFilter ? '&' + typeFilter : ''}&${!hasTeams ? teamsFilter : ''}`
26
+ : `?per_page=100000${typeFilter ? '&' + typeFilter : ''}&${teamsFilter}`),
27
+ )
28
+ }
29
+
30
+ public fetchEquipment(): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
31
+ return this.get('repairs/equipment/list?per_page=100000')
32
+ }
33
+
34
+ public fetchEquipmentPagination(params: any): Promise<ResponseApi<Api_Equipment_Full_Dto[]>> {
35
+ return this.get('repairs/equipment/list', { params })
36
+ }
37
+
38
+ public createRepair(payload: Api_Create_Repair_With_Equipments) {
39
+ return this.post<Api_Create_Repair_With_Equipments, any>('/repairs/equipments', payload)
40
+ }
41
+
42
+ public startRepair(id: string): Promise<void> {
43
+ return this.post<null, void>(`/repairs/${id}/start`, null)
44
+ }
45
+
46
+ public finishRepair(id: string) {
47
+ return this.post<null, void>(`/repairs/${id}/finish`, null)
48
+ }
49
+
50
+ public finishPreparationProject(id: string) {
51
+ return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
52
+ }
53
+
54
+ public moveRepairToCurrent(id: string) {
55
+ return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
56
+ repairs: [id],
57
+ })
58
+ }
59
+
60
+ public moveArchiveToCurrent(id: string) {
61
+ return this.post<any, void>(`/repairs/transfer_repair_archive_to_current`, {
62
+ repairs_ids: [id],
63
+ })
64
+ }
65
+
66
+ public moveRepairToApr(id: string) {
67
+ return this.post<any, void>(`/repairs/transfer_repair_current_to_plan`, {
68
+ repairs: [id],
69
+ })
70
+ }
71
+
72
+ public moveRepairToArchive(id: string) {
73
+ return this.post<any, void>(`/repairs/transfer_repair_current_to_archive`, {
74
+ repairs_ids: [id],
75
+ })
76
+ }
77
+
78
+ public restoreRepair(id: string) {
79
+ return this.post<any, void>(`/restore_repair`, {
80
+ repairs_ids: [id],
81
+ })
82
+ }
83
+
84
+ public updateRepair(payload: Api_Update_Repair, id: string) {
85
+ return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
86
+ }
87
+
88
+ public copyRepair(id: string) {
89
+ return this.post<null, any>(`/repairs/${id}/clone`, null)
90
+ }
91
+
92
+ public deleteRepair(id: string) {
93
+ return this.delete<any>(`/repairs/${id}`)
94
+ }
95
+ }
96
+
97
+ let api: RepairsService
98
+
99
+ export default function useRepairsService() {
100
+ if (!api) api = new RepairsService()
101
+ return api
102
+ }
@@ -1,63 +1,63 @@
1
- export type Api_Team = {
2
- id: string
3
- display_name: string
4
- }
5
-
6
- export type Api_Equipment_Short_Dto = {
7
- id: string
8
- name: string
9
- }
10
-
11
- export type Api_Repairs = {
12
- id: string
13
- name: string
14
- }
15
-
16
- export type Api_Projects = {
17
- id: string
18
- name: string
19
- }
20
-
21
- export type OptionFilters = {
22
- teams?: Api_Team[]
23
- equipments?: Api_Equipment_Short_Dto[]
24
- }
25
-
26
- export type Api_Equipment_Full_Dto = {
27
- id: string
28
- model: null | string
29
- name: string
30
- registration_number: string
31
- repair_frequency: number
32
- repair_range: number
33
- }
34
-
35
- export type Api_Create_Repair_With_Equipments = {
36
- name: string
37
- display_name: string
38
- description: string
39
- equipment_id: string
40
- power_output_MWh?: number
41
- cost_per_MWh?: number
42
- category?: string
43
- }
44
-
45
- export type Api_Update_Repair = {
46
- name?: string
47
- display_name?: string
48
- description: string
49
- power_output_MWh?: number
50
- cost_per_MWh?: number
51
- category?: string
52
- }
53
-
54
- export type Api_Repair_Dto = {
55
- id: string
56
- name: string
57
- display_name: string
58
- description: string
59
- start_date: string
60
- end_date: string
61
- projects: Api_Projects[]
62
- equipments: Api_Equipment_Full_Dto[]
63
- }
1
+ export type Api_Team = {
2
+ id: string
3
+ display_name: string
4
+ }
5
+
6
+ export type Api_Equipment_Short_Dto = {
7
+ id: string
8
+ name: string
9
+ }
10
+
11
+ export type Api_Repairs = {
12
+ id: string
13
+ name: string
14
+ }
15
+
16
+ export type Api_Projects = {
17
+ id: string
18
+ name: string
19
+ }
20
+
21
+ export type OptionFilters = {
22
+ teams?: Api_Team[]
23
+ equipments?: Api_Equipment_Short_Dto[]
24
+ }
25
+
26
+ export type Api_Equipment_Full_Dto = {
27
+ id: string
28
+ model: null | string
29
+ name: string
30
+ registration_number: string
31
+ repair_frequency: number
32
+ repair_range: number
33
+ }
34
+
35
+ export type Api_Create_Repair_With_Equipments = {
36
+ name: string
37
+ display_name: string
38
+ description: string
39
+ equipment_id: string
40
+ power_output_MWh?: number
41
+ cost_per_MWh?: number
42
+ category?: string
43
+ }
44
+
45
+ export type Api_Update_Repair = {
46
+ name?: string
47
+ display_name?: string
48
+ description: string
49
+ power_output_MWh?: number
50
+ cost_per_MWh?: number
51
+ category?: string
52
+ }
53
+
54
+ export type Api_Repair_Dto = {
55
+ id: string
56
+ name: string
57
+ display_name: string
58
+ description: string
59
+ start_date: string
60
+ end_date: string
61
+ projects: Api_Projects[]
62
+ equipments: Api_Equipment_Full_Dto[]
63
+ }