@openmrs/esm-stock-management-app 3.3.2-pre.474 → 3.3.2-pre.485

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.
Files changed (46) hide show
  1. package/__mocks__/operation-type.mock.ts +11 -298
  2. package/__mocks__/user-role-scope.mock.ts +2 -5
  3. package/dist/228.js +6 -6
  4. package/dist/228.js.map +1 -1
  5. package/dist/5415.js +1 -1
  6. package/dist/5415.js.map +1 -1
  7. package/dist/5996.js +1 -1
  8. package/dist/5996.js.map +1 -1
  9. package/dist/8071.js +1 -1
  10. package/dist/8071.js.map +1 -1
  11. package/dist/openmrs-esm-stock-management-app.js +1 -1
  12. package/dist/routes.json +1 -1
  13. package/package.json +1 -1
  14. package/src/core/api/types/identity/PriviledgeScope.ts +1 -1
  15. package/src/core/api/types/identity/UserRoleScopeOperationType.ts +1 -1
  16. package/src/core/api/types/stockOperation/StockOperationDTO.ts +0 -1
  17. package/src/core/api/types/stockOperation/StockOperationType.ts +3 -8
  18. package/src/core/utils/utils.ts +0 -1
  19. package/src/routes.json +1 -0
  20. package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.component.tsx +2 -2
  21. package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.test.tsx +47 -0
  22. package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +1 -1
  23. package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.test.tsx +16 -2
  24. package/src/stock-operations/stock-operation-links.component.tsx +2 -2
  25. package/src/stock-operations/stock-operation-reference.component.tsx +1 -1
  26. package/src/stock-operations/stock-operation-reference.test.tsx +47 -0
  27. package/src/stock-operations/stock-operation-types-selector/stock-operation-types-selector.component.tsx +1 -1
  28. package/src/stock-operations/stock-operation-types-selector/stock-operation-types-selector.test.tsx +4 -4
  29. package/src/stock-operations/stock-operations-filters.component.tsx +1 -1
  30. package/src/stock-operations/stock-operations-filters.test.tsx +38 -0
  31. package/src/stock-operations/stock-operations-forms/hooks/useFilteredOperationTypesByRoles.test.tsx +7 -7
  32. package/src/stock-operations/stock-operations-forms/hooks/useFilteredOperationTypesByRoles.ts +3 -3
  33. package/src/stock-operations/stock-operations-forms/steps/base-operation-details-form-step.test.tsx +2 -2
  34. package/src/stock-operations/stock-operations-forms/steps/stock-operation-items-form-step.test.tsx +3 -3
  35. package/src/stock-operations/stock-operations-forms/steps/stock-operation-submission-form-step.component.tsx +2 -2
  36. package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.workspace.test.tsx +0 -1
  37. package/src/stock-operations/stock-operations-forms/stock-operation-form.component.tsx +2 -2
  38. package/src/stock-operations/stock-operations-forms/stock-operation-form.test.tsx +153 -10
  39. package/src/stock-operations/stock-operations-forms/stock-operation-related-link.component.tsx +1 -1
  40. package/src/stock-operations/stock-operations-forms/stock-operation-related-link.test.tsx +48 -0
  41. package/src/stock-operations/stock-operations-table.component.tsx +1 -1
  42. package/src/stock-operations/stock-operations-table.test.tsx +15 -1
  43. package/src/stock-operations/stock-operations.resource.ts +1 -1
  44. package/src/stock-operations/validation-schema.ts +1 -2
  45. package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.test.tsx +29 -2
  46. package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace.tsx +9 -9
