Docs/api improvements#99
Conversation
Resolve TransactionEntity conflict by keeping the nullable creator_id (this branch's ON DELETE SET NULL change in V3) over main's not-null column. Adapt main's finance implementation (#97) to this branch's regenerated Reference-based finance contract: Transaction.member/creator and Balance.member are now Reference{id,name} instead of String. Resolve member display names via the member schema (firstName/lastName added to the read-only finance MemberEntity), mirroring the feedback/event services. Creator references are null-safe to match the nullable creator_id. Finance tests updated to assert against the Reference shape. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I also refined the letter service endpoints. |
|
There are minor misalignments, but I will handle them from the client side. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR migrates organization sports from name-based to UUID-based identity across all services (event, feedback, finance, organization, member), introducing a shared ChangesSport UUID migration, Reference schema, dashboard, async reports, role sync
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant app.py
participant reports.py
participant db.py
participant PostgreSQL
Client->>app.py: POST /reports/member/{id}
app.py->>app.py: authorize (self or admin)
app.py->>reports.py: trigger_member_report(member_id, token)
reports.py-->>app.py: daemon thread started
app.py-->>Client: 202 Accepted
reports.py->>reports.py: generate_member_report_text()
reports.py->>db.py: insert_member_report(member_id, text)
db.py->>PostgreSQL: INSERT INTO reports.member_reports
Client->>app.py: GET /reports/{report_id}
app.py->>db.py: get_report(report_id)
db.py->>PostgreSQL: SELECT member_reports / team_reports
db.py-->>app.py: dict with kind
app.py-->>Client: 200 Report
sequenceDiagram
participant OrgService
participant MemberRoleSyncService
participant KeycloakRoleService
participant KeycloakAdminAPI
OrgService->>MemberRoleSyncService: scheduleSync(memberIds)
MemberRoleSyncService->>MemberRoleSyncService: afterCommit or immediate
MemberRoleSyncService->>MemberRoleSyncService: check trainer/director/trainee repos
MemberRoleSyncService->>KeycloakRoleService: reconcile(memberId, desiredRoles)
KeycloakRoleService->>KeycloakAdminAPI: POST /token (client_credentials)
KeycloakAdminAPI-->>KeycloakRoleService: access_token
KeycloakRoleService->>KeycloakAdminAPI: GET role-mappings for user
KeycloakRoleService->>KeycloakAdminAPI: POST add roles / DELETE remove roles
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
services/spring-member/src/main/java/tum/devoops/memberservice/controller/MemberController.java (1)
51-58: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReturn the actual member resource URI in
Location.After the route migration,
POST /memberscreates a resource retrievable at/members/{id}, but the response currently advertises/{id}.🐛 Proposed fix
- return ResponseEntity.created(URI.create("/" + member.getId())).body(member); + return ResponseEntity.created(URI.create("/members/" + member.getId())).body(member);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@services/spring-member/src/main/java/tum/devoops/memberservice/controller/MemberController.java` around lines 51 - 58, The MemberController.createMember response is setting an incorrect Location header for newly created members. Update the URI built in createMember so it points to the actual member resource path under /members/{id} instead of just /{id}, keeping the rest of the ResponseEntity.created flow unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@services/spring-member/src/main/java/tum/devoops/memberservice/controller/MemberController.java`:
- Around line 51-58: The MemberController.createMember response is setting an
incorrect Location header for newly created members. Update the URI built in
createMember so it points to the actual member resource path under /members/{id}
instead of just /{id}, keeping the rest of the ResponseEntity.created flow
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 10adb7af-32ba-450a-aa37-d69e2087e9c6
📒 Files selected for processing (3)
services/spring-member/src/main/java/tum/devoops/memberservice/config/SecurityConfig.javaservices/spring-member/src/main/java/tum/devoops/memberservice/controller/MemberController.javaservices/spring-member/src/test/java/tum/devoops/memberservice/controller/MemberControllerTest.java
MemberService referenced these classes but they were never committed, breaking CI compilation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
I extended and migrated our services to the API changes we discussed. These changes have been made:
Only review these changes, do NOT merge them, since I need to do some manual steps afterwards.
Summary by CodeRabbit
New Features
Bug Fixes