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

PayTo - Field validation #2019

Merged
merged 4 commits into from
Feb 26, 2025
Merged

Conversation

araratthehero
Copy link
Contributor

Description

Add validation for PayTo fields

Checklist

  • Code is unit tested
  • Changes are tested manually

COAND-1058

@araratthehero araratthehero requested a review from a team as a code owner February 20, 2025 12:43
@AdyenAutomationBot AdyenAutomationBot added the Chore [PRs only] Indicates any task that does not need to be mentioned in the public release notes label Feb 20, 2025
firstName,
Validation.Valid
)
private fun validateFirstName(firstName: String): FieldState<String> = if (firstName.isNotEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check for isNotBlank() instead maybe?

private val PHONE_NUMBER_PATTERN = Pattern.compile(PHONE_NUMBER_REGEX)

@Suppress("ktlint:standard:max-line-length", "MaxLineLength")
private const val EMAIL_ADDRESS_REGEX =
Copy link
Contributor

Choose a reason for hiding this comment

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

In ValidationUtils we also have regexes for phone numbers and emails. Would it be possible to reuse those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The email regex has been reused, but we should keep the phone number regex.

@araratthehero araratthehero force-pushed the chore/payto_view_do_validation branch from 4125b59 to 3772fcf Compare February 21, 2025 10:57
@araratthehero araratthehero force-pushed the chore/payto_view_do_validation branch from 3772fcf to 2079e0d Compare February 21, 2025 10:58
Copy link
Contributor

✅ No public API changes

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
53.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@araratthehero araratthehero merged commit db94031 into feature/payto Feb 26, 2025
11 of 12 checks passed
@araratthehero araratthehero deleted the chore/payto_view_do_validation branch February 26, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore [PRs only] Indicates any task that does not need to be mentioned in the public release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants