import { Schema } from "mongoose"; import { getCommonSchemas as common,aliasedEntitySchemaOpts as opts} from "@onebro/oba-common"; import { FirstlineDistressReport } from "../types"; const {status} = common(); const sendAt = new Schema({time:{type:Date,default:Date.now},price:{type:Number}},{_id:false}); const report = new Schema({ created:{type:Date,default:Date.now}, updated:{type:Date,default:Date.now}, status:{type:[status],default:() => [{name:"N",time:new Date()}]}, author:{type:Schema.Types.ObjectId,ref:"FirstlineUserProfile"}, type:{type:String,enum:["contactus","note","chat","buy-alert","sell-alert"],default:"buy-alert"}, body:{type:String}, symbol:{type:String}, sendAt:{type:sendAt}, subscribers:{type:[String],default:[] as any[]}, img:{type:String}, link:{type:String}, },opts); export {report as firstlineDistressReportSchema};