feat(rt): crud RT - #65
Merged
Merged
Conversation
hanchan-dev
approved these changes
Sep 3, 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
CRUD untuk resource
rts(RT): list (dengan filterrw_id), tambah, edit, dan hapus.Jira Ticket
Ticket: EV5-7-S1
Type of Change
Changes Made
indexRts,storeRt,updateRt,destroyRtdiRegionController.phppetugas_desayang boleh create/update/delete RT (403 untuk role lain)numberRT harus unik perrw_id, dengan pesan error custom Bahasa Indonesiafull_labeldi-generate otomatis format"RT 001 / RW 001", konsisten dengan konvensiWilayahSeederroutes/api.phpdalam groupauth:sanctum:GET/POST /rts,PATCH/DELETE /rts/{rt}RegionControllerTest.php(total sekarang 14 test: 5 hamlets + 4 rws + 5 rts): create/list/update/delete sukses, non-petugas_desa ditolak, duplicate number ditolak, guard nonaktifkan & hapus dengan warga aktifHow to Test
role=petugas_desayang punyavillage_idterisi lewatphp artisan tinkerAuthorization: Bearer <token>:GET /api/rts?rw_id=1→ daftar RT di RW tersebutPOST /api/rtsbody{"rw_id": 1, "number": "002"}→ 201POST /api/rtsdenganrw_id+numberyang sama lagi → 422 (duplikat)PATCH /api/rts/{id}body{"is_active": false}→ 200 kalau tidak ada warga aktif, 409 kalau masih adaDELETE /api/rts/{id}→ 200 kalau tidak ada warga terdaftar, 409 kalau masih adaScreenshots (if applicable)
Checklist
dev(bukan langsung kemain)