mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-28 19:18:58 -04:00
refactor: extract PSR-12 renames and independent bugfixes from plugin system PR (#4784)
build/refactor/fix: tighten tooling, rename accessors to camelCase, and correct model bugs * build: tighten gitignore, lockfile, and script config - gitignore /build and /.php-cs-fixer.cache - allow core-js@3.50.0 postinstall script in package.json * refactor: rename snake_case data accessors to camelCase Rename get_info, get_multiple_info, get_sale_items, get_sale_payments, and save_customer across Customer, Employee, Item, Sale, and Supplier models to PSR-12 camelCase, updating every call site in controllers, libraries, and views. * test: update calls to match renamed camelCase accessors Update HomeTest, ItemsControllerTest, and ItemTest to call getInfo()/getMultipleInfo() instead of the old snake_case model methods. * fix: correct independent bugs in Item, Item_taxes, and Attribute models - Item::delete()/delete_list(): let $this->db->transStatus() alone decide success instead of accumulating a bitwise-AND over intermediate results, which could report failure (and trigger error toasts) even when the delete had actually completed - Item_taxes: correct $table property from 'item_taxes' to 'items_taxes' - Attribute::getDefinitionNames(): pass an array to QueryBuilder->whereNotIn(), which requires one Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b07f5e3ebb
commit
600417bfdf
36 files changed
+141
-142
No files matched your search
@@ -552,7 +552,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
$this->assertIsInt((int) $row->item_id);
|
||||
$this->assertGreaterThan(0, (int) $row->item_id);
|
||||
|
||||
$savedItem = $this->item->get_info((int) $row->item_id);
|
||||
$savedItem = $this->item->getInfo((int) $row->item_id);
|
||||
$this->assertEquals('CSV Imported Item', $savedItem->name);
|
||||
$this->assertEquals('Description from CSV', $savedItem->description);
|
||||
$this->assertEquals('Electronics', $savedItem->category);
|
||||
@@ -749,7 +749,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
|
||||
$this->assertTrue($this->item->save_value($updatedData, $updatedData['item_id']));
|
||||
|
||||
$updatedItem = $this->item->get_info($updatedData['item_id']);
|
||||
$updatedItem = $this->item->getInfo($updatedData['item_id']);
|
||||
$this->assertEquals('Updated Name', $updatedItem->name);
|
||||
$this->assertEquals('Updated Category', $updatedItem->category);
|
||||
$this->assertEquals(15.00, (float)$updatedItem->cost_price);
|
||||
@@ -939,7 +939,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
|
||||
$this->assertTrue($this->item->save_value($itemData));
|
||||
|
||||
$savedItem = $this->item->get_info($itemData['item_id']);
|
||||
$savedItem = $this->item->getInfo($itemData['item_id']);
|
||||
$this->assertEquals(-1, (int)$savedItem->reorder_level);
|
||||
}
|
||||
|
||||
@@ -978,7 +978,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
|
||||
$this->assertTrue($this->item->save_value($itemData));
|
||||
|
||||
$savedItem = $this->item->get_info($itemData['item_id']);
|
||||
$savedItem = $this->item->getInfo($itemData['item_id']);
|
||||
|
||||
$this->assertSame(
|
||||
$case['expected_cost_price'],
|
||||
@@ -1008,7 +1008,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
|
||||
$this->assertTrue($this->item->save_value($itemData));
|
||||
|
||||
$savedItem = $this->item->get_info($itemData['item_id']);
|
||||
$savedItem = $this->item->getInfo($itemData['item_id']);
|
||||
$this->assertEquals('8471', $savedItem->hsn_code);
|
||||
}
|
||||
|
||||
@@ -1101,7 +1101,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
$this->assertIsInt($itemData['item_id']);
|
||||
$this->assertGreaterThan(0, $itemData['item_id']);
|
||||
|
||||
$savedItem = $this->item->get_info($itemData['item_id']);
|
||||
$savedItem = $this->item->getInfo($itemData['item_id']);
|
||||
$this->assertEquals('Item Without Barcode', $savedItem->name);
|
||||
}
|
||||
|
||||
@@ -1195,7 +1195,7 @@ class ItemsControllerTest extends CIUnitTestCase
|
||||
];
|
||||
$this->inventory->insert($inventoryData);
|
||||
|
||||
$savedItem = $this->item->get_info($itemData['item_id']);
|
||||
$savedItem = $this->item->getInfo($itemData['item_id']);
|
||||
$this->assertEquals('Complete Test Item', $savedItem->name);
|
||||
$this->assertEquals('Electronics', $savedItem->category);
|
||||
$this->assertEquals(50.00, (float)$savedItem->cost_price);
|
||||
|
||||
Reference in new issue
Block a user