feat: Add API controllers for webservices plugin CRUD routes #37

Open
opened 2026-06-29 14:07:30 +00:00 by jmiller · 1 comment
Owner

Summary

The webservices plugin (plg_webservices_mokosuitefield) registers CRUD routes for 8 entities but no API controllers exist in the component to handle them. All API requests will return 404.

Routes registered in MokoSuiteField.php:

  • v1/mokosuitefield/workorders
  • v1/mokosuitefield/equipment
  • v1/mokosuitefield/technicians
  • v1/mokosuitefield/parts
  • v1/mokosuitefield/truckinventory
  • v1/mokosuitefield/checklists
  • v1/mokosuitefield/pmagreements
  • v1/mokosuitefield/dispatches

Requirements

Create API controllers in admin/src/Controller/Api/ (or the component's api/ directory):

  • WorkordersController — extends Joomla\CMS\MVC\Controller\ApiController, maps to work_orders table
  • EquipmentController — maps to equipment table
  • TechniciansController — maps to technicians table
  • PartsController — maps to parts table
  • TruckinventoryController — maps to truck_inventory table
  • ChecklistsController — maps to checklists table
  • PmagreementsController — maps to pm_agreements table
  • DispatchesController — maps to dispatches table

Technical Notes

  • Each controller needs $contentType property matching the route name
  • Use Joomla\CMS\MVC\Controller\ApiController base class
  • Controllers depend on Table classes existing (#34) and the component being in the package manifest (#31)
## Summary The webservices plugin (`plg_webservices_mokosuitefield`) registers CRUD routes for 8 entities but no API controllers exist in the component to handle them. All API requests will return 404. Routes registered in `MokoSuiteField.php`: - `v1/mokosuitefield/workorders` - `v1/mokosuitefield/equipment` - `v1/mokosuitefield/technicians` - `v1/mokosuitefield/parts` - `v1/mokosuitefield/truckinventory` - `v1/mokosuitefield/checklists` - `v1/mokosuitefield/pmagreements` - `v1/mokosuitefield/dispatches` ## Requirements Create API controllers in `admin/src/Controller/Api/` (or the component's `api/` directory): - [ ] **WorkordersController** — extends `Joomla\CMS\MVC\Controller\ApiController`, maps to work_orders table - [ ] **EquipmentController** — maps to equipment table - [ ] **TechniciansController** — maps to technicians table - [ ] **PartsController** — maps to parts table - [ ] **TruckinventoryController** — maps to truck_inventory table - [ ] **ChecklistsController** — maps to checklists table - [ ] **PmagreementsController** — maps to pm_agreements table - [ ] **DispatchesController** — maps to dispatches table ## Technical Notes - Each controller needs `$contentType` property matching the route name - Use `Joomla\CMS\MVC\Controller\ApiController` base class - Controllers depend on Table classes existing (#34) and the component being in the package manifest (#31)
Author
Owner

Branch created: feature/37-feat-add-api-controllers-for-webservices

git fetch origin
git checkout feature/37-feat-add-api-controllers-for-webservices
Branch created: [`feature/37-feat-add-api-controllers-for-webservices`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteField/src/branch/feature/37-feat-add-api-controllers-for-webservices) ```bash git fetch origin git checkout feature/37-feat-add-api-controllers-for-webservices ```
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteField#37