Files
tilbudgivern/apitest/BATCH_12_PLAN.md
T

3.4 KiB

Batch 12 Plan - Safe Mutations (Phase 1)

Strategy: Start with Safest Mutations

After completing ALL query endpoints (198/198 ✅), we now transition to the mutation phase.

Total Mutations: 311 endpoints

Risk Classification:

  • 🟢 SAFE (24): Read-like, idempotent, or status changes (mark, send, set, approve, register)
  • 🟡 MEDIUM (99): Update operations that modify existing data
  • 🔴 DANGEROUS (188): Create/delete operations that add or remove data

Batch 12 Focus: All 24 SAFE Mutations

These mutations are the safest to test as they:

  • Don't create new records
  • Don't delete existing data
  • Mostly change status or send notifications
  • Are often idempotent (can run multiple times safely)

Endpoints (24 total)

Approval/Status Operations (3)

  1. approveCreditorInvoice - Approve a creditor invoice
  2. approveScheme - Approve a scheme
  3. closeScheme - Close a scheme

Mark/Read Operations (1)

  1. markMessageAsRead - Mark message as read (idempotent)

Registration Operations (2)

  1. registerLiquidBarcodeUser - Register user for liquid barcode system
  2. registerUserPushNotification - Register push notification token

Rejection Operations (1)

  1. rejectGasServiceCase - Reject gas service case

Send/Communication Operations (7)

  1. sendCaseReport - Send case report via email
  2. sendCompanyPushNotification - Send push notification to company
  3. sendCreditorInvoiceViaEmail - Send creditor invoice by email
  4. sendOfferViaEmail - Send offer by email
  5. sendReminder - Send reminder (invoice/payment)
  6. sendSalesInvoiceViaEmail - Send sales invoice by email
  7. sendSalesInvoiceViaGln - Send sales invoice via GLN
  8. sendUserPushNotification - Send push notification to user

Set/Configuration Operations (9)

  1. setCarProduct - Set product for car
  2. setDiscountGroupDetailItem - Set discount group detail item
  3. setInvoiceAddress - Set invoice address
  4. setNamedPreference - Set named user preference
  5. setSalesInvoiceDraftStateLine - Set sales invoice draft state line
  6. setSalesInvoicePaidAmount - Set paid amount on invoice
  7. setUserCredentials - Set user credentials
  8. setUserPreferences - Set user preferences

Sync Operations (1)

  1. syncCreditorsToCreditorInvoices - Sync creditors to invoices

Testing Strategy

For each mutation:

  1. Introspect arguments - Get required parameters
  2. Create script with validation - Similar to Batch 11 approach
  3. Add safety notes - Document what the mutation does
  4. Test if possible - Only if we have valid IDs and it's truly safe
  5. Document output - Save results for successful tests

Expected Outcomes:

  • Most will require valid IDs (customer, invoice, case, etc.)
  • Some may return errors if already in target state (e.g., already approved)
  • Send operations may require valid email addresses
  • Set operations may work with current user credentials

Success Criteria

  • ✅ All 24 scripts created with parameter validation
  • ✅ Clear documentation of what each mutation does
  • ✅ Safety warnings where applicable
  • ✅ Test any that can be safely executed
  • ✅ Update progress: 255 → 279/507 (55%)

Next Batches

  • Batch 13-15: MEDIUM mutations (update operations, ~30 each)
  • Batch 16-22: DANGEROUS mutations (create/delete, ~30 each)

Batch 12 Goal: Complete all safe mutations and establish patterns for mutation testing.