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

Setup structure of the saved opportunity / search notification job #3534

Closed
1 task
chouinar opened this issue Jan 15, 2025 · 0 comments · Fixed by #3608
Closed
1 task

Setup structure of the saved opportunity / search notification job #3534

chouinar opened this issue Jan 15, 2025 · 0 comments · Fixed by #3608
Assignees

Comments

@chouinar
Copy link
Collaborator

chouinar commented Jan 15, 2025

Summary

We want a backend task that will run daily that will:

  1. Fetch all saved opportunities and notify users which ones have changed
  2. Fetch all saved searches and notify users which ones have changed

This ticket will implement neither of those and instead just implement the general structure of this task (where we'll plug that in later).

The script we create should do the following at the moment:

  • General task setup (background task added, setup to run as a script, etc.)
  • Setup a structure to store a user to notification mapping. We'll likely have a single email per user across multiple types of notifications, so we want to wait to send anything until we have collected everything (see below for idea)
  • A "notification" method that we'll just write to the table from Create a notification table to track notifications we've done #3546

I'm expecting that mapping to look like:

@dataclass
class NotificationContainer:
     user: User
     

     updated_opportunity_ids: list[int] = field(default_factory=[])
     updated_searches: list[.. something we'll figure out later] = field(default_factory=[])


# And elsewhere we'd just use a dict
user_notification_map: dict[uuid, NotificationContainer] = {}

Acceptance criteria

  • General structure setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants