1
0
forked from Yara724/api
This commit is contained in:
SepehrYahyaee
2026-05-12 10:26:04 +03:30
parent 07c4e5126a
commit e89cf107ff
3 changed files with 169 additions and 0 deletions

View File

@@ -2,6 +2,21 @@ import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
export type ClientDocument = ClientModel & Document;
/**
* Per-tenant tunables. Add new policy fields here; consumers read them via
* `ClientService` with documented defaults so older client documents keep
* working when a field is missing.
*/
export class ClientSettings {
/**
* Max number of days between the accident and the moment a CAR_BODY blame
* file is allowed to be submitted. When unset, consumers fall back to the
* system default (see {@link ClientService.getCarBodyAccidentMaxAgeDays}).
*/
@Prop({ type: Number, required: false })
carBodyAccidentMaxAgeDays?: number;
}
@Schema({ collection: "clients", versionKey: false })
export class ClientModel {
@Prop({ required: true, unique: true, type: Object })
@@ -20,6 +35,9 @@ export class ClientModel {
@Prop({ required: true, unique: false })
clientCode: number;
@Prop({ type: ClientSettings, required: false, default: {} })
settings?: ClientSettings;
}
export const ClientDbSchema = SchemaFactory.createForClass(ClientModel);