Repository navigation
feat: payment history, price changes over time and actual spending - #6
Merged
Merged
Conversation
Past charges are derived from the billing schedule and a per-subscription price history; any charge can be confirmed with the amount actually paid or marked as not charged. - js/core/history.js: priceAt, charges, summary, monthly buckets, withPrice and skippedWhilePaused (pure, covered by tests) - db.sanitize validates priceHistory, charges and pausedAt; legacy records get a single-entry history, so no schema migration is needed - Editing the price asks whether it applies from the next renewal, from the last charge or to the whole history - Pausing records pausedAt; resuming marks the renewals in between as not charged - History sheet from the edit form, per-charge editor, and an "Actual spending" card with last 12 months, year to date and a monthly chart - Upcoming cards, list and reminders use the price in force at the next renewal - Undo after delete restores the latest stored copy (with confirmations) Also fixes horizontal overflow on narrow phones: form grids use minmax(0, 1fr) and the frequency selector wraps to 2x2 under 420px. Bumps the version to 1.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0127iNTyhnYEypEm4cd97XPA
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a payment history so the app tracks what was actually paid, not only the projected monthly cost.
A. Calculated history. Past charges are derived from each subscription's start date, frequency and a new price history. A price applies to charges on or after its date, so a price increase no longer rewrites the past.
B. Manual corrections. Any past charge can be confirmed with the amount actually paid, or marked as not charged. Either can be reset to the automatic value.
Changes
js/core/history.js(new, pure and tested):priceAt,charges,summary,monthly(12-month buckets per currency),withPriceandskippedWhilePaused.db.sanitizevalidates the new optional fieldspriceHistory,chargesandpausedAt, including in imported backups. Older records get a single-entry history, so no IndexedDB schema migration is needed.pausedAt, and resuming marks the renewals in between as not charged.aria-label.Also fixed
minmax(0, 1fr), and the frequency selector wraps to a 2×2 grid under 420 px.Bumps
ST.VERSIONto 1.1.0, and updates the CHANGELOG and both READMEs.Known limitation
Subscriptions paused before this version have no
pausedAt, so their history keeps counting charges. Users can mark those charges as not charged by hand.Type of change
Checklist
npm testpasses (25 tests; 8 new ones intests/history.test.jscover month-end dates, price changes, overrides, pause/resume, monthly buckets and sanitising malformed input)js/core/i18n.jsST.VERSIONbumped if cached assets changed (sw.js→ASSETS, which now includesjs/core/history.js)🤖 Generated with Claude Code
https://claude.ai/code/session_0127iNTyhnYEypEm4cd97XPA
Generated by Claude Code