6 Commits

Author SHA1 Message Date
3cd161d83c feat: add equipment management with QR codes and transfers
Stage 5 (Inventory) implementation:
- Add EquipmentTransferLog model for tracking equipment movements
- Add EquipmentViewSet actions:
  - transfer: move equipment between departments/users
  - write_off: decommission equipment
  - add_maintenance: record maintenance activities
  - qr_code: generate QR code for equipment
  - transfer_history: view equipment transfer history
- Use existing QRCodeGenerator and InventoryNumberGenerator services
- Fix EquipmentStatus constants usage (IN_USE, RETIRED)
- Add 14 new tests for inventory functionality

Test results: 66/66 PASSED
- 20/20 Model tests
- 12/12 API tests
- 9/9 Workflow tests
- 11/11 Budget tests
- 14/14 Inventory tests (NEW)
2025-12-09 10:42:07 +03:00
3c6eeb93dd docs: Update implementation plan - Stage 4 complete (100%)
Updated status:
- Stage 4 (Budgets): 100% complete
- Total tests: 52/52 PASSED (11 new budget tests)
- Version: 1.1 → 1.2

New features documented:
- reserved_amount, available_amount properties
- /budgets/my-department/ endpoint
- /stats/overview/ and /stats/by-department/ endpoints
- Budget alerts at 20% and 10% thresholds

Ready for Stage 5: Inventory Management
2025-12-09 10:21:01 +03:00
f9cd94983b docs: Update implementation plan - Stages 1-3 complete (100%)
Updated PROCUREMENT_IMPLEMENTATION_PLAN.md with:
- Stage 3 status: 95% → 100% (all 9 workflow tests passing)
- New section: Test Results Summary (41/41 PASSED)
- List of all fixes applied during testing phase
- Technical infrastructure notes (git cleanup, test settings)
- Updated next steps and completion timeline
- Document version: 1.0 → 1.1

Test statistics:
✅ 41/41 PASSED (100%)
  ├─ 20/20 Model tests
  ├─ 12/12 API tests
  └─ 9/9 Workflow tests

Key fixes documented:
- headed_departments related_name fix
- items_count annotate conflict resolution
- InMemoryChannelLayer test infrastructure
- Serializer field additions (purchase_cost, requestor)
- Finance manager lookup with permissions
- Budget fixtures update (2025 Q4)
- Queryset extension for approvers (critical fix)

Ready to proceed with Stage 4: Budget Control
2025-12-09 10:02:08 +03:00
18310de0fd docs(procurement): update implementation plan with Stage 1-3 completion
- Mark Stage 1 (Models) as 100% complete - 20/20 tests passing
- Mark Stage 2 (API) as 95% complete - 12/12 tests passing
- Mark Stage 3 (Workflow) as 95% complete - 9/9 tests passing
- Note 2 remaining tests with 404 on /approve/ endpoint
- Update technology stack with NotificationService decision
- Add architectural rationale for choosing NotificationService over Celery
2025-12-09 09:51:17 +03:00
d6e7e4ae08 refactor(procurement): replace Celery with NotificationService
BREAKING CHANGE: Removed Celery tasks in favor of existing notification system

Changes:
- ❌ Deleted tasks.py (261 lines) - Celery tasks removed
- ✅ Updated views.py - replaced .delay() calls with NotificationService
- ✅ Updated README.md - documented NotificationService integration
- ✅ Updated PROCUREMENT_IMPLEMENTATION_PLAN.md - architectural decision

Architecture Decision:
- Use NotificationService instead of Celery for notifications
- Supports Web (WebSocket), Email (HTML), Telegram channels
- Simpler deployment (no worker processes needed)
- Sufficient for 50-200 employees, <10 requests/day
- 0.5-2s email delay is acceptable for rare operations

Benefits:
- -2 production processes (no celery worker/beat)
- Easier debugging (sync execution, same logs)
- Already tested and used across all modules
- No DevOps overhead

Net result: -164 lines of code, simpler architecture
2025-12-09 09:19:58 +03:00
9733c6c15c docs: add comprehensive implementation plan for Procurement module
Created detailed documentation covering:
- 8 data models with relationships and fields
- Complete API endpoints specification (30+ endpoints)
- Permission matrix and access control
- Approval workflow state machine
- UI/UX mockups for all pages
- 8-stage implementation roadmap (1-2 months)
- Technology stack decisions
- Risk assessment and mitigation strategies
- Complete checklist for tracking progress

Key Features:
- Procurement request creation and approval workflow
- Multi-level approval based on cost thresholds
- Budget control per department/quarter
- Equipment/inventory management with QR codes
- Maintenance tracking and history
- Supplier management
- Real-time notifications and WebSocket updates
- Export to PDF/Excel reports

Ready to start Stage 1: Basic Structure
2025-12-08 15:12:25 +03:00