Skip to content

fix: update fyle_category to system_category for categories in the expense form#4113

Merged
arjunaj5 merged 1 commit intomasterfrom
Fyle-86d23b6r5
Feb 27, 2026
Merged

fix: update fyle_category to system_category for categories in the expense form#4113
arjunaj5 merged 1 commit intomasterfrom
Fyle-86d23b6r5

Conversation

@arjunaj5
Copy link
Contributor

@arjunaj5 arjunaj5 commented Feb 27, 2026

Clickup

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

Code Coverage

Please add code coverage here

UI Preview

Please add screenshots for UI changes

Summary by CodeRabbit

  • Improvements
    • Updated category handling and field visibility logic in the expense form to improve consistency and reliability of conditional checks across various expense types (travel, location, date-related categories).

@arjunaj5 arjunaj5 requested a review from mvaishnavi February 27, 2026 09:18
@github-actions github-actions bot added the size/S Small PR label Feb 27, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Walkthrough

Vanakkam! Ithis a grand refactoring of the expense form template, thalaivaa! We have replaced camelCase property names with snake_case and switched the categorical logic from fyle_category to system_category throughout the form. The functionality remains intact—only the naming conventions have been revolutionized across multiple conditional blocks.

Changes

Cohort / File(s) Summary
Expense Form Template
src/app/fyle/add-edit-expense/add-edit-expense.page.html
Refactored property references: replaced displayName with display_name in Category virtual select, changed fyle_category to system_category across all conditional blocks (location, date, travel class, tax sections), and updated defaultLabelProp accordingly. All category-dependent UI elements now align with new naming convention.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🎬 A form reborn with snake_case flair,
Categories shifting with style and care,
From fyle to system, the logic takes flight,
Display names polished—pure dynamite!
Vanakkam, refactoring—thalaivaa's delight!* 💫

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes the required ClickUp reference but lacks code coverage details and UI preview screenshots as specified in the template. Complete the missing sections: add code coverage metrics and provide UI preview screenshots showing the changes in the expense form.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating fyle_category to system_category in the expense form, which aligns with all the modifications in the HTML file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Fyle-86d23b6r5

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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
Copy link

🔁 Code Duplication Report - Angular

Format Files analyzed Total lines Total tokens Clones found Duplicated lines Duplicated tokens
java 4 196 1457 0 0 (0.00%) 0 (0.00%)
typescript 756 58076 500736 210 2856 (4.92%) 26149 (5.22%)
scss 192 21745 116353 112 3935 (18.10%) 21209 (18.23%)
markup 294 19824 166309 107 1439 (7.26%) 11970 (7.20%)
python 4 697 5373 3 32 (4.59%) 368 (6.85%)
css 1 38 219 0 0 (0.00%) 0 (0.00%)
swift 1 105 836 0 0 (0.00%) 0 (0.00%)
properties 2 29 73 0 0 (0.00%) 0 (0.00%)
javascript 16 1024 7043 1 10 (0.98%) 108 (1.53%)
prolog 1 60 559 0 0 (0.00%) 0 (0.00%)
groovy 6 192 1152 0 0 (0.00%) 0 (0.00%)
yaml 14 618 4561 9 187 (30.26%) 1554 (34.07%)
markdown 2 274 2046 0 0 (0.00%) 0 (0.00%)
bash 1 12 83 0 0 (0.00%) 0 (0.00%)
Total: 1294 102890 806800 442 8459 (8.22%) 61358 (7.61%)

📊 No significant change in code duplication.

fg.controls.category?.value?.displayName &&
autoCodedData.category === fg.controls.category.value.displayName
fg.controls.category?.value?.display_name &&
autoCodedData.category === fg.controls.category.value.display_name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

auto coded message was not being shown

<app-virtual-select
[cacheName]="'recentCategoryList'"
[defaultLabelProp]="'displayName'"
[defaultLabelProp]="'display_name'"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no issue noticed due to this remaining as displayName but fixed anyways

@github-actions
Copy link

Unit Test Coverage % values
Statements 95.04% ( 21426 / 22542 )
Branches 91.06% ( 7918 / 8695 )
Functions 94.36% ( 6260 / 6634 )
Lines 95.07% ( 20744 / 21819 )

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/app/fyle/add-edit-expense/add-edit-expense.page.html (2)

731-1100: ⚠️ Potential issue | 🟠 Major

Mass change needs proof, boss: add coverage + UI screenshots before merge.

This PR changes multiple category-gated UI branches, but no test updates are included in the provided diff. Please add targeted spec coverage for these conditions and attach before/after screenshots for the affected expense-form states.

I can draft the exact test matrix (categories × fields shown/hidden) if you want.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/fyle/add-edit-expense/add-edit-expense.page.html` around lines 731 -
1100, The PR changes multiple category-gated UI branches (template bindings
around txnFields and fg controls such as flight_journey_travel_class,
flight_return_travel_class, train_travel_class, bus_travel_class, from_dt/to_dt
and location_1/location_2) but adds no test coverage or screenshots; add
targeted unit/spec tests in the AddEditExpensePage (or its spec file) that
assert which fields are rendered or hidden for representative system_category
values (e.g., 'Taxi', flight/train/bus categories) and validation states
(touched/invalid), and attach before/after UI screenshots for at least the main
affected states (expanded/collapsed, category variations) to the PR so reviewers
can verify visual and behavioral changes.

731-1027: ⚠️ Potential issue | 🔴 Critical

The systemCategories array is incomplete and will silently hide mandatory fields for most travel/category combinations.

The template guards at lines 731, 741, 760, 790, 799, 835, 882, 893, 922, 962, and 1027 check if a category's system_category is in the systemCategories array returned by CategoriesService.getSystemCategories(). This array only includes ['Bus', 'Airlines', 'Lodging', 'Train'], but the backend supports [Airlines, Food, Lodging, Mail, Mileage, Others, Per Diem, Taxi, Unspecified, activity].

When a user selects a category like Taxi, Mileage, or Per Diem, these mandatory fields won't render because the includes() check fails. Expenses with those categories will lose location, date, and travel class fields entirely—even if marked mandatory by transaction fields configuration.

Update getSystemCategories() and getBreakfastSystemCategories() in CategoriesService to return the complete set of possible system_category values from the backend.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/fyle/add-edit-expense/add-edit-expense.page.html` around lines 731 -
1027, The template hides mandatory fields because
CategoriesService.getSystemCategories() (and getBreakfastSystemCategories())
returns an incomplete array; update these two methods to return the full set of
backend-supported system_category values (Airlines, Food, Lodging, Mail,
Mileage, Others, Per Diem, Taxi, Unspecified, activity) instead of
['Bus','Airlines','Lodging','Train'], and ensure the returned arrays are used
where templates call systemCategories?.includes(...) so mandatory fields render
correctly for Taxi/Mileage/Per Diem categories.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/app/fyle/add-edit-expense/add-edit-expense.page.html`:
- Around line 731-1100: The PR changes multiple category-gated UI branches
(template bindings around txnFields and fg controls such as
flight_journey_travel_class, flight_return_travel_class, train_travel_class,
bus_travel_class, from_dt/to_dt and location_1/location_2) but adds no test
coverage or screenshots; add targeted unit/spec tests in the AddEditExpensePage
(or its spec file) that assert which fields are rendered or hidden for
representative system_category values (e.g., 'Taxi', flight/train/bus
categories) and validation states (touched/invalid), and attach before/after UI
screenshots for at least the main affected states (expanded/collapsed, category
variations) to the PR so reviewers can verify visual and behavioral changes.
- Around line 731-1027: The template hides mandatory fields because
CategoriesService.getSystemCategories() (and getBreakfastSystemCategories())
returns an incomplete array; update these two methods to return the full set of
backend-supported system_category values (Airlines, Food, Lodging, Mail,
Mileage, Others, Per Diem, Taxi, Unspecified, activity) instead of
['Bus','Airlines','Lodging','Train'], and ensure the returned arrays are used
where templates call systemCategories?.includes(...) so mandatory fields render
correctly for Taxi/Mileage/Per Diem categories.

ℹ️ Review info

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e108685 and b13d822.

📒 Files selected for processing (1)
  • src/app/fyle/add-edit-expense/add-edit-expense.page.html

@arjunaj5 arjunaj5 merged commit 6d0ae54 into master Feb 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR

Development

Successfully merging this pull request may close these issues.

2 participants