3.3 KiB
Requirements Document
Introduction
This specification addresses the API parameter mismatch issue in the contract confirmation functionality. The backend expects a partyType query parameter, but the frontend is not providing it, resulting in a "Required request parameter 'partyType' for method parameter type String is not present" error.
Glossary
- Contract_Confirmation_System: The system component responsible for handling contract confirmation operations
- Frontend_API_Client: The Vue.js frontend application that makes API calls to the backend
- Backend_API_Controller: The Spring Boot controller that handles contract confirmation requests
- Party_Type: A string parameter indicating which party is confirming the contract (SECURITY_COMPANY/CLIENT_COMPANY)
- Contract_ID: A unique identifier for the contract being confirmed
Requirements
Requirement 1
User Story: As a frontend developer, I want the API call to include the required partyType parameter, so that the contract confirmation request succeeds without parameter errors.
Acceptance Criteria
- WHEN the Frontend_API_Client calls the contract confirmation endpoint, THE Contract_Confirmation_System SHALL include the partyType parameter as a query parameter
- WHEN the partyType parameter is provided, THE Backend_API_Controller SHALL accept the request without parameter validation errors
- WHEN the user's role is client_company, THE Contract_Confirmation_System SHALL set partyType to CLIENT_COMPANY
- WHEN the user's role is admin or security_company, THE Contract_Confirmation_System SHALL set partyType to SECURITY_COMPANY
- WHEN the partyType parameter is missing, THE Backend_API_Controller SHALL return a clear error message indicating the missing parameter
Requirement 2
User Story: As a system administrator, I want the contract confirmation to properly identify which party is confirming, so that the system can track confirmation status correctly.
Acceptance Criteria
- WHEN a contract confirmation is processed, THE Contract_Confirmation_System SHALL record which party type performed the confirmation
- WHEN the confirmation is successful, THE Contract_Confirmation_System SHALL update the contract status appropriately
- WHEN the partyType is CLIENT_COMPANY, THE Contract_Confirmation_System SHALL mark the client confirmation status
- WHEN the partyType is SECURITY_COMPANY, THE Contract_Confirmation_System SHALL mark the security company confirmation status
- WHEN both parties have confirmed, THE Contract_Confirmation_System SHALL update the overall contract status to confirmed
Requirement 3
User Story: As a user, I want clear error messages when API calls fail, so that I can understand what went wrong and how to fix it.
Acceptance Criteria
- WHEN an API parameter is missing, THE Contract_Confirmation_System SHALL return a descriptive error message
- WHEN the user lacks permission to confirm, THE Contract_Confirmation_System SHALL return an authorization error
- WHEN the contract is in an invalid state for confirmation, THE Contract_Confirmation_System SHALL return a state validation error
- WHEN a system error occurs, THE Contract_Confirmation_System SHALL log the error and return a user-friendly message
- WHEN the API response contains an error, THE Frontend_API_Client SHALL display the error message to the user