DEV Community

Source Tapestry Review
Source Tapestry Review

Posted on

Carpet Quote Validation: Missing Fields Versus Substitutions

A quote checker must tell three cases apart: a key absent from the offer, a blank value, and a value that conflicts with the brief. Each means different follow-up, and none is settled by a photo. Treat the offer as a set of fields to review, not as pass or fail.

In a small Python example, an offer omits the construction and names a backing that differs from the brief. The identifiers below are placeholders.

required = {"fibre": "A", "construction": "B", "backing": "C"}
offer = {"fibre": "A", "backing": "D"}

def check_fields(required, offer):
    result = {}
    for field, expected in required.items():
        actual = offer.get(field)
        if actual is None or not actual.strip():
            result[field] = "missing"
        elif actual.strip() != expected:
            result[field] = "check difference"
        else:
            result[field] = "stated match"
    return result

assert check_fields(required, offer) == {
    "fibre": "stated match",
    "construction": "missing",
    "backing": "check difference",
}
Enter fullscreen mode Exit fullscreen mode

Run separate tests for an entirely missing key, a blank value and a genuine substitution. A trade name or abbreviation should stay open for review until its meaning is confirmed against the supplier’s item-specific documentation. If your team maintains a verified equivalence table, keep the original supplier value alongside the mapped one.

The output is a review list, not approval of the product. Take missing fields to the supplier. Send a documented substitution to the responsible specifier, particularly if project documents name a specific fibre, backing or construction technique.

Top comments (0)