Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
e5cfae1
script
Namitha-Prabhu Nov 3, 2025
0d7458d
CCM-12180: acceptance stage internal invoke
masl2 Nov 3, 2025
4999505
CCM-12180: correct infraRepo name param
masl2 Nov 7, 2025
c021822
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
masl2 Nov 7, 2025
104851e
CCM-12180: add override project and role
masl2 Nov 7, 2025
d6c1239
CCM-12180: override project
masl2 Nov 10, 2025
a424ceb
CCM-12180: remove callerId param
masl2 Nov 10, 2025
29fdc70
fix tests
Namitha-Prabhu Nov 12, 2025
038076e
remove generate-output
Namitha-Prabhu Nov 12, 2025
223d427
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
Namitha-Prabhu Nov 12, 2025
d18d495
tests
Namitha-Prabhu Nov 19, 2025
d161b85
merge
Namitha-Prabhu Nov 19, 2025
787face
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
Namitha-Prabhu Nov 22, 2025
b154794
merge
Namitha-Prabhu Nov 22, 2025
1d53900
Add upsert lambda
francisco-videira-nhs Dec 1, 2025
4334697
Fix names
francisco-videira-nhs Dec 2, 2025
132326d
Fix unit test
francisco-videira-nhs Dec 2, 2025
036c319
Fix unit test dates
francisco-videira-nhs Dec 2, 2025
d6602c3
Fix lambda handler name export
francisco-videira-nhs Dec 2, 2025
10326e9
merge
Namitha-Prabhu Dec 3, 2025
d78a8c7
merge
Namitha-Prabhu Dec 3, 2025
92d4d26
Add event-schemas-letter-rendering
francisco-videira-nhs Dec 4, 2025
b040535
Add GitHub NPM registry configuration to .npmrc
m-houston Dec 5, 2025
ffb8d5c
Add version check and Node.js setup to CI workflow
m-houston Dec 5, 2025
c307fc9
TO REVERT AFTER TEST: conditional check for event schema version update
m-houston Dec 5, 2025
46c8402
Refactor event schema version checks in CI workflow
m-houston Dec 5, 2025
f1444fd
Add GitHub NPM registry URL to Node.js setup in workflows
m-houston Dec 5, 2025
59d8846
Log npm response
m-houston Dec 5, 2025
d7a665c
Add NODE_AUTH_TOKEN to GitHub Actions environment for NPM access
m-houston Dec 5, 2025
5741a86
Revert "Add GitHub NPM registry URL to Node.js setup in workflows"
m-houston Dec 5, 2025
c427d03
Move NODE_AUTH_TOKEN to npm view step in CI workflow
m-houston Dec 5, 2025
8981a44
Reapply "Add GitHub NPM registry URL to Node.js setup in workflows"
m-houston Dec 5, 2025
fbf2e9d
Add NODE_AUTH_TOKEN to NPM install steps in workflows
m-houston Dec 5, 2025
113bbe5
Re-enable conditional check on published package check
m-houston Dec 5, 2025
032e48f
Add NODE_AUTH_TOKEN input for GitHub package registry access in workf…
m-houston Dec 5, 2025
f24f37a
Add packages:read to permissions
m-houston Dec 5, 2025
333f352
Merge branch 'main' into feature/fix-github-npm-registry-access
m-houston Dec 5, 2025
0d41d64
Merge remote-tracking branch 'origin/main' into feature/CCM-12997
francisco-videira-nhs Dec 5, 2025
6400400
delete old test
francisco-videira-nhs Dec 5, 2025
dcead20
tests
Namitha-Prabhu Dec 5, 2025
6a7efa3
Merge remote-tracking branch 'origin/feature/fix-github-npm-registry-…
francisco-videira-nhs Dec 5, 2025
116c323
fix unit tests
Namitha-Prabhu Dec 5, 2025
1d35f02
fix unit tests
Namitha-Prabhu Dec 5, 2025
4001e32
fix trivy scan step
francisco-videira-nhs Dec 5, 2025
ffdf716
fix unit tests
Namitha-Prabhu Dec 5, 2025
7e8533f
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
masl2 Dec 8, 2025
c5d9b9e
dependencies
masl2 Dec 8, 2025
20c5fd0
fix jest configurations
masl2 Dec 8, 2025
66eb971
Fix gh pkg registry test stage
francisco-videira-nhs Dec 8, 2025
b8b45ac
Merge remote-tracking branch 'origin/main' into feature/CCM-12997
francisco-videira-nhs Dec 8, 2025
1fbbb52
event package version
masl2 Dec 8, 2025
64d0fe2
fix local npmrc
francisco-videira-nhs Dec 8, 2025
7c57d35
lint fixes
Namitha-Prabhu Dec 8, 2025
fb0ebd9
lint fixes
Namitha-Prabhu Dec 8, 2025
9aaab4c
Merge branch 'feature/CCM-12180-TestsOnPipeline' of https://github.co…
Namitha-Prabhu Dec 8, 2025
52bf92b
remove duplicate variable defs
masl2 Dec 8, 2025
c8c3fd8
Merge branch 'feature/CCM-12180-TestsOnPipeline' of https://github.co…
Namitha-Prabhu Dec 8, 2025
4750470
remove test archive
Namitha-Prabhu Dec 9, 2025
d3aba34
suppress test data false positive
masl2 Dec 9, 2025
1adba99
imports
Namitha-Prabhu Dec 10, 2025
df1261c
checks for supplier data
Namitha-Prabhu Dec 10, 2025
7f06b68
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
Namitha-Prabhu Dec 10, 2025
49fd69b
tests
Namitha-Prabhu Dec 10, 2025
d0c63e1
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
masl2 Dec 11, 2025
5685221
merge
Namitha-Prabhu Dec 11, 2025
7f920cc
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
Namitha-Prabhu Dec 11, 2025
7636dda
Merge branch 'feature/CCM-12180-TestsOnPipeline' of https://github.co…
Namitha-Prabhu Dec 11, 2025
3e38147
version
Namitha-Prabhu Dec 11, 2025
0843041
lock file
Namitha-Prabhu Dec 11, 2025
93f72a7
lock file
Namitha-Prabhu Dec 11, 2025
f531aaf
fix
Namitha-Prabhu Dec 11, 2025
ecb88e8
fix
Namitha-Prabhu Dec 11, 2025
6bed21e
fix
Namitha-Prabhu Dec 11, 2025
5f30fa4
update test to reflect version
masl2 Dec 12, 2025
85233bf
package lock
masl2 Dec 12, 2025
ca58f3b
Fix unit test timestamps, add source
francisco-videira-nhs Dec 12, 2025
7b36de2
replace js-yaml with yaml
masl2 Dec 12, 2025
48b242b
downgrade yargs due to y18n dep
masl2 Dec 12, 2025
4513c92
missing deps
masl2 Dec 12, 2025
65481fd
Merge remote-tracking branch 'origin/main' into feature/CCM-12997
francisco-videira-nhs Dec 12, 2025
8a74c03
Add notification parsing logic
francisco-videira-nhs Dec 12, 2025
cb29729
fix tf var
francisco-videira-nhs Dec 12, 2025
2715285
Fix ddb permissions
francisco-videira-nhs Dec 12, 2025
5e1c732
update versions
Namitha-Prabhu Dec 15, 2025
3b5a35b
update versions
Namitha-Prabhu Dec 15, 2025
b1a5d66
fetch env variable
Namitha-Prabhu Dec 15, 2025
415d07a
fetch env variable
Namitha-Prabhu Dec 15, 2025
d9a5a14
PR number
Namitha-Prabhu Dec 15, 2025
a5ef09e
PR number
Namitha-Prabhu Dec 15, 2025
d6e80aa
Add latest version event schema letter rendering
francisco-videira-nhs Dec 15, 2025
595d4b6
Add trying v1 parse if v2 fails
francisco-videira-nhs Dec 15, 2025
d470154
add flag for execute endpoint
masl2 Dec 15, 2025
78ece30
Add subject
francisco-videira-nhs Dec 16, 2025
52513c2
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
Namitha-Prabhu Dec 18, 2025
a8fa07e
Split upsert operations
francisco-videira-nhs Dec 18, 2025
6040c12
Merge remote-tracking branch 'origin/main' into feature/CCM-12997
francisco-videira-nhs Dec 18, 2025
b1e1195
Letter variant map to vars
francisco-videira-nhs Dec 18, 2025
fdd73fc
Revert supplierStatusSk
francisco-videira-nhs Dec 18, 2025
05a6b2b
Merge remote-tracking branch 'origin/main' into feature/CCM-12997
francisco-videira-nhs Dec 18, 2025
10ec08f
Fix dependencies
francisco-videira-nhs Dec 18, 2025
9158018
merge
Namitha-Prabhu Dec 19, 2025
b7b91d2
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
Namitha-Prabhu Dec 19, 2025
b9d364e
trivy job setup of node for nhs packages
masl2 Dec 19, 2025
52b3af0
lock
masl2 Dec 19, 2025
f62a004
lock
masl2 Dec 19, 2025
7196cba
verbose log level
masl2 Dec 19, 2025
832f20e
try node setup and token env
masl2 Dec 19, 2025
1947273
node setup
masl2 Dec 22, 2025
6f6cd33
acceptance deps
masl2 Dec 22, 2025
4e060b6
acceptance deps
masl2 Dec 22, 2025
7efebb6
another go
masl2 Dec 22, 2025
c232df7
another go
masl2 Dec 22, 2025
547f6b1
Merge branch 'main' into feature/CCM-12997
masl2 Dec 24, 2025
e42d26c
CCM-13697: Letters Key and Source Data Item (#323)
masl2 Dec 24, 2025
448702b
missing close brace
masl2 Dec 24, 2025
c68acc2
merge feature/CCM-12997 into my branch
Vlasis-Perdikidis Dec 24, 2025
6e13097
minor refactor upsert unit tests
francisco-videira-nhs Dec 30, 2025
1eecf9b
remove dup line
francisco-videira-nhs Dec 30, 2025
6e86b9d
Merge remote-tracking branch 'origin/main' into feature/CCM-12180-Tes…
francisco-videira-nhs Dec 30, 2025
4693211
fix workspace for supplier test data
francisco-videira-nhs Dec 31, 2025
25d2d8f
merge latest from feature/CCM-12180-TestsOnPipeline into my branch
Vlasis-Perdikidis Jan 2, 2026
018febb
merge latest from feature/CCM-12997
Vlasis-Perdikidis Jan 2, 2026
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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
},
"mounts": [
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
"source=${localEnv:HOME}/.npmrc,target=/home/vscode/.npmrc,type=bind,consistency=cached"
],
"name": "Devcontainer",
"postCreateCommand": "scripts/devcontainer/postcreatecommand.sh"
Expand Down
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ENVIRONMENT=$ENV_NAME
API_KEY=
HEADERAUTH=
PR_NUMBER=prxx # remove if needs to run against main
NHSD_APIM_TOKEN=
51 changes: 51 additions & 0 deletions .github/actions/acceptance-tests/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Acceptance tests
description: "Run acceptance tests for this repo"

