Movementmanage Documentation

Movement Management Controller Documentation

File: /controllers/movementmanageController.php

Purpose: Tracks and reports user activities and system operations across the ERP system

Last Updated: December 20, 2024

Total Functions: 10

Lines of Code: ~282

---

๐Ÿ“‹ Overview

The Movement Management Controller provides comprehensive audit trail and user activity tracking functionality. It manages:

Primary Functions

Related Controllers

---

๐Ÿ—„๏ธ Database Tables

Primary Tables (Direct Operations)

Table NamePurposeKey Columns
**movementmanage**Active user movementsmovementmanageid, operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType
**movementmanagedeleted**Archived movementsmovementmanagedeleted, operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType
### Reference Tables

Table NamePurposeKey Columns
**user**System usersuserid, employeename, viewclients, viewbills, usergroupid
**usergroup**User permission groupsusergroupid, usergroupname
**youtubelink**Tutorial referencesyoutubelinkid, title, url
---

๐Ÿ”‘ Key Functions

1. Default Action (show) - Movement Report Display

Location: Lines 88-150

Purpose: Main interface for viewing user movement reports with advanced filtering

Function Signature:

if (empty($do) || $do == "show")

Input Parameters:

Process Flow:

1. Load user data for dropdown filters

2. Load YouTube tutorials for help system

3. Parse filter parameters from request

4. Execute appropriate filtering function based on criteria

5. Generate descriptive message for report header

6. Display results via movement template

Complex Filter Logic:

// Filter combinations with priority
if (date range AND no user AND no operation) {
    showByDate($startDate, $endDate);
} elseif (user only AND no date AND no operation) {
    showByUser($userSearchId);
} elseif (operation only AND no date AND no user) {
    showByOperationName($operationName);
} elseif (date range AND user AND no operation) {
    showByDateAndUser($startDate, $endDate, $userSearchId);
} elseif (date range AND operation AND no user) {
    showByDateAndOperationName($startDate, $endDate, $operationName);
} elseif (user AND operation AND no date) {
    showByUserAndOperationName($userSearchId, $operationName);
}

---

2. loadUser() - User Data Loading

Location: Lines 172-178

Purpose: Load active users for filter dropdown

Function Signature:

function loadUser()

Process Flow:

1. Query users with conditions = 0 (active only)

2. Return user array for template assignment

---

3. showByDate() - Date Range Filtering

Location: Lines 189-199

Purpose: Display movements within specific date range

Function Signature:

function showByDate($startDate, $endDate)

Process Flow:

1. Query active movements within date range

2. Query deleted movements within same range

3. Assign both datasets to template

4. Generate combined report

Data Sources:

---

4. showByUser() - User-Specific Reports

Location: Lines 201-211

Purpose: Display all movements for a specific user

Function Signature:

function showByUser($userSearchId)

Process Flow:

1. Query movements filtered by user ID

2. Include both active and deleted records

3. Provide complete user activity history

---

5. showByOperationName() - Operation Type Reports

Location: Lines 213-223

Purpose: Display movements for specific operation types

Function Signature:

function showByOperationName($operationName)

Process Flow:

1. Filter movements by operation name

2. Show system-wide usage of specific features

3. Include archived data for complete picture

Operation Examples:

---

6. showByDateAndUser() - Combined Date/User Filter

Location: Lines 225-235

Purpose: User activity within specific date range

Function Signature:

function showByDateAndUser($startDate, $endDate, $userSearchId)

Business Use Cases:

---

7. showByDateAndOperationName() - Combined Date/Operation Filter

Location: Lines 237-247

Purpose: System feature usage within date range

Function Signature:

function showByDateAndOperationName($startDate, $endDate, $operationName)

Business Use Cases:

---

8. showByUserAndOperationName() - Combined User/Operation Filter

Location: Lines 249-259

Purpose: Specific user's usage of specific operations

Function Signature:

function showByUserAndOperationName($userSearchId, $operationName)

Business Use Cases:

---

9. delete() - Movement Data Archival

Location: Lines 152-160 and 261-280

Purpose: Archive old movement data and clean up active table

Function Signature:

function delete($startDate, $endDate)

Process Flow:

1. Query movements to be archived within date range

2. Copy each record to movementmanagedeleted table

3. Preserve all original data fields

4. Delete records from active movementmanage table

5. Redirect to success page

Archival Logic:

$dataThatWillBeDeleted = $myMovementmanageEx->queryAllWithOpnameAndDateSimple($startDate, $endDate);
foreach ($dataThatWillBeDeleted as $value) {
    $movementManageDeleted->operationname = $value->operationname;
    $movementManageDeleted->movementmanagedate = $value->movementmanagedate;
    $movementManageDeleted->userid = $value->userid;
    $movementManageDeleted->currentDo = $value->currentDo;
    $movementManageDeleted->ip = $value->ip;
    $movementManageDeleted->mac = $value->mac;
    $movementManageDeleted->deviceType = $value->deviceType;
    $movementManageDeletedDAO->insert($movementManageDeleted);
}
$myMovementmanageEx->deleteByMovementmanagedateEX($startDate, $endDate);

Data Preservation: Complete movement history maintained in archive table

---

๐Ÿ”„ Workflows

Workflow 1: User Activity Analysis

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
START: Analyze User Activity
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1Select Analysis Criteria
- Choose date range (optional)
- Select specific user (optional)
- Pick operation type (optional)
- Combine multiple filters
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
2Execute Filtered Query
Based on filter combination:
โ†’ Date only: Show system activity by date
โ†’ User only: Show all user operations
โ†’ Operation only: Show feature usage
โ†’ Date + User: User activity in timeframe
โ†’ Date + Operation: Feature usage by date
โ”‚ โ””โ”€โ†’ User + Operation: User's specific feature use โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
3Display Comprehensive Report
- Active movement data
- Archived movement data
- Combined timeline view
- User performance metrics
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
4Analysis and Actions
- Identify usage patterns
- Security audit results
- Performance optimization insights
- Training needs assessment
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

---

Workflow 2: Movement Data Lifecycle

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
Movement Data Lifecycle
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1Movement Creation
- User performs system operation
- Movement automatically logged
- Stored in movementmanage table
- Includes: operation, user, timestamp, IP, MAC
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
2Active Monitoring Phase
- Data available for real-time reports
- Used for current period analysis
- Security monitoring and alerts
- Performance tracking
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
3Archival Decision
- Administrator selects date range for cleanup
- Data beyond retention period identified
- Archive process initiated
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
4Data Archival Process
- Copy to movementmanagedeleted table
- Preserve all original data fields
- Verify data integrity
- Remove from active table
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ–ผ
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
5Historical Reporting
- Archived data remains searchable
- Combined reports include both datasets
- Long-term trend analysis possible
- Compliance audit trail maintained
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

---

๐ŸŒ URL Routes & Actions

URL ParameterFunction CalledDescription
`do=` (empty)show()Display movement reports interface
`do=show`show()Same as empty - main reporting
`do=delete`delete()Archive movement data by date range
`do=sucess`Success pageShow operation success message
`do=error`Error pageShow operation error message
### Filter Parameters (GET/POST)

ParameterTypeDescription
`from`DateStart date for filtering (YYYY-MM-DD)
`to`DateEnd date for filtering (YYYY-MM-DD)
`usersearchid`IntegerUser ID filter
`operationname`StringOperation type filter
`nameopration`StringOperation display name (POST)
### Delete Operation (POST)

ParameterTypeDescription
`from2`DateStart date for archival
`to2`DateEnd date for archival
---

๐Ÿงฎ Calculation Methods

Report Message Generation

// Dynamic message building based on filters
$message = "ุชู‚ุฑูŠุฑ ุญุฑูƒุฉ ุงู„ู…ุณุชุฎุฏู…ูŠู†";

if (isset($startDate) && $startDate != "") {
    $message .= " ู…ู† ุชุงุฑูŠุฎ:" . $startDate . "ุงู„ู‰ ุชุงุฑูŠุฎ :" . $endDate;
}

