Skip to content

feat: add a demo clock for subscription renewals - #798

Draft
ovitrif wants to merge 2 commits into
masterfrom
feat/demo-clock-subscriptions
Draft

ovitrif wants to merge 2 commits into
masterfrom
feat/demo-clock-subscriptions

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Twin: synonymdev/bitkit-android#1341

This PR adds a demo clock so a recorded demo can show a subscription renewal without waiting a billing period.

Description

  • Adds Dev Settings › PAYKIT › "Demo clock offset (days)" (Off, 1, 7, 30, 31, 62, 365) so subscription scheduling can be moved forward on a debug build
  • Applies the offset to Paykit subscription scheduling only: proposal anchors and expiry, acceptance, due periods, renewal dates and due notifications, while one-time requests, invoices, payments and allowances keep real time
  • Keeps the offset Off by default and ignores it outside debug builds, so release behaviour is unchanged

Out of Scope

  • Device clock: unchanged; moving the simulator clock breaks the Pubky sessions, which is why the offset lives in the app
  • Release builds: the row and the offset are unavailable there

Design

N/A — no design available.

Preview

Screenshots follow before review.

QA Notes

Journeys

  • new second-billing-period.xml — with a 31-day offset the next period comes due as a Payment Request and the subscription detail lists two payments

Manual Tests

N/A

Automated Checks

  • added DemoClockTests.swift — clamping, presets and the offset applied to subscription dates
  • updated PaykitPaymentRequestServiceTests.swift — a demo clock offset makes the next billing period due

Dev Settings > PAYKIT > Demo clock offset (days) moves Paykit subscription
scheduling forward so a recorded demo can show a renewal without waiting a
billing period. It covers proposal anchors and expiry, acceptance, due periods,
renewal dates and due notifications. One-time requests, invoices, payments and
allowance checks keep real time. Off by default and ignored outside Debug.
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