Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e04d6e1
CCM-16444 Populate config table
nhsd-david-wass Apr 7, 2026
313d3bc
Fix existing database access
nhsd-david-wass Apr 9, 2026
0e6ee97
Initial config dev test data
nhsd-david-wass Apr 9, 2026
a3b5472
add force
nhsd-david-wass Apr 14, 2026
8b20fb8
remove PROD supplier config
nhsd-david-wass Apr 23, 2026
c3e6977
review changes
nhsd-david-wass Apr 23, 2026
a4579a3
point at internal main
nhsd-david-wass Apr 24, 2026
1fda0c9
minimal anaonymised data set
nhsd-david-wass Apr 27, 2026
9152a56
review changes
nhsd-david-wass Apr 27, 2026
798d67c
CCM-13372 - Select Preferred Pack
nhsd-david-wass Mar 19, 2026
23c8bf6
added more validity checks
nhsd-david-wass Mar 27, 2026
17aff61
CCM-13371 - Determine Eligible packs
nhsd-david-wass Apr 7, 2026
5160053
debug logging
nhsd-david-wass Apr 7, 2026
5c2ca03
CCM-13372 - Update pk and sk values
nhsd-david-wass Apr 14, 2026
b05bdc6
CCM-13882 - Calculate-Supplier-Weighting
nhsd-david-wass Apr 16, 2026
070dcab
calculate allocation factors
nhsd-david-wass Apr 16, 2026
0ab7471
test supplier config
nhsd-david-wass Apr 17, 2026
16eb186
handle non existent overall allocations
nhsd-david-wass Apr 17, 2026
a6618e3
store current allocations
nhsd-david-wass Apr 17, 2026
039ca0f
debug logging
nhsd-david-wass Apr 17, 2026
a585d13
error checking
nhsd-david-wass Apr 17, 2026
ee727c2
lambda permissions
nhsd-david-wass Apr 17, 2026
a47711a
fix date type
nhsd-david-wass Apr 20, 2026
9033943
more logging
nhsd-david-wass Apr 20, 2026
4e98bd0
increment correct supplier
nhsd-david-wass Apr 20, 2026
7ec6cbf
refactor for clarity
nhsd-david-wass Apr 21, 2026
4e5ef27
add priority
nhsd-david-wass Apr 21, 2026
94e035a
unit tests
nhsd-david-wass Apr 22, 2026
bc7cf0d
moved types to separate file
nhsd-david-wass Apr 22, 2026
33b92c9
rationalise logging
nhsd-david-wass Apr 22, 2026
8785f2f
updated to store total daily allocations per supplier
nhsd-david-wass Apr 23, 2026
c1bfe22
dev test data and ITs
nhsd-david-wass Apr 23, 2026
e426505
turn it on!
nhsd-david-wass Apr 23, 2026
180071e
Remove VARIANT_MAP
nhsd-david-wass Apr 24, 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
22 changes: 22 additions & 0 deletions .github/scripts/dispatch_internal_repo_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ while [[ $# -gt 0 ]]; do
version="$2"
shift 2
;;
--tableName) # Table name (optional)
tableName="$2"
shift 2
;;
--force) # Force apply flag (optional)
force="$2"
shift 2
;;
*)
echo "[ERROR] Unknown argument: $1"
exit 1
Expand Down Expand Up @@ -202,6 +210,14 @@ if [[ -z "$version" ]]; then
version=""
fi

if [{ -z "$tableName" }]; then
tableName=""
fi

if [[ -z "$force" ]]; then
force=""
fi

echo "==================== Workflow Dispatch Parameters ===================="
echo " infraRepoName: $infraRepoName"
echo " releaseVersion: $releaseVersion"
Expand All @@ -221,6 +237,8 @@ echo " apimEnvironment: $apimEnvironment"
echo " boundedContext: $boundedContext"
echo " targetDomain: $targetDomain"
echo " version: $version"
echo " tableName: $tableName"
echo " force: $force"

