feat: 8 mm of clear film between the copies and sheets of a ready sheet, billed (Marcus, 2026-11-26)
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 7m43s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m23s
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 7m43s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m23s
The Site stacked a ready sheet's copies with nothing between them (#81's were 0,3 mm apart). Now 8 mm separates each copy and each sheet from the next, and the metres include it, as Marcus confirmed. A new cart without the gap is refused with the reason; a quote made before is still reviewed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -347,7 +347,8 @@ try{
|
||||
// With a sheet loaded the declaration is locked; it cannot flip under the customer.
|
||||
assert.equal(await evaluate(`document.querySelector('#tipoEnvio .cam[data-tipo="avulsa"]').disabled`),true);
|
||||
await evaluate(`(()=>{const el=$('lista').querySelector('[data-repf]');el.value=2;el.dispatchEvent(new Event('change',{bubbles:true}));})()`);
|
||||
await waitFor(()=>evaluate('Math.abs(metros-2*folhas[0].m)<0.0001 && folhas[0].m<0.2'),'ready-sheet repetitions');
|
||||
// Two copies and the 8 mm between them (Marcus, 2026-11-26).
|
||||
await waitFor(()=>evaluate('Math.abs(metros-(2*folhas[0].m+0.008))<0.0001 && folhas[0].m<0.2'),'ready-sheet repetitions');
|
||||
assert.equal(await evaluate(`document.querySelectorAll('.folhaPrevia').length`),1);
|
||||
await evaluate(`(()=>{folhas.push({f:new File(['manual'],'manual.cdr'),med:null,rep:1,m:1,an:null});pintaFolha();})()`);
|
||||
await waitFor(()=>evaluate(`itemAtual?.nota===0 && itemAtual?.unit===PRECO[modo]+TAXA_MANUAL`),'mixed analyzed and manual sheets: the price plus the manual charge');
|
||||
|
||||
43
tests/test_sheet_gap.py
Normal file
43
tests/test_sheet_gap.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""8 mm of clear film between the copies of a ready sheet (Marcus, 2026-11-26):
|
||||
a new cart must carry it; a quote made before is still reviewed.
|
||||
|
||||
Run from the repository root: python3 -m unittest tests.test_sheet_gap -v.
|
||||
"""
|
||||
import unittest
|
||||
from uuid import uuid4
|
||||
|
||||
from app.core.models import SHEET_GAP_CHANGED, Item, check_sheet_gaps
|
||||
|
||||
|
||||
def sheet(copies=3, gap=0.8, mode='file'):
|
||||
upload = str(uuid4())
|
||||
width = 27 if mode == 'uvfile' else 57
|
||||
length = 20
|
||||
placements = [{'source_index': 0, 'copy_index': i, 'x_cm': 0, 'y_cm': round(i * (length + gap), 4),
|
||||
'width_cm': width, 'length_cm': length, 'rotation_degrees': 0, 'mirrored': False}
|
||||
for i in range(copies)]
|
||||
height = round(copies * length + (copies - 1) * gap, 4)
|
||||
return Item.model_validate({
|
||||
'mode': mode, 'metres': str(height / 100), 'grade': 100, 'uploads': [upload],
|
||||
'quality_status': 'ok', 'quality_acknowledged': False,
|
||||
'production': {'version': 3, 'film_width_cm': width, 'height_cm': height,
|
||||
'sources': [{'upload_id': upload, 'kind': 'sheet', 'width_cm': width,
|
||||
'length_cm': length, 'copies': copies, 'measurement': 'file'}],
|
||||
'placements': placements}})
|
||||
|
||||
|
||||
class SheetGapTests(unittest.TestCase):
|
||||
def test_copies_8_mm_apart_pass(self):
|
||||
check_sheet_gaps([sheet()])
|
||||
check_sheet_gaps([sheet(copies=1, gap=0)])
|
||||
check_sheet_gaps([sheet(mode='uvfile')])
|
||||
|
||||
def test_copies_without_the_gap_are_refused_with_the_reason(self):
|
||||
for gap in (0, 0.03, 0.5):
|
||||
with self.assertRaises(ValueError) as caught:
|
||||
check_sheet_gaps([sheet(gap=gap)])
|
||||
self.assertEqual(str(caught.exception), SHEET_GAP_CHANGED)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -24,9 +24,11 @@ TOO_MANY = 'Este item tem mais de 200 arquivos. Divida em dois itens.'
|
||||
|
||||
|
||||
def item_with(uploads):
|
||||
"""One ready-sheet item: one source per upload, stacked in a row."""
|
||||
"""One ready-sheet item: one source per upload, stacked in a row, 8 mm
|
||||
apart (models.SHEET_GAP_CM)."""
|
||||
count = len(uploads)
|
||||
height = count * 0.3
|
||||
step = 0.25 + 0.8
|
||||
height = round(count * step - 0.8, 4)
|
||||
return {
|
||||
'mode': 'file', 'metres': round(height / 100, 4), 'grade': 100, 'uploads': uploads,
|
||||
'production': {
|
||||
@@ -35,7 +37,7 @@ def item_with(uploads):
|
||||
'copies': 1, 'rotation_degrees': 0, 'mirrored': False,
|
||||
'measurement': 'file'} for uid in uploads],
|
||||
'placements': [{'source_index': index, 'copy_index': 0, 'x_cm': 0,
|
||||
'y_cm': round(index * 0.3, 4), 'width_cm': 0.5, 'length_cm': 0.25,
|
||||
'y_cm': round(index * step, 4), 'width_cm': 0.5, 'length_cm': 0.25,
|
||||
'rotation_degrees': 0, 'mirrored': False} for index in range(count)]},
|
||||
'quality_status': 'ok', 'quality_acknowledged': False, 'residue_accepted': 0}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user