Skip to content

Commit

Permalink
remove status 21 from the list to identify amendment approver
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijesh committed Nov 12, 2024
1 parent 0015a19 commit 657f098
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libs/db2/model/plansnapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default class PlanSnapshot extends Model {
snapshot: row.snapshot,
});
}
if (Plan.legalStatuses.indexOf(row.status_id) !== -1) {
if ([20, 8, 9, 12].indexOf(row.status_id) !== -1) {
if (lastMandatoryAmendment !== null) {
response[lastMandatoryAmendment].approvedBy = `${row.given_name} ${row.family_name}`;
response[lastMandatoryAmendment].approvedAt = row.created_at;
Expand All @@ -153,12 +153,13 @@ export default class PlanSnapshot extends Model {
}
}
}
const responseReversed = response.reverse();
const currentLegalVersion = responseReversed.find(
const responseSorted = response.reverse();

const currentLegalVersion = responseSorted.find(
(resp) => Plan.legalStatuses.indexOf(resp.snapshot.statusId) !== -1,
);
if (currentLegalVersion) currentLegalVersion.isCurrentLegalVersion = true;
return responseReversed;
return responseSorted;
}

async fetchStatus(db) {
Expand Down

0 comments on commit 657f098

Please sign in to comment.