Watch
1
0
Fork
You've already forked arc
0
forked from hesabix/arc
arc/hesabixAPI/adapters/api/v1/admin
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Motamed ASA fa730b6ab0 feat(tax): add Motamed ASA as a tax submission provider
«معتمد آسا» becomes a third, optional sending method beside «ارسال مستقیم»
and «همراه فن‌آوا». It follows the Fanava provider pattern and reuses
tax_provider_credentials, business_tax_provider_accounts and
tax_settings.submission_provider: no new table and no migration. Direct and
Fanava behaviour is unchanged; the default stays moadian_direct.

Connection (informed consent):
- The tax settings page shows what is shared with Motamed ASA and why, with
  links to its terms and to https://asatsp.ir/privacy#partner-software, and
  asks for explicit consent; consent user and time are stored as for Fanava.
- The owner signs up on Motamed ASA's own page (tax-system one-time code);
  Hesabix collects no identity documents. The business API key is handed to
  Hesabix once, after the owner agrees there; a business that already has an
  ASA API v2 key can enter its client id/secret instead.
- The business private key and memory id are not needed: the trusted
  company signs and sends.

Sending (ASA TSP API v2, https://api-v2.asatsp.ir):
- original: POST /api/invoice/send with a stable internalId per document;
  a rejected or unsent invoice is edited in place (editInvoice);
- correction: editInvoice with confirmCorrection;
- cancellation: cancelInvoice; marked cancelled only once accepted;
- sales return: ins=4 whose Body is the rows remaining after the return
  (RC_IITP.IS_V7.9 table 1), read from the chain's accepted invoice;
- timeouts are reconciled by internalId and never re-sent blindly;
- ASA issues the tax id; Hesabix stores it from the answer.

Inquiry and the tax workspace:
- inquire_tax_status, the auto-inquiry loop and the workspace health check
  read Motamed ASA invoices from ASA (inquiryInternalIds).
- The کارپوشه status (buyer reaction) and the Article 6 status (عدول /
  عدم عدول) of the document's own invoice are kept and shown as two new
  workspace columns (tax_workspace_status, tax_article6_status). A buyer
  rejection is shown there and no longer marks a registered invoice failed.
- «پرداخت‌ها و ثبت در کارپوشه» on a sent Motamed ASA invoice opens its
  payment table: every row with its registration status, and new rows
  (method, date/time, amount with VAT, trace and terminal numbers)
  registered through ASA's registerPayment; locked rows stay read-only and a
  lost answer reads the rows back instead of sending them again.

Admin: «اتصال معتمد آسا» under system settings › external services holds
the partner client id/secret Motamed ASA issues for Hesabix.

Tests: tests/test_motamed_asa_{client,invoice_payload,provider_service}.py

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 02:01:02 +03:00
..
activity_logs_admin.py progress in basalam and woc bridge 2026-05-14 01:30:20 +03:30
ai_eval.py progress in chat ai agent and some bug fix in shamsi calndar 2026-05-26 14:03:49 +00:00
ai_models.py add reasoning to ai 2026-06-19 18:35:25 +00:00
ai_plans.py add calendar and note taking 2026-04-15 17:33:30 +00:00
ai_prompts.py progress in ai 2026-06-13 23:49:34 +00:00
ai_provider_credentials.py add multi agent in ai and fast sell notification 2026-06-13 20:35:02 +00:00
ai_settings.py some stability in ai 2026-08-21 14:14:21 +00:00
ai_skills.py add skill to ai 2026-06-14 00:37:58 +00:00
ai_voice_models.py bug fix in ai url sound customizer 2026-08-18 18:00:11 +00:00
announcements.py change file permissions 2026-04-14 19:34:55 +03:30
businesses_admin.py change file permissions 2026-04-14 19:34:55 +03:30
currencies.py bug fix in local deployment 2026-04-25 02:31:13 +03:30
document_monetization.py change file permissions 2026-04-14 19:34:55 +03:30
email_config.py change file permissions 2026-04-14 19:34:55 +03:30
file_storage.py add calendar and note taking 2026-04-15 17:33:30 +00:00
firewall.py add crm webchat 2026-04-26 02:08:31 +00:00
fx_providers.py some improve in multi currency 2026-07-25 20:39:16 +00:00
hscript_admin.py first realease of HScript 2026-07-20 22:08:49 +00:00
legacy_import.py improve last latency improve 2026-05-31 11:00:18 +00:00
marketplace.py progress in basalam and woc bridge 2026-05-14 01:30:20 +03:30
monitoring.py security bug fix in notifications 2026-04-22 17:07:52 +00:00
notification_event_types.py bug fix in ai 2026-06-13 22:34:36 +00:00
notification_moderation.py change file permissions 2026-04-14 19:34:55 +03:30
notification_templates.py change file permissions 2026-04-14 19:34:55 +03:30
payment_gateways.py bug fix in parsian payway 2026-08-16 15:42:15 +00:00
scripts.py change file permissions 2026-04-14 19:34:55 +03:30
storage_plans.py change file permissions 2026-04-14 19:34:55 +03:30
support_billing.py add paid support ticket. and change loading screen 2026-07-21 11:51:28 +00:00
system_services.py android development forces 2026-08-09 03:23:51 +03:30
system_settings.py some progress and bug fix 2026-10-16 21:37:05 +03:30
tax_providers.py feat(tax): add Motamed ASA as a tax submission provider 2026-10-20 02:01:02 +03:00
users_permissions.py change file permissions 2026-04-14 19:34:55 +03:30
wallet_admin.py some bug fixes 2026-05-18 16:50:15 +00:00
zohal.py change file permissions 2026-04-14 19:34:55 +03:30