Implement trackhasartist relationship management

Add complete implementation for track-artist relationship management,
  following the established albumhasgenre pattern. This enables tracking
  which artists are associated with each track in the media library.

  Changes:
  - Fix TrackHasArtist model: Rename from TrackHasArtistt.java (typo)
    and correct table name from "trackhasgenre" to "trackhasartist"
  - Implement TrackHasArtistRepository with full CRUD operations
  - Implement TrackHasArtistService with business logic and validation
  - Add TrackHasArtistMapper for entity/protobuf conversion
  - Create action handlers:
    * CreateTrackHasArtistHandler (trackhasartist.create)
    * DeleteTrackHasArtistHandler (trackhasartist.delete)
    * GetTrackHasArtistByIdHandler (trackhasartist.getById)
    * GetTrackHasArtistHandler (trackhasartist.getAll)
  - Register TrackHasArtistService in DelegateActionManager for
    automatic handler discovery and dependency injection
  - Proto file (trackhasartist.proto) was already correct

  The implementation validates track and artist existence before creating
  relationships and provides proper error handling with appropriate HTTP
  status codes.

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

  Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2025-12-09 02:44:57 -03:00
parent e0799828d0
commit 7fd3c3e9f7
10 changed files with 535 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
syntax = "proto3";
option java_package = "com.mediamanager.protocol.messages";
option java_outer_classname = "TrackHasArtistMessages";
package mediamanager.messages;
message TrackHasArtist{
int32 id = 1;
int32 fk_track_id = 2;
int32 fk_artist_id =3;
}
message CreateTrackHasArtistRequest {
int32 fk_track_id = 1;
int32 fk_artist_id = 2;
}
message CreateTrackHasArtistResponse {
TrackHasArtist trackhasartist = 1;
}
message GetTrackHasArtistsRequest {
}
message GetTrackHasArtistsResponse {
repeated TrackHasArtist trackhasartist = 1;
}
message GetTrackHasArtistByIdRequest {
int32 id = 1;
}
message GetTrackHasArtistByIdResponse {
TrackHasArtist trackhasartist = 1;
}
message DeleteTrackHasArtistRequest {
int32 id = 1;
}
message DeleteTrackHasArtistResponse {
bool success = 1;
string message = 2;
}