Add tenant-scoped insurer, staff and branch management APIs

Support all six staff roles and editable Fanavaran codes, insurer login accounts and optional branch details. Enforce tenant boundaries and role-specific fields, document setup and extend regression coverage.
This commit is contained in:
SepehrYahyaee
2026-10-11 10:42:44 +03:30
parent 4302be8595
commit 0c272f1e86
19 changed files with 1930 additions and 7 deletions
@@ -41,6 +41,21 @@ export class CallCenterAgentModel {
@Prop({ required: false })
phone?: string;
@Prop({ type: String })
city?: string;
@Prop({ type: String })
state?: string;
@Prop({ type: String })
address?: string;
@Prop({ type: Types.ObjectId, index: true })
branchId?: Types.ObjectId;
@Prop({ type: String })
expertCode?: string;
@Prop({ default: RoleEnum.CALL_CENTER })
role: RoleEnum;
@@ -162,6 +162,18 @@ export class DamageExpertModel {
@Prop({type: "string", required: false})
expertCode?: string;
@Prop({ type: String, required: false })
ThirdPartyClaimExpertId?: string;
@Prop({ type: String, required: false })
CarBodyClaimExpertId?: string;
@Prop({ type: String, required: false })
ThirdPartyExpertiseClaim?: string;
@Prop({ type: String, required: false })
CarBodyExpertiseClaim?: string;
createdAt: Date;
}
@@ -75,6 +75,18 @@ export class ExpertModel {
@Prop({type: "string", required: false})
expertCode?: string;
@Prop({ type: String, required: false })
ThirdPartyClaimExpertId?: string;
@Prop({ type: String, required: false })
CarBodyClaimExpertId?: string;
@Prop({ type: String, required: false })
ThirdPartyExpertiseClaim?: string;
@Prop({ type: String, required: false })
CarBodyExpertiseClaim?: string;
createdAt: Date;
}
@@ -40,6 +40,15 @@ export class FieldExpertModel {
@Prop({ required: false })
phone?: string;
@Prop({ type: String })
city?: string;
@Prop({ type: String })
state?: string;
@Prop({ type: String })
address?: string;
@Prop({ default: RoleEnum.FIELD_EXPERT })
role: RoleEnum;
@@ -49,6 +58,18 @@ export class FieldExpertModel {
@Prop({type: "string", required: false})
expertCode?: string;
@Prop({ type: String, required: false })
ThirdPartyClaimExpertId?: string;
@Prop({ type: String, required: false })
CarBodyClaimExpertId?: string;
@Prop({ type: String, required: false })
ThirdPartyExpertiseClaim?: string;
@Prop({ type: String, required: false })
CarBodyExpertiseClaim?: string;
createdAt: Date;
}
@@ -56,6 +56,15 @@ export class FileMakerModel {
@Prop({ required: false })
phone?: string;
@Prop({ type: String })
city?: string;
@Prop({ type: String })
state?: string;
@Prop({ type: String })
address?: string;
@Prop({ default: RoleEnum.FILE_MAKER })
role: RoleEnum;
@@ -56,6 +56,15 @@ export class FileReviewerModel {
@Prop({ required: false })
phone?: string;
@Prop({ type: String })
city?: string;
@Prop({ type: String })
state?: string;
@Prop({ type: String })
address?: string;
@Prop({ default: RoleEnum.FILE_REVIEWER })
role: RoleEnum;