Skip to content

Supplier Config table#422

Open
nhsd-david-wass wants to merge 16 commits intomainfrom
feature/CCM-13359-Volume-Group-Eligibility
Open

Supplier Config table#422
nhsd-david-wass wants to merge 16 commits intomainfrom
feature/CCM-13359-Volume-Group-Eligibility

Conversation

@nhsd-david-wass
Copy link
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
  • If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.

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 February 19, 2026 15:20
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-13359-Volume-Group-Eligibility branch 5 times, most recently from eed6694 to fa5d2e1 Compare February 20, 2026 10:08
@nhsd-david-wass nhsd-david-wass requested a review from a team as a code owner February 20, 2026 15:41
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-13359-Volume-Group-Eligibility branch 10 times, most recently from 16c74f1 to 4c7fbc2 Compare February 25, 2026 13:18
@nhsd-david-wass nhsd-david-wass force-pushed the feature/CCM-13359-Volume-Group-Eligibility branch from fe90b52 to 7ec7e85 Compare February 26, 2026 15:41
Copy link
Contributor

@stevebux stevebux left a comment

Choose a reason for hiding this comment

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

Good work, just a few comments

description: "No letter variant found for id",
variantId,
});
throw new Error(`No letter variant details found for id ${variantId}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect we probably don't need to both log and rethrow the exception - if we rethrow it it'll get logged further up the call stack

function createVolumeGroupItem(groupId: string, status = "PROD") {
const startDate = new Date(Date.now() - 24 * 1000 * 60 * 60)
.toISOString()
.split("T")[0]; // Started an hour ago to ensure it's active based on start date. Tests can override this if needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

This look like 24 hours ago, but the comment says 1 hour

groupDetails &&
(groupDetails.status !== "PROD" ||
new Date(groupDetails.startDate) > new Date() ||
(groupDetails.endDate && new Date(groupDetails.endDate) < new Date()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the end date inclusive or exclusive? The unit tests suggest that it's going to be just a calendar date (rather than a date-time), so we probably need to consider whether a volume group expires at the start of the day on the end date or at the end of the day.

There's also a question of what time zone these dates represent - we're assuming UTC but is it Europe/London? That may be a lesser worry though as it would mean an error of no more than one hour, rather than a whole day.

supplierId: string,
deps: Deps,
): Promise<SupplierAllocation[]> {
const allocations =
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you're using the empty string to represent "no supplierId". Would declaring the type as string? be clearer maybe?

const supplierDetails: Supplier[] =
await deps.supplierConfigRepo.getSuppliersDetails(supplierIds);

if (Object.keys(supplierDetails).length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be an error if we found supplier allocations for only some of the suppliers, or is that OK?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants