import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Types } from 'mongoose'; @Schema({ timestamps: { createdAt: 'createdAt', updatedAt: 'updatedAt' }, versionKey: false, collection: 'user_insurance_snapshots', _id: true, }) export class UserInsuranceSnapshotModel { @Prop({ type: Types.ObjectId, required: true, unique: true, index: true }) userId: Types.ObjectId; @Prop({ type: String, required: true }) syncBatchId: string; @Prop({ type: Date, required: true }) syncedAt: Date; @Prop({ type: Object, required: true }) user_insurance_data: Record; @Prop({ type: Object, required: true }) user_installments_data: Record; @Prop({ type: Date }) createdAt: Date; @Prop({ type: Date }) updatedAt: Date; } export const UserInsuranceSnapshotSchema = SchemaFactory.createForClass( UserInsuranceSnapshotModel, );