Skip to content

Commit

Permalink
Added grants backload fields to upload template instructions #3356
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Oct 24, 2024
1 parent c027271 commit 52bc692
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/main/groovy/au/org/ala/merit/GmsMapper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class GmsMapper {

def geographicInfoMapping = [
NATIONWIDE:[name:'nationwide', type:'boolean', description:'If true, this project does not have a primary state'],
PRIMARY_STATE:[name:'primaryState', type:'string', description:''],
PRIMARY_ELECTORATE:[name:'primaryElectorate', type:'string', description:''],
OTHER_ELECTORATES:[name:'otherElectorates', type:'list', description:''],
OTHER_STATES:[name:'otherStates', type:'list', description:'']
PRIMARY_STATE:[name:'primaryState', type:'string', description:'The primary state to be manually assigned to this project'],
PRIMARY_ELECTORATE:[name:'primaryElectorate', type:'string', description:'The primary electorate to be manually assigned to this project'],
OTHER_ELECTORATES:[name:'otherElectorates', type:'list', description:'Other electorates to be manually assigned to this project. Enter as a comma separated list'],
OTHER_STATES:[name:'otherStates', type:'list', description:'Other states to be manually assigned to this project. Enter as a comma separated list'],
]


Expand Down Expand Up @@ -163,7 +163,7 @@ class GmsMapper {
List descriptions = []
List mandatoryFlags = []
List headers = []
projectMapping.each { String key, Map value ->
(projectMapping + geographicInfoMapping).each { String key, Map value ->
// Deliberately omit fields without a description as they are largely deprecated.
String description = value.description
if (description) {
Expand All @@ -175,6 +175,15 @@ class GmsMapper {
descriptions << description
}
}
// Special case for MERI plan funding mapping
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)) {
headers << FINANCIAL_YEAR_FUNDING_PREFIX+i+"_"+(i+1)
descriptions << "Funding amount for the financial year ${i} to ${i+1}"
}

csvWriter.writeNext(descriptions as String[])
csvWriter.writeNext(mandatoryFlags as String[])
csvWriter.writeNext(headers as String[])
Expand Down

0 comments on commit 52bc692

Please sign in to comment.