Go to file
Ali 2b9fba7dd7 Fetch e-taxes data after Asan auth, cache for wizard, materialize on finalize
Two-phase data loading so future wizard steps can consume tax-portal data before
Company exists, while still ending up with properly-linked E-Taxes DocType records.

Phase A (Asan step, after main_token):
- jey_wizard.etaxes.fetch_all_etaxes hits 6 endpoints (objects, cash registers,
  POS terminals, bank accounts, obligation pacts, presented certs), using
  invoice_az's Asan Login for the main_token. Paginated endpoints follow hasMore.
- Raw JSON per endpoint is stashed in the new single DocType
  "Jey Wizard Etaxes Cache". Per-endpoint errors are logged but don't abort.
- jey_wizard.etaxes.get_cached(kind) is the read API for future wizard steps.
- UI: new "fetching" sub-state between cert pick and done. "done" now shows a
  count summary of what was cached (or per-row error badge if a kind failed).

Phase B (setup_wizard_complete hook, after Company is created):
- jey_wizard.etaxes.materialize_after_setup receives setup args, reads
  args.company_name, and calls invoice_az.company_api.load_company_* for each
  of the six kinds. Those re-fetch and write into E-Taxes Object /
  E-Taxes Cash Register / etc with the real Company link. Each loader is
  best-effort; failures are logged, not raised.

Why re-fetch instead of materialising from the cache:
- invoice_az's loaders already own the ~500-line field mapping. Re-fetching
  once with a still-fresh main_token beats duplicating that code.

Bump to 0.0.6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 15:36:02 +00:00
jey_wizard Fetch e-taxes data after Asan auth, cache for wizard, materialize on finalize 2026-04-22 15:36:02 +00:00
.editorconfig feat: Initialize App 2026-04-22 10:00:16 +00:00
.eslintrc feat: Initialize App 2026-04-22 10:00:16 +00:00
.gitignore feat: Initialize App 2026-04-22 10:00:16 +00:00
.pre-commit-config.yaml feat: Initialize App 2026-04-22 10:00:16 +00:00
README.md feat: Initialize App 2026-04-22 10:00:16 +00:00
license.txt feat: Initialize App 2026-04-22 10:00:16 +00:00
pyproject.toml feat: Initialize App 2026-04-22 10:00:16 +00:00

README.md

Jey Wizard

Jey Wizard

Installation

You can install this app using the bench CLI:

cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch main
bench install-app jey_wizard

Contributing

This app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:

cd apps/jey_wizard
pre-commit install

Pre-commit is configured to use the following tools for checking and formatting your code:

  • ruff
  • eslint
  • prettier
  • pyupgrade

License

unlicense