Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
73a24cc
CCM-11228: Implement basic schema and datastore package
m-houston Jul 31, 2025
04bbd4c
CCM-11228: Add logging functionality and update letter repository met…
m-houston Aug 1, 2025
059000a
CCM-11228: Add test for letter list warning on invalid data
m-houston Aug 1, 2025
5d13c2c
CCM-11228: Update letter schema to include specificationId and groupId
m-houston Aug 1, 2025
928981a
CCM-11228: Enhance letter repository tests and error handling
m-houston Aug 1, 2025
1ed39b9
CCM-11228: Resolve merge
m-houston Aug 1, 2025
0576b60
Merge branch 'main' into feature/CCM-11228-db-schema
m-houston Aug 1, 2025
6ef3150
CCM-11228: Resolve merge
m-houston Aug 1, 2025
bf50012
CCM-11228: Add TTL fields to ddb repository
m-houston Aug 4, 2025
1fe5ffc
Update internal/datastore/src/__test__/letter-repository.test.ts
m-houston Aug 5, 2025
8545825
Update internal/datastore/src/letter-repository.ts
m-houston Aug 5, 2025
a5c5cea
CCM-11228: Update letter repository tests and add MI schema and diagr…
m-houston Aug 5, 2025
49473c6
Merge branch 'main' into feature/CCM-11228-db-schema
m-houston Aug 5, 2025
3864536
Merge remote-tracking branch 'origin/main' into feature/CCM-11228-db-…
francisco-videira-nhs Aug 6, 2025
839ee42
Wire getLetters and ddb
francisco-videira-nhs Aug 7, 2025
4e356a4
Wire patch letter and ddb
francisco-videira-nhs Aug 13, 2025
0588986
Merge remote-tracking branch 'origin/main' into feature/CCM-11228-db-…
francisco-videira-nhs Aug 13, 2025
34bddd7
Resolve merge conflicts
francisco-videira-nhs Aug 14, 2025
26489d3
Add delivered status
francisco-videira-nhs Aug 14, 2025
e6c67d4
Fix patch lambda permissions
francisco-videira-nhs Aug 14, 2025
f35aeac
Merge remote-tracking branch 'origin/main' into feature/CCM-11228-db-…
francisco-videira-nhs Aug 14, 2025
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
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import unicorn from 'eslint-plugin-unicorn';
import { defineConfig, globalIgnores } from 'eslint/config';
import js from '@eslint/js';
import html from 'eslint-plugin-html';
import tseslint from 'typescript-eslint';
import tseslint from '@typescript-eslint/parser';
import sortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
import {
configs as airbnbConfigs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ module "get_letters" {
log_subscription_role_arn = local.acct.log_subscription_role_arn

lambda_env_vars = {
LETTERS_TABLE_NAME = aws_dynamodb_table.letters.name
LETTERS_TABLE_NAME = aws_dynamodb_table.letters.name,
LETTER_TTL_HOURS = 24
}
}

Expand All @@ -61,13 +62,9 @@ data "aws_iam_policy_document" "get_letters_lambda" {

actions = [
"dynamodb:BatchGetItem",
"dynamodb:BatchWriteItem",
"dynamodb:DeleteItem",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:Query",
"dynamodb:Scan",
"dynamodb:UpdateItem",
]

resources = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module "patch_letters" {
environment = var.environment
project = var.project
region = var.region

group = var.group

log_retention_in_days = var.log_retention_in_days
Expand Down Expand Up @@ -37,6 +36,8 @@ module "patch_letters" {
log_subscription_role_arn = local.acct.log_subscription_role_arn

lambda_env_vars = {
LETTERS_TABLE_NAME = aws_dynamodb_table.letters.name,
LETTER_TTL_HOURS = 24
}
}

Expand All @@ -54,4 +55,23 @@ data "aws_iam_policy_document" "patch_letters_lambda" {
module.kms.key_arn, ## Requires shared kms module
]
}

statement {
sid = "AllowDynamoDBAccess"
effect = "Allow"

actions = [
"dynamodb:BatchGetItem",
"dynamodb:BatchWriteItem",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:Query",
"dynamodb:Scan",
"dynamodb:UpdateItem",
]

resources = [
aws_dynamodb_table.letters.arn,
]
}
}
1 change: 1 addition & 0 deletions internal/datastore/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
4 changes: 4 additions & 0 deletions internal/datastore/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage
node_modules
dist
.reports
60 changes: 60 additions & 0 deletions internal/datastore/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import type { Config } from 'jest';

export const baseJestConfig: Config = {
preset: 'ts-jest',

// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,

// The directory where Jest should output its coverage files
coverageDirectory: './.reports/unit/coverage',

// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'babel',

coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: -10,
},
},

coveragePathIgnorePatterns: ['/__tests__/'],
transform: { '^.+\\.ts$': 'ts-jest' },
testPathIgnorePatterns: ['.build'],
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],

// Use this configuration option to add custom reporters to Jest
reporters: [
'default',
[
'jest-html-reporter',
{
pageTitle: 'Test Report',
outputPath: './.reports/unit/test-report.html',
includeFailureMsg: true,
},
],
],

// The test environment that will be used for testing
testEnvironment: 'jsdom',
};

const utilsJestConfig = {
...baseJestConfig,

testEnvironment: 'node',

coveragePathIgnorePatterns: [
...(baseJestConfig.coveragePathIgnorePatterns ?? []),
'zod-validators.ts',
],
};

export default utilsJestConfig;
Loading
Loading