feat(hamlets): crud hamlets - #62
Merged
Merged
Conversation
hanchan-dev
force-pushed
the
crud-hamlets
branch
from
September 1, 2026 09:54
2a35183 to
6125ebf
Compare
hanchan-dev
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implementasi awal EV5-7-S1 (
RegionController) — CRUD untuk resourcehamlets(dusun): list, tambah, edit, dan hapus dusun, lengkap dengan guard otorisasi dan guard integritas data warga.Jira Ticket
Ticket: EV5-7-S1
Type of Change
Changes Made
RegionController(app/Http/Controllers/Api/RegionController.php) dengan methodindexHamlets,storeHamlet,updateHamlet,destroyHamletpetugas_desayang boleh create/update/delete dusun (role lain dapat 403)codedusun harus unik, dengan pesan error custom Bahasa Indonesiaroutes/api.phpdalam groupauth:sanctum:GET/POST /hamlets,PATCH /hamlets/{hamlet},DELETE /hamlets/{hamlet}How to Test
php artisan migrate --seeddi database lokalrole=petugas_desalewatphp artisan tinker:GET /api/hamlets → daftar dusun
POST /api/hamlets body {"name": "Dusun Test", "code": "TST"} → 201
POST /api/hamlets dengan code yang sama lagi → 422 (duplikat)
PATCH /api/hamlets/{id} body {"is_active": false} → 200 kalau tidak ada warga aktif, 409 kalau masih ada
DELETE /api/hamlets/{id} → 200 kalau tidak ada warga terdaftar, 409 kalau masih ada
Ulangi salah satu request di atas pakai user role selain petugas_desa → harus dapat 403
Screenshots (if applicable)
Checklist
dev(bukan langsung kemain)