@bizmap/sdk 0.0.72 → 0.0.74
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/dist/main.d.ts +9 -6
- package/dist/main.js +7 -12
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -153,10 +153,11 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
153
153
|
current: z.ZodInt;
|
|
154
154
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
155
155
|
}, z.core.$strip>;
|
|
156
|
-
|
|
156
|
+
usedStorageInBytes: z.ZodObject<{
|
|
157
157
|
current: z.ZodNumber;
|
|
158
158
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
159
|
-
}, z.core.$strip
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
drpInMonths: z.ZodInt;
|
|
160
161
|
invoiceNoCounter: z.ZodInt;
|
|
161
162
|
tktNoCounter: z.ZodInt;
|
|
162
163
|
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
@@ -724,10 +725,11 @@ declare const CompanyState: z.ZodObject<{
|
|
|
724
725
|
current: z.ZodInt;
|
|
725
726
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
726
727
|
}, z.core.$strip>;
|
|
727
|
-
|
|
728
|
+
usedStorageInBytes: z.ZodObject<{
|
|
728
729
|
current: z.ZodNumber;
|
|
729
730
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
730
|
-
}, z.core.$strip
|
|
731
|
+
}, z.core.$strip>;
|
|
732
|
+
drpInMonths: z.ZodInt;
|
|
731
733
|
invoiceNoCounter: z.ZodInt;
|
|
732
734
|
tktNoCounter: z.ZodInt;
|
|
733
735
|
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
@@ -1584,10 +1586,11 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1584
1586
|
current: number;
|
|
1585
1587
|
lastModified: number | null;
|
|
1586
1588
|
};
|
|
1587
|
-
|
|
1589
|
+
usedStorageInBytes: {
|
|
1588
1590
|
current: number;
|
|
1589
1591
|
lastModified: number | null;
|
|
1590
|
-
}
|
|
1592
|
+
};
|
|
1593
|
+
drpInMonths: number;
|
|
1591
1594
|
invoiceNoCounter: number;
|
|
1592
1595
|
tktNoCounter: number;
|
|
1593
1596
|
lastSavedAt: number | null;
|
package/dist/main.js
CHANGED
|
@@ -127,16 +127,12 @@ var CompanyState = z7.object({
|
|
|
127
127
|
current: z7.int().min(1),
|
|
128
128
|
lastModified: Timestamp.nullable()
|
|
129
129
|
}),
|
|
130
|
-
|
|
131
|
-
z7.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
).refine(
|
|
137
|
-
(data) => data.used.current <= data.max.current,
|
|
138
|
-
"The total storage used cannot exceed the max allowed storage."
|
|
139
|
-
),
|
|
130
|
+
usedStorageInBytes: z7.object({
|
|
131
|
+
current: z7.number(),
|
|
132
|
+
lastModified: Timestamp.nullable()
|
|
133
|
+
}),
|
|
134
|
+
/** Data retention period in months */
|
|
135
|
+
drpInMonths: z7.int().min(1),
|
|
140
136
|
/** A counter for the company's invoice no.
|
|
141
137
|
* @note This should only be null when the cycle resets
|
|
142
138
|
*/
|
|
@@ -782,7 +778,6 @@ function findNextAvailableStaff(userUids, algorithm, staff) {
|
|
|
782
778
|
}
|
|
783
779
|
|
|
784
780
|
// src/functions/scheduleAppointment.ts
|
|
785
|
-
import { adminRoles as adminRoles2 } from "src/main";
|
|
786
781
|
async function scheduleAppointment(request) {
|
|
787
782
|
request.form = ScheduleAppointmentForm.parse(request.form);
|
|
788
783
|
request.sender = UserDetails.parse(request.sender);
|
|
@@ -858,7 +853,7 @@ async function scheduleAppointment(request) {
|
|
|
858
853
|
if (totalPaid < totalOwed) throw new Error("Insufficient payments made.");
|
|
859
854
|
}
|
|
860
855
|
if (stateCopy.credits.current < request.cost) {
|
|
861
|
-
if (companyUser.roles.some((role) =>
|
|
856
|
+
if (companyUser.roles.some((role) => adminRoles.safeParse(role).success)) {
|
|
862
857
|
throw new Error("Account balance has insufficient funds.");
|
|
863
858
|
} else {
|
|
864
859
|
throw new Error(
|