9.9 KiB
9.9 KiB
Narasi Ahli Implementation Checklist
Database Schema Implementation
✅ Phase 1A: Update Users Entity
- Modify
app/database/entity/users/users.entity.go- Add
Degreefield - Add
WhatsappNumberfield - Add
LastJobTitlefield
- Add
✅ Phase 1B: Create New Entities
Education History Entity
- Create
app/database/entity/education_history.entity.go - Fields: ID, UserID, SchoolName, Major, EducationLevel, GraduationYear, CertificateImage
Work History Entity
- Create
app/database/entity/work_history.entity.go - Fields: ID, UserID, JobTitle, CompanyName, StartDate, EndDate
Research Journals Entity
- Create
app/database/entity/research_journals.entity.go - Fields: ID, UserID, JournalTitle, Publisher, JournalURL, PublishedDate
Communication Entities
- Create
app/database/entity/conversations.entity.go - Create
app/database/entity/chat_messages.entity.go - Support for text, image, file, audio message types
AI Chat Entities
- Create
app/database/entity/ai_chat_sessions.entity.go - Create
app/database/entity/ai_chat_messages.entity.go - Create
app/database/entity/ai_chat_logs.entity.go
Module Implementation
✅ Phase 2A: Education History Module (app/module/education_history/)
Files to Create:
education_history.module.go- FX dependency injection setupcontroller/controller.go- Main controller structcontroller/education_history.controller.go- HTTP handlersservice/education_history.service.go- Business logicrepository/education_history.repository.go- Data accessrequest/education_history.request.go- Input DTOsresponse/education_history.response.go- Output DTOsmapper/education_history.mapper.go- Entity ↔ DTO conversion
API Endpoints:
GET /education-history- List with paginationGET /education-history/:id- Get by IDPOST /education-history- Create newPUT /education-history/:id- Update existingDELETE /education-history/:id- DeletePOST /education-history/:id/certificate- Upload certificate
✅ Phase 2B: Work History Module (app/module/work_history/)
Files to Create:
work_history.module.gocontroller/controller.gocontroller/work_history.controller.goservice/work_history.service.gorepository/work_history.repository.gorequest/work_history.request.goresponse/work_history.response.gomapper/work_history.mapper.go
API Endpoints:
GET /work-history- List with paginationGET /work-history/:id- Get by IDPOST /work-history- Create newPUT /work-history/:id- Update existingDELETE /work-history/:id- Delete
✅ Phase 2C: Research Journals Module (app/module/research_journals/)
Files to Create:
research_journals.module.gocontroller/controller.gocontroller/research_journals.controller.goservice/research_journals.service.gorepository/research_journals.repository.gorequest/research_journals.request.goresponse/research_journals.response.gomapper/research_journals.mapper.go
API Endpoints:
GET /research-journals- List with paginationGET /research-journals/:id- Get by IDPOST /research-journals- Create newPUT /research-journals/:id- Update existingDELETE /research-journals/:id- Delete
✅ Phase 2D: Communications Module (app/module/communications/)
Files to Create:
communications.module.gocontroller/controller.gocontroller/conversations.controller.gocontroller/chat_messages.controller.goservice/conversations.service.goservice/chat_messages.service.goservice/file_upload.service.gorepository/conversations.repository.gorepository/chat_messages.repository.gorequest/conversations.request.gorequest/chat_messages.request.goresponse/conversations.response.goresponse/chat_messages.response.gomapper/conversations.mapper.gomapper/chat_messages.mapper.go
API Endpoints:
GET /conversations- List user conversationsGET /conversations/:id- Get conversation detailsPOST /conversations- Start new conversationGET /conversations/:id/messages- Get messages with paginationPOST /conversations/:id/messages- Send text messagePOST /conversations/:id/messages/file- Send file messagePUT /conversations/:id/messages/:messageId/read- Mark as read
✅ Phase 2E: AI Chat Module (app/module/ai_chat/)
Files to Create:
ai_chat.module.gocontroller/controller.gocontroller/ai_chat_sessions.controller.gocontroller/ai_chat_messages.controller.goservice/ai_chat_sessions.service.goservice/ai_chat_messages.service.goservice/ai_integration.service.gorepository/ai_chat_sessions.repository.gorepository/ai_chat_messages.repository.gorequest/ai_chat_sessions.request.gorequest/ai_chat_messages.request.goresponse/ai_chat_sessions.response.goresponse/ai_chat_messages.response.gomapper/ai_chat_sessions.mapper.gomapper/ai_chat_messages.mapper.go
API Endpoints:
GET /ai-chat/sessions- List user sessionsPOST /ai-chat/sessions- Create new sessionGET /ai-chat/sessions/:id- Get session detailsPUT /ai-chat/sessions/:id- Update session (title, status)DELETE /ai-chat/sessions/:id- Delete sessionGET /ai-chat/sessions/:id/messages- Get messagesPOST /ai-chat/sessions/:id/messages- Send message to AI
✅ Phase 2F: AI Chat Logs Module (app/module/ai_chat_logs/)
Files to Create:
ai_chat_logs.module.gocontroller/controller.gocontroller/ai_chat_logs.controller.goservice/ai_chat_logs.service.gorepository/ai_chat_logs.repository.gorequest/ai_chat_logs.request.goresponse/ai_chat_logs.response.gomapper/ai_chat_logs.mapper.go
API Endpoints:
GET /ai-chat-logs- List logs with filtersGET /ai-chat-logs/:id- Get specific logPOST /ai-chat-logs- Create log entryPUT /ai-chat-logs/:id- Update log (end session)
Integration Updates
✅ Phase 3A: Database Registration
- Update
app/database/index.database.go- Add all new entities to
Models()function - Ensure proper migration order
- Add all new entities to
✅ Phase 3B: Router Registration
- Update
app/router/api.go- Add new router structs
- Add constructor parameters
- Add router registrations in
Register()method
✅ Phase 3C: Main Application Updates
- Update
main.go- Add new module imports
- Add module providers to FX
✅ Phase 3D: Users Module Enhancement
- Update
app/module/users/request/users.request.go- Add new fields to request DTOs
- Update
app/module/users/response/users.response.go- Add new fields to response DTOs
- Update
app/module/users/mapper/users.mapper.go- Handle new field mappings
File Upload & Storage
✅ Phase 4A: File Upload Service
- Create
utils/service/file_upload.service.go - Support certificate images (education)
- Support chat attachments (photos, files, audio)
- Integration with existing MinIO setup
✅ Phase 4B: File Validation
- Implement file type validation
- Implement file size limits
- Implement security scanning
Real-time Features (Optional)
✅ Phase 5A: WebSocket Support
- Add WebSocket handler for real-time chat
- Message broadcasting system
- Connection management
✅ Phase 5B: Push Notifications
- New message notifications
- AI response notifications
Testing Implementation
✅ Phase 6A: Unit Tests
- Service layer tests for each module
- Repository layer tests
- Mapper tests
✅ Phase 6B: Integration Tests
- API endpoint tests
- Database integration tests
- File upload tests
Documentation
✅ Phase 7A: API Documentation
- Update Swagger documentation for all endpoints
- Request/response examples
- Error response documentation
✅ Phase 7B: Database Documentation
- ERD diagram
- Table relationships
- Migration scripts
Deployment Preparation
✅ Phase 8A: Configuration
- Environment variables for AI service
- MinIO bucket configuration
- Database migration scripts
✅ Phase 8B: Performance Optimization
- Database indexing
- Query optimization
- Caching strategy
Quality Assurance
✅ Phase 9A: Code Review
- Follow existing code patterns
- Error handling consistency
- Security review
✅ Phase 9B: Performance Testing
- Load testing for chat features
- File upload performance
- Database query performance
Implementation Notes
- Follow Existing Patterns: Each module should follow the exact same structure as existing modules
- Database Constraints: Add proper foreign key constraints and indexes
- Error Handling: Use consistent error response format
- Authentication: Ensure all endpoints properly validate user tokens
- Authorization: Users can only access their own data
- Pagination: Implement pagination for all list endpoints
- File Security: Validate file uploads and implement virus scanning
- API Versioning: Consider version compatibility for future updates
Priority Order
- High Priority: Users profile updates, Education History, Work History
- Medium Priority: Research Journals, Basic Communication
- Low Priority: AI Chat, Real-time features, Advanced communication features
This checklist ensures systematic implementation while maintaining code quality and consistency with the existing architecture.