import { Schema } from "mongoose"; import { EnumMap,IJson,IDocument,IObject,IInstance,IModel,IAction,IActionTypes,ISettings,MiscInfo } from "@onebro/oba-common"; export enum EnginamorUserProfileStatuses { N = "New", S = "Saved", Y = "Sent", Z = "Seen/Read", A = "Accepted", D = "Declined", R = "Revised", E = "Expired", C = "Cancelled",} export type EnginamorUserProfileStatus = keyof typeof EnginamorUserProfileStatuses; export enum EnginamorRoles { G = "GUEST", U = "USER", A = "ADMIN", S = "SUPER", SA = "SYSADMIN"} export type EnginamorRole = keyof typeof EnginamorRoles; export type EnginamorExperienceLevel = "novice"|"beginner"|"intermediate"|"advanced"|"expert"; export type EnginamorUserProfileConfig = { username:string; role:EnginamorRole; settings:ISettings<"location"|"cookies">; img?:string;}; export type EnginamorUserProfileType = IObject & EnginamorUserProfileConfig & { bio:string; motto:string; socials?:MiscInfo; stats?:MiscInfo; expYrs?:number; expLvl?:EnginamorExperienceLevel; rating?:number; followers?:EnginamorUserProfile[]; following?:EnginamorUserProfile[];}; export interface EnginamorUserProfileDocument extends IDocument,EnginamorUserProfileType {lang:string;} export interface EnginamorUserProfile extends IInstance,EnginamorUserProfileDocument { following:EnginamorUserProfile[]; followers:EnginamorUserProfile[]; preview():EnginamorUserProfilePreview; follow(o:any):Promise; unfollow(o:any):Promise; rate(o:any):Promise; invite(o:any):Promise; respond(o:any):Promise;} export interface EnginamorUserProfileModel extends IModel {} export type EnginamorUSerProfilePublicKeys = "username"|"bio"|"motto"|"expYrs"|"expLvl"|"rating"|"settings"|"img"|"socials"|"lang"; export type EnginamorUSerProfilePublicData = Pick; export type EnginamorUserProfilePreview = Pick & {role:EnginamorRoles;}; export type EnginamorUserProfileJson = IJson & EnginamorUSerProfilePublicData & { role:EnginamorRoles; memberSince:Date; followers:EnginamorUserProfilePreview[]; following:EnginamorUserProfilePreview[];}; export type EnginamorUserProfileModelMap = {EnginamorUserProfile:EnginamorUserProfileModel;}; export type EnginamorUserProfileInstanceMap = {profile:EnginamorUserProfile;}; export type EnginamorUserProfileSchemaMap = {profile:Schema;}; export type EnginamorUserProfileActionTypes = IActionTypes|"fetchByUsername$"; export type EnginamorUserProfileActions = EnumMap; export type EnginamorUserProfileUpdateFollowersOrFollowing = Partial<{ addFollowers?:string[]; removeFollowers?:string[]; addFollowing?:string[]; removeFollowing?:string[];}>;