forked from Yara724/api
Fixed lock mechanism, and some resendItem types
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
|
||||
import { Types } from "mongoose";
|
||||
import { ClaimWorkflowStep } from "src/Types&Enums/claim-request-management/claim-workflow-steps.enum";
|
||||
import { ClaimStatus } from "src/Types&Enums/claim-request-management/claimStatus.enum";
|
||||
import {
|
||||
ExpertProfileSnapshot,
|
||||
ExpertProfileSnapshotSchema,
|
||||
@@ -23,6 +24,22 @@ export class ClaimActorLock {
|
||||
}
|
||||
export const ClaimActorLockSchema = SchemaFactory.createForClass(ClaimActorLock);
|
||||
|
||||
/** Captures queue fields before a damage-expert lock; restored if the lock TTL expires without a reply. */
|
||||
@Schema({ _id: false })
|
||||
export class ClaimPreLockQueueSnapshot {
|
||||
@Prop({ type: String, enum: ClaimStatus, required: true })
|
||||
claimStatus: ClaimStatus;
|
||||
|
||||
@Prop({ type: String, enum: ClaimWorkflowStep, required: true })
|
||||
currentStep: ClaimWorkflowStep;
|
||||
|
||||
@Prop({ type: String, enum: ClaimWorkflowStep, required: false })
|
||||
nextStep?: ClaimWorkflowStep;
|
||||
}
|
||||
export const ClaimPreLockQueueSnapshotSchema = SchemaFactory.createForClass(
|
||||
ClaimPreLockQueueSnapshot,
|
||||
);
|
||||
|
||||
@Schema({ _id: false })
|
||||
export class ClaimWorkflow {
|
||||
@Prop({ type: String, enum: ClaimWorkflowStep })
|
||||
@@ -46,6 +63,9 @@ export class ClaimWorkflow {
|
||||
|
||||
@Prop({ type: ClaimActorLockSchema })
|
||||
lockedBy?: ClaimActorLock;
|
||||
|
||||
@Prop({ type: ClaimPreLockQueueSnapshotSchema })
|
||||
preLockQueueSnapshot?: ClaimPreLockQueueSnapshot;
|
||||
}
|
||||
export const ClaimWorkflowSchema = SchemaFactory.createForClass(ClaimWorkflow);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user