Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #337 from communitiesuk/FS-4389-hsra-seed-data
Browse files Browse the repository at this point in the history
FS-4389: HSRA seed data config
  • Loading branch information
hamzabinkhalid authored May 15, 2024
2 parents 15d7c4b + fd27846 commit 6a380ae
Show file tree
Hide file tree
Showing 7 changed files with 793 additions and 40 deletions.
10 changes: 5 additions & 5 deletions api/routes/application/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
from flask import request
from flask import send_file
from flask.views import MethodView
from fsd_utils import Eoi_Decision
from fsd_utils import evaluate_eoi_response
from fsd_utils import Decision
from fsd_utils import evaluate_response
from fsd_utils.config.notify_constants import NotifyConstants
from sqlalchemy.orm.exc import NoResultFound

Expand Down Expand Up @@ -207,10 +207,10 @@ def submit(self, application_id):
NotifyConstants.MAGIC_LINK_CONTACT_HELP_EMAIL_FIELD: round_data.contact_email,
NotifyConstants.APPLICATION_CAVEATS: eoi_results["caveats"],
}
if Eoi_Decision(eoi_decision) == Eoi_Decision.PASS: # EOI Full pass
if Decision(eoi_decision) == Decision.PASS: # EOI Full pass
notify_template = Config.NOTIFY_TEMPLATE_EOI_PASS

elif Eoi_Decision(eoi_decision) == Eoi_Decision.PASS_WITH_CAVEATS: # EOI Pass with caveats
elif Decision(eoi_decision) == Decision.PASS_WITH_CAVEATS: # EOI Pass with caveats
notify_template = Config.NOTIFY_TEMPLATE_EOI_PASS_W_CAVEATS
else:
notify_template = None
Expand Down Expand Up @@ -330,5 +330,5 @@ def get_all_feedbacks_and_survey_report(self, **params):

def get_application_eoi_response(self, application):
eoi_schema = get_round_eoi_schema(application["fund_id"], application["round_id"], application["language"])
result = evaluate_eoi_response(eoi_schema, application["forms"])
result = evaluate_response(eoi_schema, application["forms"])
return result
30 changes: 15 additions & 15 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements-dev.in
Expand Down Expand Up @@ -88,12 +88,6 @@ clickclick==20.10.2
# via
# -r requirements.txt
# connexion
colorama==0.4.6
# via
# -r requirements.txt
# build
# click
# pytest
colored==1.4.4
# via -r requirements.txt
commonmark==0.9.1
Expand All @@ -120,6 +114,8 @@ et-xmlfile==1.1.0
# via
# -r requirements.txt
# openpyxl
exceptiongroup==1.2.1
# via pytest
filelock==3.8.0
# via virtualenv
flake8==7.0.0
Expand Down Expand Up @@ -164,12 +160,8 @@ flipper-client==1.3.1
# via
# -r requirements.txt
# funding-service-design-utils
funding-service-design-utils==2.0.41
funding-service-design-utils==2.0.47
# via -r requirements.txt
greenlet==3.0.1
# via
# -r requirements.txt
# sqlalchemy
gunicorn==20.1.0
# via
# -r requirements.txt
Expand Down Expand Up @@ -328,7 +320,6 @@ pyjwt[crypto]==2.6.0
# via
# -r requirements.txt
# funding-service-design-utils
# pyjwt
pyparsing==3.0.9
# via
# -r requirements.txt
Expand Down Expand Up @@ -416,6 +407,10 @@ ruamel-yaml==0.17.21
# via
# -r requirements.txt
# prance
ruamel-yaml-clib==0.2.8
# via
# -r requirements.txt
# ruamel-yaml
s3transfer==0.6.0
# via
# -r requirements.txt
Expand All @@ -428,7 +423,6 @@ sentry-sdk[flask]==1.32.0
# via
# -r requirements.txt
# funding-service-design-utils
# sentry-sdk
six==1.16.0
# via
# -r requirements.txt
Expand Down Expand Up @@ -467,6 +461,13 @@ thrift==0.16.0
# flipper-client
toml==0.10.2
# via pre-commit
tomli==2.0.1
# via
# black
# build
# flake8-pyproject
# pip-tools
# pytest
typing-extensions==4.4.0
# via
# -r requirements.txt
Expand All @@ -476,7 +477,6 @@ tzdata==2023.3
# via
# -r requirements.txt
# pandas
# tzlocal
tzlocal==5.2
# via
# -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
connexion
flask_restx
funding-service-design-utils>=2.0.41,<2.1.0
funding-service-design-utils>=2.0.47,<2.1.0
openapi-spec-validator
prance
requests
Expand Down
22 changes: 7 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements.in
Expand Down Expand Up @@ -48,8 +48,6 @@ click==8.1.7
# flask
clickclick==20.10.2
# via connexion
colorama==0.4.6
# via click
colored==1.4.4
# via -r requirements.in
commonmark==0.9.1
Expand Down Expand Up @@ -93,10 +91,8 @@ flask-sqlalchemy==3.0.3
# funding-service-design-utils
flipper-client==1.3.1
# via funding-service-design-utils
funding-service-design-utils==2.0.41
funding-service-design-utils==2.0.47
# via -r requirements.in
greenlet==3.0.1
# via sqlalchemy
gunicorn==20.1.0
# via funding-service-design-utils
idna==3.4
Expand Down Expand Up @@ -181,9 +177,7 @@ pyee==6.0.0
pygments==2.15.0
# via rich
pyjwt[crypto]==2.6.0
# via
# funding-service-design-utils
# pyjwt
# via funding-service-design-utils
pyparsing==3.0.9
# via packaging
python-consul==1.1.0
Expand Down Expand Up @@ -239,14 +233,14 @@ rpds-py==0.12.0
# referencing
ruamel-yaml==0.17.21
# via prance
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
s3transfer==0.6.0
# via boto3
semver==2.13.0
# via prance
sentry-sdk[flask]==1.32.0
# via
# funding-service-design-utils
# sentry-sdk
# via funding-service-design-utils
six==1.16.0
# via
# apscheduler
Expand Down Expand Up @@ -283,9 +277,7 @@ typing-extensions==4.4.0
# alembic
# sqlalchemy
tzdata==2023.3
# via
# pandas
# tzlocal
# via pandas
tzlocal==5.2
# via apscheduler
urllib3==1.26.18
Expand Down
15 changes: 13 additions & 2 deletions scripts/seed_db_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,32 @@
}
},
},
"HSRA": {
"id": UsefulConfig.HSRA_FUND_ID,
"short_code": "HSRA",
"rounds": {
"R1": {
"short_code": "R1",
"id": UsefulConfig.HSRA_ROUND_1_ID,
"project_name_form": "name-your-application-hsra",
}
},
},
}


@click.command()
@click.option(
"--fund_short_code",
default="COF",
type=click.Choice(["COF", "NSTF"]),
type=click.Choice(["COF", "NSTF", "HSRA"]),
help="Fund to seed applications for",
prompt=True,
)
@click.option(
"--round_short_code",
default="R3W2",
type=click.Choice(["R3W2", "R3W1", "R2"]),
type=click.Choice(["R3W2", "R3W1", "R2", "R1"]),
help="Round to seed applications for",
prompt=True,
)
Expand Down
Loading

0 comments on commit 6a380ae

Please sign in to comment.