shared-ritm 1.2.59 → 1.2.60

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.
@@ -0,0 +1,7 @@
1
+ import ApiService from '@/api/settings/ApiService';
2
+ import { InstrumentHistoryParams, InstrumentHistoryResponse } from '@/api/types/Api_Instruments';
3
+ declare class InstrumentsService extends ApiService {
4
+ fetchUserInstrumentsHistory(id: string, params: InstrumentHistoryParams): Promise<InstrumentHistoryResponse>;
5
+ }
6
+ export default function useInstrumentsService(): InstrumentsService;
7
+ export {};
@@ -0,0 +1,133 @@
1
+ type InstrumentStorage = {
2
+ id: string;
3
+ created_at: string;
4
+ deleted_at: string | null;
5
+ updated_at: string;
6
+ description: string;
7
+ name: string;
8
+ title: string;
9
+ parent: unknown | null;
10
+ parents: unknown[];
11
+ state_id: unknown | null;
12
+ };
13
+ type InstrumentType = {
14
+ id: string;
15
+ name: string;
16
+ created_at: string;
17
+ updated_at: string;
18
+ deleted_at: string | null;
19
+ icon: string;
20
+ storage_id: string;
21
+ storage: InstrumentStorage;
22
+ };
23
+ type InstrumentLocation = {
24
+ id: string;
25
+ name: string;
26
+ title: string;
27
+ description: string;
28
+ created_at: string;
29
+ updated_at: string;
30
+ deleted_at: string | null;
31
+ state_id: unknown | null;
32
+ };
33
+ type UserTeam = {
34
+ id: string;
35
+ name: string;
36
+ display_name: string;
37
+ description: string;
38
+ created_at: string;
39
+ updated_at: string;
40
+ pivot: {
41
+ team_id: string;
42
+ user_id: string;
43
+ };
44
+ };
45
+ type InstrumentStatus = {
46
+ id: string;
47
+ description: string;
48
+ name: string;
49
+ title: string;
50
+ created_at: string;
51
+ updated_at: string;
52
+ deleted_at: string | null;
53
+ };
54
+ type InstrumentResponsible = {
55
+ id: string;
56
+ RFID: string;
57
+ avatar: unknown | null;
58
+ avatar_id: string | null;
59
+ change_password: string;
60
+ created_at: string;
61
+ updated_at: string;
62
+ deleted_at: string | null;
63
+ dismissal_at: string | null;
64
+ email_verified_at: string;
65
+ divisions: string;
66
+ email: string;
67
+ face_recognition_id: string | null;
68
+ first_name: string;
69
+ full_name: string;
70
+ last_name: string;
71
+ patronymic: string;
72
+ personnel_number: number;
73
+ phone: string;
74
+ profession: string;
75
+ teams: UserTeam[];
76
+ };
77
+ type Instrument = {
78
+ id: string;
79
+ RFID: string | null;
80
+ instrument_id: string;
81
+ arrival_at: string;
82
+ created_at: string;
83
+ supply_at: string;
84
+ updated_at: string;
85
+ deleted_at: string | null;
86
+ inventory_number: string;
87
+ instrument_type: InstrumentType;
88
+ invoice_ref_key: string;
89
+ last_status_updated_at: string;
90
+ location_id: string;
91
+ location: InstrumentLocation;
92
+ misplacement: boolean;
93
+ module: string | null;
94
+ module_id: string | null;
95
+ name: string;
96
+ pressure: unknown | null;
97
+ registry_module_id: string;
98
+ responsible_id: string;
99
+ responsible: InstrumentResponsible;
100
+ status: InstrumentStatus;
101
+ status_id: string;
102
+ storage: InstrumentStorage;
103
+ supervisor: unknown | null;
104
+ supervisor_id: string;
105
+ type: unknown | null;
106
+ weight: unknown | null;
107
+ };
108
+ export type InstrumentHistoryParams = {
109
+ status?: string;
110
+ page?: number;
111
+ desc?: string;
112
+ column?: string;
113
+ };
114
+ export type InstrumentHistoryResponse = {
115
+ data: Instrument[];
116
+ from: number;
117
+ to: number;
118
+ total: number;
119
+ per_page: number;
120
+ current_page: number;
121
+ last_page: number;
122
+ last_page_url: string;
123
+ first_page_url: string;
124
+ next_page_url: string | null;
125
+ prev_page_url: string | null;
126
+ path: string;
127
+ links: {
128
+ label: string;
129
+ url: string;
130
+ active: boolean;
131
+ }[];
132
+ };
133
+ export {};
@@ -29,10 +29,11 @@ import useTasksService from '@/api/services/TasksService';
29
29
  import useAuthService from '@/api/services/AuthService';
30
30
  import useFileService from '@/api/services/FileService';
31
31
  import useVideoService from '@/api/services/VideoService';
32
+ import useInstrumentsService from '@/api/services/InstrumentsService';
32
33
  import ApiService from '@/api/settings/ApiService';
33
34
  import useControlsService from '@/api/services/ControlsService';
34
35
  export { AppButton, AppCheckbox, AppDatePicker, AppInput, AppInputSearch, AppLayout, AppLayoutHeader, AppLayoutPage, AppLoader, AppSelect, AppSheet, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, AppDropdown, AppTablePagination, AppTableSearch, AppTableModal, AppTable, AppTableLayout, AppModalSelect, };
35
- export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, };
36
+ export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useInstrumentsService, };
36
37
  export { useBaseTable } from './common/app-table/controllers/useBaseTable';
37
38
  export { useTableModel } from './common/app-table/controllers/useTableModel';
38
39
  export { useColumnSelector } from './common/app-table/controllers/useColumnSelector';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.59",
3
+ "version": "1.2.60",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -0,0 +1,22 @@
1
+ import ApiService from '@/api/settings/ApiService'
2
+ import { InstrumentHistoryResponse } from '@/api/types/Api_Instruments'
3
+
4
+ class InstrumentsService extends ApiService {
5
+ public async fetchUserInstrumentsHistory(id: string, page: number): Promise<InstrumentHistoryResponse> {
6
+ const params = {
7
+ status: 'issued',
8
+ page,
9
+ desc: 'desc',
10
+ column: 'updated_at',
11
+ }
12
+
13
+ return await this.get(`users/${id}/instruments`, { params })
14
+ }
15
+ }
16
+
17
+ let api: InstrumentsService
18
+
19
+ export default function useInstrumentsService() {
20
+ if (!api) api = new InstrumentsService()
21
+ return api
22
+ }
@@ -0,0 +1,133 @@
1
+ type InstrumentStorage = {
2
+ id: string
3
+ created_at: string
4
+ deleted_at: string | null
5
+ updated_at: string
6
+ description: string
7
+ name: string
8
+ title: string
9
+ parent: unknown | null
10
+ parents: unknown[]
11
+ state_id: unknown | null
12
+ }
13
+
14
+ type InstrumentType = {
15
+ id: string
16
+ name: string
17
+ created_at: string
18
+ updated_at: string
19
+ deleted_at: string | null
20
+ icon: string
21
+ storage_id: string
22
+ storage: InstrumentStorage
23
+ }
24
+
25
+ type InstrumentLocation = {
26
+ id: string
27
+ name: string
28
+ title: string
29
+ description: string
30
+ created_at: string
31
+ updated_at: string
32
+ deleted_at: string | null
33
+ state_id: unknown | null
34
+ }
35
+
36
+ type UserTeam = {
37
+ id: string
38
+ name: string
39
+ display_name: string
40
+ description: string
41
+ created_at: string
42
+ updated_at: string
43
+ pivot: {
44
+ team_id: string
45
+ user_id: string
46
+ }
47
+ }
48
+
49
+ type InstrumentStatus = {
50
+ id: string
51
+ description: string
52
+ name: string
53
+ title: string
54
+ created_at: string
55
+ updated_at: string
56
+ deleted_at: string | null
57
+ }
58
+
59
+ type InstrumentResponsible = {
60
+ id: string
61
+ RFID: string
62
+ avatar: unknown | null
63
+ avatar_id: string | null
64
+ change_password: string
65
+ created_at: string
66
+ updated_at: string
67
+ deleted_at: string | null
68
+ dismissal_at: string | null
69
+ email_verified_at: string
70
+ divisions: string
71
+ email: string
72
+ face_recognition_id: string | null
73
+ first_name: string
74
+ full_name: string
75
+ last_name: string
76
+ patronymic: string
77
+ personnel_number: number
78
+ phone: string
79
+ profession: string
80
+ teams: UserTeam[]
81
+ }
82
+
83
+ type Instrument = {
84
+ id: string
85
+ RFID: string | null
86
+ instrument_id: string
87
+ arrival_at: string
88
+ created_at: string
89
+ supply_at: string
90
+ updated_at: string
91
+ deleted_at: string | null
92
+ inventory_number: string
93
+ instrument_type: InstrumentType
94
+ invoice_ref_key: string
95
+ last_status_updated_at: string
96
+ location_id: string
97
+ location: InstrumentLocation
98
+ misplacement: boolean
99
+ module: string | null
100
+ module_id: string | null
101
+ name: string
102
+ pressure: unknown | null
103
+ registry_module_id: string
104
+ responsible_id: string
105
+ responsible: InstrumentResponsible
106
+ status: InstrumentStatus
107
+ status_id: string
108
+ storage: InstrumentStorage
109
+ supervisor: unknown | null
110
+ supervisor_id: string
111
+ type: unknown | null
112
+ weight: unknown | null
113
+ }
114
+
115
+ export type InstrumentHistoryResponse = {
116
+ data: Instrument[]
117
+ from: number
118
+ to: number
119
+ total: number
120
+ per_page: number
121
+ current_page: number
122
+ last_page: number
123
+ last_page_url: string
124
+ first_page_url: string
125
+ next_page_url: string | null
126
+ prev_page_url: string | null
127
+ path: string
128
+ links: {
129
+ label: string
130
+ url: string
131
+ active: boolean
132
+ }[]
133
+ }
package/src/index.ts CHANGED
@@ -30,6 +30,7 @@ import useTasksService from '@/api/services/TasksService'
30
30
  import useAuthService from '@/api/services/AuthService'
31
31
  import useFileService from '@/api/services/FileService'
32
32
  import useVideoService from '@/api/services/VideoService'
33
+ import useInstrumentsService from '@/api/services/InstrumentsService'
33
34
  import ApiService from '@/api/settings/ApiService'
34
35
  import useControlsService from '@/api/services/ControlsService'
35
36
 
@@ -69,6 +70,7 @@ export {
69
70
  useFileService,
70
71
  useControlsService,
71
72
  useVideoService,
73
+ useInstrumentsService,
72
74
  }
73
75
  export { useBaseTable } from './common/app-table/controllers/useBaseTable'
74
76
  export { useTableModel } from './common/app-table/controllers/useTableModel'