feat: add auction chat
This commit is contained in:
1 parent
c4f19d256d
commit
5ad0f8a1c2
7 files changed
+449
-20
No files matched your search
@@ -618,6 +618,14 @@ export interface AuctionBid {
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
export interface AuctionChatMessage {
|
||||
id: string;
|
||||
userId?: mongoose.Types.ObjectId;
|
||||
displayName: string;
|
||||
message: string;
|
||||
sentAt: Date;
|
||||
}
|
||||
|
||||
export interface Auction extends MongooseTimestamps {
|
||||
matchId: mongoose.Types.ObjectId;
|
||||
phase: AuctionPhase;
|
||||
@@ -635,6 +643,7 @@ export interface Auction extends MongooseTimestamps {
|
||||
initialPoints: number;
|
||||
topTierThreshold: AuctionTopTierThreshold;
|
||||
manualTopTierUserIds: mongoose.Types.ObjectId[];
|
||||
chatMessages: AuctionChatMessage[];
|
||||
startedAt?: Date;
|
||||
completedAt?: Date;
|
||||
}
|
||||
@@ -1566,6 +1575,17 @@ const AuctionBidSubSchema = new Schema<AuctionBid>(
|
||||
{ _id: false },
|
||||
);
|
||||
|
||||
const AuctionChatMessageSubSchema = new Schema<AuctionChatMessage>(
|
||||
{
|
||||
id: { type: String, required: true },
|
||||
userId: { type: Schema.Types.ObjectId, ref: 'user', required: false },
|
||||
displayName: { type: String, required: true },
|
||||
message: { type: String, required: true },
|
||||
sentAt: { type: Date, required: true, default: Date.now },
|
||||
},
|
||||
{ _id: false },
|
||||
);
|
||||
|
||||
export const AuctionSchema = new Schema<Auction>(
|
||||
{
|
||||
matchId: {
|
||||
@@ -1612,6 +1632,11 @@ export const AuctionSchema = new Schema<Auction>(
|
||||
required: true,
|
||||
default: [],
|
||||
},
|
||||
chatMessages: {
|
||||
type: [AuctionChatMessageSubSchema],
|
||||
required: true,
|
||||
default: [],
|
||||
},
|
||||
startedAt: { type: Date, required: false },
|
||||
completedAt: { type: Date, required: false },
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user