Driver Fee Registration Form
Component Detail
Description
Form screen for recording a driving assignment linked to a specific contact, capturing the agreed driver fee amount, and initiating the confidentiality declaration flow. Only rendered when the org-level driver feature flag is enabled.
driver-fee-registration-form
Summaries
Accurately recording driver fees at the point of assignment is essential for financial transparency, audit compliance, and correct reimbursement processing. This form ensures that every driving engagement is paired with a documented, agreed fee and a confidentiality declaration, reducing disputes and protecting the organisation from compliance gaps. The feature-flag-gated design means the capability can be rolled out incrementally to organisations that opt in, enabling a controlled commercial expansion strategy. This directly supports revenue integrity and reduces the administrative cost of correcting fee discrepancies after the fact, improving margins on transport coordination workflows.
Medium complexity form screen with two notable dependencies: the driver-feature-flag-guard (which gates rendering entirely) and the declaration-send-screen (which must be functional before the full assignment flow can be tested end-to-end). The flag guard dependency means this screen cannot be shown in integration testing without the flag enabled — ensure test environments have this configured. Currency formatting for the fee amount field requires locale-aware input handling, which adds a small but non-trivial implementation concern. Validation error display must be tested across field combinations.
Coordinate with the declaration workflow stream to avoid blocking on declaration-send-screen availability during development sprints.
Renders conditionally based on org-level driver feature flag evaluated via driver-feature-flag-guard — the component should return null or a placeholder if the flag is disabled. The contact selector (onContactSelected) should integrate with the existing contact search/autocomplete component. Fee amount input must use a currency-aware text field with locale-specific decimal and thousands separators; store as integer minor units (e.g., cents) internally to avoid floating-point errors. onSubmitDriverAssignment assembles a driver_assignment record linking contactId, fee amount, and orgId before persisting.
onOpenDeclarationFlow navigates to declaration-send-screen passing the driverId and newly created assignmentId. Validate required fields (contact, fee > 0) before enabling submit. Data models: driver_assignment, driver_fee.
Responsibilities
- Render contact selector for the transport recipient
- Capture agreed driver fee amount with currency formatting
- Display org-flag-gated visibility (hidden when flag disabled)
- Provide entry point to attach or send confidentiality declaration
Interfaces
renderDriverFeeForm(contactId, orgConfig)
onContactSelected(contact)
onFeeAmountChanged(amount)
onSubmitDriverAssignment(assignment)
onOpenDeclarationFlow()
showValidationErrors(errors)
onCancel()
Relationships
Dependencies (2)
Components this component depends on
Related Data Entities (2)
Data entities managed by this component