Work on person methods and related
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -476,6 +476,7 @@ async def get_event_session_obj(
|
||||
inc_event_file_list: bool = False,
|
||||
inc_event_location: bool = False,
|
||||
inc_event_person: bool = False, # Under event_presenter
|
||||
inc_event_person_profile: bool = False, # Under event_person
|
||||
inc_event_person_list: bool = False,
|
||||
inc_event_presentation_list: bool = False,
|
||||
inc_event_presenter_cat: bool = False,
|
||||
@@ -509,6 +510,7 @@ async def get_event_session_obj(
|
||||
inc_event_file_list = inc_event_file_list,
|
||||
inc_event_location = inc_event_location,
|
||||
inc_event_person = inc_event_person,
|
||||
inc_event_person_profile = inc_event_person_profile,
|
||||
inc_event_person_list = inc_event_person_list,
|
||||
inc_event_presentation_list = inc_event_presentation_list,
|
||||
inc_event_presenter_cat = inc_event_presenter_cat,
|
||||
|
||||
@@ -72,10 +72,10 @@ async def patch_person_obj(
|
||||
return result
|
||||
|
||||
|
||||
# ### BEGIN ### API Person ### post_person_obj_new_v3() ###
|
||||
# ### BEGIN ### API Person ### v3_post_person_obj_new() ###
|
||||
# Updated 2021-08-24
|
||||
@router.post('/person/new_v3', response_model=Resp_Body_Base)
|
||||
async def post_person_obj_new_v3(
|
||||
@router.post('/v3/person/new', response_model=Resp_Body_Base)
|
||||
async def v3_post_person_obj_new(
|
||||
person_obj: Person_Base,
|
||||
create_sub_obj: bool = False,
|
||||
fail_any: bool = True, # Fail if any thing goes wrong for sub objects
|
||||
@@ -132,13 +132,13 @@ async def post_person_obj_new_v3(
|
||||
return mk_resp(data=data, response=response, status_message='The person was created.')
|
||||
else:
|
||||
return mk_resp(data=False, status_code=400, response=response, status_message='The result from trying to create an person was unexpected.')
|
||||
# ### BEGIN ### API Person ### post_person_obj_new_v3() ###
|
||||
# ### BEGIN ### API Person ### v3_post_person_obj_new() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Person ### patch_person_obj_exist_v3() ###
|
||||
# ### BEGIN ### API Person ### v3_patch_person_obj_exist ###
|
||||
# Updated 2021-08-24
|
||||
@router.patch('/person/{person_id}/exist_v3', response_model=Resp_Body_Base)
|
||||
async def patch_person_obj_exist_v3(
|
||||
@router.patch('/v3/person/{person_id}/exist', response_model=Resp_Body_Base)
|
||||
async def v3_patch_person_obj_exist(
|
||||
person_obj: Person_Base,
|
||||
person_id: str = Query(..., min_length=11, max_length=22),
|
||||
create_sub_obj: bool = False,
|
||||
@@ -179,7 +179,7 @@ async def patch_person_obj_exist_v3(
|
||||
return mk_resp(data=data, response=response, status_message='The person was created.')
|
||||
else:
|
||||
return mk_resp(data=False, status_code=400, response=response, status_message='The result from trying to create an person was unexpected.')
|
||||
# ### END ### API Person ### patch_person_obj_exist_v3() ###
|
||||
# ### END ### API Person ### v3_patch_person_obj_exist ###
|
||||
|
||||
|
||||
|
||||
@@ -390,7 +390,8 @@ async def get_person_obj(
|
||||
if person_dict := load_person_obj(
|
||||
person_id = person_id,
|
||||
limit = limit,
|
||||
model_as_dict = True, # NOTE: returning model as a dict
|
||||
exclude_unset = False,
|
||||
model_as_dict = False, # NOTE: returning model as a dict
|
||||
enabled = enabled,
|
||||
inc_address = inc_address,
|
||||
# inc_archive_list = inc_archive_list,
|
||||
|
||||
Reference in New Issue
Block a user