feat: add ATC position management API - #3
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new ATC Position management module (CRUD + OpenAPI docs) backed by a new atc_position table seeded from the VATPRC station list, and extends the audit-log model/storage to support non-UUID entity identifiers via entity_key (used for ATC position callsigns).
Changes:
- Introduces
atc_positionmodule with routes/service/repository/DTOs and wires it into the app router andServices. - Extends audit logging to support
AuditLogEntity::AtcPosition(String)and adds list endpoints for ATC-position audit logs. - Adds a migration to create and seed
public.atc_position, and updatespublic.audit_logto allow eitherentity_idorentity_key.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/services.rs | Registers AtcPositionService in the shared Services container. |
| src/openapi.rs | Adds ATC Positions API docs + OpenAPI test assertions for new endpoints. |
| src/modules/mod.rs | Exposes the new atc_position module. |
| src/modules/audit_log/service.rs | Adds ATC-position audit log listing methods. |
| src/modules/audit_log/routes.rs | Adds secured audit-log routes for ATC positions and callsign-scoped audit queries. |
| src/modules/audit_log/repository.rs | Adds entity_key support and ATC-position entity conversions + query by entity key. |
| src/modules/audit_log/models.rs | Adds AuditLogEntity::AtcPosition(String) (non-Copy). |
| src/modules/audit_log/dto.rs | Adds DTO mapping for ATC-position audit-log entities. |
| src/modules/atc_position/service.rs | Implements CRUD service with audit-log recording for position changes. |
| src/modules/atc_position/routes.rs | Adds list/get/create/update/delete endpoints with role-gated mutations. |
| src/modules/atc_position/repository.rs | Adds SQLx repository operations + required sort order for listing positions. |
| src/modules/atc_position/models.rs | Defines position models + category enum string conversions. |
| src/modules/atc_position/mod.rs | Declares atc_position submodules. |
| src/modules/atc_position/dto.rs | Adds request/response DTOs, callsign normalization, frequency validation + tests. |
| src/error.rs | Maps AtcPositionServiceError into ApiError. |
| src/app.rs | Mounts /api/atc/positions routes. |
| migrations/20260829000000_add_atc_positions.sql | Creates atc_position, seeds 665 rows, and extends audit_log with entity_key. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Testing
cargo test --all-targets(80 passed)Tracking