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

Ensure Sync All Contracts API is Idempotent and Data-Safe

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • swatch-contracts

      • Validate that the Sync All Contracts API(/internal/rpc/syncAllContracts) is fully idempotent.
      • Ensure repeated executions correctly synchronize contracts and subscriptions without creating duplicate or inconsistent data.
      • Verify data integrity across related tables(contracts, contract_metrics, subscriptions, subscription_measurements).
      • Assess whether is_pre_cleanup logic is required for global sync like we have it for 
        /api/swatch-contracts/internal/rpc/sync/contracts/{org_id}

      AC:

      • Multiple executions of the API do not create duplicate contracts or subscriptions.
      • No additional or unintended records are inserted or modified.
      • Contracts and subscriptions remain consistent and aligned after each run.
      • Clear decision documented on is_pre_cleanup needed or not.
      • Automated tests validate repeat-run and already-synced scenarios.    

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

                Created:
                Updated: