DMIT-2018 / Take-Home-Exercises-Sep-2022

2 stars 3 forks source link

Create of the OLTP service for registration of a new employee #3

Open Aamir369 opened 1 year ago

Aamir369 commented 1 year ago

The form is designed and created to collect an employee skill registration information. The individual may be a completely new employee or an existing employee who is registering a new skill. Entire form will be processed as a single transaction in the BLL.

Aamir369 commented 1 year ago

information for Business processing requirements ???

This comment will describe various methods that will be used for commands ( CQRS) that alter the data base. Queries are read only and require ( on average ) no complex processing. you may* in another comment out line your query methods. However commands requires business rules validation and manipulations of one or more tables and/or records ???

The processing of commands could require Extensive logic to the outline

include the method signature(name of method and list of parameters) and a bulleted list of processing(Psuedocode)**

Add Track

RDT return data type - PlaylistTrackservices_AddTrack( lilst of parameters ) - i need to determine what are my incoming parameters

example for above line - void PlaylistTrackservices_AddTrack(string playlistname, string username, int trackid) - this is method signature. this method is only WHAT needs to be done

  • check that the incoming data exists in DB
  • if a problem exists, throw an ArgumentNullException for missing incoming value( ### possible scenarios from the UIX )
  • check if track exists
  • does not exist, throw an exception error (could be an argument exception on TrackID)
  • Check to see if the play list exists
  • two possiblities - _the play liist does not exist or _the playlist exists
  • if the playlist does not exist then -create a new playlist record and set track number to 1
  • if the playlist exists ( appending the existing playlist )
  • check for the B/R( business rule ) to check if the track is already on the playlist)
  • yes - if the track is existing in the playlist then throw an exception on BR.
  • No - if the track is not existing then i need to determine the next track number and
  • Add the track to the playlists track
  • Check for any errors - if there are errors then throw the list of all errors collected exceptions and if it no then save all work to DB.
  • Logic completed
  • CODING PART TO CONTINUE IN LINQ PAD

WhatsApp Image 2022-10-12 at 19 52 23