import { Schema } from "mongoose"; import { EnumMap,IJson,IDocument,IObject,IInstance,IModel,IAction,IActionTypes,ISettings,MiscInfo } from "@onebro/oba-common"; export enum DominoDownUserProfileStatuses { N = "New", S = "Saved", Y = "Sent", Z = "Seen/Read", A = "Accepted", D = "Declined", R = "Revised", E = "Expired", C = "Cancelled",} export type DominoDownUserProfileStatus = keyof typeof DominoDownUserProfileStatuses; export enum DominoDownRoles { G = "GUEST", U = "USER", A = "ADMIN", S = "SUPER", SA = "SYSADMIN"} export type DominoDownRole = keyof typeof DominoDownRoles; export type DominoDownExperienceLevel = "novice"|"beginner"|"intermediate"|"advanced"|"expert"; export type DominoDownUserProfileConfig = { username:string; role:DominoDownRole; settings:ISettings<"location"|"cookies">; img?:string;}; export type DominoDownUserProfileType = IObject & DominoDownUserProfileConfig & { bio:string; motto:string; socials?:MiscInfo; stats?:MiscInfo; expYrs?:number; expLvl?:DominoDownExperienceLevel; rating?:number; followers?:DominoDownUserProfile[]; following?:DominoDownUserProfile[];}; export interface DominoDownUserProfileDocument extends IDocument,DominoDownUserProfileType {lang:string;} export interface DominoDownUserProfile extends IInstance,DominoDownUserProfileDocument { following:DominoDownUserProfile[]; followers:DominoDownUserProfile[]; preview():DominoDownUserProfilePreview; follow(o:any):Promise; unfollow(o:any):Promise; rate(o:any):Promise; invite(o:any):Promise; respond(o:any):Promise;} export interface DominoDownUserProfileModel extends IModel {} export type DominoDownUSerProfilePublicKeys = "username"|"bio"|"motto"|"expYrs"|"expLvl"|"rating"|"settings"|"img"|"socials"|"lang"; export type DominoDownUSerProfilePublicData = Pick; export type DominoDownUserProfilePreview = Pick & {role:DominoDownRoles;}; export type DominoDownUserProfileJson = IJson & DominoDownUSerProfilePublicData & { role:DominoDownRoles; memberSince:Date; followers:DominoDownUserProfilePreview[]; following:DominoDownUserProfilePreview[];}; export type DominoDownUserProfileModelMap = {DominoDownUserProfile:DominoDownUserProfileModel;}; export type DominoDownUserProfileInstanceMap = {profile:DominoDownUserProfile;}; export type DominoDownUserProfileSchemaMap = {profile:Schema;}; export type DominoDownUserProfileActionTypes = IActionTypes|"fetchByUsername$"; export type DominoDownUserProfileActions = EnumMap; export type DominoDownUserProfileUpdateFollowersOrFollowing = Partial<{ addFollowers?:string[]; removeFollowers?:string[]; addFollowing?:string[]; removeFollowing?:string[];}>;