34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import { String, Text, Boolean, Datetime } from 'oak-domain/lib/types/DataType';
|
|
import { ActionDef } from 'oak-domain/lib/types/Action';
|
|
import { Schema as ExtraFile } from './ExtraFile';
|
|
import { Schema as WechatQrCode } from './WechatQrCode';
|
|
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
|
import { Schema as Address } from './Address';
|
|
import { Schema as User } from 'oak-domain/lib/entities/User';
|
|
export interface Schema extends User {
|
|
passwordSha1?: Text;
|
|
birth?: Datetime;
|
|
gender?: 'male' | 'female';
|
|
idCardType?: 'ID-Card' | 'passport' | 'Mainland-passport';
|
|
idNumber?: String<32>;
|
|
files: Array<ExtraFile>;
|
|
codes: Array<WechatQrCode>;
|
|
isRoot?: Boolean;
|
|
addresses?: Address[];
|
|
hasPassword?: Boolean;
|
|
verifyPasswordAt?: Datetime;
|
|
}
|
|
export type IdAction = 'verify' | 'accept' | 'reject';
|
|
export type IdState = 'unverified' | 'verified' | 'verifying';
|
|
export declare const IdActionDef: ActionDef<IdAction, IdState>;
|
|
export type UserAction = 'activate' | 'disable' | 'enable' | 'mergeTo' | 'mergeFrom';
|
|
export type UserState = 'shadow' | 'normal' | 'disabled' | 'merged';
|
|
export declare const UserActionDef: ActionDef<UserAction, UserState>;
|
|
export type Action = UserAction | IdAction | 'play';
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
userState: UserState;
|
|
idState: IdState;
|
|
gender: Required<Schema>['gender'];
|
|
idCardType: Required<Schema>['idCardType'];
|
|
}>;
|