Skip to content

Fix medication history update and add medicationDate to API response - #122

Merged
fyui001 merged 1 commit into
NewWorldOrg:masterfrom
fyui001:fix/medication-history-update
Apr 7, 2026
Merged

fyui001 merged 1 commit into
NewWorldOrg:masterfrom
fyui001:fix/medication-history-update

Conversation

@fyui001

@fyui001 fyui001 commented Apr 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix UpdateMedicationHistoryRequest to use MedicationDate::forStringTime() instead of direct constructor (TypeError: int expected, string given)
  • Add medication_date to EloquentRepository::update() (was saving only amount and note)
  • Add medicationDate field to MedicationHistoryDetail DTO and OpenAPI spec
  • Add BaseTime ISO string conversion in BaseResponder::objectToArray() (BaseTime subclasses were serialized as UNIX timestamps instead of ISO strings)

Test plan

  • PUT /api/medication_histories/{id} with medication_date returns updated value
  • medicationDate field appears in API response as ISO 8601 string
  • Existing GET endpoints continue to work

🤖 Generated with Claude Code

- Fix UpdateMedicationHistoryRequest to use MedicationDate::forStringTime()
  instead of direct constructor (TypeError: int expected, string given)
- Add medication_date to EloquentRepository::update() (was saving only
  amount and note)
- Add medicationDate field to MedicationHistoryDetail DTO and OpenAPI spec
- Add BaseTime ISO string conversion in BaseResponder::objectToArray()
  (BaseTime subclasses were serialized as UNIX timestamps instead of ISO strings)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fyui001 fyui001 self-assigned this Apr 7, 2026
@fyui001
fyui001 merged commit 4e2ee21 into NewWorldOrg:master Apr 7, 2026
4 checks passed
@fyui001
fyui001 deleted the fix/medication-history-update branch April 7, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant