@@ -16,17 +16,20 @@ usage() {
1616 echo " "
1717 echo " Optional parameters:"
1818 echo " --count Number of letters per batch (default: 835)"
19+ echo " --missing-count Number of letters with missing PDFs (default: 5)"
1920 echo " --status Letter status (default: PENDING)"
2021 echo " --ttl-hours TTL in hours (default: 13140)"
2122 echo " "
2223 echo " Example:"
2324 echo " $0 --supplier-id supplier-123 --environment pr147 --awsAccountId 820178564574"
2425 echo " $0 --supplier-id supplier-123 --environment main --awsAccountId 820178564574 --count 25 --status ACCEPTED"
26+ echo " $0 --supplier-id supplier-123 --environment main --awsAccountId 820178564574 --count 25 --status ACCEPTED --missing-count 3"
2527 exit 1
2628}
2729
2830# Default values
2931COUNT=835 # 3 batches = 2505 letters
32+ MISSING_COUNT=5 # Number of letters with missing PDFs
3033STATUS=" PENDING"
3134TTL_HOURS=13140 # Approximately 18 months
3235
@@ -49,6 +52,10 @@ while [[ $# -gt 0 ]]; do
4952 COUNT=" $2 "
5053 shift 2
5154 ;;
55+ --missing-count)
56+ MISSING_COUNT=" $2 "
57+ shift 2
58+ ;;
5259 --status)
5360 STATUS=" $2 "
5461 shift 2
@@ -87,11 +94,18 @@ if ! [[ "$COUNT" =~ ^[1-9][0-9]*$ ]]; then
8794 exit 1
8895fi
8996
97+ # Validate missing count is a positive number
98+ if ! [[ " $MISSING_COUNT " =~ ^[1-9][0-9]* $ ]]; then
99+ echo " Error: Missing count must be a positive integer"
100+ exit 1
101+ fi
102+
90103echo " Creating letter batches with the following configuration:"
91104echo " Supplier ID: $SUPPLIER_ID "
92105echo " Environment: $ENVIRONMENT "
93106echo " AWS Account ID: $AWS_ACCOUNT_ID "
94107echo " Count per batch: $COUNT "
108+ echo " Letters missing PDFs count: $MISSING_COUNT "
95109echo " Status: $STATUS "
96110echo " TTL Hours: $TTL_HOURS "
97111echo " "
@@ -105,9 +119,10 @@ cd "$PROJECT_DIR"
105119
106120# Define the three batches with different specification and group IDs
107121BATCHES=(
108- " integration-specification-english:group-english:test-letter-standard"
109- " integration-specification-braille:group-accessible:test-letter-standard"
110- " integration-specification-arabic:group-international:test-letter-large"
122+ " integration-specification-english:group-english:test-letter-standard:${COUNT} "
123+ " integration-specification-braille:group-accessible:test-letter-standard:${COUNT} "
124+ " integration-specification-arabic:group-international:test-letter-large:${COUNT} "
125+ " integration-specification-missing-pdf:group-error:none:${MISSING_COUNT} "
111126)
112127
113128# Counter for tracking batch creation
@@ -121,7 +136,7 @@ echo ""
121136# Create each batch
122137for batch in " ${BATCHES[@]} " ; do
123138 # Parse specification-id and group-id from the batch definition
124- IFS=' :' read -r SPEC_ID GROUP_ID TEST_LETTER <<< " $batch"
139+ IFS=' :' read -r SPEC_ID GROUP_ID TEST_LETTER BATCH_COUNT <<< " $batch"
125140
126141 echo " [$BATCH_COUNTER /$TOTAL_BATCHES ] Creating batch with specification-id: $SPEC_ID , group-id: $GROUP_ID -$SUPPLIER_ID "
127142
@@ -133,7 +148,7 @@ for batch in "${BATCHES[@]}"; do
133148 --specification-id " $SPEC_ID " \
134149 --group-id " $GROUP_ID -$SUPPLIER_ID " \
135150 --status " $STATUS " \
136- --count " $COUNT " \
151+ --count " $BATCH_COUNT " \
137152 --ttl-hours " $TTL_HOURS " \
138153 --test-letter " $TEST_LETTER "
139154
0 commit comments