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

βœ” Create new history model #602

Closed
14 of 18 tasks
jon-nfc opened this issue Feb 13, 2025 · 0 comments Β· Fixed by #605
Closed
14 of 18 tasks

βœ” Create new history model #602

jon-nfc opened this issue Feb 13, 2025 · 0 comments Β· Fixed by #605
Assignees
Labels
task::feature Adds functionality type::task Issue Type
Milestone

Comments

@jon-nfc
Copy link
Member

jon-nfc commented Feb 13, 2025

History is a core feature that tracks the changes to a model, including related models.

πŸ“ Details

Create a new model that will be a proxy model for history entries. This model will then be used (proxied) by each "model's history" which will contain only the model details.

This model should replicate the current history table with the exception of the model details which will subsequently move to their "own model history table" per model.

This base model must contain a function that is used to create the history entry. the before, after, model fields should be passed directly to this function. Function should return bool

🚧 Tasks

  • Model Created
  • [ ] Model tag added to app/core/lib/slash_commands/linked_model.CommandLinkedModel.get_model() function
    • [ ] Tag updated in the docs

Note

Ensure that when creating the tag the following is adhered to:

  • Two words are not to contain a space char, \s. It is to be replaced with an underscore _
  • As much as practical, keep the tag as close to the model name as possible
  • Admin Documentation if applicable

  • Developer Documentation if applicable

  • User Documentation

  • 🟨 Migrate old date to new tables

Old history table models

appsettings
cluster
clustertype
configgrouphosts
configgroups
configgroupsoftware
device
devicemodel
deviceoperatingsystem
devicesoftware
devicetype
externallink
groups
knowledgebase
knowledgebasecategory
manufacturer
operatingsystem
operatingsystemversion
organization
port
project
projectmilestone
projectstate
projecttype
service
software
softwarecategory
softwareversion
team
teamusers

---

πŸ§ͺ Tests

  • Unit Test Model
  • Unit Test Serializer
  • Unit Test Tenancy Object
  • Unit Test ViewSet
  • Function Test ViewSet
  • Function Test API Metadata
  • Function Test API Permissions
  • Function Test API Render (fields)

  • Abstract test cases
    • checking if entries created for Add, and Update of a model.
    • on delete of model confirms history is deleted
    • Child model Add, Delete and update entries never be delete if child model is deleted

βœ… Requirements

A Requirement is a must have. In addition will also be tested.

  • [ ] Must have a model_tag not a required feature as the hitory is a log not an item

  • Model contains the "create entry"
    • returns bool for success/failure
@jon-nfc jon-nfc added type::task Issue Type task::feature Adds functionality labels Feb 13, 2025
@jon-nfc jon-nfc moved this to Planning in Centurion ERP Feb 13, 2025
@jon-nfc jon-nfc moved this from Planning to Accepted in Centurion ERP Feb 13, 2025
@jon-nfc jon-nfc added this to the Next Release milestone Feb 13, 2025
@jon-nfc jon-nfc moved this from Accepted to Planning in Centurion ERP Feb 13, 2025
@jon-nfc jon-nfc self-assigned this Feb 13, 2025
@jon-nfc jon-nfc moved this from Planning to In progress in Centurion ERP Feb 13, 2025
jon-nfc added a commit that referenced this issue Feb 14, 2025
@jon-nfc jon-nfc modified the milestone: Next Release Feb 14, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 15, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 17, 2025
jon-nfc added a commit that referenced this issue Feb 19, 2025
@jon-nfc jon-nfc linked a pull request Feb 19, 2025 that will close this issue
9 tasks
@jon-nfc jon-nfc moved this from In progress to Done in Centurion ERP Feb 19, 2025
@jon-nfc jon-nfc changed the title Create new history model βœ” Create new history model Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task::feature Adds functionality type::task Issue Type
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant