-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add spp_hazard_programs, spp_import_match, and spp_oauth modules #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8bef52a
feat: add spp_hazard_programs, spp_import_match, and spp_oauth modules
gonzalesedwin1123 6a71263
fix(pre-commit): resolve semgrep, pylint, and lint issues for CI
gonzalesedwin1123 1c384f2
fix: resolve pre-existing test failures in spp_key_management and spp…
gonzalesedwin1123 248e524
fix(ci): prevent codecov/project from blocking PRs
gonzalesedwin1123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ openpyxl | |
| parse-accept-language | ||
| pydantic | ||
| pyjwt | ||
| pyjwt>=2.4.0 | ||
| pyproj | ||
| python-dateutil | ||
| python-magic | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| =================================== | ||
| OpenSPP Hazard Programs Integration | ||
| =================================== | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:e4ca3f5b5e8c998b833ccd6526f575c07f53a38ac49875511c31201f13122916 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Alpha | ||
| .. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
| :alt: License: LGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github | ||
| :target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_hazard_programs | ||
| :alt: OpenSPP/OpenSPP2 | ||
|
|
||
| |badge1| |badge2| |badge3| | ||
|
|
||
| Links hazard incidents to emergency response programs. Enables programs | ||
| to target affected populations using verified impact data, filter | ||
| registrants by damage severity, and automatically enable emergency mode | ||
| when responding to active incidents. | ||
|
|
||
| Key Capabilities | ||
| ~~~~~~~~~~~~~~~~ | ||
|
|
||
| - Link programs to one or more hazard incidents via many-to-many | ||
| relation | ||
| - Automatically flag programs as emergency when linked to incidents in | ||
| alert/active/recovery status | ||
| - Filter eligible registrants by damage level threshold (any, moderate+, | ||
| severe+, critical only) | ||
| - Count affected registrants based on verified impacts matching damage | ||
| criteria | ||
| - Track which programs are responding to each incident (bidirectional | ||
| navigation) | ||
|
|
||
| Key Models | ||
| ~~~~~~~~~~ | ||
|
|
||
| +----------------------------------+-----------------------------------+ | ||
| | Model | Description | | ||
| +==================================+===================================+ | ||
| | ``spp.program`` (extend) | Adds target incidents, emergency | | ||
| | | mode, damage filter | | ||
| +----------------------------------+-----------------------------------+ | ||
| | ``spp.hazard.incident`` (extend) | Adds reverse relation to response | | ||
| | | programs | | ||
| +----------------------------------+-----------------------------------+ | ||
|
|
||
| UI Location | ||
| ~~~~~~~~~~~ | ||
|
|
||
| - **Programs**: Programs > Programs > "Emergency Response" tab | ||
| - **Incidents**: Hazard & Emergency > Incidents > All Incidents > | ||
| "Response Programs" tab | ||
| - **Stat buttons**: Programs show incident count and affected registrant | ||
| count; incidents show response program count | ||
| - **Filters**: "Emergency Programs" and "Has Target Incidents" filters | ||
| in program search view | ||
|
|
||
| Security | ||
| ~~~~~~~~ | ||
|
|
||
| No new ACL entries. Access inherited from base models: | ||
|
|
||
| - ``spp.program``: Controlled by ``spp_programs`` security groups | ||
| - ``spp.hazard.incident``: Controlled by ``spp_hazard`` security groups | ||
|
|
||
| Extension Points | ||
| ~~~~~~~~~~~~~~~~ | ||
|
|
||
| - Override ``get_emergency_eligible_registrants()`` to customize | ||
| eligibility logic beyond damage levels | ||
| - Override ``_get_damage_level_domain()`` to add custom damage filtering | ||
| rules | ||
| - Inherit ``spp.program`` to add fields used in emergency calculations | ||
| - Use ``is_emergency_program`` and ``is_emergency_mode`` flags in | ||
| downstream program logic | ||
|
|
||
| Dependencies | ||
| ~~~~~~~~~~~~ | ||
|
|
||
| ``spp_hazard``, ``spp_programs`` | ||
|
|
||
| .. IMPORTANT:: | ||
| This is an alpha version, the data model and design can change at any time without warning. | ||
| Only for development or testing purpose, do not use in production. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OpenSPP/OpenSPP2/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/OpenSPP/OpenSPP2/issues/new?body=module:%20spp_hazard_programs%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * OpenSPP.org | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| .. |maintainer-jeremi| image:: https://github.com/jeremi.png?size=40px | ||
| :target: https://github.com/jeremi | ||
| :alt: jeremi | ||
| .. |maintainer-gonzalesedwin1123| image:: https://github.com/gonzalesedwin1123.png?size=40px | ||
| :target: https://github.com/gonzalesedwin1123 | ||
| :alt: gonzalesedwin1123 | ||
| .. |maintainer-reichie020212| image:: https://github.com/reichie020212.png?size=40px | ||
| :target: https://github.com/reichie020212 | ||
| :alt: reichie020212 | ||
|
|
||
| Current maintainers: | ||
|
|
||
| |maintainer-jeremi| |maintainer-gonzalesedwin1123| |maintainer-reichie020212| | ||
|
|
||
| This module is part of the `OpenSPP/OpenSPP2 <https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_hazard_programs>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Part of OpenSPP. See LICENSE file for full copyright and licensing details. | ||
|
|
||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # pylint: disable=pointless-statement | ||
| # Part of OpenSPP. See LICENSE file for full copyright and licensing details. | ||
|
|
||
|
|
||
| { | ||
| "name": "OpenSPP Hazard Programs Integration", | ||
| "summary": "Links hazard impacts to program eligibility and entitlements. " | ||
| "Enables emergency programs to use hazard data for targeting and benefit calculation.", | ||
| "category": "OpenSPP/Targeting", | ||
| "version": "19.0.1.0.0", | ||
| "sequence": 1, | ||
| "author": "OpenSPP.org", | ||
| "website": "https://github.com/OpenSPP/OpenSPP2", | ||
| "license": "LGPL-3", | ||
| "development_status": "Alpha", | ||
| "maintainers": ["jeremi", "gonzalesedwin1123", "reichie020212"], | ||
| "depends": [ | ||
| "spp_hazard", | ||
| "spp_programs", | ||
| ], | ||
| "data": [ | ||
| "security/ir.model.access.csv", | ||
| "views/program_views.xml", | ||
| "views/incident_views.xml", | ||
| ], | ||
| "demo": [], | ||
| "assets": {}, | ||
| "application": False, | ||
| "installable": True, | ||
| "auto_install": True, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Part of OpenSPP. See LICENSE file for full copyright and licensing details. | ||
|
|
||
| from . import program | ||
| from . import incident |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
pyjwtdependency is specified twice. Please remove the line with justpyjwtand keeppyjwt>=2.4.0to avoid redundancy and ensure the correct version is used.