# Requirements Document

## Introduction

This document specifies the requirements for a Military Training Material Management System, a PC web-based backend management system designed to implement training material allocation and personnel information management for military units. The system supports hierarchical organizational structures and role-based access control with automatic data flow between different organizational levels.

## Glossary

- **System**: The Military Training Material Management System
- **Division**: The highest organizational level (师团)
- **Regiment**: Mid-level organizational unit under Division (团)
- **Battalion**: Lower organizational unit under Regiment (营)
- **Company**: Lowest organizational unit under Battalion (连)
- **Division Administrator**: User with full system permissions through dedicated Division-level account
- **Training Material**: Military supplies and equipment used for training purposes
- **Allocation Target**: The specific organizational unit receiving material allocation
- **Allocation Quota**: The amount of material assigned to a specific unit
- **Actual Completion**: The actual amount of material reported by a unit
- **Completion Rate**: Calculated as Actual Completion / Allocation Quota
- **Personnel**: Military personnel managed within the system
- **Personnel Level**: Classification based on the organizational level that approved the personnel

## Requirements

### Requirement 1

**User Story:** As a Division administrator, I want to manage organizational accounts, so that I can control access and maintain proper hierarchical structure.

#### Acceptance Criteria

1. WHEN a Division administrator creates accounts, THE System SHALL generate accounts based on organizational structure
2. THE System SHALL support four-level organizational hierarchy including Division, Regiment, Battalion, and Company levels
3. WHEN accessing the system, THE System SHALL enforce role-based permissions according to organizational hierarchy
4. THE System SHALL maintain audit logs for all account operations performed by Division administrators

### Requirement 2

**User Story:** As a Division administrator, I want to create and distribute training material allocations, so that subordinate units receive proper resource assignments.

#### Acceptance Criteria

1. WHEN creating material categories, THE System SHALL allow Division administrators to define new categories with descriptive names
2. WHEN creating allocations, THE System SHALL require material name, unit, total allocation quota, and target organizational units
3. WHEN setting unit quotas, THE System SHALL validate that sum of all unit quotas does not exceed total allocation quota
4. WHEN allocation is created, THE System SHALL automatically distribute allocation data to corresponding organizational accounts
5. THE System SHALL prevent allocation creation when quota validation fails

### Requirement 3

**User Story:** As a Regiment user, I want to view and report on received allocations, so that I can track material distribution and report completion status.

#### Acceptance Criteria

1. WHEN viewing allocations, THE System SHALL display category, material name, unit, quota, actual completion, and completion rate
2. WHEN submitting reports, THE System SHALL allow Regiment users to enter actual completion values and submit to Battalion level
3. THE System SHALL calculate completion rate automatically as actual completion divided by quota
4. WHEN Battalion users view data, THE System SHALL show aggregated information from subordinate Regiment units
5. THE System SHALL restrict Company users to view-only access without direct reporting capabilities

### Requirement 4

**User Story:** As any organizational user, I want to view hierarchical data summaries, so that I can understand material distribution across different organizational levels.

#### Acceptance Criteria

1. WHEN Division users access reports, THE System SHALL display total quotas, actual completion, and overall completion rates for all subordinate units
2. WHEN Regiment users access reports, THE System SHALL show detailed quota, actual completion, and completion rate data for direct subordinate units
3. WHEN viewing detailed records, THE System SHALL provide access to specific reporting records including timestamps and reporting personnel
4. THE System SHALL maintain data visibility restrictions based on organizational hierarchy

### Requirement 5

**User Story:** As a user, I want to modify or delete submitted reports, so that I can correct errors in previously submitted data.

#### Acceptance Criteria

1. WHEN a user requests modification, THE System SHALL allow editing of submitted reports only before higher-level approval
2. WHEN submitting modification requests, THE System SHALL require reason for change and route to Division administrator for approval
3. WHEN Division administrator reviews requests, THE System SHALL display original values, requested changes, requesting user, and modification reason
4. WHEN Division administrator approves changes, THE System SHALL update the data and maintain audit trail
5. THE System SHALL prevent direct modification of approved reports without proper authorization workflow

### Requirement 6

**User Story:** As an organizational unit, I want to submit personnel information, so that personnel data can be managed hierarchically.

#### Acceptance Criteria

1. WHEN submitting personnel data, THE System SHALL require name, photo, position, rank, gender, ID number, professional title, education level, age, height, contact information, hometown, training participation, achievements, and supporting documents
2. THE System SHALL support photo upload with 2-inch format requirement
3. WHEN personnel data is submitted, THE System SHALL route to appropriate organizational level for approval
4. THE System SHALL maintain personnel records with complete audit trail of submissions and approvals

### Requirement 7

**User Story:** As a higher-level organizational unit, I want to approve or reject personnel submissions, so that I can maintain personnel quality standards.

#### Acceptance Criteria

1. WHEN receiving personnel submissions, THE System SHALL provide approve or reject options to higher-level units
2. WHEN personnel is approved, THE System SHALL assign personnel level based on the approving organizational level
3. WHEN personnel level is determined, THE System SHALL classify as Company Personnel, Battalion Personnel, Regiment Personnel, or Division Personnel based on approval level
4. THE System SHALL support cross-level personnel transfers when approved by appropriate higher authority
5. THE System SHALL maintain personnel level consistency with organizational approval hierarchy

### Requirement 8

**User Story:** As an organizational user, I want to view personnel information, so that I can access personnel data appropriate to my organizational level.

#### Acceptance Criteria

1. WHEN accessing personnel data, THE System SHALL display personnel list for current and subordinate organizational levels only
2. THE System SHALL restrict personnel data access based on organizational hierarchy and approval levels
3. WHEN viewing personnel details, THE System SHALL show complete personnel information including photos and supporting documents
4. THE System SHALL maintain data security by preventing access to personnel from non-subordinate organizational units