Skip to content

Commit

Permalink
feat(forecasted grants): return correct opportunity status
Browse files Browse the repository at this point in the history
  • Loading branch information
lsr-explore committed Oct 22, 2024
1 parent e1b6b7e commit f565549
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/server/src/db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,13 @@ async function getGrantsNew(filters, paginationParams, orderingParams, tenantId,
'grants.funding_instrument_codes',
'grants.bill',
'grants.funding_activity_category_codes',
'grants.opportunity_status',
])
.select(knex.raw(`
CASE
WHEN grants.archive_date <= now() THEN 'archived'
WHEN grants.close_date <= now() THEN 'closed'
WHEN grants.open_date > now() THEN 'forecasted'
WHEN grants.open_date > now() OR grants.opportunity_status = 'forecasted' THEN 'forecasted'
ELSE 'posted'
END as opportunity_status
`))
Expand Down

0 comments on commit f565549

Please sign in to comment.