From af15a6bce0b4d35c2b4ed7946c640d4969fc5b86 Mon Sep 17 00:00:00 2001 From: louiscklaw Date: Thu, 15 May 2025 11:12:56 +0800 Subject: [PATCH] ``` refactor Student type definitions to deprecate obsolete fields, standardize structure, and update billing address format ``` --- 002_source/cms/src/db/Students/type.d.ts | 65 ++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/002_source/cms/src/db/Students/type.d.ts b/002_source/cms/src/db/Students/type.d.ts index 69759df..2eed10a 100644 --- a/002_source/cms/src/db/Students/type.d.ts +++ b/002_source/cms/src/db/Students/type.d.ts @@ -1,17 +1,71 @@ +// src/db/Students/type.d.ts // -// RULES +// PURPOSE // type for student record +// +// RULES: sorting direction for user meta lists +import type { BillingAddress } from '../billingAddress/type'; // Student type definitions -export interface Student { - id: string; + +export interface DBStudentOld { + // name: string; - avatar: string; + // + // NOTE: obslete "avatar" and use "avatar_file" + avatar?: string; + avatar_file?: string; + // email: string; phone: string; quota: number; - status: 'active' | 'blocked' | 'pending'; + company: string; + // + // billingAddress: BillingAddress[] | []; + expand: { billingAddress?: BillingAddress[] }; + + // status is obsoleted, replace by state + status: 'pending' | 'active' | 'blocked'; + state: 'pending' | 'active' | 'blocked'; + // + timezone: string; + language: string; + currency: string; + // + id: string; + created: string; + updated?: string; + collectionId: string; +} + +// RULES: core user meta data structure +export interface Student { + id: string; + name: string; + // + // NOTE: obslete "avatar" and use "avatar_file" + avatar?: string; + avatar_file?: string; + // + email: string; + phone?: string; + quota: number; + company?: string; + // + billingAddress: BillingAddress | Record; + + // status is obsoleted, replace by state + status: 'pending' | 'active' | 'blocked'; + state: 'pending' | 'active' | 'blocked'; + // + timezone: string; + language: string; + currency: string; + // + id: string; createdAt: Date; + updatedAt?: Date; + collectionId: string; } export interface UpdateStudent { @@ -36,6 +90,7 @@ export interface UpdateStudent { timezone?: string; language?: string; currency?: string; + // taxId?: string; }