Skip to content

Conversation

@jamil314
Copy link
Contributor

Description

Clearly describe what has been changed. Include relevant context or background.
Explain how the issue was fixed (if applicable) and the root cause.

Link this pull request to the GitHub issue (and optionally name the branch ocrvs-<issue #>)

Checklist

  • I have linked the correct Github issue under "Development"
  • I have tested the changes locally, and written appropriate tests
  • I have tested beyond the happy path (e.g. edge cases, failure paths)
  • I have updated the changelog with this change (if applicable)
  • I have updated the GitHub issue status accordingly

@github-actions

This comment has been minimized.

Copy link
Contributor

@makelicious makelicious left a comment

Choose a reason for hiding this comment

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

Looks good!
Let's add test cases so we know it works.

  • Whatever we use externalId for
  • data-seeder related changes.


it('loads languages, facilities and locations on startup', async () => {
const loadFacilities = vi.spyOn(referenceApi, 'loadFacilities')
const loadContent = vi.spyOn(referenceApi, 'loadContent')
Copy link
Contributor

Choose a reason for hiding this comment

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

content test might still have value?

'parentId',
'validUntil',
'locationType',
'externalId'
Copy link
Contributor

Choose a reason for hiding this comment

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

test case needed for external id. what is the need?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Locations are read from csv file for seeding. id is generated during seeding. externalId is for referring to the csv row for each location.

When seeding user, their primary office is referred to as the externalId from the locations csv.

},
async primaryOffice(userModel: IUserModelData, _, { dataSources }) {
return dataSources.locationsAPI.getLocation(userModel.primaryOfficeId)
async primaryOffice(userModel: IUserModelData, _, { headers }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have corresponding scopes? anything to check

@@ -0,0 +1,7 @@
-- Up Migration
ALTER TABLE locations ADD COLUMN external_id text UNIQUE;
Copy link
Contributor

Choose a reason for hiding this comment

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

What was the need, does administrative_areas need the same? We should have similar rows there

Copy link
Contributor

Choose a reason for hiding this comment

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

intentional?

validUntil: null,
externalId:
location.externalId ??
generateTrackingId(prng) + generateTrackingId(prng),
Copy link
Contributor

Choose a reason for hiding this comment

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

why plus?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Original externalIds are 11 characters long, TrackingIds are 6 characters.

"build:clean": "rm -rf build",
"generate-db-types": "kanel && prettier src/storage/postgres/events/schema --write",
"generate-db-schema": "docker run --rm postgres:17.6 pg_dump postgres://events_migrator:[email protected]:5432/events -s > src/tests/postgres-migrations.sql --exclude-schema=analytics"
"generate-db-schema": "docker run --rm postgres:17.6 pg_dump postgres://events_migrator:migrator_password@$( [[ '$OSTYPE' == darwin* ]] && echo host.docker.internal || echo 172.17.0.1 ):5432/events -s > src/tests/postgres-migrations.sql --exclude-schema=analytics"
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the need?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

host.docker.internal does not work for linux.

}
}

async function loadLocations(): Promise<ILocationDataResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove? no reason to return empty.

@Zangetsu101 Zangetsu101 added the Skip e2e Helps run lint/unit test only for faster feedback. Remove before merge. label Dec 9, 2025
@Zangetsu101 Zangetsu101 removed the Skip e2e Helps run lint/unit test only for faster feedback. Remove before merge. label Dec 10, 2025
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.

Delete location endpoints from Gateway, ensure Events service has all the same functionality now (3)

4 participants