resource aws_dynamodb_table slz_uow_status {
  name           = "${var.name_prefix}-slz_uow_status"
  billing_mode   = "PAY_PER_REQUEST"
  hash_key       = "UnitOfWorkID"

  attribute {
    name = "UnitOfWorkID"
    type = "S"
  }

  attribute {
    name = "ActivityStatus"
    type = "S"
  }



//  not indexed fields in terraform file are not allowed
//  attribute {
//    name = "UoWCompletenessStatus"
//    type = "S"
//  }
//  attribute {
//    name = "CreatedAt"
//    type = "S"
//  }
//
//  attribute {
//    name = "CompletedAt"
//    type = "S"
//  }
//  attribute {
//    name = "NextRunAt"
//    type = "S"
//  }

  global_secondary_index {
    name               = "ActivityStatusIndex"
    hash_key           = "ActivityStatus"
    projection_type    = "ALL"
  }

  point_in_time_recovery {
    enabled = var.backups_enabled
  }

  tags = merge(
    var.tags,
    {
      "Name" = "${var.name_prefix}-slz_uow_status"
    },
  )

}