@@ -1,9 +1,7 @@
1
+ import { type StockOperationType } from '../src/core/api/types/stockOperation/StockOperationType';
2
+
1
3
  export const adjustmentOpeationTypeMock = {
2
- uuid: '11111111-1111-1111-1111-111111111111',
3
- dateCreated: '2022-07-31T00:00:00.000+0300',
4
- dateChanged: null,
5
4
  name: 'Adjustment',
6
- description: 'Physical item quantities that do not match the current system quantity.',
7
5
  operationType: 'adjustment',
8
6
  hasSource: true,
9
7
  sourceType: 'Location',
@@ -13,62 +11,25 @@ export const adjustmentOpeationTypeMock = {
13
11
  allowExpiredBatchNumbers: false,
14
12
  stockOperationTypeLocationScopes: [
15
13
  {
16
- uuid: 'f958ad0a-2a55-11ed-9cab-507b9dea1806',
17
- dateCreated: '2024-03-13T15:41:25.000+0300',
18
- dateChanged: null,
19
14
  locationTag: 'Main Pharmacy',
20
15
  isSource: true,
21
16
  isDestination: false,
22
- links: [
23
- {
24
- rel: 'full',
25
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/f958ad0a-2a55-11ed-9cab-507b9dea1806?v=full',
26
- resourceAlias: 'stockoperationtypelocationscope',
27
- },
28
- ],
29
- resourceVersion: '1.8',
30
17
  },
31
18
  {
32
- uuid: '019f2d4b-2a56-11ed-9cab-507b9dea1806',
33
- dateCreated: '2024-03-13T15:41:25.000+0300',
34
- dateChanged: null,
35
19
  locationTag: 'Main Store',
36
20
  isSource: true,
37
21
  isDestination: false,
38
- links: [
39
- {
40
- rel: 'full',
41
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/019f2d4b-2a56-11ed-9cab-507b9dea1806?v=full',
42
- resourceAlias: 'stockoperationtypelocationscope',
43
- },
44
- ],
45
- resourceVersion: '1.8',
46
22
  },
47
23
  {
48
- uuid: '7228d114-2abc-11ed-ba4a-507b9dea1806',
49
- dateCreated: '2024-03-13T15:41:25.000+0300',
50
- dateChanged: null,
51
24
  locationTag: 'Dispensary',
52
25
  isSource: true,
53
26
  isDestination: false,
54
- links: [
55
- {
56
- rel: 'full',
57
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/7228d114-2abc-11ed-ba4a-507b9dea1806?v=full',
58
- resourceAlias: 'stockoperationtypelocationscope',
59
- },
60
- ],
61
- resourceVersion: '1.8',
62
27
  },
63
28
  ],
64
- };
29
+ } satisfies StockOperationType;
65
30
 
66
31
  export const disposalOperationTypeMock = {
67
- uuid: '22222222-2222-2222-2222-222222222222',
68
- dateCreated: '2022-07-31T00:00:00.000+0300',
69
- dateChanged: null,
70
32
  name: 'Disposal',
71
- description: 'Item stock quantities that have expired and must be removed from circulation.',
72
33
  operationType: 'disposed',
73
34
  hasSource: true,
74
35
  sourceType: 'Location',
@@ -78,62 +39,25 @@ export const disposalOperationTypeMock = {
78
39
  allowExpiredBatchNumbers: true,
79
40
  stockOperationTypeLocationScopes: [
80
41
  {
81
- uuid: '12de41c9-28a1-11ed-bdcb-507b9dea1806',
82
- dateCreated: '2024-03-13T15:41:26.000+0300',
83
- dateChanged: null,
84
42
  locationTag: 'Main Store',
85
43
  isSource: true,
86
44
  isDestination: false,
87
- links: [
88
- {
89
- rel: 'full',
90
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/12de41c9-28a1-11ed-bdcb-507b9dea1806?v=full',
91
- resourceAlias: 'stockoperationtypelocationscope',
92
- },
93
- ],
94
- resourceVersion: '1.8',
95
45
  },
96
46
  {
97
- uuid: '8bee3005-2ae6-11ed-ba4a-507b9dea1806',
98
- dateCreated: '2024-03-13T15:41:26.000+0300',
99
- dateChanged: null,
100
47
  locationTag: 'Main Pharmacy',
101
48
  isSource: true,
102
49
  isDestination: false,
103
- links: [
104
- {
105
- rel: 'full',
106
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/8bee3005-2ae6-11ed-ba4a-507b9dea1806?v=full',
107
- resourceAlias: 'stockoperationtypelocationscope',
108
- },
109
- ],
110
- resourceVersion: '1.8',
111
50
  },
112
51
  {
113
- uuid: '83fbf8ca-2ae6-11ed-ba4a-507b9dea1806',
114
- dateCreated: '2024-03-13T15:41:27.000+0300',
115
- dateChanged: null,
116
52
  locationTag: 'Dispensary',
117
53
  isSource: true,
118
54
  isDestination: false,
119
- links: [
120
- {
121
- rel: 'full',
122
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/83fbf8ca-2ae6-11ed-ba4a-507b9dea1806?v=full',
123
- resourceAlias: 'stockoperationtypelocationscope',
124
- },
125
- ],
126
- resourceVersion: '1.8',
127
55
  },
128
56
  ],
129
- };
57
+ } satisfies StockOperationType;
130
58
 
131
59
  export const tranferOutOperationTypeMock = {
132
- uuid: '33333333-3333-3333-3333-333333333333',
133
- dateCreated: '2022-07-31T00:00:00.000+0300',
134
- dateChanged: null,
135
60
  name: 'Transfer Out',
136
- description: 'Items that are distributed to other outside destination.',
137
61
  operationType: 'transferout',
138
62
  hasSource: true,
139
63
  sourceType: 'Location',
@@ -143,30 +67,15 @@ export const tranferOutOperationTypeMock = {
143
67
  allowExpiredBatchNumbers: false,
144
68
  stockOperationTypeLocationScopes: [
145
69
  {
146
- uuid: '5b341a26-28a2-11ed-bdcb-507b9dea1806',
147
- dateCreated: '2024-03-13T15:41:27.000+0300',
148
- dateChanged: null,
149
70
  locationTag: 'Main Store',
150
71
  isSource: true,
151
72
  isDestination: false,
152
- links: [
153
- {
154
- rel: 'full',
155
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/5b341a26-28a2-11ed-bdcb-507b9dea1806?v=full',
156
- resourceAlias: 'stockoperationtypelocationscope',
157
- },
158
- ],
159
- resourceVersion: '1.8',
160
73
  },
161
74
  ],
162
- };
75
+ } satisfies StockOperationType;
163
76
 
164
77
  export const receiptOperationTypeMock = {
165
- uuid: '44444444-4444-4444-4444-444444444444',
166
- dateCreated: '2022-07-31T00:00:00.000+0300',
167
- dateChanged: null,
168
78
  name: 'Receipt',
169
- description: 'Items that are added into the inventory system from an outside provider.',
170
79
  operationType: 'receipt',
171
80
  hasSource: true,
172
81
  sourceType: 'Other',
@@ -176,30 +85,15 @@ export const receiptOperationTypeMock = {
176
85
  allowExpiredBatchNumbers: false,
177
86
  stockOperationTypeLocationScopes: [
178
87
  {
179
- uuid: '01c9285a-28a3-11ed-bdcb-507b9dea1806',
180
- dateCreated: '2024-03-13T15:41:28.000+0300',
181
- dateChanged: null,
182
88
  locationTag: 'Main Store',
183
89
  isSource: false,
184
90
  isDestination: true,
185
- links: [
186
- {
187
- rel: 'full',
188
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/01c9285a-28a3-11ed-bdcb-507b9dea1806?v=full',
189
- resourceAlias: 'stockoperationtypelocationscope',
190
- },
191
- ],
192
- resourceVersion: '1.8',
193
91
  },
194
92
  ],
195
- };
93
+ } satisfies StockOperationType;
196
94
 
197
95
  export const returnOperationTypeMock = {
198
- uuid: '55555555-5555-5555-5555-555555555555',
199
- dateCreated: '2022-07-31T00:00:00.000+0300',
200
- dateChanged: null,
201
96
  name: 'Return',
202
- description: 'Items that are returned to the main store from other stock holding areas.',
203
97
  operationType: 'return',
204
98
  hasSource: true,
205
99
  sourceType: 'Location',
@@ -209,62 +103,25 @@ export const returnOperationTypeMock = {
209
103
  allowExpiredBatchNumbers: false,
210
104
  stockOperationTypeLocationScopes: [
211
105
  {
212
- uuid: '2c5772e7-28a4-11ed-bdcb-507b9dea1806',
213
- dateCreated: '2024-03-13T15:41:28.000+0300',
214
- dateChanged: null,
215
106
  locationTag: 'Main Pharmacy',
216
107
  isSource: true,
217
108
  isDestination: false,
218
- links: [
219
- {
220
- rel: 'full',
221
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/2c5772e7-28a4-11ed-bdcb-507b9dea1806?v=full',
222
- resourceAlias: 'stockoperationtypelocationscope',
223
- },
224
- ],
225
- resourceVersion: '1.8',
226
109
  },
227
110
  {
228
- uuid: '6e26757a-2abe-11ed-ba4a-507b9dea1806',
229
- dateCreated: '2024-03-13T15:41:29.000+0300',
230
- dateChanged: null,
231
111
  locationTag: 'Dispensary',
232
112
  isSource: true,
233
113
  isDestination: false,
234
- links: [
235
- {
236
- rel: 'full',
237
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/6e26757a-2abe-11ed-ba4a-507b9dea1806?v=full',
238
- resourceAlias: 'stockoperationtypelocationscope',
239
- },
240
- ],
241
- resourceVersion: '1.8',
242
114
  },
243
115
  {
244
- uuid: '27ff4a05-28a4-11ed-bdcb-507b9dea1806',
245
- dateCreated: '2024-03-13T15:41:29.000+0300',
246
- dateChanged: null,
247
116
  locationTag: 'Main Store',
248
117
  isSource: false,
249
118
  isDestination: true,
250
- links: [
251
- {
252
- rel: 'full',
253
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/27ff4a05-28a4-11ed-bdcb-507b9dea1806?v=full',
254
- resourceAlias: 'stockoperationtypelocationscope',
255
- },
256
- ],
257
- resourceVersion: '1.8',
258
119
  },
259
120
  ],
260
- };
121
+ } satisfies StockOperationType;
261
122
 
262
123
  export const stockIssueOperationtypeMock = {
263
- uuid: '66666666-6666-6666-6666-666666666666',
264
- dateCreated: '2022-07-31T00:00:00.000+0300',
265
- dateChanged: null,
266
124
  name: 'Stock Issue',
267
- description: 'Items that are transferred between two locations.',
268
125
  operationType: 'stockissue',
269
126
  hasSource: true,
270
127
  sourceType: 'Location',
@@ -274,62 +131,25 @@ export const stockIssueOperationtypeMock = {
274
131
  allowExpiredBatchNumbers: false,
275
132
  stockOperationTypeLocationScopes: [
276
133
  {
277
- uuid: '20fac1fa-28a4-11ed-bdcb-507b9dea1806',
278
- dateCreated: '2024-03-13T15:41:29.000+0300',
279
- dateChanged: null,
280
134
  locationTag: 'Main Pharmacy',
281
135
  isSource: false,
282
136
  isDestination: true,
283
- links: [
284
- {
285
- rel: 'full',
286
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/20fac1fa-28a4-11ed-bdcb-507b9dea1806?v=full',
287
- resourceAlias: 'stockoperationtypelocationscope',
288
- },
289
- ],
290
- resourceVersion: '1.8',
291
137
  },
292
138
  {
293
- uuid: '11ebab13-2abf-11ed-ba4a-507b9dea1806',
294
- dateCreated: '2024-03-13T15:41:30.000+0300',
295
- dateChanged: null,
296
139
  locationTag: 'Dispensary',
297
140
  isSource: false,
298
141
  isDestination: true,
299
- links: [
300
- {
301
- rel: 'full',
302
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/11ebab13-2abf-11ed-ba4a-507b9dea1806?v=full',
303
- resourceAlias: 'stockoperationtypelocationscope',
304
- },
305
- ],
306
- resourceVersion: '1.8',
307
142
  },
308
143
  {
309
- uuid: '1c984ba0-28a4-11ed-bdcb-507b9dea1806',
310
- dateCreated: '2024-03-13T15:41:30.000+0300',
311
- dateChanged: null,
312
144
  locationTag: 'Main Store',
313
145
  isSource: true,
314
146
  isDestination: false,
315
- links: [
316
- {
317
- rel: 'full',
318
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/1c984ba0-28a4-11ed-bdcb-507b9dea1806?v=full',
319
- resourceAlias: 'stockoperationtypelocationscope',
320
- },
321
- ],
322
- resourceVersion: '1.8',
323
147
  },
324
148
  ],
325
- };
149
+ } satisfies StockOperationType;
326
150
 
