@natch-the-storage/heathershaw-platform-types 1.11.3 → 1.11.5
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.
- package/build/validators.d.ts +15 -4
- package/build/validators.js +15 -38
- package/package.json +1 -1
package/build/validators.d.ts
CHANGED
|
@@ -624,6 +624,12 @@ export interface CDFormulationList {
|
|
|
624
624
|
infoUrl: string;
|
|
625
625
|
isSignedOff: boolean;
|
|
626
626
|
}
|
|
627
|
+
export interface CDPriceOptionUpdate {
|
|
628
|
+
formulationPriceId: number;
|
|
629
|
+
formulationId: number;
|
|
630
|
+
quantity: number;
|
|
631
|
+
price: number;
|
|
632
|
+
}
|
|
627
633
|
export declare const parseCategory: (category: string) => "Compounding" | "Order or delivery" | "Prescription" | "Profile or account" | "General";
|
|
628
634
|
export interface ContactFormInternalCreate {
|
|
629
635
|
category: string;
|
|
@@ -646,6 +652,10 @@ export declare const BucketObjects: {
|
|
|
646
652
|
};
|
|
647
653
|
};
|
|
648
654
|
};
|
|
655
|
+
interface ListParams {
|
|
656
|
+
page?: number;
|
|
657
|
+
limit?: number;
|
|
658
|
+
}
|
|
649
659
|
export declare const ApiRoutes: {
|
|
650
660
|
admin: {
|
|
651
661
|
getDashboardData: string;
|
|
@@ -665,6 +675,7 @@ export declare const ApiRoutes: {
|
|
|
665
675
|
getHouseholdDraftScripts: string;
|
|
666
676
|
listFormulations: string;
|
|
667
677
|
getFormulationById: (id: number) => string;
|
|
678
|
+
updatePriceOptions: string;
|
|
668
679
|
};
|
|
669
680
|
directUserProfiles: {
|
|
670
681
|
list: string;
|
|
@@ -683,13 +694,11 @@ export declare const ApiRoutes: {
|
|
|
683
694
|
createPaymentLink: string;
|
|
684
695
|
};
|
|
685
696
|
orders: {
|
|
686
|
-
list: (filters?: {
|
|
697
|
+
list: (filters?: ListParams & {
|
|
687
698
|
partnerPharmacyProfileId?: number;
|
|
688
699
|
directUserProfileId?: number;
|
|
689
700
|
patientRecordId?: number;
|
|
690
701
|
draft?: boolean;
|
|
691
|
-
page?: number;
|
|
692
|
-
limit?: number;
|
|
693
702
|
}) => string;
|
|
694
703
|
get: (id: number) => string;
|
|
695
704
|
getSummary: (date: string) => string;
|
|
@@ -725,7 +734,9 @@ export declare const ApiRoutes: {
|
|
|
725
734
|
delete: (id: number) => string;
|
|
726
735
|
};
|
|
727
736
|
priceMatches: {
|
|
728
|
-
list:
|
|
737
|
+
list: (filters?: {
|
|
738
|
+
partnerPharmacyProfileId?: number;
|
|
739
|
+
}) => string;
|
|
729
740
|
get: (id: number) => string;
|
|
730
741
|
create: string;
|
|
731
742
|
update: string;
|
package/build/validators.js
CHANGED
|
@@ -153,6 +153,16 @@ export const BucketObjects = {
|
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
};
|
|
156
|
+
function handleParams(filters) {
|
|
157
|
+
const params = new URLSearchParams();
|
|
158
|
+
const entries = Object.entries(filters ?? {});
|
|
159
|
+
for (const [key, value] of entries) {
|
|
160
|
+
if (value !== undefined && value !== null)
|
|
161
|
+
params.set(key, String(value));
|
|
162
|
+
}
|
|
163
|
+
const query = params.toString();
|
|
164
|
+
return `${query ? `?${query}` : ''}`;
|
|
165
|
+
}
|
|
156
166
|
export const ApiRoutes = {
|
|
157
167
|
admin: {
|
|
158
168
|
getDashboardData: '/api/admin/dashboard-data',
|
|
@@ -172,6 +182,7 @@ export const ApiRoutes = {
|
|
|
172
182
|
getHouseholdDraftScripts: '/api/compound-direct/scripts/households',
|
|
173
183
|
listFormulations: '/api/compound-direct/formulations',
|
|
174
184
|
getFormulationById: (id) => `/api/compound-direct/formulations/${id}`,
|
|
185
|
+
updatePriceOptions: '/api/compound-direct/formulations/prices',
|
|
175
186
|
},
|
|
176
187
|
directUserProfiles: {
|
|
177
188
|
list: '/api/profiles/direct-users',
|
|
@@ -190,23 +201,7 @@ export const ApiRoutes = {
|
|
|
190
201
|
createPaymentLink: '/api/notifications/payment-links',
|
|
191
202
|
},
|
|
192
203
|
orders: {
|
|
193
|
-
list: (filters) => {
|
|
194
|
-
const params = new URLSearchParams();
|
|
195
|
-
if (filters?.partnerPharmacyProfileId)
|
|
196
|
-
params.set('partnerPharmacyProfileId', String(filters.partnerPharmacyProfileId));
|
|
197
|
-
if (filters?.directUserProfileId)
|
|
198
|
-
params.set('directUserProfileId', String(filters.directUserProfileId));
|
|
199
|
-
if (filters?.patientRecordId)
|
|
200
|
-
params.set('patientRecordId', String(filters.patientRecordId));
|
|
201
|
-
if (filters?.page)
|
|
202
|
-
params.set('page', String(filters.page));
|
|
203
|
-
if (filters?.limit)
|
|
204
|
-
params.set('limit', String(filters.limit));
|
|
205
|
-
if (filters?.draft)
|
|
206
|
-
params.set('draft', String(filters.draft));
|
|
207
|
-
const query = params.toString();
|
|
208
|
-
return `/api/orders${query ? `?${query}` : ''}`;
|
|
209
|
-
},
|
|
204
|
+
list: (filters) => `/api/orders${handleParams(filters)}`,
|
|
210
205
|
get: (id) => `/api/orders/${id}`,
|
|
211
206
|
getSummary: (date) => `/api/orders/summary${date ? '?date=' + date : ''}`,
|
|
212
207
|
create: '/api/orders',
|
|
@@ -241,7 +236,7 @@ export const ApiRoutes = {
|
|
|
241
236
|
delete: (id) => `/api/patient-records/${id}`,
|
|
242
237
|
},
|
|
243
238
|
priceMatches: {
|
|
244
|
-
list:
|
|
239
|
+
list: (filters) => `/api/price-matches${handleParams(filters)}`,
|
|
245
240
|
get: (id) => `/api/price-matches/${id}`,
|
|
246
241
|
create: '/api/price-matches',
|
|
247
242
|
update: '/api/price-matches',
|
|
@@ -263,15 +258,7 @@ export const ApiRoutes = {
|
|
|
263
258
|
delete: (id) => `/api/reminders/repeats/${id}`,
|
|
264
259
|
},
|
|
265
260
|
scripts: {
|
|
266
|
-
get: (filters) => {
|
|
267
|
-
const params = new URLSearchParams();
|
|
268
|
-
if (filters?.partnerPharmacyProfileId)
|
|
269
|
-
params.set('partnerPharmacyProfileId', String(filters.partnerPharmacyProfileId));
|
|
270
|
-
if (filters?.patientRecordId)
|
|
271
|
-
params.set('patientRecordId', String(filters.patientRecordId));
|
|
272
|
-
const query = params.toString();
|
|
273
|
-
return `/api/scripts${query ? `?${query}` : ''}`;
|
|
274
|
-
},
|
|
261
|
+
get: (filters) => `/api/scripts${handleParams(filters)}`,
|
|
275
262
|
getById: (id) => `/api/scripts/${id}`,
|
|
276
263
|
getAdminScripts: '/api/scripts/admin-scripts',
|
|
277
264
|
createEscript: '/api/scripts/escripts',
|
|
@@ -284,17 +271,7 @@ export const ApiRoutes = {
|
|
|
284
271
|
send: '/api/reminders/sms',
|
|
285
272
|
},
|
|
286
273
|
staffProfiles: {
|
|
287
|
-
list: (filters) => {
|
|
288
|
-
const params = new URLSearchParams();
|
|
289
|
-
if (filters?.userId)
|
|
290
|
-
params.set('userId', filters.userId);
|
|
291
|
-
if (filters?.page)
|
|
292
|
-
params.set('page', String(filters.page));
|
|
293
|
-
if (filters?.limit)
|
|
294
|
-
params.set('limit', String(filters.limit));
|
|
295
|
-
const query = params.toString();
|
|
296
|
-
return `/api/profiles/staff-profiles${query ? `?${query}` : ''}`;
|
|
297
|
-
},
|
|
274
|
+
list: (filters) => `/api/profiles/staff-profiles${handleParams(filters)}`,
|
|
298
275
|
get: (id) => `/api/profiles/staff-profiles/${id}`,
|
|
299
276
|
getByUser: (userId) => `/api/profiles/staff-profiles/users/${userId}`,
|
|
300
277
|
create: '/api/profiles/staff-profiles',
|