Skip to content

Commit

Permalink
API owner search add party types. (#2056)
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Lovett <doug@diamante.ca>
  • Loading branch information
doug-lovett authored Oct 31, 2024
1 parent f12b65c commit c3460ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mhr-api/migrations/versions/0001_rebase_2024-10.py
Original file line number Diff line number Diff line change
Expand Up @@ -3270,14 +3270,14 @@ def upgrade():
public_mhr_search_owner_bus_vw = PGView(
schema="public",
signature="mhr_search_owner_bus_vw",
definition="SELECT r.mhr_number, r.status_type, r.registration_ts, a.city,\n (SELECT s.serial_number\n FROM mhr_registrations rs, mhr_sections s\n WHERE rs.mhr_number = r.mhr_number \n AND rs.id = s.registration_id\n AND s.status_type = 'ACTIVE'\n ORDER BY s.id\n FETCH FIRST 1 ROWS ONLY) AS serial_number,\n d.year_made,\n d.make, d.model, r.id,\n p.business_name,\n og.status_type AS owner_status_type,\n p.compressed_name\n FROM mhr_registrations r,\n mhr_registrations rl,\n mhr_registrations rd,\n mhr_registrations ro,\n mhr_owner_groups og,\n mhr_parties p,\n mhr_locations l, \n addresses a, \n mhr_descriptions d\n WHERE (r.registration_type = 'MHREG' or r.registration_type = 'MHREG_CONVERSION')\n AND ro.mhr_number = r.mhr_number \n AND ro.id = og.registration_id\n AND og.registration_id = p.registration_id\n AND p.owner_group_id = og.id\n AND p.party_type = 'OWNER_BUS'\n AND r.mhr_number = rl.mhr_number\n AND r.mhr_number = rd.mhr_number\n AND rl.id = l.registration_id\n AND l.status_type = 'ACTIVE'\n AND l.address_id = a.id\n AND rd.id = d.registration_id\n AND d.status_type = 'ACTIVE'"
definition="SELECT r.mhr_number, r.status_type, r.registration_ts, a.city,\n (SELECT s.serial_number\n FROM mhr_registrations rs, mhr_sections s\n WHERE rs.mhr_number = r.mhr_number \n AND rs.id = s.registration_id\n AND s.status_type = 'ACTIVE'\n ORDER BY s.id\n FETCH FIRST 1 ROWS ONLY) AS serial_number,\n d.year_made,\n d.make, d.model, r.id,\n p.business_name,\n og.status_type AS owner_status_type,\n p.compressed_name\n FROM mhr_registrations r,\n mhr_registrations rl,\n mhr_registrations rd,\n mhr_registrations ro,\n mhr_owner_groups og,\n mhr_parties p,\n mhr_locations l, \n addresses a, \n mhr_descriptions d\n WHERE (r.registration_type = 'MHREG' or r.registration_type = 'MHREG_CONVERSION')\n AND ro.mhr_number = r.mhr_number \n AND ro.id = og.registration_id\n AND og.registration_id = p.registration_id\n AND p.owner_group_id = og.id\n AND p.party_type IN ('EXECUTOR', 'TRUSTEE', 'ADMINISTRATOR', 'TRUST', 'OWNER_BUS')\n AND r.mhr_number = rl.mhr_number\n AND r.mhr_number = rd.mhr_number\n AND rl.id = l.registration_id\n AND l.status_type = 'ACTIVE'\n AND l.address_id = a.id\n AND rd.id = d.registration_id\n AND d.status_type = 'ACTIVE'"
)
op.create_entity(public_mhr_search_owner_bus_vw)

public_mhr_search_owner_ind_vw = PGView(
schema="public",
signature="mhr_search_owner_ind_vw",
definition="SELECT r.mhr_number, r.status_type, r.registration_ts, a.city,\n (SELECT s.serial_number\n FROM mhr_registrations rs, mhr_sections s\n WHERE rs.mhr_number = r.mhr_number \n AND rs.id = s.registration_id\n AND s.status_type = 'ACTIVE'\n ORDER BY s.id\n FETCH FIRST 1 ROWS ONLY) AS serial_number,\n d.year_made,\n d.make, d.model, r.id,\n p.last_name,\n p.first_name,\n p.middle_name,\n og.status_type AS owner_status_type,\n p.compressed_name\n FROM mhr_registrations r,\n mhr_registrations rl,\n mhr_registrations rd,\n mhr_registrations ro,\n mhr_owner_groups og,\n mhr_parties p,\n mhr_locations l, \n addresses a, \n mhr_descriptions d\n WHERE (r.registration_type = 'MHREG' or r.registration_type = 'MHREG_CONVERSION')\n AND ro.mhr_number = r.mhr_number \n AND ro.id = og.registration_id\n AND og.registration_id = p.registration_id\n AND p.party_type = 'OWNER_IND'\n AND p.owner_group_id = og.id\n AND r.mhr_number = rl.mhr_number\n AND r.mhr_number = rd.mhr_number\n AND rl.id = l.registration_id\n AND l.status_type = 'ACTIVE'\n AND l.address_id = a.id\n AND rd.id = d.registration_id\n AND d.status_type = 'ACTIVE'"
definition="SELECT r.mhr_number, r.status_type, r.registration_ts, a.city,\n (SELECT s.serial_number\n FROM mhr_registrations rs, mhr_sections s\n WHERE rs.mhr_number = r.mhr_number \n AND rs.id = s.registration_id\n AND s.status_type = 'ACTIVE'\n ORDER BY s.id\n FETCH FIRST 1 ROWS ONLY) AS serial_number,\n d.year_made,\n d.make, d.model, r.id,\n p.last_name,\n p.first_name,\n p.middle_name,\n og.status_type AS owner_status_type,\n p.compressed_name\n FROM mhr_registrations r,\n mhr_registrations rl,\n mhr_registrations rd,\n mhr_registrations ro,\n mhr_owner_groups og,\n mhr_parties p,\n mhr_locations l, \n addresses a, \n mhr_descriptions d\n WHERE (r.registration_type = 'MHREG' or r.registration_type = 'MHREG_CONVERSION')\n AND ro.mhr_number = r.mhr_number \n AND ro.id = og.registration_id\n AND og.registration_id = p.registration_id\n AND p.party_type IN ('EXECUTOR', 'TRUSTEE', 'ADMINISTRATOR', 'TRUST', 'OWNER_IND')\n AND p.owner_group_id = og.id\n AND r.mhr_number = rl.mhr_number\n AND r.mhr_number = rd.mhr_number\n AND rl.id = l.registration_id\n AND l.status_type = 'ACTIVE'\n AND l.address_id = a.id\n AND rd.id = d.registration_id\n AND d.status_type = 'ACTIVE'"
)
op.create_entity(public_mhr_search_owner_ind_vw)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
AND ro.id = og.registration_id
AND og.registration_id = p.registration_id
AND p.owner_group_id = og.id
AND p.party_type = 'OWNER_BUS'
AND p.party_type IN ('EXECUTOR', 'TRUSTEE', 'ADMINISTRATOR', 'TRUST', 'OWNER_BUS')
AND r.mhr_number = rl.mhr_number
AND r.mhr_number = rd.mhr_number
AND rl.id = l.registration_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
AND ro.mhr_number = r.mhr_number
AND ro.id = og.registration_id
AND og.registration_id = p.registration_id
AND p.party_type = 'OWNER_IND'
AND p.party_type IN ('EXECUTOR', 'TRUSTEE', 'ADMINISTRATOR', 'TRUST', 'OWNER_IND')
AND p.owner_group_id = og.id
AND r.mhr_number = rl.mhr_number
AND r.mhr_number = rd.mhr_number
Expand Down

0 comments on commit c3460ab

Please sign in to comment.