feat: add Angular member and user models + API services

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Chen
2026-05-27 14:13:35 -07:00
parent 8249b3fe3e
commit d2eac52a47
4 changed files with 225 additions and 0 deletions
@@ -0,0 +1,84 @@
export type MemberStatus = 'Member' | 'Visitor' | 'Inactive' | 'Former';
export interface MemberListItemDto {
id: number;
firstName_en: string;
lastName_en: string;
nickName: string | null;
firstName_zh: string | null;
lastName_zh: string | null;
status: MemberStatus;
email: string | null;
phoneCell: string | null;
joinDate: string | null;
linkedUserId: string | null;
}
export interface MemberDto extends MemberListItemDto {
gender: string | null;
dateOfBirth: string | null;
baptismDate: string | null;
baptismChurch: string | null;
phoneHome: string | null;
address: string | null;
city: string | null;
state: string | null;
zipCode: string | null;
country: string;
photoBlobPath: string | null;
languagePreference: string;
notes: string | null;
familyUnitId: number | null;
createdAt: string;
updatedAt: string;
}
export interface CreateMemberRequest {
firstName_en: string;
lastName_en: string;
nickName: string | null;
firstName_zh: string | null;
lastName_zh: string | null;
gender: string | null;
dateOfBirth: string | null;
baptismDate: string | null;
baptismChurch: string | null;
email: string | null;
phoneCell: string | null;
phoneHome: string | null;
address: string | null;
city: string | null;
state: string | null;
zipCode: string | null;
country: string;
status: string;
languagePreference: string;
joinDate: string | null;
notes: string | null;
familyUnitId: number | null;
}
export type UpdateMemberRequest = CreateMemberRequest;
export interface PagedResult<T> {
items: T[];
totalCount: number;
page: number;
pageSize: number;
totalPages: number;
}
export interface MemberQueryParams {
page?: number;
pageSize?: number;
search?: string;
status?: string;
hasUser?: boolean;
}
/** Display name: NickName (if present) else FirstName_en, plus LastName_en */
export function memberDisplayName(
m: Pick<MemberListItemDto, 'nickName' | 'firstName_en' | 'lastName_en'>
): string {
return `${m.nickName ?? m.firstName_en} ${m.lastName_en}`;
}