fix(auth): add debug logs to transition

This commit is contained in:
Karol Sójko 2023-09-19 08:02:27 +02:00
parent 41cd377145
commit bf855bb26e
No known key found for this signature in database
GPG key ID: C2F813669419D05F

View file

@ -53,7 +53,10 @@ const requestTransition = async (
continue
}
let wasTransitionRequested = false
if (itemsTransitionStatus?.value !== TransitionStatus.STATUSES.Verified) {
wasTransitionRequested = true
await transitionStatusRepository.remove(user.uuid, 'items')
await domainEventPublisher.publish(
@ -66,6 +69,7 @@ const requestTransition = async (
}
if (revisionsTransitionStatus?.value !== TransitionStatus.STATUSES.Verified) {
wasTransitionRequested = true
await transitionStatusRepository.remove(user.uuid, 'revisions')
await domainEventPublisher.publish(
@ -78,6 +82,12 @@ const requestTransition = async (
}
usersTriggered += 1
if (wasTransitionRequested) {
logger.info(
`[TRANSITION ${timestamp}] Transition requested for user ${user.uuid} - items status: ${itemsTransitionStatus?.value}, revisions status: ${revisionsTransitionStatus?.value}, has transition role: ${userHasTransitionRole}`,
)
}
}
logger.info(