feat(assets): thread previousStatus through movement writes
This commit is contained in:
@@ -186,6 +186,7 @@ export async function createAssetUseCase(
|
||||
personId: createdAssignment?.personId || undefined,
|
||||
assignmentId: createdAssignment?.id,
|
||||
userId: actorId,
|
||||
previousStatus: null,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -352,6 +353,7 @@ export async function updateAssetUseCase(
|
||||
personId: activeAssignment.personId || undefined,
|
||||
assignmentId: activeAssignment.id,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -384,6 +386,7 @@ export async function updateAssetUseCase(
|
||||
: "ADJUSTMENT",
|
||||
details: `Status changed from ${transition.previousStatus} to ${transition.nextStatus}`,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -408,6 +411,7 @@ export async function updateAssetUseCase(
|
||||
type: "OUT",
|
||||
details: `Asset moved from item ${transition.previousItemId} to ${transition.nextItemId}`,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -420,6 +424,7 @@ export async function updateAssetUseCase(
|
||||
type: "IN",
|
||||
details: `Asset moved from item ${transition.previousItemId} to ${transition.nextItemId}`,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -444,6 +449,7 @@ export async function updateAssetUseCase(
|
||||
type: "OUT",
|
||||
details: `Asset assigned from item ${transition.previousItemId} to item ${transition.nextItemId}`,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -463,6 +469,7 @@ export async function updateAssetUseCase(
|
||||
personId: activeAssignment.personId || undefined,
|
||||
assignmentId: activeAssignment.id,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -476,6 +483,7 @@ export async function updateAssetUseCase(
|
||||
personId: transition.nextPersonId,
|
||||
assignmentId: activeAssignment.id,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
@@ -527,6 +535,7 @@ export async function updateAssetUseCase(
|
||||
personId: transition.nextPersonId,
|
||||
assignmentId: createdAssignment.id,
|
||||
userId: actorId,
|
||||
previousStatus: transition.previousStatus,
|
||||
},
|
||||
tx,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user