Skip to content

Commit eed4049

Browse files
committed
remove imms-batch-app
1 parent b4b540d commit eed4049

File tree

7 files changed

+108
-330
lines changed

7 files changed

+108
-330
lines changed

backend/poetry.lock

Lines changed: 37 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ boto3 = "~1.38.35"
1313
boto3-stubs-lite = {extras = ["dynamodb"], version = "~1.38.35"}
1414
aws-lambda-typing = "~2.20.0"
1515
moto = "^5.1.4"
16+
redis = "^4.6.0"
1617
requests = "~2.32.4"
1718
responses = "~0.25.7"
1819
pydantic = "~1.10.13"

backend/src/fhir_controller.py

Lines changed: 53 additions & 257 deletions
Large diffs are not rendered by default.

backend/src/models/errors.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -265,27 +265,3 @@ class RecordProcessorError(Exception):
265265

266266
def __init__(self, diagnostics_dictionary: dict):
267267
self.diagnostics_dictionary = diagnostics_dictionary
268-
269-
class VaccineTypePermissionsError(Exception):
270-
"""
271-
Raised when a supplier tries to access a vaccine type they don't have permission for.
272-
"""
273-
274-
def __init__(self, message: str):
275-
super().__init__(message)
276-
self.message = message
277-
278-
def to_operation_outcome(self) -> dict:
279-
"""
280-
Converts the error to a FHIR-compliant OperationOutcome resource.
281-
"""
282-
return {
283-
"resourceType": "OperationOutcome",
284-
"issue": [
285-
{
286-
"severity": "error",
287-
"code": "forbidden",
288-
"diagnostics": self.message,
289-
}
290-
]
291-
}

backend/src/models/utils/permissions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from clients import redis_client
2-
from errors import VaccineTypePermissionsError
32
import json
43

54
def get_supplier_permissions(supplier: str) -> list[str]:

backend/tests/sample_data/permissions_config.py

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import unittest
2+
from unittest.mock import patch
3+
from src.models.utils.permissions import get_supplier_permissions
4+
5+
class TestPermissions(unittest.TestCase):
6+
7+
@patch("clients.redis_client.hget")
8+
def test_returns_list_if_permissions_exist(self, mock_hget):
9+
mock_hget.return_value = '["COVID19_FULL", "FLU_CREATE"]'
10+
result = get_supplier_permissions("DPSFULL")
11+
self.assertEqual(result, ["COVID19_FULL", "FLU_CREATE"])
12+
13+
@patch("clients.redis_client.hget")
14+
def test_returns_empty_list_if_no_permissions(self, mock_hget):
15+
mock_hget.return_value = None
16+
result = get_supplier_permissions("UNKNOWN")
17+
self.assertEqual(result, [])

0 commit comments

Comments
 (0)