DISPATCH_EVENT=$(jq -ncM \
--arg infraRepoName "$infraRepoName" \
Expand All @@ -240,6 +258,8 @@ DISPATCH_EVENT=$(jq -ncM \
--arg boundedContext "$boundedContext" \
--arg targetDomain "$targetDomain" \
--arg version "$version" \
--arg tableName "$tableName" \
--arg force "$force" \
'{
"ref": "'"$internalRef"'",
"inputs": (
Expand All @@ -255,6 +275,8 @@ DISPATCH_EVENT=$(jq -ncM \
(if $boundedContext != "" then { "boundedContext": $boundedContext } else {} end) +
(if $targetDomain != "" then { "targetDomain": $targetDomain } else {} end) +
(if $version != "" then { "version": $version } else {} end) +
(if $tableName != "" then { "tableName": $tableName } else {} end) +
(if $force != "" then { "force": $force } else {} end) +
(if $targetAccountGroup != "" then { "targetAccountGroup": $targetAccountGroup } else {} end) +
{
"releaseVersion": $releaseVersion,
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,34 @@ jobs:
--terraformAction "apply" \
--overrideProjectName "nhs" \
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
populate-config:
name: "Populate Supplier Config"
runs-on: ubuntu-latest
needs: [pr-create-dynamic-environment]
timeout-minutes: 10

steps:
- name: "Checkout code"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Set Environment Name
id: set-environment
run: echo "environment_name=${{ inputs.pr_number != '' && format('pr{0}', inputs.pr_number) || 'main' }}" >> $GITHUB_OUTPUT
- name: "Trigger populate config workflow in internal repo"
env:
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
PR_NUMBER: ${{ inputs.pr_number }}
shell: bash
run: |
.github/scripts/dispatch_internal_repo_workflow.sh \
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
--releaseVersion ${{ github.head_ref || github.ref_name }} \
--targetWorkflow "publish-supplier-config.yaml" \
--targetEnvironment "${{ steps.set-environment.outputs.environment_name }}" \
--targetComponent "config" \
--targetAccountGroup "nhs-notify-suppliers-dev" \
--tableName "supplier-config" \
--force "true"
artefact-proxies:
name: "Build proxies"
runs-on: ubuntu-latest
Expand Down
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-aspiring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-aspiring"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 3
},
"sides": {
"operator": "LESS_THAN",
"value": 6
}
},
"description": "Colour printing, ASPIRING envelope, Attachment",
"id": "client1-aspiring",
"name": "Client1 - ASPIRING",
"packSpecificationIds": [
"client1-aspiring"
],
"priority": 1,
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-dmapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-dmapp"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail, colour printing",
"id": "client1-dmapp",
"name": "Client1 - DMAPP",
"packSpecificationIds": [
"client1-dmapp"
],
"priority": 1,
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-globalminds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-globalminds"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail?, colour printing, booklet",
"id": "client1-globalminds",
"name": "Client1 - Global Minds",
"packSpecificationIds": [
"client1-globalminds"
],
"priority": 2,
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-mymelanoma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-mymelanoma"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail, colour printing, MyMelanoma envelope",
"id": "client1-mymelanoma",
"name": "Client1 - MyMelanoma",
"packSpecificationIds": [
"client1-mymelanoma"
],
"priority": 3,
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-ofh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-ofh"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail, colour printing, OFH envelope",
"id": "client1-ofh",
"name": "Client1 - Our Future Health",
"packSpecificationIds": [
"client1-ofh"
],
"priority": 4,
"status": "PROD",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-prostateprogress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-prostateprogress"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 4
},
"sides": {
"operator": "LESS_THAN",
"value": 8
}
},
"description": "Colour printing, PP envelope, Attachment",
"id": "client1-prostateprogress",
"name": "Client1 - Prostate Progress",
"packSpecificationIds": [
"client1-prostateprogress"
],
"priority": 5,
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/client1-protectc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"client1-protectc"
],
"clientId": "client1",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Economy, colour printing",
"id": "client1-protectc",
"name": "Client1 - PROTECT-C",
"packSpecificationIds": [
"notify-c5-colour"
],
"priority": 50,
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
Loading
Loading