Open jthompsonnait opened 2 years ago
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
Managing the playlist.
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).
public class TrackSelection
{
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 class PlaylistTrackInfo
{
public int TrackId {get; set;}
public int TrackNumber {get; set;}
public string SongName {get; set;}
public int Milliseconds {get; set;}
}
No model class, individual parameters
UserName and PlaylistName are individual parameters. Requires track id list in a List
public class PlaylistTrackMove
{
public int TrackId {get; set;}
public bool SelectedTrack {get; set;}
public int TrackNumber {get; set;}
public int TrackInput {get; set; }
}
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. However, commands require business rule validations and manipulations of one or more tables and/or records. Therefore, the processing of commands should be outlined.
include the method signature and a bullet list of processes
Add Track
void PlaylistTrack_AddTrack(string playlistname, string username, int trackid)
- check track exists (trackid)
- no
add exception
- check playlist exists (playlistname, username)
- yes (playlist there)
- check track is not already on playlist
- yes
- add exception
- no
- generate next track number
- no (new playlist)
- create a new playlist record
- set track number to 1
- add track to playlist tracks
- check for any errors
- yes
- throw list of all collected exceptions
- no
save all work to database
Remove Tracks
void PlayListTrack_RemoveTracks(string playlistname, string username, List <PlaylistTrackMove> trackstoremove)
- Check playlist exists
- no
- add exception
- yes
- obtain a list of tracks to retain (order by tracknumber0
- for each track to remove, remove track
- for each track to retain
- re-sequence list of tracks to retain starting at one
- stage update
- check for any exceptions
- yes
- throw new exception with list
- no
save staged work to database
Move Tracks
void PlayListTrack_MoveTracks(string playlistname, string username, List <PlayLlstTrackMove> trackstomove)
- check playlist exists
- no
- add exception
- yes
- check trackstomove sequence
- order by tracknumber
- for each track:
- tracknumber is positive numeric (add any exception)
- tracknumber is unique (add any exception)
- for each track:
- re-sequence tracknumber (start 1, increment by 1)
- stage update
- check for any exceptions
- yes
- throw new exception with list
- no
- save staged work to database
This task list area 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. The tasks that are outlined in this area, are the tasks that are counted for the milestone.