Files
yara724api/src/claim-request-management/entites/schema/claim-case.identity.schema.ts
2026-04-18 17:04:19 +03:30

69 lines
1.5 KiB
TypeScript

import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { Types } from "mongoose";
@Schema({ _id: false })
export class ClaimPlate {
@Prop({ type: Number })
leftDigits?: number;
@Prop({ type: String })
centerAlphabet?: string;
@Prop({ type: Number })
centerDigits?: number;
@Prop({ type: Number })
ir?: number;
@Prop({ type: String })
nationalCode?: string;
}
export const ClaimPlateSchema = SchemaFactory.createForClass(ClaimPlate);
@Schema({ _id: false })
export class ClaimVehicleSnapshot {
@Prop({ type: String })
carName?: string;
@Prop({ type: String })
carModel?: string;
@Prop({ type: String })
carType?: string;
@Prop({ type: Boolean })
isNewCar?: boolean;
@Prop({ type: ClaimPlateSchema })
plate?: ClaimPlate;
}
export const ClaimVehicleSnapshotSchema =
SchemaFactory.createForClass(ClaimVehicleSnapshot);
@Schema({ _id: false })
export class ClaimOwner {
@Prop({ type: Types.ObjectId })
userId?: Types.ObjectId;
@Prop({ type: Types.ObjectId })
userClientKey?: Types.ObjectId;
@Prop({ type: String })
fullName?: string;
@Prop({ type: Types.ObjectId })
clientId: Types.ObjectId;
}
export const ClaimOwnerSchema = SchemaFactory.createForClass(ClaimOwner);
@Schema({ _id: false })
export class ClaimMoney {
@Prop({ type: String, trim: true })
sheba?: string;
@Prop({ type: String, trim: true })
nationalCodeOfInsurer?: string;
}
export const ClaimMoneySchema = SchemaFactory.createForClass(ClaimMoney);