import { IMultipleRelationOperation } from '../relation'; import { IGroupPropertiesConfig, defaultGroupPropertiesConfig } from './group'; export type UserIdType = number; export interface IUser { id: UserIdType; name: string; email: string; password?: string; // groupIds: number[]; // roles: IUserUserRole[] | null; // investorRoles: IInvestorUserRole[] | null; // role: string; } export interface IUserCreateInput { name: string; email: string; password: string; groupRelations: IMultipleRelationOperation[]; // groupRelations: IRelation[]; } export interface IUserUpdateInput { id: UserIdType; name?: string; email?: string; password?: string; groupRelations?: IMultipleRelationOperation[]; } export interface IUserProperties { id?: boolean; name?: boolean; email?: boolean; password?: boolean; // groupIds?: boolean; } // type IUserRelationProperties = {}; // interface IUserRelationProperties { // groups?: IGroupPropertiesConfig; // } export interface IUserPropertiesConfig { properties: IUserProperties; relationProperties?: {}; // IUserRelationProperties; } export interface IUserDeleteInput { id: UserIdType; } export function defaultUserProperties(): IUserProperties { return { id: true, name: true, email: true, password: false, // groupIds: true, }; } // export function defaultUserRelationProperties(): IUserRelationProperties { // return { // groups: defaultGroupPropertiesConfig(), // }; // } export function defaultUserPropertiesConfig(): IUserPropertiesConfig { return { properties: defaultUserProperties(), relationProperties: {}, // defaultUserRelationProperties(), }; }