سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 22:00 UTC
test(stage3): export synthetic browser source contracts for independent real PostgreSQL audit
davoodmehraban89 committed
Oct 23, 2026 at 02:45 UTC
93d3196bc0d3f1abad5f61b361e9391beb316a60
1 file changed
+7
scripts/accounting-document-workflow.spec.js
+7
@@ -721,4 +721,11 @@ test('Stage3 new sale and purchase UI must persist complete SQL-v1 monetary cont
721
expect(purchase.items).toHaveLength(1);
722
expect(purchase.items[0]).toMatchObject({qty:2,price:100,lineTotal:200});
723
expect(remoteInvoices(server).filter(x=>x.number==='STAGE3-SALE-CONTRACT')).toHaveLength(1);
724
+ // Export ONLY isolated synthetic monetary fields, for independent PostgreSQL
725
+ // validation in the separate CI job (never real user IDs, JWTs or tokens).
726
+ const fields=['companyId','kind','paymentMethod','items','subtotal','discount','discountType',
727
+ 'discountInput','vat','vatMode','vatType','vatRate','grandTotal','accountingVersion','currencyCode'];
728
+ const monetary=src=>Object.fromEntries(fields.filter(k=>Object.hasOwn(src,k)).map(k=>[k,copy(src[k])]));
729
+ require('node:fs').writeFileSync('stage3-ui-fixtures.json',
730
+ JSON.stringify({sale:monetary(sale),purchase:monetary(purchase)},null,2));
731
});