Overview
This prompt guides developers in enhancing the infinitepay-dashboard-flutter repository by implementing a new failure handling system. Programmers working on this project will benefit from clear instructions and structured output requirements.
Prompt Overview
Purpose: This implementation aims to enhance user onboarding by handling specific failure scenarios effectively.
Audience: Developers working on the infinitepay-dashboard-flutter repository will benefit from improved error management.
Distinctive Feature: The new `PepPersonFailure` class introduces localized error messages for politically exposed persons.
Outcome: Users will receive clear feedback during onboarding, improving overall user experience and compliance.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Business Communications, Data Analytics & Business Intelligence, Development Tools & DevOps
- Techniques: Decomposition, Prompt Templates, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
In the infinitepay-dashboard-flutter repository, expand functionality by implementing a new failure and its handling across multiple files and languages.
## Steps
1. Create User Failure
– Open the file:
`create_user_failure.dart`
in the `shared_onboarding` package.
– Create a new failure class named:
`PepPersonFailure`.
2. Map the Failure
– Add a case for:
`PepPersonFailure`
in the file:
`create_user_exception_mapper.dart`.
– Ensure it matches a 422 status code with response code:
`12`.
3. UI Error Handling
– Modify:
`OnboardingErrorsFactory`
in:
`app/lib/featuresonboarding/presentation/ui_errors`.
– Add error messages for the new failure:
– EN:
– Title: “Hey, politically exposed person”
– Message: “This CPF belongs to a politically exposed person and we don’t allow creating accounts for people like that.”
– PT:
– Title: “Ei, pessoa politicamente exposta”
– Message: “Esse CPF pertence a uma pessoa politicamente exposta e não permitimos a criação da conta de pessoas assim.”
4. Localize Messages
– Add these messages to the `.arb` files within the app folder.
– Execute:
`flutter pub run intl_utils:generate`
to generate localized files.
5. Unit Testing
– Create or update unit tests for all modified or newly created classes.
## Output Format
Describe the changes made, including any relevant file paths and code snippets. Detail the test case setup and results in a structured format.
## Notes
– Adhere to existing coding standards and project guidelines.
– Ensure multilingual support is implemented correctly as per `.arb` file settings.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Open your preferred code editor for the project.
- Follow the steps outlined in the prompt sequentially.
- Implement changes in the specified files and locations.
- Test your changes thoroughly for functionality.
- Document your changes and results as instructed.
Tips for Best Results
- Create User Failure: Implement the `PepPersonFailure` class in `create_user_failure.dart` within the `shared_onboarding` package.
- Map the Failure: Update `create_user_exception_mapper.dart` to handle `PepPersonFailure` with a 422 status code and response code 12.
- UI Error Handling: Modify `OnboardingErrorsFactory` to include English and Portuguese error messages for `PepPersonFailure`.
- Unit Testing: Create or update unit tests for the new failure class and error handling to ensure proper functionality.
FAQ
- What is the new failure class created?
The new failure class created is named `PepPersonFailure` in `create_user_failure.dart`. - Where is the failure mapped?
The failure is mapped in `create_user_exception_mapper.dart` with a 422 status code. - What messages were added for UI error handling?
Messages for politically exposed persons were added in English and Portuguese in `OnboardingErrorsFactory`. - How are messages localized in the app?
Messages are added to `.arb` files and localized using `flutter pub run intl_utils:generate`.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


