shared-ritm 1.2.107 → 1.2.108

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,7 +1,23 @@
1
1
  import ApiService from '../settings/ApiService';
2
- import { Api_instruments_HistoryResponse } from '../types/Api_Instruments';
2
+ import { Api_Instrument, Api_instruments_HistoryResponse, Api_Warehouse_Create, Api_Warehouse_Search, Api_Warehouse_Status_History_Item } from '../types/Api_Instruments';
3
+ import { ResponseApi } from '@/api/types/Api_Service';
3
4
  declare class InstrumentsService extends ApiService {
4
5
  fetchUserInstrumentsHistory(id: string, page?: number): Promise<Api_instruments_HistoryResponse>;
6
+ fetchWarehouses(params: any): Promise<ResponseApi<Api_Warehouse_Search[]>>;
7
+ fetchWarehouse(id: string): Promise<Api_Instrument>;
8
+ fetchStatusHistory(id: string): Promise<Api_Warehouse_Status_History_Item[]>;
9
+ createWarehouse(model: Api_Warehouse_Create): Promise<Api_Instrument>;
10
+ editWarehouse({ id, model, }: {
11
+ id: string;
12
+ model: Partial<Api_Warehouse_Create>;
13
+ }): Promise<Api_Instrument>;
14
+ deleteWarehouse(id: string): Promise<{
15
+ data: boolean;
16
+ status: number;
17
+ }>;
18
+ unsetWarehouseRfid(model: {
19
+ warehouses: string[];
20
+ }): Promise<Api_Warehouse_Search[]>;
5
21
  }
6
22
  export default function useInstrumentsService(): InstrumentsService;
7
23
  export {};
@@ -1,9 +1,10 @@
1
1
  import ApiService from '../settings/ApiService';
2
2
  import { ResponseApi } from '../types/Api_Service';
3
- import { Api_Search_User, Api_Search_Instruments } from '../types/Api_Search';
3
+ import { Api_Search_User, Api_Search_Instruments, Api_Search_Module } from '../types/Api_Search';
4
4
  declare class SearchService extends ApiService {
5
5
  fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>>;
6
6
  fetchSearchInstruments(params: any): Promise<ResponseApi<Api_Search_Instruments[]>>;
7
+ fetchSearchModules(params: any): Promise<ResponseApi<Api_Search_Module[]>>;
7
8
  }
8
9
  export default function useSearchService(): SearchService;
9
10
  export {};
@@ -1,4 +1,6 @@
1
1
  import { Api_User } from '../types/Api_User';
2
+ import { Api_Status_DTO } from '@/api/types/Api_Tasks';
3
+ import { Api_Search_User } from '@/api/types/Api_Search';
2
4
  export type Api_Instrument_Storage = {
3
5
  id: string;
4
6
  created_at: string;
@@ -90,3 +92,27 @@ export type Api_instruments_HistoryResponse = {
90
92
  active: boolean;
91
93
  }[];
92
94
  };
