forked from Yara724/api
blame and claim refactored
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
|
||||
import { Types } from "mongoose";
|
||||
import { ClaimWorkflowStep } from "src/Types&Enums/claim-request-management/claim-workflow-steps.enum";
|
||||
|
||||
@Schema({ _id: false })
|
||||
export class ClaimActorLock {
|
||||
@Prop({ type: Types.ObjectId })
|
||||
actorId: Types.ObjectId;
|
||||
|
||||
@Prop({ type: String })
|
||||
actorName: string;
|
||||
|
||||
@Prop({ type: String, default: "damage_expert" })
|
||||
actorRole: "damage_expert" | "expert" | "admin";
|
||||
}
|
||||
export const ClaimActorLockSchema = SchemaFactory.createForClass(ClaimActorLock);
|
||||
|
||||
@Schema({ _id: false })
|
||||
export class ClaimWorkflow {
|
||||
@Prop({ type: String, enum: ClaimWorkflowStep })
|
||||
currentStep: ClaimWorkflowStep;
|
||||
|
||||
@Prop({ type: String, enum: ClaimWorkflowStep })
|
||||
nextStep: ClaimWorkflowStep;
|
||||
|
||||
@Prop({ type: [String], enum: ClaimWorkflowStep, default: [] })
|
||||
completedSteps?: ClaimWorkflowStep[];
|
||||
|
||||
@Prop({ type: Boolean, default: false })
|
||||
locked?: boolean;
|
||||
|
||||
@Prop({ type: Date })
|
||||
lockedAt?: Date;
|
||||
|
||||
@Prop({ type: ClaimActorLockSchema })
|
||||
lockedBy?: ClaimActorLock;
|
||||
}
|
||||
export const ClaimWorkflowSchema = SchemaFactory.createForClass(ClaimWorkflow);
|
||||
|
||||
Reference in New Issue
Block a user