refactor: Revise training model documentation for clarity and completeness
- Updated the overview to better describe the training management system for farmers, including content management, scheduling, and attendance tracking. - Reorganized the model structure to include detailed fields for training programs, such as scheduling, location types, and group management. - Enhanced the business rules section to clarify validation requirements and attendance tracking processes. - Streamlined use cases and key features to reflect the comprehensive capabilities of the training system. - Improved documentation for better understanding and usability.
This commit is contained in:
parent
5f1b9cc011
commit
3d4b28fe90
|
|
@ -1,317 +1,258 @@
|
|||
# Training Model Documentation
|
||||
|
||||
## Overview
|
||||
Model Training adalah komponen inti dalam sistem manajemen pelatihan Happy Farmer yang berfungsi sebagai blueprint untuk program-program pelatihan yang dapat diikuti oleh petani. Model ini dirancang untuk mendukung upaya peningkatan kapasitas dan keterampilan petani dalam berbagai aspek pertanian modern.
|
||||
|
||||
## Business Context
|
||||
Model Training berfungsi sebagai:
|
||||
- **Knowledge Repository**: Penyimpan konten pelatihan dan materi pembelajaran
|
||||
- **Curriculum Management**: Pengelolaan kurikulum pelatihan yang terstruktur
|
||||
- **Capacity Building**: Alat untuk meningkatkan kemampuan petani
|
||||
- **Quality Assurance**: Standarisasi program pelatihan
|
||||
- **Performance Tracking**: Basis untuk tracking progress dan hasil pelatihan
|
||||
Model Training adalah sistem manajemen pelatihan untuk petani yang mencakup pengelolaan konten, penjadwalan, undangan, dan tracking kehadiran. Sistem ini mendukung pelatihan individu maupun kelompok dengan dokumentasi lengkap.
|
||||
|
||||
## Core Purpose
|
||||
|
||||
- **Content Management**: Mengelola materi dan konten pelatihan
|
||||
- **Scheduling**: Penjadwalan pelatihan dengan lokasi dan waktu
|
||||
- **Invitation System**: Sistem undangan untuk petani
|
||||
- **Attendance Tracking**: Pelacakan kehadiran dan partisipasi
|
||||
- **Documentation**: Penyimpanan foto, video, dan dokumen pelatihan
|
||||
|
||||
## Model Structure
|
||||
|
||||
### Primary Fields
|
||||
### Training (Core Model)
|
||||
|
||||
#### **Identification & Basic Info**
|
||||
- **`id`** (String, Primary Key): Unique identifier menggunakan CUID
|
||||
- **`title`** (String, Required): Judul pelatihan yang akan ditampilkan
|
||||
- **`description`** (String, Optional): Deskripsi singkat tentang pelatihan
|
||||
- **`content`** (String, Optional): Konten detail pelatihan (dapat berupa HTML, Markdown, atau text)
|
||||
```
|
||||
id String @id @default(cuid())
|
||||
title String // Judul pelatihan
|
||||
description String? // Deskripsi pelatihan
|
||||
content String? // Materi/konten pelatihan
|
||||
category String // Kategori: "Pest Control", "Organic Farming", dll
|
||||
duration Int? // Durasi dalam menit
|
||||
level String? // Level: "beginner", "intermediate", "advanced"
|
||||
prerequisites String? // Syarat untuk mengikuti pelatihan
|
||||
maxParticipants Int? // Batas maksimal peserta
|
||||
createdBy String? // ID admin yang membuat
|
||||
|
||||
#### **Classification & Organization**
|
||||
- **`category`** (String, Required): Kategori pelatihan
|
||||
- Contoh: "Crop Management", "Pest Control", "Financial Management", "Technology", "Marketing"
|
||||
- **`duration`** (Integer, Optional): Durasi pelatihan dalam menit
|
||||
- **`level`** (String, Optional): Level kesulitan pelatihan
|
||||
- **beginner**: Untuk petani pemula
|
||||
- **intermediate**: Untuk petani dengan pengalaman menengah
|
||||
- **advanced**: Untuk petani berpengalaman atau expert
|
||||
// Scheduling & Location
|
||||
scheduledDate DateTime? // Tanggal pelatihan
|
||||
startTime DateTime? // Waktu mulai
|
||||
endTime DateTime? // Waktu selesai
|
||||
locationType TrainingLocationType // Jenis lokasi pelatihan
|
||||
location String? // Nama lokasi
|
||||
locationAddress String? // Alamat lengkap
|
||||
locationGPS Json? // Koordinat GPS
|
||||
|
||||
#### **Prerequisites & Requirements**
|
||||
- **`prerequisites`** (String, Optional): Syarat atau pelatihan yang harus diselesaikan sebelumnya
|
||||
- **`maxParticipants`** (Integer, Optional): Jumlah maksimum peserta yang dapat mengikuti pelatihan
|
||||
// Group Management
|
||||
batchName String? // Nama batch pelatihan
|
||||
targetGroup String? // Target peserta
|
||||
kelompokTaniIds String[] // ID kelompok tani
|
||||
|
||||
#### **Administrative Fields**
|
||||
- **`createdBy`** (String, Optional): ID admin yang membuat pelatihan
|
||||
- **`isActive`** (Boolean, Default: true): Status aktif pelatihan
|
||||
- **`createdAt`** (DateTime, Default: now()): Tanggal pembuatan
|
||||
- **`updatedAt`** (DateTime, Auto-update): Tanggal terakhir diupdate
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
```
|
||||
|
||||
## Training Categories
|
||||
### Training Location Types
|
||||
|
||||
### Primary Categories
|
||||
1. **Crop Management**
|
||||
- Teknik penanaman
|
||||
- Pemilihan varietas
|
||||
- Pengelolaan lahan
|
||||
- Rotasi tanaman
|
||||
- **VILLAGE_HALL**: Balai desa
|
||||
- **FARM_FIELD**: Pelatihan di kebun/ladang
|
||||
- **FARMER_HOME**: Rumah petani
|
||||
- **COOPERATIVE**: Kantor koperasi
|
||||
- **GOVERNMENT_OFFICE**: Kantor pemerintah
|
||||
- **ONLINE**: Pelatihan virtual
|
||||
- **OTHER**: Lokasi lainnya
|
||||
|
||||
2. **Pest Control**
|
||||
- Identifikasi hama dan penyakit
|
||||
- Pengendalian hama terpadu
|
||||
- Penggunaan pestisida yang aman
|
||||
- Metode organik
|
||||
### Training Levels
|
||||
|
||||
3. **Financial Management**
|
||||
- Pengelolaan keuangan usaha tani
|
||||
- Akuntansi sederhana
|
||||
- Analisis biaya produksi
|
||||
- Perencanaan investasi
|
||||
- **beginner**: Untuk petani pemula
|
||||
- **intermediate**: Petani dengan pengalaman menengah
|
||||
- **advanced**: Petani berpengalaman
|
||||
|
||||
4. **Technology & Innovation**
|
||||
- Penggunaan aplikasi pertanian
|
||||
- Teknologi irigasi
|
||||
- Mesin dan peralatan modern
|
||||
- Sistem informasi pasar
|
||||
### Popular Categories
|
||||
|
||||
5. **Marketing & Business**
|
||||
- Strategi pemasaran
|
||||
- Kualitas dan grading
|
||||
- Negosiasi harga
|
||||
- Kemitraan dengan buyer
|
||||
|
||||
6. **Sustainable Agriculture**
|
||||
- Pertanian organik
|
||||
- Konservasi tanah dan air
|
||||
- Biodiversitas
|
||||
- Perubahan iklim
|
||||
- Crop Management (Pengelolaan tanaman)
|
||||
- Pest Control (Pengendalian hama)
|
||||
- Financial Management (Manajemen keuangan)
|
||||
- Technology & Innovation (Teknologi pertanian)
|
||||
- Marketing & Business (Pemasaran)
|
||||
- Sustainable Agriculture (Pertanian berkelanjutan)
|
||||
|
||||
## Relationships
|
||||
|
||||
### One-to-Many Relationships
|
||||
- **FarmerTraining**: Satu training dapat diikuti oleh banyak petani
|
||||
- Tracking enrollment, progress, dan completion
|
||||
- Scoring dan evaluasi
|
||||
- Assignment dan deadline management
|
||||
### 1. FarmerTraining (Many-to-Many)
|
||||
|
||||
**Purpose**: Tracking enrollment dan progress petani dalam pelatihan
|
||||
|
||||
```
|
||||
farmerId String // ID petani
|
||||
trainingId String // ID pelatihan
|
||||
status TrainingStatus // ENROLLED, IN_PROGRESS, COMPLETED, DROPPED
|
||||
progress Int @default(0) // Progress 0-100%
|
||||
score Float? // Nilai hasil pelatihan
|
||||
completedAt DateTime? // Tanggal selesai
|
||||
assignedBy String? // Admin yang menugaskan
|
||||
deadline DateTime? // Batas waktu penyelesaian
|
||||
```
|
||||
|
||||
### 2. TrainingInvitation (One-to-Many)
|
||||
|
||||
**Purpose**: Sistem undangan untuk petani
|
||||
|
||||
```
|
||||
trainingId String // ID pelatihan
|
||||
farmerId String // ID petani yang diundang
|
||||
invitedBy String? // Admin yang mengundang
|
||||
invitedAt DateTime // Waktu undangan dikirim
|
||||
message String? // Pesan khusus undangan
|
||||
responseStatus AttendanceStatus // INVITED, CONFIRMED, CANCELLED
|
||||
respondedAt DateTime? // Waktu respon petani
|
||||
reminderSent Boolean // Status pengingat
|
||||
```
|
||||
|
||||
### 3. TrainingAttendance (One-to-Many)
|
||||
|
||||
**Purpose**: Pelacakan kehadiran real-time
|
||||
|
||||
```
|
||||
trainingId String // ID pelatihan
|
||||
farmerId String // ID petani
|
||||
attendanceStatus AttendanceStatus // INVITED, CONFIRMED, ATTENDED, ABSENT
|
||||
checkInTime DateTime? // Waktu check-in
|
||||
checkOutTime DateTime? // Waktu check-out
|
||||
participationScore Float? // Nilai partisipasi 1-5
|
||||
completedTasks Boolean // Status penyelesaian tugas
|
||||
feedback String? // Feedback petani
|
||||
```
|
||||
|
||||
### 4. TrainingDocument (One-to-Many)
|
||||
|
||||
**Purpose**: Penyimpanan dokumentasi pelatihan
|
||||
|
||||
```
|
||||
trainingId String // ID pelatihan
|
||||
title String // Judul dokumen
|
||||
fileUrl String // URL file
|
||||
fileName String // Nama file
|
||||
documentType String? // Type: "photo", "video", "certificate", "handout"
|
||||
category String? // Kategori: "documentation", "material", "evaluation"
|
||||
uploadedBy String? // ID pengunggah
|
||||
takenAt DateTime? // Waktu pengambilan foto/video
|
||||
gpsLocation Json? // Koordinat GPS
|
||||
isVerified Boolean // Status verifikasi
|
||||
isPublic Boolean // Akses publik
|
||||
```
|
||||
|
||||
## Business Rules
|
||||
|
||||
### Validation Rules
|
||||
1. **Required Fields**:
|
||||
- `title`: Wajib diisi dan harus deskriptif
|
||||
- `category`: Wajib diisi untuk klasifikasi
|
||||
### Training Management
|
||||
|
||||
2. **Optional but Important**:
|
||||
- `description`: Sangat disarankan untuk memberikan overview
|
||||
- `duration`: Penting untuk planning dan scheduling
|
||||
- `level`: Membantu petani memilih pelatihan yang sesuai
|
||||
1. **Title dan category** wajib diisi
|
||||
2. **maxParticipants** membatasi jumlah peserta
|
||||
3. **prerequisites** harus dipenuhi sebelum enrollment
|
||||
4. **isActive = false** menonaktifkan pelatihan
|
||||
|
||||
3. **Business Logic**:
|
||||
- Training hanya dapat diikuti jika `isActive = true`
|
||||
- `maxParticipants` membatasi jumlah peserta jika diset
|
||||
- `prerequisites` harus dicek sebelum enrollment
|
||||
### Invitation System
|
||||
|
||||
### Content Management Rules
|
||||
- Content dapat berupa text, HTML, atau Markdown
|
||||
- Mendukung multimedia (images, videos) melalui referensi URL
|
||||
- Versioning untuk updates konten
|
||||
- Approval workflow untuk konten baru
|
||||
1. Satu undangan per petani per pelatihan
|
||||
2. Reminder dapat dikirim berkali-kali
|
||||
3. Status response dapat diubah petani
|
||||
|
||||
### Attendance Tracking
|
||||
|
||||
1. Check-in/out hanya bisa dilakukan saat pelatihan aktif
|
||||
2. Participation score 1-5 untuk evaluasi
|
||||
3. Feedback wajib untuk completed attendance
|
||||
|
||||
### Documentation
|
||||
|
||||
1. File verification diperlukan untuk dokumen penting
|
||||
2. GPS location otomatis tersimpan saat upload
|
||||
3. Public access mengatur visibilitas dokumen
|
||||
|
||||
## Use Cases
|
||||
|
||||
### 1. Training Creation
|
||||
**Actor**: Admin/Training Manager
|
||||
**Flow**:
|
||||
1. Admin membuat training baru
|
||||
2. Mengisi title, description, dan category
|
||||
3. Menentukan level dan prerequisites
|
||||
4. Upload atau input content
|
||||
5. Set duration dan max participants
|
||||
6. Aktivasi training
|
||||
### 1. Create Training Program
|
||||
|
||||
### 2. Training Catalog Management
|
||||
**Actor**: Admin
|
||||
**Flow**:
|
||||
1. View semua training yang tersedia
|
||||
2. Filter berdasarkan category, level, atau status
|
||||
3. Edit training content dan metadata
|
||||
4. Activate/deactivate training
|
||||
5. Monitor enrollment dan completion rates
|
||||
```
|
||||
1. Admin creates training dengan title, category, description
|
||||
2. Set schedule (date, time, location)
|
||||
3. Define target group dan max participants
|
||||
4. Upload training materials
|
||||
5. Activate training
|
||||
```
|
||||
|
||||
### 3. Training Discovery
|
||||
**Actor**: Petani/Admin
|
||||
**Flow**:
|
||||
1. Browse training catalog
|
||||
2. Filter berdasarkan category atau level
|
||||
3. View training details dan prerequisites
|
||||
4. Check availability dan enrollment status
|
||||
5. Enroll ke training yang dipilih
|
||||
### 2. Invite Farmers
|
||||
|
||||
```
|
||||
1. Admin selects training program
|
||||
2. Choose farmers atau farmer groups
|
||||
3. Send bulk invitations
|
||||
4. Track responses dan send reminders
|
||||
```
|
||||
|
||||
### 3. Conduct Training
|
||||
|
||||
```
|
||||
1. Admin starts training session
|
||||
2. Check-in farmers attendance
|
||||
3. Record participation scores
|
||||
4. Upload documentation (photos, videos)
|
||||
5. Check-out farmers
|
||||
```
|
||||
|
||||
### 4. Training Analytics
|
||||
**Actor**: Admin/Manager
|
||||
**Flow**:
|
||||
1. View training performance metrics
|
||||
2. Analyze enrollment vs completion rates
|
||||
3. Identify popular training categories
|
||||
4. Track training effectiveness
|
||||
5. Generate reports untuk decision making
|
||||
|
||||
```
|
||||
1. View enrollment vs completion rates
|
||||
2. Track farmer progress across trainings
|
||||
3. Analyze popular categories
|
||||
4. Generate attendance reports
|
||||
```
|
||||
|
||||
## Key Features
|
||||
|
||||
### Group Training Support
|
||||
|
||||
- **Batch Management**: Pelatihan dapat dikelompokkan dalam batch
|
||||
- **Group Invitations**: Undangan massal untuk kelompok tani
|
||||
- **Location Management**: Fleksibilitas lokasi pelatihan
|
||||
|
||||
### Real-time Tracking
|
||||
|
||||
- **Live Attendance**: Check-in/out real-time
|
||||
- **Progress Monitoring**: Tracking progress individual
|
||||
- **Instant Documentation**: Upload foto/video langsung
|
||||
|
||||
### Comprehensive Documentation
|
||||
|
||||
- **Multi-media Support**: Foto, video, dokumen
|
||||
- **GPS Integration**: Lokasi otomatis tersimpan
|
||||
- **Verification System**: Kontrol kualitas dokumentasi
|
||||
|
||||
## Performance Optimization
|
||||
|
||||
### Database Indexes
|
||||
|
||||
- Training: `category`, `level`, `scheduledDate`, `isActive`
|
||||
- FarmerTraining: `farmerId`, `trainingId`, `status`, `progress`
|
||||
- TrainingInvitation: `trainingId`, `farmerId`, `responseStatus`
|
||||
- TrainingAttendance: `trainingId`, `farmerId`, `attendanceStatus`
|
||||
- TrainingDocument: `trainingId`, `documentType`, `isVerified`
|
||||
|
||||
### Query Patterns
|
||||
|
||||
- Filter by category dan level untuk discovery
|
||||
- Search by farmer untuk individual tracking
|
||||
- Date range queries untuk scheduling
|
||||
- Status-based filtering untuk monitoring
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Internal Systems
|
||||
- **FarmerTraining**: Enrollment dan progress tracking
|
||||
- **User Management**: Creator dan access control
|
||||
- **Notification System**: Training announcements
|
||||
- **Reporting System**: Analytics dan performance metrics
|
||||
|
||||
- **Farmer Management**: Enrollment dan progress tracking
|
||||
- **User Authentication**: Access control
|
||||
- **Notification System**: Alerts dan reminders
|
||||
- **File Management**: Document storage
|
||||
|
||||
### External Systems
|
||||
- **Learning Management System (LMS)**: Untuk delivery konten
|
||||
- **Video Platforms**: Untuk multimedia content
|
||||
- **Assessment Tools**: Untuk evaluasi dan testing
|
||||
- **Certificate Management**: Untuk issuing certificates
|
||||
|
||||
## Data Management
|
||||
|
||||
### Content Storage
|
||||
- **Text Content**: Stored dalam database
|
||||
- **Media Files**: Stored di cloud storage (S3, GCS)
|
||||
- **Documents**: PDF, presentations via cloud storage
|
||||
- **Interactive Content**: Link ke external platforms
|
||||
|
||||
### Backup & Recovery
|
||||
- Regular backup untuk training content
|
||||
- Version control untuk content changes
|
||||
- Disaster recovery plan
|
||||
- Data archival strategy
|
||||
|
||||
## Performance Considerations
|
||||
|
||||
### Query Optimization
|
||||
- Index pada `category` untuk filtering
|
||||
- Index pada `isActive` untuk active training queries
|
||||
- Index pada `createdAt` untuk sorting
|
||||
- Full-text search pada `title` dan `description`
|
||||
|
||||
### Scalability
|
||||
- Content caching untuk popular trainings
|
||||
- CDN untuk media files
|
||||
- Database partitioning berdasarkan category
|
||||
- Load balancing untuk high traffic
|
||||
|
||||
## Quality Assurance
|
||||
|
||||
### Content Standards
|
||||
- Structured content format
|
||||
- Clear learning objectives
|
||||
- Appropriate difficulty progression
|
||||
- Cultural sensitivity
|
||||
- Language consistency
|
||||
|
||||
### Review Process
|
||||
- Content review sebelum publikasi
|
||||
- Subject matter expert validation
|
||||
- Regular content updates
|
||||
- Feedback incorporation
|
||||
|
||||
## Analytics & Reporting
|
||||
|
||||
### Key Metrics
|
||||
- **Enrollment Rate**: Jumlah pendaftar per training
|
||||
- **Completion Rate**: Persentase yang menyelesaikan training
|
||||
- **Popular Categories**: Kategori paling diminati
|
||||
- **Duration Analysis**: Efektivitas durasi training
|
||||
- **Success Rate**: Tingkat keberhasilan per level
|
||||
|
||||
### Reports
|
||||
- Training catalog summary
|
||||
- Enrollment trends
|
||||
- Completion analytics
|
||||
- Category performance
|
||||
- Creator productivity
|
||||
|
||||
## Security & Access Control
|
||||
|
||||
### Data Protection
|
||||
- Role-based access untuk training creation
|
||||
- Content encryption untuk sensitive material
|
||||
- Audit logs untuk content changes
|
||||
- Backup security
|
||||
|
||||
### Privacy Considerations
|
||||
- Training participation privacy
|
||||
- Content intellectual property
|
||||
- Data retention policies
|
||||
- GDPR compliance
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
### Planned Features
|
||||
1. **Interactive Content**:
|
||||
- Video-based training
|
||||
- Interactive simulations
|
||||
- Gamification elements
|
||||
- Virtual reality experiences
|
||||
|
||||
2. **AI-Powered Features**:
|
||||
- Personalized training recommendations
|
||||
- Adaptive learning paths
|
||||
- Automated content generation
|
||||
- Intelligent assessment
|
||||
|
||||
3. **Mobile Learning**:
|
||||
- Offline content access
|
||||
- Mobile-optimized content
|
||||
- Push notifications
|
||||
- Progress synchronization
|
||||
|
||||
4. **Social Learning**:
|
||||
- Discussion forums
|
||||
- Peer-to-peer learning
|
||||
- Expert mentorship
|
||||
- Community challenges
|
||||
|
||||
### Integration Roadmap
|
||||
- **Advanced LMS**: Full-featured learning management
|
||||
- **Assessment Engine**: Comprehensive testing and evaluation
|
||||
- **Certification System**: Digital badges dan certificates
|
||||
- **Mobile App**: Native mobile learning experience
|
||||
- **Analytics Dashboard**: Advanced reporting dan insights
|
||||
|
||||
## Sample Training Categories
|
||||
|
||||
### Technical Skills
|
||||
- Modern farming techniques
|
||||
- Irrigation system management
|
||||
- Soil health management
|
||||
- Crop rotation strategies
|
||||
- Harvest timing optimization
|
||||
|
||||
### Business Skills
|
||||
- Farm business planning
|
||||
- Market analysis
|
||||
- Financial planning
|
||||
- Record keeping
|
||||
- Customer relationship management
|
||||
|
||||
### Technology Adoption
|
||||
- Mobile app usage
|
||||
- Weather monitoring tools
|
||||
- GPS and mapping
|
||||
- E-commerce platforms
|
||||
- Digital payment systems
|
||||
|
||||
### Sustainability
|
||||
- Organic farming practices
|
||||
- Water conservation
|
||||
- Integrated pest management
|
||||
- Carbon footprint reduction
|
||||
- Biodiversity conservation
|
||||
|
||||
## Content Delivery Methods
|
||||
|
||||
### Formats Supported
|
||||
- **Text-based**: Articles, guides, manuals
|
||||
- **Video**: Instructional videos, demonstrations
|
||||
- **Interactive**: Quizzes, simulations, games
|
||||
- **Audio**: Podcasts, voice instructions
|
||||
- **Documents**: PDFs, presentations, worksheets
|
||||
|
||||
### Delivery Channels
|
||||
- **Web Platform**: Browser-based access
|
||||
- **Mobile App**: Native mobile experience
|
||||
- **Offline Mode**: Downloaded content
|
||||
- **SMS/USSD**: For basic content delivery
|
||||
- **WhatsApp**: Micro-learning modules
|
||||
- **Cloud Storage**: Media file storage
|
||||
- **SMS/WhatsApp**: Invitation delivery
|
||||
- **GPS Services**: Location tracking
|
||||
- **Video Conferencing**: Online training support
|
||||
|
|
|
|||
Loading…
Reference in New Issue