DMIT-2018 / dmit-2018-jan-2023-a01-workbook-jthompsonnait

dmit-2018-jan-2023-a01-workbook-jthompsonnait created by GitHub Classroom
1 stars 0 forks source link

General Planning Implementation task of Managing Play List in Chinook #3

Open jthompsonnait opened 1 year ago

jthompsonnait commented 1 year ago

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

jthompsonnait commented 1 year ago

UI Experience

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

PRG Post Redirect Get (Query)

PLayList Management screen shot

jthompsonnait commented 1 year ago

Data Models

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

CQRS image

Query Models

Artist and Album Track Fetch

Search Results

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; }
        public string Length
        {
            get { return $"{(int)Milliseconds / 60 / 1000}:{Milliseconds / 1000 % 60}"; }
        }
}

Current Playlist Tracks

Current Playlist

public class PlaylistTrackView
{
        public int TrackId { get; set; }
        public bool Remove { get; set; }
        public int TrackNumber { get; set; }
        public string SongName { get; set; }
        public int Milliseconds { get; set; }
        public string Length
        {
            get { return $"{(int)Milliseconds / 60 / 1000}:{Milliseconds / 1000 % 60}"; }
        }
        public int NewTrackNumber { get; set; }
}

Command Models

Add Track

Add track

No model class, individual parameters public void AddTrack(string userName, string playlistName, int trackId)

Remove Track

Remove Track

No model class, individual parameters

public void RemoveTracks(int playListId, list<int> trackIds)

Move Track

Move Track

public class MoveTrackView
{
  public int TrackId {get; set;}
  public int TrackNumber {get; set;}
}
jthompsonnait commented 1 year ago

Business Processing Requirements

This comment will describe the various methods that will be used for Commands (CQRS) that alter the database. Queries are read-only and require 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 method signature and a bullet list of processing (pseido code)

Fetch Playlist

List<PlaylistTrackView> PlaylistTrackServices_FetchPlaylist(string userName, string playlistName)

Move Track

void PlaylistTrackServices_MoveTrack(int playlistId, List<MoveTrackView> moveTracks)