diff --git a/src/domains/ecommerce-app/api/ecommerce-helpdesk-api/v1/_openapi.json.tpl b/src/domains/ecommerce-app/api/ecommerce-helpdesk-api/v1/_openapi.json.tpl index 6cf09dafa3..e4641c8dcf 100644 --- a/src/domains/ecommerce-app/api/ecommerce-helpdesk-api/v1/_openapi.json.tpl +++ b/src/domains/ecommerce-app/api/ecommerce-helpdesk-api/v1/_openapi.json.tpl @@ -1442,6 +1442,36 @@ "endDate" ] }, + "DeadLetterExcludedStatuses": { + "type": "object", + "properties": { + "ecommerceStatuses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of eCommerce statuses to exclude", + "example": [ + "NOTIFIED_OK" + ] + }, + "npgStatuses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of NPG statuses to exclude", + "example": [ + "DECLINED", + "CANCELLED" + ] + } + }, + "required": [ + "ecommerceStatuses", + "npgStatuses" + ] + }, "SearchPgsStatusResponse": { "type": "object", "properties": { @@ -2147,6 +2177,9 @@ }, "timeRange": { "$ref": "#/components/schemas/DeadLetterSearchDateTimeRange" + }, + "excludedStatuses": { + "$ref": "#/components/schemas/DeadLetterExcludedStatuses" } }, "required": [ @@ -2167,6 +2200,24 @@ "endDate": "2023-01-01T02:00:00.000Z" } } + }, + "search by source with time range and excluded statuses": { + "value": { + "source": "ALL", + "timeRange": { + "startDate": "2023-01-01T00:00:00.000Z", + "endDate": "2023-01-01T02:00:00.000Z" + }, + "excludedStatuses": { + "ecommerceStatuses": [ + "NOTIFIED_OK" + ], + "npgStatuses": [ + "DECLINED", + "CANCELLED" + ] + } + } } } } @@ -2242,4 +2293,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/domains/ecommerce-common/03_cosmosdb.tf b/src/domains/ecommerce-common/03_cosmosdb.tf index 1a8b052b51..f4c37b3455 100644 --- a/src/domains/ecommerce-common/03_cosmosdb.tf +++ b/src/domains/ecommerce-common/03_cosmosdb.tf @@ -34,7 +34,7 @@ module "cosmosdb_account_mongodb" { offer_type = var.cosmos_mongo_db_params.offer_type kind = var.cosmos_mongo_db_params.kind capabilities = var.cosmos_mongo_db_params.capabilities - #version commented out since using 6.0 version here raise the following error + #version commented out since using 6.0 version here raise the following error # `expected mongo_server_version to be one of [3.2 3.6 4.0 4.2], got 6.0`` # Leaving mongo_server_version parameter here causes plan diff for each plan # so it was simply commented out so that actual version is ignored @@ -159,6 +159,14 @@ locals { { keys = ["insertionDate"] unique = false + }, + { + keys = ["transactionInfo.eCommerceStatus"] + unique = false + }, + { + keys = ["transactionInfo.details.operationResult"] + unique = false } ] shard_key = "_id", @@ -304,4 +312,4 @@ resource "azurerm_monitor_metric_alert" "cosmos_db_normalized_ru_exceeded" { } tags = var.tags -} \ No newline at end of file +}