327
151
  export const requisitionOperationTypeMock = {
328
- uuid: '77777777-7777-7777-7777-777777777777',
329
- dateCreated: '2022-07-31T00:00:00.000+0300',
330
- dateChanged: null,
331
152
  name: 'Requisition',
332
- description: 'Request for items from another location.',
333
153
  operationType: 'requisition',
334
154
  hasSource: true,
335
155
  sourceType: 'Location',
@@ -339,62 +159,25 @@ export const requisitionOperationTypeMock = {
339
159
  allowExpiredBatchNumbers: false,
340
160
  stockOperationTypeLocationScopes: [
341
161
  {
342
- uuid: 'dfba06ad-2abe-11ed-ba4a-507b9dea1806',
343
- dateCreated: '2024-03-13T15:41:31.000+0300',
344
- dateChanged: null,
345
162
  locationTag: 'Dispensary',
346
163
  isSource: true,
347
164
  isDestination: false,
348
- links: [
349
- {
350
- rel: 'full',
351
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/dfba06ad-2abe-11ed-ba4a-507b9dea1806?v=full',
352
- resourceAlias: 'stockoperationtypelocationscope',
353
- },
354
- ],
355
- resourceVersion: '1.8',
356
165
  },
357
166
  {
358
- uuid: '161ccea9-28a4-11ed-bdcb-507b9dea1806',
359
- dateCreated: '2024-03-13T15:41:30.000+0300',
360
- dateChanged: null,
361
167
  locationTag: 'Main Pharmacy',
362
168
  isSource: true,
363
169
  isDestination: false,
364
- links: [
365
- {
366
- rel: 'full',
367
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/161ccea9-28a4-11ed-bdcb-507b9dea1806?v=full',
368
- resourceAlias: 'stockoperationtypelocationscope',
369
- },
370
- ],
371
- resourceVersion: '1.8',
372
170
  },
373
171
  {
374
- uuid: '11ba3575-28a4-11ed-bdcb-507b9dea1806',
375
- dateCreated: '2024-03-13T15:41:31.000+0300',
376
- dateChanged: null,
377
172
  locationTag: 'Main Store',
378
173
  isSource: false,
379
174
  isDestination: true,
380
- links: [
381
- {
382
- rel: 'full',
383
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/11ba3575-28a4-11ed-bdcb-507b9dea1806?v=full',
384
- resourceAlias: 'stockoperationtypelocationscope',
385
- },
386
- ],
387
- resourceVersion: '1.8',
388
175
  },
389
176
  ],
390
- };
177
+ } satisfies StockOperationType;
391
178
 
392
179
  export const stockTakeOperationTypeMock = {
393
- uuid: '88888888-8888-8888-8888-888888888888',
394
- dateCreated: '2022-07-31T00:00:00.000+0300',
395
- dateChanged: null,
396
180
  name: 'Stock Take',
397
- description: 'Physical verification of item quantities.',
398
181
  operationType: 'stocktake',
399
182
  hasSource: true,
400
183
  sourceType: 'Location',
@@ -404,62 +187,25 @@ export const stockTakeOperationTypeMock = {
404
187
  allowExpiredBatchNumbers: false,
405
188
  stockOperationTypeLocationScopes: [
406
189
  {
407
- uuid: '86fad5b3-2abf-11ed-ba4a-507b9dea1806',
408
- dateCreated: '2024-03-13T15:41:32.000+0300',
409
- dateChanged: null,
410
190
  locationTag: 'Dispensary',
411
191
  isSource: true,
412
192
  isDestination: false,
413
- links: [
414
- {
415
- rel: 'full',
416
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/86fad5b3-2abf-11ed-ba4a-507b9dea1806?v=full',
417
- resourceAlias: 'stockoperationtypelocationscope',
418
- },
419
- ],
420
- resourceVersion: '1.8',
421
193
  },
422
194
  {
423
- uuid: '90b9f544-2abf-11ed-ba4a-507b9dea1806',
424
- dateCreated: '2024-03-13T15:41:31.000+0300',
425
- dateChanged: null,
426
195
  locationTag: 'Main Store',
427
196
  isSource: true,
428
197
  isDestination: false,
429
- links: [
430
- {
431
- rel: 'full',
432
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/90b9f544-2abf-11ed-ba4a-507b9dea1806?v=full',
433
- resourceAlias: 'stockoperationtypelocationscope',
434
- },
435
- ],
436
- resourceVersion: '1.8',
437
198
  },
438
199
  {
439
- uuid: '8ab5bb1d-2abf-11ed-ba4a-507b9dea1806',
440
- dateCreated: '2024-03-13T15:41:32.000+0300',
441
- dateChanged: null,
442
200
  locationTag: 'Main Pharmacy',
443
201
  isSource: true,
444
202
  isDestination: false,
445
- links: [
446
- {
447
- rel: 'full',
448
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/8ab5bb1d-2abf-11ed-ba4a-507b9dea1806?v=full',
449
- resourceAlias: 'stockoperationtypelocationscope',
450
- },
451
- ],
452
- resourceVersion: '1.8',
453
203
  },
454
204
  ],
455
- };
205
+ } satisfies StockOperationType;
456
206
 
