@bizmap/sdk 0.0.6 → 0.0.8

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 CHANGED
@@ -28,10 +28,11 @@ type PriceTag = z.infer<typeof PriceTag>;
28
28
  declare const CompanyIdentity: z.ZodObject<{
29
29
  createdAt: z.ZodReadonly<z.ZodNumber>;
30
30
  lastModified: z.ZodNullable<z.ZodNumber>;
31
- uid: z.ZodString;
31
+ uid: z.ZodReadonly<z.ZodString>;
32
32
  displayName: z.ZodString;
33
- logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ logo: z.ZodOptional<z.ZodString>;
34
34
  slogan: z.ZodString;
35
+ regNo: z.ZodReadonly<z.ZodString>;
35
36
  email: z.ZodEmail;
36
37
  address: z.ZodRecord<z.ZodEnum<{
37
38
  streetAddress: "streetAddress";
@@ -40,24 +41,22 @@ declare const CompanyIdentity: z.ZodObject<{
40
41
  country: "country";
41
42
  }>, z.ZodString>;
42
43
  phoneNumber: z.ZodOptional<z.ZodString>;
44
+ trn: z.ZodOptional<z.ZodString>;
45
+ gctRegNo: z.ZodOptional<z.ZodString>;
43
46
  }, z.core.$strip>;
44
47
  type CompanyIdentity = z.infer<typeof CompanyIdentity>;
45
48
  declare const CompanyOpState: z.ZodObject<{
46
49
  createdAt: z.ZodReadonly<z.ZodNumber>;
47
50
  lastModified: z.ZodNullable<z.ZodNumber>;
48
- uid: z.ZodString;
51
+ uid: z.ZodReadonly<z.ZodString>;
49
52
  availableBalance: z.ZodNumber;
50
53
  isOffline: z.ZodBoolean;
51
54
  }, z.core.$strip>;
52
55
  type CompanyOpState = z.infer<typeof CompanyOpState>;
53
- declare const appointmentDistAlgs: z.ZodEnum<{
54
- RR: "RR";
55
- LOR: "LOR";
56
- }>;
57
56
  declare const CompanyPreferences: z.ZodObject<{
58
57
  createdAt: z.ZodReadonly<z.ZodNumber>;
59
58
  lastModified: z.ZodNullable<z.ZodNumber>;
60
- uid: z.ZodString;
59
+ uid: z.ZodReadonly<z.ZodString>;
61
60
  userProvisions: z.ZodNumber;
62
61
  apptDistAlg: z.ZodEnum<{
63
62
  RR: "RR";
@@ -72,12 +71,10 @@ type CompanyPreferences = z.infer<typeof CompanyPreferences>;
72
71
  declare const CompanyBillingModel: z.ZodObject<{
73
72
  createdAt: z.ZodReadonly<z.ZodNumber>;
74
73
  lastModified: z.ZodNullable<z.ZodNumber>;
75
- uid: z.ZodString;
76
- trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
- gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
- billingProvider: z.ZodEnum<{
74
+ uid: z.ZodReadonly<z.ZodString>;
75
+ biller: z.ZodEnum<{
79
76
  doc: "doc";
80
- physAsst: "physAsst";
77
+ fdc: "fdc";
81
78
  }>;
82
79
  primaryCurrency: z.ZodEnum<{
83
80
  JMD: "JMD";
@@ -96,13 +93,13 @@ declare const CompanyBillingModel: z.ZodObject<{
96
93
  fixedAmount: z.ZodNumber;
97
94
  percentage: z.ZodNumber;
98
95
  }, z.core.$strip>>>;
99
- services: z.ZodArray<z.ZodObject<{
96
+ services: z.ZodOptional<z.ZodArray<z.ZodObject<{
100
97
  createdAt: z.ZodReadonly<z.ZodNumber>;
101
98
  lastModified: z.ZodNullable<z.ZodNumber>;
102
99
  uid: z.ZodString;
103
100
  name: z.ZodString;
104
101
  cost: z.ZodNumber;
105
- }, z.core.$strip>>;
102
+ }, z.core.$strip>>>;
106
103
  acceptedCurrencies: z.ZodArray<z.ZodEnum<{
107
104
  JMD: "JMD";
108
105
  }>>;
@@ -179,34 +176,6 @@ declare const CompanyRegistrationClaims: z.ZodObject<{
179
176
  }, z.core.$strip>;
180
177
  }, z.core.$strip>;
181
178
  type CompanyRegistrationClaims = z.infer<typeof CompanyRegistrationClaims>;
182
-
183
- declare const UserCompaniesDTO: z.ZodObject<{
184
- companies: z.ZodArray<z.ZodObject<{
185
- createdAt: z.ZodReadonly<z.ZodNumber>;
186
- lastModified: z.ZodNullable<z.ZodNumber>;
187
- uid: z.ZodString;
188
- displayName: z.ZodString;
189
- logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
190
- slogan: z.ZodString;
191
- email: z.ZodEmail;
192
- address: z.ZodRecord<z.ZodEnum<{
193
- streetAddress: "streetAddress";
194
- city: "city";
195
- parish: "parish";
196
- country: "country";
197
- }>, z.ZodString>;
198
- phoneNumber: z.ZodOptional<z.ZodString>;
199
- }, z.core.$strip>>;
200
- }, z.core.$strip>;
201
- type UserCompaniesDTO = z.infer<typeof UserCompaniesDTO>;
202
- declare const companyUserRoles: z.ZodEnum<{
203
- doc: "doc";
204
- physAsst: "physAsst";
205
- rcpst: "rcpst";
206
- cshr: "cshr";
207
- fdc: "fdc";
208
- admin: "admin";
209
- }>;
210
179
  declare const CompanyUser: z.ZodObject<{
211
180
  createdAt: z.ZodReadonly<z.ZodNumber>;
212
181
  lastModified: z.ZodNullable<z.ZodNumber>;
@@ -234,9 +203,10 @@ declare const CompanyUser: z.ZodObject<{
234
203
  uid: z.ZodString;
235
204
  }, z.core.$strip>;
236
205
  type CompanyUser = z.infer<typeof CompanyUser>;
237
- type CompanyUserRole = z.infer<typeof companyUserRoles>;
238
- declare const CompanyUsersOverviewDTO: z.ZodObject<{
239
- users: z.ZodArray<z.ZodObject<{
206
+ /** The unpacked Staff Details */
207
+ declare const StaffDetails: z.ZodObject<{
208
+ uid: z.ZodReadonly<z.ZodString>;
209
+ members: z.ZodArray<z.ZodObject<{
240
210
  createdAt: z.ZodReadonly<z.ZodNumber>;
241
211
  lastModified: z.ZodNullable<z.ZodNumber>;
242
212
  lastActive: z.ZodNumber;
@@ -264,7 +234,24 @@ declare const CompanyUsersOverviewDTO: z.ZodObject<{
264
234
  }, z.core.$strip>>;
265
235
  partnerMap: z.ZodRecord<z.ZodEmail, z.ZodArray<z.ZodEmail>>;
266
236
  }, z.core.$strip>;
267
- type CompanyUsersOverviewDTO = z.infer<typeof CompanyUsersOverviewDTO>;
237
+ type StaffDetails = z.infer<typeof StaffDetails>;
238
+
239
+ declare const TimeLog: z.ZodObject<{
240
+ createdAt: z.ZodReadonly<z.ZodNumber>;
241
+ lastModified: z.ZodNullable<z.ZodNumber>;
242
+ }, z.core.$strip>;
243
+ type TimeLog = z.infer<typeof TimeLog>;
244
+ declare const Time: z.ZodString;
245
+
246
+ declare const companyUserRoles: z.ZodEnum<{
247
+ doc: "doc";
248
+ physAsst: "physAsst";
249
+ rcpst: "rcpst";
250
+ cshr: "cshr";
251
+ fdc: "fdc";
252
+ admin: "admin";
253
+ }>;
254
+ type CompanyUserRole = z.infer<typeof companyUserRoles>;
268
255
  declare const companyPartnerRoles: z.ZodEnum<{
269
256
  doc: "doc";
270
257
  physAsst: "physAsst";
@@ -278,12 +265,10 @@ declare const employeeRoles: z.ZodEnum<{
278
265
  fdc: "fdc";
279
266
  }>;
280
267
  type EmployeeRole = z.infer<typeof employeeRoles>;
268
+ declare const appointmentDistAlgs: z.ZodEnum<{
269
+ RR: "RR";
270
+ LOR: "LOR";
271
+ }>;
272
+ type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
281
273
 
282
- declare const TimeLog: z.ZodObject<{
283
- createdAt: z.ZodReadonly<z.ZodNumber>;
284
- lastModified: z.ZodNullable<z.ZodNumber>;
285
- }, z.core.$strip>;
286
- type TimeLog = z.infer<typeof TimeLog>;
287
- declare const Time: z.ZodString;
288
-
289
- export { CompanyBillingModel, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyPreferences, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, CompanyUsersOverviewDTO, type EmployeeRole, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, Time, TimeLog, UserCompaniesDTO, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles };
274
+ export { type AppointmentDistAlg, CompanyBillingModel, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyPreferences, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, Time, TimeLog, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles };
package/dist/main.js CHANGED
@@ -36,67 +36,40 @@ import {
36
36
  currencies,
37
37
  FileDetails,
38
38
  PhoneNumber,
39
- UserModel as UserModel2
39
+ UserModel
40
40
  } from "@wavy/util";
41
- import * as z4 from "zod";
42
-
43
- // src/schemas/User.ts
44
41
  import * as z3 from "zod";
45
- import { UserModel } from "@wavy/util";
46
- var UserCompaniesDTO = z3.object({
47
- companies: z3.array(CompanyIdentity)
48
- });
49
- var companyUserRoles = z3.enum([
50
- "doc",
51
- "physAsst",
52
- "rcpst",
53
- "cshr",
54
- "fdc",
55
- "admin"
56
- ]);
57
- var CompanyUser = z3.object({
58
- ...UserModel.shape,
59
- lastActive: z3.number(),
60
- status: z3.enum(["inviteSent", "active", "inactive"]),
61
- roles: z3.array(companyUserRoles),
62
- ...TimeLog.shape
63
- });
64
- var CompanyUsersOverviewDTO = z3.object({
65
- users: z3.array(CompanyUser),
66
- /**doc (one) -> physAsst (many) */
67
- partnerMap: z3.record(z3.email(), z3.array(z3.email()))
68
- });
69
- var companyPartnerRoles = companyUserRoles.extract([
70
- "doc",
71
- "physAsst"
72
- ]);
73
- var employeeRoles = companyUserRoles.exclude(["admin"]);
74
-
75
- // src/schemas/Company.ts
76
- var CompanyIdentity = z4.object({
42
+ import { appointmentDistAlgs, companyUserRoles } from "src/enums/CompanyEnums";
43
+ var CompanyIdentity = z3.object({
44
+ uid: z3.string().readonly(),
77
45
  // The company's uid
78
- uid: z4.string(),
79
- displayName: z4.string(),
80
- logo: z4.string().nullish(),
81
- slogan: z4.string(),
82
- email: z4.email(),
46
+ // Organizational
47
+ displayName: z3.string(),
48
+ logo: z3.string().optional(),
49
+ slogan: z3.string(),
50
+ regNo: z3.string().readonly(),
51
+ // The company's registration number
52
+ // Social
53
+ email: z3.email(),
83
54
  address: Address,
84
55
  phoneNumber: PhoneNumber.optional(),
56
+ // Legal
57
+ trn: z3.string().optional(),
58
+ gctRegNo: z3.string().optional(),
85
59
  ...TimeLog.shape
86
60
  });
87
- var CompanyOpState = z4.object({
61
+ var CompanyOpState = z3.object({
88
62
  // The company's uid
89
- uid: z4.string(),
90
- availableBalance: z4.number(),
91
- isOffline: z4.boolean(),
63
+ uid: CompanyIdentity.shape.uid,
64
+ availableBalance: z3.number(),
65
+ isOffline: z3.boolean(),
92
66
  ...TimeLog.shape
93
67
  });
94
- var appointmentDistAlgs = z4.enum(["RR", "LOR"]);
95
- var CompanyPreferences = z4.object({
68
+ var CompanyPreferences = z3.object({
96
69
  // The company's uid
97
- uid: z4.string(),
70
+ uid: CompanyIdentity.shape.uid,
98
71
  /** The amount of user provisions made for this company */
99
- userProvisions: z4.number(),
72
+ userProvisions: z3.number(),
100
73
  /**
101
74
  * @property RR (Round Robin): Even distribution.
102
75
  * @property LOR (Least Outstanding Requests): Distribute based on availability.
@@ -106,40 +79,69 @@ var CompanyPreferences = z4.object({
106
79
  // [1] when the working directory on the server should reset
107
80
  // [2] the time that company session requests are cut-off
108
81
  // (the cutoff time affects non-admins)
109
- workingHours: z4.object({
82
+ workingHours: z3.object({
110
83
  start: Time,
111
84
  end: Time
112
85
  }),
113
86
  ...TimeLog.shape
114
87
  });
115
- var CompanyBillingModel = z4.object({
116
- uid: z4.string(),
117
- trn: z4.string().nullish(),
118
- gctRegNo: z4.string().nullish(),
119
- billingProvider: companyUserRoles.extract(["doc", "physAsst"]),
88
+ var CompanyBillingModel = z3.object({
89
+ uid: CompanyIdentity.shape.uid,
90
+ /** The user that provides the bill to the client */
91
+ biller: companyUserRoles.extract(["doc", "fdc"]),
120
92
  primaryCurrency: currencies,
121
- additionalFees: z4.array(PriceAdjustment).optional(),
122
- discounts: z4.array(PriceAdjustment).optional(),
123
- services: z4.array(PriceTag),
124
- acceptedCurrencies: z4.array(currencies),
93
+ additionalFees: z3.array(PriceAdjustment).optional(),
94
+ discounts: z3.array(PriceAdjustment).optional(),
95
+ services: z3.array(PriceTag).optional(),
96
+ acceptedCurrencies: z3.array(currencies),
125
97
  ...TimeLog.shape
126
98
  });
127
- var RegisterCompanyForm = z4.object({
128
- regNo: z4.string(),
129
- userProvisions: z4.number(),
130
- slogan: z4.string(),
131
- email: z4.email(),
132
- phoneNumber: z4.string(),
99
+ var RegisterCompanyForm = z3.object({
100
+ regNo: z3.string(),
101
+ userProvisions: z3.number(),
102
+ slogan: z3.string(),
103
+ email: z3.email(),
104
+ phoneNumber: PhoneNumber,
133
105
  workingHours: CompanyPreferences.shape.workingHours,
134
106
  logo: FileDetails,
135
107
  receipt: FileDetails,
136
- _claims: z4.string()
108
+ _claims: z3.string()
137
109
  });
138
- var CompanyRegistrationClaims = z4.object({
139
- sender: UserModel2,
110
+ var CompanyRegistrationClaims = z3.object({
111
+ sender: UserModel,
140
112
  pricingRate: PricingRate.shape.companyRegistration,
141
113
  ...TimeLog.shape
142
114
  });
115
+ var CompanyUser = z3.object({
116
+ ...UserModel.shape,
117
+ lastActive: z3.number(),
118
+ status: z3.enum(["inviteSent", "active", "inactive"]),
119
+ roles: z3.array(companyUserRoles),
120
+ ...TimeLog.shape
121
+ });
122
+ var StaffDetails = z3.object({
123
+ uid: CompanyIdentity.shape.uid,
124
+ members: z3.array(CompanyUser),
125
+ /**doc (one) -> physAsst (many) */
126
+ partnerMap: z3.record(z3.email(), z3.array(z3.email()))
127
+ });
128
+
129
+ // src/enums/CompanyEnums.ts
130
+ import * as z4 from "zod";
131
+ var companyUserRoles2 = z4.enum([
132
+ "doc",
133
+ "physAsst",
134
+ "rcpst",
135
+ "cshr",
136
+ "fdc",
137
+ "admin"
138
+ ]);
139
+ var companyPartnerRoles = companyUserRoles2.extract([
140
+ "doc",
141
+ "physAsst"
142
+ ]);
143
+ var employeeRoles = companyUserRoles2.exclude(["admin"]);
144
+ var appointmentDistAlgs2 = z4.enum(["RR", "LOR"]);
143
145
  export {
144
146
  CompanyBillingModel,
145
147
  CompanyIdentity,
@@ -147,16 +149,15 @@ export {
147
149
  CompanyPreferences,
148
150
  CompanyRegistrationClaims,
149
151
  CompanyUser,
150
- CompanyUsersOverviewDTO,
151
152
  PriceAdjustment,
152
153
  PriceTag,
153
154
  PricingRate,
154
155
  RegisterCompanyForm,
156
+ StaffDetails,
155
157
  Time,
156
158
  TimeLog,
157
- UserCompaniesDTO,
158
- appointmentDistAlgs,
159
+ appointmentDistAlgs2 as appointmentDistAlgs,
159
160
  companyPartnerRoles,
160
- companyUserRoles,
161
+ companyUserRoles2 as companyUserRoles,
161
162
  employeeRoles
162
163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",