diff --git a/src/client/pages/VergunningDetail/RvvSloterweg.tsx b/src/client/pages/VergunningDetail/RvvSloterweg.tsx
index f667eb0ecc..c5f9559e9a 100644
--- a/src/client/pages/VergunningDetail/RvvSloterweg.tsx
+++ b/src/client/pages/VergunningDetail/RvvSloterweg.tsx
@@ -18,15 +18,20 @@ export function getRVVSloterwegLineItems(
const isReceived =
(!vergunning.dateWorkflowActive || !vergunning.dateWorkflowVerleend) &&
!vergunning.decision;
- const isInprogress = !!vergunning.dateWorkflowActive && !vergunning.decision;
- const isGranted = !!vergunning.dateWorkflowVerleend && !vergunning.decision;
+ const isInprogress = !!vergunning.dateWorkflowActive;
+ const isGranted = !!vergunning.dateWorkflowVerleend;
const isExpired =
- (vergunning.dateEnd && isGranted
+ (vergunning.dateEnd && isGranted && !vergunning.decision
? new Date(vergunning.dateEnd) < new Date()
: false) ||
vergunning.decision === RVV_SLOTERWEG_RESULT_UPDATED_WIHT_NEW_KENTEKEN;
+ const hasDecision =
+ isRevoked ||
+ isMatured ||
+ vergunning.decision === RVV_SLOTERWEG_RESULT_UPDATED_WIHT_NEW_KENTEKEN;
+
const lineItems: StatusLineItem[] = [
{
id: 'status-ontvangen',
@@ -46,20 +51,22 @@ export function getRVVSloterwegLineItems(
datePublished: vergunning.dateWorkflowActive ?? '',
description: '',
documents: [],
- isActive: isInprogress && !isGranted,
+ isActive: isInprogress && !isGranted && !isRevoked,
isChecked: isInprogress,
});
}
- lineItems.push({
- id: 'status-in-verleend',
- status: 'Verleend',
- datePublished: vergunning.dateWorkflowVerleend ?? '',
- description: '',
- documents: [],
- isActive: isGranted,
- isChecked: !!vergunning.dateWorkflowVerleend,
- });
+ if (isGranted || (!isGranted && !isRevoked)) {
+ lineItems.push({
+ id: 'status-in-verleend',
+ status: 'Verleend',
+ datePublished: vergunning.dateWorkflowVerleend ?? '',
+ description: '',
+ documents: [],
+ isActive: isGranted && !hasDecision,
+ isChecked: !!vergunning.dateWorkflowVerleend || hasDecision,
+ });
+ }
if (isRevoked) {
lineItems.push({
@@ -101,7 +108,7 @@ export function getRVVSloterwegLineItems(
});
}
- if (isGranted && !isExpired) {
+ if (isGranted && !isExpired && !isMatured && !isRevoked) {
lineItems.push({
id: 'status-verlopen-placeholder',
status: 'Verlopen',
diff --git a/src/client/pages/VergunningDetail/__snapshots__/VergunningDetail.test.tsx.snap b/src/client/pages/VergunningDetail/__snapshots__/VergunningDetail.test.tsx.snap
index 5b25b87d8f..de21927325 100644
--- a/src/client/pages/VergunningDetail/__snapshots__/VergunningDetail.test.tsx.snap
+++ b/src/client/pages/VergunningDetail/__snapshots__/VergunningDetail.test.tsx.snap
@@ -4561,6 +4561,20 @@ exports[`
+ 22 juli 2023 +
++ 22 juli 2023 +
+