Create well-structured service layer classes that encapsulate business logic, coordinate between repositories, and provide clean interfaces for controllers and APIs.
| CRUD Service | Basic DocType operations | CustomerService | | Workflow Service | State transitions, approvals | ApprovalService | | Integration Service | External API calls | PaymentGatewayService | | Orchestration Service | Multi-DocType coordination | OrderFulfillmentService | | Batch Service | Bulk operations | BulkImportService |
┌─────────────────────┐ │ Controller/API │ └──────────┬──────────┘ │ ▼ ┌─────────────────────┐ │ │ ← Business Logic │ Service │ └──────────┬──────────┘ │ ▼ ┌─────────────────────┐ │ │ ← Data Access │ Repository │ └──────────┬──────────┘ │ ▼ ┌─────────────────────┐ │ Database │ └─────────────────────┘
Design and implement service layer classes for Frappe Framework v15 with proper business logic separation. Triggers: "create service", "add service layer", "frappe service", "business logic", "/frappe-service". Generates service classes with validation, orchestration, and integration patterns. Source: sergio-bershadsky/ai.