Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions backend/compact-connect/lambdas/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "commonjs",
"description": "NodeJS lambdas for CompactConnect",
"resolutions": {
"fast-xml-parser": "5.7.0",
"fast-xml-parser": "5.7.3",
"postcss": "8.5.10"
},
"scripts": {
Expand Down Expand Up @@ -45,9 +45,9 @@
},
"dependencies": {
"@aws-lambda-powertools/logger": "^2.32.0",
"@aws-sdk/client-dynamodb": "^3.1029.0",
"@aws-sdk/client-s3": "^3.1029.0",
"@aws-sdk/client-sesv2": "^3.1029.0",
"@aws-sdk/client-dynamodb": "^3.1045.0",
"@aws-sdk/client-s3": "^3.1045.0",
"@aws-sdk/client-sesv2": "^3.1045.0",
"@aws-sdk/util-dynamodb": "^3.996.2",
"@csg-org/email-builder": "^0.0.13",
"nodemailer": "^8.0.5",
Expand Down
782 changes: 393 additions & 389 deletions backend/compact-connect/lambdas/nodejs/yarn.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ six==1.17.0
# via python-dateutil
typing-extensions==4.15.0
# via aws-lambda-powertools
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ typing-inspection==0.4.2
# via
# pydantic
# pydantic-settings
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ six==1.17.0
# via python-dateutil
typing-extensions==4.15.0
# via aws-lambda-powertools
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# requests
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ statsig-python-core==0.19.1
# via -r requirements.in
typing-extensions==4.15.0
# via statsig-python-core
urllib3==2.6.3
urllib3==2.7.0
# via requests
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ boto3>=1.34.33, <2
cryptography>=46, <47
marshmallow>=4.3.0, <5.0.0
requests>=2.31.0, <3.0.0
urllib3>=2.6.3, <3
urllib3>=2.7.0, <3
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ tomli-w==1.2.0
# via pip-audit
typing-extensions==4.15.0
# via aws-lambda-powertools
urllib3==2.6.3
urllib3==2.7.0
# via
# -r purchases/requirements-dev.in
# botocore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# common requirements are managed in the common-python requirements.in file
authorizenet>=1.1.6, <2
# explicitly setting this transitive dependency to pick vulnerability patch
urllib3>=2.6.3, <3
urllib3>=2.7.0, <3
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pyxb-x==1.2.6.3
# via authorizenet
requests==2.33.1
# via authorizenet
urllib3==2.6.3
urllib3==2.7.0
# via
# -r requirements.in
# requests
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ six==1.17.0
# via python-dateutil
typing-extensions==4.15.0
# via grpcio
urllib3==2.6.3
urllib3==2.7.0
# via
# opensearch-py
# requests
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ s3transfer==0.16.0
# via boto3
six==1.17.0
# via python-dateutil
urllib3==2.6.3
urllib3==2.7.0
# via
# botocore
# docker
Expand Down
2 changes: 1 addition & 1 deletion backend/compact-connect/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ tomli==2.4.1
# via pip-audit
tomli-w==1.2.0
# via pip-audit
urllib3==2.6.3
urllib3==2.7.0
# via requests
wheel==0.46.3
# via pip-tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Context } from 'aws-lambda';
import { EnvironmentVariablesService } from '../lib/environment-variables-service';
import { CompactConfigurationClient } from '../lib/compact-configuration-client';
import { JurisdictionClient } from '../lib/jurisdiction-client';
import { EncumbranceNotificationService, InvestigationNotificationService } from '../lib/email';
import { EmailNotificationService, EncumbranceNotificationService, InvestigationNotificationService } from '../lib/email';
import { EmailNotificationEvent, EmailNotificationResponse } from '../lib/models/email-notification-service-event';

const environmentVariables = new EnvironmentVariablesService();
Expand All @@ -19,6 +19,7 @@ interface LambdaProperties {
}

export class Lambda implements LambdaInterface {
private readonly emailService: EmailNotificationService;
private readonly encumbranceService: EncumbranceNotificationService;
private readonly investigationService: InvestigationNotificationService;

Expand All @@ -40,6 +41,13 @@ export class Lambda implements LambdaInterface {
jurisdictionClient: jurisdictionClient
});

this.emailService = new EmailNotificationService({
logger: logger,
sesClient: props.sesClient,
compactConfigurationClient: compactConfigurationClient,
jurisdictionClient: jurisdictionClient
});

this.investigationService = new InvestigationNotificationService({
logger: logger,
sesClient: props.sesClient,
Expand Down Expand Up @@ -319,6 +327,27 @@ export class Lambda implements LambdaInterface {
event.templateVariables.licenseType
);
break;
case 'homeJurisdictionChangeNotification':
if (!event.jurisdiction) {
throw new Error('Missing required jurisdiction field for home jurisdiction change notification template.');
}
if (!event.templateVariables?.providerFirstName
|| !event.templateVariables?.providerLastName
|| !event.templateVariables?.providerId
|| !event.templateVariables?.previousJurisdiction
|| !event.templateVariables?.newJurisdiction) {
throw new Error('Missing required template variables for home jurisdiction change notification template.');
}
await this.emailService.sendHomeJurisdictionChangeStateNotificationEmail(
event.compact,
event.jurisdiction,
event.templateVariables.providerFirstName,
event.templateVariables.providerLastName,
event.templateVariables.providerId,
event.templateVariables.previousJurisdiction,
event.templateVariables.newJurisdiction
);
break;
default:
logger.info('Unsupported email template provided', { template: event.template });
throw new Error(`Unsupported email template: ${event.template}`);
Expand Down
Loading
Loading