-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUser.ts
More file actions
44 lines (36 loc) · 1.44 KB
/
User.ts
File metadata and controls
44 lines (36 loc) · 1.44 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
import { AutoIncrement, BackReference, entity, PrimaryKey, Reference } from "@deepkit/type";
import { EmergencyContact } from "./EmergencyContact";
import { IDataObject } from "../types/data";
import { Address } from "./Address";
import { Invoice } from "./Invoice";
import { League } from "./League";
import { ParentContact } from "./ParentContact";
import { DrawTime } from "./DrawTime";
import { LeagueMembership } from "./joinerObjects/LeagueMembership";
import { UserParentContact } from "./joinerObjects/UserParentContact";
import { SpareCandidate } from "./joinerObjects/SpareCandidate";
@(entity.name("user").collection("users"))
export class User implements IDataObject {
public id: number & PrimaryKey & AutoIncrement = 0;
public created: Date = new Date();
public modified?: Date;
public gender?: string;
public occupation?: string;
public school?: string;
public ccmUserName?: string;
public invoices?: Invoice[] & BackReference;
public address?: Address & Reference;
public emergencyContact?: EmergencyContact & Reference;
parentContacts?: ParentContact[] & BackReference<{via: UserParentContact}>;
leagues?: League[] & BackReference<{via: LeagueMembership}>;
spareAvailability?: DrawTime[] & BackReference<{via: SpareCandidate}>;
constructor(
public fullName: string,
public friendlyName: string,
public email: string,
public memberSince: Date,
public curledSince: Date,
public dateOfBirth: Date,
public phone: string
) {}
}