Spaces:
Running on Zero
Add Gherkin feature specs for editable tables, accumulation, and background processing
Browse filesThree existing features were missing Gherkin scenarios for behaviors already supported by the codebase. Two new feature files cover cross-export deduplication and progressive streaming.
crm_card.feature: add 3 scenarios for editable payments, trips, and documents tables. The app already renders gr.Dataframe components with interactive=True (app.py:617-643) and the crm_tables presenter; these scenarios pin that contract.
dashboard.feature: add 2 scenarios for last-10-messages overview and chatbox Q&A. The app already has a chatbox wired to DashboardInteractor.stream() (app.py:588-603) which answers queries like 'a Maria ja pagou tudo?' using aggregated data.
accumulation.feature (new): 4 scenarios covering cross-export merge behavior. BuildCrmCard already deduplicates payments by (payer, amount, date), trips by locator, messages by (contact, text, timestamp), and preserves pipeline stage (build_crm_card.py:366-421). These scenarios document the merge invariants.
background_processing.feature (new): 3 scenarios for progressive UI updates. BuildCrmCard.process_streaming() yields snapshots at each stage (image, audio, documents, assemble, done) while the status panel updates alongside (build_crm_card.py:86-96, app.py:520-546). One scenario also asserts that the chatbox search remains independently usable during processing.
- features/accumulation.feature +27 -0
- features/background_processing.feature +22 -0
- features/crm_card.feature +18 -0
- features/dashboard.feature +10 -0
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Feature: Cross-export data accumulation
|
| 2 |
+
As the agency owner
|
| 3 |
+
I want to upload multiple exports for the same customer without duplication
|
| 4 |
+
So that the CRM card stays clean and complete
|
| 5 |
+
|
| 6 |
+
Scenario: Merge payments from two exports
|
| 7 |
+
Given a customer "Maria" with a payment of "R$ 1.000,00" from a previous export
|
| 8 |
+
When the user uploads a second export containing a payment of "R$ 500,00" and the same "R$ 1.000,00" receipt
|
| 9 |
+
Then the total payments include both unique amounts
|
| 10 |
+
And the duplicate "R$ 1.000,00" payment appears only once
|
| 11 |
+
|
| 12 |
+
Scenario: Merge trips from two exports
|
| 13 |
+
Given a customer with a trip "ABC123" from a previous export
|
| 14 |
+
When the user uploads a second export containing trip "ABC123" and a new trip "DEF456"
|
| 15 |
+
Then the customer card lists both trips
|
| 16 |
+
And trip "ABC123" appears only once
|
| 17 |
+
|
| 18 |
+
Scenario: Preserve existing pipeline stage
|
| 19 |
+
Given a customer at pipeline stage "TICKETING" from a previous export
|
| 20 |
+
When the user uploads a new export with no additional pipeline data
|
| 21 |
+
Then the pipeline stage remains "TICKETING"
|
| 22 |
+
|
| 23 |
+
Scenario: Merge contacts and fellow travelers
|
| 24 |
+
Given a customer "Ana" with contact "ana@email.com" from a previous export
|
| 25 |
+
When the user uploads a second export mentioning "Ana" as a fellow traveler of "Maria"
|
| 26 |
+
Then the customer "Ana" keeps the previous contact
|
| 27 |
+
And the customer "Ana" also has the new fellow-traveler relationship
|
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Feature: Background processing with progressive updates
|
| 2 |
+
As the agency owner
|
| 3 |
+
I want to see data appear gradually while processing
|
| 4 |
+
So that I never wait on a blank screen
|
| 5 |
+
|
| 6 |
+
Scenario: Show partial results as images are processed
|
| 7 |
+
Given a WhatsApp export with two receipt images and one ticket image
|
| 8 |
+
When the user uploads it
|
| 9 |
+
Then the payments table updates after each receipt is processed
|
| 10 |
+
And the trips table updates after the ticket is processed
|
| 11 |
+
And the interface remains responsive throughout
|
| 12 |
+
|
| 13 |
+
Scenario: Show progress status at each stage
|
| 14 |
+
Given a WhatsApp export with images, audio, and documents
|
| 15 |
+
When the user uploads it
|
| 16 |
+
Then a status message shows the current step
|
| 17 |
+
And the status updates through stages: images, audio, documents, assembly, done
|
| 18 |
+
|
| 19 |
+
Scenario: Search remains usable during processing
|
| 20 |
+
Given the system is currently processing a WhatsApp export
|
| 21 |
+
When the user types "quem ainda deve?" in the chatbox
|
| 22 |
+
Then the answer is returned immediately without waiting for processing to finish
|
|
@@ -21,3 +21,21 @@ Feature: Auto-built customer CRM card
|
|
| 21 |
Given a conversation thread with voice notes
|
| 22 |
When the user uploads it to the Space
|
| 23 |
Then the timeline includes audio events with transcribed text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
Given a conversation thread with voice notes
|
| 22 |
When the user uploads it to the Space
|
| 23 |
Then the timeline includes audio events with transcribed text
|
| 24 |
+
|
| 25 |
+
Scenario: View payments in editable table
|
| 26 |
+
Given a customer card with three payments
|
| 27 |
+
When the user views the payments tab
|
| 28 |
+
Then a table shows payer, amount, method, bank, and date columns
|
| 29 |
+
And the amount cell can be edited
|
| 30 |
+
|
| 31 |
+
Scenario: View trips in editable table
|
| 32 |
+
Given a customer card with two trips
|
| 33 |
+
When the user views the trips tab
|
| 34 |
+
Then a table shows locator, passengers, airline, total, and segment columns
|
| 35 |
+
And the total cell can be edited
|
| 36 |
+
|
| 37 |
+
Scenario: View documents in editable table
|
| 38 |
+
Given a customer card with documents for two passengers
|
| 39 |
+
When the user views the documents tab
|
| 40 |
+
Then a table shows passenger, document kind, and status columns
|
| 41 |
+
And the status cell can be edited
|
|
@@ -12,3 +12,13 @@ Feature: Cross-customer dashboard and search
|
|
| 12 |
Given several processed customers
|
| 13 |
When the user opens the overview
|
| 14 |
Then the total money in, outstanding, and profit are shown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
Given several processed customers
|
| 13 |
When the user opens the overview
|
| 14 |
Then the total money in, outstanding, and profit are shown
|
| 15 |
+
|
| 16 |
+
Scenario: Show recent messages across customers
|
| 17 |
+
Given several processed customers with messages
|
| 18 |
+
When the user opens the dashboard overview
|
| 19 |
+
Then the last 10 messages across all customers are shown
|
| 20 |
+
|
| 21 |
+
Scenario: Ask about customers via chatbox
|
| 22 |
+
Given several processed customers
|
| 23 |
+
When the user types "a Maria ja pagou tudo?" in the chatbox
|
| 24 |
+
Then the system answers based on the aggregated data
|