| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(billing): show per-metric charges for past months on the billing page (#7457) ## Problem Past months showed no per-metric charges even though Orb can return costs for a requested period. ## Solution - Add paired `from` and `to` dates to the period-cost endpoint and request the selected month from the billing page. - Accept closed periods only for explicit date ranges, preserving the current-period guard for ended subscriptions. - Report fixed prices separately so totals include base fees without assigning them to usage metrics. Fixes [NAN-6935](https://linear.app/nango/issue/NAN-6935) ## Testing Tested on the local stack against Orb test mode: selecting a past month showed a charge for each usage metric. Tests cover paired and invalid date ranges, closed periods, and subscriptions with only fixed prices. <img width="1264" height="473" alt="image" src="https://github.com/user-attachments/assets/cb213810-2a22-46c7-aa8a-4a44c2a5e34a" /> | 20 天前 | |
fix(billing): stop dropping charges when prices change mid-month (#7470) ## Context `fromOrbPeriodCosts` reads one series of Orb cost buckets and throws the rest away, so a month whose prices changed part-way through is costed from only part of itself. No customer has lost a visible charge over this yet. It would take an immediate change between two paid plans on the same pricing, with usage on both sides of it — the mid-month upgrade path. The prod accounts that do split, like 25153, separate their usage prices from the growth add-on, and the page renders no fixed prices, so the figure on screen is unaffected. Both series also end at the same instant there, so which one the old code keeps is down to Orb's response order. ## Changes - Take the last bucket of every series, not one bucket overall. Each bucket in a series is a running total, so the last one covers that whole stretch. The stretches don't overlap, so adding them up gives the month. - Skip a series whose end date can't be read instead of losing the whole month to it, and report the skip so it isn't silent. Fixes [NAN-6972](https://linear.app/nango/issue/NAN-6972) ## Testing Backend only, so nothing to click in the preview. Ran the patched adapter against 25153's real prod payload: both series land, and the $270 add-on is counted instead of discarded. Tests cover a plan change splitting the month, one metric priced on both sides of it, a fixed price added later, keeping each series' last bucket, and an unreadable end date. | 14 天前 |