Refactorized AGActiveEvent model to prevent developer pushing multiple records in AGActiveEvent table as much as possible
Description
what is the purpose of this PR?
Introduce refactorized AGActiveEvent model
what is the original vs the new behaviour?
Originally, when developer use save method, they can push multiple non-duplicate records in AGActiveEvent table which will against our usage of AGActiveEvent model.
Now, with new refactored AGActiveEvent model, we are able to make sure there will be at most one record in this table.
what bug does this PR attempt to fix?
Developer was able to push multiple records in AGActiveEvent table
So, when there are multiple records in AGActiveEvent model, user will see multiple events are active at the same time from the UI perspective, , which is not what we expected.
what is documented in the new documentation?
None
Types of Changes
Put an x in the boxes that apply
[x] Feature (non-breaking change which adds functionality)
[x] Bug Fix (non-breaking change that fixes an issue)
[ ] Breaking Change (feature/fix that causes existing features to not work as expected)
[ ] Documentation
Checklist
[x] I have read the [contribute]contributing doc
[x] Classes, scripts, and environment variables follow existing naming convention
[x] Lint and Unit tests pass locally
[ ] New features on hardware have been tested on a local Raspberry Pi
[ ] Mention new programs/binaries if any must be installed along with this change
[ ] Mention new environment variables if any have been added to hardware/env file
[x] Test coverage should not drop more than 3%
[x] Any new required python modules are added to the requirements.txt
Title
Refactorized AGActiveEvent model to prevent developer pushing multiple records in AGActiveEvent table as much as possible
Description
what is the purpose of this PR? Introduce refactorized AGActiveEvent model
what is the original vs the new behaviour? Originally, when developer use save method, they can push multiple non-duplicate records in AGActiveEvent table which will against our usage of AGActiveEvent model. Now, with new refactored AGActiveEvent model, we are able to make sure there will be at most one record in this table.
what bug does this PR attempt to fix? Developer was able to push multiple records in AGActiveEvent table So, when there are multiple records in AGActiveEvent model, user will see multiple events are active at the same time from the UI perspective, , which is not what we expected.
what is documented in the new documentation? None
Types of Changes
Put an
x
in the boxes that apply[x] Feature (non-breaking change which adds functionality)
[x] Bug Fix (non-breaking change that fixes an issue)
[ ] Breaking Change (feature/fix that causes existing features to not work as expected)
[ ] Documentation
Checklist