Skip to content

Conversation

@bidyashish
Copy link
Contributor

@bidyashish bidyashish commented Jul 28, 2025

AC

Update keycloak to accept new fields from BCSC logins (BCSC in DEV/TEST are currently configured to send these fields)

Keycloak

Dev Done ✅

Pending:
Test/Staging
Prod

Demo

image

Keycloack Demo

image

@bidyashish bidyashish self-assigned this Jul 28, 2025
@bidyashish bidyashish marked this pull request as draft July 28, 2025 17:36
@bidyashish bidyashish force-pushed the feature/4471-BCSC-Enable-address branch from db9458e to 4dc9726 Compare July 28, 2025 22:02
@bidyashish bidyashish changed the title update address BCSC #4471 - BCSC - Enable using the address from BCSC in SIMS profile Jul 28, 2025
@bidyashish bidyashish marked this pull request as ready for review July 28, 2025 23:36
Comment on lines 81 to 82
bcscParsedToken.address.country.toLowerCase() === "ca" ||
bcscParsedToken.address.country.toLowerCase() === "canada"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any expectation to receive "ca" and "canada" as a country?
If not, please use the xpcetd one only and have it declared as a constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andrewsignori-aot ,
Code updated.

const studentStore = useStudentStore();
const processing = ref(false);
const populateBcscAddressFields = (data: StudentProfileFormModel) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BCSC goes uppercase for this name: populateBCSCAddressFields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andrewsignori-aot ,
Code updated.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, please take a look at the comments.

Comment on lines 60 to 68
if (bcscParsedToken.address.street_address) {
const normalizedAddress =
bcscParsedToken.address.street_address.replace(/\\n/g, "\n");
const addressParts = normalizedAddress.split("\n");
data.addressLine1 = addressParts[0];
if (addressParts.length > 1) {
data.addressLine2 = addressParts.slice(1).join("\n");
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested code:

if (bcscParsedToken.address.street_address) {
  const [address1, address2] =
    bcscParsedToken.address.street_address.split("\n");
  data.addressLine1 = address1?.trim();
  data.addressLine2 = address2?.trim();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need it anymore this logic as we are populate all in addressLine1.

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @bidyashish 👍

const processing = ref(false);
const populateBCSCAddressFields = (data: StudentProfileFormModel) => {
if (!bcscParsedToken.address) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If bcscParsedToken.address is no longer optional, the check can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check removed.

data.provinceState = bcscParsedToken.address.region;
data.canadaPostalCode = bcscParsedToken.address.postal_code;
data.country = bcscParsedToken.address.country;
data.selectedCountry =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, the "CA" can be added as a const.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"CA" moved to system const.

Comment on lines 62 to 63
data.provinceState = bcscParsedToken.address.region;
data.canadaPostalCode = bcscParsedToken.address.postal_code;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this respecting the below AC?

For address info that is non-Canadian: bring over the street address, city, country

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks,.

Updated the code.

@sonarqubecloud
Copy link

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 21.63% ( 4093 / 18925 )
Methods: 9.66% ( 234 / 2423 )
Lines: 24.99% ( 3540 / 14168 )
Branches: 13.67% ( 319 / 2334 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 73.08% ( 725 / 992 )
Methods: 73.5% ( 86 / 117 )
Lines: 75.13% ( 568 / 756 )
Branches: 59.66% ( 71 / 119 )

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks for making the changes, looks good 👍

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 86.43% ( 1548 / 1791 )
Methods: 84.62% ( 176 / 208 )
Lines: 88.75% ( 1278 / 1440 )
Branches: 65.73% ( 94 / 143 )

@bidyashish bidyashish added this pull request to the merge queue Jul 29, 2025
Merged via the queue into main with commit f0bdc4f Jul 29, 2025
21 checks passed
@bidyashish bidyashish deleted the feature/4471-BCSC-Enable-address branch July 29, 2025 22:45
@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 73.61% ( 7251 / 9851 )
Methods: 71.27% ( 893 / 1253 )
Lines: 77.05% ( 5611 / 7282 )
Branches: 56.76% ( 747 / 1316 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants