-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add openhim queue model and signal #590
Conversation
(CHW_REGISTRATION, "CHWRegistration"), | ||
(PUBLIC_REGISTRATION, "PublicRegistration"), | ||
(CHANNEL_SWITCH, "ChannelSwitch"), | ||
(OPTOUT, "OptOut"), |
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.
Not a big thing, but I think we usually use the snake case for these values, eg. prebirth_registration
, for the value that gets stored in the database, and then title case for the values that get shown in the UI, eg. Prebirth Registration
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.
Thanks for the review, yes that makes sense, I initially wanted to get the models dymanically so tried to keep them the same as the class name
eventstore/models.py
Outdated
(PROCESSING, "Processing"), | ||
(COMPLETE, "Complete"), | ||
(ERROR, "Error"), | ||
) |
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.
Are we on a new enough version of django that we can use models.IntegerChoices
instead? https://docs.djangoproject.com/en/4.2/ref/models/fields/#enumeration-types
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.
I'll check
eventstore/signals.py
Outdated
|
||
|
||
@receiver(post_save, sender=PrebirthRegistration) | ||
def create_user_profile(sender, instance, created, **kwargs): |
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.
Should this function name be something like queue_prebirth_registration
?
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.
Yes
object_type = models.CharField(max_length=30, choices=ObjectType.choices) | ||
status = models.PositiveSmallIntegerField( | ||
choices=Status.choices, default=Status.PENDING | ||
) |
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.
Do we also need to store a copy of the details from the object? In case they do a forget delete before this gets forwarded? Or in that case do we not want to forward the object to them?
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.
Hmm I didn't think about that use case, I would assume we don't send it then, since they requested we delete all their data. We can't leave it in a queue then
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.
I've noted the assumption on the ticket
No description provided.