@natch-the-storage/heathershaw-platform-types 1.9.5 → 1.10.0

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.
@@ -5,6 +5,8 @@ export declare const paymentStatusValues: readonly ["AWAITING_PAYMENT", "PAID",
5
5
  export declare const repeatStorageValues: readonly ["HEATHERSHAWS", "PHARMACY", "PATIENT"];
6
6
  export declare const scriptTypeValues: readonly ["eRx", "PAPER"];
7
7
  export declare const shippingTypeValues: readonly ["STANDARD", "COLD_CHAIN"];
8
+ export declare const staffProfileRoleValues: readonly ["ACTIVE", "SUSPENDED"];
9
+ export declare const staffProfileStatusValues: readonly ["ACTIVE", "SUSPENDED"];
8
10
  export type PaperScriptReminderStatus = (typeof paperScriptReminderStatusValues)[number];
9
11
  export type QuoteStatus = (typeof quoteStatusValues)[number];
10
12
  export type PaymentModeAtOrder = (typeof paymentModeAtOrderValues)[number];
@@ -12,6 +14,8 @@ export type PaymentStatus = (typeof paymentStatusValues)[number];
12
14
  export type RepeatStorage = (typeof repeatStorageValues)[number];
13
15
  export type ScriptType = (typeof scriptTypeValues)[number];
14
16
  export type ShippingType = (typeof shippingTypeValues)[number];
17
+ export type StaffProfileRole = (typeof staffProfileRoleValues)[number];
18
+ export type StaffProfileStatus = (typeof staffProfileStatusValues)[number];
15
19
  export interface Address {
16
20
  street: string;
17
21
  suburb: string;
@@ -31,15 +35,6 @@ export interface HealthInfo {
31
35
  additionalInfo?: string;
32
36
  lastUpdated?: string;
33
37
  }
34
- export interface ScriptSelect {
35
- id: number;
36
- patientRecordId: number;
37
- partnerPharmacyProfileId?: number;
38
- uploaded: string;
39
- processed: boolean;
40
- token?: string | null;
41
- fileKey?: string | null;
42
- }
43
38
  export interface LineItem {
44
39
  id: string;
45
40
  name: string;
@@ -87,6 +82,18 @@ export interface Sms {
87
82
  to: string;
88
83
  from: string;
89
84
  }
85
+ interface DashboardData {
86
+ label: string;
87
+ count: number;
88
+ }
89
+ export interface AdminDashboardData {
90
+ pendingOrders: DashboardData;
91
+ ordersRequiringCounselling: DashboardData;
92
+ unpaidOrders: DashboardData;
93
+ pendingQuotes: DashboardData;
94
+ unprocessedScripts: DashboardData;
95
+ unprocessedPaperScripts: DashboardData;
96
+ }
90
97
  export interface User {
91
98
  id: string;
92
99
  name: string;
@@ -105,7 +112,7 @@ export interface User {
105
112
  }
106
113
  export interface DirectUserProfile {
107
114
  id: number;
108
- userId?: string;
115
+ userId: string;
109
116
  remindersEnabled?: boolean;
110
117
  }
111
118
  export interface DirectUserProfileCreate {
@@ -137,7 +144,7 @@ export interface Order {
137
144
  counsellingPriority?: string;
138
145
  counselledBy?: string;
139
146
  consellingNotes?: string;
140
- counselledStatus?: string;
147
+ counsellingStatus?: string;
141
148
  confirmationSentAt?: Date;
142
149
  patientCharged?: number;
143
150
  overage?: number;
@@ -171,7 +178,7 @@ export interface OrderCreate {
171
178
  counsellingPriority?: string;
172
179
  counselledBy?: string;
173
180
  consellingNotes?: string;
174
- counselledStatus?: string;
181
+ counsellingStatus?: string;
175
182
  confirmationSentAt?: Date;
176
183
  patientCharged?: number;
177
184
  overage?: number;
@@ -203,8 +210,8 @@ export interface PaperScriptReminderCreate {
203
210
  }
204
211
  export interface PartnerPharmacyProfile {
205
212
  id: number;
206
- userId?: string;
207
- abn?: string;
213
+ userId: string;
214
+ abn: string;
208
215
  pharmacyName: string;
209
216
  contactName: string;
210
217
  invoiceEmail: string;
@@ -233,7 +240,7 @@ export interface PartnerPharmacyProfileCreate {
233
240
  export interface PartnerPharmacyProfileReportData {
234
241
  orderCount: number;
235
242
  patientRecordCount: number;
236
- awaitingPatientPayment: number;
243
+ pendingPaperScripts: number;
237
244
  }
238
245
  export interface PatientRecord {
239
246
  id: number;
@@ -249,25 +256,25 @@ export interface PatientRecord {
249
256
  addresses?: Address[];
250
257
  healthInfo?: HealthInfo;
251
258
  reminderEnabled?: boolean;
252
- scripts?: ScriptSelect[];
259
+ scripts?: Script[];
253
260
  orderHistory?: Order[];
254
261
  animalSpecies?: string;
255
262
  relationship?: string | null;
256
263
  }
257
264
  export interface PatientRecordCreate {
258
- firstName: string;
259
- lastName: string;
260
- dateOfBirth: string;
261
- phone: string;
262
265
  partnerPharmacyProfileId?: number | null;
263
266
  directUserProfileId?: number | null;
264
267
  compoundDirectId?: number | null;
265
268
  userId?: string | null;
269
+ firstName: string;
270
+ lastName: string;
271
+ dateOfBirth: string;
272
+ phone: string;
266
273
  medicareNumber?: string | null;
267
274
  addresses?: Address[];
268
275
  healthInfo?: HealthInfo;
269
276
  reminderEnabled?: boolean;
270
- scripts?: ScriptSelect[];
277
+ scripts?: Script[];
271
278
  orderHistory?: Order[];
272
279
  animalSpecies?: string;
273
280
  relationship?: string | null;
@@ -354,6 +361,36 @@ export interface getScriptsQuery {
354
361
  patientRecordId?: number;
355
362
  partnerPharmacyProfileId?: number;
356
363
  }
364
+ export interface StaffProfile {
365
+ id: number;
366
+ userId: string;
367
+ name: string;
368
+ email: string;
369
+ userName: string;
370
+ role: StaffProfileRole;
371
+ status: StaffProfileStatus;
372
+ }
373
+ export interface StaffProfileCreate {
374
+ userId: string;
375
+ name: string;
376
+ email: string;
377
+ userName: string;
378
+ password: string;
379
+ role: StaffProfileRole;
380
+ status: StaffProfileStatus;
381
+ }
382
+ export interface UpdateStaffProfilePassword {
383
+ newPassword: string;
384
+ }
385
+ export interface StaffProfileSignIn {
386
+ userName: string;
387
+ password: string;
388
+ }
389
+ export interface GetStaffProfilesQuery {
390
+ page?: number;
391
+ limit?: number;
392
+ userId?: string;
393
+ }
357
394
  export interface Cart {
358
395
  id: number;
359
396
  directUserProfileId?: number;
@@ -612,6 +649,37 @@ export declare const BucketObjects: {
612
649
  };
613
650
  };
614
651
  export declare const ApiRoutes: {
652
+ admin: {
653
+ getDashboardData: string;
654
+ };
655
+ cart: {
656
+ getByDirectUser: (id: number) => string;
657
+ getByPartnerPharmacy: (id: number) => string;
658
+ put: string;
659
+ deleteByDirectUser: (id: number) => string;
660
+ deleteByPartnerPharmacy: (id: number) => string;
661
+ };
662
+ compoundDirect: {
663
+ searchCustomers: string;
664
+ createCustomer: string;
665
+ getDraftScripts: string;
666
+ getDraftScriptById: (id: number) => string;
667
+ listFormulations: string;
668
+ getFormulationById: (id: number) => string;
669
+ };
670
+ directUserProfiles: {
671
+ list: string;
672
+ get: (id: number) => string;
673
+ getByUser: (userId: string) => string;
674
+ getOrders: (userId: number) => string;
675
+ create: string;
676
+ onboard: (userId: string) => string;
677
+ update: string;
678
+ delete: (id: number) => string;
679
+ };
680
+ email: {
681
+ contactFormInternal: string;
682
+ };
615
683
  orders: {
616
684
  list: (filters?: {
617
685
  partnerPharmacyProfileId?: number;
@@ -623,40 +691,26 @@ export declare const ApiRoutes: {
623
691
  update: string;
624
692
  delete: (id: number) => string;
625
693
  };
626
- patientRecords: {
627
- list: (id?: number, type?: "partner" | "direct") => string;
628
- get: (id: number) => string;
629
- getByUser: (userId: string) => string;
630
- create: string;
631
- update: string;
632
- delete: (id: number) => string;
633
- };
634
- scripts: {
635
- get: (filters?: getScriptsQuery) => string;
636
- getById: (id: number) => string;
637
- createEscript: string;
638
- createPaperScript: string;
639
- update: string;
640
- delete: (id: number) => string;
641
- };
642
- quotes: {
694
+ paperScriptReminders: {
643
695
  list: string;
644
696
  get: (id: number) => string;
645
697
  create: string;
646
698
  update: string;
647
699
  delete: (id: number) => string;
648
700
  };
649
- paperScriptReminders: {
701
+ partnerPharmacyProfiles: {
650
702
  list: string;
651
703
  get: (id: number) => string;
704
+ getByUser: (userId: string) => string;
652
705
  create: string;
653
706
  update: string;
654
707
  delete: (id: number) => string;
708
+ getReportData: (id: number) => string;
655
709
  };
656
- repeatReminders: {
657
- list: string;
710
+ patientRecords: {
711
+ list: (id?: number, type?: "partner" | "direct") => string;
658
712
  get: (id: number) => string;
659
- history: (id: number) => string;
713
+ getByUser: (userId: string) => string;
660
714
  create: string;
661
715
  update: string;
662
716
  delete: (id: number) => string;
@@ -668,52 +722,51 @@ export declare const ApiRoutes: {
668
722
  update: string;
669
723
  delete: (id: number) => string;
670
724
  };
671
- directUserProfiles: {
725
+ quotes: {
672
726
  list: string;
673
727
  get: (id: number) => string;
674
- getByUser: (userId: string) => string;
675
- getOrders: (userId: number) => string;
676
728
  create: string;
677
- onboard: (userId: string) => string;
678
729
  update: string;
679
730
  delete: (id: number) => string;
680
731
  };
681
- partnerPharmacyProfiles: {
732
+ repeatReminders: {
682
733
  list: string;
683
734
  get: (id: number) => string;
684
- getByUser: (userId: string) => string;
735
+ history: (id: number) => string;
685
736
  create: string;
686
737
  update: string;
687
738
  delete: (id: number) => string;
688
- getReportData: (id: number) => string;
689
- };
690
- users: {
691
- data: (userId: string) => string;
692
739
  };
693
- uploads: {
694
- presign: string;
695
- delete: string;
740
+ scripts: {
741
+ get: (filters?: getScriptsQuery) => string;
742
+ getById: (id: number) => string;
743
+ createEscript: string;
744
+ createPaperScript: string;
745
+ update: string;
746
+ delete: (id: number) => string;
696
747
  };
697
748
  sms: {
698
749
  twilioStatus: string;
699
750
  send: string;
700
751
  };
701
- email: {
702
- contactFormInternal: string;
752
+ staffProfiles: {
753
+ list: (filters?: {
754
+ userId?: string;
755
+ page?: number;
756
+ limit?: number;
757
+ }) => string;
758
+ get: (id: number) => string;
759
+ create: string;
760
+ update: string;
761
+ updatePassword: (id: number) => string;
762
+ signIn: string;
703
763
  };
704
- cart: {
705
- getByDirectUser: (id: number) => string;
706
- getByPartnerPharmacy: (id: number) => string;
707
- put: string;
708
- deleteByDirectUser: (id: number) => string;
709
- deleteByPartnerPharmacy: (id: number) => string;
764
+ uploads: {
765
+ presign: string;
766
+ delete: string;
710
767
  };
711
- compoundDirect: {
712
- searchCustomers: string;
713
- createCustomer: string;
714
- getDraftScripts: string;
715
- getDraftScriptById: (id: number) => string;
716
- listFormulations: string;
717
- getFormulationById: (id: number) => string;
768
+ users: {
769
+ data: (userId: string) => string;
718
770
  };
719
771
  };
772
+ export {};
@@ -18,6 +18,8 @@ export const repeatStorageValues = [
18
18
  ];
19
19
  export const scriptTypeValues = ['eRx', 'PAPER'];
20
20
  export const shippingTypeValues = ['STANDARD', 'COLD_CHAIN'];
21
+ export const staffProfileRoleValues = ['ACTIVE', 'SUSPENDED'];
22
+ export const staffProfileStatusValues = ['ACTIVE', 'SUSPENDED'];
21
23
  // ─── Compound Direct ────────────────────────────────────────────────────────────
22
24
  export const CompoundDirectAnimalId = {
23
25
  dog: { id: 1, name: 'Dog' },
@@ -75,6 +77,37 @@ export const BucketObjects = {
75
77
  },
76
78
  };
77
79
  export const ApiRoutes = {
80
+ admin: {
81
+ getDashboardData: '/admin/dashboard-data',
82
+ },
83
+ cart: {
84
+ getByDirectUser: (id) => `/api/carts/direct-users/${id}`,
85
+ getByPartnerPharmacy: (id) => `/api/carts/partner-pharmacies/${id}`,
86
+ put: '/api/carts',
87
+ deleteByDirectUser: (id) => `/api/carts/direct-users/${id}`,
88
+ deleteByPartnerPharmacy: (id) => `/api/carts/partner-pharmacies/${id}`,
89
+ },
90
+ compoundDirect: {
91
+ searchCustomers: '/api/compound-direct/customers',
92
+ createCustomer: '/api/compound-direct/customer',
93
+ getDraftScripts: '/api/compound-direct/draft-scripts',
94
+ getDraftScriptById: (id) => `/api/compound-direct/draft-scripts/${id}`,
95
+ listFormulations: '/api/compound-direct/formulations',
96
+ getFormulationById: (id) => `/api/compound-direct/formulations/${id}`,
97
+ },
98
+ directUserProfiles: {
99
+ list: '/api/profiles/direct-users',
100
+ get: (id) => `/api/profiles/direct-users/${id}`,
101
+ getByUser: (userId) => `/api/profiles/direct-users/users/${userId}`,
102
+ getOrders: (userId) => `/api/profiles/direct-users/users/${userId}/orders`,
103
+ create: '/api/profiles/direct-users',
104
+ onboard: (userId) => `/api/profiles/direct-users/${userId}`,
105
+ update: '/api/profiles/direct-users',
106
+ delete: (id) => `/api/profiles/direct-users/${id}`,
107
+ },
108
+ email: {
109
+ contactFormInternal: '/api/emails/contact-requests',
110
+ },
78
111
  orders: {
79
112
  list: (filters) => {
80
113
  const params = new URLSearchParams();
@@ -92,6 +125,22 @@ export const ApiRoutes = {
92
125
  update: '/api/orders',
93
126
  delete: (id) => `/api/orders/${id}`,
94
127
  },
128
+ paperScriptReminders: {
129
+ list: '/api/paper-script-reminders',
130
+ get: (id) => `/api/paper-script-reminders/${id}`,
131
+ create: '/api/paper-script-reminders',
132
+ update: '/api/paper-script-reminders',
133
+ delete: (id) => `/api/paper-script-reminders/${id}`,
134
+ },
135
+ partnerPharmacyProfiles: {
136
+ list: '/api/profiles/partner-pharmacies',
137
+ get: (id) => `/api/profiles/partner-pharmacies/${id}`,
138
+ getByUser: (userId) => `/api/profiles/partner-pharmacies/user/${userId}`,
139
+ create: '/api/profiles/partner-pharmacies',
140
+ update: '/api/profiles/partner-pharmacies',
141
+ delete: (id) => `/api/profiles/partner-pharmacies/${id}`,
142
+ getReportData: (id) => `/api/profiles/partner-pharmacies/${id}/reports`,
143
+ },
95
144
  patientRecords: {
96
145
  list: (id, type) => '/api/patient-records' + `${type ? '?' + type + '=' + id : ''}`,
97
146
  get: (id) => `/api/patient-records/${id}`,
@@ -100,21 +149,12 @@ export const ApiRoutes = {
100
149
  update: '/api/patient-records',
101
150
  delete: (id) => `/api/patient-records/${id}`,
102
151
  },
103
- scripts: {
104
- get: (filters) => {
105
- const params = new URLSearchParams();
106
- if (filters?.partnerPharmacyProfileId)
107
- params.set('partnerPharmacyProfileId', String(filters.partnerPharmacyProfileId));
108
- if (filters?.patientRecordId)
109
- params.set('patientRecordId', String(filters.patientRecordId));
110
- const query = params.toString();
111
- return `/api/scripts${query ? `/?${query}` : ''}`;
112
- },
113
- getById: (id) => `/api/scripts/${id}`,
114
- createEscript: '/api/scripts/escripts',
115
- createPaperScript: '/api/scripts/paper-scripts',
116
- update: '/api/scripts',
117
- delete: (id) => `/api/scripts/${id}`,
152
+ priceMatches: {
153
+ list: '/api/price-matches',
154
+ get: (id) => `/api/price-matches/${id}`,
155
+ create: '/api/price-matches',
156
+ update: '/api/price-matches',
157
+ delete: (id) => `/api/price-matches/${id}`,
118
158
  },
119
159
  quotes: {
120
160
  list: '/api/quotes',
@@ -123,13 +163,6 @@ export const ApiRoutes = {
123
163
  update: '/api/quotes',
124
164
  delete: (id) => `/api/quotes/${id}`,
125
165
  },
126
- paperScriptReminders: {
127
- list: '/api/paper-script-reminders',
128
- get: (id) => `/api/paper-script-reminders/${id}`,
129
- create: '/api/paper-script-reminders',
130
- update: '/api/paper-script-reminders',
131
- delete: (id) => `/api/paper-script-reminders/${id}`,
132
- },
133
166
  repeatReminders: {
134
167
  list: '/api/reminders/repeats',
135
168
  get: (id) => `/api/reminders/repeats/${id}`,
@@ -138,59 +171,49 @@ export const ApiRoutes = {
138
171
  update: '/api/reminders/repeats',
139
172
  delete: (id) => `/api/reminders/repeats/${id}`,
140
173
  },
141
- priceMatches: {
142
- list: '/api/price-matches',
143
- get: (id) => `/api/price-matches/${id}`,
144
- create: '/api/price-matches',
145
- update: '/api/price-matches',
146
- delete: (id) => `/api/price-matches/${id}`,
147
- },
148
- directUserProfiles: {
149
- list: '/api/profiles/direct-users',
150
- get: (id) => `/api/profiles/direct-users/${id}`,
151
- getByUser: (userId) => `/api/profiles/direct-users/users/${userId}`,
152
- getOrders: (userId) => `/api/profiles/direct-users/users/${userId}/orders`,
153
- create: '/api/profiles/direct-users',
154
- onboard: (userId) => `/api/profiles/direct-users/${userId}`,
155
- update: '/api/profiles/direct-users',
156
- delete: (id) => `/api/profiles/direct-users/${id}`,
157
- },
158
- partnerPharmacyProfiles: {
159
- list: '/api/profiles/partner-pharmacies',
160
- get: (id) => `/api/profiles/partner-pharmacies/${id}`,
161
- getByUser: (userId) => `/api/profiles/partner-pharmacies/user/${userId}`,
162
- create: '/api/profiles/partner-pharmacies',
163
- update: '/api/profiles/partner-pharmacies',
164
- delete: (id) => `/api/profiles/partner-pharmacies/${id}`,
165
- getReportData: (id) => `/api/profiles/partner-pharmacies/${id}/reports`,
166
- },
167
- users: {
168
- data: (userId) => `/api/users/data/${userId}`,
169
- },
170
- uploads: {
171
- presign: '/api/uploads/presign',
172
- delete: '/api/uploads',
174
+ scripts: {
175
+ get: (filters) => {
176
+ const params = new URLSearchParams();
177
+ if (filters?.partnerPharmacyProfileId)
178
+ params.set('partnerPharmacyProfileId', String(filters.partnerPharmacyProfileId));
179
+ if (filters?.patientRecordId)
180
+ params.set('patientRecordId', String(filters.patientRecordId));
181
+ const query = params.toString();
182
+ return `/api/scripts${query ? `?${query}` : ''}`;
183
+ },
184
+ getById: (id) => `/api/scripts/${id}`,
185
+ createEscript: '/api/scripts/escripts',
186
+ createPaperScript: '/api/scripts/paper-scripts',
187
+ update: '/api/scripts',
188
+ delete: (id) => `/api/scripts/${id}`,
173
189
  },
174
190
  sms: {
175
191
  twilioStatus: '/api/webhooks/twilio/status',
176
192
  send: '/api/reminders/sms',
177
193
  },
178
- email: {
179
- contactFormInternal: '/api/emails/contact-requests',
194
+ staffProfiles: {
195
+ list: (filters) => {
196
+ const params = new URLSearchParams();
197
+ if (filters?.userId)
198
+ params.set('userId', filters.userId);
199
+ if (filters?.page)
200
+ params.set('page', String(filters.page));
201
+ if (filters?.limit)
202
+ params.set('limit', String(filters.limit));
203
+ const query = params.toString();
204
+ return `/api/profiles/staff-profiles${query ? `?${query}` : ''}`;
205
+ },
206
+ get: (id) => `/api/profiles/staff-profiles/${id}`,
207
+ create: '/api/profiles/staff-profiles',
208
+ update: '/api/profiles/staff-profiles',
209
+ updatePassword: (id) => `/api/profiles/staff-profiles/${id}/password`,
210
+ signIn: '/api/profiles/staff-profiles/sign-in',
180
211
  },
181
- cart: {
182
- getByDirectUser: (id) => `/api/carts/direct-users/${id}`,
183
- getByPartnerPharmacy: (id) => `/api/carts/partner-pharmacies/${id}`,
184
- put: '/api/carts',
185
- deleteByDirectUser: (id) => `/api/carts/direct-users/${id}`,
186
- deleteByPartnerPharmacy: (id) => `/api/carts/partner-pharmacies/${id}`,
212
+ uploads: {
213
+ presign: '/api/uploads/presign',
214
+ delete: '/api/uploads',
187
215
  },
188
- compoundDirect: {
189
- searchCustomers: '/api/compound-direct/customers',
190
- createCustomer: '/api/compound-direct/customer',
191
- getDraftScripts: '/api/compound-direct/draft-scripts',
192
- getDraftScriptById: (id) => `/api/compound-direct/draft-scripts/${id}`,
193
- listFormulations: '/api/compound-direct/formulations',
194
- getFormulationById: (id) => `/api/compound-direct/formulations/${id}`,
216
+ users: {
217
+ data: (userId) => `/api/users/data/${userId}`,
195
218
  },
196
219
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natch-the-storage/heathershaw-platform-types",
3
- "version": "1.9.5",
3
+ "version": "1.10.0",
4
4
  "description": "Interfaces and routes to use on the client",
5
5
  "license": "ISC",
6
6
  "author": "Natch Surana",