Skip to content

Commit 1442806

Browse files
committed
Add borden number tests for upstream failures
Add permit application filing_type, associated controlled list and update unit tests to align Rename initial workflow title to support BT changes
1 parent 392c609 commit 1442806

15 files changed

Lines changed: 341 additions & 52 deletions

File tree

bcap/migrations/1290_add_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def add_plugin_config(apps, schema_editor):
77
plugin = Plugin()
8-
plugin.name = {"en": "External Permit Submissions"}
8+
plugin.name = {"en": "External Submissions"}
99
plugin.icon = "fa fa-play-circle"
1010
plugin.component = "views/components/plugins/external-permit-workflows"
1111
plugin.componentname = "external-permit-workflows"

bcap/pkg/graphs/resource_models/Permit Application.json

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -703,11 +703,30 @@
703703
"en": "Project Name"
704704
},
705705
"node_id": "47064904-4bf4-49c6-a9ea-61915a5d512b",
706-
"sortorder": null,
706+
"sortorder": 2,
707707
"source_identifier_id": null,
708708
"visible": true,
709709
"widget_id": "10000000-0000-0000-0000-000000000001"
710710
},
711+
{
712+
"card_id": "2cecb3b6-f430-4e6a-a597-a9b70823c58d",
713+
"config": {
714+
"i18n_properties": ["placeholder"],
715+
"label": "Filing Type",
716+
"placeholder": {
717+
"en": "Select an option"
718+
}
719+
},
720+
"id": "5edbbbac-39dc-4979-9e0e-1f7810215e46",
721+
"label": {
722+
"en": "Filing Type"
723+
},
724+
"node_id": "c4506124-e2d8-4fc9-8bc5-c6fa564d0bdf",
725+
"sortorder": 1,
726+
"source_identifier_id": null,
727+
"visible": true,
728+
"widget_id": "19e56148-82b8-47eb-b66e-f6243639a1a8"
729+
},
711730
{
712731
"card_id": "79ef3bc7-4c2d-4c30-89f7-f329b324569f",
713732
"config": {
@@ -767,7 +786,7 @@
767786
"en": "Is Replacement"
768787
},
769788
"node_id": "aabddd33-2476-4572-b8b6-50766004772d",
770-
"sortorder": null,
789+
"sortorder": 4,
771790
"source_identifier_id": null,
772791
"visible": true,
773792
"widget_id": "10000000-0000-0000-0000-000000000006"
@@ -786,7 +805,7 @@
786805
"en": "MAP or HIP"
787806
},
788807
"node_id": "9f846e12-abac-48d5-b6c6-b325b9616c8c",
789-
"sortorder": null,
808+
"sortorder": 3,
790809
"source_identifier_id": null,
791810
"visible": true,
792811
"widget_id": "19e56148-82b8-47eb-b66e-f6243639a1a8"
@@ -825,7 +844,7 @@
825844
"en": "Supplemental Information"
826845
},
827846
"node_id": "3794179e-c749-4c12-9060-4a974a710e83",
828-
"sortorder": null,
847+
"sortorder": 5,
829848
"source_identifier_id": null,
830849
"visible": true,
831850
"widget_id": "10000000-0000-0000-0000-000000000019"
@@ -1017,7 +1036,7 @@
10171036
"en": "Application ID"
10181037
},
10191038
"node_id": "6256c464-bc9a-4b37-8b07-993fc213baf3",
1020-
"sortorder": null,
1039+
"sortorder": 0,
10211040
"source_identifier_id": null,
10221041
"visible": true,
10231042
"widget_id": "10000000-0000-0000-0000-000000000001"
@@ -1294,6 +1313,16 @@
12941313
"rangenode_id": "e03c1f16-3d9c-4f20-b749-fd49b9bfd05c",
12951314
"source_identifier_id": null
12961315
},
1316+
{
1317+
"description": null,
1318+
"domainnode_id": "e03c1f16-3d9c-4f20-b749-fd49b9bfd05c",
1319+
"edgeid": "28527ac9-6c34-40ac-ba6a-531c63ed595b",
1320+
"graph_id": "5c900e2b-257c-4af3-b67f-b5caf3850f71",
1321+
"name": null,
1322+
"ontologyproperty": "http://www.cidoc-crm.org/cidoc-crm/P2_has_type",
1323+
"rangenode_id": "c4506124-e2d8-4fc9-8bc5-c6fa564d0bdf",
1324+
"source_identifier_id": null
1325+
},
12971326
{
12981327
"description": null,
12991328
"domainnode_id": "8e109012-2e5f-4248-bf37-7e19851a97c2",
@@ -3233,6 +3262,32 @@
32333262
"source_identifier_id": null,
32343263
"sourcebranchpublication_id": null
32353264
},
3265+
{
3266+
"alias": "filing_type",
3267+
"config": {
3268+
"controlledList": "cfda6f18-56a4-4946-becf-fdf86994f275",
3269+
"multiValue": false
3270+
},
3271+
"datatype": "reference",
3272+
"description": "This identifies how the proponent is wanting to engage with the Archaeology Branch",
3273+
"exportable": false,
3274+
"fieldname": null,
3275+
"graph_id": "5c900e2b-257c-4af3-b67f-b5caf3850f71",
3276+
"hascustomalias": false,
3277+
"is_collector": false,
3278+
"is_immutable": false,
3279+
"isrequired": true,
3280+
"issearchable": true,
3281+
"istopnode": false,
3282+
"name": "Filing Type",
3283+
"nodegroup_id": "e03c1f16-3d9c-4f20-b749-fd49b9bfd05c",
3284+
"nodeid": "c4506124-e2d8-4fc9-8bc5-c6fa564d0bdf",
3285+
"ontologyclass": "http://www.cidoc-crm.org/cidoc-crm/E55_Type",
3286+
"parentproperty": "http://www.cidoc-crm.org/cidoc-crm/P2_has_type",
3287+
"sortorder": 0,
3288+
"source_identifier_id": null,
3289+
"sourcebranchpublication_id": null
3290+
},
32363291
{
32373292
"alias": "related_permit",
32383293
"config": {
@@ -3582,9 +3637,9 @@
35823637
"publication": {
35833638
"graph_id": "5c900e2b-257c-4af3-b67f-b5caf3850f71",
35843639
"most_recent_edit_id": null,
3585-
"notes": "Added Permit Messages node",
3586-
"publicationid": "b295a44d-6a22-4a30-bd79-919a8ac6db51",
3587-
"published_time": "2026-06-16T16:16:11.909"
3640+
"notes": "Add filing type",
3641+
"publicationid": "ce370e68-c734-4886-a390-aa04197a414c",
3642+
"published_time": "2026-07-12T11:21:00.991"
35883643
},
35893644
"relatable_resource_model_ids": [],
35903645
"resource_2_resource_constraints": [],
@@ -3683,9 +3738,9 @@
36833738
}
36843739
],
36853740
"metadata": {
3686-
"db": "PostgreSQL 16.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2), 64-bit",
3687-
"git hash": "fatal: not a git repository (or any parent up to mount point /fs)",
3741+
"db": "PostgreSQL 16.3 (Debian 16.3-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit",
3742+
"git hash": "22f8c0b1b3 2026-06-03 18:00:05 -0700",
36883743
"os": "Linux",
3689-
"os version": "5.14.0-687.13.1.el9_8.x86_64"
3744+
"os version": "6.12.76-linuxkit"
36903745
}
36913746
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<rdf:RDF
3+
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
4+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
5+
xmlns:arches="http://localhost:82/"
6+
xmlns:dcterms="http://purl.org/dc/terms/"
7+
>
8+
<skos:Concept rdf:about="http://localhost:82/6dad6fc7-9bc4-4f25-9e50-20c4eb2be6ab">
9+
<skos:inScheme>
10+
<skos:ConceptScheme rdf:about="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275">
11+
<dcterms:title>Filing Type</dcterms:title>
12+
</skos:ConceptScheme>
13+
</skos:inScheme>
14+
<skos:definition xml:lang="en">Submission of a document without a larger context</skos:definition>
15+
<skos:prefLabel xml:lang="en">Document Submission</skos:prefLabel>
16+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">0</arches:sortorder>
17+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/6dad6fc7-9bc4-4f25-9e50-20c4eb2be6ab</dcterms:identifier>
18+
</skos:Concept>
19+
<skos:Concept rdf:about="http://localhost:82/6576fbb7-948a-4064-bc8f-2e5ab788c27c">
20+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">3</arches:sortorder>
21+
<skos:scopeNote xml:lang="en">Application to do work within the context of an emergency (Flood, Fire, etc)</skos:scopeNote>
22+
<skos:inScheme rdf:resource="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275"/>
23+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/6576fbb7-948a-4064-bc8f-2e5ab788c27c</dcterms:identifier>
24+
<skos:prefLabel xml:lang="en">Permit Application - Emergency</skos:prefLabel>
25+
</skos:Concept>
26+
<skos:Concept rdf:about="http://localhost:82/7c3b5f74-e68b-49ae-ba6e-2125fc7a4da8">
27+
<skos:prefLabel xml:lang="en">Information Request</skos:prefLabel>
28+
<skos:definition xml:lang="en">Filing to request information from the Arch Branch</skos:definition>
29+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</arches:sortorder>
30+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/7c3b5f74-e68b-49ae-ba6e-2125fc7a4da8</dcterms:identifier>
31+
<skos:inScheme rdf:resource="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275"/>
32+
</skos:Concept>
33+
<skos:Concept rdf:about="http://localhost:82/69f170e3-6dfd-4af8-a32c-c124d19c3e26">
34+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2</arches:sortorder>
35+
<skos:inScheme rdf:resource="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275"/>
36+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/69f170e3-6dfd-4af8-a32c-c124d19c3e26</dcterms:identifier>
37+
<skos:prefLabel xml:lang="en">Permit Application - Standard</skos:prefLabel>
38+
</skos:Concept>
39+
<skos:Concept rdf:about="http://localhost:82/357f2bb7-47cb-4340-9a51-2ce6128bedd4">
40+
<skos:inScheme rdf:resource="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275"/>
41+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">5</arches:sortorder>
42+
<skos:prefLabel xml:lang="en">Site Visit</skos:prefLabel>
43+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/357f2bb7-47cb-4340-9a51-2ce6128bedd4</dcterms:identifier>
44+
</skos:Concept>
45+
<skos:Concept rdf:about="http://localhost:82/f4be651b-cdae-4e05-a109-60192575f385">
46+
<skos:inScheme rdf:resource="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275"/>
47+
<skos:broader>
48+
<skos:Concept rdf:about="http://localhost:82/20f204a6-7a49-432a-8734-eb1fdff2e570">
49+
<skos:narrower rdf:resource="http://localhost:82/f4be651b-cdae-4e05-a109-60192575f385"/>
50+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">4</arches:sortorder>
51+
<skos:prefLabel xml:lang="en">Permit Application - Multi Project</skos:prefLabel>
52+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/20f204a6-7a49-432a-8734-eb1fdff2e570</dcterms:identifier>
53+
<skos:inScheme rdf:resource="http://localhost:82/cfda6f18-56a4-4946-becf-fdf86994f275"/>
54+
</skos:Concept>
55+
</skos:broader>
56+
<skos:prefLabel xml:lang="en">Zone Addition</skos:prefLabel>
57+
<dcterms:identifier>http://localhost:82/plugins/controlled-list-manager/item/f4be651b-cdae-4e05-a109-60192575f385</dcterms:identifier>
58+
<arches:sortorder rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">0</arches:sortorder>
59+
</skos:Concept>
60+
</rdf:RDF>

