-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] API: Add DeleteCategory handler and archive endpoint #120
Copy link
Copy link
Closed
Labels
go:yesReady to implementReady to implementpriority:p2Next sprintNext sprintrelease:backlogNot yet targetedNot yet targetedsprint-3Sprint 3 — Full CRUD UI + ArchiveSprint 3 — Full CRUD UI + ArchivesquadSquad triage inbox — Lead will assign to a memberSquad triage inbox — Lead will assign to a membersquad:legolasAssigned to Legolas (Frontend Dev)Assigned to Legolas (Frontend Dev)squad:samAssigned to Sam (Backend Dev)Assigned to Sam (Backend Dev)type:featureNew capabilityNew capability
Metadata
Metadata
Assignees
Labels
go:yesReady to implementReady to implementpriority:p2Next sprintNext sprintrelease:backlogNot yet targetedNot yet targetedsprint-3Sprint 3 — Full CRUD UI + ArchiveSprint 3 — Full CRUD UI + ArchivesquadSquad triage inbox — Lead will assign to a memberSquad triage inbox — Lead will assign to a membersquad:legolasAssigned to Legolas (Frontend Dev)Assigned to Legolas (Frontend Dev)squad:samAssigned to Sam (Backend Dev)Assigned to Sam (Backend Dev)type:featureNew capabilityNew capability
Summary
The Categories API is missing a Delete/Archive endpoint. The domain model has
ArchivedByandArchivedOnfields indicating soft-delete is the intended pattern — but no handler or endpoint exists to perform it.Current State
CategoryEndpoints.csexposes:GET /api/v1/categories— List allGET /api/v1/categories/{id}— Get by IDPOST /api/v1/categories— CreatePUT /api/v1/categories/{id}— UpdateWork Required
Following the existing CQRS vertical slice pattern:
1. Command + Handler
Create
src/Api/Handlers/Categories/DeleteCategoryHandler.cs:ArchivedBy,ArchivedOnon the entityArchived = trueICategoryRepository2. Endpoint
Add to
CategoryEndpoints.cs:3. Repository
Verify
ICategoryRepositoryhasArchiveAsyncorUpdateAsyncthat covers the archived state.Acceptance Criteria
DELETE /api/v1/categories/{id}returns 204 for valid admin requestFiles
src/Api/Handlers/Categories/DeleteCategoryHandler.cs(new)src/Api/Handlers/Categories/CategoryEndpoints.cssrc/Api/Repositories/ICategoryRepository.cs