Learning from what happens
The rules are guesses
Every currency guess is recorded next to what the customer then did, and reviewed monthly
The situation
Every rule on the currency page started as a judgement. A rule that is sometimes wrong, or a question that customers always answer the same way, only shows up if someone keeps count.
What the app does
Every guess is recorded. On each sales inquiry's first reply the app records which rule settled the currency (or that it asked), the currency it went with, and the number's country.
The customer's own answer is read later. A tap on the currency buttons, a currency they name, or the currency of the quotation they were sent.
A monthly page compares the two. For each rule: how many guesses the customers confirmed, how many they contradicted, and how many are not confirmed yet. For the question: how often customers chose something other than the number's default. A question that only ever gets the default back can be dropped; a rule with wrong guesses is tightened. The page is behind the console login at
/currency.
This is the same loop as machine learning, at the scale of a parts business: tens of new foreign inquiries a month rather than thousands. A person reviews the numbers and changes the rule, and the change is recorded with its reason.
The tests that hold it
tests/unit/test_currency_learning.py.
