Skip to content

Commit

Permalink
Merge pull request Expensify#53459 from Expensify/monil-cleanuptaxVio…
Browse files Browse the repository at this point in the history
…lationCode

Cleanup tax violations logic and migrate it to server
  • Loading branch information
techievivek authored Dec 5, 2024
2 parents 0e28aa4 + f5cd07f commit e25e3fa
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/hooks/useViolations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,13 @@ const violationFields: Record<ViolationName, ViolationField> = {

type ViolationsMap = Map<ViolationField, TransactionViolation[]>;

// We don't want to show these violations on NewDot
const excludedViolationsName = ['taxAmountChanged', 'taxRateChanged'];

/**
* @param violations – List of transaction violations
* @param shouldShowOnlyViolations – Whether we should only show violations of type 'violation'
*/
function useViolations(violations: TransactionViolation[], shouldShowOnlyViolations: boolean) {
const violationsByField = useMemo((): ViolationsMap => {
const filteredViolations = violations.filter((violation) => {
if (excludedViolationsName.includes(violation.name)) {
return false;
}
if (shouldShowOnlyViolations) {
return violation.type === CONST.VIOLATION_TYPES.VIOLATION;
}
Expand Down

0 comments on commit e25e3fa

Please sign in to comment.