-
Notifications
You must be signed in to change notification settings - Fork 0
✨ feat(linking): implement Phase 1.2 Device Linking #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Complete device linking flow with the following features:
API Endpoints:
- POST /api/devices/link-code - Generate 6-digit link code
- POST /api/devices/link - Link device to family with token
- GET /api/devices/family/{familyId} - List family devices
- GET /api/devices/family/{familyId}/{id} - Get device details
- PUT /api/devices/family/{familyId}/{id} - Update device
- POST /api/devices/family/{familyId}/{id}/unlink - Unlink device
- DELETE /api/devices/family/{familyId}/{id} - Delete device
- POST /api/devices/family/{familyId}/{id}/heartbeat - Record heartbeat
Domain:
- Add Unlink, Rename, UpdateSettings, Activate, Deactivate methods
- Device entity with full lifecycle support
Application:
- GenerateLinkCodeCommand, LinkDeviceCommand (with token)
- GetDeviceQuery, GetFamilyDevicesQuery
- UpdateDeviceCommand, UnlinkDeviceCommand, DeleteDeviceCommand
- RecordHeartbeatCommand for device status tracking
DTOs:
- LinkedDeviceDto with JWT device token
- DeviceHeartbeatDto for heartbeat response
- DeviceSettingsDto for device configuration
Tests:
- Unit tests for Device entity methods
- Application tests for command handlers and validators
Closes Phase 1.2 in roadmap
Remove dependency on packages.lock.json which doesn't exist. Use Directory.Packages.props and .csproj files for cache key instead.
- Add 'new' keyword to IDeviceRepository.GetByIdAsync to fix CS0108 - Add 'new' keyword to IUserRepository.GetByIdAsync to fix CS0108 - Remove --no-restore from build step to ensure packages are available
The Nanoid package v3.0+ changed its namespace from 'Nanoid' to 'NanoidDotNet'. Updated all usages across domain entities and tests.
- Add `using Xunit;` to all test files that were missing it - Add Microsoft.Extensions.Logging.Abstractions package to Application project for LoggingBehavior and PerformanceBehavior classes
…ge management Add package version to Directory.Packages.props for central package version management compliance.
- Use fully qualified FluentValidation.ValidationException in command handlers to resolve ambiguity with Luminous.Application.Common.Exceptions.ValidationException - Make LinkedDeviceDto.RefreshToken nullable to match AuthResultDto.RefreshToken
Microsoft.Azure.Cosmos requires explicit Newtonsoft.Json reference with version >= 10.0.2. Added v13.0.3 to central package management and Infrastructure project.
- Add using alias `User = Luminous.Domain.Entities.User` in UserRepository to disambiguate from Microsoft.Azure.Cosmos.User - Add `new` keyword to GetByIdAsync in both repositories - Fix recursive calls by using `base.GetByIdAsync()` instead
- Make familyId parameter nullable in IDeviceRepository and IUserRepository to match base IReadRepository<T>.GetByIdAsync signature - Update repository implementations to match interface signatures - Remove async from CosmosDbContext.GetDatabaseAsync (no await needed) - Remove async from CosmosDbContext.DisposeAsync, return ValueTask.CompletedTask
…ddleware Method is named Fail, not Failure.
The command handlers throw FluentValidation.ValidationException, not Luminous.Application.Common.Exceptions.ValidationException.
trickpatty
added a commit
that referenced
this pull request
Dec 24, 2025
trickpatty
added a commit
that referenced
this pull request
Dec 24, 2025
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.
Complete device linking flow with the following features:
API Endpoints:
Domain:
Application:
DTOs:
Tests:
Closes Phase 1.2 in roadmap