Aggregate the Total Plant Count
Not Started

User Story:
As a Garden Manager, I want to capture the total number of plants in a garden when a plant is added or removed, so that I can accurately report on the number of plants in each garden at all times.

Acceptance Criteria:

  • The garden's "Total Plant Count" (CAMPX__Total_Plant_Count__c) field should increase when a plant is associated to a garden and decrease when a plant is removed from the garden
  • A plant is also considered removed from a garden when the plant is deleted

Example Scenario:

  • The rose garden's total plant count is 15. A new rose bush is added, so the total plant count increases to 16
  • A plant is moved from one garden to another, the total plant count for the first garden decreases and increases for the second
  • A plant record is deleted, it's former garden's total plant count decreases by one