Skip to content

docs: add customer_billing app reference and update lifecycle doc - #228

Open
iloveagent57 wants to merge 1 commit into
mainfrom
adusenbery/customer-billing-docs
Open

docs: add customer_billing app reference and update lifecycle doc#228
iloveagent57 wants to merge 1 commit into
mainfrom
adusenbery/customer-billing-docs

Conversation

@iloveagent57

Copy link
Copy Markdown
Member

Add customer-billing-app-reference.rst covering the app module structure, models, Stripe event handlers, Celery tasks, management commands, and external service dependencies.

Update subscription-and-renewal-lifecycle.rst with gaps identified during the architecture review:

  • Expand CheckoutIntent state field to show full state machine including ERRORED_FULFILLMENT_STALLED and recovery paths
  • Document checkout_intent_uuid vs checkout_intent_id lookup fallback on StripeEventData, and add handled_at field description
  • Explain the invoice.created / invoice.paid two-event split and out-of-order delivery handling in the trial-to-paid section
  • Add Management Commands section

Motivation: qualitative exploration of whether https://github.com/abhigyanpatwari/GitNexus can help LLMs more thoroughly and correctly read, trace, and explain our code.

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

Add customer-billing-app-reference.rst covering the app module
structure, models, Stripe event handlers, Celery tasks, management
commands, and external service dependencies.

Update subscription-and-renewal-lifecycle.rst with gaps identified
during the architecture review:
- Expand CheckoutIntent state field to show full state machine
  including ERRORED_FULFILLMENT_STALLED and recovery paths
- Document checkout_intent_uuid vs checkout_intent_id lookup fallback
  on StripeEventData, and add handled_at field description
- Explain the invoice.created / invoice.paid two-event split and
  out-of-order delivery handling in the trial-to-paid section
- Add Management Commands section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 8, 2026 17:55
@iloveagent57
iloveagent57 requested review from a team as code owners July 8, 2026 17:55
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.06%. Comparing base (bc44b59) to head (9b60c55).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #228   +/-   ##
=======================================
  Coverage   87.06%   87.06%           
=======================================
  Files         155      155           
  Lines       13014    13014           
  Branches     1249     1249           
=======================================
  Hits        11331    11331           
  Misses       1375     1375           
  Partials      308      308           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the Customer Billing documentation set by adding a module-level reference for the customer_billing Django app and tightening the subscription/renewal lifecycle narrative to reflect additional states, webhook processing details, and operational tooling.

Changes:

  • Added customer-billing-app-reference.rst describing core models, key modules, Celery tasks, management commands, and external dependencies.
  • Expanded subscription-and-renewal-lifecycle.rst with a fuller CheckoutIntent.state state machine, StripeEventData.handled_at + checkout intent lookup behavior, and detailed handling for invoice.created/invoice.paid ordering.
  • Documented operational management commands in the lifecycle doc.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/customer-billing/subscription-and-renewal-lifecycle.rst Expands lifecycle/state-machine and webhook-processing docs; adds management commands section.
docs/customer-billing/customer-billing-app-reference.rst New module-level reference for the customer_billing app structure, behavior, and dependencies.

+------------------------------------+------------------------------------------------------------------+
| ``backfill_subscription_renewals`` | Data migration helper for ``SelfServiceSubscriptionRenewal`` |
+------------------------------------+------------------------------------------------------------------+
| ``populate_stripe_event_summaries``| Backfill ``StripeEventSummary`` records from existing event data |
Management Commands
-------------------

Operational commands for routine maintenance and data recovery:
+------------------------------------+------------------------------------------------------------------+
| ``backfill_subscription_renewals`` | Data migration helper for ``SelfServiceSubscriptionRenewal`` |
+------------------------------------+------------------------------------------------------------------+
| ``populate_stripe_event_summaries``| Backfill ``StripeEventSummary`` records from existing event data |
Comment on lines +51 to +52
Raw Stripe event payload storage. PII-flagged (``email_address``) — scrubbed after 90 days via
management command. Linked to ``CheckoutIntent`` via Stripe customer ID cross-referenced with
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants