Harden prototype validation, UI, and test coverage
Summary
- Added server-side validation for production-job creation
- Added validation for production steps, job activation, station inventory, and transfer fulfillment
- Prevented negative inventory values
- Prevented jobs without production steps from being activated
- Prevented changes to production configuration after activation
- Prevented zero, invalid, excessive, or repeated transfer fulfillment
- Added shared responsive styling across all five application pages
- Added smoke tests for main pages, job details, and static CSS delivery
- Preserved the existing TC-01 through TC-15 workflow
Input Validation
Production jobs
- Job name is required
- Production quantity must be at least 1
- Low-stock threshold must be between 0% and 100%
- Invalid numeric input returns a controlled validation response
- Invalid input does not create a database record
Production steps
- Only Draft jobs can be modified
- A valid station is required
- Production instruction is required
- Required part name is required
- Required part quantity must be at least 1
Job activation
- Only Draft jobs can be activated
- At least one production step is required before activation
- Invalid activation does not create a barcode or product units
Station inventory
- Station and part references must be valid
- Quantity must be numeric
- Negative station inventory is rejected
Transfer fulfillment
- Transferred quantity must be numeric and greater than zero
- Transferred quantity cannot exceed the remaining requested quantity
- Fulfilled requests cannot be fulfilled again
- Rejected transfers do not modify station inventory
Interface Improvements
- Added one shared responsive stylesheet
- Standardized page background, navigation, forms, buttons, tables, alerts, and status messages
- Added mobile-friendly table behavior
- Applied consistent styling to:
- Production Jobs
- Job Details
- Station Inventory
- Warehouse Requests
- Worker Kiosk
Test Coverage
Automated command:
python -m pytest -q
Result:
32 passed
Coverage includes:
- 15 functional test cases covering TC-01 through TC-15
- 10 validation test results
- 7 application smoke-test results
Smoke coverage verifies:
- Production Jobs page
- Station Inventory page
- Warehouse Requests page
- Worker Kiosk page
- Job Details page
- Static stylesheet availability
- Correct CSS response type
Technical Verification
-
python -m pip check— no broken requirements - Python application modules compile successfully
- All expected Flask routes are registered
- All 32 tests pass
- All five main pages load with the shared styling
- Working tree is clean
Increment Scope
README and final-project documentation are intentionally deferred until the complete final prototype is ready.