bcap/src/bcap/apps/Permit/Modules/BaseModule/BaseModule.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const showDebug = ref(false);
290290
</StepList>
291291
</div>
292292
<div class="bcgov-vertical-step-panels">
293-
<h1>Submit Permit Application</h1>
293+
<h1>Submit Filing</h1>
294294
<div
295295
v-if="submissionErrors.length > 0"
296296
class="red"

bcap/src/bcap/apps/Permit/Modules/BaseModule/steps/Step2_Prelim.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,32 @@ defineExpose({ isValid });
3030
:mode="EDIT"
3131
:aliased-node-data="
3232
draftData?.application_identification?.aliased_data
33-
?.project_name
33+
?.filing_type
3434
"
3535
graph-slug="permit_application"
36-
node-alias="project_name"
36+
node-alias="filing_type"
3737
@update:value="
3838
updateValue(
3939
$event,
40-
'project_name',
40+
'filing_type',
4141
'application_identification',
4242
)
4343
"
4444
/>
4545
<GenericWidget
4646
:mode="EDIT"
4747
:aliased-node-data="
48-
draftData?.proposed_project?.aliased_data?.project_type
48+
draftData?.application_identification?.aliased_data
49+
?.project_name
4950
"
5051
graph-slug="permit_application"
51-
node-alias="project_type"
52+
node-alias="project_name"
5253
@update:value="
53-
updateValue($event, 'project_type', 'proposed_project')
54+
updateValue(
55+
$event,
56+
'project_name',
57+
'application_identification',
58+
)
5459
"
5560
/>
5661
<GenericWidget

