Implement Track entity with complete CRUD operations

Add full Track implementation following the established pattern from Disc and Album entities.

  Components added:
  - Track entity model with relationships to Disc, Composer, BitDepth, BitRate, and SamplingRate
  - TrackRepository for data access layer with full CRUD operations
  - TrackService with business logic and validation
  - TrackMapper for protobuf/entity conversion
  - track.proto with all protobuf message definitions
  - Five action handlers: Create, GetAll, GetById, Update, Delete
  - TrackService registration in DelegateActionManager

  The Track entity supports:
  - Required fields: trackNumber, title, filepath, discId
  - Optional fields: duration, composerId, bitDepthId, bitRateId, samplingRateId
  - Full transaction management and error handling
  - Proper validation and logging throughout all layers
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2025-12-08 20:43:08 -03:00
parent 61c5124d27
commit 8208b58b34
11 changed files with 936 additions and 0 deletions
+81
View File
@@ -0,0 +1,81 @@
syntax = "proto3";
import "google/protobuf/wrappers.proto";
option java_package = "com.mediamanager.protocol.messages";
option java_outer_classname = "TrackMessages";
package mediamanager.messages;
message Track{
int32 id = 1;
int32 track_number = 2;
string title = 3;
int32 duration = 4;
string filepath = 5;
int32 fk_disc_id = 6;
int32 fk_composer_id = 7;
int32 fk_bitdepth_id = 8;
int32 fk_bitrate_id = 9;
int32 fk_samplingrate_id = 10;
}
message CreateTrackRequest {
int32 track_number = 1;
string title = 2;
google.protobuf.Int32Value duration = 3;
string filepath = 4;
int32 fk_disc_id = 5;
google.protobuf.Int32Value fk_composer_id = 6;
google.protobuf.Int32Value fk_bitdepth_id = 7;
google.protobuf.Int32Value fk_bitrate_id = 8;
google.protobuf.Int32Value fk_samplingrate_id = 9;
}
message CreateTrackResponse {
Track track = 1;
}
message GetTracksRequest {
}
message GetTracksResponse {
repeated Track tracks = 1;
}
message GetTrackByIdRequest {
int32 id = 1;
}
message GetTrackByIdResponse {
Track track = 1;
}
message UpdateTrackRequest {
int32 id = 1;
google.protobuf.Int32Value track_number = 2;
string title = 3;
google.protobuf.Int32Value duration = 4;
string filepath = 5;
google.protobuf.Int32Value fk_disc_id = 6;
google.protobuf.Int32Value fk_composer_id = 7;
google.protobuf.Int32Value fk_bitdepth_id = 8;
google.protobuf.Int32Value fk_bitrate_id = 9;
google.protobuf.Int32Value fk_samplingrate_id = 10;
}
message UpdateTrackResponse {
Track track = 1;
}
message DeleteTrackRequest {
int32 id = 1;
}
message DeleteTrackResponse {
bool success = 1;
string message = 2;
}