inputs:
testType:
description: Type of test to run
required: true

targetEnvironment:
description: Name of the environment under test
required: true

targetAccountGroup:
description: Name of the account group under test
default: nhs-notify-template-management-dev
required: true

targetComponent:
description: Name of the component under test
required: true

runs:
using: "composite"

steps:
- name: Fetch terraform output
uses: actions/download-artifact@v5
with:
name: terraform-output-${{ inputs.targetComponent }}

- name: Get Node version
id: nodejs_version
shell: bash
run: |
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT

- name: "Repo setup"
uses: ./.github/actions/node-install
with:
node-version: ${{ steps.nodejs_version.outputs.nodejs_version }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

- name: "Set PR NUMBER"
shell: bash
run: |
echo "PR_NUMBER=${{ inputs.targetEnvironment }}" >> $GITHUB_ENV

- name: Run test - ${{ inputs.testType }}
shell: bash
run: |
make test-${{ inputs.testType }}
3 changes: 3 additions & 0 deletions .github/actions/test-types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"component"
]
6 changes: 2 additions & 4 deletions .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
needs: detect-terraform-changes
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
permissions:
contents: write
contents: write
steps:
- name: "Checkout code"
uses: actions/checkout@v5
Expand Down Expand Up @@ -164,8 +164,6 @@ jobs:
registry-url: 'https://npm.pkg.github.com'
- name: "Setup ASDF"
uses: asdf-vm/actions/setup@v4
- name: "Perform Setup"
uses: ./.github/actions/setup
- name: "Trivy Scan"
uses: ./.github/actions/trivy
count-lines-of-code:
Expand Down Expand Up @@ -288,7 +286,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs_version }}
registry-url: 'https://npm.pkg.github.com'
registry-url: "https://npm.pkg.github.com"

