From 52bc692bbb8df48416618d5e01f6633280db32e6 Mon Sep 17 00:00:00 2001 From: chrisala Date: Thu, 24 Oct 2024 14:09:28 +1100 Subject: [PATCH] Added grants backload fields to upload template instructions #3356 --- .../groovy/au/org/ala/merit/GmsMapper.groovy | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/au/org/ala/merit/GmsMapper.groovy b/src/main/groovy/au/org/ala/merit/GmsMapper.groovy index 8feac3ef6..1bf9d8bb9 100644 --- a/src/main/groovy/au/org/ala/merit/GmsMapper.groovy +++ b/src/main/groovy/au/org/ala/merit/GmsMapper.groovy @@ -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'], ] @@ -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) { @@ -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[])