18 lines
497 B
TypeScript
18 lines
497 B
TypeScript
import { Schema, Document } from 'mongoose';
|
|
|
|
export interface ISharedSummary extends Document {
|
|
userId: string;
|
|
sharedBy: string;
|
|
sharedAt: Date;
|
|
viewedAt?: Date;
|
|
isRead: boolean;
|
|
}
|
|
|
|
export const SharedSummarySchema = new Schema<ISharedSummary>({
|
|
userId: { type: String, required: true },
|
|
sharedBy: { type: String, required: true },
|
|
sharedAt: { type: Date, default: Date.now },
|
|
viewedAt: Date,
|
|
isRead: { type: Boolean, default: false }
|
|
}, { _id: false });
|