diff --git a/app/core/models.py b/app/core/models.py index 3b8deda..3f39e76 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -164,7 +164,8 @@ class Item(StrictModel): if [source.upload_id for source in self.production.sources] != self.uploads: raise ValueError('Production sources must match uploaded files in order') is_sheet = self.mode in ('file', 'uvfile') - film_width = Decimal('28.5') if self.mode in ('uvfile', 'uv') else Decimal('57') + # UV is 27 cm wide (Dropstar, 2026-10-28; it was 28,5). + film_width = Decimal('27') if self.mode in ('uvfile', 'uv') else Decimal('57') if self.production.film_width_cm != film_width: raise ValueError('Production film width does not match the product') for source in self.production.sources: diff --git a/app/tiny.py b/app/tiny.py index 1db7aff..68d9e54 100644 --- a/app/tiny.py +++ b/app/tiny.py @@ -77,8 +77,8 @@ STEP_DEFAULTS = {'uvfile': 'DTFIMP.UV.010CM', 'uv': 'DTFIMP.UV.010CM'} METRE_DEFAULTS = {'uvfile': 'DTFIMP.UV.1MT', 'uv': 'DTFIMP.UV.1MT'} PRODUCTS = {'file': 'DTF Têxtil 57 cm · folha montada', 'avulsa': 'DTF Têxtil 57 cm · artes avulsas', - 'uvfile': 'DTF UV 28,5 cm · folha montada', - 'uv': 'DTF UV 28,5 cm · artes avulsas'} + 'uvfile': 'DTF UV 27 cm · folha montada', + 'uv': 'DTF UV 27 cm · artes avulsas'} # How far back to look for an order a previous delivery may already have made. SEARCH_DAYS = 7 # A "ready" event can come after corrections; it normally knows the Tiny id. diff --git a/docs/CONTEXT.md b/docs/CONTEXT.md index 6dba18e..9b83304 100644 --- a/docs/CONTEXT.md +++ b/docs/CONTEXT.md @@ -155,7 +155,7 @@ for loose artwork: | Product | Ready sheet | Loose artwork | |---|---:|---:| | DTF textile, 57 cm | R$ 19,90 | R$ 21,90 | -| UV sticker, 28,5 cm | R$ 79,90 | R$ 89,90 | +| UV sticker, 27 cm (Dropstar, 2026-10-28; was 28,5) | R$ 79,90 | R$ 89,90 | The grade (nota) is still computed and shown, to the customer, on the Kanban and in Tiny's item note: it explains the file and no longer changes the price. diff --git a/tests/artwork_browser_test.mjs b/tests/artwork_browser_test.mjs index 6aaaf48..d0a8417 100644 --- a/tests/artwork_browser_test.mjs +++ b/tests/artwork_browser_test.mjs @@ -259,9 +259,9 @@ try{ return {altura:+r.altura.toFixed(2),folga:+r.folga.toFixed(3), xs:[...new Set(r.pos.map(p=>+p.x.toFixed(2)))],ys:[...new Set(r.pos.map(p=>+p.y.toFixed(2)))]};})()`), {altura:89.42,folga:0.2,xs:[0.2,28.6],ys:[0.5,30.14,59.78]}); - // UV, 28,5 cm: two 14 cm pieces still share a row, 1,67 mm apart. - assert.equal(await evaluate(`(()=>{const a={};const r=encaixar([{w:14,h:10,img:null,a},{w:14,h:10,img:null,a}],28.5); - return new Set(r.pos.map(p=>p.y)).size===1 && Math.abs(r.folga-0.5/3)<1e-9})()`),true); + // UV, 27 cm: two 13,2 cm pieces still share a row, 2 mm apart. + assert.equal(await evaluate(`(()=>{const a={};const r=encaixar([{w:13.2,h:10,img:null,a},{w:13.2,h:10,img:null,a}],27); + return new Set(r.pos.map(p=>p.y)).size===1 && Math.abs(r.folga-0.6/3)<1e-9})()`),true); // A long piece stands up when that shortens the sheet: 30 x 10 cm, eight copies, // five to a row turned instead of one to a row as sent. assert.deepEqual(await evaluate(`(()=>{const a={};const r=encaixar(Array.from({length:8},()=>({w:30,h:10,img:null,a})),57); diff --git a/tests/smoke_test.py b/tests/smoke_test.py index 2ab9ba8..fa0d3b6 100644 --- a/tests/smoke_test.py +++ b/tests/smoke_test.py @@ -93,7 +93,7 @@ def upload_bytes(client, content, name='LOCAL-TEST.cdr', order_id=None, expected return uid def item_spec(mode, metres, grade, uid): - film_width=28.5 if mode in ('uvfile','uv') else 57 + film_width=27 if mode in ('uvfile','uv') else 57 length_cm=float(metres)*100 return {'mode':mode,'metres':str(metres),'grade':grade,'uploads':[uid], 'production':{'version':2,'film_width_cm':film_width,'height_cm':length_cm, diff --git a/tests/test_layout_rules.py b/tests/test_layout_rules.py index a64e954..5dee94b 100644 --- a/tests/test_layout_rules.py +++ b/tests/test_layout_rules.py @@ -9,7 +9,7 @@ from app.core.models import Item def item(mode='avulsa', mirrored=False, version=3): upload = uuid4() - film = 28.5 if mode in ('uv', 'uvfile') else 57 + film = 27 if mode in ('uv', 'uvfile') else 57 return {'mode': mode, 'metres': '0.21', 'grade': 100, 'uploads': [str(upload)], 'quality_status': 'ok', 'quality_acknowledged': False, 'production': {'version': version, 'film_width_cm': film, 'height_cm': 21, diff --git a/tests/test_tiny.py b/tests/test_tiny.py index 02f3426..a4efb9e 100644 --- a/tests/test_tiny.py +++ b/tests/test_tiny.py @@ -213,8 +213,8 @@ class TinyTests(FakeTinyCase): self.products['103']['situacao'] = 'I' with mock.patch.dict(os.environ, {'TINY_PRODUCT_UV_AVULSA': ''}): results = check(auth=FakeAuth(), transport=httpx.MockTransport(self.handler)) - self.assertIn('não está ativo', results['DTF UV 28,5 cm · folha montada']) - self.assertEqual(results['DTF UV 28,5 cm · artes avulsas'], 'TINY_PRODUCT_UV_AVULSA sem id') + self.assertIn('não está ativo', results['DTF UV 27 cm · folha montada']) + self.assertEqual(results['DTF UV 27 cm · artes avulsas'], 'TINY_PRODUCT_UV_AVULSA sem id') self.assertEqual(results['pedidos'], 'ok') # The order list is asked by date: unfiltered, Tiny times out on a large account. asked = [] @@ -528,10 +528,10 @@ class TinyStepSkuTests(FakeTinyCase): def test_settings_and_check_know_the_step_sku(self): from app.tiny import check, required_settings self.assertNotIn('TINY_PRODUCT_UV_FOLHA', required_settings()) - self.assertEqual(check(orders=self.tiny)['DTF UV 28,5 cm · folha montada'], 'ok') + self.assertEqual(check(orders=self.tiny)['DTF UV 27 cm · folha montada'], 'ok') del self.products['300'] self.tiny.skus.clear() - self.assertIn('DTFIMP.UV.010CM', check(orders=self.tiny)['DTF UV 28,5 cm · folha montada']) + self.assertIn('DTFIMP.UV.010CM', check(orders=self.tiny)['DTF UV 27 cm · folha montada']) @product_ids @@ -555,10 +555,10 @@ class TinyMetreAndStepSkuTests(FakeTinyCase): def test_whole_metres_alone_and_the_check(self): from app.tiny import check, step_lines self.assertEqual(step_lines({'billed_metres': '2', 'unit_cents': 6990}, 'C', 'M'), [('M', 2, 6990)]) - self.assertEqual(check(orders=self.tiny)['DTF UV 28,5 cm · folha montada'], 'ok') + self.assertEqual(check(orders=self.tiny)['DTF UV 27 cm · folha montada'], 'ok') del self.products['301'] self.tiny.skus.clear() - self.assertIn('DTFIMP.UV.1MT', check(orders=self.tiny)['DTF UV 28,5 cm · folha montada']) + self.assertIn('DTFIMP.UV.1MT', check(orders=self.tiny)['DTF UV 27 cm · folha montada']) @product_ids @@ -578,7 +578,7 @@ class TinyProbeTests(FakeTinyCase): self.assertIn('101\tDTF-101\tProduto 101', text) code, text = self.probe('conferir') self.assertEqual(code, 0) - self.assertIn('TINY_PRODUCT_UV_AVULSA (DTF UV 28,5 cm · artes avulsas): ok DTF-104', text) + self.assertIn('TINY_PRODUCT_UV_AVULSA (DTF UV 27 cm · artes avulsas): ok DTF-104', text) self.assertIn('TINY_FORMA_ENVIO_RETIRADA (retirada): ok Retirar pessoalmente', text) code, text = self.probe('formas-envio') self.assertIn('77\t6\tRetirar pessoalmente', text) diff --git a/web/index.html b/web/index.html index 94e5245..c0fc918 100644 --- a/web/index.html +++ b/web/index.html @@ -676,7 +676,7 @@ h2 em{font-style:normal;color:var(--laranja)} Impressão DTF