Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-4014

Filter contract dimensions with incorrect dimension without product tag

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • swatch-contracts
    • None

      This card is outcome of investigation from SWATCH-3867

      SWATCH currently has logic to handle cases with incorrect dimensions, but it requires a product tag match. Since these dimensions are non-configured in SWATCH and doesn't have a product tag, we are unable to filter them with the existing logic. Example when we get a sku with a non configured product tag and then dimension is MCT4545

      https://github.com/RedHatInsights/rhsm-subscriptions/blob/60ec50cbb3783ad961aea09fc28b02bca3a8f357/swatch-contracts/src/main/java/com/redhat/swatch/contract/model/MeasurementMetricIdTransformer.java#L130 

      I was able to replicate the issue by calling API as below:

      curl -X POST http://localhost:8011/api/swatch-contracts/internal/contracts \
          -H "Content-Type: application/json" \
          -d '{
            "partner_entitlement": {
              "rhAccountId": "org123",
              "sourcePartner": "aws_marketplace",
              "entitlementDates": {
                "startDate": "2023-05-24T18:46:05Z",
                "endDate": "2026-09-24T12:46:10.229Z"
              },
              "rhEntitlements": [
                {
                  "subscriptionNumber": "14968327",
                  "sku": "BASILISK"
                }
              ],
              "purchase": {
                "vendorProductCode": "cmjyuylkjymet72qluirawh6v",
                "contracts": [
                  {
                    "dimensions": [
                      {
                        "name": "MCT4545",
                        "value": "600"
                      }
                    ]
                  }
                ]
              },
              "partnerIdentities": {
                "awsCustomerId": "W4TpJBpJKhD",
                "sellerAccountId": "403771435366",
                "customerAwsAccountId": "771835612317"
              }
            },
            "subscription_id": "sub14968327"
          }'
      
      
      

       

      AC:

      • We should filter invalid dimensions when there is no matching product tag
      • Component test around this functionality

              Unassigned Unassigned
              karshah@redhat.com Kartik Shah
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: