forked from Yara724/api
61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
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<string, CapturedImage>;
|
|
|
|
/**
|
|
* V2: Damaged parts captures
|
|
* Map of part key to captured image
|
|
*/
|
|
@Prop({
|
|
type: Map,
|
|
of: CapturedImageSchema,
|
|
default: () => ({}),
|
|
})
|
|
damagedParts?: Map<string, CapturedImage>;
|
|
}
|
|
export const ClaimMediaSchema = SchemaFactory.createForClass(ClaimMedia);
|
|
|