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

Improve the device assignment CRUD logic #3108

Closed
muloem opened this issue May 28, 2019 · 1 comment
Closed

Improve the device assignment CRUD logic #3108

muloem opened this issue May 28, 2019 · 1 comment

Comments

@muloem
Copy link
Member

muloem commented May 28, 2019

We currently have survey/device assignments saved as SurveyAssignment entities in the backend. These map the list of forms to the list of devices to which the forms have been assigned. In the current setup the list of forms can contain forms from multiple surveys. However, in the new setup (started in #2796) we will have this list of forms coming from only one survey.

We will update the CRUD logic in the backend for SurveyAssignment entities to ensure that it conforms to this restriction. In order to avoid breaking the app function, we will not change the DeviceSurveyJobQueue entities but only ensure that they correctly correspond to existing assignments

In this issue, we update the CRUD to ensure that the assignment-device (DeviceSurveyJobQueue) entities are correctly generated in an optimal way when an assignment is created and updated. Also that the entities are correctly deleted when an assignment is deleted.

Whereas this issue was originally written to implement the restriction that forms in an assignment only come from a single survey, the implementation work done thus far improves on the way assignments are generated but does not yet implement this restriction, because it requires the frontend to first realise these changes. We will forward the restriction to a new issue (see #3147).

muloem added a commit that referenced this issue Jul 24, 2019
* Instead of updating the individual survey-device entities based on changes in the assignment, we remove all the previously generated ones and generate new ones.
muloem added a commit that referenced this issue Jul 24, 2019
stellanl added a commit that referenced this issue Jul 24, 2019
[#3108] Refactor assignments entities generation
@muloem muloem self-assigned this Jul 29, 2019
@muloem muloem changed the title Update the device assignment CRUD logic Improve the device assignment CRUD logic Jul 29, 2019
@muloem
Copy link
Member Author

muloem commented Aug 1, 2019

Test Plan

It is covered by regression testing of the assignments functionality. It should behave the same.

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

No branches or pull requests

1 participant