Aura Components and Schedulable and Batch Apex Challanges

Challanges

Challenge 1

  1. Create an Aura component using LDS to create new Account records
  2. A data table should reflect new records.

Challenge 2

  1. Create Schedulable Apex that runs every Sat @ 2:00 am. This will launch a Batch job
  2. Search for any Opportunity records that are over 6 months that have not been closed (either Closed - Won or Closed - Lost)
  3. Then delete the matched records.

Results

  1. See challenge 1 code in /force-app/main/default/aura/createNewAccounts
    1. See also AccountController.cls in /force-app/main/default/classes
  2. See challenge 2 code in /forece-app/main/default/classes
    1. BatchDeleteOpportunity.cls
    2. ScheduleBatchDeleteOpportunity.cls
    3. Respectively test classes (prpended with Test)
    4. and a utility test class called TestOpportunityFactory.cls

Futher considerations

I found out just today there was an easier way to handle the CreatedDate for opportunities in my test data. I would go back and change my Factory class to use that method

I did not get 100% passing tests (I think, the UI and output seemed to contradict each other at points).

I did not conduct unit testing for the Aura components. Not sure how valuable that is considering it is the older framework, but it was something I'd like to have at least researched.

I would have liked to have the form for the Aura component reset automatically when submitting, but I had some trouble there so settled for a button.