-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DUOS-2780] System Email - DAR submitted to DAC Chair #2236
Conversation
2684d39
to
42ca0a8
Compare
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.
Going to tackle this feedback myself.
@@ -128,6 +150,26 @@ public List<MailMessage> fetchEmailMessagesByCreateDate(Date start, Date end, In | |||
public void sendNewDARCollectionMessage(Integer collectionId) | |||
throws IOException, TemplateException { | |||
DarCollection collection = collectionDAO.findDARCollectionByCollectionId(collectionId); | |||
List<User> distinctUsers = getDistinctUsers(collection); | |||
DataAccessRequest dar = dataAccessRequestDAO.findByReferenceId(collection.getDarCode()); |
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.
We need to fix this, the dar code is not the same as the reference id.
@SqlQuery(""" | ||
select dac.* | ||
from dac | ||
inner join dataset d on d.dac_id = dac.dac_id | ||
inner join dar_dataset dd on dd.dataset_id = d.dataset_id | ||
inner join data_access_request dar on dd.reference_id = dar.reference_id | ||
where dar.collection_id = :collectionId | ||
""") |
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.
We should standardize the casing here
String researcherName = userDAO.findUserById(dar.getUserId()).getDisplayName(); | ||
Collection<Dac> dacsInDAR = dacDAO.findDacsForCollectionId(collectionId); | ||
List<Dataset> datasetsInDAR = datasetDAO.findDatasetsByIdList(dar.datasetIds); |
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.
We need some safety checking around the bulk calls to ensure we're not passing empty lists.
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.
Manually tested 👍🏽
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.
seems reasonable, lgtm but didn't manually test
Addresses
https://broadworkbench.atlassian.net/browse/DUOS-2780
Summary
Have you read CONTRIBUTING.md lately? If not, do that first.