```
refactor Student type definitions to deprecate obsolete fields, standardize structure, and update billing address format ```
This commit is contained in:
65
002_source/cms/src/db/Students/type.d.ts
vendored
65
002_source/cms/src/db/Students/type.d.ts
vendored
@@ -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<string, never>;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user