- New balance_adjustments table with CRUD store, sync logging, and service methods
- SQL migrations restructured: embed fs.FS from internal/store/migrations/, apply in order via user_version
- WeekService.Balance combines closed-weeks delta + adjustments delta; BalanceSummary breakdown
- Four REST routes: GET/POST /api/balance/adjustments, PUT/DELETE /api/balance/adjustments/{id}
- Dexie schema v2 + sync apply cases for balance_adjustments
- API client: BalanceAdjustment type, balance namespace (list/create/update/delete)
- utils: composeDeltaMs / decomposeDeltaMs helpers + 8 new Vitest tests (19 total, all passing)
- History page: balance card breakdown line + full adjustments section with inline add/edit/delete
15 lines
465 B
SQL
15 lines
465 B
SQL
-- +migrate Up
|
|
CREATE TABLE balance_adjustments (
|
|
id TEXT PRIMARY KEY,
|
|
delta_ms INTEGER NOT NULL,
|
|
note TEXT NOT NULL DEFAULT '',
|
|
effective_at INTEGER NOT NULL,
|
|
created_at INTEGER NOT NULL,
|
|
updated_at INTEGER NOT NULL
|
|
);
|
|
CREATE INDEX idx_balance_adjustments_effective_at ON balance_adjustments(effective_at);
|
|
|
|
-- +migrate Down
|
|
DROP INDEX IF EXISTS idx_balance_adjustments_effective_at;
|
|
DROP TABLE IF EXISTS balance_adjustments;
|