457
207
  export const openingStockOperationTypeMock = {
458
- uuid: '99999999-9999-9999-9999-999999999999',
459
- dateCreated: '2022-07-31T00:00:00.000+0300',
460
- dateChanged: null,
461
208
  name: 'Opening Stock',
462
- description: 'Initial physical item quantities.',
463
209
  operationType: 'initial',
464
210
  hasSource: true,
465
211
  sourceType: 'Location',
@@ -469,55 +215,22 @@ export const openingStockOperationTypeMock = {
469
215
  allowExpiredBatchNumbers: false,
470
216
  stockOperationTypeLocationScopes: [
471
217
  {
472
- uuid: '99e64f69-2e90-11ed-a5a0-507b9dea1806',
473
- dateCreated: '2024-03-13T15:41:33.000+0300',
474
- dateChanged: null,
475
218
  locationTag: 'Main Pharmacy',
476
219
  isSource: true,
477
220
  isDestination: false,
478
- links: [
479
- {
480
- rel: 'full',
481
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/99e64f69-2e90-11ed-a5a0-507b9dea1806?v=full',
482
- resourceAlias: 'stockoperationtypelocationscope',
483
- },
484
- ],
485
- resourceVersion: '1.8',
486
221
  },
487
222
  {
488
- uuid: '886b6f2d-2e90-11ed-a5a0-507b9dea1806',
489
- dateCreated: '2024-03-13T15:41:32.000+0300',
490
- dateChanged: null,
491
223
  locationTag: 'Main Store',
492
224
  isSource: true,
493
225
  isDestination: false,
494
- links: [
495
- {
496
- rel: 'full',
497
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/886b6f2d-2e90-11ed-a5a0-507b9dea1806?v=full',
498
- resourceAlias: 'stockoperationtypelocationscope',
499
- },
500
- ],
501
- resourceVersion: '1.8',
502
226
  },
503
227
  {
504
- uuid: 'a24c5c90-2e90-11ed-a5a0-507b9dea1806',
505
- dateCreated: '2024-03-13T15:41:33.000+0300',
506
- dateChanged: null,
507
228
  locationTag: 'Dispensary',
508
229
  isSource: true,
509
230
  isDestination: false,
510
- links: [
511
- {
512
- rel: 'full',
513
- uri: 'http://hie.kenyahmis.org/openmrs/ws/rest/v1/stockmanagement/stockoperationtypelocationscope/a24c5c90-2e90-11ed-a5a0-507b9dea1806?v=full',
514
- resourceAlias: 'stockoperationtypelocationscope',
515
- },
516
- ],
517
- resourceVersion: '1.8',
518
231
  },
519
232
  ],
520
- };
233
+ } satisfies StockOperationType;
521
234
 
522
235
  export const operationTypesMock = [
523
236
  adjustmentOpeationTypeMock,
@@ -17,9 +17,6 @@ const auditFields: Omit<BaseOpenmrsData, 'uuid'> = {
17
17
  export const roleScopeOperationTypes = operationTypesMock.map(
18
18
  (operation): StockOperationType => ({
19
19
  ...operation,
20
- ...auditFields,
21
- hasRecipient: false,
22
- recipientRequired: false,
23
20
  sourceType: operation.hasSource ? 'Location' : null,
24
21
  destinationType: operation.hasDestination ? 'Location' : null,
25
22
  stockOperationTypeLocationScopes: [],
@@ -38,8 +35,8 @@ export const userRoleScopeMock: UserRoleScope = {
38
35
  enabled: true,
39
36
  operationTypes: roleScopeOperationTypes.map((operation) => ({
40
37
  ...auditFields,
41
- uuid: `scope-operation-${operation.uuid}`,
42
- operationTypeUuid: operation.uuid,
38
+ uuid: `scope-operation-${operation.operationType}`,
39
+ operationType: operation.operationType,
43
40
  operationTypeName: operation.name,
44
41
  })),
45
42
  locations: [