Skip to content

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

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-ios#798

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 emulator 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

Next period due after a 31-day offset Two paid periods

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 DemoClockTest.kt — clamping, presets and the offset applied to a subscription clock
  • updated PaykitPaymentRequestRepoSubscriptionTest.kt — a demo clock offset makes the next billing period due
  • updated PaykitPaymentRequestRepoTest.kt — the repo takes the subscription clock

This branch has not been deployed

No deployments
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