-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathperson.ts
More file actions
127 lines (114 loc) · 3.37 KB
/
person.ts
File metadata and controls
127 lines (114 loc) · 3.37 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import { AssignmentCode } from './assignment';
export const ALL_PRIVILEGE_TYPES = ['elder', 'ms'] as const;
export type PrivilegeType = (typeof ALL_PRIVILEGE_TYPES)[number];
export const isPrivilegeType = (value: string): value is PrivilegeType => {
return ALL_PRIVILEGE_TYPES.includes(value as PrivilegeType);
};
export const ALL_ENROLLMENT_TYPES = ['AP', 'FR', 'FS', 'FMF'] as const;
export type EnrollmentType = (typeof ALL_ENROLLMENT_TYPES)[number];
export const isEnrollmentType = (value: string): value is EnrollmentType => {
return ALL_ENROLLMENT_TYPES.includes(value as EnrollmentType);
};
export type AssignmentType = {
type: string;
updatedAt: string;
values: AssignmentCode[];
};
export type TimeAwayType = {
id: string;
_deleted: boolean;
updatedAt: string;
start_date: string;
end_date: string;
comments: string;
};
export type StatusHistoryType = {
id: string;
_deleted: boolean;
updatedAt: string;
start_date: string;
end_date: string;
};
type PrivilegeHistoryType = {
id: string;
_deleted: boolean;
updatedAt: string;
privilege: PrivilegeType;
start_date: string;
end_date: string;
};
type EnrollmentHistoryType = {
id: string;
_deleted: boolean;
updatedAt: string;
enrollment: EnrollmentType;
start_date: string;
end_date: string;
};
type EmergencyContactsType = {
id: string;
_deleted: boolean;
updatedAt: string;
name: string;
contact: string;
};
export type PersonType = {
_deleted: { value: boolean; updatedAt: string };
person_uid: string;
person_data: {
person_firstname: { value: string; updatedAt: string };
person_lastname: { value: string; updatedAt: string };
person_display_name: { value: string; updatedAt: string };
male: { value: boolean; updatedAt: string };
female: { value: boolean; updatedAt: string };
birth_date: { value: string | null; updatedAt: string };
assignments: AssignmentType[];
timeAway: TimeAwayType[];
archived: { value: boolean; updatedAt: string };
disqualified: { value: boolean; updatedAt: string };
email: { value: string; updatedAt: string };
address: { value: string; updatedAt: string };
phone: { value: string; updatedAt: string };
first_report?: { value: string; updatedAt: string };
publisher_baptized: {
active: { value: boolean; updatedAt: string };
anointed: { value: boolean; updatedAt: string };
other_sheep: { value: boolean; updatedAt: string };
baptism_date: { value: string | null; updatedAt: string };
history: StatusHistoryType[];
};
publisher_unbaptized: {
active: { value: boolean; updatedAt: string };
history: StatusHistoryType[];
};
midweek_meeting_student: {
active: { value: boolean; updatedAt: string };
history: StatusHistoryType[];
};
privileges: PrivilegeHistoryType[];
enrollments: EnrollmentHistoryType[];
emergency_contacts: EmergencyContactsType[];
categories?: { value: string[]; updatedAt: string };
};
};
export type VisitingSpeakerPersonType = {
person_uid: string;
person_name: string;
person_display_name: string;
is_elder: boolean;
is_ms: boolean;
talks: [];
is_unavailable: boolean;
is_deleted: boolean;
cong_name: string;
cong_number: number | string;
cong_id: string;
is_local: boolean;
email: string;
phone: string;
changes: [];
};
export enum PersonsTab {
ALL = 0,
RECENT = 1,
}