DMIT-2018 / dmit-2018-jan-2023-a03-workbook-apalavecinofrez

dmit-2018-jan-2023-a03-workbook-apalavecinofrez created by GitHub Classroom
0 stars 0 forks source link

General planning implementation tasks of Managing Play Lists in Chinook #3

Open apalavecinofrez opened 1 year ago

apalavecinofrez commented 1 year ago

This task list area will be completed once the implementation plan has been outlined. This area is where one creates the task list associated with the milestone.

apalavecinofrez commented 1 year ago

UI Experience

This comment outlines the actions that can happen to the forms. Actions are in response to the user interacting with the form, pressing buttons, or controls.

PRG Post Redirect Get (Query)

apalavecinofrez commented 1 year ago

Data Model

The data models are C# classes that we will be coding in the folder (ViewModel) that holds the data classes in our solution. These classes represent the query class models and the command class model (CQRS - Command and Query Responsibility Segregation)

CQRS image


Query Models

Artist and Album Tracks fetch

Search Results

Tracks -> TrackID Tracks -> SongName

public class TrackSelectionView
{
  public int TrackId {get; set;}
  public string SongName {get; set;}
  public string AlbumTitle {get; set;}
  public string ArtistName {get; set;}
  public int Milliseconds {get; set;}
  public decimal Price {get; set;}
}

Current Playlist Tracks

Current Playlist

public class PlaylistTrackView
{
  public int TrackId {get; set;}
  public int TrackNumber {get; set;}
  public string SongName {get; set;}
  public int Milliseconds {get; set;}
}

Command Model

Add Track

Add track

No model class, individual paramaters

public string AddTrack(string userName, string playlistName, int trackId)

Remove Tracks

Remove Track

No model class, individual paramaters

public string RemoveTrack(int playlistId, list<int> trackIds)

Move Tracks

public class MoveTrackCommand
{
  public int TrackId {get; set;}
  public int TrackNumber {get; set;}
}
apalavecinofrez commented 1 year ago

Business Processing Requirements

This comment will describe the various methods that will be used for commands (CRQS) that alter the database. Queries are read-only and required, on average, no complex processing. You may in another comment, outline your query methods. However, commands require business rules, data validation and manipulations of one or more tables and/or records. Therefore, the processing of commands could require extensive logic to be outlined.

Include the methods signature and a bullet list of processing (pseudo-code)

Add Track

void PlaylistTrackService_AddTracks(string userName, string playlistName, int trackId)


Remove Track(s)

void PlaylistTrackService_RemoveTracks(int playlistID, list \<int> trackIds)


Move Tracks

void PlaylistTrackService_MoveTracks(int playlistId, list \<MoveTrackCommand> moveTracks)