feat: add refresh and delete artist endpoints (sections 1.2, 1.3)

- Add POST /api/artists/{id}/refresh to re-fetch metadata from gRPC service
- Add DELETE /api/artists/{id} with cascade delete via PostgreSQL
- Add e2e tests for both flows covering happy path, not found, idempotency
- Extend testutil with GetArtistUpdatedAt, CountAlbumsByArtist, DELETE helper
This commit is contained in:
Alexander
2026-04-29 13:08:53 +02:00
parent 25deaf4621
commit b08a0b1646
7 changed files with 717 additions and 0 deletions
+5
View File
@@ -43,6 +43,11 @@ func NewRouter(h *Handlers) *chi.Mux {
r.Post("/sync", h.Sync)
r.Route("/artists", func(r chi.Router) {
r.Post("/{id}/refresh", h.RefreshArtist)
r.Delete("/{id}", h.DeleteArtist)
})
r.Route("/library", func(r chi.Router) {
r.Get("/artists", h.ListLibraryArtists)
r.Get("/albums", h.ListLibraryAlbums)