File tree Expand file tree Collapse file tree
infrastructure/terraform/components/api
lambdas/upsert-letter/src/handler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ resource "aws_dynamodb_table" "letter_queue" {
1212
1313 local_secondary_index {
1414 name = " queueSortOrder-index"
15- range_key = " queueSortOrder-SK "
15+ range_key = " queueSortOrderSk "
1616 projection_type = " ALL"
1717 }
1818
@@ -27,7 +27,7 @@ resource "aws_dynamodb_table" "letter_queue" {
2727 }
2828
2929 attribute {
30- name = " queueSortOrder-SK "
30+ name = " queueSortOrderSk "
3131 type = " S"
3232 }
3333
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ export default class LetterQueueRepository {
3131 ) : Promise < PendingLetter > {
3232 // needs to be an ISO timestamp as Db sorts alphabetically
3333 const now = new Date ( ) . toISOString ( ) ;
34- const priority = String ( insertPendingLetter . priority ?? 10 ) ;
34+ const priority = String (
35+ insertPendingLetter . priority ?? this . defaultPriority ,
36+ ) ;
3537 const queueSortOrderSk = `${ priority . padStart ( 2 , "0" ) } -${ now } ` ;
3638 const pendingLetter : PendingLetter = {
3739 ...insertPendingLetter ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ type PreparedEvents = LetterRequestPreparedEventV2 | LetterRequestPreparedEvent;
2121const SupplierSpecSchema = z . object ( {
2222 supplierId : z . string ( ) . min ( 1 ) ,
2323 specId : z . string ( ) . min ( 1 ) ,
24- priority : z . int ( ) ,
24+ priority : z . int ( ) . min ( 0 ) . max ( 99 ) ,
2525} ) ;
2626
2727type SupplierSpec = z . infer < typeof SupplierSpecSchema > ;
You can’t perform that action at this time.
0 commit comments