-
Notifications
You must be signed in to change notification settings - Fork 15
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: retain receipt when editing, remove code for advance wallet id, set unspecified category id #3245
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR title must start with "fix:", "feat:", "chore:", "refactor:", or "test:" (case-insensitive) |
PR description must contain a link to a ClickUp (case-insensitive) |
PR description must contain a link to a ClickUp (case-insensitive) |
PR description must contain a link to a ClickUp (case-insensitive) |
}; | ||
return this.expensesService.post(expense).pipe(map(() => txn)); | ||
} else { | ||
return of(txn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
advance_wallet_id
will be already set in the normal POST flow. We don't need this additional call
return this.transactionService.upsert(etxn.tx as Transaction).pipe( | ||
switchMap((txn) => this.expensesService.getExpenseById(txn.id)), | ||
map((expense) => this.transactionService.transformExpense(expense).tx), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not using the result of this double call for checking policy_amount
and other fields
@@ -3545,7 +3548,8 @@ export class AddEditExpensePage implements OnInit { | |||
amount = etxn.tx.user_amount; | |||
} | |||
|
|||
//TODO: Add depenedent fields to custom_properties array once APIs are available | |||
const category_id = this.getOrgCategoryID() || unspecifiedCategory.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting unspecified category as the default category.
@@ -205,7 +205,8 @@ export class TransactionService { | |||
} | |||
} else { | |||
const fileIds = fileObjs.map((fileObj) => fileObj.id); | |||
return this.upsert(txn, fileIds); | |||
txn.file_ids = fileIds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only during createTxnWithFiles
do we have to set the file_ids
in the add/edit flow. In other scenarios of the add/edit, the file_ids will be already present.
* fix expense for sending claim_amount as user_amount * fix mileage expenses creation -> add mileage_rate_id * test: Fix failing tests for move expenses POST to platform (#3251) * fix all failing tests except add-edit-expense-4.spec unknown ones on component.editExpense() * fix more test * minor
PR description must contain a link to a ClickUp (case-insensitive) |
|
Clickup
Please add link here
Code Coverage
Please add code coverage here
UI Preview
Please add screenshots for UI changes