Sunteți pe pagina 1din 5

Background:,

,
Racing'Geeks'Inc.'owns'multiple'racing'tracks'around'Australia.'Each'season'they'
organise'a'number'of'races'at'each'of'their'tracks.'Their'customers'(hobby'racers)'own'
multiple'cars'and'can'enter'into'many'races'each'season.'Racing'Geeks'Inc.'receive'
registrations'by'mail'and'they'enter'them'into'Salesforce'manually.'What'they'need'at'this'
stage'is,'an'automated'way'to'manage'all'their'bookings'easily.'Their'future'plan'is'to'
automate'the'registration'and'payment'process,'but'let's'focus'only'on'what's'required'for'
now.'
'
Data,Model:,
,
Racing'Geeks'Inc.'use'the'following'objects'in'Salesforce'(with'the'sharing'model'
respectively)'
'
! Standard'Objects:'
' ' Contact'(Racer)'J'Public'Read/Write'
'
! Custom'Objects:'
' ' Season'J'Private'
' ' Race'Entry'J'Controlled'by'Parent'
' ' Track'J'Public'Read/Write'
'
Each'racer'owns'one'or'more'cars'and'can'participate'in'multiple'races'each'season.'
The'Track'catalogue'is'stored'in'the'Track'table.'Season'records'are'created'4'times'
per'year'for'each'racer.'Race'Entry'records'are'created'to'keep'track'of'each'race'on'
a'particular'track.'
'
ERD:,
'

'
'
, Fields:,
'
' Track:'
! Track'Name'(Name)'J'Name'of'the'Track'(Values:'"Calder'Park'Raceway",'
"Lakeside'Park",'"Phillip'Island'GP'Circuit",'"Sandown'Raceway",'"Wakefield'
Park")'
! Location__c'(Picklist)'J'Location'of'the'Track'(VIC,'QLD,'NSW'etc.)'
! Difficulty__c'(Picklist)'J'The'diffuculty'of'the'Track'(Values:'"Noob",'"Easy",'
"Moderate",'"Hard",'"Insane")'
! Circuit'Length'KM'(Length__c)'J'The'length'of'the'track'in'kilometers'
! Race_Entries__c'(Number)'J'Number'of'how'many'racers'have'currently'
entered'the'race'on'a'Track'[This'will'get'populated'via'apex]'
! Max_Race_Entries__c'(Number)'J'Number'of'maximum'racers'that'can'race'
on'a'Track'[populate'with'Apex]'
'
Season'is'a'quarterly'participation'entry'which'allows'the'racers'to'enter'into'any'
race'on'any'track'for'that'season.'Fields:'
'
! Name'J'Name'of'the'season'(Spring,'Summer,'Fall,'Winter)'
! Year'(Number)'J'Year'of'the'season'
! Racer__c'(Lookup'to'Contact)'
! Car'Name'(Text)'J'Name'of'the'car'
! Model__c'(Text)'J'Car'model'
! Engine_Size__c'(Number)'J'Size'of'the'engine'in'cc'
! Horse_Power__c'(Number)'J'BHP'of'the'car'
! Primary_Difficulty_Level__c'(Text)'J'The'primary'difficulty'of'the'track'
[populate'with'Apex]'
'
' Race'Entry:'
! Name'(Auto'Number)'
! Season__c'(ReJparentable'Master'Detail'to'Season)'
! Track__c'(Lookup'to'Track)'
'
, Limits:,
! Race'Entries'per'Season'J'Max'of'12'
! A'Track'on'average'can'have'22'Race'Entries.'
'
'
, Profiles:,
! "Track'Manager"'who'can'create,'read,'update'and'delete'all'Tracks,'but'they'
can't'see'any'of'the'other'objects'
! "Race'Planner"'who'can'read'all'tracks'and'can'create,'read,'update'and'
delete'Contacts,'Seasons'and'Race'Entries'
'
'
'
, Requirements:,
' '
Write'a'trigger'that'will'automatically'update'the'values'of'the'fields'below'
when'Race'Entry'records'are'created,'deleted,'restored'from'the'recycle'bin'or'the'
lookups'have'changed.'Ensure'that'in'the'case'of'an'error,'the'values'do'not'become'
invalid.'Race'Entries'can'also'be'loaded'in'bulk'using'data'loader'so'make'sure'your'
code'supports'bulk'data'uploads.'
'
' Season:'
'
Primary'Difficulty'Level'J'Most'frequent'difficulty'level'of'Tracks'included'in'
the'associate'Race'Entries.'Leave'blank'for'Seasons'with'no'Race'Entries.'Ties'
are'broken'alphabetically'(AJZ'caseJinsensitive).'
'
' Track:'
'
' ' Race_Entries__c'J'number'of'race'entries'related'to'the'Track'
'
' User,Interface:,
'
Replace'the'standard'create'and'edit'pages'for'the'Season'object.'A'new'record'can'
be'created'from'one'of'the'following'places:'
'
! New'Season'button'from'the'Seasons'tab'
! New'Season'button'from'the'Season'related'list'on'a'Contact'record'
! Quick'Create'in'the'sidebar'
'
' The'page'UI'is'up'to'you'
'
When'a'Season'is'created'from'the'Contact's'related'list,'the'Contact'lookup'must'be'
prepopulated'
'
Users'should'be'able'to'add'and'remove'Tracks'that'the'races'are'going'to'be'racing'
on'within'that'season.'
' The'table'should'display'the'following'fields:'
'
! Checkbox'to'select/deselect'a'track'
! Track'Name'
! Track'Location'
! Difficulty'
! Circuit'Length'(km)'
'
The'table'should'also'have'a'field'that'will'filter'the'Tracks'based'on'the'Difficulty.'
"All"'displays'all'difficulties.'The'selection'of'tracks'should'be'preserved'when'
filtering.'
The'table'should'have'pagination'(First,'Previous,'Next'and'Last)'including'the'page'
numbers.'
'
The'summary'section'should'automatically'update'the'stats'as'soon'as'a'track'is'
selected'or'deselected.'A'message'should'be'displayed'while'the'stats'are'being'
recalculated.'This'section'includes:'
'
! Race'Entries'(Number'of'Selected'Tracks)'
! Remaining'Race'Entries'(Max,12)'
! Total'Distance'(Total'Distance'in'KM'from'all'Selected'Tracks)'
! Remaining'Distance'(300KM,Max)'
'
Upon'Save'the'following'actions'need'to'be'performed:'
'
! Ensure'all'required'fields'are'populated'
! Validate'the'stats'and'restrict'by'Max'values'
! Save'changes'to'the'Season'record'
! Create'Race'Entries'for'each'Selected'Track'
! Delete'Race'Entries'for'each'DeJSelected'Track'(When'Editing)'
'
If'the'transaction'fails,'all'changes'should'be'rolled'back'and'a'user'friendly'message'
should'be'displayed'on'the'page.'
'
If'the'transaction'succeeds,'redirect'the'user'to'the'Season'Detail'Page.'
'
'
'
Testing:,
'
Write'apex'test'to'validate'business'requirements.'Validate'security'(running'as'
different'users),'validate'large'data'volumes'(bulk'DML'of'200+'records).'Create'your'
own'data'inside'the'test'classes'and'don't'rely'on'organisational'data.'Use'asserts'for'
positive'and'negative'outcomes.'
'
'
' TIPS:,
! Ensure'your'code'is'well'commented'
! Use'trigger'handler'class'
! Split'your'test'methods'into'smaller'blocks'focusing'on'a'business'requirement'

S-ar putea să vă placă și