- name: check if local version differs from latest published version
id: check-version
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ env:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
contents: read # This is required for actions/checkout
packages: read # This is required for downloading from GitHub Package Registry

jobs:
Expand All @@ -49,6 +49,11 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs_version }}
registry-url: "https://npm.pkg.github.com"
- name: "Cache node_modules"
uses: actions/cache@v4
with:
Expand All @@ -73,6 +78,11 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs_version }}
registry-url: "https://npm.pkg.github.com"
- name: "Cache node_modules"
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -142,6 +152,11 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs_version }}
registry-url: "https://npm.pkg.github.com"
- name: "Cache node_modules"
uses: actions/cache@v4
with:
Expand All @@ -168,6 +183,11 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs_version }}
registry-url: "https://npm.pkg.github.com"
- name: "Cache node_modules"
uses: actions/cache@v4
with:
Expand Down
170 changes: 27 additions & 143 deletions .github/workflows/stage-4-acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,152 +35,36 @@ on:
required: true
type: string

jobs:
# environment-set-up:
# name: "Environment set up"
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Create infractructure"
# run: |
# echo "Creating infractructure..."
# - name: "Update database"
# run: |
# echo "Updating database..."
# - name: "Deploy application"
# run: |
# echo "Deploying application..."
permissions:
id-token: write
contents: read

