@@ -37,8 +37,8 @@ def __get_mapped_amendment_type(cls, data):
37
37
return amendment_type_mapping [data ]
38
38
39
39
@classmethod
40
- def __create_full_address (cls , address_line1 , city , sub_division_code , post_code ):
41
- return f"{ address_line1 } , { city } , { sub_division_code } , { post_code } "
40
+ def __create_full_address (cls , address_line1 , city , sub_division_code , post_code , suite_no ):
41
+ return f"{ suite_no } { address_line1 } , { city } , { sub_division_code } , { post_code } "
42
42
43
43
@classmethod
44
44
def __get_authorization_details (cls , ams_authorizations , detail_type ):
@@ -91,38 +91,42 @@ def __set_contact_details(cls, contact):
91
91
contact ['address' ].get ('address_line_1' , '' ),
92
92
contact ['address' ].get ('city' , '' ),
93
93
contact ['address' ].get ('sub_division_code' , '' ),
94
- contact ['address' ].get ('post_code' , '' )
94
+ contact ['address' ].get ('post_code' , '' ),
95
+ contact ['address' ].get ('suite_no' , '' )
95
96
) if contact .get ('address' ) else ''
96
97
}
97
98
return contact_details
98
99
99
100
@classmethod
100
- def __set_applicant_details (cls , applicant , company_alias ):
101
+ def __set_applicant_details (cls , applicant , company_alias , incorporation_number ):
101
102
applicant_details = {
102
103
'applicanttype' : cls .__get_mapped_party_type (applicant .get ('party_type_code' )),
103
104
'em_companyname' : applicant .get ('party_name' , '' ),
104
105
'em_firstname' : applicant .get ('first_name' , '' ),
105
106
'em_middlename' : applicant .get ('middle_name' , '' ),
106
107
'em_lastname' : applicant .get ('party_name' , '' ),
107
108
'em_doingbusinessas' : company_alias ,
108
- 'bccompanyregistrationnumber' : applicant . get ( 'party_orgbook_entity' , {}). get ( 'registration_id' , '' ) ,
109
+ 'bccompanyregistrationnumber' : incorporation_number ,
109
110
'em_businessphone' : cls .__format_phone_number (applicant .get ('phone_no' , '' )),
110
111
'em_email' : applicant .get ('email' , '' ),
111
112
'legaladdress' : cls .__create_full_address (
112
113
applicant .get ('address' )[1 ].get ('address_line_1' , '' ),
113
114
applicant .get ('address' )[1 ].get ('city' , '' ),
114
115
applicant .get ('address' )[1 ].get ('sub_division_code' , '' ),
115
- applicant .get ('address' )[1 ].get ('post_code' )),
116
+ applicant .get ('address' )[1 ].get ('post_code' ),
117
+ applicant .get ('address' )[1 ].get ('suite_no' , '' )),
116
118
'mailingaddress' : cls .__create_full_address (
117
119
applicant .get ('address' )[0 ].get ('address_line_1' , '' ),
118
120
applicant .get ('address' )[0 ].get ('city' , '' ),
119
121
applicant .get ('address' )[0 ].get ('sub_division_code' , '' ),
120
- applicant .get ('address' )[0 ].get ('post_code' )),
122
+ applicant .get ('address' )[0 ].get ('post_code' ),
123
+ applicant .get ('address' )[0 ].get ('suite_no' , '' )),
121
124
'billingaddress' : cls .__create_full_address (
122
125
applicant .get ('address' )[2 ].get ('address_line_1' , '' ),
123
126
applicant .get ('address' )[2 ].get ('city' , '' ),
124
127
applicant .get ('address' )[2 ].get ('sub_division_code' , '' ),
125
- applicant .get ('address' )[2 ].get ('post_code' )),
128
+ applicant .get ('address' )[2 ].get ('post_code' ),
129
+ applicant .get ('address' )[2 ].get ('suite_no' , '' )),
126
130
'billingemailaddress' : ''
127
131
}
128
132
return applicant_details
@@ -138,7 +142,8 @@ def __set_agent_details(cls, agent):
138
142
agent .get ('address' ).get ('address_line_1' , '' ),
139
143
agent .get ('address' ).get ('city' , '' ),
140
144
agent .get ('address' ).get ('sub_division_code' , '' ),
141
- agent .get ('address' ).get ('post_code' )) if agent else '' ,
145
+ agent .get ('address' ).get ('post_code' ),
146
+ agent .get ('address' ).get ('suit_no' , '' )) if agent else '' ,
142
147
'em_businessphone' : cls .__format_phone_number (agent .get ('phone_no' )) if agent else '' ,
143
148
'em_title' : agent .get ('job_title' , '' ) if agent else '' ,
144
149
}
@@ -159,7 +164,8 @@ def __set_facility_address_details(cls, facility_operator, address_type=None):
159
164
facility_operator .get ('address' ).get ('address_line_1' ),
160
165
facility_operator .get ('address' ).get ('city' ),
161
166
facility_operator .get ('address' ).get ('sub_division_code' ),
162
- facility_operator .get ('address' ).get ('post_code' ))
167
+ facility_operator .get ('address' ).get ('post_code' ),
168
+ facility_operator .get ('address' ).get ('suite_no' , '' ))
163
169
}
164
170
if address_type is not None :
165
171
facility_address ['addresstype' ] = address_type
@@ -214,7 +220,8 @@ def create_new_ams_authorization(cls,
214
220
zoning_reason ,
215
221
regional_district_name ,
216
222
project_guid ,
217
- payment_contact
223
+ payment_contact ,
224
+ incorporation_number
218
225
):
219
226
"""Creates a new AMS authorization application"""
220
227
@@ -249,7 +256,7 @@ def create_new_ams_authorization(cls,
249
256
'majorcentre' : {
250
257
'name' : nearest_municipality_name
251
258
},
252
- 'applicant' : cls .__set_applicant_details (applicant , company_alias ),
259
+ 'applicant' : cls .__set_applicant_details (applicant , company_alias , incorporation_number ),
253
260
'agent' : cls .__set_agent_details (agent ),
254
261
'purposeofapplication' : authorization .get ('authorization_description' , '' ),
255
262
'preappexemptionrequest' : cls .__boolean_to_yes_no (authorization .get ('exemption_requested' )),
@@ -360,7 +367,8 @@ def create_amendment_ams_authorization(cls,
360
367
is_legal_land_owner ,
361
368
is_crown_land_federal_or_provincial ,
362
369
project_guid ,
363
- payment_contact
370
+ payment_contact ,
371
+ incorporation_number
364
372
):
365
373
"""Creates an AMS authorization application amendment"""
366
374
@@ -410,7 +418,7 @@ def create_amendment_ams_authorization(cls,
410
418
'preappexemptionrequest' : cls .__boolean_to_yes_no (authorization .get ('exemption_requested' )),
411
419
'preappexemptionrequestreason' : authorization .get ('exemption_reason' , '' ),
412
420
'newiscontaminatedsite' : cls .__boolean_to_yes_no (authorization .get ('is_contaminated' )),
413
- 'newapplicant' : cls .__set_applicant_details (applicant , company_alias ),
421
+ 'newapplicant' : cls .__set_applicant_details (applicant , company_alias , incorporation_number ),
414
422
'newcontact' : cls .__set_contact_details (contacts [0 ]),
415
423
'newagent' : cls .__set_agent_details (agent ),
416
424
'newfacilitytype' : facility_type ,
0 commit comments