@managemint-solutions/sdk 0.9.0 → 0.16.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.
Files changed (49) hide show
  1. package/dist/audit/index.d.ts +15 -0
  2. package/dist/audit/index.js +37 -14
  3. package/dist/audit/index.js.map +1 -1
  4. package/dist/billing/dto.d.ts +33 -0
  5. package/dist/billing/dto.js +71 -0
  6. package/dist/billing/dto.js.map +1 -0
  7. package/dist/billing/index.d.ts +35 -0
  8. package/dist/billing/index.js +115 -0
  9. package/dist/billing/index.js.map +1 -0
  10. package/dist/client.d.ts +8 -0
  11. package/dist/client.js +12 -0
  12. package/dist/client.js.map +1 -1
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.js +7 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/nest/index.d.ts +11 -0
  17. package/dist/nest/index.js +17 -1
  18. package/dist/nest/index.js.map +1 -1
  19. package/dist/notifications/dto.d.ts +10 -0
  20. package/dist/notifications/dto.js +63 -0
  21. package/dist/notifications/dto.js.map +1 -0
  22. package/dist/notifications/index.d.ts +139 -0
  23. package/dist/notifications/index.js +354 -0
  24. package/dist/notifications/index.js.map +1 -0
  25. package/dist/organizations/dto.d.ts +62 -0
  26. package/dist/organizations/dto.js +445 -0
  27. package/dist/organizations/dto.js.map +1 -0
  28. package/dist/organizations/index.d.ts +72 -0
  29. package/dist/organizations/index.js +221 -0
  30. package/dist/organizations/index.js.map +1 -0
  31. package/dist/permissions/dto.d.ts +27 -0
  32. package/dist/permissions/dto.js +215 -0
  33. package/dist/permissions/dto.js.map +1 -0
  34. package/dist/permissions/index.d.ts +36 -0
  35. package/dist/permissions/index.js +110 -0
  36. package/dist/permissions/index.js.map +1 -0
  37. package/dist/service-client/index.d.ts +72 -0
  38. package/dist/service-client/index.js +119 -0
  39. package/dist/service-client/index.js.map +1 -0
  40. package/dist/users/dto.d.ts +48 -0
  41. package/dist/users/dto.js +267 -0
  42. package/dist/users/dto.js.map +1 -0
  43. package/dist/users/index.d.ts +38 -0
  44. package/dist/users/index.js +144 -0
  45. package/dist/users/index.js.map +1 -0
  46. package/dist/webhook-events/index.d.ts +65 -0
  47. package/dist/webhook-events/index.js +109 -0
  48. package/dist/webhook-events/index.js.map +1 -0
  49. package/package.json +2 -2
