Skip to content
Open
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
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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but populate-config could go before artefact-proxies, so we have the backend stuff done first?

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
37 changes: 37 additions & 0 deletions config/suppliers/letter-variant/client1-campaign.json
Comment thread
m-houston marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"campaignIds": [
"client1-campaign"
],
"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, campaign envelope, Attachment",
"id": "client1-campaign",
"name": "Client1 - campaign",
"packSpecificationIds": [
"client1-campaign"
],
"status": "INT",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test3"
}
30 changes: 30 additions & 0 deletions config/suppliers/letter-variant/notify-standard-test1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Dev test variant for happy path testing",
"id": "notify-standard-test1",
"name": "Dev Happy Path",
"packSpecificationIds": [
"notify-c5",
"notify-c4"
],
"status": "PROD",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test1"
}
29 changes: 29 additions & 0 deletions config/suppliers/letter-variant/notify-standard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Black printing, economy postage tariff",
"id": "notify-standard",
"name": "Standard Letter",
"packSpecificationIds": [
"notify-c5"
],
"status": "PROD",
"type": "STANDARD",
"volumeGroupId": "volumeGroup-test2"
}
58 changes: 58 additions & 0 deletions config/suppliers/pack-specification/client1-campaign.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"assembly": {
"duplex": true,
"envelopeId": "client1-campaign",
"features": [
"ADMAIL"
],
"insertIds": [
"client1-campaign-fast-facts-attachment"
],
"paper": {
"colour": "WHITE",
"id": "paper-std-white-100",
"name": "Standard White 80gsm",
"recycled": true,
"size": "A4",
"weightGSM": 80
},
"printColour": "COLOUR"
},
"billingId": "client1-campaign-billing",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 4
},
"sides": {
"operator": "LESS_THAN",
"value": 8
}
},
"createdAt": "2026-01-12T00:00:00.000Z",
"description": "Envelope and attachment for campaign",
"id": "client1-campaign",
"name": "Client1 - campaign",
"postage": {
"deliveryDays": 3,
"id": "economy",
"maxThicknessMm": 5,
"maxWeightGrams": 100,
"size": "STANDARD"
},
"status": "PROD",
"updatedAt": "2026-02-16T17:00:00.000Z",
"version": 2
}
48 changes: 48 additions & 0 deletions config/suppliers/pack-specification/notify-c4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"assembly": {
"duplex": true,
"envelopeId": "economy-c5",
"paper": {
"colour": "WHITE",
"id": "paper-std-white-80",
"name": "Standard White 80gsm",
"recycled": true,
"size": "A4",
"weightGSM": 80
},
"printColour": "BLACK"
},
"billingId": "notify-c4",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 20
},
"sides": {
"operator": "LESS_THAN",
"value": 40
}
},
"createdAt": "2026-01-12T00:00:00.000Z",
"description": "C4 pack (large letter)",
"id": "notify-c4",
"name": "Notify standard (C4)",
"postage": {
"deliveryDays": 3,
"id": "economy",
"maxThicknessMm": 25,
"maxWeightGrams": 500,
"size": "LARGE"
},
"status": "DRAFT",
"updatedAt": "2026-01-12T00:00:00.000Z",
"version": 1
}
48 changes: 48 additions & 0 deletions config/suppliers/pack-specification/notify-c5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"assembly": {
"duplex": true,
"envelopeId": "economy-c4",
"paper": {
"colour": "WHITE",
"id": "paper-std-white-80",
"name": "Standard White 80gsm",
"recycled": true,
"size": "A4",
"weightGSM": 80
},
"printColour": "BLACK"
},
"billingId": "notify-c5-billing",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"createdAt": "2026-01-12T00:00:00.000Z",
"description": "C5 pack",
"id": "notify-c5",
"name": "Notify standard",
"postage": {
"deliveryDays": 3,
"id": "economy",
"maxThicknessMm": 5,
"maxWeightGrams": 100,
"size": "STANDARD"
},
"status": "PROD",
"updatedAt": "2026-01-12T00:00:00.000Z",
"version": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"allocationPercentage": 30,
"id": "supplier1-volumeGroup-test1",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"allocationPercentage": 100,
"id": "supplier1-volumeGroup-test2",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"allocationPercentage": 100,
"id": "supplier1-volumeGroup-test3",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"allocationPercentage": 70,
"id": "supplier2-volumeGroup-test1",
"status": "PROD",
"supplier": "supplier2",
"volumeGroup": "volumeGroup-test1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"approval": "APPROVED",
"id": "supplier1-client1-campaign",
"packSpecificationId": "client1-campaign",
"status": "PROD",
"supplierId": "supplier1"
}
7 changes: 7 additions & 0 deletions config/suppliers/supplier-pack/supplier1-notify-c4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"approval": "DRAFT",
"id": "supplier1-notify-c4",
"packSpecificationId": "notify-c4",
"status": "DRAFT",
"supplierId": "supplier1"
}
Loading
Loading