Core Models (based on actual DB schema analysis):
- User: Headscale users with relationships
- Node: Connected machines with detailed host info
- PreAuthKey: Pre-authentication keys with validation
- ApiKey: API authentication keys with expiration
- Policy: ACL policies (JSON format)
Extended Models for FARMQ:
- PharmacyInfo: Pharmacy details (name, business number, contact)
- MachineSpecs: Hardware specifications per machine
- MonitoringData: Real-time monitoring metrics
Features:
- Complete database relationships and foreign keys
- JSON type handling for complex data structures
- Timezone-aware datetime handling
- Helper methods (is_online, is_expired, is_valid)
- Database utility functions
- Comprehensive test suite with actual data validation
Test Results: ✅ All models working with live Headscale SQLite DB
- 1 User: myuser
- 1 Node: 0bin-Ubuntu-VM (100.64.0.1)
- 1 API Key: 8qRr1IB (valid until Dec 2025)
- 1 Pre-auth Key: reusable, valid
- Extended tables created and tested successfully
Ready for FARMQ pharmacy management system integration.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>