File tree Expand file tree Collapse file tree
scripts/utilities/letter-test-data/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,21 +192,22 @@ async function main() {
192192 const letterRepository = createLetterRepository ( environment , ttlHours ) ;
193193 const { count } = argv ;
194194 const { testLetter } = argv ;
195-
196195 // Setup file attributes
197196 const bucketName = `nhs-${ argv . awsAccountId } -eu-west-2-${ argv . environment } -supapi-test-letters` ;
198197 const targetFilename = `${ batchId } -${ status } .pdf` ;
199198 const folder = `${ supplierId } /${ batchId } ` ;
200199 const url = `s3://${ bucketName } /${ folder } /${ targetFilename } ` ;
200+ let hash : string | undefined ;
201201
202202 // Upload a test file for this batch if it is not an 'none' batch
203203 if ( testLetter !== "none" ) {
204- await uploadFile (
204+ const result = await uploadFile (
205205 bucketName ,
206- folder ,
206+ supplierId ,
207207 `${ testLetter } .pdf` ,
208208 targetFilename ,
209209 ) ;
210+ hash = result . hash ;
210211 }
211212
212213 // Create letter DTOs
@@ -221,6 +222,7 @@ async function main() {
221222 billingId,
222223 status : status as LetterStatusType ,
223224 url,
225+ sha256Hash : hash ,
224226 } ) ,
225227 ) ;
226228 }
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ export function createLetterDto(params: {
6969 groupId : string ;
7070 status : LetterStatusType ;
7171 url : string ;
72+ sha256Hash ?: string ;
7273} ) {
7374 const {
7475 billingId,
@@ -78,6 +79,7 @@ export function createLetterDto(params: {
7879 status,
7980 supplierId,
8081 url,
82+ sha256Hash,
8183 } = params ;
8284
8385 const letter : Omit < Letter , "ttl" | "supplierStatus" | "supplierStatusSk" > = {
You can’t perform that action at this time.
0 commit comments