{
  "generatedAt": "2026-07-30T22:23:07.322Z",
  "databasePath": "C:\\Users\\goura\\Desktop\\Office365\\production-office365-20260731-032012.sqlite",
  "databaseSizeBytes": 1028096,
  "tables": [
    "admin_clocks",
    "admin_tasks",
    "admin_users",
    "audit_logs",
    "customers",
    "email_logs",
    "external_lead_imports",
    "finance_agent_rates",
    "finance_agents",
    "finance_payment_modes",
    "finance_payouts",
    "finance_reserve_batch_items",
    "finance_reserve_batches",
    "finance_sale_allocations",
    "finance_sales",
    "integration_sources",
    "invoice_settings",
    "invoices",
    "leads",
    "notification_recipients",
    "order_status_history",
    "orders",
    "password_reset_otps",
    "plans",
    "reminders",
    "sessions",
    "site_content",
    "smtp_profiles"
  ],
  "tableCounts": {
    "admin_clocks": 4,
    "admin_tasks": 8,
    "admin_users": 5,
    "audit_logs": 541,
    "customers": 211,
    "email_logs": 90,
    "external_lead_imports": 25,
    "finance_agent_rates": 7,
    "finance_agents": 6,
    "finance_payment_modes": 5,
    "finance_payouts": 152,
    "finance_reserve_batch_items": 52,
    "finance_reserve_batches": 7,
    "finance_sale_allocations": 10,
    "finance_sales": 212,
    "integration_sources": 0,
    "invoice_settings": 1,
    "invoices": 42,
    "leads": 222,
    "notification_recipients": 0,
    "order_status_history": 331,
    "orders": 222,
    "password_reset_otps": 0,
    "plans": 7,
    "reminders": 0,
    "sessions": 68,
    "site_content": 1,
    "smtp_profiles": 1
  },
  "summaries": {
    "leadsByStatus": [
      {
        "label": "converted",
        "count": 185
      },
      {
        "label": "disputed",
        "count": 20
      },
      {
        "label": "closed",
        "count": 4
      },
      {
        "label": "refunded",
        "count": 4
      },
      {
        "label": "cancelled",
        "count": 3
      },
      {
        "label": "contacted",
        "count": 3
      },
      {
        "label": "new",
        "count": 2
      },
      {
        "label": "dispute_won",
        "count": 1
      }
    ],
    "leadsByAgent": [
      {
        "label": "Ashish Kumar",
        "count": 75
      },
      {
        "label": "Priyank Jain",
        "count": 75
      },
      {
        "label": "Deep Kumar",
        "count": 57
      },
      {
        "label": "(unassigned)",
        "count": 11
      },
      {
        "label": "Rahul Singh",
        "count": 3
      },
      {
        "label": "Deepika",
        "count": 1
      }
    ],
    "salesByStatus": [
      {
        "label": "converted",
        "count": 185
      },
      {
        "label": "disputed",
        "count": 20
      },
      {
        "label": "closed",
        "count": 4
      },
      {
        "label": "refunded",
        "count": 4
      },
      {
        "label": "cancelled",
        "count": 3
      },
      {
        "label": "contacted",
        "count": 3
      },
      {
        "label": "new",
        "count": 2
      },
      {
        "label": "dispute_won",
        "count": 1
      }
    ],
    "salesTotalsByCurrency": [
      {
        "currency": "GBP",
        "count": 22,
        "amountMinor": 1197500
      },
      {
        "currency": "USD",
        "count": 200,
        "amountMinor": 6804913
      }
    ],
    "invoicesByPaymentStatus": [
      {
        "label": "unpaid",
        "count": 25,
        "amountMinor": 499976
      },
      {
        "label": "paid",
        "count": 17,
        "amountMinor": 419983
      }
    ],
    "invoiceTotalsByCurrency": [
      {
        "currency": "USD",
        "count": 42,
        "amountMinor": 919959
      }
    ],
    "paidInvoiceTotalsByCurrency": [
      {
        "currency": "USD",
        "count": 17,
        "amountMinor": 419983
      }
    ],
    "unpaidInvoiceTotalsByCurrency": [
      {
        "currency": "USD",
        "count": 25,
        "amountMinor": 499976
      }
    ],
    "financeSalesTotalsByCurrency": [
      {
        "currency": "GBP",
        "count": 22,
        "amountMinor": 1197500
      },
      {
        "currency": "USD",
        "count": 190,
        "amountMinor": 6564923
      }
    ],
    "reserveBalancesByCurrency": [
      {
        "currency": "GBP",
        "count": 22,
        "reserveAmountMinor": 0,
        "releasedAmountMinor": 1051100,
        "reservePayableInrPaise": 0
      },
      {
        "currency": "USD",
        "count": 190,
        "reserveAmountMinor": 514500,
        "releasedAmountMinor": 5263948,
        "reservePayableInrPaise": 3780000
      }
    ]
  },
  "integrity": {
    "duplicateCustomerEmails": [
      {
        "value": "hutchk41@comcast.net",
        "count": 3
      },
      {
        "value": "henryhalladay@earthlink.net",
        "count": 2
      },
      {
        "value": "jfetes@att.net",
        "count": 2
      },
      {
        "value": "stephanie@stephanieweil.com",
        "count": 2
      }
    ],
    "duplicateInvoiceNumbers": [],
    "orphanLeadsWithoutOrder": 0,
    "orphanOrdersWithoutCustomer": 0,
    "orphanInvoicesWithoutOrder": 0,
    "orphanFinanceSalesWithoutOrder": 0,
    "missingLeadAgents": 0,
    "missingOrderAgents": 0,
    "nullImportantFields": []
  },
  "migrationPlan": [
    {
      "entity": "Payment gateways",
      "source": "invoice_settings.payment_links",
      "destination": "payment_gateways",
      "rule": "Seed active default gateway from first configured legacy payment link when no gateway exists. Preserve legacy links.",
      "rollback": "Keep legacy payment_links untouched; archive inserted payment gateway if rollout is cancelled."
    },
    {
      "entity": "Invoice gateway snapshots",
      "source": "invoices.payment_links plus selected gateway on new sends",
      "destination": "invoices.payment_gateway_id/payment_gateway_snapshot",
      "rule": "New unpaid invoices store selected gateway snapshot. Existing invoice links remain unchanged.",
      "rollback": "Ignore new nullable columns; historical payment_links still render."
    },
    {
      "entity": "Paid invoice sales linkage",
      "source": "invoices, orders, finance_sales",
      "destination": "orders/finance_sales relationship",
      "rule": "Link only where order/invoice relationship is certain. Do not create duplicate finance_sales.",
      "rollback": "Remove only new linkage rows recorded in audit/mapping table."
    },
    {
      "entity": "Finance and reserve values",
      "source": "finance_sales, finance_payouts, finance_reserve_batches",
      "destination": "retained tables",
      "rule": "Preserve historical amounts, currencies, sale dates, payout dates, reserve dates, and settlement status.",
      "rollback": "Restore database backup if financial reconciliation fails."
    }
  ]
}
