forked from hesabix/arc
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Hesabix asked for a sandbox. Motamed ASA's API v2 has no separate sandbox
host: the same base URL, token and client credentials are used, and each
/send member says where it goes with sandBox (API v2 docs, section 05F).
No new table, column or migration; Direct and Fanava are unchanged.
- With tax_settings.sandbox_mode on, every /api/invoice/send member
(original, return) carries sandBox: true and no fiscalId: ASA accepts it
only with the business's Sandbox fiscal memory (its default, or the only
active one) and sends it to the tax organisation's sandbox. The memory id
issued at sign-up is a production one. In production mode the member
carries sandBox: false and that memory id, as before.
- editInvoice, cancelInvoice and registerPayment take no sandBox: an invoice
keeps the environment it was registered in (docs 08D). Each document
records its environment in extra_info.asa_sandbox (chains sent before this
change are production), and a sandbox chain has its own internalId
(hesabix-sandbox-{id}), as ASA keeps internalIds unique per business across
both environments.
- Changing the setting never moves an invoice. Before the document is marked
as being sent, a correction or cancellation of an invoice from the other
environment is refused (MOTAMED_ASA_ENVIRONMENT_MISMATCH); an original or
return whose chain there is unknown to ASA or was refused starts again in
the current environment, one registered or in flight is refused. Payment
registration follows the same rule; reading payments and inquiries work in
either mode, each chain by its stored internalId. A return must refer to a
sale of its own environment (MOTAMED_ASA_REFERENCE_OTHER_ENVIRONMENT).
- The MOTAMED_ASA_SANDBOX_UNAVAILABLE guards are removed (settings save,
provider selection, manual credentials, sending); Fanava's stay.
- Tax settings: Motamed ASA stays selectable in sandbox mode, and a note says
where invoices go and that the business's Sandbox fiscal memory must be
registered with Motamed ASA. motamedAsaSandboxNote replaces the now unused
motamedAsaSandboxUnavailable (ARB and generated files).
Tests: tests/test_motamed_asa_sandbox.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
| .. | ||
| core | ||
| integrations | ||
| services | ||
| utils | ||
| workers | ||
| __init__.py | ||
| main.py | ||
| openapi_list_query_patch.py | ||
| openapi_local_docs.py | ||
| openapi_query_filter_docs.py | ||