95
+ export type Api_Warehouse_Search = Omit<Api_Instrument, 'created_at' | 'deleted_at' | 'invoice_ref_key' | 'last_status_updated_at' | 'pressure' | 'registry_module_id' | 'supervisor' | 'supervisor_id' | 'type' | 'weight'> & {
96
+ issued_in: unknown | null;
97
+ registry: {
98
+ id: string;
99
+ title: string;
100
+ };
101
+ };
102
+ export type Api_Warehouse_Create = {
103
+ instrument_id: string;
104
+ inventory_number: string;
105
+ module_id?: string;
106
+ registry_module_id?: string;
107
+ };
108
+ export type Api_Warehouse_Status_History_Item = {
109
+ old_status: Api_Status_DTO;
110
+ new_status: Api_Status_DTO;
111
+ created_at: string;
112
+ responsible: Omit<Api_Search_User, 'photos' | 'divisions' | 'passes'> & {
113
+ roles: {
114
+ id: string;
115
+ display_name: string;
116
+ }[];
117
+ };
118
+ };
@@ -1,3 +1,4 @@
1
+ import { Api_Warehouse_Search } from '@/api/types/Api_Instruments';
1
2
  export type Api_Search_User_Passes = {
2
3
  id: string;
3
4
  type: string;
@@ -50,3 +51,18 @@ export type Api_Search_Instruments = {
50
51
  divisions: string;
51
52
  personnel_number: string;
52
53
  };
54
+ export type Api_Search_Module_User = Pick<Api_Search_User, 'id' | 'full_name' | 'email'> & {
55
+ teams: Omit<Api_Search_User_Teams, 'roles'>[];
56
+ };
57
+ export type Api_Search_Module = {
58
+ id: string;
59
+ RFID: string;
60
+ inventory_number: string;
61
+ title: string;
62
+ type: string;
63
+ mac: unknown;
64
+ wlan: unknown;
65
+ warehouses: Api_Warehouse_Search[];
66
+ user: Api_Search_Module_User;
67
+ teams: Omit<Api_Search_User_Teams, 'roles'>[];
68
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.107",
3
+ "version": "1.2.108",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,5 +1,12 @@
1
1
  import ApiService from '../settings/ApiService'
2
- import { Api_instruments_HistoryResponse } from '../types/Api_Instruments'
2
+ import {
3
+ Api_Instrument,
4
+ Api_instruments_HistoryResponse,
5
+ Api_Warehouse_Create,
6
+ Api_Warehouse_Search,
7
+ Api_Warehouse_Status_History_Item,
8
+ } from '../types/Api_Instruments'
9
+ import { ResponseApi } from '@/api/types/Api_Service'
3
10
 
4
11
  class InstrumentsService extends ApiService {
5
12
  public async fetchUserInstrumentsHistory(id: string, page?: number): Promise<Api_instruments_HistoryResponse> {
@@ -12,6 +19,40 @@ class InstrumentsService extends ApiService {
12
19
 
13
20
  return await this.get(`users/${id}/instruments`, { params })
14
21
  }
22
+
23
+ public async fetchWarehouses(params: any): Promise<ResponseApi<Api_Warehouse_Search[]>> {
24
+ return await this.get('search/warehouses', { params })
25
+ }
26
+
27
+ public async fetchWarehouse(id: string): Promise<Api_Instrument> {
28
+ return await this.get(`admin/warehouses/${id}`)
29
+ }
30
+
31
+ public async fetchStatusHistory(id: string): Promise<Api_Warehouse_Status_History_Item[]> {
32
+ return await this.get(`warehouses/${id}/history/status`)
33
+ }
34
+
35
+ public async createWarehouse(model: Api_Warehouse_Create): Promise<Api_Instrument> {
36
+ return await this.post('admin/warehouses', model)
37
+ }
38
+
39
+ public async editWarehouse({
40
+ id,
41
+ model,
42
+ }: {
43
+ id: string
44
+ model: Partial<Api_Warehouse_Create>
45
+ }): Promise<Api_Instrument> {
46
+ return await this.put(`admin/warehouses/${id}`, model)
47
+ }
48
+
49
+ public deleteWarehouse(id: string): Promise<{ data: boolean; status: number }> {
50
+ return this.delete(`admin/warehouses/${id}`)
51
+ }
52
+
53
+ public async unsetWarehouseRfid(model: { warehouses: string[] }): Promise<Api_Warehouse_Search[]> {
54
+ return await this.post('warehouses/unset-rfid', model)
55
+ }
15
56
  }
16
57
 
17
58
  let api: InstrumentsService
@@ -1,13 +1,16 @@
1
1
  import ApiService from '../settings/ApiService'
2
2
  import { ResponseApi } from '../types/Api_Service'
3
- import { Api_Search_User, Api_Search_Instruments } from '../types/Api_Search'
3
+ import { Api_Search_User, Api_Search_Instruments, Api_Search_Module } from '../types/Api_Search'
4
4
 
5
5
  class SearchService extends ApiService {
6
6
  public fetchSearchUsers(params: any): Promise<ResponseApi<Api_Search_User[]>> {
7
7
  return this.get<ResponseApi<Api_Search_User[]>>('search/users', { params })
8
8
  }
9
9
  public fetchSearchInstruments(params: any): Promise<ResponseApi<Api_Search_Instruments[]>> {
10
- return this.get<ResponseApi<Api_Search_User[]>>('search/instrument_type', { params })
10
+ return this.get<ResponseApi<Api_Search_Instruments[]>>('search/instrument_type', { params })
11
+ }
12
+ public fetchSearchModules(params: any): Promise<ResponseApi<Api_Search_Module[]>> {
13
+ return this.get<ResponseApi<Api_Search_Module[]>>('search/modules', { params })
11
14
  }
12
15
  }
13
16
 
@@ -1,4 +1,6 @@
1
1
  import { Api_User } from '../types/Api_User'
2
+ import { Api_Status_DTO } from '@/api/types/Api_Tasks'
3
+ import { Api_Search_User } from '@/api/types/Api_Search'
2
4
 
3
5
  export type Api_Instrument_Storage = {
4
6
  id: string
@@ -96,3 +98,39 @@ export type Api_instruments_HistoryResponse = {
96
98
  active: boolean
97
99
  }[]
98
100
  }
101
+
102
+ export type Api_Warehouse_Search = Omit<
103
+ Api_Instrument,
104
+ | 'created_at'
105
+ | 'deleted_at'
106
+ | 'invoice_ref_key'
107
+ | 'last_status_updated_at'
108
+ | 'pressure'
109
+ | 'registry_module_id'
110
+ | 'supervisor'
111
+ | 'supervisor_id'
112
+ | 'type'
113
+ | 'weight'
114
+ > & {
115
+ issued_in: unknown | null
116
+ registry: {
117
+ id: string
118
+ title: string
119
+ }
120
+ }
121
+
122
+ export type Api_Warehouse_Create = {
123
+ instrument_id: string
124
+ inventory_number: string
125
+ module_id?: string
126
+ registry_module_id?: string
127
+ }
128
+
129
+ export type Api_Warehouse_Status_History_Item = {
130
+ old_status: Api_Status_DTO
131
+ new_status: Api_Status_DTO
132
+ created_at: string
133
+ responsible: Omit<Api_Search_User, 'photos' | 'divisions' | 'passes'> & {
134
+ roles: { id: string; display_name: string }[]
135
+ }
136
+ }
@@ -1,3 +1,5 @@
1
+ import { Api_Warehouse_Search } from '@/api/types/Api_Instruments'
2
+
1
3
  export type Api_Search_User_Passes = {
2
4
  id: string
3
5
  type: string
@@ -56,3 +58,20 @@ export type Api_Search_Instruments = {
56
58
  divisions: string
57
59
  personnel_number: string
58
60
  }
61
+
62
+ export type Api_Search_Module_User = Pick<Api_Search_User, 'id' | 'full_name' | 'email'> & {
63
+ teams: Omit<Api_Search_User_Teams, 'roles'>[]
64
+ }
65
+
66
+ export type Api_Search_Module = {
67
+ id: string
68
+ RFID: string
69
+ inventory_number: string
70
+ title: string
71
+ type: string
72
+ mac: unknown
73
+ wlan: unknown
74
+ warehouses: Api_Warehouse_Search[]
75
+ user: Api_Search_Module_User
76
+ teams: Omit<Api_Search_User_Teams, 'roles'>[]
77
+ }
@@ -12,6 +12,7 @@
12
12
  :rows-per-page-options="[0]"
13
13
  :selection="props.enableMultiSelect ? 'multiple' : 'none'"
14
14
  style="height: 100%"
15
+ :table-row-style-fn="tableRowStyleFn"
15
16
  @row-click="rowClick"
16
17
  >
17
18
  <template #header-selection="scope">
@@ -160,6 +161,7 @@ const props = defineProps<{
160
161
  hidePagination?: boolean
161
162
  selectedRows: any[]
162
163
  actions?: string[]
164
+ tableRowStyleFn?: (row: Record<string, any>) => string
163
165
  slots?: Slots
164
166
  }>()
165
167
  const emit = defineEmits<TableEmits>()