Simpl-Resultat/src/hooks
le king fu 7d667f7ca3
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 1m40s
PR Check — Rust / rust (pull_request) Successful in 8m52s
fix(license): call /v1 routes with product, name server refusals, localize purchase URL
- Activation, deactivation and verify POST to /v1/licenses/* with
  "product":"simpl-resultat" instead of the legacy /licenses/* paths,
  which cost a 308 on every call.
- New LicenseError enum, serialized as {code} like FetchPriceError and
  read from error.code of the /v1 envelope. A 200 {valid:false} from
  verify is now a coded refusal instead of an empty machine list, and an
  HTML error page on a non-2xx maps to server instead of
  invalid_response. Deactivation is idempotent: no_active_activation
  counts as done.
- The three calls live in *_inner functions without AppHandle, tested
  against a mockito server that only declares the /v1 routes.
- useLicenseMachines hook with an exported reducer. The activation error
  survives the list load it triggers (machine_limit_reached opens the
  list), a deactivation removes the machine locally without re-running
  verify (4 requests on the machine-limit path, under the server's
  5/min/IP limit), and refresh() follows every successful activation or
  deactivation.
- license.errors.* in FR and EN; purchaseUrl() opens
  /{fr|en}/produits/simpl-resultat.

test: reproduces #270. Each original defect, reintroduced on the final
tree, turns tests red: legacy activate path 5, missing product 2,
envelope read as a string 3, verify valid:false as an empty list 2,
strict body parse on a non-2xx 2, untrimmed key 1, list load clearing
the activation error 4, verify re-run after deactivation 2, empty state
despite a list error 1, no refresh after activation 3, old purchase
URL 4.

Fixes #270

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:15:52 -04:00
..
useAdjustments.ts feat: add Budget and Adjustments pages with full functionality 2026-02-12 00:58:43 +00:00
useAuth.ts feat: Maximus Account OAuth2 PKCE + machine activation + subscription check (#51, #53) 2026-04-10 14:18:51 -04:00
useBalanceAccounts.ts feat(balance): account form vehicle field + category rename via custom_label (#203) 2026-06-01 20:50:40 -04:00
useBalanceOverview.test.ts feat(balance): add useBalanceOverview hook 2026-04-25 16:06:38 -04:00
useBalanceOverview.ts feat(balance): per-security drill-down + latent gain in accounts table (#216) 2026-06-06 13:49:57 -04:00
useBudget.test.ts feat(budget): adopt multi-level collapse on the Budget grid 2026-07-15 21:16:01 -04:00
useBudget.ts feat(budget): adopt multi-level collapse on the Budget grid 2026-07-15 21:16:01 -04:00
useCartes.test.ts feat(reports/cartes): Mensuel/YTD toggle on KPI cards + user guide section (#102) 2026-04-19 09:49:21 -04:00
useCartes.ts feat(reports/cartes): Mensuel/YTD toggle on KPI cards + user guide section (#102) 2026-04-19 09:49:21 -04:00
useCategories.ts feat: add 3rd level of category hierarchy 2026-02-25 19:54:05 -05:00
useCategoryMigration.test.ts feat(categories): merge custom categories into the standard taxonomy (#259) 2026-07-19 19:43:47 +00:00
useCategoryMigration.ts feat(categories): merge custom categories into the standard taxonomy (#259) 2026-07-19 19:43:47 +00:00
useCategoryTaxonomy.ts feat(categories): add categoryTaxonomyService + useCategoryTaxonomy hook (#116) 2026-04-20 20:53:15 -04:00
useCategoryZoom.ts feat: category zoom + secure AddKeywordDialog with context menu (#74) 2026-04-14 15:09:17 -04:00
useCollapsibleGroups.ts feat(reports): collapse category hierarchy at every level (socle + 3 reports) 2026-07-15 20:58:18 -04:00
useCompare.test.ts fix(reports): StrictMode-safe period sync + review polish (#253) 2026-07-05 19:37:22 -04:00
useCompare.ts feat(reports): adopt shared FilterPanel on Compare and Budget 2026-07-11 15:52:21 -04:00
useDashboard.ts feat(dashboard): converge home page on the Cartes report model 2026-07-11 17:13:23 -04:00
useDataExport.ts fix(export): preserve import sources and templates across data export/import 2026-08-14 10:58:52 -04:00
useDataImport.ts fix(export): preserve import sources and templates across data export/import 2026-08-14 10:58:52 -04:00
useEntitlement.ts feat(gating): license provider + entitlements matrix + useEntitlement (#297) 2026-07-19 21:05:10 -04:00
useFeedback.test.ts feat: feedback hub widget in Settings Logs card (#67) 2026-04-17 14:36:26 +00:00
useFeedback.ts feat: feedback hub widget in Settings Logs card (#67) 2026-04-17 14:36:26 +00:00
useHighlights.test.ts feat(reports/highlights): default reference month to previous month + YTD current year, user-changeable (#106) 2026-04-19 08:28:30 -04:00
useHighlights.ts feat(reports/highlights): default reference month to previous month + YTD current year, user-changeable (#106) 2026-04-19 08:28:30 -04:00
useImportHistory.ts feat: 12-month budget grid, import UX improvements, confirmation dialogs (v0.2.4) 2026-02-14 12:59:11 +00:00
useImportWizard.ts feat(import): recognise known bank layouts and report format drift 2026-08-13 14:54:46 -04:00
useIsPremium.test.ts fix(gating): keep key-validation errors out of the load lifecycle (#297) 2026-07-20 21:21:18 -04:00
useIsPremium.ts feat(gating): license provider + entitlements matrix + useEntitlement (#297) 2026-07-19 21:05:10 -04:00
useLicenseMachines.test.ts fix(license): call /v1 routes with product, name server refusals, localize purchase URL 2026-09-26 09:15:52 -04:00
useLicenseMachines.ts fix(license): call /v1 routes with product, name server refusals, localize purchase URL 2026-09-26 09:15:52 -04:00
useReportsPeriod.test.ts feat(reports): extend useReportsPeriod with account filter foundation 2026-07-11 15:01:43 -04:00
useReportsPeriod.ts feat(reports): extend useReportsPeriod with account filter foundation 2026-07-11 15:01:43 -04:00
useSnapshotEditor.test.ts feat(balance): CSV import of holdings in detailed snapshot 2026-07-04 18:04:12 -04:00
useSnapshotEditor.ts fix(import): read amounts with an anchored parser and a real debit/credit rule 2026-08-13 13:37:06 -04:00
useTheme.ts feat: add dark mode with famille-website-inspired warm gray palette 2026-02-13 12:28:11 +00:00
useTransactions.ts feat: add transaction split adjustments across multiple categories 2026-02-16 23:51:36 +00:00
useTrends.ts feat(reports): adopt shared FilterPanel on the Trends page 2026-07-11 15:41:13 -04:00
useUpdater.ts feat: gate auto-updates behind license entitlement (#48) 2026-04-09 15:52:59 -04:00