-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathcreate-provider-organization.request.ts
More file actions
52 lines (49 loc) · 1.25 KB
/
create-provider-organization.request.ts
File metadata and controls
52 lines (49 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { PlanType } from "../../../billing/enums";
import { OrganizationKeysRequest } from "./organization-keys.request";
export class CreateProviderOrganizationRequest {
name: string;
ownerEmail: string;
planType: PlanType;
seats: number;
key: string;
keyPair: OrganizationKeysRequest;
collectionName: string;
constructor(
name: string,
ownerEmail: string,
planType: PlanType,
seats: number,
key: string,
keyPair: OrganizationKeysRequest,
collectionName: string,
) {
if (!name) {
throw new Error("Name is required");
}
if (!ownerEmail) {
throw new Error("Owner email is required");
}
if (planType == null) {
throw new Error("Plan type is required");
}
if (seats == null) {
throw new Error("Seats is required");
}
if (!key) {
throw new Error("Organization key is required");
}
if (!keyPair) {
throw new Error("Organization key pair is required");
}
if (!collectionName) {
throw new Error("Collection name is required");
}
this.name = name;
this.ownerEmail = ownerEmail;
this.planType = planType;
this.seats = seats;
this.key = key;
this.keyPair = keyPair;
this.collectionName = collectionName;
}
}