-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PUB-2249 - Refactor MI Endpoints to use Models #450
Changes from 14 commits
4c778f0
6035893
6460f7a
1e09e19
3badf75
5ef120b
3cc53dd
ab7fc8c
8d6a900
fe69f0c
f577e6a
15d6d73
feb10fc
2647626
eb8a531
f1fb5a7
de8626f
42fadef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
import uk.gov.hmcts.reform.pip.account.management.model.PiUser; | ||
import uk.gov.hmcts.reform.pip.model.account.Roles; | ||
import uk.gov.hmcts.reform.pip.model.account.UserProvenances; | ||
import uk.gov.hmcts.reform.pip.model.report.AccountMiData; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
@@ -24,10 +25,10 @@ List<PiUser> findExistingByProvenanceId(@Param("provUserId") String provenanceUs | |
|
||
Optional<PiUser> findByUserId(UUID userId); | ||
|
||
@Query(value = "SELECT cast(user_id as text), provenance_user_id, user_provenance, roles, created_date, " | ||
+ "last_signed_in_date FROM pi_user", | ||
nativeQuery = true) | ||
List<String> getAccManDataForMI(); | ||
@Query("SELECT new uk.gov.hmcts.reform.pip.model.report.AccountMiData(" | ||
+ "u.userId, u.provenanceUserId, u.userProvenance, u.roles, u.createdDate, u.lastSignedInDate) " | ||
+ "FROM PiUser u") | ||
List<AccountMiData> getAccManDataForMI(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not your change but while you are there are you OK to rename the method name to something like getAccountDataForMi() or getMiData() or getAccountMiData(), etc.? 'AccMan' does not sound good :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done :) |
||
|
||
@Query(value = "SELECT * FROM pi_user WHERE CAST(last_verified_date AS DATE) = CURRENT_DATE - (interval '1' day)" | ||
+ " * :daysAgo AND user_provenance = 'PI_AAD' AND roles = 'VERIFIED'", nativeQuery = true) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't understand why is this has a size 6. Does it reply on the data from other tests in this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an error on my part - I added it as part of debugging for the test below and forgot to remove it. Have removed now :)