feat: initialize project backend structure and document system specifications across all modules

This commit is contained in:
SonPhung
2026-07-24 09:05:41 +07:00
parent 506008c69f
commit 4534e4ecb8
74 changed files with 7989 additions and 44 deletions

View File

@@ -0,0 +1,65 @@
---
title: "Permission Management"
type: OpenSpec
status: Draft
domain: OneAccess
---
# Permission Management
## Requirement Definition
The Permission Management module is used to maintain Access Rights Groups. It defines:
1. Which modules and functions can be accessed by users in a group.
2. Which applicable actions (Add, Change, View, Delete, Approve/Reject, Copy, View History, Save as Template) can be performed by users in each function within each module.
## Process Flow
### Trigger
- A new user group is defined, requiring permission assignment.
### Pre-Conditions
- Users must have access rights to the Permission Management module to view, add, or edit permission records.
## Business Rules
- The system checks and displays available modules/functions for each user based on:
- **A**: Permissions assigned directly to the user.
- **B**: Permissions assigned to the user's permission group.
- **Total User Permission (C)** = Combination of A and B.
### Data Schema
#### General Information
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Role | The unique identifier of the permission group. | String (10) | Required. |
| Role Name | Text describing the Permission Group Name. | String (100) | Required. |
| Permission Type | The type of permission assignment. | Enum | Required. Values: Particular User, User Group. |
| User | Select one or more users for this role. | Array of User IDs | Required if Permission Type is "Particular User". |
| User Group | Select one group for this role. | String (User Group ID) | Required if Permission Type is "User Group". |
| Description | Text describing the Role. | String (200) | Optional. |
#### Module Permissions
*A hierarchy of modules containing the list of available functions (Top-level and Second-level modules).*
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| View | Allows viewing data available in the function. | Boolean | |
| Create | Allows creating data in the function. (Includes "Save as draft" implicitly). | Boolean | |
| Edit | Allows updating data in the function. | Boolean | |
| Delete | Allows deleting data in the function. | Boolean | |
| Copy | Allows copying available data in the function. | Boolean | |
| Approve | Allows approving/rejecting data in the function. | Boolean | |
| History | Allows viewing data history (activity log). | Boolean | |
| Template | Allows saving records as a template. | Boolean | |
#### Access Rights Fields (Field-Level Permissions)
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| View | Allows viewing the specific field on the screen. | Boolean | |
| Editable | Allows modifying the value of the specific field. | Boolean | |
## Post-Conditions
- Records are automated for approval upon creation/modification.
## Exception Flow
- If input data fails validation, the action is canceled, and the operation fails.

View File

@@ -0,0 +1,47 @@
---
title: "User Group"
type: OpenSpec
status: Draft
domain: OneAccess
---
# User Group
## Requirement Definition
The User Group module is utilized to categorize users who share identical permissions within OLS. It defines the group to be assigned to a particular user or group of users.
## Process Flow
### Trigger
- A new user group needs to be defined.
- An existing user group needs to be modified, or a user needs to review the existing group.
### Pre-Conditions
- Users must have access rights to the User Group module to view, add, or edit user group records.
## Business Rules
- The user group ID must be a unique value.
### Data Schema
#### General Information
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| User Group ID | The identity of the user group. | String (10) | Required. Must be unique. |
| User Group Name | The name of the user group. | String (100) | Required. |
| Description | Description for the user group. | String (200) | Optional. |
#### Group Users (View Only)
*Lists all active User Profile records assigned to this group.*
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| User ID | The identity of the user belonging to the chosen group. | String | Read-only |
| User Name | The name of the user. | String | Read-only |
| Email | Email address of the user. | String | Read-only |
## Post-Conditions
- The data is updated in the database and related screens.
## Exception Flow
- If input data fails validation, the action is canceled, and the operation fails.

View File

@@ -0,0 +1,61 @@
---
title: "User Profile"
type: OpenSpec
status: Draft
domain: OneAccess
---
# User Profile
## Requirement Definition
The User Profile defines user attributes and sets the date and time allowing user access to system functions. It is used for login. Upon logging in, users can view a list of functions with specific operations set in the permission management section.
## Process Flow
### Trigger
- A new account needs to be defined.
- Information of an existing account needs to be updated.
### Pre-Conditions
- Users must have access rights to the User Profile module to view, add, or edit User Profile records.
## Business Rules
### Data Schema
#### General Information
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| User ID | Unique user identifier. | String (10) | Required. Must be unique. |
| User Name | Name of the user associated with the User ID. | String (50) | Required. |
| Password | User password. | String (50) | Required for new users. Must meet strong password policies. |
| Re-enter Password | Confirmation of the password. | String (50) | Must match Password. |
| Email | User's email address. Can be used for login and password resets. | String (100) | Required. Must be unique. |
| Default Language | Determines the language for screen labels. | Enum | Required. |
#### Access Detail
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Access Day | Indicates the days of the week the user has access to the system. | Array of Enums | Required. (e.g., Monday-Sunday) |
| Access Time | The time on and after which the user has access to the system on allowed days. | Time | Required. |
| User Profile Effective From Date | Date on and after which the User Profile is effective. | Date | Required. |
| User Profile Effective End Date | Date on and before which the User Profile is effective. | Date | Required. |
| User Group | The selected group determining the functions the user can access. | String (User Group ID) | Required. |
| Report Access Right | Determines which report(s) the user has access to. | String (Report Group ID) | Optional. |
| User Status | Status of the user account. | Enum | Required. Values: Active, Blocked. |
#### User Permission (View Only)
*Displays all permissions applicable for the chosen user across top-level and second-level modules.*
| Field Name | Description | Logic Type | Constraints / Rules |
|---|---|---|---|
| Module Name | The name of the module. | String | Read-only |
| Permissions | Available actions (View, Create, Edit, Delete, Copy, Approve, History, Template). | Boolean per action | Read-only |
## Post-Conditions
- When creating a new record, the user account is successfully created.
- The new user receives an email notification with login instructions and a temporary password.
- When the password is reset, an email notification is sent to the user's email with the new password.
## Exception Flow
- No specific exception flow defined.