Skip to content

Conversation

@marlonkeating
Copy link
Contributor

Description:
Adding more constraint fields for field validation to the checkout context BFF payload.

Jira:
ENT-10753

Testing Instructions

  • Navigate to http://localhost:18270/api-docs/
  • Scroll to v1/bffs/checkout/context/ POST entry
  • Click "Try it out" -> Execute
  • Verify the response field_constraints contains the new entries

Validation
Validate that regexes provide the proper constraints for the fields in question (Good tool: https://regex101.com/ )

  • admin_email: enforces valid email format
  • country: enforces capitalized letters

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

Copy link
Contributor

@iloveagent57 iloveagent57 left a comment

Choose a reason for hiding this comment

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

looks great! one tiny request

Copy link
Member

@brobro10000 brobro10000 left a comment

Choose a reason for hiding this comment

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

Approved to unblock but as part of making validation complete, it requires a fix to company name in the abstract serializer in order to surface the errors downstream to the form fields.

In enterprise_access/apps/api/serializers/customer_billing.py, the CustomerBillingCreateCheckoutSessionValidationFailedResponseSerializer does not have company_name as as valid field abstracted. Adding the company name field as part of the serializer allows the downstream component to properly surface the correct error.

    company_name = FieldValidationSerializer(
        required=False,
        help_text='Validation results for company_name if validation failed. Absent otherwise.',
    )

It results in the downstream form field for company_name to properly surface the correct error (albeit not user friendly yet).

Image

@marlonkeating marlonkeating merged commit fa715b7 into main Nov 4, 2025
4 checks passed
@marlonkeating marlonkeating deleted the mkeating/ENT-10753 branch November 4, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants