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
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>
* 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>
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.