-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$250] Distance rate- WS owner can create multiple distance rate with same amount #51769
Comments
Triggered auto assignment to @strepanier03 ( |
@strepanier03 FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
Edited by proposal-police: This proposal was edited at 2024-10-30 21:07:32 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Distance rate- WS owner can create multiple distance rate with same amount What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
const rateValueRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{0,${CONST.MAX_TAX_RATE_DECIMAL_PLACES}})?$`, 'i');
const ratesList = Object.values(customUnitRates);
if (ratesList.some((r) => r.rate === convertToBackendAmount(Number(parsedRate)))) {
errors.rate = Localize.translateLocal('common.error.invalidRateError');
} else if (!rateValueRegex.test(parsedRate) || parsedRate === '') {
errors.rate = Localize.translateLocal('common.error.invalidRateError');
} else if (NumberUtils.parseFloatAnyLocale(parsedRate) <= 0) {
errors.rate = Localize.translateLocal('common.error.lowRateError');
}
return errors;
const customUnitRates: Record<string, Rate> = useMemo(() => customUnit?.rates ?? {}, [customUnit]);
const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.POLICY_CREATE_DISTANCE_RATE_FORM>) => {
return validateRateValue(values, currency, toLocaleDigit, customUnitRates);
},
[currency, toLocaleDigit, customUnitRates],
);
What alternative solutions did you explore? (Optional)Result |
@strepanier03 Huh... This is 4 days overdue. Who can take care of this? |
We chatted about this internally, and we want to block duplicate rates since the rate is the name and it's not possible to differentiate. We also block categories and tags of the same name so we'd want this similar to that. |
Job added to Upwork: https://www.upwork.com/jobs/~021854599760824128596 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
Working on determining the project now. |
We are unlikely to make any changes to this other than blocking the duplicate rate, but we will in the future most likely. |
This comment was marked as outdated.
This comment was marked as outdated.
Okay, we are good to move forward, here is the outcome.
Let's focus on not allowing duplicate rates within the same workspace in this GH and the other issue will be handled separately. |
@Krishna2323's proposal looks good to me 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @bondydaa, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@bondydaa Friendly bump |
@strepanier03 It seems @bondydaa is OOO |
@strepanier03 as mentioned here, @bondydaa is left and we need a new engineer to process this one. Could you help to unassign @bondydaa? |
@Krishna2323's proposal looks good to me 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @danieldoglas, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Bump @danieldoglas on above comment |
@danieldoglas, @strepanier03, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick! |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
Assigned |
📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@danieldoglas, one thing to confirm:
@DylanDylann, PR is ready for review. |
cc @Expensify/design for above comment |
I like that. cc @jamesdeanexpensify for 👀 on the copy |
Yup I like that too but will let James confirm! |
I like that too! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.55-9
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): testpayment935+523@gmail.com
Issue reported by: Applause - Internal Team
Action Performed:
Preconditions
Navigate to http://www.staging.new.expensify.com/
Steps
Expected Result:
Error shows as the rate is already exist
Actual Result:
WS owner can create multiple distance rate with same amount
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6650641_1730320405551.Screen_Recording_20241030_223334.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @DylanDylannThe text was updated successfully, but these errors were encountered: