docs + AGENTS: no-implementation rule, issue-driven workflow, Vico, Uncategorized, ClearAllData, AddEditRecurringScreen

- AGENTS.md: add No-implementation rule and Issue-driven workflow section
- docs/01: rename default fallback category from 'Other' to 'Uncategorized'
- docs/02, 03: update 'Other' references to 'Uncategorized' in delete/seed/default flows
- docs/04: replace Canvas charts with Vico 2.x dep, add data feature folder, add AddEditRecurringScreen, document tab-aware FAB and shared ExportAction helper
This commit is contained in:
2026-06-28 15:47:28 +07:00
parent 3e30423083
commit 51c54749cb
5 changed files with 105 additions and 27 deletions
+11 -2
View File
@@ -85,11 +85,11 @@ Insert if `id == 0`, update otherwise. Returns the id. Does not allow changing `
### `await(id: Long)`
1. Guard: fetch category by id. If `isDefault = true`, throw `IllegalArgumentException("Cannot delete a default category")`.
2. Find the fallback: call `getCategories.awaitDefault()` to get the "Other" category id.
2. Find the fallback: call `getCategories.awaitDefault()` to get the "Uncategorized" category id.
3. Call `reassignExpenseCategory.await(id, fallbackId)` to move orphaned expenses.
4. Delete the category from the DB.
Steps 3 and 4 run sequentially in the interactor (not a DB transaction). If step 4 fails, expenses are already reassigned to Other — acceptable, retry is safe.
Steps 3 and 4 run sequentially in the interactor (not a DB transaction). If step 4 fails, expenses are already reassigned to Uncategorized — acceptable, retry is safe.
---
@@ -172,3 +172,12 @@ Contract for all implementations:
6. For each expense: `date` in ISO 8601 (`yyyy-MM-dd`), then `category.name`, `amount`, `"note"` (double-quote the note to handle embedded commas).
7. Close sink.
8. Return `Result.success(Unit)` or `Result.failure(exception)`.
---
## data / ClearAllData
### `await()`
1. Call `database.clearAllTables()` (Room built-in) inside a `withTransaction { }` block on the database's executor.
2. No-op guard: this is destructive — the caller (`SettingsScreen` `AlertDialogPreference`) is responsible for showing a confirmation dialog before invoking.
3. After clearing, `SeedDefaultCategories` should be re-run so the app retains the 8 default categories. The `SettingsScreen` ScreenModel calls `inject<SeedDefaultCategories>().await()` after `ClearAllData.await()` returns successfully.