Explains, not just counts
Adea shows the sequence: which lines counted, which rule was hit and why the threshold was not reached. Support can answer the customer right away.
Stack · Django
Prices, discounts and rules often sit in a views.py or a service that only developers can read. Adea reads it and explains step by step what happened on a specific order.
Why didn't order 10432 get the volume discount?
The order had 9 items, and the volume discount starts at 10. The discount also only applies to items in the Tools category, and 2 of the items were in Accessories.
Sourcesshop/pricing.py:112
The code Adea read · shop/pricing.py:112
def volume_discount(lines):
eligible = [l for l in lines
if l.product.category == 'tools']
if sum(l.qty for l in eligible) >= 10:
return Decimal('0.08')
The query Adea ran (read-only)
SELECT l.qty, c.name FROM shop_orderline l JOIN shop_product p ON p.id = l.product_id JOIN shop_category c ON c.id = p.category_id WHERE l.order_id = 10432
Adea shows the sequence: which lines counted, which rule was hit and why the threshold was not reached. Support can answer the customer right away.
Adea follows relations and managers in the Django models and finds the right tables, even when the names do not look like what you call things.
If Adea has understood a rule wrongly, a developer corrects it. The fix applies to all future answers.
Give read access to the repo and to a Postgres read-only user. Adea finds the models itself.
CREATE ROLE adea_readonly LOGIN PASSWORD '…'; GRANT SELECT ON ALL TABLES IN SCHEMA public TO adea_readonly;
Adea reads the code that decides the rules, whether it lives in views, serializers, services or tasks.
Only the tables and columns you open for their role.
It is not required, but you can have Adea link to the record in admin in the answer.