@@ -0,0 +1,445 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UpdateOrganizationDto = exports.CreateOrganizationDto = void 0;
13
+ const enum_1 = require("@managemint-solutions/entities/organization/enum");
14
+ const class_validator_1 = require("class-validator");
15
+ const validators_1 = require("../validators");
16
+ const class_transformer_1 = require("class-transformer");
17
+ class CreateOrganizationDto {
18
+ org_type;
19
+ org_name;
20
+ org_trading_name;
21
+ org_vat_number;
22
+ org_registration_number;
23
+ org_email;
24
+ org_website;
25
+ org_phone;
26
+ org_address_line_1;
27
+ org_address_line_2;
28
+ org_city;
29
+ org_state;
30
+ org_postal_code;
31
+ org_country;
32
+ use_address_for_billing = true;
33
+ org_billing_address_line_1;
34
+ org_billing_address_line_2;
35
+ org_billing_city;
36
+ org_billing_state;
37
+ org_billing_postal_code;
38
+ org_billing_country;
39
+ org_consent_given;
40
+ org_industry;
41
+ org_marketting_consent_given = false;
42
+ org_currency;
43
+ owner_first_name;
44
+ owner_last_name;
45
+ owner_email;
46
+ owner_country_code;
47
+ owner_phone;
48
+ owner_profile_image;
49
+ module_ids;
50
+ }
51
+ exports.CreateOrganizationDto = CreateOrganizationDto;
52
+ __decorate([
53
+ (0, class_validator_1.IsEnum)(enum_1.OrganizationTypes, { message: 'Organization type is required' }),
54
+ __metadata("design:type", String)
55
+ ], CreateOrganizationDto.prototype, "org_type", void 0);
56
+ __decorate([
57
+ (0, class_validator_1.IsString)({ message: 'Organization name is required' }),
58
+ (0, class_validator_1.MinLength)(1, { message: 'Organization name must be at least 1 characters' }),
59
+ (0, class_validator_1.MaxLength)(255, { message: 'Organization name must be less than 255 characters' }),
60
+ __metadata("design:type", String)
61
+ ], CreateOrganizationDto.prototype, "org_name", void 0);
62
+ __decorate([
63
+ (0, class_validator_1.IsOptional)(),
64
+ (0, class_validator_1.IsString)({ message: 'Trading name is required' }),
65
+ __metadata("design:type", Object)
66
+ ], CreateOrganizationDto.prototype, "org_trading_name", void 0);
67
+ __decorate([
68
+ (0, class_validator_1.IsOptional)(),
69
+ (0, class_validator_1.IsString)({ message: 'VAT number is required' }),
70
+ __metadata("design:type", Object)
71
+ ], CreateOrganizationDto.prototype, "org_vat_number", void 0);
72
+ __decorate([
73
+ (0, class_validator_1.IsOptional)(),
74
+ (0, class_validator_1.IsString)({ message: 'Registration number is required' }),
75
+ __metadata("design:type", Object)
76
+ ], CreateOrganizationDto.prototype, "org_registration_number", void 0);
77
+ __decorate([
78
+ (0, class_validator_1.IsEmail)({}, { message: 'Email is required' }),
79
+ __metadata("design:type", String)
80
+ ], CreateOrganizationDto.prototype, "org_email", void 0);
81
+ __decorate([
82
+ (0, class_validator_1.IsOptional)(),
83
+ (0, class_validator_1.IsString)({ message: 'Website URL' }),
84
+ __metadata("design:type", Object)
85
+ ], CreateOrganizationDto.prototype, "org_website", void 0);
86
+ __decorate([
87
+ (0, class_validator_1.IsOptional)(),
88
+ (0, class_validator_1.IsString)(),
89
+ __metadata("design:type", Object)
90
+ ], CreateOrganizationDto.prototype, "org_phone", void 0);
91
+ __decorate([
92
+ (0, class_validator_1.IsOptional)(),
93
+ (0, class_validator_1.IsString)({ message: 'Address line 1 is required' }),
94
+ __metadata("design:type", Object)
95
+ ], CreateOrganizationDto.prototype, "org_address_line_1", void 0);
96
+ __decorate([
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.IsString)({ message: 'Address line 2' }),
99
+ __metadata("design:type", Object)
100
+ ], CreateOrganizationDto.prototype, "org_address_line_2", void 0);
101
+ __decorate([
102
+ (0, class_validator_1.IsOptional)(),
103
+ (0, class_validator_1.IsString)({ message: 'City is required' }),
104
+ __metadata("design:type", Object)
105
+ ], CreateOrganizationDto.prototype, "org_city", void 0);
106
+ __decorate([
107
+ (0, class_validator_1.IsOptional)(),
108
+ (0, class_validator_1.IsString)({ message: 'State is required' }),
109
+ __metadata("design:type", Object)
110
+ ], CreateOrganizationDto.prototype, "org_state", void 0);
111
+ __decorate([
112
+ (0, class_validator_1.IsOptional)(),
113
+ (0, class_validator_1.IsString)({ message: 'Postal code is required' }),
114
+ __metadata("design:type", Object)
115
+ ], CreateOrganizationDto.prototype, "org_postal_code", void 0);
116
+ __decorate([
117
+ (0, class_validator_1.IsOptional)(),
118
+ (0, class_validator_1.IsString)({ message: 'Country is required' }),
119
+ __metadata("design:type", Object)
120
+ ], CreateOrganizationDto.prototype, "org_country", void 0);
121
+ __decorate([
122
+ (0, class_validator_1.IsBoolean)({ message: 'Use address for billing is required' }),
123
+ __metadata("design:type", Boolean)
124
+ ], CreateOrganizationDto.prototype, "use_address_for_billing", void 0);
125
+ __decorate([
126
+ (0, class_validator_1.IsOptional)(),
127
+ (0, class_validator_1.IsString)({ message: 'Billing address line 1 is required' }),
128
+ __metadata("design:type", Object)
129
+ ], CreateOrganizationDto.prototype, "org_billing_address_line_1", void 0);
130
+ __decorate([
131
+ (0, class_validator_1.IsOptional)(),
132
+ (0, class_validator_1.IsString)({ message: 'Billing address line 2' }),
133
+ __metadata("design:type", Object)
134
+ ], CreateOrganizationDto.prototype, "org_billing_address_line_2", void 0);
135
+ __decorate([
136
+ (0, class_validator_1.IsOptional)(),
137
+ (0, class_validator_1.IsString)({ message: 'Billing city is required' }),
138
+ __metadata("design:type", Object)
139
+ ], CreateOrganizationDto.prototype, "org_billing_city", void 0);
140
+ __decorate([
141
+ (0, class_validator_1.IsOptional)(),
142
+ (0, class_validator_1.IsString)({ message: 'Billing state is required' }),
143
+ __metadata("design:type", Object)
144
+ ], CreateOrganizationDto.prototype, "org_billing_state", void 0);
145
+ __decorate([
146
+ (0, class_validator_1.IsOptional)(),
147
+ (0, class_validator_1.IsString)({ message: 'Billing postal code is required' }),
148
+ __metadata("design:type", Object)
149
+ ], CreateOrganizationDto.prototype, "org_billing_postal_code", void 0);
150
+ __decorate([
151
+ (0, class_validator_1.IsOptional)(),
152
+ (0, class_validator_1.IsString)({ message: 'Billing country is required' }),
153
+ __metadata("design:type", Object)
154
+ ], CreateOrganizationDto.prototype, "org_billing_country", void 0);
155
+ __decorate([
156
+ (0, class_validator_1.Equals)(true, { message: 'Consent is required' }),
157
+ __metadata("design:type", Boolean)
158
+ ], CreateOrganizationDto.prototype, "org_consent_given", void 0);
159
+ __decorate([
160
+ (0, class_validator_1.IsOptional)(),
161
+ (0, class_validator_1.IsString)({ message: 'Industry is required' }),
162
+ __metadata("design:type", Object)
163
+ ], CreateOrganizationDto.prototype, "org_industry", void 0);
164
+ __decorate([
165
+ (0, class_validator_1.IsBoolean)({ message: 'Marketing consent is required' }),
166
+ __metadata("design:type", Boolean)
167
+ ], CreateOrganizationDto.prototype, "org_marketting_consent_given", void 0);
168
+ __decorate([
169
+ (0, class_validator_1.IsString)({ message: 'Organization currency is required' }),
170
+ __metadata("design:type", String)
171
+ ], CreateOrganizationDto.prototype, "org_currency", void 0);
172
+ __decorate([
173
+ (0, class_validator_1.IsString)({ message: 'Owner first name is required' }),
174
+ __metadata("design:type", String)
175
+ ], CreateOrganizationDto.prototype, "owner_first_name", void 0);
176
+ __decorate([
177
+ (0, class_validator_1.IsString)({ message: 'Owner last name is required' }),
178
+ __metadata("design:type", String)
179
+ ], CreateOrganizationDto.prototype, "owner_last_name", void 0);
180
+ __decorate([
181
+ (0, class_validator_1.IsEmail)({}, { message: 'Owner email is required' }),
182
+ __metadata("design:type", String)
183
+ ], CreateOrganizationDto.prototype, "owner_email", void 0);
184
+ __decorate([
185
+ (0, class_validator_1.IsString)({ message: 'Owner country code is required' }),
186
+ __metadata("design:type", String)
187
+ ], CreateOrganizationDto.prototype, "owner_country_code", void 0);
188
+ __decorate([
189
+ (0, class_validator_1.IsString)({ message: 'Owner phone number is required' }),
190
+ __metadata("design:type", String)
191
+ ], CreateOrganizationDto.prototype, "owner_phone", void 0);
192
+ __decorate([
193
+ (0, class_validator_1.IsOptional)(),
194
+ (0, class_validator_1.IsString)({ message: 'Owner profile image URL' }),
195
+ __metadata("design:type", Object)
196
+ ], CreateOrganizationDto.prototype, "owner_profile_image", void 0);
197
+ __decorate([
198
+ (0, class_validator_1.IsArray)({ message: 'At least one module must be selected' }),
199
+ (0, class_validator_1.ArrayMinSize)(1, { message: 'At least one module must be selected' }),
200
+ (0, class_validator_1.IsUUID)('4', { each: true, message: 'At least one module must be selected' }),
201
+ __metadata("design:type", Array)
202
+ ], CreateOrganizationDto.prototype, "module_ids", void 0);
203
+ class UpdateOrganizationDto {
204
+ type;
205
+ name;
206
+ trading_name;
207
+ vat_number;
208
+ registration_number;
209
+ email;
210
+ website;
211
+ phone;
212
+ address_line_1;
213
+ address_line_2;
214
+ city;
215
+ state;
216
+ post_code;
217
+ country;
218
+ use_address_for_billing;
219
+ billing_address_line_1;
220
+ billing_address_line_2;
221
+ billing_city;
222
+ billing_state;
223
+ billing_post_code;
224
+ billing_country;
225
+ industry;
226
+ marketing_consent;
227
+ currency;
228
+ }
229
+ exports.UpdateOrganizationDto = UpdateOrganizationDto;
230
+ __decorate([
231
+ (0, class_validator_1.IsOptional)(),
232
+ (0, class_validator_1.IsEnum)(enum_1.OrganizationTypes, { message: 'Invalid organization type' }),
233
+ __metadata("design:type", String)
234
+ ], UpdateOrganizationDto.prototype, "type", void 0);
235
+ __decorate([
236
+ (0, class_validator_1.IsOptional)(),
237
+ (0, class_validator_1.ValidateIf)((o) => o.name !== undefined),
238
+ (0, class_validator_1.IsString)({ message: 'Organization name must be a string' }),
239
+ (0, class_validator_1.MinLength)(1, { message: 'Organization name must be at least 1 characters' }),
240
+ (0, class_validator_1.MaxLength)(255, { message: 'Organization name must be less than 255 characters' }),
241
+ __metadata("design:type", String)
242
+ ], UpdateOrganizationDto.prototype, "name", void 0);
243
+ __decorate([
244
+ (0, class_validator_1.IsOptional)(),
245
+ (0, validators_1.IsNullable)(),
246
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
247
+ (0, class_validator_1.ValidateIf)((o) => o.trading_name !== undefined && o.trading_name !== null),
248
+ (0, class_validator_1.IsString)({ message: 'Trading name must be a string' }),
249
+ (0, class_validator_1.MinLength)(1, { message: 'Trading name must be at least 1 characters' }),
250
+ (0, class_validator_1.MaxLength)(255, { message: 'Trading name must be less than 255 characters' }),
251
+ __metadata("design:type", Object)
252
+ ], UpdateOrganizationDto.prototype, "trading_name", void 0);
253
+ __decorate([
254
+ (0, class_validator_1.IsOptional)(),
255
+ (0, validators_1.IsNullable)(),
256
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
257
+ (0, class_validator_1.ValidateIf)((o) => o.vat_number !== undefined && o.vat_number !== null),
258
+ (0, class_validator_1.IsString)({ message: 'VAT number must be a string' }),
259
+ (0, class_validator_1.MinLength)(1, { message: 'VAT number must be at least 1 characters' }),
260
+ (0, class_validator_1.MaxLength)(255, { message: 'VAT number must be less than 255 characters' }),
261
+ __metadata("design:type", Object)
262
+ ], UpdateOrganizationDto.prototype, "vat_number", void 0);
263
+ __decorate([
264
+ (0, class_validator_1.IsOptional)(),
265
+ (0, validators_1.IsNullable)(),
266
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
267
+ (0, class_validator_1.ValidateIf)((o) => o.registration_number !== undefined && o.registration_number !== null),
268
+ (0, class_validator_1.IsString)({ message: 'Registration number must be a string' }),
269
+ (0, class_validator_1.MinLength)(1, { message: 'Registration number must be at least 1 characters' }),
270
+ (0, class_validator_1.MaxLength)(255, { message: 'Registration number must be less than 255 characters' }),
271
+ __metadata("design:type", Object)
272
+ ], UpdateOrganizationDto.prototype, "registration_number", void 0);
273
+ __decorate([
274
+ (0, class_validator_1.IsOptional)(),
275
+ (0, class_validator_1.ValidateIf)((o) => o.email !== undefined),
276
+ (0, class_validator_1.IsEmail)({}, { message: 'Email must be a valid email address' }),
277
+ __metadata("design:type", String)
278
+ ], UpdateOrganizationDto.prototype, "email", void 0);
279
+ __decorate([
280
+ (0, class_validator_1.IsOptional)(),
281
+ (0, validators_1.IsNullable)(),
282
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
283
+ (0, class_validator_1.ValidateIf)((o) => o.website !== undefined && o.website !== null),
284
+ (0, class_validator_1.IsUrl)({}, { message: 'Website URL must be a string' }),
285
+ __metadata("design:type", Object)
286
+ ], UpdateOrganizationDto.prototype, "website", void 0);
287
+ __decorate([
288
+ (0, class_validator_1.IsOptional)(),
289
+ (0, validators_1.IsNullable)(),
290
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
291
+ (0, class_validator_1.ValidateIf)((o) => o.phone !== undefined && o.phone !== null),
292
+ (0, class_validator_1.IsString)({ message: 'Phone number must be a string' }),
293
+ __metadata("design:type", Object)
294
+ ], UpdateOrganizationDto.prototype, "phone", void 0);
295
+ __decorate([
296
+ (0, class_validator_1.IsOptional)(),
297
+ (0, validators_1.IsNullable)(),
298
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
299
+ (0, class_validator_1.ValidateIf)((o) => o.address_line_1 !== undefined && o.address_line_1 !== null),
300
+ (0, class_validator_1.IsString)({ message: 'Address line 1 must be a string' }),
301
+ (0, class_validator_1.MinLength)(1, { message: 'Address line 1 must be at least 1 characters' }),
302
+ (0, class_validator_1.MaxLength)(255, { message: 'Address line 1 must be less than 255 characters' }),
303
+ __metadata("design:type", Object)
304
+ ], UpdateOrganizationDto.prototype, "address_line_1", void 0);
305
+ __decorate([
306
+ (0, class_validator_1.IsOptional)(),
307
+ (0, validators_1.IsNullable)(),
308
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
309
+ (0, class_validator_1.ValidateIf)((o) => o.address_line_2 !== undefined && o.address_line_2 !== null),
310
+ (0, class_validator_1.IsString)({ message: 'Address line 2 must be a string' }),
311
+ (0, class_validator_1.MinLength)(1, { message: 'Address line 2 must be at least 1 characters' }),
312
+ (0, class_validator_1.MaxLength)(255, { message: 'Address line 2 must be less than 255 characters' }),
313
+ __metadata("design:type", Object)
314
+ ], UpdateOrganizationDto.prototype, "address_line_2", void 0);
315
+ __decorate([
316
+ (0, class_validator_1.IsOptional)(),
317
+ (0, validators_1.IsNullable)(),
318
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
319
+ (0, class_validator_1.ValidateIf)((o) => o.city !== undefined && o.city !== null),
320
+ (0, class_validator_1.IsString)({ message: 'City must be a string' }),
321
+ (0, class_validator_1.MinLength)(1, { message: 'City must be at least 1 characters' }),
322
+ (0, class_validator_1.MaxLength)(255, { message: 'City must be less than 255 characters' }),
323
+ __metadata("design:type", Object)
324
+ ], UpdateOrganizationDto.prototype, "city", void 0);
325
+ __decorate([
326
+ (0, class_validator_1.IsOptional)(),
327
+ (0, validators_1.IsNullable)(),
328
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
329
+ (0, class_validator_1.ValidateIf)((o) => o.state !== undefined && o.state !== null),
330
+ (0, class_validator_1.IsString)({ message: 'State must be a string' }),
331
+ (0, class_validator_1.MinLength)(1, { message: 'State must be at least 1 characters' }),
332
+ (0, class_validator_1.MaxLength)(255, { message: 'State must be less than 255 characters' }),
333
+ __metadata("design:type", Object)
334
+ ], UpdateOrganizationDto.prototype, "state", void 0);
335
+ __decorate([
336
+ (0, class_validator_1.IsOptional)(),
337
+ (0, validators_1.IsNullable)(),
338
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
339
+ (0, class_validator_1.ValidateIf)((o) => o.post_code !== undefined && o.post_code !== null),
340
+ (0, class_validator_1.IsString)({ message: 'Post code must be a string' }),
341
+ (0, class_validator_1.MinLength)(1, { message: 'Post code must be at least 1 characters' }),
342
+ (0, class_validator_1.MaxLength)(255, { message: 'Post code must be less than 255 characters' }),
343
+ __metadata("design:type", Object)
344
+ ], UpdateOrganizationDto.prototype, "post_code", void 0);
345
+ __decorate([
346
+ (0, class_validator_1.IsOptional)(),
347
+ (0, validators_1.IsNullable)(),
348
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
349
+ (0, class_validator_1.ValidateIf)((o) => o.country !== undefined && o.country !== null),
350
+ (0, class_validator_1.IsString)({ message: 'Country must be a string' }),
351
+ (0, class_validator_1.MinLength)(1, { message: 'Country must be at least 1 characters' }),
352
+ (0, class_validator_1.MaxLength)(255, { message: 'Country must be less than 255 characters' }),
353
+ __metadata("design:type", Object)
354
+ ], UpdateOrganizationDto.prototype, "country", void 0);
355
+ __decorate([
356
+ (0, class_validator_1.IsOptional)(),
357
+ (0, class_validator_1.ValidateIf)((o) => o.use_address_for_billing !== undefined),
358
+ (0, class_validator_1.IsBoolean)({ message: 'Use address for billing must be a boolean' }),
359
+ __metadata("design:type", Boolean)
360
+ ], UpdateOrganizationDto.prototype, "use_address_for_billing", void 0);
361
+ __decorate([
362
+ (0, class_validator_1.IsOptional)(),
363
+ (0, validators_1.IsNullable)(),
364
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
365
+ (0, class_validator_1.ValidateIf)((o) => o.billing_address_line_1 !== undefined && o.billing_address_line_1 !== null),
366
+ (0, class_validator_1.IsString)({ message: 'Billing address line 1 must be a string' }),
367
+ (0, class_validator_1.MinLength)(1, { message: 'Billing address line 1 must be at least 1 characters' }),
368
+ (0, class_validator_1.MaxLength)(255, { message: 'Billing address line 1 must be less than 255 characters' }),
369
+ __metadata("design:type", Object)
370
+ ], UpdateOrganizationDto.prototype, "billing_address_line_1", void 0);
371
+ __decorate([
372
+ (0, class_validator_1.IsOptional)(),
373
+ (0, validators_1.IsNullable)(),
374
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
375
+ (0, class_validator_1.ValidateIf)((o) => o.billing_address_line_2 !== undefined && o.billing_address_line_2 !== null),
376
+ (0, class_validator_1.IsString)({ message: 'Billing address line 2 must be a string' }),
377
+ (0, class_validator_1.MinLength)(1, { message: 'Billing address line 2 must be at least 1 characters' }),
378
+ (0, class_validator_1.MaxLength)(255, { message: 'Billing address line 2 must be less than 255 characters' }),
379
+ __metadata("design:type", Object)
380
+ ], UpdateOrganizationDto.prototype, "billing_address_line_2", void 0);
381
+ __decorate([
382
+ (0, class_validator_1.IsOptional)(),
383
+ (0, validators_1.IsNullable)(),
384
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
385
+ (0, class_validator_1.ValidateIf)((o) => o.billing_city !== undefined && o.billing_city !== null),
386
+ (0, class_validator_1.IsString)({ message: 'Billing city must be a string' }),
387
+ (0, class_validator_1.MinLength)(1, { message: 'Billing city must be at least 1 characters' }),
388
+ (0, class_validator_1.MaxLength)(255, { message: 'Billing city must be less than 255 characters' }),
389
+ __metadata("design:type", Object)
390
+ ], UpdateOrganizationDto.prototype, "billing_city", void 0);
391
+ __decorate([
392
+ (0, class_validator_1.IsOptional)(),
393
+ (0, validators_1.IsNullable)(),
394
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
395
+ (0, class_validator_1.ValidateIf)((o) => o.billing_state !== undefined && o.billing_state !== null),
396
+ (0, class_validator_1.IsString)({ message: 'Billing state must be a string' }),
397
+ (0, class_validator_1.MinLength)(1, { message: 'Billing state must be at least 1 characters' }),
398
+ (0, class_validator_1.MaxLength)(255, { message: 'Billing state must be less than 255 characters' }),
399
+ __metadata("design:type", Object)
400
+ ], UpdateOrganizationDto.prototype, "billing_state", void 0);
401
+ __decorate([
402
+ (0, class_validator_1.IsOptional)(),
403
+ (0, validators_1.IsNullable)(),
404
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
405
+ (0, class_validator_1.ValidateIf)((o) => o.billing_post_code !== undefined && o.billing_post_code !== null),
406
+ (0, class_validator_1.IsString)({ message: 'Billing postal code must be a string' }),
407
+ (0, class_validator_1.MinLength)(1, { message: 'Billing postal code must be at least 1 characters' }),
408
+ (0, class_validator_1.MaxLength)(255, { message: 'Billing postal code must be less than 255 characters' }),
409
+ __metadata("design:type", Object)
410
+ ], UpdateOrganizationDto.prototype, "billing_post_code", void 0);
411
+ __decorate([
412
+ (0, class_validator_1.IsOptional)(),
413
+ (0, validators_1.IsNullable)(),
414
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
415
+ (0, class_validator_1.ValidateIf)((o) => o.billing_country !== undefined && o.billing_country !== null),
416
+ (0, class_validator_1.IsString)({ message: 'Billing country must be a string' }),
417
+ (0, class_validator_1.MinLength)(1, { message: 'Billing country must be at least 1 characters' }),
418
+ (0, class_validator_1.MaxLength)(255, { message: 'Billing country must be less than 255 characters' }),
419
+ __metadata("design:type", Object)
420
+ ], UpdateOrganizationDto.prototype, "billing_country", void 0);
421
+ __decorate([
422
+ (0, class_validator_1.IsOptional)(),
423
+ (0, validators_1.IsNullable)(),
424
+ (0, class_transformer_1.Transform)(({ value }) => (value === '' ? null : value)),
425
+ (0, class_validator_1.ValidateIf)((o) => o.industry !== undefined && o.industry !== null),
426
+ (0, class_validator_1.IsString)({ message: 'Industry must be a string' }),
427
+ (0, class_validator_1.MinLength)(1, { message: 'Industry must be at least 1 characters' }),
428
+ (0, class_validator_1.MaxLength)(255, { message: 'Industry must be less than 255 characters' }),
429
+ __metadata("design:type", Object)
430
+ ], UpdateOrganizationDto.prototype, "industry", void 0);
431
+ __decorate([
432
+ (0, class_validator_1.IsOptional)(),
433
+ (0, class_validator_1.ValidateIf)((o) => o.marketing_consent !== undefined),
434
+ (0, class_validator_1.IsBoolean)({ message: 'Marketing consent must be a boolean' }),
435
+ __metadata("design:type", Boolean)
436
+ ], UpdateOrganizationDto.prototype, "marketing_consent", void 0);
437
+ __decorate([
438
+ (0, class_validator_1.IsOptional)(),
439
+ (0, class_validator_1.ValidateIf)((o) => o.currency !== undefined),
440
+ (0, class_validator_1.IsString)({ message: 'Organization currency must be a string' }),
441
+ (0, class_validator_1.MinLength)(1, { message: 'Organization currency must be at least 1 characters' }),
442
+ (0, class_validator_1.MaxLength)(255, { message: 'Organization currency must be less than 255 characters' }),
443
+ __metadata("design:type", String)
444
+ ], UpdateOrganizationDto.prototype, "currency", void 0);
445
+ //# sourceMappingURL=dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/organizations/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,2EAAqF;AAErF,qDAcyB;AACzB,8CAA2C;AAC3C,yDAA8C;AAE9C,MAAa,qBAAqB;IAEvB,QAAQ,CAAqB;IAK5B,QAAQ,CAAU;IAIlB,gBAAgB,CAAiB;IAIjC,cAAc,CAAiB;IAI/B,uBAAuB,CAAiB;IAGxC,SAAS,CAAU;IAInB,WAAW,CAAiB;IAI5B,SAAS,CAAiB;IAI1B,kBAAkB,CAAiB;IAInC,kBAAkB,CAAiB;IAInC,QAAQ,CAAiB;IAIzB,SAAS,CAAiB;IAI1B,eAAe,CAAiB;IAIhC,WAAW,CAAiB;IAG5B,uBAAuB,GAAY,IAAI,CAAC;IAIxC,0BAA0B,CAAiB;IAI3C,0BAA0B,CAAiB;IAI3C,gBAAgB,CAAiB;IAIjC,iBAAiB,CAAiB;IAIlC,uBAAuB,CAAiB;IAIxC,mBAAmB,CAAiB;IAGpC,iBAAiB,CAAQ;I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AAC,GAAG,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;;uDACvC;AAKzB;IAHR,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,KAAK,SAAS,CAAC;IACpD,IAAA,2BAAS,EAAC,EAAE,OAAO,EAAE,qCAAqC,EAAE,CAAC;;gEACzB;AAO5B;IALR,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC;IAC3C,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC;IAC/D,IAAA,2BAAS,EAAC,CAAC,EAAE,EAAE,OAAO,EAAE,qDAAqD,EAAE,CAAC;IAChF,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,wDAAwD,EAAE,CAAC;;uDAC3D"}
@@ -0,0 +1,72 @@
1
+ import type { SeatReservation } from '@managemint-solutions/entities/billing';
2
+ import { type AuditActor, type AuditResource, type AuditRow } from '../audit';
3
+ import type { TypedSupabaseClient } from '../client';
4
+ export * from './dto';
5
+ /** The organizations row as `ORGANIZATION_SELECT` produces it, before the api shapes it. */
6
+ export type OrganizationRow = Record<string, unknown> & {
7
+ mms_id: string;
8
+ pricebook_id: string | null;
9
+ };
10
+ /** The columns signup writes. Everything else on the row is defaulted or set later by billing. */
11
+ export type CreateOrganizationRow = Record<string, unknown>;
12
+ /**
13
+ * The caller's own organization. Every method takes the id explicitly rather than reading it
14
+ * off the auth context, because the signup and webhook paths operate on an organization that
15
+ * is not the caller's — there is no caller at all.
16
+ */
17
+ export declare class OrganizationsResource {
18
+ private readonly supabase;
19
+ private readonly auth;
20
+ private readonly table;
21
+ constructor(supabase: TypedSupabaseClient, auth: AuditActor, audit: AuditResource);
22
+ getById(organizationId: string): Promise<OrganizationRow>;
23
+ /** The caller's own organization, from the auth context. */
24
+ get(): Promise<OrganizationRow>;
25
+ /**
26
+ * The whole row, unprojected. Billing reads a different handful of columns for each of its
27
+ * flows — provisioning, a module purchase, a seat charge — and they are all single-row
28
+ * lookups by primary key, so one read serves them all rather than a select string each.
29
+ */
30
+ getRowById(organizationId: string): Promise<OrganizationRow>;
31
+ /**
32
+ * A status move that only lands while the organization is still in `expectedFrom` — the
33
+ * compare-and-set that stops two concurrent webhooks both advancing the subscription.
34
+ * Resolves to null when someone else moved it first.
35
+ */
36
+ moveBillingStatus(organizationId: string, expectedFrom: string, patch: AuditRow): Promise<AuditRow | null>;
37
+ update(organizationId: string, patch: AuditRow): Promise<OrganizationRow>;
38
+ /** Hard delete — used by the signup rollback. Returns the row as it was. */
39
+ remove(organizationId: string): Promise<AuditRow>;
40
+ /**
41
+ * Claims a seat atomically. This is the serialization point for concurrent user creation —
42
+ * two admins adding at once get distinct seat numbers — so it is a function, not a
43
+ * read-then-write. The caller decides what to do with the billing status it returns.
44
+ */
45
+ reserveSeat(organizationId: string): Promise<SeatReservation | null>;
46
+ /**
47
+ * Gives a seat back. `active_seat_count` drops immediately; `paid_seat_count` is deliberately
48
+ * untouched, because there are no mid-cycle refunds and the paid seat holds until the cycle
49
+ * turns.
50
+ */
51
+ releaseSeat(organizationId: string): Promise<void>;
52
+ }
53
+ /**
54
+ * Signup, on the service client. `organizations` INSERT is `false` for `authenticated` — the
55
+ * caller has no account yet, so there is no RLS context to run under.
56
+ */
57
+ export declare class OrganizationSignupResource {
58
+ private readonly supabase;
59
+ private readonly auditFor;
60
+ constructor(supabase: TypedSupabaseClient, auditFor: (organizationId: string) => AuditResource);
61
+ /** Whether an account already exists for this address, checked before anything is created. */
62
+ emailInUse(email: string): Promise<boolean>;
63
+ /**
64
+ * Creates the organization and records its own INSERT.
65
+ *
66
+ * This is the one write that cannot go through the audited helper: the actor's organization
67
+ * is the row being inserted, so it is not knowable until the insert has returned. The audit
68
+ * row is recorded here instead, with the new organization as both the actor's organization
69
+ * and the entity.
70
+ */
71
+ create(payload: CreateOrganizationRow): Promise<OrganizationRow>;
72
+ }