summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/json-schema/invite-code.ts
blob: b70a779f2914516cc1e3a5c9da3050c87afee127 (plain)
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
export const packedInviteCodeSchema = {
	type: 'object',
	properties: {
		id: {
			type: 'string',
			optional: false, nullable: false,
			format: 'id',
			example: 'xxxxxxxxxx',
		},
		code: {
			type: 'string',
			optional: false, nullable: false,
			example: 'GR6S02ERUA5VR',
		},
		expiresAt: {
			type: 'string',
			optional: false, nullable: true,
			format: 'date-time',
		},
		createdAt: {
			type: 'string',
			optional: false, nullable: false,
			format: 'date-time',
		},
		createdBy: {
			type: 'object',
			optional: false, nullable: true,
			ref: 'UserLite',
		},
		usedBy: {
			type: 'object',
			optional: false, nullable: true,
			ref: 'UserLite',
		},
		usedAt: {
			type: 'string',
			optional: false, nullable: true,
			format: 'date-time',
		},
		used: {
			type: 'boolean',
			optional: false, nullable: false,
		},
	},
} as const;