import { Schema } from "mongoose"; import { EnumMap,IJson,IDocument,IObject,IInstance,IModel,IAction,IActionTypes } from "@onebro/oba-common"; import { CnDUserProfile,CnDUserProfilePreview } from "./profiles"; export enum CnDGameStatuses { N = "New", S = "Saved", Y = "Sent", Z = "Seen/Read", A = "Accepted", D = "Declined", R = "Revised", E = "Expired", C = "Cancelled",} export type CnDGameStatus = keyof typeof CnDGameStatuses; export type CnDGameConfig = { type:"contactus"|"note"|"chat"|"buy-alert"|"sell-alert"; author:string; body:string; symbol:string; subscribers:string[]; sendAt:{time?:Date;price?:number;}; img?:string; link?:string;}; export type CnDGameType = IObject & Omit & { author:CnDUserProfile; }; export interface CnDGameDocument extends IDocument,CnDGameType {} export interface CnDGame extends IInstance,CnDGameDocument {} export interface CnDGameModel extends IModel {} export type CnDGamePublicKeys = Exclude; export type CnDGamePublicData = Pick; export type CnDGameJson = IJson & CnDGamePublicData & {published:Date;author:CnDUserProfilePreview;}; export type CnDGameModelMap = {CnDGame:CnDGameModel;}; export type CnDGameInstanceMap = {game:CnDGame;}; export type CnDGameSchemaMap = {game:Schema;}; export type CnDGameActionTypes = IActionTypes; export type CnDGameActions = EnumMap;