import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { Types } from "mongoose"; import { AiImagesModel } from "./ai-image.schema"; import { CarGreenCardModel } from "./car-green-card.schema"; import { ImageRequiredModel } from "./image-required.schema"; @Schema({ _id: false }) export class CapturedImage { @Prop({ type: String }) path?: string; @Prop({ type: String }) fileName?: string; @Prop({ type: String }) url?: string; @Prop({ type: Date }) capturedAt?: Date; } export const CapturedImageSchema = SchemaFactory.createForClass(CapturedImage); @Schema({ _id: false }) export class ClaimMedia { @Prop({ type: CarGreenCardModel }) carGreenCard?: CarGreenCardModel; @Prop({ type: ImageRequiredModel }) imageRequired?: ImageRequiredModel; @Prop({ type: AiImagesModel }) aiImages?: AiImagesModel; @Prop({ type: Types.ObjectId }) videoCaptureId?: Types.ObjectId; /** * V2: Car angles captures (front, back, left, right) * Map of angle key to captured image */ @Prop({ type: Map, of: CapturedImageSchema, default: () => ({}), }) carAngles?: Map; /** * V2: Damaged parts captures * Map of part key to captured image */ @Prop({ type: Map, of: CapturedImageSchema, default: () => ({}), }) damagedParts?: Map; } export const ClaimMediaSchema = SchemaFactory.createForClass(ClaimMedia);