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

Refactor contract ingestion to increase consistency and testability

    XMLWordPrintable

Details

    Description

      The approach:

      • Create a method named upsertPartnerContract with params (PartnerEntitlementContract, PartnerEntitlements, subscriptionId)  that performs current upsert logic. Logic should be refactored from ContractService.createPartnerContract 
      • Update createPartnerContract to:
        • fetch PartnerEntitlements from the API - refactor from collectMissingUpStreamContractDetails
        • fetch subscriptionId
        • delegate to the upsertPartnerContract method.
      • Update createContract to take all of the necessary information in as a single parameter object, and then delegate to createPartnerContract.
        •  openapi updates needed: create a JSON schema in the openapi spec with fields for the partner contract, the partnerentitlements (new - extract spec from partner api spec), and the subscriptionId.
        • This will require updates to QE tools.

      Once this is done, the createContract REST method will exercise the same logic as UMB contract ingestion, except createContract will provide data that is otherwise fetched from APIs when receiving a UMB message. Calling createContract should not result in any API calls.

      Attachments

        Issue Links

          Activity

            People

              jcarvaja@redhat.com Jose Carvajal Hilario
              khowell@redhat.com Kevin Howell
              Aurobinda Nayak Aurobinda Nayak
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: