Skip to content

Commit

Permalink
Added grants template items to project load template #3356
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Jan 6, 2025
1 parent 7a5d653 commit 085f053
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/groovy/au/org/ala/merit/GmsMapper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GmsMapper {
static final REPORTING_THEME_COLUMN = 'PGAT_PRIORITY'

static final FINANCIAL_YEAR_FUNDING_PREFIX = 'FUNDING_'

static final FINANCIAL_YEAR_FUNDING_DESCRIPTION = "FINANCIAL_YEAR_FUNDING_DESCRIPTION"
static MERIT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")

static final GMS_DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy")
Expand Down Expand Up @@ -177,7 +177,7 @@ class GmsMapper {
}
}
// Special case for MERI plan funding mapping
headers << "FINANCIAL_YEAR_FUNDING_DESCRIPTION"
headers << FINANCIAL_YEAR_FUNDING_DESCRIPTION
descriptions << "Description of the funding for each financial year. Must be present for financial year funding amounts to be imported"

for (int i : (18..30)) {
Expand All @@ -199,7 +199,7 @@ class GmsMapper {
mappingKeys.add(DATA_SUB_TYPE_COLUMN)
mappingKeys.add(REPORTING_THEME_COLUMN)
mappingKeys.add(FINANCIAL_YEAR_FUNDING_PREFIX)
mappingKeys.add("FINANCIAL_YEAR_FUNDING_DESCRIPTION")
mappingKeys.add(FINANCIAL_YEAR_FUNDING_DESCRIPTION)

projectRows[0].keySet().each { key ->
if (!key?.trim() || key == 'index') {
Expand Down
3 changes: 2 additions & 1 deletion src/test/groovy/au/org/ala/merit/GmsMapperSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ class GmsMapperSpec extends Specification{

then: "We are just checking every value in the spreadsheet is mappable and has a description"
lines.size() == 4
Map mappings = gmsMapper.projectMapping + gmsMapper.geographicInfoMapping
lines[3].every {String value ->
gmsMapper.projectMapping[value].description != null
value == GmsMapper.FINANCIAL_YEAR_FUNDING_DESCRIPTION || value.startsWith(GmsMapper.FINANCIAL_YEAR_FUNDING_PREFIX) || mappings[value].description != null
}
}

Expand Down

0 comments on commit 085f053

Please sign in to comment.