Skip to content

Conversation

@chenhongjing
Copy link
Collaborator

@chenhongjing chenhongjing commented Dec 19, 2025

Issue #: /bcgov/entity#10653

Description of changes:

  • Create API user if the record doesn't exist during post_financing_statements()
  • Update unit tests
  • Update query & alembic script to make sure no leading/trailing whitespace for registering_name
  • ppr-api version = 1.3.5

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the PPR license (Apache 2.0).

@chenhongjing chenhongjing self-assigned this Dec 19, 2025
Signed-off-by: Hongjing Chen <[email protected]>
@chenhongjing
Copy link
Collaborator Author

registering_name is updated

from

(SELECT CASE WHEN r.user_id IS NULL THEN ''
                    ELSE (SELECT CASE WHEN u.lastname = '' or u.lastname IS NULL THEN u.firstname
                                 ELSE u.firstname || ' ' || u.lastname END
                            FROM users u
                           WHERE u.username = r.user_id FETCH FIRST 1 ROWS ONLY) END) AS registering_name

to

(SELECT CASE
            WHEN r.user_id IS NULL OR r.user_id = '' THEN ''
            ELSE COALESCE((
                SELECT CONCAT_WS(' ', NULLIF(TRIM(u.firstname), ''), NULLIF(TRIM(u.lastname), ''))
                FROM users u
                WHERE u.username = r.user_id FETCH FIRST 1 ROWS ONLY
            ), '') END) AS registering_name

@chenhongjing chenhongjing marked this pull request as ready for review December 19, 2025 23:34
Copy link
Collaborator

@doug-lovett doug-lovett left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for updating the db views. I reviewed the db migration script and the upgrade views look correct.

Copy link
Collaborator

@cameron-eyds cameron-eyds left a comment

Choose a reason for hiding this comment

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

Well done!

@chenhongjing chenhongjing merged commit dc540ed into bcgov:main Dec 22, 2025
6 of 7 checks passed
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.

3 participants