diff --git a/arSam/handlers/export-variance/__tests__/export-variance.tests.js b/arSam/handlers/export-variance/__tests__/export-variance.tests.js index 52f6c72..d494904 100644 --- a/arSam/handlers/export-variance/__tests__/export-variance.tests.js +++ b/arSam/handlers/export-variance/__tests__/export-variance.tests.js @@ -1,60 +1,60 @@ const { DynamoDBClient, PutItemCommand } = require('@aws-sdk/client-dynamodb'); -const { REGION, ENDPOINT } = require("../../../__tests__/settings"); -const { PARKSLIST, SUBAREAS, VARIANCE_JOBSLIST, VARIANCE_MOCKJOB } = require("../../../__tests__/mock_data.json"); -const { getHashedText, deleteDB, createDB } = require("../../../__tests__/setup"); +const { REGION, ENDPOINT } = require('../../../__tests__/settings'); +const { PARKSLIST, SUBAREAS, VARIANCE_JOBSLIST, VARIANCE_MOCKJOB } = require('../../../__tests__/mock_data.json'); +const { getHashedText, deleteDB, createDB } = require('../../../__tests__/setup'); const { marshall } = require('@aws-sdk/util-dynamodb'); -const jwt = require("jsonwebtoken"); +const jwt = require('jsonwebtoken'); const tokenContent = { - resource_access: { "attendance-and-revenue": { roles: ["sysadmin"] } }, + resource_access: { 'attendance-and-revenue': { roles: ['sysadmin'] } }, }; -const token = jwt.sign(tokenContent, "defaultSecret"); +const token = jwt.sign(tokenContent, 'defaultSecret'); async function setupDb(TABLE_NAME) { const dynamoClient = new DynamoDBClient({ region: REGION, - endpoint: ENDPOINT + endpoint: ENDPOINT, }); for (const park of PARKSLIST) { let params = { - TableName: TABLE_NAME, - Item: marshall(park), - } + TableName: TABLE_NAME, + Item: marshall(park), + }; await dynamoClient.send(new PutItemCommand(params)); } for (const subarea of SUBAREAS) { params = { - TableName: TABLE_NAME, - Item: marshall(subarea), - } + TableName: TABLE_NAME, + Item: marshall(subarea), + }; await dynamoClient.send(new PutItemCommand(params)); } for (const job of VARIANCE_JOBSLIST) { params = { - TableName: TABLE_NAME, - Item: marshall(job), - } + TableName: TABLE_NAME, + Item: marshall(job), + }; await dynamoClient.send(new PutItemCommand(params)); } } -describe("Export Variance Report", () => { +describe('Export Variance Report', () => { const OLD_ENV = process.env; - let hash - let TABLE_NAME - let NAME_CACHE_TABLE_NAME - let CONFIG_TABLE_NAME - + let hash; + let TABLE_NAME; + let NAME_CACHE_TABLE_NAME; + let CONFIG_TABLE_NAME; + beforeEach(async () => { jest.resetModules(); process.env = { ...OLD_ENV }; // Make a copy of environment hash = getHashedText(expect.getState().currentTestName); - process.env.TABLE_NAME = hash + process.env.TABLE_NAME = hash; TABLE_NAME = process.env.TABLE_NAME; - NAME_CACHE_TABLE_NAME = TABLE_NAME.concat("-nameCache"); - CONFIG_TABLE_NAME = TABLE_NAME.concat("-config"); + NAME_CACHE_TABLE_NAME = TABLE_NAME.concat('-nameCache'); + CONFIG_TABLE_NAME = TABLE_NAME.concat('-config'); await createDB(TABLE_NAME, NAME_CACHE_TABLE_NAME, CONFIG_TABLE_NAME); await setupDb(TABLE_NAME); }); @@ -64,135 +64,133 @@ describe("Export Variance Report", () => { process.env = OLD_ENV; // Restore old environment }); - test("Handler - 403 GET Invalid Auth", async () => { + test('Handler - 403 GET Invalid Auth', async () => { const event = { - headers: { - Authorization: "Bearer " + token, - }, - httpMethod: "GET", - requestContext: { - authorizer: { - roles: "[\"public\"]", - isAdmin: false, - isAuthenticated: false, - }, + headers: { + Authorization: 'Bearer ' + token, + }, + httpMethod: 'GET', + requestContext: { + authorizer: { + roles: '["public"]', + isAdmin: false, + isAuthenticated: false, }, + }, }; - const varianceExportGET = require("../GET/index"); + const varianceExportGET = require('../GET/index'); const response = await varianceExportGET.handler(event, null); expect(response.statusCode).toBe(403); }); - test("Handler - 400 no fiscal year provided", async () => { - const dateField = "dateGenerated" + test('Handler - 400 no fiscal year provided', async () => { + const dateField = 'dateGenerated'; const event = { headers: { - Authorization: "Bearer " + token, + Authorization: 'Bearer ' + token, }, - httpMethod: "GET", + httpMethod: 'GET', requestContext: { authorizer: { - roles: "[\"sysadmin\"]", + roles: '["sysadmin"]', isAdmin: true, isAuthenticated: true, }, }, queryStringParameters: { - getJob: "true" + getJob: 'true', }, }; - const varianceExportGET = require("../GET/index"); + const varianceExportGET = require('../GET/index'); const result = await varianceExportGET.handler(event, null); let body; try { - body = JSON.parse(result.body) + body = JSON.parse(result.body); } catch (e) { - body = 'fail' + body = 'fail'; } expect(result).toEqual( expect.objectContaining({ headers: { - "Access-Control-Allow-Headers": - "Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token", - "Access-Control-Allow-Methods": "OPTIONS,GET,POST,PUT,DELETE", - "Access-Control-Allow-Origin": "*", - "Content-Type": "application/json", + 'Access-Control-Allow-Headers': 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token', + 'Access-Control-Allow-Methods': 'OPTIONS,GET,POST,PUT,DELETE', + 'Access-Control-Allow-Origin': '*', + 'Content-Type': 'application/json', }, statusCode: 400, }), ); - }) + }); - test("Handler - 200 GET, with no jobs", async () => { - process.env.IS_OFFLINE = 'true' - const dateField = "dateGenerated" + test('Handler - 200 GET, with no jobs', async () => { + process.env.IS_OFFLINE = 'true'; + const dateField = 'dateGenerated'; const event = { headers: { - Authorization: "Bearer " + token, + Authorization: 'Bearer ' + token, }, - httpMethod: "GET", + httpMethod: 'GET', requestContext: { authorizer: { - roles: "[\"sysadmin\"]", + roles: '["sysadmin"]', isAdmin: true, isAuthenticated: true, }, }, queryStringParameters: { - getJob: "true", - fiscalYearEnd: 2023 + getJob: 'true', + fiscalYearEnd: 2023, }, }; - const varianceExportGET = require("../GET/index"); + const varianceExportGET = require('../GET/index'); const result = await varianceExportGET.handler(event, null); let body; try { - body = JSON.parse(result.body) + body = JSON.parse(result.body); console.log('body:', body); } catch (e) { - body = 'fail' + body = 'fail'; } expect(result).toEqual( expect.objectContaining({ headers: { - "Access-Control-Allow-Headers": - "Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token", - "Access-Control-Allow-Methods": "OPTIONS,GET,POST,PUT,DELETE", - "Access-Control-Allow-Origin": "*", - "Content-Type": "application/json", + 'Access-Control-Allow-Headers': 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token', + 'Access-Control-Allow-Methods': 'OPTIONS,GET,POST,PUT,DELETE', + 'Access-Control-Allow-Origin': '*', + 'Content-Type': 'application/json', }, statusCode: 200, }), ); - expect(body.jobObj[dateField]).toMatch(VARIANCE_JOBSLIST[0][dateField]) - }) + expect(body.jobObj[dateField]).toMatch(VARIANCE_JOBSLIST[0][dateField]); + }); - test("Handler - 200 GET, generate report", async () => { + test('Handler - 200 GET, generate report', async () => { const event = { headers: { - Authorization: "Bearer " + token, + Authorization: 'Bearer ' + token, }, - httpMethod: "GET", + httpMethod: 'GET', requestContext: { authorizer: { - roles: "[\"sysadmin\"]", + roles: '["sysadmin"]', isAdmin: true, isAuthenticated: true, }, }, queryStringParameters: { - fiscalYearEnd: 2023 + fiscalYearEnd: 2023, }, }; - const varianceExportGET = require("../GET/index"); - const result = await varianceExportGET.handler(event, null) + const varianceExportGET = require('../GET/index'); + const result = await varianceExportGET.handler(event, null); // Returns value below even with no job // Update when invokable can be called - expect(result.body).toBe("{\"msg\":\"Variance report export job already running\"}") + expect(result.body).toBe('{"msg":"Variance report export job already running"}'); }); }); diff --git a/arSam/handlers/export-variance/invokable/index.js b/arSam/handlers/export-variance/invokable/index.js index d8c83ac..ec2fe14 100644 --- a/arSam/handlers/export-variance/invokable/index.js +++ b/arSam/handlers/export-variance/invokable/index.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const { VARIANCE_CSV_SCHEMA, VARIANCE_STATE_DICTIONARY } = require("/opt/constantsLayer"); +const { VARIANCE_CSV_SCHEMA, VARIANCE_STATE_DICTIONARY, EXPORT_VARIANCE_CONFIG } = require("/opt/constantsLayer"); const { getParks, TABLE_NAME, dynamoClient, @@ -234,16 +234,29 @@ function updateHighAccuracyJobState(state, index, total, size){ } } +// used to flatten EXPORT_VARIANCE_CONFIG keys into an array +function flattenConfig(config) { + let flattenedKeys = []; + Object.values(config).forEach(category => { + Object.keys(category).forEach(key => { + flattenedKeys.push(key); + }); + }); + return flattenedKeys; +} + function formatRecords(records) { for (const record of records) { - // list all variances as semicolon separated string so it can be parsed later - if (record.fields.length > 0) { - let fields = []; + // add each existing variance field to the record + if (record.fields && record.fields.length > 0) { for (const field of record.fields) { - const percent = (parseFloat(field.percentageChange) * 100).toFixed(2); - fields.push(String(field.key + " " + percent + "%")); + // if the key matches an item in the array of EXPORT_VARIANCE_CONFIG, push it to the record + const flattenedConfig = flattenConfig(EXPORT_VARIANCE_CONFIG); + if (flattenedSchema.includes(field.key)) { + const percent = (parseFloat(field.percentageChange) * 100).toFixed(2); + record[field.key] = String(percent + "%"); + } } - record['fields'] = fields.join("; "); } const date = record.pk.split('::')[2]; record['year'] = date.slice(0, 4); @@ -268,8 +281,39 @@ function createCSV(records) { record.year || 'N/A', record.month || 'N/A', `"${record.notes || ''}"`, - record.fields || '', - record.resolved || '' + record.resolved || '', + record['peopleAdult'] || '', + record['peopleChild'] || '', + record['peopleFamily'] || '', + record['revenueFamily'] || '', + record['people'] || '', + record['grossCampingRevenue'] || '', + record['boatAttendanceNightsOnDock'] || '', + record['boatAttendanceNightsOnBouys'] || '', + record['boatAttendanceMiscellaneous'] || '', + record['boatRevenueGross'] || '', + record['peopleAndVehiclesTrail'] || '', + record['peopleAndVehiclesVehicle'] || '', + record['peopleAndVehiclesBus'] || '', + record['picnicRevenueShelter'] || '', + record['picnicShelterPeople'] || '', + record['picnicRevenueGross'] || '', + record['otherDayUsePeopleHotSprings'] || '', + record['otherDayUseRevenueHotSprings'] || '', + record['totalAttendanceParties'] || '', + record['revenueGrossCamping'] || '', + record['campingPartyNightsAttendanceStandard'] || '', + record['campingPartyNightsAttendanceSenior'] || '', + record['campingPartyNightsAttendanceSocial'] || '', + record['campingPartyNightsAttendanceLongStay'] || '', + record['campingPartyNightsRevenueGross'] || '', + record['secondCarsAttendanceStandard'] || '', + record['secondCarsAttendanceSenior'] || '', + record['secondCarsAttendanceSocial'] || '', + record['secondCarsRevenueGross'] || '', + record['otherRevenueGrossSani'] || '', + record['otherRevenueElectrical'] || '', + record['otherRevenueShower'] || '' ]) } let csvData = ''; @@ -312,3 +356,4 @@ function convertMonth(monthNumber){ } } + diff --git a/arSam/handlers/export/__tests__/export.test.js b/arSam/handlers/export/__tests__/export.test.js index d3ba53d..b02c2c9 100644 --- a/arSam/handlers/export/__tests__/export.test.js +++ b/arSam/handlers/export/__tests__/export.test.js @@ -1,61 +1,61 @@ const { DynamoDBClient, PutItemCommand } = require('@aws-sdk/client-dynamodb'); -const { REGION, ENDPOINT } = require("../../../__tests__/settings"); -const { PARKSLIST, SUBAREAS, JOBSLIST, MOCKJOB } = require("../../../__tests__/mock_data.json"); -const { getHashedText, deleteDB, createDB } = require("../../../__tests__/setup"); +const { REGION, ENDPOINT } = require('../../../__tests__/settings'); +const { PARKSLIST, SUBAREAS, JOBSLIST, MOCKJOB } = require('../../../__tests__/mock_data.json'); +const { getHashedText, deleteDB, createDB } = require('../../../__tests__/setup'); const { marshall } = require('@aws-sdk/util-dynamodb'); -const jwt = require("jsonwebtoken"); +const jwt = require('jsonwebtoken'); const tokenContent = { - resource_access: { "attendance-and-revenue": { roles: ["sysadmin"] } }, + resource_access: { 'attendance-and-revenue': { roles: ['sysadmin'] } }, }; -const token = jwt.sign(tokenContent, "defaultSecret"); +const token = jwt.sign(tokenContent, 'defaultSecret'); async function setupDb(tableName) { const dynamoClient = new DynamoDBClient({ region: REGION, - endpoint: ENDPOINT + endpoint: ENDPOINT, }); for (const park of PARKSLIST) { let params = { - TableName: tableName, - Item: marshall(park), - } - await dynamoClient.send(new PutItemCommand(params)) + TableName: tableName, + Item: marshall(park), + }; + await dynamoClient.send(new PutItemCommand(params)); } for (const subarea of SUBAREAS) { let params = { - TableName: tableName, - Item: marshall(subarea), - } - await dynamoClient.send(new PutItemCommand(params)) - } + TableName: tableName, + Item: marshall(subarea), + }; + await dynamoClient.send(new PutItemCommand(params)); + } for (const job of JOBSLIST) { let params = { - TableName: tableName, - Item: marshall(job), - } - await dynamoClient.send(new PutItemCommand(params)) + TableName: tableName, + Item: marshall(job), + }; + await dynamoClient.send(new PutItemCommand(params)); } } -describe("Export Report", () => { +describe('Export Report', () => { const OLD_ENV = process.env; - let hash - let TABLE_NAME - let NAME_CACHE_TABLE_NAME - let CONFIG_TABLE_NAME - + let hash; + let TABLE_NAME; + let NAME_CACHE_TABLE_NAME; + let CONFIG_TABLE_NAME; + beforeEach(async () => { jest.resetModules(); process.env = { ...OLD_ENV }; // Make a copy of environment hash = getHashedText(expect.getState().currentTestName); - process.env.TABLE_NAME = hash + process.env.TABLE_NAME = hash; TABLE_NAME = process.env.TABLE_NAME; - NAME_CACHE_TABLE_NAME = TABLE_NAME.concat("-nameCache"); - CONFIG_TABLE_NAME = TABLE_NAME.concat("-config"); + NAME_CACHE_TABLE_NAME = TABLE_NAME.concat('-nameCache'); + CONFIG_TABLE_NAME = TABLE_NAME.concat('-config'); await createDB(TABLE_NAME, NAME_CACHE_TABLE_NAME, CONFIG_TABLE_NAME); await setupDb(TABLE_NAME); }); @@ -64,113 +64,112 @@ describe("Export Report", () => { deleteDB(TABLE_NAME, NAME_CACHE_TABLE_NAME, CONFIG_TABLE_NAME); process.env = OLD_ENV; // Restore old environment }); - - test("Handler - 403 GET Invalid Auth", async () => { + + test('Handler - 403 GET Invalid Auth', async () => { const event = { - headers: { - Authorization: "Bearer " + token, - }, - requestContext: { - authorizer: { - roles: "[\"public\"]", - isAdmin: false, - isAuthenticated: false, - } - }, - httpMethod: "GET", - queryStringParameters: { - getJob: "true" + headers: { + Authorization: 'Bearer ' + token, + }, + requestContext: { + authorizer: { + roles: '["public"]', + isAdmin: false, + isAuthenticated: false, }, + }, + httpMethod: 'GET', + queryStringParameters: { + getJob: 'true', + }, }; - - const exportGET = require("../GET/index"); + + const exportGET = require('../GET/index'); const response = await exportGET.handler(event, null); expect(response.statusCode).toBe(403); }); - test("Handler - 200 GET, with no jobs", async () => { - process.env.IS_OFFLINE = 'true' - const dateField = "dateGenerated" + test('Handler - 200 GET, with no jobs', async () => { + process.env.IS_OFFLINE = 'true'; + const dateField = 'dateGenerated'; const event = { headers: { - Authorization: "Bearer " + token, + Authorization: 'Bearer ' + token, }, requestContext: { authorizer: { - roles: "[\"sysadmin\"]", - isAdmin: true, - isAuthenticated: true, - } + roles: '["sysadmin"]', + isAdmin: true, + isAuthenticated: true, + }, }, - httpMethod: "GET", + httpMethod: 'GET', queryStringParameters: { - getJob: "true" + getJob: 'true', }, }; - const exportGET = require("../GET/index"); + const exportGET = require('../GET/index'); const result = await exportGET.handler(event, null); let body; try { - body = JSON.parse(result.body) + body = JSON.parse(result.body); } catch (e) { - console.log("In this dumb catch") - body = 'fail' + console.log('In this dumb catch'); + body = 'fail'; } - + expect(result).toEqual( expect.objectContaining({ headers: { - "Access-Control-Allow-Headers": - "Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token", - "Access-Control-Allow-Methods": "OPTIONS,GET,POST,PUT,DELETE", - "Access-Control-Allow-Origin": "*", - "Content-Type": "application/json", + 'Access-Control-Allow-Headers': 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token', + 'Access-Control-Allow-Methods': 'OPTIONS,GET,POST,PUT,DELETE', + 'Access-Control-Allow-Origin': '*', + 'Content-Type': 'application/json', }, statusCode: 200, }), ); - expect(body.jobObj[dateField]).toMatch(JOBSLIST[0][dateField]) - }) + expect(body.jobObj[dateField]).toMatch(JOBSLIST[0][dateField]); + }); - test("Handler - 200 GET, generate report", async () => { + test('Handler - 200 GET, generate report', async () => { const event = { headers: { - Authorization: "Bearer " + token, + Authorization: 'Bearer ' + token, }, requestContext: { authorizer: { - roles: "[\"sysadmin\"]", + roles: '["sysadmin"]', isAdmin: true, isAuthenticated: true, }, }, - httpMethod: "GET", + httpMethod: 'GET', }; - const exportGET = require("../GET/index"); - const result = await exportGET.handler(event, null) + const exportGET = require('../GET/index'); + const result = await exportGET.handler(event, null); // Returns value below even with no job // Update when invokable can be called - expect(result.body).toBe("{\"status\":\"Job is already running\"}") + expect(result.body).toBe('{"status":"Job is already running"}'); }); - test("Functions - updateJobEntry", async () => { + test('Functions - updateJobEntry', async () => { const query = { TableName: TABLE_NAME, - KeyConditionExpression: "pk = :pk AND sk = :sk", + KeyConditionExpression: 'pk = :pk AND sk = :sk', ExpressionAttributeValues: { - ":pk": { S: "job" }, - ":sk": {S: "MOCK_JOB_ID"} - } + ':pk': { S: 'job' }, + ':sk': { S: 'MOCK_JOB_ID' }, + }, }; - const exportFUNCTIONS = require("/opt/functionsLayer"); - await exportFUNCTIONS.updateJobEntry(MOCKJOB, TABLE_NAME) - const utils = require("/opt/baseLayer"); - const result = await utils.runQuery(query) + const exportFUNCTIONS = require('/opt/functionsLayer'); + await exportFUNCTIONS.updateJobEntry(MOCKJOB, TABLE_NAME); + const utils = require('/opt/baseLayer'); + const result = await utils.runQuery(query); - expect(result).toMatchObject([MOCKJOB]) - }) + expect(result).toMatchObject([MOCKJOB]); + }); }); diff --git a/arSam/layers/constantsLayer/constantsLayer.js b/arSam/layers/constantsLayer/constantsLayer.js index a759fcf..3391b30 100644 --- a/arSam/layers/constantsLayer/constantsLayer.js +++ b/arSam/layers/constantsLayer/constantsLayer.js @@ -743,10 +743,51 @@ const CSV_SYSADMIN_SCHEMA = [ }, ]; -VARIANCE_CSV_SCHEMA = [ - 'Bundle', 'ORCS', 'Park Name', 'Sub-area Name', 'Sub-area ID', 'Activity', 'Year', 'Month', 'Notes', 'Variances', 'Resolved' -] - + VARIANCE_CSV_SCHEMA = [ + 'Bundle', + 'ORCS', + 'Park Name', + 'Sub-area Name', + 'Sub-area ID', + 'Activity', + 'Year', + 'Month', + 'Notes', + 'Resolved', + 'Backcountry Cabins - People - Adult', + 'Backcountry Cabins - People - Youth', + 'Backcountry Cabins - People - Family', + 'Backcountry Cabins - Revenue Family', + 'Backcountry Camping - People', + 'Backcountry Camping - Gross Revenue', + 'Boating - Boat Attendance - Nights On Dock', + 'Boating - Boat Attendance - Nights On Bouys', + 'Boating - Boat Attendance - Miscellaneous', + 'Boating - Boat Revenue - Gross Revenue', + 'Day Use - People And Vehicles - Trail Count', + 'Day Use - People And Vehicles - Vehicle Count', + 'Day Use - People And Vehicles - Bus Count', + 'Day Use - Picnic Shelters - Rentals', + 'Day Use - Picnic Shelters - People', + 'Day Use - Picnic Shelters - Gross Revenue', + 'Day Use - Hot Springs - People', + 'Day Use - Hot Springs - Gross Revenue', + 'Frontcountry Cabins - Total Attendance - Parties', + 'Frontcountry Cabins - Gross Revenue', + 'Frontcountry Camping - Camping Party Nights - Standard', + 'Frontcountry Camping - Camping Party Nights - Senior', + 'Frontcountry Camping - Camping Party Nights - Social Services Fee Exemption', + 'Frontcountry Camping - Camping Party Nights - Long Stay', + 'Frontcountry Camping - Camping Party Nights - Gross Revenue', + 'Frontcountry Camping - Second Cars - Standard', + 'Frontcountry Camping - Second Cars - Senior', + 'Frontcountry Camping - Second Cars - Social Services Fee Exemption', + 'Frontcountry Camping - Second Cars - Gross Revenue', + 'Frontcountry Camping - Other Frontcountry Camping - Gross Sani', + 'Frontcountry Camping - Other Frontcountry Camping - Electrical', + 'Frontcountry Camping - Other Frontcountry Camping - Shower' +]; + module.exports = { EXPORT_NOTE_KEYS, EXPORT_VARIANCE_CONFIG, @@ -754,5 +795,5 @@ module.exports = { CSV_SYSADMIN_SCHEMA, STATE_DICTIONARY, VARIANCE_CSV_SCHEMA, - VARIANCE_STATE_DICTIONARY + VARIANCE_STATE_DICTIONARY, }; diff --git a/arSam/template.yaml b/arSam/template.yaml index 25b6e97..dcaca7e 100644 --- a/arSam/template.yaml +++ b/arSam/template.yaml @@ -50,7 +50,7 @@ Parameters: Default: 'false' S3BucketData: Type: String - Default: 'parks-ar-assets-tools' + Default: 'parks-ar-assets-tools' TableNameAR: Type: String Default: 'ParksAr' @@ -60,16 +60,16 @@ Parameters: TableNameConfigAR: Type: String Default: "ConfigAr" - DataRegisterNameEndpoint: + DataRegisterNameEndpoint: Type: String Default: "defaultEndpoint" DataRegisterNameApiKey: Type: String Default: "defaultApiKey" - SSOIssuerUrl: + SSOIssuerUrl: Type: String Default: "https://dev.loginproxy.gov.bc.ca/auth/realms/bcparks-service-transformation" - SSOJWKSUri: + SSOJWKSUri: Type: String Default: "https://dev.loginproxy.gov.bc.ca/auth/realms/bcparks-service-transformation/protocol/openid-connect/certs" SSOOrigin: @@ -256,7 +256,7 @@ Resources: Path: /activity/lock Method: POST RestApiId: !Ref ApiDeployment - + ActivityPostUnlockFunction: Type: AWS::Serverless::Function Properties: @@ -388,7 +388,7 @@ Resources: ExportInvokableFunction: Type: AWS::Serverless::Function Properties: - Timeout: 300 + Timeout: 900 CodeUri: handlers/export/invokable/ Handler: index.handler Runtime: nodejs20.x @@ -455,7 +455,7 @@ Resources: VarianceExportInvokableFunction: Type: AWS::Serverless::Function Properties: - Timeout: 300 + Timeout: 900 CodeUri: handlers/export-variance/invokable/ Handler: index.handler Runtime: nodejs20.x @@ -557,7 +557,7 @@ Resources: CodeUri: handlers/nameUpdate/ Handler: index.handler Runtime: nodejs20.x - Timeout: 300 + Timeout: 900 Environment: Variables: TABLE_NAME: !Ref TableNameAR @@ -686,7 +686,7 @@ Resources: Auth: Authorizer: NONE OverrideApiAuth: true - + SubAreaGetFunction: Type: AWS::Serverless::Function Properties: @@ -785,7 +785,7 @@ Resources: Path: /subArea Method: PUT RestApiId: !Ref ApiDeployment - + VarianceGetFunction: Type: AWS::Serverless::Function Properties: @@ -815,7 +815,7 @@ Resources: Path: /variance Method: OPTIONS RestApiId: !Ref ApiDeployment - + VariancePostFunction: Type: AWS::Serverless::Function Properties: