Skip to content

CCM-20032: Letter Variant SupplierId Not Honoured#634

Open
nhsd-david-wass wants to merge 7 commits into
mainfrom
feature/CCM-20032-Letter-Variant_SupplierId
Open

CCM-20032: Letter Variant SupplierId Not Honoured#634
nhsd-david-wass wants to merge 7 commits into
mainfrom
feature/CCM-20032-Letter-Variant_SupplierId

Conversation

@nhsd-david-wass

Copy link
Copy Markdown
Contributor

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

DT3-Specific Checklist

  • If I have added a new resource (SQS, Lambda, Gateway, DDB table, etc), I have created the appropriate alarms

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@nhsd-david-wass nhsd-david-wass requested a review from a team as a code owner June 25, 2026 09:40
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-20032-Letter-Variant_SupplierId branch from 430dc4e to 1086bb7 Compare June 25, 2026 10:28
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-20032-Letter-Variant_SupplierId branch from 1086bb7 to 30c7f1f Compare June 25, 2026 12:44
@nhsd-david-wass nhsd-david-wass requested a review from a team as a code owner June 25, 2026 15:13
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-20032-Letter-Variant_SupplierId branch 5 times, most recently from 6955ecc to 0ef1446 Compare June 30, 2026 09:54
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-20032-Letter-Variant_SupplierId branch from 0ef1446 to 51cd442 Compare June 30, 2026 10:04
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-20032-Letter-Variant_SupplierId branch from c7ff230 to 2b34aa3 Compare June 30, 2026 12:16
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-20032-Letter-Variant_SupplierId branch from 2b34aa3 to 197426d Compare June 30, 2026 12:22
});
}
return {
supplierAllocations: filteredAllocations,

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.

I'm just trying to understand the logic of this change. The ticket says:
All volume group and supplier allocations logic should be applied before applying this filter
But it looks like you're skipping the getSupplierAllocationsForVolumeGroup step here - is that correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - if we have a supplier specified on the letter variant, the allocation is going to them regardless of the allocation percentage. That will only come into affect for other letters in the volume group that do not have a supplier Id on the variant

test.describe("Letter Variant Tests", () => {
test.setTimeout(180_000); // 3 minutes for long running polling

test("Verify that supplierId on letter variant takes pecedence over volume group", async () => {

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 typo: pecedence -> precedence

volumeGroupId: volumeGroup.id,
letterVariantSupplierId,
});
const filteredAllocations = supplierAllocations.filter(

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.

Am I right in thinking there will only ever be one supplier allocation per supplier? If so, it might be clearer to use find here rather than filter

stevebux
stevebux previously approved these changes Jul 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants