# quote-request Specification

## Requirements

### Requirement: m² quote calculator

The product detail page MUST provide a Livewire calculator that accepts a quantity in m², computes
the estimated boxes/packages needed, and offers "Enviar cotización" or WhatsApp with a prefilled
message.

#### Scenario: Calculator computes packages from m²

- GIVEN a product with a defined m² per box/package
- WHEN the visitor enters a quantity in m²
- THEN the calculator shows the estimated boxes/packages needed

#### Scenario: WhatsApp message is prefilled

- GIVEN a visitor entered a quantity
- WHEN they choose the WhatsApp action
- THEN a WhatsApp link opens with a message prefilled with the product and quantity

#### Scenario: Invalid quantity is rejected

- GIVEN a visitor enters zero or a non-numeric quantity
- WHEN the calculator evaluates it
- THEN it shows a validation error and does not compute a result

### Requirement: Lead persistence and admin visibility

Quote and contact submissions MUST persist leads with name, contact, profile, region, message,
product, and m², and MUST be viewable in the admin panel.

#### Scenario: Submission persists a lead

- GIVEN a visitor completes a quote or contact form
- WHEN they submit valid data
- THEN a lead is stored with all submitted fields

#### Scenario: Admin lists submitted leads

- GIVEN stored leads
- WHEN an admin opens the leads list
- THEN the leads and their fields are visible

### Requirement: Validation, states, and anti-spam

Submissions MUST validate required fields, MUST show success and error states using the
success-600/error-600 tokens, and MUST apply anti-spam measures (honeypot and/or rate limiting).

#### Scenario: Invalid submission shows error state

- GIVEN a submission missing a required field
- WHEN it is submitted
- THEN validation errors are shown using the error-600 token
- AND no lead is stored

#### Scenario: Valid submission shows success state

- GIVEN a submission with valid data
- WHEN it is submitted
- THEN a success state is shown using the success-600 token
- AND the lead is stored

#### Scenario: Honeypot blocks bots

- GIVEN the hidden honeypot field is filled
- WHEN the form is submitted
- THEN the submission is rejected and no lead is stored
