Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Dec 23, 2025

What does this PR do?

Use organization.billingPlanId as a part of internal and planned refactor.

Test Plan

N/A.

Related PRs and Issues

Cloud#3061

Have you read the Contributing Guidelines on issues?

Yes.

Summary by CodeRabbit

  • Chores
    • Updated console dependency to a newer release.
    • Extended organization data to include additional billing plan identifiers and plan details (fields are present for future use; no user-facing behavior changed).

✏️ Tip: You can customize this high-level summary in your review settings.

@ItzNotABug ItzNotABug self-assigned this Dec 23, 2025
@appwrite
Copy link

appwrite bot commented Dec 23, 2025

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Storage files get ClamAV malware scanning and encryption by default

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Walkthrough

The pull request updates the @appwrite.io/console dependency reference in package.json to a different commit hash and adds two new public fields to the Organization interface in src/lib/stores/organization.ts: billingPlanId: Tier and billingPlanDetails: Plan (both marked as unused). No control-flow or behavioral logic changes are present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add billingPlanDetails prelim support' accurately describes the main change in the PR, which adds two new fields (billingPlanId and billingPlanDetails) to the Organization type for preliminary billing plan support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-billing-plan-object

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.

@ItzNotABug
Copy link
Member Author

This will have issues with Queries against billingPlanId as that doesn't exist. Will update as per latest changes 👍

@ItzNotABug ItzNotABug changed the title Use billingPlanId Add billingPlanDetails prelim support Dec 23, 2025
@ItzNotABug ItzNotABug marked this pull request as ready for review December 23, 2025 12:46
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
src/lib/stores/organization.ts (1)

19-19: Make billingPlanDetails optional with a tracking reference.

The billingPlanDetails field is marked as "unused for now!" yet remains non-optional. Since no code currently references this field, making it optional eliminates unnecessary friction when constructing Organization objects.

Update to:

billingPlanDetails?: Plan; /* TODO: Cloud#3061 - use once backend support is available */

This is a safe change as the field is not accessed anywhere in the codebase.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b18a769 and 4f4855a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/lib/stores/organization.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports

Files:

  • src/lib/stores/organization.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Define types inline or in .d.ts files, avoid creating separate .types.ts files
Use TypeScript in non-strict mode; any type is tolerated in this project

Files:

  • src/lib/stores/organization.ts
**/*.{ts,tsx,js,jsx,svelte,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration

Files:

  • src/lib/stores/organization.ts
  • package.json
🧠 Learnings (2)
📓 Common learnings
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2670
File: src/routes/(console)/organization-[organization]/+layout.ts:134-150
Timestamp: 2025-12-05T09:24:15.846Z
Learning: In the Appwrite console codebase, `prefs.organization` is maintained to always reference an organization with Platform.Appwrite, so when using preferences.organization as a fallback in redirect logic, no additional platform validation is required.
📚 Learning: 2025-09-26T06:48:57.938Z
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2373
File: src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte:629-631
Timestamp: 2025-09-26T06:48:57.938Z
Learning: In the Appwrite console codebase using appwrite.io/pink-svelte, the Icon component automatically handles CSS variable names passed to its color prop by internally wrapping them with var(). Therefore, passing '--some-css-variable' as a string to the Icon color prop works correctly without needing to manually wrap it with var().

Applied to files:

  • package.json
🧬 Code graph analysis (1)
src/lib/stores/organization.ts (1)
src/lib/sdk/billing.ts (1)
  • Plan (378-434)
🔇 Additional comments (2)
src/lib/stores/organization.ts (1)

3-3: LGTM!

The import follows the project's $lib alias convention and correctly imports the Plan type needed for the new billingPlanDetails field.

package.json (1)

25-25: The dependency update is valid and secure. The URL is accessible and resolves correctly via the package registry. No known vulnerabilities are published for @appwrite.io/console. No action required.

@ItzNotABug ItzNotABug marked this pull request as draft December 23, 2025 14:30
@ItzNotABug
Copy link
Member Author

ItzNotABug commented Dec 23, 2025

Marked as Draft until the BE change is done. Done.

@ItzNotABug ItzNotABug marked this pull request as ready for review December 24, 2025 10:11
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
src/lib/stores/organization.ts (1)

19-20: Clarify the naming and purpose of billingPlanId.

The field name billingPlanId suggests a unique identifier (e.g., "plan_abc123"), but it's typed as Tier, which is a string literal union representing tier levels ('tier-0' | 'tier-1' etc.). This creates semantic confusion.

Additionally, the existing billingPlan: Tier field (line 18) appears to serve a similar purpose. Consider:

  • If billingPlanId is meant to store a tier level, rename it to billingPlanTier or similar to avoid the "Id" suffix confusion
  • If it's meant to store an actual plan identifier, change the type to string
  • Clarify whether billingPlan and billingPlanId are meant to coexist or if one replaces the other in the refactor
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f4855a and 5d0fe28.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/lib/stores/organization.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx,svelte}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports

Files:

  • src/lib/stores/organization.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Define types inline or in .d.ts files, avoid creating separate .types.ts files
Use TypeScript in non-strict mode; any type is tolerated in this project

Files:

  • src/lib/stores/organization.ts
**/*.{ts,tsx,js,jsx,svelte,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration

Files:

  • src/lib/stores/organization.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: ItzNotABug
Repo: appwrite/console PR: 2670
File: src/routes/(console)/organization-[organization]/+layout.ts:134-150
Timestamp: 2025-12-05T09:24:15.846Z
Learning: In the Appwrite console codebase, `prefs.organization` is maintained to always reference an organization with Platform.Appwrite, so when using preferences.organization as a fallback in redirect logic, no additional platform validation is required.
🧬 Code graph analysis (1)
src/lib/stores/organization.ts (2)
src/lib/stores/billing.ts (1)
  • Tier (45-45)
src/lib/sdk/billing.ts (1)
  • Plan (378-434)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: e2e
  • GitHub Check: build
🔇 Additional comments (1)
src/lib/stores/organization.ts (1)

2-3: Imports look good.

The type imports for the new fields follow the coding guidelines correctly, using the $lib alias.

@ItzNotABug ItzNotABug merged commit 4425d99 into main Dec 24, 2025
4 checks passed
@ItzNotABug ItzNotABug deleted the add-billing-plan-object branch December 24, 2025 12:40
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.

3 participants