Files
gongxue-base/apps/admin/src/pages/Deposits/deposit-student-option.ts

15 lines
480 B
TypeScript

export interface DepositStudentLookup {
id: number;
name: string;
studentNo?: string | null;
roomType?: string | null;
}
export const buildDepositStudentOption = (student: DepositStudentLookup) => ({
value: student.id,
label: `${student.name} (${student.studentNo || `#${student.id}`})${student.roomType ? ` - ${student.roomType}` : ''}`,
});
export const buildDepositStudentOptions = (students: DepositStudentLookup[]) =>
students.map(buildDepositStudentOption);