Version 2.0

This commit is contained in:
2026-05-12 09:23:05 +00:00
parent f2bc048219
commit f1b68e5e78
34 changed files with 564 additions and 283 deletions

View File

@@ -9,6 +9,7 @@
- **SOP Phase 1-8:** 100% hoàn thành
- **AI Instructions Core:** 85% (6/7, còn auto-suggest transfer)
- **V2 Restructure:** 100% hoàn thành (Contract category, bỏ pivot, đại diện)
- **Test:** Pest 8/8 tests (21 assertions) pass
- **Data import:** 3658 rows từ `ai_instructions/CSKH.xlsx` imported successfully
- **Dual Panel:** Admin (đầy đủ) + Support (rút gọn, tập trung feedback)
@@ -146,6 +147,20 @@
- [x] Resources trong Support: Feedback, Customer, Product, FeedbackChannel, FeedbackTag, ActivityLog
- [x] Widgets: ResolvedTicketsWidget, AvgProcessingTimeWidget, HandlerPerformanceWidget
### V2: Contract Restructure — Category + Representative + Bỏ Pivot
- [x] Migration: thêm `category` (ownership/business), `representative_*` vào contracts, xóa `customer_product`
- [x] Enum: `ContractCategory` (ownership, business) + cập nhật `ContractType` (deposit, purchase, transfer, rental, self_business, bcc)
- [x] Model: Contract (+category, +representative), Customer (ownedProducts qua contracts), Feedback (-customer_product_id)
- [x] Xóa `CustomerProduct` model/pivot
- [x] Validation: ràng buộc 1 active/category/product (CreateContract/EditContract)
- [x] FeedbackForm: filter mới (Customer → Product qua Contract ownership + đại diện), case-insensitive search
- [x] ContractForm: select category → dynamic type options, representative form section
- [x] FeedbackTable: `contract.product.name` thay `customerProduct.product.name`
- [x] Seeder: 6 contracts V2 (ownership+business, có representative), feedback no customer_product_id
- [x] ImportCskh: cập nhật pipeline, không còn customer_product
- [x] i18n: vi/en cho category, type mới, representative, validation
- [x] Tests: 8/8 pass (21 assertions)
### ActivityLog — Audit Trail
- [x] Migration `activity_logs`: user_id, action, description, subject_type/id, metadata
- [x] Model `ActivityLog` + Service `ActivityLogger` (static log method)