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

feat: Add checklists models and populate #182

Merged
merged 3 commits into from
Nov 12, 2024
Merged

feat: Add checklists models and populate #182

merged 3 commits into from
Nov 12, 2024

Conversation

lsetiawan
Copy link
Member

@lsetiawan lsetiawan commented Nov 9, 2024

This pull request introduces several new models and updates existing ones in the support_sphere project to improve the structure and functionality of checklists. The most significant changes include the addition of the Priority enum, the creation of new models like Checklist, ChecklistStep, and Frequency, and the removal of deprecated models.

New Models and Enums:

  • Added Priority enum to represent different priority levels for checklists (LOW, MEDIUM, HIGH). ([src/support_sphere_py/src/support_sphere/models/enums/priority.pyR1-R11](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-59185b973de38181884faf346268fa1ec2a2ab160d04bafe6f9f80fd41f2c11cR1-R11))
  • Added Checklist model to represent a checklist entity, including attributes like id, title, description, priority, and relationships with Frequency and UserChecklists. ([src/support_sphere_py/src/support_sphere/models/public/checklist.pyR1-R51](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-f6520240393b42aca39ba8d41f21c281311f2e3bfe5ceda8c9a970d0db077e99R1-R51))
  • Added Frequency model to represent the frequency of checklist recurrences, with attributes like id, name, and num_days. ([src/support_sphere_py/src/support_sphere/models/public/frequency.pyR1-R29](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-1541aef48b949208a66eb40d2f7dabf01c25102a6adc2dd46f3be31811af5291R1-R29))
  • Added ChecklistStepsState model to track the state of checklist steps for users, including attributes like id, checklist_steps_order_id, user_profile_id, and is_completed. ([src/support_sphere_py/src/support_sphere/models/public/checklist_steps_state.pyR1-R32](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-e88ff0de75614461e4850b5d9bb85f1b6872d666113db244f5538f1d6d657b79R1-R32))

Updated Models:

  • Renamed ChecklistStepsTemplate to ChecklistStep and updated its attributes and relationships to better reflect its purpose. ([src/support_sphere_py/src/support_sphere/models/public/checklist_step.pyR3-R9](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-3a6812571549045ddf213bff59c370adaf685b172dd2da5a7a4b51a104db62c9R3-R9))
  • Updated ChecklistStepsOrder model to include new attributes and relationships, such as checklist_id, checklist_step_id, and priority. ([src/support_sphere_py/src/support_sphere/models/public/checklist_steps_order.pyL31-R42](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-479946ad6ea1e1f9088069ebe8d0e7a5d24ba4385d12eb180fe75f5f2e939d3eL31-R42))
  • Modified UserChecklist model to UserChecklists, updating its attributes and relationships to align with the new Checklist model. ([src/support_sphere_py/src/support_sphere/models/public/user_checklist.pyL9-R9](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-4b0a4c7a4c3ece2a992ffd128e01c10c15d35144c4bd9db175e2752e70750ccfL9-R9))

Removed Deprecated Models:

  • Removed ChecklistType, RecurringType, and UserChecklistState models as they are no longer needed with the new structure. ([[1]](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-a8cd6569fad45cfd701058aa570a06c250419aa6d917170048640dc4b1b1d92bL1-L49), [[2]](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-278d96ce6fe4205c0840c0b6ede21e8e17ada00a0e4d8dea62da86efa71f19f1L1-L29), [[3]](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-e3ab9e10ac61625d5daec471db4f72263e130bdaea9858b064a20620f84d3360L1-L33))

Import and Export Updates:

  • Updated import statements and __all__ lists in several __init__.py files to reflect the new and updated models. ([[1]](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-c3f2e0b8fe4389309c711dc7bfd8632b124a9152759ae978db65df9ac914c0adR4-R7), [[2]](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6L2-L39), [[3]](https://github.com/uw-ssec/post-disaster-comms/pull/182/files#diff-2fd7615f1a2aa0dcf722cc23576a73dfd71ba3f0009a670526f6303ab10e8ef6L48-R52))

Related issues

TODO:

  • Go through docstrings to make sure it's accurate

Copy link

github-actions bot commented Nov 9, 2024

@lsetiawan lsetiawan marked this pull request as ready for review November 12, 2024 22:52
Copy link
Contributor

@nikiburggraf nikiburggraf left a comment

Choose a reason for hiding this comment

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

LGTM

@lsetiawan lsetiawan merged commit eacc951 into main Nov 12, 2024
2 checks passed
@lsetiawan lsetiawan deleted the add-checklists branch November 12, 2024 23:05
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.

2 participants