forked from Yara724/api
YARA-899
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user