feat: Premium built and switched off; default machine minimums (front 3, Marcus 10/11)
Premium (8 passadas, R$ 39,90/m, SKU DTFP.TX.100CM) is a fifth textile ready-sheet product: priced on the server and the Site, a hidden fifth card, a PREMIUM hot-folder class, its Tiny SKU, and a products row created disabled by a migration until Dropstar says 'testado'. A machine with no typed minimum now alerts at Dropstar's fixed minimums: 1 roll of film, 1 L of each ink, 5 kg of powder. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
import unittest
|
||||
from decimal import Decimal
|
||||
|
||||
from app.machine_log import (ALIGN_AFTER_FILM_METRES, CLEAN_EVERY_METRES, estimate,
|
||||
one_decimal, supply_low)
|
||||
from app.machine_log import (ALIGN_AFTER_FILM_METRES, CLEAN_EVERY_METRES, DEFAULT_MINIMUMS,
|
||||
estimate, minimum_for, one_decimal, supply_low)
|
||||
|
||||
|
||||
class EstimateTest(unittest.TestCase):
|
||||
@@ -38,6 +38,22 @@ class EstimateTest(unittest.TestCase):
|
||||
self.assertEqual(CLEAN_EVERY_METRES, Decimal('10'))
|
||||
self.assertEqual(ALIGN_AFTER_FILM_METRES, Decimal('20'))
|
||||
|
||||
def test_a_machine_without_typed_minimums_alerts_at_dropstars_defaults(self):
|
||||
# Marcus, 2026-11-10: 1 roll of film, 1 L of each ink, 5 kg of powder.
|
||||
self.assertEqual(DEFAULT_MINIMUMS, {'film': Decimal('1'), 'ink_c': Decimal('1'),
|
||||
'ink_m': Decimal('1'), 'ink_y': Decimal('1'),
|
||||
'ink_k': Decimal('1'), 'ink_w': Decimal('1'),
|
||||
'powder': Decimal('5')})
|
||||
for item, default in DEFAULT_MINIMUMS.items():
|
||||
with self.subTest(item=item):
|
||||
minimum = minimum_for({}, item)
|
||||
self.assertEqual(minimum, default)
|
||||
value = estimate([Decimal('1'), Decimal('1')], [Decimal('10')],
|
||||
Decimal('9'), minimum)
|
||||
self.assertTrue(supply_low(value))
|
||||
# A minimum Gestão typed still wins over the default.
|
||||
self.assertEqual(minimum_for({'film': Decimal('0')}, 'film'), Decimal('0'))
|
||||
|
||||
|
||||
class AlertTextTest(unittest.TestCase):
|
||||
def test_one_decimal_uses_a_comma(self):
|
||||
|
||||
Reference in New Issue
Block a user