Skip to content

Commit

Permalink
chore: add s3 bucket url to config
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Sep 20, 2023
1 parent 673895f commit b718e23
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const s3BucketUrlVars = convict(s3BucketUrlSchema)
attachmentBucketUrl: `${awsEndpoint}/${basicVars.awsConfig.attachmentS3Bucket}/`,
virusScannerQuarantineS3BucketUrl: `${awsEndpoint}/${basicVars.awsConfig.virusScannerQuarantineS3Bucket}`,
virusScannerCleanS3BucketUrl: `${awsEndpoint}/${basicVars.awsConfig.virusScannerCleanS3Bucket}`,
paymentProofS3BucketUrl: `${awsEndpoint}/${basicVars.awsConfig.paymentProofS3Bucket}`,
})
.validate({ allowed: 'strict' })
.getProperties()
Expand Down
6 changes: 6 additions & 0 deletions src/app/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,5 +485,11 @@ export const loadS3BucketUrlSchema = ({
validateS3BucketUrl(val, { isDev, hasTrailingSlash: false, region }),
default: null,
},
paymentProofS3BucketUrl: {
doc: 'Url of payment proof S3 bucket.',
format: (val) =>
validateS3BucketUrl(val, { isDev, hasTrailingSlash: false, region }),
default: null,
},
}
}
1 change: 1 addition & 0 deletions src/app/modules/payments/payments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const confirmPaymentPendingSubmission = (
paymentDate,
receiptUrl,
transactionFee,
hasS3ReceiptUrl: false,
}
return okAsync(payment)
})
Expand Down
2 changes: 2 additions & 0 deletions src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export interface ICompulsoryVarsSchema {
attachmentS3Bucket: string
virusScannerQuarantineS3Bucket: string
virusScannerCleanS3Bucket: string
paymentProofS3Bucket: string
}
}

Expand Down Expand Up @@ -199,5 +200,6 @@ export interface IBucketUrlSchema {
staticAssetsBucketUrl: string
virusScannerQuarantineS3BucketUrl: string
virusScannerCleanS3BucketUrl: string
paymentProofS3BucketUrl: string
endPoint: string
}

0 comments on commit b718e23

Please sign in to comment.