-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/197-lfo-review-facilities-page
- Loading branch information
Showing
152 changed files
with
4,203 additions
and
815 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,12 @@ | ||
# Generated by Django 5.0.11 on 2025-01-22 21:03 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('common', '0030_V1_18_0'), | ||
] | ||
|
||
operations = [] |
This file contains 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 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 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 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 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 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
53 changes: 53 additions & 0 deletions
53
bc_obps/registration/api/v2/_transfer_events/transfer_id.py
This file contains 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,53 @@ | ||
from typing import Literal, Tuple | ||
from uuid import UUID | ||
from django.http import HttpRequest | ||
from ninja.types import DictStrAny | ||
from registration.constants import TRANSFER_EVENT_TAGS | ||
from registration.models import TransferEvent | ||
from common.api.utils import get_current_user_guid | ||
from common.permissions import authorize | ||
from registration.decorators import handle_http_errors | ||
from registration.api.router import router | ||
from registration.schema.generic import Message | ||
from registration.schema.v2.transfer_event import TransferEventOut, TransferEventUpdateIn | ||
from service.error_service.custom_codes_4xx import custom_codes_4xx | ||
from service.transfer_event_service import TransferEventService | ||
|
||
|
||
@router.get( | ||
"/transfer-events/{uuid:transfer_id}", | ||
response={200: TransferEventOut, custom_codes_4xx: Message}, | ||
tags=TRANSFER_EVENT_TAGS, | ||
description="""Retrieves the details of a specific transfer event by its ID. The endpoint checks if the current user is authorized to access the transfer event.""", | ||
auth=authorize("authorized_irc_user"), | ||
) | ||
@handle_http_errors() | ||
def get_transfer_event(request: HttpRequest, transfer_id: UUID) -> Tuple[Literal[200], TransferEvent]: | ||
return 200, TransferEventService.get_if_authorized(get_current_user_guid(request), transfer_id) | ||
|
||
|
||
@router.delete( | ||
"/transfer-events/{uuid:transfer_id}", | ||
response={200: DictStrAny, custom_codes_4xx: Message}, | ||
tags=TRANSFER_EVENT_TAGS, | ||
description="""Deletes a transfer event by its ID.""", | ||
auth=authorize("cas_analyst"), | ||
) | ||
@handle_http_errors() | ||
def delete_transfer_event(request: HttpRequest, transfer_id: UUID) -> Tuple[Literal[200], DictStrAny]: | ||
TransferEventService.delete_transfer_event(get_current_user_guid(request), transfer_id) | ||
return 200, {"success": True} | ||
|
||
|
||
@router.patch( | ||
"/transfer-events/{uuid:transfer_id}", | ||
response={200: TransferEventOut, custom_codes_4xx: Message}, | ||
tags=TRANSFER_EVENT_TAGS, | ||
description="""Updates the details of an existing transfer event by its ID.""", | ||
auth=authorize("cas_analyst"), | ||
) | ||
@handle_http_errors() | ||
def update_transfer_event( | ||
request: HttpRequest, transfer_id: UUID, payload: TransferEventUpdateIn | ||
) -> Tuple[Literal[200], TransferEvent]: | ||
return 200, TransferEventService.update_transfer_event(get_current_user_guid(request), transfer_id, payload) |
This file contains 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 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 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 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 |
---|---|---|
|
@@ -4,11 +4,11 @@ | |
"pk": 1, | ||
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "John", | ||
"last_name": "Doe", | ||
"first_name": "Alice", | ||
"last_name": "Art", | ||
"position_title": "Manager", | ||
"address": 1, | ||
"email": "john.doe@example.com", | ||
"email": "alice.art@example.com", | ||
"phone_number": "+16044011234" | ||
} | ||
}, | ||
|
@@ -17,11 +17,11 @@ | |
"pk": 2, | ||
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "Jane", | ||
"last_name": "Smith", | ||
"first_name": "Althea", | ||
"last_name": "Ark", | ||
"position_title": "Manager", | ||
"address": 2, | ||
"email": "jane.smith@example.com", | ||
"email": "althea.ark@example.com", | ||
"phone_number": "+16044011234" | ||
} | ||
}, | ||
|
@@ -30,11 +30,11 @@ | |
"pk": 3, | ||
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "Alice", | ||
"last_name": "Johnson", | ||
"first_name": "Bill", | ||
"last_name": "Blue", | ||
"position_title": "Manager", | ||
"address": 3, | ||
"email": "alice.johnson@example.com", | ||
"email": "bill.blue@example.com", | ||
"phone_number": "+16044011235" | ||
} | ||
}, | ||
|
@@ -56,11 +56,10 @@ | |
"pk": 5, | ||
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "Carol", | ||
"last_name": "Davis", | ||
"first_name": "Blair", | ||
"last_name": "Balloons - no address", | ||
"position_title": "Manager", | ||
"address": 5, | ||
"email": "[email protected]", | ||
"email": "[email protected]", | ||
"phone_number": "+16044011237" | ||
} | ||
}, | ||
|
@@ -69,11 +68,11 @@ | |
"pk": 6, | ||
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "Dave", | ||
"last_name": "Evans", | ||
"first_name": "Bart", | ||
"last_name": "Banker - incomplete address", | ||
"position_title": "Manager", | ||
"address": 6, | ||
"email": "dave.evans@example.com", | ||
"address": 21, | ||
"email": "bart.banker@example.com", | ||
"phone_number": "+16044011238" | ||
} | ||
}, | ||
|
@@ -135,9 +134,8 @@ | |
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "Ivy", | ||
"last_name": "Jones", | ||
"last_name": "Jones - no address", | ||
"position_title": "Manager", | ||
"address": 11, | ||
"email": "[email protected]", | ||
"phone_number": "+16044011243" | ||
} | ||
|
@@ -148,9 +146,9 @@ | |
"fields": { | ||
"business_role": "Operation Representative", | ||
"first_name": "Jack", | ||
"last_name": "King", | ||
"last_name": "King - incomplete address", | ||
"position_title": "Manager", | ||
"address": 12, | ||
"address": 21, | ||
"email": "[email protected]", | ||
"phone_number": "+16044011244" | ||
} | ||
|
Oops, something went wrong.