File tree Expand file tree Collapse file tree
lambdas/supplier-allocator/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { SQSBatchItemFailure , SQSEvent , SQSHandler } from "aws-lambda" ;
22import { SendMessageCommand } from "@aws-sdk/client-sqs" ;
3- import { LetterRequestPreparedEvent } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering-v1" ;
43import {
54 LetterVariant ,
65 PackSpecification ,
76 Supplier ,
87 VolumeGroup ,
98} from "@nhsdigital/nhs-notify-event-schemas-supplier-config" ;
10- import { LetterRequestPreparedEventV2 } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering" ;
119import z from "zod" ;
1210import { Unit } from "aws-embedded-metrics" ;
1311import { MetricEntry , MetricStatus , buildEMFObject } from "@internal/helpers" ;
@@ -25,20 +23,7 @@ import {
2523} from "./allocation-config" ;
2624
2725import { Deps } from "../config/deps" ;
28-
29- type SupplierSpec = {
30- supplierId : string ;
31- specId : string ;
32- priority : number ;
33- billingId : string ;
34- } ;
35-
36- type SupplierDetails = {
37- supplierSpec : SupplierSpec ;
38- volumeGroupId : string ;
39- } ;
40-
41- type PreparedEvents = LetterRequestPreparedEventV2 | LetterRequestPreparedEvent ;
26+ import { PreparedEvents , SupplierDetails , SupplierSpec } from "./types" ;
4227
4328// small envelope that must exist in all inputs
4429const TypeEnvelope = z . object ( { type : z . string ( ) . min ( 1 ) } ) ;
Original file line number Diff line number Diff line change 1- import { LetterRequestPreparedEvent } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering-v1" ;
2- import { LetterRequestPreparedEventV2 } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering" ;
31import {
42 PackSpecification ,
53 Supplier ,
@@ -17,8 +15,7 @@ import {
1715} from "../services/supplier-config" ;
1816import { calculateSupplierAllocatedFactor } from "../services/supplier-quotas" ;
1917import { Deps } from "../config/deps" ;
20-
21- type PreparedEvents = LetterRequestPreparedEventV2 | LetterRequestPreparedEvent ;
18+ import { PreparedEvents } from "./types" ;
2219
2320export async function eligibleSuppliers (
2421 volumeGroup : VolumeGroup ,
Original file line number Diff line number Diff line change 1+ import { LetterRequestPreparedEvent } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering-v1" ;
2+ import { LetterRequestPreparedEventV2 } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering" ;
3+
4+ export type SupplierSpec = {
5+ supplierId : string ;
6+ specId : string ;
7+ priority : number ;
8+ billingId : string ;
9+ } ;
10+
11+ export type SupplierDetails = {
12+ supplierSpec : SupplierSpec ;
13+ volumeGroupId : string ;
14+ } ;
15+
16+ export type PreparedEvents =
17+ | LetterRequestPreparedEventV2
18+ | LetterRequestPreparedEvent ;
Original file line number Diff line number Diff line change @@ -6,12 +6,9 @@ import {
66 SupplierPack ,
77 VolumeGroup ,
88} from "@nhsdigital/nhs-notify-event-schemas-supplier-config" ;
9- import { LetterRequestPreparedEventV2 } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering" ;
10- import { LetterRequestPreparedEvent } from "@nhsdigital/nhs-notify-event-schemas-letter-rendering-v1" ;
119
1210import { Deps } from "../config/deps" ;
13-
14- type PreparedEvents = LetterRequestPreparedEventV2 | LetterRequestPreparedEvent ;
11+ import { PreparedEvents } from "../handler/types" ;
1512
1613export async function getVariantDetails (
1714 variantId : string ,
You can’t perform that action at this time.
0 commit comments