1
0
forked from Yara724/api

blame and claim refactored

This commit is contained in:
2026-02-24 12:19:25 +03:30
parent 0d8858f458
commit 35732dd70a
81 changed files with 11603 additions and 77 deletions

View File

@@ -0,0 +1,60 @@
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);