Files
v3-api/src/database/model/user-insurance-snapshot.model.ts

36 lines
906 B
TypeScript

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<string, unknown>;
@Prop({ type: Object, required: true })
user_installments_data: Record<string, unknown>;
@Prop({ type: Date })
createdAt: Date;
@Prop({ type: Date })
updatedAt: Date;
}
export const UserInsuranceSnapshotSchema = SchemaFactory.createForClass(
UserInsuranceSnapshotModel,
);