Work on person methods and related

This commit is contained in:
Scott Idem
2021-09-08 12:22:22 -04:00
parent 84aecddc7c
commit d0d8392817
12 changed files with 533 additions and 277 deletions

View File

@@ -24,10 +24,10 @@ from app.models.user_models import User_New_Base, User_Base
router = APIRouter()
# ### BEGIN ### API Event Person ### post_event_person_obj_new_v4() ###
# ### BEGIN ### API Event Person ### v4_post_event_person_obj_new() ###
# Updated 2021-08-25
@router.post('/event/person/new_v4', response_model=Resp_Body_Base)
async def post_event_person_obj_new_v4(
@router.post('/v4/event/person/new', response_model=Resp_Body_Base)
async def v4_post_event_person_obj_new(
event_person_obj: Event_Person_Base,
create_sub_obj: bool = False,
fail_any: bool = True, # Fail if any thing goes wrong for sub objects
@@ -81,13 +81,13 @@ async def post_event_person_obj_new_v4(
return mk_resp(data=data, response=response, status_message='The event person was created.')
else:
return mk_resp(data=False, status_code=400, response=response, status_message='The result from trying to create an event person was unexpected.')
# ### BEGIN ### API Event Person ### post_event_person_obj_new_v4() ###
# ### BEGIN ### API Event Person ### v4_post_event_person_obj_new() ###
# ### BEGIN ### API Event Person ### patch_event_person_obj_exist_v4() ###
# ### BEGIN ### API Event Person ### v4_patch_event_person_obj_exist() ###
# Updated 2021-08-25
@router.patch('/event/person/{event_person_id}/exist_v4', response_model=Resp_Body_Base)
async def patch_event_person_obj_exist_v4(
@router.patch('/v4/event/person/{event_person_id}/exist', response_model=Resp_Body_Base)
async def v4_patch_event_person_obj_exist(
event_person_obj: Event_Person_Base,
event_person_id: str = Query(..., min_length=11, max_length=22),
create_sub_obj: bool = False,
@@ -142,16 +142,16 @@ async def patch_event_person_obj_exist_v4(
return mk_resp(data=data, response=response, status_message='The event person was created.')
else:
return mk_resp(data=False, status_code=400, response=response, status_message='The result from trying to create an event person was unexpected.')
# ### END ### API Event Person ### patch_event_person_obj_exist_v4() ###
# ### END ### API Event Person ### v4_patch_event_person_obj_exist() ###
# ### BEGIN ### API Event Person Route ### post_event_person_new() ###
# ### BEGIN ### API Event Person Route ### v2_post_event_person_new() ###
# Initialize/create a new event person
# Create a person record (with a contact record and an address for the contact record)
# Create a user record
# Create an event_person record with the new person and user IDs
@router.post('/event/person/new', response_model=Resp_Body_Base)
async def post_event_person_new(
@router.post('/v2/event/person/new', response_model=Resp_Body_Base)
async def v2_post_event_person_new(
event_person_new_init: Event_Person_New_Base,
x_account_id: str = Header(...),
return_obj: bool = True,
@@ -332,7 +332,7 @@ async def post_event_person_new(
return mk_resp(data=event_person_dict)
#return mk_resp(data=event_person_obj)
# ### BEGIN ### API Event Person Route ### post_event_person_new() ###
# ### BEGIN ### API Event Person Route ### v2_post_event_person_new() ###
# ### BEGIN ### API Event Person ### patch_event_person_json() ###
@@ -393,7 +393,7 @@ async def get_event_person_obj(
#inc_event_person_list: bool = False,
inc_event_person_profile: bool = False,
inc_event_presentation_list: bool = False,
#inc_event_presenter_list: bool = False,
inc_event_presenter_list: bool = False,
inc_event_registration: bool = False,
#inc_event_track: bool = False,
inc_person: bool = False,
@@ -425,7 +425,7 @@ async def get_event_person_obj(
#inc_event_person_list = inc_event_person_list,
inc_event_person_profile = inc_event_person_profile,
inc_event_presentation_list = inc_event_presentation_list,
#inc_event_presenter_list = inc_event_presenter_list,
inc_event_presenter_list = inc_event_presenter_list,
inc_event_registration = inc_event_registration,
#inc_event_track = inc_event_track,
inc_person = inc_person,