Skip to content

Commit

Permalink
UXA RE reg type report updates, fix existing search history bug. (#1911)
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Jun 4, 2024
1 parent d03f47e commit 398a6bd
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="separator mt-5"></div>
{% endif %}
<div class="no-page-break">
<div class="section-title mt-3">Securities Act Notice</div>
<div class="section-title mt-3">Securities Order or Proceedings Notice</div>
{% if securitiesActNotices is defined and change is not defined %}
{% for notice in securitiesActNotices %}
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription|title }}</div>
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription }}</div>
<table class="no-page-break section-data court-order-table mt-3" role="presentation">
<tr>
<td class="section-sub-title">Effective Date:</td>
Expand Down Expand Up @@ -55,7 +55,7 @@
{% if change.addSecuritiesActNotices is defined %}
{% for notice in change.addSecuritiesActNotices %}
<div class="section-sub-title-blue mt-3">
{{ notice.registrationDescription|title }}
{{ notice.registrationDescription }}
{% if notice.amendNoticeId is defined%}<span class="label">AMENDED</span>{% else %}<span class="label">ADDED</span>{% endif %}
</div>
<table class="no-page-break section-data court-order-table mt-3" role="presentation">
Expand Down Expand Up @@ -116,7 +116,7 @@
{% if change.deleteSecuritiesActNotices is defined %}
{% for notice in change.deleteSecuritiesActNotices %}
{% if notice.edit is not defined %}
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription|title }} <span class="label">DELETED</span></div>
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription }} <span class="label">DELETED</span></div>
<table class="no-page-break section-data court-order-table mt-3" role="presentation">
<tr>
<td class="section-sub-title">Date of Effectiveness:</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="separator mt-5"></div>
{% endif %}
<div class="no-page-break">
<div class="section-title mt-3">Securities Act Notice</div>
<div class="section-title mt-3">Securities Order or Proceedings Notice</div>
{% if detail.financingStatement.securitiesActNotices is defined and change is not defined %}
{% for notice in detail.financingStatement.securitiesActNotices %}
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription|title }}</div>
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription }}</div>
<table class="no-page-break section-data court-order-table mt-3" role="presentation">
<tr>
<td class="section-sub-title">Effective Date:</td>
Expand Down Expand Up @@ -55,7 +55,7 @@
{% if change.addSecuritiesActNotices is defined %}
{% for notice in change.addSecuritiesActNotices %}
<div class="section-sub-title-blue mt-3">
{{ notice.registrationDescription|title }}
{{ notice.registrationDescription }}
{% if notice.amendNoticeId is defined%}<span class="label">AMENDED</span>{% else %}<span class="label">ADDED</span>{% endif %}
</div>
<table class="no-page-break section-data court-order-table mt-3" role="presentation">
Expand Down Expand Up @@ -116,7 +116,7 @@
{% if change.deleteSecuritiesActNotices is defined %}
{% for notice in change.deleteSecuritiesActNotices %}
{% if notice.edit is not defined %}
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription|title }} <span class="label">DELETED</span></div>
<div class="section-sub-title-blue mt-3">{{ notice.registrationDescription }} <span class="label">DELETED</span></div>
<table class="no-page-break section-data court-order-table mt-3" role="presentation">
<tr>
<td class="section-sub-title">Date of Effectiveness:</td>
Expand Down
6 changes: 3 additions & 3 deletions ppr-api/src/database/patch/15187-ppr-securities-act.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- 15178 begin release 1.2.5
INSERT INTO registration_types(registration_type, registration_type_cl, registration_desc, registration_act) VALUES
('SE', 'MISCLIEN', 'SECURITIES ACT NOTICE', 'SECURITIES ACT');
('SE', 'MISCLIEN', 'SECURITIES ORDER OR PROCEEDINGS NOTICE', 'MISCELLANEOUS REGISTRATIONS ACT');

ALTER TABLE account_bcol_ids
ADD COLUMN securities_act_ind VARCHAR(1) NULL CHECK (securities_act_ind IN ('Y', 'N'));
Expand All @@ -11,7 +11,7 @@ CREATE TABLE public.securities_act_types (
securities_act_type_desc VARCHAR (100) NOT NULL
);
INSERT INTO securities_act_types(securities_act_type, securities_act_type_desc) VALUES
('LIEN', 'NOTICE OF LIEN'),
('LIEN', 'NOTICE OF LIEN AND CHARGES'),
('PRESERVATION', 'PRESERVATION ORDER'),
('PROCEEDINGS', 'NOTICE OF PROCEEDINGS')
;
Expand Down Expand Up @@ -61,7 +61,7 @@ CREATE INDEX ix_sec_orders_change_registration_id ON public.securities_act_order

INSERT INTO registration_types(registration_type, registration_type_cl, registration_desc, registration_act) VALUES
('A1', 'AMENDMENT', 'AMENDMENT - NOTICE ADDED', 'SECURITIES ACT'),
('A2', 'AMENDMENT', 'AMENDMENT - NOTICE REMOVEd', 'SECURITIES ACT'),
('A2', 'AMENDMENT', 'AMENDMENT - NOTICE REMOVED', 'SECURITIES ACT'),
('A3', 'AMENDMENT', 'AMENDMENT - NOTICE AMENDED', 'SECURITIES ACT')
;
-- 15178 end release 1.2.5
16 changes: 16 additions & 0 deletions ppr-api/src/ppr_api/models/search_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@
SELECT sc.id, sc.search_ts, sc.api_criteria, sc.total_results_size, sc.returned_results_size,
(SELECT CASE WHEN sc.search_type IN ('MM', 'MI', 'MO', 'MS') THEN -1
WHEN sr.api_result IS NULL THEN 0
WHEN sc.updated_selection IS NULL THEN
(SELECT COUNT(*)
FROM json_array_elements(sr.api_result) sr2
WHERE sr2 ->> 'matchType' = 'EXACT')
ELSE (SELECT COUNT(*)
FROM json_array_elements(sr.api_result) sr2
WHERE sr2 ->> 'matchType' = 'EXACT') END) AS exact_match_count,
Expand Down Expand Up @@ -314,6 +318,10 @@
SELECT sc.id, sc.search_ts, sc.api_criteria, sc.total_results_size, sc.returned_results_size,
(SELECT CASE WHEN sc.search_type IN ('MM', 'MI', 'MO', 'MS') THEN -1
WHEN sr.api_result IS NULL THEN 0
WHEN sc.updated_selection IS NULL THEN
(SELECT COUNT(*)
FROM json_array_elements(sr.api_result) sr2
WHERE sr2 ->> 'matchType' = 'EXACT')
ELSE (SELECT COUNT(*)
FROM json_array_elements(sr.api_result) sr2
WHERE sr2 ->> 'matchType' = 'EXACT') END) AS exact_match_count,
Expand Down Expand Up @@ -342,6 +350,10 @@
ACCOUNT_SEARCH_HISTORY_DATE_QUERY_NEW = f"""
SELECT sc.id, sc.search_ts, sc.api_criteria, sc.total_results_size, sc.returned_results_size,
(SELECT CASE WHEN sc.search_type IN ('MM', 'MI', 'MO', 'MS') THEN -1
WHEN sc.updated_selection IS NULL THEN
(SELECT COUNT(*)
FROM json_array_elements(sr.api_result) sr2
WHERE sr2 ->> 'matchType' = 'EXACT')
ELSE (SELECT COUNT(*)
FROM json_array_elements(sc.updated_selection) sc2
WHERE sc2 ->> 'matchType' = 'EXACT') END) AS exact_match_count,
Expand Down Expand Up @@ -371,6 +383,10 @@
ACCOUNT_SEARCH_HISTORY_QUERY_NEW = f"""
SELECT sc.id, sc.search_ts, sc.api_criteria, sc.total_results_size, sc.returned_results_size,
(SELECT CASE WHEN sc.search_type IN ('MM', 'MI', 'MO', 'MS') THEN -1
WHEN sc.updated_selection IS NULL THEN
(SELECT COUNT(*)
FROM json_array_elements(sr.api_result) sr2
WHERE sr2 ->> 'matchType' = 'EXACT')
ELSE (SELECT COUNT(*)
FROM json_array_elements(sc.updated_selection) sc2
WHERE sc2 ->> 'matchType' = 'EXACT') END) AS exact_match_count,
Expand Down
4 changes: 3 additions & 1 deletion ppr-api/src/ppr_api/reports/v2/report_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,9 @@ def to_report_datetime(date_time: str, include_time: bool = True, expiry: bool =


def set_notice_date_time(notice: dict):
"""Conditionally set the Securities Act Notice dates."""
"""Conditionally set the Securities Act Notice dates and description title case."""
if notice.get('registrationDescription'):
notice['registrationDescription'] = format_description(notice.get('registrationDescription'))
if notice.get('effectiveDateTime'):
notice['effectiveDateTime'] = to_report_datetime(notice['effectiveDateTime'], False)
if notice.get('securitiesActOrders'):
Expand Down

0 comments on commit 398a6bd

Please sign in to comment.