Skip to content

feat: add linkedin account to profiles#181

Merged
joelamouche merged 2 commits intomainfrom
be-163-linkedin-account
Mar 2, 2026
Merged

feat: add linkedin account to profiles#181
joelamouche merged 2 commits intomainfrom
be-163-linkedin-account

Conversation

@tusharshah21
Copy link
Collaborator

Summary

This PR adds linkedin_account support to profile storage and existing profile APIs, including case-insensitive global uniqueness and validation behavior defined in BE #163.

Changes

  • Added linkedin_account to the profiles table with a unique index on LOWER(linkedin_account) to enforce global case-insensitive uniqueness.
  • Updated existing profile update payload (PUT /profiles/:address) to accept optional linkedin_account.
  • Added LinkedIn validation and conflict checks in profile update flow:
    • invalid format returns 400
    • already-claimed handle returns 409
    • uniqueness checks use trimmed/lowercased value
    • persisted value keeps original casing.
  • Included linkedin_account in existing profile response DTOs (GET profile endpoints and profile-related responses).
  • Extended profile tests for LinkedIn invalid format and case-insensitive conflict.
  • Regenerated SQLx offline metadata for updated queries.

Copy link
Contributor

@joelamouche joelamouche left a comment

Choose a reason for hiding this comment

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

Overall looks great. Just two tests are missing

let err = update_profile(repo.clone(), profile2.address.to_string(), req).await;
assert!(err.is_err());
assert!(err.unwrap_err().contains("LinkedIn account already taken"));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Two missing tests:

  • successfully create profile with linkedin account at creation (you can reuse existing create test)
  • successfully update linkedin account on a profile

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done mate

Copy link
Contributor

@joelamouche joelamouche left a comment

Choose a reason for hiding this comment

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

Nice!

@joelamouche joelamouche merged commit 5b18ea3 into main Mar 2, 2026
4 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.

2 participants