Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Students courses in Schoolworks are represented by a Course Id, Start Date and End date.

We store the student’s course booking in an object called Booking__c

Student Courses might look like:

Booking__c

Student Id

Course Id

Start Date

End Date

Status

1234

1

25/3/24

19/4/24

Booked

2345

1

5/2/24

21/3/24

Booked

3456

1

3/1/24

13/11/24

Booked

4567

1

13/2/24

10/10/24

Cancelled

5678

1

26/3/24

28/3/24

Booked

5678

2

27/3/24

29/3/24

Booked

Each booking has a status - ‘Booked’ and ‘Cancelled’.

...

A student is deemed to be ‘here' (i.e. in schoolschool’) if their course dates are 'across' the period dates.

e.g. 3 unique students are in school (above) for period 25/3/24 to 29/3/24.

...

Please write a Salesforce Apex method, with input parameters - periodStartDate, periodEndDate, that returns a list of unique students Ids 'here' across the period, from the object Booking__c, which has the fields, Student_Id, Course_Id, Booking_Start_Date__c, Booking_End_Date__c, Status__c. where Booking Start/End dates are across PeriodStart/End dates and Status = "Booked".

Please demonstrate development best practices, including considerations for NULL, Error management, validation, comments and anything else you consider to be important in your submission.

...

Additionally, please exclude any students from the list, who may be on holiday, i.e. every day, across the whole Period Start/End. periodStartDate, periodEndDate.

If the student is ‘in school’ on any day during the period and they are also ‘on holiday’ for some, but not all, of the periodStartDate, periodEndDate then they are deemed to be ‘in school’

Holidays are stored in another object Holidays__c with fields, Student_Id, Holiday_Start_Date__c and Holiday_End_Date__c, Status__c.

...

Student Id

Start Date

End Date

Status

1234

1/3/24

1/3/24

Booked

1234

21/3/24

3/3/24

Booked

2345

2319/32/2430

21/32/24

Booked

1234

26/3/24

26/3/24

Booked

3456

20/3/24

26/3/24

CancelledBooked

3456

27/3/24

30/4/24

Booked

5678

27/3/24

27/3/24

Booked

e.g. there 2 students are in school for the period 25/3/24 to 29/3/24 if we now exclude those on holiday for this period using both sets of data above.


Further questions

Please feel free to ask for further questions for clarification of the task - asking questions is perfectly OK and welcomed, if anything here is unclear.

Your submission

This can be submitted in a format you think is appropriate. It can be a txt file, PDF, or working example in a test ORG.

...

Please consider usual best practices in your submission; testing of your submission as an example.

We will consider part answers as well with any questions or assumptions, in particular for the extension task.

...

Your approach to the task, understanding of the details, further questions (if needed for clarification), assumptions, best practices and then accuracy are all important in our evaluation of your submission.