Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Oct 6, 2025

Summary by CodeRabbit

  • New Features

    • Added a public API endpoint to fetch organization user suggestions with filtering and pagination support.
    • Expanded invoice API to include invoice_status (DRAFT, PENDING_PAYMENT, PAID) and issued_time fields.
  • Documentation

    • Updated API documentation and examples to reflect the new user suggestions endpoint.
    • Revised invoice examples to include issued_time and invoice_status; removed invoice_paid_date references.

@coderabbitai
Copy link

coderabbitai bot commented Oct 6, 2025

Walkthrough

The OpenAPI spec adds a new manage-scope GET endpoint for organization user suggestions, introduces response and entity schemas for suggestions, and updates invoice models by adding InvoiceStatus and issued_time, removing invoice_paid_date, and refreshing examples to align with the new fields.

Changes

Cohort / File(s) Summary of Changes
OpenAPI: user suggestions endpoint and invoice model updates
src/libs/Ideogram/openapi.yaml
Added public schemas: GetApiOrganizationUserSuggestionsResponse, ApiOrganizationUserSuggestion; introduced GET /manage/api/organization/user_suggestions with params organization_id, user_handle_prefix, maxItems and 200/401/403/404 responses; added InvoiceStatus enum (DRAFT, PENDING_PAYMENT, PAID); updated Invoice schema to require invoice_status and issued_time; removed invoice_paid_date in favor of issued_time; reordered fields (e.g., total_spend); refreshed example payloads for ListOrganizationInvoicesResponse and Invoice to include issued_time and invoice_status.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant API as Manage API
  participant Auth as AuthZ
  participant Org as Org Service
  participant DB as Data Store

  C->>API: GET /manage/api/organization/user_suggestions<br/>?organization_id&user_handle_prefix&maxItems
  API->>Auth: Validate scope (manage) and permissions
  alt Authorized
    Auth-->>API: OK
    API->>Org: Fetch user suggestions (org_id, prefix, limit)
    Org->>DB: Query users by prefix and org
    DB-->>Org: Matching users
    Org-->>API: Suggestions list
    API-->>C: 200 GetApiOrganizationUserSuggestionsResponse
  else Unauthorized/Forbidden/Not Found
    Auth-->>API: 401/403
    API-->>C: 401/403/404
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my whiskers at specs renewed,
New paths for names, suggestions queued.
Invoices don a status crown,
Issued times now noted down.
I hop through YAML, ears held high—
Carrots, commas, schemas nigh! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “feat:@coderabbitai” does not describe the changes in the pull request and fails to convey the main updates to the OpenAPI definitions, including the new user suggestions endpoint and invoice schema enhancements. Please update the title to clearly summarize the key changes, for example “Add organization user suggestions endpoint and update invoice schemas in OpenAPI,” so reviewers can immediately understand the PR’s purpose.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202510061830

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot enabled auto-merge October 6, 2025 18:31
@github-actions github-actions bot merged commit 078bcd1 into main Oct 6, 2025
3 of 4 checks passed
@github-actions github-actions bot deleted the bot/update-openapi_202510061830 branch October 6, 2025 18:32
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add org user suggestions GET and schemas; update invoice models Oct 6, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa4548a and 9f1b35c.

⛔ Files ignored due to path filters (12)
  • src/libs/Ideogram/Generated/Ideogram..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiOrganizationUserSuggestions.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatus.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.JsonConverters.InvoiceStatusNullable.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiOrganizationUserSuggestions.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.Json.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ApiOrganizationUserSuggestion.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GetApiOrganizationUserSuggestionsResponse.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.Invoice.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.InvoiceStatus.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Ideogram/openapi.yaml (7 hunks)

Comment on lines +562 to 565
status: PAID
issued_time: '2024-02-01'
invoice_paid_date: '2024-02-05T10:30:00.0000000+00:00'
line_items:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Invoice example still references removed fields

Line 562 keeps status: PAID, and Line 564 retains invoice_paid_date, but the Invoice schema now requires invoice_status and dropped invoice_paid_date. The example should be updated to match the schema; otherwise SDKs generated from examples or readers following them will use the wrong properties.

-                    status: PAID
-                    issued_time: '2024-02-01'
-                    invoice_paid_date: '2024-02-05T10:30:00.0000000+00:00'
+                    invoice_status: PAID
+                    issued_time: '2024-02-01T00:00:00.0000000+00:00'

And similarly adjust the second invoice entry. This keeps the documentation consistent with the actual API contract.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
status: PAID
issued_time: '2024-02-01'
invoice_paid_date: '2024-02-05T10:30:00.0000000+00:00'
line_items:
invoice_status: PAID
issued_time: '2024-02-01T00:00:00.0000000+00:00'
line_items:
🤖 Prompt for AI Agents
In src/libs/Ideogram/openapi.yaml around lines 562 to 565, the invoice example
uses removed fields (status and invoice_paid_date) and must match the Invoice
schema which requires invoice_status and no longer includes invoice_paid_date;
update the example by replacing status: PAID with invoice_status: PAID, remove
invoice_paid_date entirely, and make the same change for the second invoice
entry so both examples use invoice_status and omit invoice_paid_date to stay
consistent with the schema.

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.

2 participants