test-contract:
name: "Contract test"
jobs:
run-acceptance-tests:
name: Run Acceptance Tests
runs-on: ubuntu-latest
# needs: environment-set-up
timeout-minutes: 10
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Cache node_modules"
uses: actions/cache@v4
- uses: actions/checkout@v5.0.0

- name: 'Use Node.js'
uses: actions/setup-node@v6
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
- name: "Run contract test"
run: |
make test-contract
node-version: '${{ inputs.nodejs_version }}'
registry-url: 'https://npm.pkg.github.com'
scope: '@nhsdigital'

- name: Trigger Acceptance Tests
shell: bash
env:
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Save result"
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Nothing to save"

# Environment-based tests should run from notify-internal repo, not in public repo
# test-security:
# name: "Security test"
# runs-on: ubuntu-latest
# needs: environment-set-up
# timeout-minutes: 10
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Run security test"
# run: |
# make test-security
# - name: "Save result"
# run: |
# echo "Nothing to save"
# test-ui:
# name: "UI test"
# runs-on: ubuntu-latest
# needs: environment-set-up
# timeout-minutes: 10
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Run UI test"
# run: |
# make test-ui
# - name: "Save result"
# run: |
# echo "Nothing to save"
# test-ui-performance:
# name: "UI performance test"
# runs-on: ubuntu-latest
# needs: environment-set-up
# timeout-minutes: 10
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Run UI performance test"
# run: |
# make test-ui-performance
# - name: "Save result"
# run: |
# echo "Nothing to save"
# test-integration:
# name: "Integration test"
# runs-on: ubuntu-latest
# needs: environment-set-up
# timeout-minutes: 10
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Run integration test"
# run: |
# make test-integration
# - name: "Save result"
# run: |
# echo "Nothing to save"
# test-accessibility:
# name: "Accessibility test"
# runs-on: ubuntu-latest
# needs: environment-set-up
# timeout-minutes: 10
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Run accessibility test"
# run: |
# make test-accessibility
# - name: "Save result"
# run: |
# echo "Nothing to save"
# test-load:
# name: "Load test"
# runs-on: ubuntu-latest
# needs: environment-set-up
# timeout-minutes: 10
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Run load tests"
# run: |
# make test-load
# - name: "Save result"
# run: |
# echo "Nothing to save"
# environment-tear-down:
# name: "Environment tear down"
# runs-on: ubuntu-latest
# needs:
# [
# test-accessibility,
# test-contract,
# test-integration,
# test-load,
# test-security,
# test-ui-performance,
# test-ui,
# ]
# if: always()
# timeout-minutes: 5
# steps:
# - name: "Checkout code"
# uses: actions/checkout@v5
# - name: "Tear down environment"
# run: |
# echo "Tearing down environment..."
.github/scripts/dispatch_internal_repo_workflow.sh \
--targetWorkflow "dispatch-contextual-tests-dynamic-env.yaml" \
--infraRepoName "nhs-notify-supplier-api" \
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
--overrideProjectName "nhs" \
--targetEnvironment "pr${{ inputs.pr_number }}" \
--targetAccountGroup "nhs-notify-supplier-api-dev" \
--targetComponent "api"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ version.json
# Please, add your custom content below!
.idea
.env
.envrc

# dependencies
node_modules
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"autoOpenWorkspace.enableAutoOpenIfSingleWorkspace": true,
"cSpell.words": [
"envrc"
],
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
Expand Down
19 changes: 15 additions & 4 deletions docs/assets/diagrams/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,27 @@ erDiagram
erDiagram
MI {
string id
string supplierId "ref: Supplier"
string specificationId
string groupId
string lineItem
string timestamp
number quantity
string specificationId
string groupId
number stockRemaining
string supplierId
string createdAt
string updatedAt
number ttl "min: -9007199254740991, max: 9007199254740991"
}
```

## Supplier schema

```mermaid
erDiagram
Supplier {
string id
string name
string apimId
string status "enum: ENABLED, DISABLED"
}
MI }o--|| Supplier : "supplierId"
```
Loading
Loading