bcap/src/bcap/client/zod.gen.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,7 @@ export const zPermitApplicationApplicationContactsTile = z.object({
21842184

21852185
export const zPermitApplicationApplicationIdentificationAliasedData = z.object({
21862186
application_id: zStringAliasedNodeData.nullish(),
2187+
filing_type: zReferenceAliasedNodeDataRequired.nullable(),
21872188
project_name: zStringAliasedNodeData.nullable(),
21882189
map_or_hip: zReferenceAliasedNodeData.nullish(),
21892190
is_replacement: zBooleanAliasedNodeData.nullish(),
@@ -3753,7 +3754,7 @@ export const zArchaeologicalSiteRemarkKeywordTile = z.object({
37533754
export const zArchaeologicalSiteSiteBoundaryAliasedData = z.object({
37543755
site_boundary: zGeojsonFeatureCollectionAliasedNodeData.nullable(),
37553756
site_boundary_description: zStringAliasedNodeData.nullish(),
3756-
unprotected_areas: zArchaeologicalSiteUnprotectedAreasTile.nullish(),
3757+
unprotected_areas: z.array(zArchaeologicalSiteUnprotectedAreasTile).nullish(),
37573758
latest_edit_type: zReferenceAliasedNodeDataRequired.nullable(),
37583759
accuracy_remarks: zStringAliasedNodeDataMax500.nullable()
37593760
});
@@ -3777,9 +3778,10 @@ export const zArchaeologicalSiteSiteBoundaryTile = z.object({
37773778

37783779
export const zSiteVisitSiteVisitLocationAliasedData = z.object({
37793780
site_visit_location: zGeojsonFeatureCollectionAliasedNodeData.nullish(),
3780-
location_and_access: zStringAliasedNodeData.nullish(),
37813781
latest_edit_type: zReferenceAliasedNodeDataRequired.nullable(),
3782+
location_and_access: zStringAliasedNodeData.nullish(),
37823783
accuracy_remarks: zStringAliasedNodeDataMax500.nullable(),
3784+
boundary_type: zReferenceAliasedNodeDataRequired.nullable(),
37833785
biogeography: z.array(zSiteVisitBiogeographyTile).nullish()
37843786
});
37853787

@@ -4114,7 +4116,7 @@ export const zSiteVisitRelatedDocumentsTile = z.object({
41144116
});
41154117

41164118
export const zSiteVisitResourceAliasedData = z.object({
4117-
site_visit_location: zSiteVisitSiteVisitLocationTile.nullish(),
4119+
site_visit_location: z.array(zSiteVisitSiteVisitLocationTile).nullish(),
41184120
identification: zSiteVisitIdentificationTile.nullish(),
41194121
site_visit_details: zSiteVisitSiteVisitDetailsTile.nullish(),
41204122
archaeological_data: zSiteVisitArchaeologicalDataTile.nullish(),
@@ -6269,6 +6271,7 @@ export const zPermitApplicationApplicationContactsTileWritable = z.object({
62696271

62706272
export const zPermitApplicationApplicationIdentificationAliasedDataWritable = z.object({
62716273
application_id: zStringAliasedNodeDataWritable.nullish(),
6274+
filing_type: zReferenceAliasedNodeDataRequiredWritable.nullable(),
62726275
project_name: zStringAliasedNodeDataWritable.nullable(),
62736276
map_or_hip: zReferenceAliasedNodeDataWritable.nullish(),
62746277
is_replacement: zBooleanAliasedNodeDataWritable.nullish(),
@@ -7738,7 +7741,7 @@ export const zArchaeologicalSiteRemarkKeywordTileWritable = z.object({
77387741
export const zArchaeologicalSiteSiteBoundaryAliasedDataWritable = z.object({
77397742
site_boundary: zGeojsonFeatureCollectionAliasedNodeDataWritable.nullable(),
77407743
site_boundary_description: zStringAliasedNodeDataWritable.nullish(),
7741-
unprotected_areas: zArchaeologicalSiteUnprotectedAreasTileWritable.nullish(),
7744+
unprotected_areas: z.array(zArchaeologicalSiteUnprotectedAreasTileWritable).nullish(),
77427745
latest_edit_type: zReferenceAliasedNodeDataRequiredWritable.nullable(),
77437746
accuracy_remarks: zStringAliasedNodeDataMax500Writable.nullable()
77447747
});
@@ -7762,9 +7765,10 @@ export const zArchaeologicalSiteSiteBoundaryTileWritable = z.object({
77627765

77637766
export const zSiteVisitSiteVisitLocationAliasedDataWritable = z.object({
77647767
site_visit_location: zGeojsonFeatureCollectionAliasedNodeDataWritable.nullish(),
7765-
location_and_access: zStringAliasedNodeDataWritable.nullish(),
77667768
latest_edit_type: zReferenceAliasedNodeDataRequiredWritable.nullable(),
7769+
location_and_access: zStringAliasedNodeDataWritable.nullish(),
77677770
accuracy_remarks: zStringAliasedNodeDataMax500Writable.nullable(),
7771+
boundary_type: zReferenceAliasedNodeDataRequiredWritable.nullable(),
77687772
biogeography: z.array(zSiteVisitBiogeographyTileWritable).nullish()
77697773
});
77707774

@@ -8067,7 +8071,7 @@ export const zSiteVisitRelatedDocumentsTileWritable = z.object({
80678071
});
80688072

80698073
export const zSiteVisitResourceAliasedDataWritable = z.object({
8070-
site_visit_location: zSiteVisitSiteVisitLocationTileWritable.nullish(),
8074+
site_visit_location: z.array(zSiteVisitSiteVisitLocationTileWritable).nullish(),
80718075
identification: zSiteVisitIdentificationTileWritable.nullish(),
80728076
site_visit_details: zSiteVisitSiteVisitDetailsTileWritable.nullish(),
80738077
archaeological_data: zSiteVisitArchaeologicalDataTileWritable.nullish(),

bcap/util/borden_number_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class MissingGeometryError(Exception):
2020
pass
2121

2222

23+
class BordenGridServiceError(Exception):
24+
pass
25+
26+
2327
# @todo - How do we handle multiple geometries?
2428
class BordenNumberApi:
2529
_datatype_factory = None
@@ -78,7 +82,17 @@ def _get_borden_grid_for_geometry(self, geometry):
7882
req = urllib3.PoolManager()
7983

8084
response = req.request("GET", url)
85+
if response.status != 200:
86+
raise BordenGridServiceError(
87+
f"The Borden Grid lookup service returned an unexpected error (HTTP {response.status}). "
88+
"Please try again or contact system support."
89+
)
8190
body = json.loads(response.data.decode())
91+
if not body.get("features"):
92+
raise MissingGeometryError(
93+
"No Borden Grid was found for the provided location. "
94+
"Please ensure the site boundary is within British Columbia."
95+
)
8296
borden_grid = body["features"][0]["properties"]["BORDGRID"]
8397

8498
return borden_grid

bcap/util/dashboard/dashboard_seed.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ def _make_permit(self, spec: PermitSpec):
427427
{
428428
"project_name": self.localized(spec.project_name),
429429
"application_id": self.localized(spec.application_id),
430+
"filing_type": random_reference_value(
431+
"permit_application", "filing_type"
432+
),
430433
},
431434
)
432435
self.append_blank_tile_for_group(

0 commit comments

Comments
 (0)