Work on ISHLT Impexium importing

This commit is contained in:
Scott Idem
2022-04-15 18:25:06 -04:00
parent 789d7372d9
commit a2e5f804d6
6 changed files with 303 additions and 22 deletions

View File

@@ -44,7 +44,8 @@ class Event_Badge_Base(BaseModel):
person_id: Optional[int]
external_id: Optional[str] # Generated internally or externally. Needs to be stable. It should not change.
external_sys_id: Optional[str] # Generated by external system (should be stable and not change)
external_sys_id: Optional[str] # Person ID generated by external system (should be stable and not change)
external_reg_id: Optional[str] # Registration ID generated by external system (should be stable and not change)
pronouns: Optional[str] # Preferred pronouns
informal_name: Optional[str]
@@ -62,7 +63,7 @@ class Event_Badge_Base(BaseModel):
professional_title: Optional[str] # Professional title
title: Optional[str] # NOTE: Phasing out! Use *professional_title* instead.
display_name: Optional[str] # Actual name shown on badge and other "public" areas
display_name: Optional[str] # # Override full_name; Actual name shown on badge and other "public" areas
# BEGIN # Auto created name variations
full_name: Optional[str] # title_names given_name middle_name family_name designations
@@ -70,6 +71,7 @@ class Event_Badge_Base(BaseModel):
affiliations: Optional[str] # One or more affiliations with organizations, companies, and other groups
affiliation: Optional[str] # NOTE: Phasing out! Use *affiliations* instead.
affiliation_name: Optional[str] # NOTE: Phasing out! Use *affiliations* instead.
display_affiliations: Optional[str] # Override affiliations
email: Optional[str]
@@ -86,6 +88,7 @@ class Event_Badge_Base(BaseModel):
location: Optional[str] # Actual location name shown on badge and other "public" areas
location_short: Optional[str] # Auto generated short version
location_long: Optional[str] # Auto generated long version
display_location: Optional[str] # Override location
# This is updated using SQL triggers and a SQL function
# Combines informal, given, middle, family, email
@@ -185,3 +188,127 @@ class Event_Badge_Base(BaseModel):
underscore_attrs_are_private = True
allow_population_by_field_name = True
fields = base_fields
class Event_Badge_Basic_Base(BaseModel):
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
id_random: Optional[str] = Field(
**base_fields['event_badge_id_random'],
alias = 'event_badge_id_random',
)
event_badge_template_id_random: Optional[str]
# event_badge_template_id: Optional[int]
event_person_id_random: Optional[str]
# event_person_id: Optional[int]
external_id: Optional[str] # Generated internally or externally. Needs to be stable. It should not change.
# external_sys_id: Optional[str] # Person ID generated by external system (should be stable and not change)
# external_reg_id: Optional[str] # Registration ID generated by external system (should be stable and not change)
pronouns: Optional[str] # Preferred pronouns
informal_name: Optional[str]
title_names: Optional[str] # Title for generation, official position, or professional or academic qualification, other honorific, or other name prefix
given_name: Optional[str]
middle_name: Optional[str]
family_name: Optional[str]
designations: Optional[str] # Temporary or long-term designations related to family, relationships, person differentiation (Junior/Senior), location, social status, professional qualifications, legal status, or other name suffix
professional_title: Optional[str] # Professional title
display_name: Optional[str] # Override full_name; Actual name shown on badge and other "public" areas
# BEGIN # Auto created name variations
full_name: Optional[str] # title_names given_name middle_name family_name designations
affiliations: Optional[str] # One or more affiliations with organizations, companies, and other groups
display_affiliations: Optional[str] # Override affiliations
email: Optional[str]
city: Optional[str]
county: Optional[str] # NOTE: This is for a county within a state or province
country_subdivision_code: Optional[str]
state_province: Optional[str]
state_province_abb: Optional[str]
country_alpha_2_code: Optional[str]
country: Optional[str]
# full_address: Optional[str]
location: Optional[str] # Actual location name shown on badge and other "public" areas
# location_short: Optional[str] # Auto generated short version
# location_long: Optional[str] # Auto generated long version
display_location: Optional[str] # Override location
# NOTE: More badge fields need to be added here once things are cleaned up
badge_type_code: Optional[str]
badge_type: Optional[str]
member_type_code: Optional[str]
member_type: Optional[str]
registration_type_code: Optional[str]
registration_type: Optional[str]
# other_1: Optional[str]
# other_2: Optional[str]
# agree_to_tc: Optional[bool] # Agree to terms and conditions
allow_tracking: Optional[bool] # Allow tracking for lead retrival and other marketing
# print_first_datetime: Optional[datetime.datetime] = None
# print_last_datetime: Optional[datetime.datetime] = None
# print_count: Optional[int]
# priority: Optional[bool]
# sort: Optional[int]
# group: Optional[str]
enable: Optional[bool]
# notes: Optional[str]
created_on: Optional[datetime.datetime] = None
updated_on: Optional[datetime.datetime] = None
# Including other related objects
# order: Optional[Union[Order_Base, None]]
# ticket_list: Optional[list]
event_badge_template: Optional[Union[Event_Badge_Template_Base, None]]
_processed_at: datetime.datetime = PrivateAttr(default_factory=datetime.datetime.now)
#@validator('event_badge_id_random', always=True)
# def event_badge_id_random_copy(cls, v, values, **kwargs):
# log.setLevel(logging.WARNING)
# log.debug(locals())
# if values['id_random']:
# return values['id_random']
# return None
# @validator('id', always=True)
# def event_badge_id_lookup(cls, v, values, **kwargs):
# if isinstance(v, int) and v > 0: return v
# elif id_random := values.get('id_random'):
# return redis_lookup_id_random(record_id_random=id_random, table_name='event_badge')
# return None
# @validator('event_badge_template_id', always=True)
# def event_badge_template_id_lookup(cls, v, values, **kwargs):
# if isinstance(v, int) and v > 0: return v
# elif id_random := values.get('event_badge_template_id_random'):
# return redis_lookup_id_random(record_id_random=id_random, table_name='event_badge_template')
# return None
# @validator('event_person_id', always=True)
# def event_person_id_lookup(cls, v, values, **kwargs):
# if isinstance(v, int) and v > 0: return v
# elif id_random := values.get('event_person_id_random'):
# return redis_lookup_id_random(record_id_random=id_random, table_name='event_person')
# return None
class Config:
underscore_attrs_are_private = True
allow_population_by_field_name = True
fields = base_fields

View File

@@ -38,6 +38,10 @@ class Event_Exhibit_Tracking_Base(BaseModel):
event_badge_id_random: Optional[str]
event_badge_id: Optional[int]
exhibitor_notes: Optional[str]
# json_data: Optional[str]
json_data: Optional[Json]
enable: Optional[bool]
hide: Optional[bool]
priority: Optional[bool] = False

View File

@@ -57,7 +57,8 @@ class Event_Person_Base(BaseModel):
user_id: Optional[int]
external_id: Optional[str] # Generated internally or externally. Needs to be stable. It should not change.
external_sys_id: Optional[str] # Generated by external system (should be stable and not change)
external_sys_id: Optional[str] # Person ID generated by external system (should be stable and not change)
external_reg_id: Optional[str] # Registration ID generated by external system (should be stable and not change)
file_count: Optional[int]