Skip to content

fix(invoices): detect catalog drafts from fees - #6723

Open
endenis wants to merge 1 commit into
mainfrom
fix/catalog-draft-invoice-detection
Open

endenis wants to merge 1 commit into
mainfrom
fix/catalog-draft-invoice-detection

Conversation

@endenis

@endenis endenis commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Context

Follow-up to #6532 to address the remaining review feedback about identifying Product Catalog drafts.

Description

  • Recognize Product Catalog drafts through contract-linked fees.
  • Keep the billing-segment check for drafts without fees.
  • Add regression coverage for both cases.

## Context

Product Catalog drafts were identified only through their billing segments.

## Description

Also recognize drafts with contract-linked fees. Keep billing segments as a fallback for drafts without fees and cover both cases with regression tests.
@lago-claude-ai-agent

Copy link
Copy Markdown
Contributor

Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green

HOLD: fee-only product-catalog drafts are not handled safely end to end.

  • RefreshDraftAndFinalizeService#recurring_invoice? still recognizes catalog invoices only through billing segments, so a fee-only draft with keep_anchor will incorrectly move its issuing date at finalization. Use the same contract-fee fallback and add a finalization regression spec.
  • The new no-segments spec stubs the computation that production runs. The real catalog path deletes the existing fee and recomputes from an empty segment collection, producing a zero-value invoice. Cover the real result and preserve or rebuild the fee instead of only asserting service dispatch.

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.

1 participant