def process(court_order_filing: Filing, filing: Dict, filing_meta: FilingMeta): """Render the court order filing into the business model objects.""" court_order_filing.court_order_file_number = filing['courtOrder'].get( 'fileNumber') court_order_filing.court_order_effect_of_order = filing['courtOrder'].get( 'effectOfOrder') court_order_filing.order_details = filing['courtOrder']['orderDetails'] with suppress(IndexError, KeyError, TypeError, ValueError): court_order_filing.court_order_date = datetime.fromisoformat( filing['courtOrder'].get('orderDate'))
def update_filing_court_order(filing_submission: Filing, court_order_json: Dict) -> Optional[Dict]: """Update the court_order info for a Filing.""" if not Filing: return {'error': babel('Filing required before alternate names can be set.')} filing_submission.court_order_file_number = court_order_json.get('fileNumber') filing_submission.court_order_effect_of_order = court_order_json.get('effectOfOrder') with suppress(IndexError, KeyError, TypeError, ValueError): filing_submission.court_order_date = datetime.fromisoformat(court_order_json.get('orderDate')) return None
def process(registrars_notation_filing: Filing, filing: Dict): """Render the registrars notation filing into the business model objects.""" registrars_notation_filing.court_order_file_number = filing[ 'registrarsNotation'].get('fileNumber') registrars_notation_filing.court_order_effect_of_order = filing[ 'registrarsNotation'].get('effectOfOrder') with suppress(IndexError, KeyError, TypeError, ValueError): registrars_notation_filing.court_order_date = datetime.fromisoformat( filing['registrarsNotation'].get('orderDate')) # add comment to the registrars notation filing registrars_notation_filing.comments.append( Comment(comment=filing['registrarsNotation']['orderDetails'], staff_id=registrars_notation_filing.submitter_id))
def process(court_order_filing: Filing, filing: Dict): """Render the court order filing into the business model objects.""" court_order_filing.court_order_file_number = filing['courtOrder'].get( 'fileNumber') court_order_filing.court_order_effect_of_order = filing['courtOrder'].get( 'effectOfOrder') with suppress(IndexError, KeyError, TypeError, ValueError): court_order_filing.court_order_date = datetime.fromisoformat( filing['courtOrder'].get('orderDate')) # add comment to the court order filing court_order_filing.comments.append( Comment(comment=filing['courtOrder']['orderDetails'], staff_id=court_order_filing.submitter_id))