forked from hesabix/arc
3.2 KiB
3.2 KiB
غنیسازی Functionهای AI — وضعیت پیادهسازی
فاز ۰ — زیرساخت permission
app/services/ai/ai_permission_map.py: نگاشتpersons.write→people.addو سایر aliasهاfunction_registry.py: استفاده ازhas_any_ai_tool_permissionدر فیلتر و اجراai_tool_intent.py: کلیدواژه «اضافه»، دستهpeople، سقف tools → ۴۸
فاز ۱ — query گسترده
- Entityهای جدید:
category,person_group,currency,product_attribute - Tool:
batch_query_business_data(حداکثر ۸ پرسوجو)
فاز ۲ — گزارش و read اختصاصی
- Tool:
get_report(sales_by_product, item_movements, debtors, creditors, cash_flow, inventory_valuation, sales) - Tools:
search_categories,list_person_groups,list_currencies
فاز ۳ — write
delete_person,create_product,update_product,create_check,create_transfer- همه با
requires_approval=True
فاز ۴ — batch/report/write تکمیلی
batch_query_business_data,get_report, read tools- write:
delete_person,create_product,update_product,create_check,create_transfer
فاز ۵ — write/CRM/workflow/export
create_expense_income— سند هزینه/درآمد ساده (expenses_income.write)update_invoice,delete_invoice— (invoices.write)create_lead— CRM (crm.write→crm.add/crm.edit)execute_workflow— (workflows.write)export_business_data— Excel/PDF باcontent_base64(reports.read)- سرویس همگام:
app/services/ai/ai_export_service.py(بدون وابستگی به routeهای async)
آمار تقریبی
| مورد | قبل | بعد |
|---|---|---|
| Tools | ~۸۰ | ~۹۷ (+۱۷ از فاز ۴–۵) |
Entities query_business_data |
۲۲ | ۲۶ |
| Write tools (با تأیید) | ۴ | ۱۶ |
فاز ۶ — گزارشات (اجرایی)
ai_reports_catalog.py+ai_reports_service.pylist_available_reports— کاتالوگ گزارشهای مجاز کاربرget_report— ~۳۵report_type(تراز، دفتر کل، انبار، باسلام، …)- جزئیات:
AI_EXECUTION_PHASES.md
فاز ۷ — قالب اسناد (اجرایی MVP)
list_report_templates,get_report_template,get_report_template_scope_catalogset_default_report_template,publish_report_template(با تأیید)
فاز ۸ — افزونه / باشگاه / باسلام (اجرایی MVP)
list_marketplace_plugins,list_business_pluginsget_basalam_overview,list_basalam_dead_letteradjust_customer_club_points,recalculate_customer_club_rfm,update_customer_club_settings
آمار بهروز
| مورد | مقدار |
|---|---|
| Tools | ~۱۱۲ |
انواع get_report |
۳۵ |
| Write با تأیید | ~۲۲ |
فاز ۹ (برنامه — اجرا نشده)
- خرید/trial افزونه، sync باسلام، ساخت قالب از چت
- UI دانلود
content_base64در Flutter
باقیمانده (اختیاری)
- export چکها، حواله انبار write،
update_dealCRM