Skip to content

Test clock delete + fixture rewind, SDK31 discount source, transfer_lookup_key - #79

Merged
midagedev merged 1 commit into
mainfrom
fix/test-clock-delete-and-sdk31-ports
Aug 30, 2026
Merged

Test clock delete + fixture rewind, SDK31 discount source, transfer_lookup_key#79
midagedev merged 1 commit into
mainfrom
fix/test-clock-delete-and-sdk31-ports

Conversation

@midagedev

Copy link
Copy Markdown
Owner

Summary

Fixes #76 and ports the two items from #68 that had not already landed through #70#75.

  • DELETE /v1/test_helpers/test_clocks/{id} removes a clock and detaches (rather than deletes) the customers and subscriptions referencing it, so a fixture pack can re-seed against a recreated clock reusing the same id.
  • Re-applying a fixture pack recreates a clock that ran past the pack's declared frozen_time before subscriptions re-seed. The issue test clock reset/delete: fixture 재적용이 시계를 되돌리지 못해 trial 전제가 회차 간 소진된다 #76 round-trip — seed trialing → advance past trial_end (premise consumed) → re-apply — now restores both the clock and the trialing premise. Backwards advance stays rejected.
  • Discount objects serialize the Stripe SDK 31 source.{coupon,promotion_code} sub-object alongside the legacy top-level coupon.
  • POST /v1/prices/{id} accepts transfer_lookup_key: an in-use lookup key is cleared from its previous holder. Without the flag, the existing set-in-place semantics are unchanged.

Verification

  • go test ./... green (full suite).
  • New regression tests: TestTestClockDeleteDetachesReferences, TestFixtureReapplyRestoresAdvancedTrialClock (reproduces the issue scenario before the fixture-rewind path), TestDiscountSourceShape, TestPriceTransferLookupKey.
  • Inventory against the pinned dahlia snapshot: operations=587 implemented=201 inventory_only=386 implemented_percent=34.2.

Open risks

  • Clock deletion detaches instead of deleting attached objects — documented divergence from Stripe semantics, chosen so fixture re-apply is idempotent.

Gate status

No gate regressions; coverage baselines refreshed (201/587, 34.2%).

… transfer_lookup_key

DELETE /v1/test_helpers/test_clocks/{id} removes a clock and detaches
its referenced customers and subscriptions (Stripe deletes the attached
objects; Billtap keeps them so fixture packs can re-seed against a
recreated clock reusing the same id). Re-applying a fixture pack now
recreates a clock that ran past the pack's declared frozen_time before
subscriptions re-seed, restoring a consumed premise such as an expired
trial instead of forcing a database rebuild (fixes #76).

Discount objects serialize the Stripe SDK 31 source.{coupon,
promotion_code} sub-object alongside the legacy top-level coupon, and
POST /v1/prices/{id} accepts transfer_lookup_key to move an in-use
lookup key, clearing it from the previous holder.

Ports the two items from #68 that had not landed through #70-#75.
OpenAPI inventory: 200/587 (34.1%) -> 201/587 (34.2%).
@midagedev
midagedev merged commit 1de04ce into main Aug 30, 2026
2 of 3 checks passed
@midagedev
midagedev deleted the fix/test-clock-delete-and-sdk31-ports branch August 30, 2026 09:18
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.

test clock reset/delete: fixture 재적용이 시계를 되돌리지 못해 trial 전제가 회차 간 소진된다

1 participant