Skip to content

API- MHR Out of Province report for Consumer Tax Branch #16725

Closed

Description

@lbergero819

Criteria for including MHR Registrations in the report:

• New registrations (Document Type 101)
• All MH Registration Numbers since the last program execution
• The Province entered for the Registered Location is not BC

Registration Information to be included in the report:
-MHR Registration number
-Registration Date
-Tenancy Type
-Fractional Ownership (interest for owner)
-Manufacturer
-Make
-Model
-Number of Sections
-Serial Numbers
-Year
-Circa (Y/N)
-Length
-Width

Replace existing mainframe job:
AMHRJPM1 – sequential file of all manufactured homes registered from out of province. Runs Monthly on the last workday of the month at 23:10. Report is sent to consumer taxation branch (Steven.Harrison@gov.bc.ca & Shawn.Mitchell@gov.bc.ca)

Example file from John McColl:
amhrp_x8_report_240927.txt

@arlentees the remaining registrations for the month of September as JSON are in a comment below. The amount of effort is the same to format as the existing text or a pdf with our report service.

And here is the updated mainframe report with the 4 registrations created after the data migration.
amhrp_x8_report_240930.txt

Activity

  1. doug-lovett commented on Sep 20, 2024

    @doug-lovett
    Collaborator

    @arlentees can we get an example report?

  2. arlentees commented on Sep 20, 2024

    @arlentees

    @doug-lovett hopefully yes - I've sent another email out to them with the details of this ticket, and asked to confirm and provide an example of the report.

    Putting an on-hold label until Assets can meet with the Consumer Tax Branch

  3. doug-lovett commented on Oct 1, 2024

    @doug-lovett
    Collaborator

    Mainframe job background provided by John McColl:
    The job retains the last MHREGNUM processed which is used in the subsequent execution to select only the new type 101 documents.

    Here is the program mainline along with the SQL cursors for DOCUMENT, MANUHOME, LOCATION tables. I also included the SQL found in the PRODUCE_REPOR procedure which were the OWNGROUP, OWNER and DESCRIPT tables.

    Just so you have a bit more of the background on the data retrieved for the report.

    CALL INIT_VARIABLES;

    CALL OPEN_DOCUMENT_C1;

    CALL FETCH_DOCUMENT_C1;

    DO WHILE (SQLCODE = SUCCESSFUL);

    CALL RETRIEVE_MANUHOME_T;

    IF SQLCODE = SUCCESSFUL

    THEN DO;

     CALL RETRIEVE_LOCATION_T;
    
     IF SQLCODE = SUCCESSFUL
    
     THEN  DO;
    
        IF LOCATION_T.PROVINCE ¬= 'BC'
    
        THEN DO;
    
           NUM_REGISTRATIONS = NUM_REGISTRATIONS + 1;
    
           CALL PRODUCE_REPORT;
    
        END;
    
     END;
    

    END;

    REF_RECORD.MHREGNUM = DOCUMENT_T.MHREGNUM;

    CALL FETCH_DOCUMENT_C1;

    END;

    OPEN_DOCUMENT_C1: PROC;

    /***$$$

    EXEC SQL DECLARE DOCUMENT_C1 CURSOR FOR

    SELECT DOCUMTID,
    
           MHREGNUM,
    
           REGIDATE,
    
           DOCUTYPE
    
    FROM DOCUMENT
    
    WHERE MHREGNUM >  :DOCUMENT_T.MHREGNUM
    
      AND DOCUTYPE =  '101'
    
    ORDER BY MHREGNUM
    
    FOR FETCH ONLY
    

    $$$***/

    RETRIEVE_MANUHOME_T: PROC;

    /***$$$

    EXEC SQL SELECT MANHOMID,

                  MHREGNUM
    
            INTO :MANUHOME_T.MANHOMID,
    
                 :MANUHOME_T.MHREGNUM
    
             FROM MANUHOME
    
            WHERE MHREGNUM = :DOCUMENT_T.MHREGNUM
    

    $$$***/

    RETRIEVE_LOCATION_T: PROC;

    /***$$$

    EXEC SQL SELECT MANHOMID,

                  REGDOCID,
    
                  PROVINCE
    
            INTO :LOCATION_T.MANHOMID,
    
                 :LOCATION_T.REGDOCID,
    
                 :LOCATION_T.PROVINCE
    
             FROM LOCATION
    
            WHERE MANHOMID = :MANUHOME_T.MANHOMID
    
              AND REGDOCID = :DOCUMENT_T.DOCUMTID
    

    $$$***/

    PRODUCE_REPORT: PROC;

    FIRST_OWNER = ON;

    CALL OPEN_OWNGROUP_C1;

    CALL FETCH_OWNGROUP_C1;

    DO WHILE (SQLCODE = SUCCESSFUL);

     CALL OPEN_OWNER_C1;
    
     CALL FETCH_OWNER_C1;
    
     DO WHILE (SQLCODE = SUCCESSFUL);
    
        CALL PRINT_OWNER_DETAIL;
    
        CALL FETCH_OWNER_C1;
    
     END;
    
     CALL CLOSE_OWNER_C1;
    
     CALL FETCH_OWNGROUP_C1;
    

    END;

    CALL CLOSE_OWNGROUP_C1;

    CALL RETRIEVE_DESCRIPT_T;

    IF SQLCODE = SUCCESSFUL

    THEN CALL PRINT_DESCRIPTION_DETAIL;

    END PRODUCE_REPORT;

    OPEN_OWNGROUP_C1: PROC;

    /***$$$

    EXEC SQL DECLARE OWNGROUP_C1 CURSOR FOR

    SELECT MANHOMID,
    
           OWNGRPID,
    
           REGDOCID,
    
           TENYTYPE,
    
           INTEREST
    
    FROM OWNGROUP
    
    WHERE MANHOMID  = :MANUHOME_T.MANHOMID
    
      AND REGDOCID  = :DOCUMENT_T.DOCUMTID
    
    ORDER BY MANHOMID, REGDOCID
    
    OPTIMIZE FOR 1 ROWS
    
    FOR FETCH ONLY
    

    $$$***/

    OPEN_OWNER_C1: PROC;

    /***$$$

    EXEC SQL DECLARE OWNER_C1 CURSOR FOR

    SELECT MANHOMID,
    
           OWNGRPID,
    
           OWNERID,
    
           OWNRNAME,
    
           OWNRADDR,
    
           OWNRPOCO
    
    FROM  OWNER
    
    WHERE MANHOMID  = :MANUHOME_T.MANHOMID
    
      AND OWNGRPID  = :OWNGROUP_T.OWNGRPID
    
    ORDER BY MANHOMID, OWNGRPID, OWNERID
    
    FOR FETCH ONLY
    

    $$$***/

    RETRIEVE_DESCRIPT_T: PROC;

    /***$$$

    EXEC SQL SELECT MANHOMID,

                  DESCRNID,
    
                  REGDOCID,
    
                  CANDOCID,
    
                  NUMBSECT,
    
                  SQARFEET,
    
                  YEARMADE,
    
                  CIRCA,
    
                  SERNUMB1,
    
                  SERNUMB2,
    
                  SERNUMB3,
    
                  SERNUMB4,
    
                  LENGTH1,
    
                  LENGTH2,
    
                  LENGTH3,
    
              LENGTH4,
    
              LENGIN1,
    
              LENGIN2,
    
              LENGIN3,
    
              LENGIN4,
    
              WIDTH1,
    
              WIDTH2,
    
              WIDTH3,
    
              WIDTH4,
    
              WIDIN1,
    
              WIDIN2,
    
              WIDIN3,
    
              WIDIN4,
    
              MANUNAME,
    
              MAKEMODL
    
        INTO :DESCRIPT_T.MANHOMID,
    
             :DESCRIPT_T.DESCRNID,
    
             :DESCRIPT_T.REGDOCID,
    
             :DESCRIPT_T.CANDOCID,
    
             :DESCRIPT_T.NUMBSECT,
    
                    :DESCRIPT_T.SQARFEET,
    
                    :DESCRIPT_T.YEARMADE,
    
                    :DESCRIPT_T.CIRCA,
    
                    :DESCRIPT_T.SERNUMB1,
    
                    :DESCRIPT_T.SERNUMB2,
    
                    :DESCRIPT_T.SERNUMB3,
    
                    :DESCRIPT_T.SERNUMB4,
    
                    :DESCRIPT_T.LENGTH1,
    
                    :DESCRIPT_T.LENGTH2,
    
                    :DESCRIPT_T.LENGTH3,
    
                    :DESCRIPT_T.LENGTH4,
    
                    :DESCRIPT_T.LENGIN1,
    
                    :DESCRIPT_T.LENGIN2,
    
                    :DESCRIPT_T.LENGIN3,
    
                    :DESCRIPT_T.LENGIN4,
    
                    :DESCRIPT_T.WIDTH1,
    
                    :DESCRIPT_T.WIDTH2,
    
                    :DESCRIPT_T.WIDTH3,
    
                    :DESCRIPT_T.WIDTH4,
    
                    :DESCRIPT_T.WIDIN1,
    
                  :DESCRIPT_T.WIDIN2,
    
                  :DESCRIPT_T.WIDIN3,
    
                  :DESCRIPT_T.WIDIN4,
    
                  :DESCRIPT_T.MANUNAME,
    
                  :DESCRIPT_T.MAKEMODL
    
              FROM DESCRIPT
    
             WHERE MANHOMID = :MANUHOME_T.MANHOMID
    
               AND REGDOCID = :DOCUMENT_T.DOCUMTID
    

    $$$***/

  4. doug-lovett commented on Oct 1, 2024

    @doug-lovett
    Collaborator

    For the month of September, here are the 4 homes that are out of province and registered after the MHR data migration:

    [
      {
        "mhrNumber": "108716",
        "createDateTime": "2024-09-26T18:20:21+00:00",
        "description": {
          "status": "ACTIVE",
          "sectionCount": 1,
          "csaNumber": "002726",
          "csaStandard": "Z240",
          "engineerName": "",
          "baseInformation": {
            "make": "",
            "model": "BC1672-306-CRD-1",
            "circa": false,
            "year": 2024
          },
          "rebuiltRemarks": "",
          "otherRemarks": "",
          "manufacturer": "TRIPLE M HOUSING LTD.",
          "sections": [
            {
              "serialNumber": "S60012634",
              "lengthFeet": 72,
              "lengthInches": 0,
              "widthFeet": 15,
              "widthInches": 6
            }
          ]
        },
        "ownerGroups": [
          {
            "groupId": 1,
            "type": "SOLE",
            "status": "ACTIVE",
            "tenancySpecified": true,
            "owners": [
              {
                "ownerId": 1004851,
                "status": "ACTIVE",
                "partyType": "OWNER_BUS",
                "organizationName": "TRIPLE M HOUSING LTD.",
                "address": {
                  "street": "3501 GIFFEN RD N",
                  "city": "LETHBRIDGE",
                  "region": "AB",
                  "country": "CA",
                  "postalCode": "T1H 0E8"
                },
                "phoneNumber": "4033208588",
                "type": "SOLE"
              }
            ]
          }
        ]
      },
      {
        "mhrNumber": "108718",
        "createDateTime": "2024-09-27T17:26:04+00:00",
        "description": {
          "status": "ACTIVE",
          "sectionCount": 1,
          "csaNumber": "002728",
          "csaStandard": "Z240",
          "engineerName": "",
          "baseInformation": {
            "make": "",
            "model": "BCOST1676-12655-C-1",
            "circa": false,
            "year": 2024
          },
          "rebuiltRemarks": "",
          "otherRemarks": "",
          "manufacturer": "TRIPLE M HOUSING LTD.",
          "sections": [
            {
              "serialNumber": "S60012655",
              "lengthFeet": 76,
              "lengthInches": 0,
              "widthFeet": 15,
              "widthInches": 6
            }
          ]
        },
        "ownerGroups": [
          {
            "groupId": 1,
            "type": "SOLE",
            "status": "ACTIVE",
            "tenancySpecified": true,
            "owners": [
              {
                "ownerId": 1004970,
                "status": "ACTIVE",
                "partyType": "OWNER_BUS",
                "organizationName": "TRIPLE M HOUSING LTD.",
                "address": {
                  "street": "3501 GIFFEN RD N",
                  "city": "LETHBRIDGE",
                  "region": "AB",
                  "country": "CA",
                  "postalCode": "T1H 0E8"
                },
                "phoneNumber": "4033208588",
                "type": "SOLE"
              }
            ]
          }
        ]
      },
      {
        "mhrNumber": "108719",
        "createDateTime": "2024-09-27T17:38:43+00:00",
        "description": {
          "status": "ACTIVE",
          "sectionCount": 1,
          "csaNumber": "002725",
          "csaStandard": "Z240",
          "engineerName": "",
          "baseInformation": {
            "make": "",
            "model": "MRD2276-267-CRD-2",
            "circa": false,
            "year": 2024
          },
          "rebuiltRemarks": "",
          "otherRemarks": "",
          "manufacturer": "TRIPLE M HOUSING LTD.",
          "sections": [
            {
              "serialNumber": "S60012629",
              "lengthFeet": 76,
              "lengthInches": 0,
              "widthFeet": 21,
              "widthInches": 8
            }
          ]
        },
        "ownerGroups": [
          {
            "groupId": 1,
            "type": "SOLE",
            "status": "ACTIVE",
            "tenancySpecified": true,
            "owners": [
              {
                "ownerId": 1004974,
                "status": "ACTIVE",
                "partyType": "OWNER_BUS",
                "organizationName": "TRIPLE M HOUSING LTD.",
                "address": {
                  "street": "3501 GIFFEN RD N",
                  "city": "LETHBRIDGE",
                  "region": "AB",
                  "country": "CA",
                  "postalCode": "T1H 0E8"
                },
                "phoneNumber": "4033208588",
                "type": "SOLE"
              }
            ]
          }
        ]
      },
      {
        "mhrNumber": "108721",
        "createDateTime": "2024-09-30T20:38:03+00:00",
        "description": {
          "status": "ACTIVE",
          "sectionCount": 1,
          "csaNumber": "PB-10992",
          "csaStandard": "A277",
          "engineerName": "",
          "baseInformation": {
            "make": "CUSTOM CJ ",
            "model": "CU24-102",
            "circa": false,
            "year": 2024
          },
          "rebuiltRemarks": "",
          "otherRemarks": "",
          "manufacturer": "CHAMPION CANADA MODULAR LTD. / SRI HOMES - LETHBRIDGE",
          "sections": [
            {
              "serialNumber": "31200PA015019A",
              "lengthFeet": 60,
              "lengthInches": 0,
              "widthFeet": 22,
              "widthInches": 0
            }
          ]
        },
        "ownerGroups": [
          {
            "groupId": 1,
            "type": "SOLE",
            "status": "ACTIVE",
            "tenancySpecified": true,
            "owners": [
              {
                "ownerId": 1005072,
                "status": "ACTIVE",
                "partyType": "OWNER_BUS",
                "organizationName": "CHAMPION CANADA MODULAR LTD.",
                "address": {
                  "street": "131 STUBB ROSS ROAD",
                  "city": "LETHBRIDGE",
                  "region": "AB",
                  "country": "CA",
                  "postalCode": "T1K 7N3"
                },
                "type": "SOLE"
              }
            ]
          }
        ]
      }
    ]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions