Invoice Blocking Gherkin / BDD
Objective
Express Pre Order eligibility rules based on outstanding payment collection and remaining invoice buffer in a clear, executable format that Product, QA, Development, and Business stakeholders can review together before implementation or automation.
Business Rule
Pre Order using “KREDIT” payment method must be controlled by remaining invoice buffer. If remaining invoice amount > configured buffer, Pre Order should be put on HOLD with a confirmation popup. If remaining invoice amount <= buffer, Pre Order can be created with status “C”.
Feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Feature: Pre Order eligibility based on outstanding payment collection
As a sales operations team
I want outstanding payment collection rules to control Pre Order eligibility
So that new Pre Orders do not increase unsupported financial exposure
Background:
Given there is CPO import with Outstanding payment collection
And the remaining invoice buffer is configured as 50000
Scenario: Pre Order successful when Remaining invoice is smaller than buffer
When the user starts a Visit
And creates a Payment Collection with remaining invoice = 40000
And creates a Pre Order using payment method ["KREDIT"]
Then the Pre Order should be created successfully with status "C"
Scenario: Pre Order successful when Remaining invoice is equal to buffer
When the user starts a Visit
And creates a Payment Collection with remaining invoice = 50000
And creates a Pre Order using payment method ["KREDIT"]
Then the Pre Order should be created successfully with status "C"
Scenario: Pre Order on HOLD when Remaining invoice is greater than buffer
When the user starts a Visit
And creates a Payment Collection with remaining invoice = 50001
And creates a Pre Order using payment method ["KREDIT"]
Then the Pre Order should be created successfully with status "HOLD"
And a confirmation popup appears with the message "Terdapat Outstanding Invoice, harap melakukan penagihan terlebih dahulu"
Scenario Outline: Apply the remaining invoice buffer correctly
Given the remaining invoice amount is <remaining_amount>
When the user starts a Visit
And creates a Pre Order using payment method ["KREDIT"]
Then the Pre Order should be created with status <status>
Examples:
| remaining_amount | status |
| 40000 | C |
| 50000 | C |
| 50001 | HOLD |
Supporting Validation
- Confirm the configured remaining invoice buffer used by the application.
- Verify Pre Order status, either “C” or “HOLD”, and popup message.
- Reconcile payment collection, remaining invoice, and Pre Order status in database.
- Check audit log for eligibility decision.
- Retest the boundary when buffer configuration changes.
Why This Format Helps
The scenarios make the business rule, boundary conditions, expected Pre Order status, and user feedback visible before implementation. The same examples can support manual execution, UAT, and later become candidates for automation.