opt-cc/static/src/app/models/model-interfaces.ts

87 lines
1.3 KiB
TypeScript

export interface AppUser {
_id?: string;
username?: string;
squad?: Squad;
secret?: string;
activated: boolean;
permission: number;
}
export interface User {
_id?: string;
boardUserId?: number;
username?: string;
squad?: Squad;
rank?: Rank;
awards?: Award[];
}
export interface Squad {
_id?: string;
name?: string;
fraction?: string;
sortingNumber?: number;
}
export interface Rank {
_id?: string;
name?: string;
fraction?: string;
level?: number;
}
export interface Award {
_id?: string,
userId: string,
decorationId?: Decoration;
reason?: string;
proposer?: AppUser;
date?: number; // since Date.now() returns a number
confirmed?: number;
}
export interface Promotion {
userId?: string
oldRankLvl: number,
newRankLvl: number
}
export interface Decoration {
_id?: string;
name?: string;
description?: string;
fraction?: string;
sortingNumber?: number;
isMedal?: boolean;
}
export interface Army {
NATO: {
squads: {
_id,
name,
memberCount,
members: {
_id,
username,
rank
}[],
}[],
memberCount
},
CSAT: {
squads: {
_id,
name,
memberCount,
members: {
_id,
username,
rank
}[],
}[],
memberCount
},
}