if (isset($userSearchId) && $userSearchId != "-1") {
    $myuserdata = $myUserRecord->load($userSearchId);
    $message .= " ู„ู„ู…ูˆุธู :" . $myuserdata->employeename;
}

if (isset($operationName) && $operationName != "-1") {
    $message .= " ูู‰ ุนู…ู„ูŠู‡ :" . $nameopration;
}

User Permission Integration

$userGroup = $myUserGroupRecord->load($_SESSION['usergroupid']);
$smarty->assign("userGroup", $userGroup);
$smarty->assign("sessionuserid", $_SESSION['userid']);

---

๐Ÿ”’ Security & Permissions

User Group Authorization

// Load user group permissions for access control
$userGroup = $myUserGroupRecord->load($_SESSION['usergroupid']);

Session-Based Access

Sensitive Data Protection

---

๐Ÿ“Š Performance Considerations

Database Optimization

1. Critical Indexes Needed:

- movementmanage(movementmanagedate, userid)

- movementmanage(operationname, movementmanagedate)

- movementmanagedeleted(movementmanagedate, userid)

- movementmanagedeleted(operationname, movementmanagedate)

2. Query Performance:

- Date range queries should use indexed columns

- Extended DAO methods provide optimized queries

- Archive cleanup improves active table performance

Memory Management

Archival Strategy

// Efficient bulk archival process
foreach ($dataThatWillBeDeleted as $value) {
    // Copy to archive table
    $movementManageDeletedDAO->insert($movementManageDeleted);
}
// Bulk delete from active table
$myMovementmanageEx->deleteByMovementmanagedateEX($startDate, $endDate);

---

๐Ÿ› Common Issues & Troubleshooting

1. Large Dataset Performance

Issue: Reports slow with large movement datasets

Cause: Missing database indexes on filter columns

Fix: Add compound indexes:

CREATE INDEX idx_movement_date_user ON movementmanage(movementmanagedate, userid);
CREATE INDEX idx_movement_operation_date ON movementmanage(operationname, movementmanagedate);

2. Archival Process Failures

Issue: Archive operation fails partway through

Cause: Transaction not properly handled

Fix: Wrap in transaction:

try {
    R::begin();
    // Archive operations
    R::commit();
} catch (Exception $e) {
    R::rollback();
    throw $e;
}

3. Memory Issues with Large Archives

Issue: Out of memory during large archival operations

Cause: Loading entire dataset into memory

Fix: Process in batches:

$batchSize = 1000;
$offset = 0;
do {
    $batch = $myMovementmanageEx->queryBatch($startDate, $endDate, $offset, $batchSize);
    // Process batch
    $offset += $batchSize;
} while (count($batch) > 0);

4. Filter Combination Logic

Issue: Complex filter combinations not working correctly

Cause: Incorrect boolean logic in filter processing

Fix: Simplify filter logic with clear precedence:

$hasDate = !empty($startDate) && !empty($endDate);
$hasUser = !empty($userSearchId) && $userSearchId != "-1";
$hasOperation = !empty($operationName) && $operationName != "-1";

if ($hasDate && $hasUser && $hasOperation) {
    // All three filters
} elseif ($hasDate && $hasUser) {
    // Date and user
} // Continue with clear logic

---

๐Ÿงช Testing Scenarios

Test Case 1: Basic Movement Reporting

1. Access movement reports with no filters
2. Apply date range filter and verify results
3. Filter by specific user and check data
4. Test operation type filtering

Test Case 2: Complex Filter Combinations

1. Combine date range with user filter
2. Test date range with operation filter
3. Apply user and operation filters together
4. Verify all combinations work correctly

Test Case 3: Data Archival Process

1. Create test movement data
2. Run archival process for specific date range
3. Verify data moved to archive table
4. Confirm data removed from active table
5. Test archived data still searchable

Test Case 4: Performance Testing

1. Generate large movement dataset
2. Test report performance with various filters
3. Measure archival process speed
4. Verify memory usage within limits

---

๐Ÿ“š Related Documentation

---

Documented By: AI Assistant

Review Status: โœ… Complete

Next Review: When archival strategy needs optimization