فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

test(a02): keep fractional stock thresholds in atomic product import

davoodmehraban89 committed Oct 31, 2026 at 06:49 UTC 6db5cdaea5544cb780342588772d00e49ec71e92
1 file changed +2 -1
tests/a02-excel-atomic-merge.test.mjs
+2 -1
@@ -29,7 +29,7 @@ test('A02 Excel product import deduplicates against current company and in same
29 code: 'FOREIGN', name: 'Foreign' });
30 const result = await ExcelController.importProducts({ 'کالاها': [
31 { 'کد': 'OLD', 'نام': 'Do not overwrite' },
32 - { 'کد': 'NEW', 'نام': 'First', 'قیمت خرید': '۱٬۵۰۰' },
32 + { 'کد': 'NEW', 'نام': 'First', 'قیمت خرید': '۱٬۵۰۰', 'نقطه سفارش': '۲.۵' },
33 { 'کد': 'NEW', 'نام': 'Repeated' },
34 { 'کد': 'FOREIGN', 'نام': 'Same code but in another company' },
35 { 'کد': '', 'نام': '' }
@@ -39,6 +39,7 @@ test('A02 Excel product import deduplicates against current company and in same
39 assert.equal(list.length, 3);
40 assert.equal(list.find(p => p.id === 'old-c1').buyPrice, 5);
41 assert.equal(list.find(p => p.code === 'NEW').buyPrice, 1500);
42 + assert.equal(list.find(p => p.code === 'NEW').minStock, 2.5);
43 assert.equal(list.find(p => p.code === 'FOREIGN').companyId, 'excel-c1');
44 assert.equal((await StorageService.get('products', 'foreign-c2')).name, 'Foreign');
45 assert.ok(list.every(p => p.createdAt && p.updatedAt && p.ownerUserId !== undefined));