feat: implement health statistics tracking (Phase 2.7 Task 2)
- Add HealthStatistics model with 10 stat types - Implement HealthStatisticsRepository - Create 6 health stats API endpoints - Add trend analysis with summary calculations - Follow medication repository pattern Status: 60% complete, needs compilation fixes
This commit is contained in:
parent
d673415bc6
commit
b59be78e4a
18 changed files with 2420 additions and 7 deletions
46
test-medication-api.sh
Executable file
46
test-medication-api.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
API_URL="http://solaria.solivarez.com.ar:8001"
|
||||
|
||||
echo "Testing Medication Management API"
|
||||
echo "=================================="
|
||||
|
||||
echo ""
|
||||
echo "1. Health Check"
|
||||
curl -s "$API_URL/health"
|
||||
echo ""
|
||||
|
||||
echo ""
|
||||
echo "2. Register User"
|
||||
REGISTER=$(curl -s -X POST "$API_URL/api/auth/register" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"email":"med-test@example.com","username":"medtest","password":"SecurePass123!","first_name":"Test","last_name":"User"}')
|
||||
echo "$REGISTER"
|
||||
|
||||
echo ""
|
||||
echo "3. Login"
|
||||
LOGIN=$(curl -s -X POST "$API_URL/api/auth/login" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"email":"med-test@example.com","password":"SecurePass123!"}')
|
||||
echo "$LOGIN"
|
||||
|
||||
TOKEN=$(echo "$LOGIN" | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
||||
echo ""
|
||||
echo "Token obtained"
|
||||
|
||||
echo ""
|
||||
echo "4. Create Medication"
|
||||
CREATE=$(curl -s -X POST "$API_URL/api/medications" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-d '{"profile_id":null,"medication_name":"Lisinopril","dosage":"10mg","frequency":"once_daily","instructions":"Take with breakfast"}')
|
||||
echo "$CREATE"
|
||||
|
||||
echo ""
|
||||
echo "5. List Medications"
|
||||
curl -s -X GET "$API_URL/api/medications" \
|
||||
-H "Authorization: Bearer $TOKEN"
|
||||
echo ""
|
||||
|
||||
echo ""
|
||||
echo "Tests complete!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue