Store additional device metadata - #725
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request extends the cross-service “device” contract to persist additional client metadata (brand/model/platform/agent/buildNumber) from auth flows into the device-management database.
Changes:
- Adds new device metadata fields to the auth/api/device-management DTOs and login event payloads.
- Persists the new fields in device-management Postgres (schema + model + converters + upsert).
- Exposes a local dev Postgres port for the device-management database in
docker-compose.local.yml.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docker-compose.local.yml | Exposes postgres-device-management on port 5441 for local development. |
| device-management/device-management-ports/device-management-postgres/src/main/resources/db/migration/V4__add_new_columns_for_device.sql | Adds new columns to devices table for additional metadata. |
| device-management/device-management-ports/device-management-postgres/src/main/kotlin/co/nilin/opex/device/ports/postgres/utils/Convertor.kt | Maps new fields between core Device and persistence DeviceModel. |
| device-management/device-management-ports/device-management-postgres/src/main/kotlin/co/nilin/opex/device/ports/postgres/model/DeviceModel.kt | Extends DB model with brand/model/platform/agent/buildNumber fields. |
| device-management/device-management-ports/device-management-postgres/src/main/kotlin/co/nilin/opex/device/ports/postgres/impl/DeviceManagerImpl.kt | Ensures upsert updates/persists the new device metadata fields. |
| device-management/device-management-core/src/main/kotlin/co/nilin/opex/device/core/service/UserSessionDeviceService.kt | Includes new metadata when upserting a device from a login event. |
| device-management/device-management-core/src/main/kotlin/co/nilin/opex/device/core/data/Platform.kt | Introduces Platform enum in device-management core. |
| device-management/device-management-core/src/main/kotlin/co/nilin/opex/device/core/data/LoginEvent.kt | Extends login event with new device metadata fields. |
| device-management/device-management-core/src/main/kotlin/co/nilin/opex/device/core/data/Device.kt | Extends core Device with new metadata fields. |
| auth-gateway/auth-gateway-app/src/main/kotlin/co/nilin/opex/auth/service/RegisterService.kt | Sends expanded login events including device metadata. |
| auth-gateway/auth-gateway-app/src/main/kotlin/co/nilin/opex/auth/service/LoginService.kt | Sends expanded login events including device metadata. |
| auth-gateway/auth-gateway-app/src/main/kotlin/co/nilin/opex/auth/data/Session.kt | Adds Platform enum to auth-gateway auth data. |
| auth-gateway/auth-gateway-app/src/main/kotlin/co/nilin/opex/auth/data/LoginEvent.kt | Updates auth-gateway login event schema with new fields. |
| auth-gateway/auth-gateway-app/src/main/kotlin/co/nilin/opex/auth/data/Device.kt | Extends auth-gateway Device payload with new metadata fields. |
| api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/auth/Session.kt | Adds Platform enum to API auth in/out models. |
| api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/auth/Device.kt | Extends API Device in/out model with new metadata fields. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fatemeh-i
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.