docs(development): Add new abstract models to API docs

ref: #772
This commit is contained in:
2025-05-25 05:25:46 +09:30
parent db41c73300
commit 0c6a15d22d
20 changed files with 70 additions and 289 deletions

View File

@ -13,5 +13,3 @@ This section contains the application API documentation to assist in application
- [Models](./models/index.md)
- [Serializers](./serializer/index.md)
- [Unit Testing](./tests/index.md)

View File

@ -0,0 +1,15 @@
---
title: Centurion Abstract Model
description: No Fuss Computings Centurion ERP Centurion Abstract model documentation.
date: 2025-05-25
template: project.html
about: https://github.com/nofusscomputing/centurion_erp
---
This abstract model establishes the base features for ALL models within Centurion ERP
::: app.core.models.centurion.CenturionModel
options:
heading_level: 2
inherited_members: true
members: true

View File

@ -0,0 +1,14 @@
---
title: Centurion Abstract Sub-Model
description: No Fuss Computings Centurion ERP Centurion Abstract sub-model documentation.
date: 2025-05-25
template: project.html
about: https://github.com/nofusscomputing/centurion_erp
---
This abstract model establishes the base features for ALL sub-models within Centurion ERP
::: app.core.models.centurion.CenturionSubModel
options:
inherited_members: true
heading_level: 2

View File

@ -8,13 +8,13 @@ about: https://gitlab.com/nofusscomputing/infrastructure/configuration-managemen
Models within Centurion ERP:
- core
- Abstract
- [Ticket](./ticket.md)
- [Centurion Base](./centurion.md)
- itam
- [Centurion Sub-Model](./centurion_sub.md)
- [Device](./itam_device.md)
- [Tenancy](./tenancy.md)
## Helpers

View File

@ -0,0 +1,14 @@
---
title: Centurion Tenancy Abstract Model
description: No Fuss Computings Centurion ERP Centurion Tenancy Abstract model documentation.
date: 2025-05-25
template: project.html
about: https://github.com/nofusscomputing/centurion_erp
---
This abstract model establishes the tenancy features for ALL models within Centurion ERP
::: app.access.models.tenancy_abstract.TenancyAbstractModel
options:
inherited_members: true
heading_level: 2

View File

@ -1,33 +0,0 @@
---
title: Test Cases
description: No Fuss Computings Centurion ERP unit tests
date: 2024-06-15
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
Models are tested using the following test cases:
- [ALL Model Permission](./model_permissions.md)
- [ALL Model Permission (organization Manager)](./model_permissions_organization_manager.md)
- [Add Permission](./model_permission_add.md)
- [Add Permission (organization Manager)](./model_permission_add_organization_manager.md)
- [Change Permission](./model_permission_change.md)
- [Change Permission (organization Manager)](./model_permission_change_organization_manager.md)
- [Delete Permission](./model_permission_delete.md)
- [Delete Permission (organization Manager)](./model_permission_delete_organization_manager.md)
- [View Permission](./model_permission_view.md)
- [View Permission (organization Manager)](./model_permission_view_organization_manager.md)
- [Model Views](./model_views.md)
The above test cases are common to alot of models and function of this application and are intended to be inherited by your test class.

View File

@ -1,11 +0,0 @@
---
title: Model Permissions Add Test Cases
description: No Fuss Computings model permissions add unit tests
date: 2024-06-15
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.app.tests.abstract.model_permissions.ModelPermissionsAdd
options:
show_source: true

View File

@ -1,9 +0,0 @@
---
title: Model Permissions Add (Organization Manager) Test Cases
description: No Fuss Computings model permissions add test cases for organization manager
date: 2024-06-17
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.access.tests.abstract.model_permissions_organization_manager.OrganizationManagerModelPermissionAdd

View File

@ -1,9 +0,0 @@
---
title: Model Permissions Change Test Cases
description: No Fuss Computings model permissions change unit tests
date: 2024-06-15
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.app.tests.abstract.model_permissions.ModelPermissionsChange

View File

@ -1,9 +0,0 @@
---
title: Model Permissions Change (Organization Manager) Test Cases
description: No Fuss Computings model permissions change test cases for organization manager
date: 2024-06-17
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.access.tests.abstract.model_permissions_organization_manager.OrganizationManagerModelPermissionChange

View File

@ -1,9 +0,0 @@
---
title: Model Permissions Delete Test Cases
description: No Fuss Computings model permissions delete unit tests
date: 2024-06-15
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.app.tests.abstract.model_permissions.ModelPermissionsDelete

View File

@ -1,9 +0,0 @@
---
title: Model Permissions Delete (Organization Manager) Test Cases
description: No Fuss Computings model permissions delete test cases for organization manager
date: 2024-06-17
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.access.tests.abstract.model_permissions_organization_manager.OrganizationManagerModelPermissionDelete

View File

@ -1,9 +0,0 @@
---
title: Model Permissions View Test Cases
description: No Fuss Computings model permissions view unit tests
date: 2024-06-15
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.app.tests.abstract.model_permissions.ModelPermissionsView

View File

@ -1,9 +0,0 @@
---
title: Model Permissions View (Organization Manager) Test Cases
description: No Fuss Computings model permissions view unit tests
date: 2024-06-17
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.access.tests.abstract.model_permissions_organization_manager.OrganizationManagerModelPermissionView

View File

@ -1,12 +0,0 @@
---
title: Model Permissions Test Cases
description: No Fuss Computings model permissions add unit tests
date: 2024-06-15
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.app.tests.abstract.model_permissions.ModelPermissions
options:
show_source: true
inherited_members: true

View File

@ -1,12 +0,0 @@
---
title: Model Permissions (Organization Manager) Test Cases
description: No Fuss Computings model permissions Test cases for model permissions as an organization manager
date: 2024-06-17
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
::: app.access.tests.abstract.model_permissions_organization_manager.OrganizationManagerModelPermissions
options:
show_source: true
inherited_members: true

View File

@ -1,63 +0,0 @@
---
title: Model Views Test Cases
description: No Fuss Computings model views unit tests
date: 2024-07-13
template: project.html
about: https://gitlab.com/nofusscomputing/infrastructure/configuration-management/centurion_erp
---
Below are the test cases for the model views.
## All Views
::: app.app.tests.abstract.views.AllViews
options:
heading_level: 3
show_source: true
inherited_members: true
## Add View
::: app.app.tests.abstract.views.AddView
options:
heading_level: 3
show_source: true
inherited_members: true
## Change View
::: app.app.tests.abstract.views.ChangeView
options:
heading_level: 3
show_source: true
inherited_members: true
## Delete View
::: app.app.tests.abstract.views.DeleteView
options:
heading_level: 3
show_source: true
inherited_members: true
## Display View
::: app.app.tests.abstract.views.DisplayView
options:
heading_level: 3
show_source: true
inherited_members: true
## Index View
::: app.app.tests.abstract.views.IndexView
options:
heading_level: 3
show_source: true
inherited_members: true

View File

@ -20,7 +20,7 @@ When designing or even implementing a model do consider that what is defined wit
When creating models they must meet the following requirements:
- inherits from `core.models.centurion.CenturionModel` or if a submodel `core.models.centurion.CenturionSubModel` and its base model.
- inherits from [`core.models.centurion.CenturionModel`](./api/models/centurion.md) or if a submodel [`core.models.centurion.CenturionSubModel`](./api/models/centurion_sub.md) and its base model.
- class has the folloing objects defined:
@ -213,21 +213,7 @@ table_fields: list = [
```
## Depreciated Docs undergoing re-write
- ToDo
@ -242,17 +228,9 @@ table_fields: list = [
- Add `model.clean()` To set/modify any field values, _if required_
<!-- markdownlint-disable -->
## Requirements
<!-- markdownlint-restore -->
- `clean()` method within a model is **only** used to ensure that the data entered into the DB is valid and/or to ensure application wide changes/validation is conducted prior to saving model.
@ -261,11 +239,6 @@ table_fields: list = [
- Models must save audit history
<!-- markdownlint-disable -->
#### Requirements
<!-- markdownlint-restore -->
@ -286,7 +259,6 @@ This section details the additional items that may need to be done when adding a
- If the model is a primary model, add it to the model link slash command in `app/core/lib/slash_commands/linked_model.py` function `command_linked_model`
## History
Adding [History](./core/model_history.md) to a model is automatic. If there is a desire not to have model history it can be disabled by adding attribute `_audit_enabled` to the model class and setting its value to `False.`

View File

@ -211,7 +211,7 @@ The views that we use are:
Display a model
Common test cases are available for views. These test cases can be found within the API docs under [model view test cases](./api/tests/model_views.md).
Common test cases are available for views. These test cases can be found within the API docs under model view test cases.
### Requirements - Depreciated
@ -231,26 +231,6 @@ All views are to meet the following requirements:
- Add and change views to use a form class
### Tests
The following unit test cases exist for views:
- [AddView](./api/tests/model_views.md#add-view)
- [ChangeView](./api/tests/model_views.md#change-view)
- [DeleteView](./api/tests/model_views.md#delete-view)
- [Display View](./api/tests/model_views.md#display-view)
- [IndexView](./api/tests/model_views.md#index-view)
- [AllViews](./api/tests/model_views.md#all-views)
!!! tip
The `AllViews` test class is an aggregation of all views. This class is the recommended test class to include if the model uses all available views.
### Docs to clean up
!!! note

View File

@ -24,7 +24,7 @@ plugins:
find_stubs_package: true
heading_level: 2
inherited_members: false
members_order: source
members_order: alphabetical
paths: [ '.' ]
parameter_headings: false
show_category_heading: true
@ -79,57 +79,39 @@ nav:
- projects/centurion_erp/development/api/index.md
- projects/centurion_erp/development/api/admin_model_form.md
- projects/centurion_erp/development/api/models/centurion.md
- projects/centurion_erp/development/api/model_form.md
- projects/centurion_erp/development/api/models/centurion_sub.md
- projects/centurion_erp/development/api/token_authentication.md
- projects/centurion_erp/development/api/models/tenancy.md
- Models:
- Depreciated:
- projects/centurion_erp/development/api/models/index.md
- projects/centurion_erp/development/api/admin_model_form.md
- projects/centurion_erp/development/api/models/core_history_save.md
- projects/centurion_erp/development/api/model_form.md
- projects/centurion_erp/development/api/models/external_links.md
- projects/centurion_erp/development/api/token_authentication.md
- projects/centurion_erp/development/api/models/itam_device.md
- Models:
- projects/centurion_erp/development/api/models/ticket.md
- projects/centurion_erp/development/api/models/index.md
- projects/centurion_erp/development/api/common_views.md
- projects/centurion_erp/development/api/models/core_history_save.md
- Serializers:
- projects/centurion_erp/development/api/models/external_links.md
- projects/centurion_erp/development/api/serializer/index.md
- projects/centurion_erp/development/api/models/itam_device.md
- projects/centurion_erp/development/api/serializer/inventory.md
- projects/centurion_erp/development/api/models/ticket.md
- Unit Testing:
- projects/centurion_erp/development/api/common_views.md
- projects/centurion_erp/development/api/tests/index.md
- Serializers:
- projects/centurion_erp/development/api/tests/model_permissions.md
- projects/centurion_erp/development/api/serializer/index.md
- projects/centurion_erp/development/api/tests/model_permissions_organization_manager.md
- projects/centurion_erp/development/api/tests/model_permission_add.md
- projects/centurion_erp/development/api/tests/model_permission_add_organization_manager.md
- projects/centurion_erp/development/api/tests/model_permission_change.md
- projects/centurion_erp/development/api/tests/model_permission_change_organization_manager.md
- projects/centurion_erp/development/api/tests/model_permission_delete.md
- projects/centurion_erp/development/api/tests/model_permission_delete_organization_manager.md
- projects/centurion_erp/development/api/tests/model_permission_view.md
- projects/centurion_erp/development/api/tests/model_permission_view_organization_manager.md
- projects/centurion_erp/development/api/tests/model_views.md
- projects/centurion_erp/development/api/serializer/inventory.md
- projects/centurion_erp/development/accounting/asset.md