Skip to content
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

Feature/operator documents new notifications #485

Merged
merged 7 commits into from
May 8, 2024

Conversation

tsubik
Copy link
Collaborator

@tsubik tsubik commented Apr 16, 2024

Adding new notifications when operator document changes status.

PT: https://www.pivotaltracker.com/story/show/187126380

@tsubik tsubik requested a review from santostiago April 16, 2024 14:00
end

def expired_documents(operator, user, documents)
@documents = documents.sort_by { |d| [d.fmu&.name || "_", d.required_operator_document.name] }
Copy link
Contributor

Choose a reason for hiding this comment

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

since this is used twice maybe there could be a decorator for the sorting name, or even a comparable method for docs. Well, it's not super important. Maybe it's not worth the trouble.

@@ -31,7 +31,7 @@ def generate_reset_url(user)

def generate_reset_token(user)
token, hashed = Devise.token_generator.generate(User, :reset_password_token)
user.update(reset_password_token: hashed, reset_password_sent_at: DateTime.now)
user.update!(reset_password_token: hashed, reset_password_sent_at: DateTime.now) unless user.new_record? # workaround for mailer previews
Copy link
Contributor

Choose a reason for hiding this comment

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

mmm.. I didn't get this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I had some validations errors here as in mailer's previews I'm not using persisted data, just User.new entity. I want to just get the reset token here without saving in db.

@@ -217,4 +219,18 @@ def reason_or_file
errors.add(:base, "File must be present or reason when document is non applicable")
end
end

def notify_about_changes
Copy link
Contributor

Choose a reason for hiding this comment

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

mmm.. from the task in Pivotal it looks like the goal is to notify when the documents are ready to be reviewed.
Like, the operators submitted them and the admins should review them.

But here the task tells the operators that their documents were reviewed.
Maybe the description of the task in Pivotal is not very clear.

Copy link
Collaborator Author

@tsubik tsubik Apr 30, 2024

Choose a reason for hiding this comment

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

I think you looked at wrong PT task. This one is "Set up email notifications to alert private sector users when their documents have been published or if they have been rejected", there is another one for notifying admins that document is ready for review (I will add a new PR today for it).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup. I probably checked the wrong task.
All good.

@tsubik tsubik force-pushed the feature/admin-operator-documents-perform-qc branch from ecdd106 to 76ec6e8 Compare April 30, 2024 11:22
@tsubik tsubik force-pushed the feature/operator-documents-new-notifications branch from 574f871 to 3995812 Compare April 30, 2024 11:40
Base automatically changed from feature/admin-operator-documents-perform-qc to develop May 8, 2024 08:57
@tsubik tsubik merged commit 4a8162b into develop May 8, 2024
4 checks passed
@tsubik tsubik deleted the feature/operator-documents-new-notifications branch May 8, 2024 11:10
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.

None yet

2 participants