User Story:
As a GreenGuardian CRM Director, I want to understand the garden's status, so that I can report on the garden's overall condition and know if it's operational or in need of attention.
Acceptance Criteria:
- The garden's "Status" (CAMPX__Status__c) field should updated based on the conditions in the table below
- The field should re-evaluate anytime the dependent fields change. With an exception below.
- Once the status has been updated to "Permanent Closure" the status should no longer automatically update
Default Values:
Status | Condition |
---|---|
Operational | (100 >= Capacity >= 70) AND (Total Plant Count >= Minimum Plant Count) AND (Health Index >= 70) |
Temporary Closure | Capacity = 0 |
Over Capacity | Capacity > 100 |
Awaiting Resources | (70 > Capacity > 0) OR (70 > Health Index) OR (Minimum Plant Count > Total Plant Count) |
Example Scenario:
- The Lavender Garden is undergoing renovation, and all the plants have moved out, so capacity is set to 0. The status is updated to "Temporary Closure".
- The Community Vegetable Garden has a capacity of 105, exceeding the maximum limit of 100. The status is set to "Over Capacity".
- The Rose Garden has a capacity of 50 and a Health Index of 100. The status is updated to 'Awaiting Resources'.
- The Tropical Garden has a capacity of 80, more than the minimum plant count, and a Health Index of 75. The status is set to 'Operational'.
- The Tropical Garden has its status updated to "Permanent Closure". Its status should not change when the capacity or any other field changes.