@natch-the-storage/heathershaw-platform-types 1.11.7 → 1.12.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.
- package/build/validators.d.ts +15 -0
- package/build/validators.js +27 -0
- package/package.json +1 -1
package/build/validators.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const cDProductCategoryValues: string[];
|
|
1
2
|
export declare const orderFulfillmentValues: readonly ["PICKUP", "POST", "COURIER", "DELIVER"];
|
|
2
3
|
export declare const orderStatusValues: readonly ["RECEIVED", "PROCESSING", "DISPATCHED", "DELIVERED", "COMPLETED"];
|
|
3
4
|
export declare const paperScriptReminderStatusValues: readonly ["PENDING", "RECEIVED", "ESCALATED"];
|
|
@@ -12,6 +13,7 @@ export declare const staffProfileRoleValues: readonly ["STAFF", "ADMIN", "COUNSE
|
|
|
12
13
|
export declare const staffProfileStatusValues: readonly ["ACTIVE", "SUSPENDED"];
|
|
13
14
|
export declare const auStatesValues: string[];
|
|
14
15
|
export declare const discountTierValues: number[];
|
|
16
|
+
export type CDProductCategory = (typeof cDProductCategoryValues)[number];
|
|
15
17
|
export type OrderFulfillment = (typeof orderFulfillmentValues)[number];
|
|
16
18
|
export type OrderStatus = (typeof orderStatusValues)[number];
|
|
17
19
|
export type PaperScriptReminderStatus = (typeof paperScriptReminderStatusValues)[number];
|
|
@@ -26,6 +28,10 @@ export type StaffProfileRole = (typeof staffProfileRoleValues)[number];
|
|
|
26
28
|
export type StaffProfileStatus = (typeof staffProfileStatusValues)[number];
|
|
27
29
|
export type AuStates = (typeof auStatesValues)[number];
|
|
28
30
|
export type DiscountTiers = (typeof discountTierValues)[number];
|
|
31
|
+
export declare const CDProductCategoriesIdLabel: {
|
|
32
|
+
id: string;
|
|
33
|
+
label: CDProductCategory;
|
|
34
|
+
}[];
|
|
29
35
|
export type Pharmacy = {
|
|
30
36
|
name: string;
|
|
31
37
|
address: string;
|
|
@@ -624,6 +630,14 @@ export interface CDFormulationList {
|
|
|
624
630
|
infoUrl: string;
|
|
625
631
|
isSignedOff: boolean;
|
|
626
632
|
}
|
|
633
|
+
export type CDProduct = Omit<CDFormulation, 'pricing'> & Omit<CDScriptPriceOption, 'id'> & {
|
|
634
|
+
pricingId: number;
|
|
635
|
+
category: CDProductCategory;
|
|
636
|
+
};
|
|
637
|
+
export declare const CDProductFormsIdLabels: {
|
|
638
|
+
id: string;
|
|
639
|
+
label: string;
|
|
640
|
+
}[];
|
|
627
641
|
export interface CDPriceOptionUpdate {
|
|
628
642
|
formulationPriceId: number;
|
|
629
643
|
formulationId: number;
|
|
@@ -674,6 +688,7 @@ export declare const ApiRoutes: {
|
|
|
674
688
|
getDraftScriptById: (id: number) => string;
|
|
675
689
|
getHouseholdDraftScripts: string;
|
|
676
690
|
listFormulations: string;
|
|
691
|
+
listProducts: string;
|
|
677
692
|
getFormulationById: (id: number) => string;
|
|
678
693
|
updatePriceOptions: string;
|
|
679
694
|
};
|
package/build/validators.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region Enum value arrays ──────────────────────────────────────────────────────────
|
|
2
|
+
export const cDProductCategoryValues = ['OTC', 'Schedule 4', 'Schedule 8'];
|
|
2
3
|
export const orderFulfillmentValues = [
|
|
3
4
|
'PICKUP',
|
|
4
5
|
'POST',
|
|
@@ -56,6 +57,11 @@ export const auStatesValues = [
|
|
|
56
57
|
'NT',
|
|
57
58
|
];
|
|
58
59
|
export const discountTierValues = [0.9, 0.88, 0.875, 0.85, 0.8, 0.75, 0.7];
|
|
60
|
+
//#endregion ──────────────────────────────────────────────────────────────────────
|
|
61
|
+
// #region Functions
|
|
62
|
+
export const CDProductCategoriesIdLabel = cDProductCategoryValues.map((v) => {
|
|
63
|
+
return { id: v, label: v === 'schedule_1' ? 'OTC' : v.replace('_', ' ') };
|
|
64
|
+
});
|
|
59
65
|
export const PHARMACIES = [
|
|
60
66
|
{
|
|
61
67
|
name: 'Malvern Road',
|
|
@@ -124,6 +130,26 @@ export const CompoundDirectAnimalId = {
|
|
|
124
130
|
other: { id: 25, name: 'N/A' },
|
|
125
131
|
};
|
|
126
132
|
export const AnimalSpeciesKeys = Object.keys(CompoundDirectAnimalId);
|
|
133
|
+
export const CDProductFormsIdLabels = [
|
|
134
|
+
{ id: 'capsule', label: 'Capsules' },
|
|
135
|
+
{ id: 'oral liquid', label: 'Oral liquids / suspensions' },
|
|
136
|
+
{ id: 'suppository', label: 'Suppositories' },
|
|
137
|
+
{ id: 'ointment', label: 'Ointments' },
|
|
138
|
+
{ id: 'topical liquid', label: 'Topical Liquids' },
|
|
139
|
+
{ id: 'scooped powder', label: 'Scooped Powders' },
|
|
140
|
+
{ id: 'cream', label: 'Creams' },
|
|
141
|
+
{ id: 'troche', label: 'Troches / lozenges' },
|
|
142
|
+
{ id: 'pessary', label: 'Pessaries' },
|
|
143
|
+
{ id: 'gummy', label: 'Gummies' },
|
|
144
|
+
{ id: 'gel', label: 'Gels' },
|
|
145
|
+
{ id: 'lotion', label: 'Lotions' },
|
|
146
|
+
{ id: 'patch', label: 'Transdermal patches' },
|
|
147
|
+
{ id: 'nasal spray', label: 'Nasal sprays' },
|
|
148
|
+
{ id: 'vaginal', label: 'Vaginal creams / gels' },
|
|
149
|
+
{ id: 'drop', label: 'Drops' },
|
|
150
|
+
{ id: 'spray', label: 'Sprays' },
|
|
151
|
+
{ id: 'tablet', label: 'Tablets' },
|
|
152
|
+
];
|
|
127
153
|
//#endregion ──────────────────────────────────────────────────────────────────────
|
|
128
154
|
//#region contact form ────────────────────────────────────────────────────────────
|
|
129
155
|
export const parseCategory = (category) => {
|
|
@@ -181,6 +207,7 @@ export const ApiRoutes = {
|
|
|
181
207
|
getDraftScriptById: (id) => `/api/compound-direct/draft-scripts/${id}`,
|
|
182
208
|
getHouseholdDraftScripts: '/api/compound-direct/scripts/households',
|
|
183
209
|
listFormulations: '/api/compound-direct/formulations',
|
|
210
|
+
listProducts: '/api/compound-direct/products',
|
|
184
211
|
getFormulationById: (id) => `/api/compound-direct/formulations/${id}`,
|
|
185
212
|
updatePriceOptions: '/api/compound-direct/formulations/prices',
|
|
186
213
|
},
|