forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { Prop, Schema } from "@nestjs/mongoose";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
@Schema({ versionKey: false, _id: false })
|
||||
export class ImageRequiredModel {
|
||||
@Prop({ type: "array" })
|
||||
public aroundTheCar = [
|
||||
{ side: "left" },
|
||||
{ side: "back" },
|
||||
{ side: "front" },
|
||||
{ side: "right" },
|
||||
];
|
||||
|
||||
@Prop({ type: "array" })
|
||||
public selectPartOfCar = [];
|
||||
|
||||
@Prop({ type: "string" })
|
||||
public aiReportText: string;
|
||||
|
||||
constructor(claimFile: any[]) {
|
||||
this.aroundTheCar.forEach((a) => {
|
||||
Object.assign(a, {
|
||||
partId: uuidv4(),
|
||||
imageId: null,
|
||||
aiReport: {},
|
||||
upload: false,
|
||||
});
|
||||
});
|
||||
this.selectPartOfCar = claimFile.map((c, idx) =>
|
||||
Object.assign(c, {
|
||||
partId: uuidv4(),
|
||||
aiReport: {},
|
||||
imageId: null,
|
||||
upload: false,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user