Skip to content
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

fix: delete personal_card.model.ts and places where it was used #3398

Merged

Conversation

sumrender
Copy link
Contributor

@sumrender sumrender commented Jan 4, 2025

Clickup

https://app.clickup.com/t/86cx8awe8

Code Coverage

Please add code coverage here

UI Preview

Please add screenshots for UI changes

Summary by CodeRabbit

  • Refactor

    • Removed PersonalCard model and associated mock data.
    • Simplified account deletion process across services and components.
    • Removed LaunchDarklyService dependencies from account deletion logic.
    • Transitioned to platform-specific models for personal card transactions and expense suggestions.
  • Bug Fixes

    • Streamlined account deletion method to use platform API consistently.
    • Updated transaction handling to reflect new data structures.
  • Chores

    • Cleaned up unused imports and test configurations.
    • Removed conditional API handling for account deletion.
    • Updated test cases to align with new data models and structures.

Copy link

coderabbitai bot commented Jan 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

In a thunderous display of code refactoring, this pull request obliterates the PersonalCard interface and trims down mock data related to personal cards. The changes streamline the account deletion process by removing conditional API logic and LaunchDarklyService dependencies. The transformation simplifies service methods, test suites, and component interactions, creating a more direct path for personal card management.

Changes

File Change Summary
src/app/core/mock-data/personal-cards.data.ts Removed multiple mock data constants for personal cards, retained platform-specific responses
src/app/core/models/personal_card.model.ts Completely removed PersonalCard interface
src/app/core/services/personal-cards.service.ts Simplified deleteAccount method, removed usePlatformApi parameter
src/app/fyle/personal-cards/personal-cards.page.spec.ts Removed PersonalCard model import
src/app/shared/components/bank-account-cards/... Removed LaunchDarklyService dependencies in component and test files
src/app/core/services/personal-cards.service.spec.ts Updated test cases to reflect platform-specific logic and removed unused mock data
src/app/core/models/personal-card-txn-expense-suggestion.model.ts Removed PersonalCardTxnExpenseSuggestion interface
src/app/core/models/personal_card_txn.model.ts Removed PersonalCardTxn interface
src/app/core/models/platform/... Introduced new platform-specific models and updated existing ones
src/app/fyle/add-edit-expense/... Updated imports and handling of personal card transactions in tests and components
src/app/shared/components/expense-card-lite/... Removed service dependencies and updated logic to simplify receipt handling

Suggested labels

size/XL

Suggested reviewers

  • arjunaj5
  • Chethan-Fyle
  • Dimple16

Possibly related PRs

Poem

Behold, code warriors, a refactor's might! 💥
Personal cards dance, complexity takes flight
Services streamlined, with Rajini's grace
Mock data trimmed, leaving not a trace
In the realm of bytes, simplicity reigns supreme! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ba07e9 and c3dd8b7.

📒 Files selected for processing (28)
  • src/app/core/mock-data/get-tasks-query-params-with-filters.data.ts (2 hunks)
  • src/app/core/mock-data/personal-card-txn-expense-suggestions.data.ts (5 hunks)
  • src/app/core/mock-data/personal-card-txns.data.ts (3 hunks)
  • src/app/core/mock-data/unflattened-txn.data.ts (1 hunks)
  • src/app/core/models/personal-card-txn-expense-suggestion.model.ts (0 hunks)
  • src/app/core/models/personal_card_txn.model.ts (0 hunks)
  • src/app/core/models/platform/platform-personal-card-filter-params.model.ts (1 hunks)
  • src/app/core/models/platform/platform-personal-card-query-params.model.ts (1 hunks)
  • src/app/core/models/platform/platform-personal-card-txn.model.ts (1 hunks)
  • src/app/core/services/personal-cards.service.spec.ts (24 hunks)
  • src/app/core/services/personal-cards.service.ts (14 hunks)
  • src/app/fyle/add-edit-expense/add-edit-expense-3.spec.ts (2 hunks)
  • src/app/fyle/add-edit-expense/add-edit-expense-4.spec.ts (11 hunks)
  • src/app/fyle/add-edit-expense/add-edit-expense.page.ts (4 hunks)
  • src/app/fyle/personal-cards-matched-expenses/expense-preview/expense-preview.component.spec.ts (1 hunks)
  • src/app/fyle/personal-cards-matched-expenses/expense-preview/expense-preview.component.ts (3 hunks)
  • src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.html (1 hunks)
  • src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.spec.ts (6 hunks)
  • src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.ts (3 hunks)
  • src/app/fyle/personal-cards/personal-cards.page.html (1 hunks)
  • src/app/fyle/personal-cards/personal-cards.page.spec.ts (25 hunks)
  • src/app/fyle/personal-cards/personal-cards.page.ts (24 hunks)
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.html (1 hunks)
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.spec.ts (3 hunks)
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.ts (1 hunks)
  • src/app/shared/components/personal-card-transaction/personal-card-transaction.component.html (2 hunks)
  • src/app/shared/components/personal-card-transaction/personal-card-transaction.component.spec.ts (5 hunks)
  • src/app/shared/components/personal-card-transaction/personal-card-transaction.component.ts (2 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the size/M Medium PR label Jan 4, 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: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99ec05f and 6ba07e9.

📒 Files selected for processing (7)
  • src/app/core/mock-data/personal-cards.data.ts (0 hunks)
  • src/app/core/models/personal_card.model.ts (0 hunks)
  • src/app/core/services/personal-cards.service.spec.ts (2 hunks)
  • src/app/core/services/personal-cards.service.ts (1 hunks)
  • src/app/fyle/personal-cards/personal-cards.page.spec.ts (0 hunks)
  • src/app/shared/components/bank-account-cards/bank-account-card/bank-account-card.component.spec.ts (3 hunks)
  • src/app/shared/components/bank-account-cards/bank-account-card/bank-account-card.component.ts (2 hunks)
💤 Files with no reviewable changes (3)
  • src/app/core/models/personal_card.model.ts
  • src/app/fyle/personal-cards/personal-cards.page.spec.ts
  • src/app/core/mock-data/personal-cards.data.ts
🔇 Additional comments (7)
src/app/shared/components/bank-account-cards/bank-account-card/bank-account-card.component.ts (1)

36-36: Aiyoo! Constructor is much leaner now, thalaiva.

Removing the LaunchDarklyService from the constructor is like removing extra baggage, making this code unstoppable. Great work, boss!

src/app/shared/components/bank-account-cards/bank-account-card/bank-account-card.component.spec.ts (3)

10-10: Ayya, this import be looking fine!
No major concerns, boss!


107-107: Thalaiva, referencing deletePersonalCardPlatformRes.data is neat!
That’s a well-structured approach, saar!


117-117: Aiyoo, verifying the deleteAccount call is perfect!
All lined up well, friend!

src/app/core/services/personal-cards.service.ts (1)

Line range hint 242-250: Saar, the fresh deleteAccount method is straightforward and powerful!
Removing the old parameter clearly simplifies the design.

src/app/core/services/personal-cards.service.spec.ts (2)

8-8: Magizhchi! The import for deletePersonalCardPlatformRes is in harmony with your tidy clean-up, boss.
Carry on, no trouble here!


169-169: Aiyoo, the test’s deleteAccount usage is top-notch!
All set like a blockbuster scene, my friend!

* fix: remove model PersonalCardTxnExpenseSuggestion

* fix: transform personal card public queryParams to platform (#3400)

* fix: transform personal card public queryParams to platform

* fix: remove use of old PersonalCardTxn model (#3401)

* remove use of old PersonalCardTxn model

* delete public PersonalCardTxn model and corresponding ldFlag (#3402)
@github-actions github-actions bot added size/XL Extra Large PR and removed size/M Medium PR labels Jan 6, 2025
@sumrender sumrender merged commit 5de4951 into remove-old-personal-card-model Jan 6, 2025
6 checks passed
Copy link

github-actions bot commented Jan 6, 2025

Unit Test Coverage % values
Statements 95.94% ( 19236 / 20048 )
Branches 91.1% ( 10632 / 11670 )
Functions 94.19% ( 5715 / 6067 )
Lines 95.98% ( 18364 / 19132 )

sumrender added a commit that referenced this pull request Jan 6, 2025
* fix: remove old getPersonalCardsCount method

* remove old getPersonalCards method

* replace use of PersonalCard model with PlatformPersonalCard

* fix: delete personal_card.model.ts and places where it was used (#3398)

* delete personal_card.model.ts and places where it was used

* fix: remove model PersonalCardTxnExpenseSuggestion (#3399)

* fix: remove model PersonalCardTxnExpenseSuggestion

* fix: transform personal card public queryParams to platform (#3400)

* fix: transform personal card public queryParams to platform

* fix: remove use of old PersonalCardTxn model (#3401)

* remove use of old PersonalCardTxn model

* delete public PersonalCardTxn model and corresponding ldFlag (#3402)
sumrender added a commit that referenced this pull request Jan 6, 2025
* fix: remove old getPersonalCardsCount method

* remove old getPersonalCards method

* replace use of PersonalCard model with PlatformPersonalCard

* fix: delete personal_card.model.ts and places where it was used (#3398)

* delete personal_card.model.ts and places where it was used

* fix: remove model PersonalCardTxnExpenseSuggestion (#3399)

* fix: remove model PersonalCardTxnExpenseSuggestion

* fix: transform personal card public queryParams to platform (#3400)

* fix: transform personal card public queryParams to platform

* fix: remove use of old PersonalCardTxn model (#3401)

* remove use of old PersonalCardTxn model

* delete public PersonalCardTxn model and corresponding ldFlag (#3402)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Extra Large PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants