Skip to content

Commit

Permalink
[CHORE] Clean up CORE mine permits table (#3207)
Browse files Browse the repository at this point in the history
* refactor to something more manageable

* fix test, make permit data more complete
  • Loading branch information
taraepp authored Aug 7, 2024
1 parent 9f8006f commit e4a856f
Show file tree
Hide file tree
Showing 10 changed files with 644 additions and 654 deletions.
126 changes: 93 additions & 33 deletions services/common/src/tests/mocks/dataMocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
IProject,
IProjectSummary,
IInformationRequirementsTable,
IPermit,
} from "@mds/common/interfaces";
import {
MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODES,
MINE_INCIDENT_DOCUMENT_TYPE_CODE,
NodStatusSaveEnum,
NoDTypeSaveEnum,
PROJECT_SUMMARY_STATUS_CODES,
VC_CONNECTION_STATES,
VC_CRED_ISSUE_STATES,
} from "@mds/common/constants";

Expand Down Expand Up @@ -1127,7 +1129,7 @@ export const MINE_TSF_REQUIRED_REPORTS_HASH = {
"faa99067-3639-4d9c-a3e5-5401df15ad4b": "5 year DSR",
};

export const PERMITS = [
export const PERMITS: IPermit[] = [
{
permit_id: "283",
permit_guid: "1628847c-060b-45f2-990f-815877174801",
Expand All @@ -1139,76 +1141,127 @@ export const PERMITS = [
active_bond_total: 700,
permit_amendments: [
{
permit_amendment_id: 1,
permit_no: "C-12345",
security_received_date: "2019-04-03",
security_not_required: false,
security_not_required_reason: "",
issuing_inspector_title: "Inspector Gadget",
regional_office: "region",
now_application_guid: "",
now_application_documents: [],
imported_now_application_documents: [],
permit_conditions_last_updated_by: "Condition Updater",
permit_conditions_last_updated_date: "2019-04-04",
has_permit_conditions: false,
conditions: [],
is_generated_in_core: false,
preamble_text: "words",
vc_credential_exch_state: VC_CRED_ISSUE_STATES.issued,
permit_amendment_guid: "822310fd-3a2c-44a9-a9ce-dee81acc9585",
permit_guid: "71d00d45-9fda-45d3-a4b0-59a7ceb6518e",
permit_amendment_status_code: "ACT",
permit_amendment_type_code: "OGP",
received_date: null,
issue_date: "2019-04-01",
authorization_end_date: null,
liability_adjustment: "1000000",
liability_adjustment: 1000000,
description: "Initial permit issued.",
related_documents: [
{
permit_id: 283,
mine_guid: "8e9ca839-a28e-427e-997e-9ef23d9d97cd",
document_guid: "31204ba5-5207-4fb5-b6c3-d47e55a0971c",
permit_amendment_document_guid: "31204ba5-5207-4fb5-b6c3-d47e55a0971c",
document_name: "Adams_amendment_1.pdf",
document_manager_guid: "64caef0e-060d-4875-a470-6c225b242723",
active_ind: true,
preamble_author: "Preamble Author",
preamble_title: "Preamble Title",
preamble_date: "2019-04-02",
},
],
},
{
permit_amendment_id: 2,
permit_no: "C-12345",
security_received_date: "2019-04-03",
security_not_required: false,
security_not_required_reason: "",
issuing_inspector_title: "Inspector Gadget",
regional_office: "region",
now_application_guid: "",
now_application_documents: [],
imported_now_application_documents: [],
permit_conditions_last_updated_by: "Condition Updater",
permit_conditions_last_updated_date: "2019-04-04",
has_permit_conditions: false,
conditions: [],
is_generated_in_core: false,
preamble_text: "words",
vc_credential_exch_state: VC_CRED_ISSUE_STATES.issued,
permit_amendment_guid: "8729830e-5e9a-4be8-9eef-dac4af775f1d",
permit_guid: "71d00d45-9fda-45d3-a4b0-59a7ceb6518e",
permit_amendment_status_code: "ACT",
permit_amendment_type_code: "AMD",
received_date: null,
issue_date: "2020-04-01",
authorization_end_date: null,
liability_adjustment: "7000000",
liability_adjustment: 7000000,
description: "Amendment",
related_documents: [
{
permit_id: 1,
mine_guid: "8e9ca839-a28e-427e-997e-9ef23d9d97cd",
document_guid: "31204ba5-5207-4fb5-b6c3-d47e55a0971c",
permit_amendment_document_guid: "31204ba5-5207-4fb5-b6c3-d47e55a0971c",
document_name: "Adams_amendment_1.pdf",
document_manager_guid: "64caef0e-060d-4875-a470-6c225b242723",
active_ind: true,
preamble_author: "Preamble Author",
preamble_title: "Preamble Title",
preamble_date: "2019-04-02",
},
],
},
],
site_properties: [
{
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_guid: "3b118b13-7397-4512-8021-c11ed90ce14c",
permit_guid: "67074e37-b7c6-475d-ade6-eb24fdbd1e13",
now_application_guid: null,
mine_tenure_type_code: "MIN",
mine_type_detail: [
{
mine_type_detail_xref_guid: "467cf2f1-7707-4acd-8c58-a385b3acc16f",
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_disturbance_code: null,
mine_commodity_code: "AL",
},
{
mine_type_detail_xref_guid: "2bab57dd-d5d0-49bd-bd31-774fa40779db",
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_disturbance_code: "UND",
mine_commodity_code: null,
},
],
},
],
site_properties: {
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_guid: "3b118b13-7397-4512-8021-c11ed90ce14c",
permit_guid: "67074e37-b7c6-475d-ade6-eb24fdbd1e13",
now_application_guid: null,
mine_tenure_type_code: "MIN",
mine_type_detail: [
{
mine_type_detail_xref_guid: "467cf2f1-7707-4acd-8c58-a385b3acc16f",
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_disturbance_code: null,
mine_commodity_code: "AL",
},
{
mine_type_detail_xref_guid: "2bab57dd-d5d0-49bd-bd31-774fa40779db",
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_disturbance_code: "UND",
mine_commodity_code: null,
},
],
},
current_permittee: "Current Permittee",
current_permittee_digital_wallet_connection_state: VC_CONNECTION_STATES.invitation,
current_permittee_guid: "",
project_id: "",
remaining_static_liability: 0,
bonds: [],
exemption_fee_status_code: "",
exemption_fee_status_note: "",
permit_prefix: "",
update_user: "",
update_timestamp: "",
},
{
permit_id: 2484,
permit_id: "2484",
permit_guid: "67074e37-b7c6-475d-ade6-eb24fdbd1e13",
permit_no: "M-12345",
permit_status_code: "O",
current_permittee: "TEST corp",
current_permittee_guid: "c391c1ab-3652-4804-80ae-7b81b8d05ed9",
current_permittee_digital_wallet_connection_state: "active",
current_permittee_digital_wallet_connection_state: VC_CONNECTION_STATES.active,
project_id: null,
permit_amendments: [
{
Expand All @@ -1220,7 +1273,7 @@ export const PERMITS = [
received_date: null,
issue_date: "2024-03-07T00:00:00",
authorization_end_date: "2026-03-26T00:00:00",
liability_adjustment: "1000000.00",
liability_adjustment: 1000000.0,
security_received_date: "2024-03-07T00:00:00",
security_not_required: null,
security_not_required_reason: null,
Expand Down Expand Up @@ -1251,8 +1304,15 @@ export const PERMITS = [
mine_tenure_type_code: "MIN",
mine_commodity_code: ["AL"],
mine_disturbance_code: ["UND"],
mine_type_guid: "2cf4cd5c-c7f8-4607-afe4-245ee0fd20db",
mine_guid: "3b118b13-7397-4512-8021-c11ed90ce14c",
permit_guid: "67074e37-b7c6-475d-ade6-eb24fdbd1e13",
now_application_guid: null,
mine_type_detail: [],
},
permit_prefix: "M",
update_user: "",
update_timestamp: "",
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ export const MinePermitInfo: FC<MinePermitInfoProps> = (props) => {
<MinePermitTable
isLoaded={isLoaded}
permits={props.permits}
major_mine_ind={mine.major_mine_ind}
openEditPermitModal={openEditPermitModal}
openEditAmendmentModal={openEditAmendmentModal}
openEditSitePropertiesModal={openEditSitePropertiesModal}
Expand Down
Loading

0 comments on commit e4a856f

Please sign in to comment.