Skip to content

Commit

Permalink
feat: added ability to search consultants and admins by id
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi committed Aug 15, 2023
1 parent dbf0de8 commit a7ca0f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/useradminservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ paths:
parameters:
- name: query
in: query
description: URL-encoded infix to search for in first name, last name, or email.
description: URL-encoded infix to search for in id first name, last name, or email.
A non-encoded star symbol searches for all.
required: true
schema:
Expand Down
2 changes: 1 addition & 1 deletion api/userservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ paths:
parameters:
- name: query
in: query
description: URL-encoded infix to search for in first name, last name, or email.
description: URL-encoded infix to search for in id, first name, last name, or email.
A non-encoded star symbol searches for all.
required: true
schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public interface AdminRepository extends CrudRepository<Admin, String> {
+ "AND ("
+ " ?1 = '*' "
+ " OR ("
+ " UPPER(a.firstName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " UPPER(a.adminId) = UPPER(?1)"
+ " OR UPPER(a.firstName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR UPPER(a.lastName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR UPPER(a.email) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR CONVERT(a.tenantId,char) LIKE CONCAT('%', UPPER(?1), '%')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public interface ConsultantRepository extends CrudRepository<Consultant, String>
+ "WHERE"
+ " ?1 = '*' "
+ " OR ("
+ " UPPER(c.firstName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " UPPER(c.consulantId) = UPPER(?1)"
+ " OR UPPER(c.firstName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR UPPER(c.lastName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR UPPER(c.email) LIKE CONCAT('%', UPPER(?1), '%')"
+ " )")
Expand All @@ -52,7 +53,8 @@ public interface ConsultantRepository extends CrudRepository<Consultant, String>
+ " AND ("
+ " ?1 = '*' "
+ " OR ("
+ " UPPER(c.firstName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " UPPER(c.consulantId) = UPPER(?1)
+ " OR UPPER(c.firstName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR UPPER(c.lastName) LIKE CONCAT('%', UPPER(?1), '%')"
+ " OR UPPER(c.email) LIKE CONCAT('%', UPPER(?1), '%')"
+ " )"
Expand Down

0 comments on commit a7ca0f5

Please sign in to comment.