reworked manual redaction entries condition
This commit is contained in:
parent
7ccc42b80f
commit
e6f3951c2a
@ -16,12 +16,14 @@ export class FileDataModel {
|
||||
}
|
||||
|
||||
get entriesToAdd(): ManualRedactionEntry[] {
|
||||
return this.manualRedactions.entriesToAdd.filter((e) => {
|
||||
const notDeclined = e.status !== 'DECLINED';
|
||||
const notAlreadyDrawn = !this.redactionLogEntry.find((r) => r.id === e.id);
|
||||
const alreadyProcessed = !!e.processedDate && new Date(e.processedDate).getTime() < new Date(this.fileStatus.lastProcessed).getTime();
|
||||
return this.manualRedactions.entriesToAdd.filter((manualRedaction) => {
|
||||
const isRequested =
|
||||
manualRedaction.status === 'REQUESTED' && new Date(manualRedaction.requestDate).getTime() > new Date(this.fileStatus.lastProcessed).getTime();
|
||||
const isApprovedOrDeclined =
|
||||
(manualRedaction.status === 'APPROVED' || manualRedaction.status === 'DECLINED') &&
|
||||
new Date(manualRedaction.requestDate).getTime() > new Date(this.fileStatus.lastProcessed).getTime();
|
||||
|
||||
return notDeclined && notAlreadyDrawn && !alreadyProcessed;
|
||||
return isRequested || isApprovedOrDeclined;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user