Commit Graph

696 Commits

Author SHA1 Message Date
saltbo ddeb49ded6 test(cloud): verify staging license unbind 2026-05-10 01:18:03 -04:00
saltbo d8139b124d fix(cloud): use billing store endpoints 2026-05-10 00:45:50 -04:00
saltbo d9d17e7fcf fix(billing): avoid premature pairing expiry 2026-05-10 00:21:18 -04:00
saltbo b9386e1cd6 fix(cloud): unbind license through cloud first 2026-05-09 23:57:22 -04:00
saltbo 14a0723120 fix(cloud): keep staging e2e licenses isolated 2026-05-09 22:33:50 -04:00
saltbo 46008a139d ci(cloud): serialize tunnel e2e jobs 2026-05-09 22:29:12 -04:00
saltbo a4dbb033bd test(cloud): align pro license host fixtures 2026-05-09 22:22:10 -04:00
saltbo 800cda9f9c test(cloud): add tunnel-backed store e2e 2026-05-09 22:17:52 -04:00
saltbo 02d88b0684 chore(cloud): point local dev at staging 2026-05-09 20:38:06 -04:00
saltbo b6c20d7650 fix(db): wrap multi-write flows in transactions 2026-05-09 20:03:54 -04:00
saltbo 0365e50a31 refactor(store): centralize database write transactions 2026-05-09 19:56:00 -04:00
saltbo 4a22044bff fix(store): use d1 batch for webhook transaction 2026-05-09 19:41:24 -04:00
saltbo b0077fa6f2 test(store): guard d1 webhook path from transactions 2026-05-09 19:35:07 -04:00
saltbo 5830da07c1 fix(store): detect d1 webhook conflicts 2026-05-09 19:17:24 -04:00
saltbo 0c36b73ea5 fix(store): avoid d1 transaction for cloud webhooks 2026-05-09 18:46:33 -04:00
dependabot[bot] f386fd2b4f build(deps): bump hono from 4.12.14 to 4.12.18 (#380)
Bumps [hono](https://github.com/honojs/hono) from 4.12.14 to 4.12.18.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.12.14...v4.12.18)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.12.18
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-09 18:45:46 -04:00
saltbo 7cfe929b06 fix(store): use unified delivery webhook route 2026-05-09 18:33:04 -04:00
saltbo 3363c4e5d5 fix(storage): distinguish product cards 2026-05-09 16:03:47 -04:00
saltbo 0f0ea65cb1 feat(storage): allow metered traffic overage 2026-05-09 15:27:54 -04:00
saltbo 46cacc011c feat(storage): redesign plan catalog 2026-05-09 15:10:48 -04:00
saltbo ae3f368335 feat(billing): configure per-currency metered plan pricing 2026-05-09 13:02:41 -04:00
saltbo 25c4a3c3ac feat(billing): configure traffic overage price on plans 2026-05-09 12:24:10 -04:00
saltbo 88f6e22f72 fix(traffic): sync cloud usage in background 2026-05-09 11:46:26 -04:00
saltbo 1ebc46fac0 feat(store): manage workspace subscription plans 2026-05-09 09:25:39 -04:00
saltbo 0b2e7d40cc feat(store): support subscription and fixed quota packages 2026-05-09 08:28:38 -04:00
saltbo 58d94c3df6 feat(cloud-store): accept opaque store deliveries 2026-05-09 00:07:37 -04:00
saltbo 25416a5f18 feat(quota): support plan and extra entitlement quotas 2026-05-08 23:34:15 -04:00
Jasper Van 3b2a2b03bf test: document metered storage plan flow (#386)
* test: document metered storage plan flow

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* test: align subscription entitlement lifecycle

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-08 21:42:40 -04:00
Jasper Van 52a8dc46a8 feat: clarify storage plans and traffic metering UI (#385)
Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-08 21:05:24 -04:00
Jasper Van ec5d08b233 Report traffic egress to Cloud metering (#384)
* feat(api): report traffic egress to cloud metering

Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98

* test(api): cover cloud traffic redirect reporting

Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98

* test(api): cover cloud traffic failure branches

Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98

* test(api): cover final traffic metering branches

Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98

* test(api): cover cloud metering rollback paths

Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98
2026-05-08 20:31:48 -04:00
Jasper Van bf8a4f5877 feat: add quota entitlements (#383)
Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-08 19:21:34 -04:00
Jasper Van 0b65e2dc15 [v2.6] Integrate zpan with new cloud order flow and complete migration cleanup
fix(store): guard cloud order actions by org
2026-05-08 15:42:05 -04:00
Jasper Van 11ab430493 refactor(quota-store): unify orders and gift cards
* refactor(quota-store): unify orders and gift cards

* test(quota-store): cover helper paths

* test(quota-store): cover webhook idempotency

* test(quota-store): cover cloud response normalization
2026-05-07 09:03:55 -04:00
Jasper Van 9cabe3ccc1 feat: align Storage Plans with combined package model
Update ZPan to treat each Store package as one product that can include both storage quota and download traffic quota.

- replace package resourceType/resourceBytes with storageBytes/trafficBytes in shared schemas and types
- widen package and checkout currency handling to string
- update Cloud proxy parsing for new package response shapes
- redesign admin package form/list and Store package cards around combined quotas
- update API and UI tests for storage-only, traffic-only, and combined package flows
- remove an unreachable duplicate parser branch so Codecov patch coverage stays green

Task: jrfmeahm17rp
2026-05-06 22:48:56 -04:00
Jasper Van be58015ab2 feat(quota-store): support store reversal delivery
Remove the unique constraint on cloud_order_id in quota_delivery_events so
that a same-order reversal event (decrease) can be delivered after the original
purchase event (increase).  A non-unique index replaces the dropped constraint
to preserve query performance.

The resumeDeliveryEvent lookup is tightened to match only by eventId,
cloudRedemptionId, or code — never by cloudOrderId — so different events
for the same order are processed independently.

Add integration tests covering:
- same cloudOrderId increase → decrease both succeed and net to zero
- replaying the same decrease event is idempotent (no double-deduct)
- audit records decrease with action quota_storage_decrease and full metadata
- traffic decrease from same cloudOrderId processes independently

Update the in-memory test schema to match the new index definition.

Closes #v78t1unzz94w


Agent-Profile: https://agent-kanban.dev/agents/f68cfbce6456edb5

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 19:01:24 -04:00
Jasper Van 9908953252 fix: drop local quota store package table
Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-06 17:50:34 -04:00
Jasper Van bf0bf99ef4 feat: separate storage code revoke and delete
* feat(quota-store): separate revoke and delete semantics for redemption codes

- PATCH /api/admin/quota-store/storage-codes/:code accepts { revokedAt } to
  revoke a code (keeps it visible, prevents future redemptions)
- DELETE /api/admin/quota-store/storage-codes/:code removes eligible codes
- Added revokeStorageCodeSchema (shared) with zValidator on PATCH route
- Fixed revokeStorageRedemptionCode API fn to use PATCH with revokedAt payload
- Added deleteStorageRedemptionCode API fn using DELETE
- UI: separate Revoke and Delete buttons per code row with distinct disabled rules
  - Revoke disabled when already revoked or fully redeemed
  - Delete disabled when any redemptions exist (usesCount > 0)
- Updated confirmation copy to describe product outcome, not technical action
- i18n: added delete keys in en.json and zh.json; updated revokeConfirm copy
- Updated integration, unit, and component tests

Agent-Profile: https://agent-kanban.dev/agents/f68cfbce6456edb5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: align storage code revoke contract

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:08:41 -04:00
Jasper Van df2e2a8cd3 feat: manage Cloud storage packages
Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98
2026-05-06 16:46:10 -04:00
Jasper Van a4f9e3ff6a refactor: proxy quota store through cloud
Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98
2026-05-06 16:16:20 -04:00
Jasper Van da62c9e6c2 fix: enforce monthly traffic on download URL issuance
* fix: enforce download traffic quota before presign

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* fix: prevent cached metered image redirects

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-06 14:24:45 -04:00
Jasper Van 3a88c17d6e feat: add monthly traffic quotas
Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-06 13:41:20 -04:00
saltbo dfc8c708d5 docs: switch license to AGPLv3 2026-05-06 12:41:02 -04:00
saltbo ec832b0dfd feat(storage): refine storage plan experience 2026-05-06 10:58:06 -04:00
Jasper Van 2363ca1a6c feat: manage quota store redemption codes
Adds ZPan admin quota-store APIs and UI for Cloud-bound storage redemption code management, refactors the admin quota-store page into tabs, and polishes the user store page.
2026-05-06 03:00:57 -04:00
Jasper Van 5632cbbc83 fix: use pro binding auth for quota store (#367)
* fix: use pro binding auth for quota store

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* fix: align quota store event token audience

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* fix: match cloud delivery event audience contract

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-06 00:29:48 -04:00
Jasper Van 8f6e4c2ff3 Fix quota store Cloud binding contract (#366)
* fix(quota-store): use Pro binding for Cloud store auth

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* fix(quota-store): align Cloud store binding contract

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-05 22:32:40 -04:00
Jasper Van 05b14a4991 docs: verify pro quota store release notes (#364)
Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98
2026-05-05 17:13:54 -04:00
Jasper Van 5eac0f4642 feat(branding): add pro theme settings (#362)
Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98
2026-05-05 17:01:48 -04:00
Jasper Van 8a185c4cd4 feat: add quota store UI (#363)
Agent-Profile: https://agent-kanban.dev/agents/a318237412dd8b98
2026-05-05 16:40:54 -04:00
Jasper Van 41877d384f feat: add quota store backend (#361)
* feat: add quota store backend

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* test: cover quota store cloud responses

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* test: cover quota store edge cases

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5

* fix: align quota store cloud contract

Agent-Profile: https://agent-kanban.dev/agents/1dc839c09b5ee5e5
2026-05-05 12:01:29 -04:00