Add bulk CSV product import for POS (retail + restaurant)
Deploy Ladill POS / deploy (push) Successful in 1m39s
Deploy Ladill POS / deploy (push) Successful in 1m39s
Customers with large catalogs can upload a CSV instead of adding products one by one. Mode-aware: restaurant imports into the local catalog (chunked INSERT, categories resolved/created by name); retail batches to the CRM products/bulk endpoint. Streamed parsing + batched writes handle thousands of rows in one request. Includes a downloadable template, an Import button on both product pages, and a skipped-rows report. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
62e396195b
commit
9fcea24680
@@ -36,6 +36,17 @@ class CrmClient
|
||||
return $this->send('post', 'products', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk-create products (one CRM INSERT per call). Caller batches large
|
||||
* catalogs; the CRM caps each request at 500 rows.
|
||||
*
|
||||
* @param array<int, array<string, mixed>> $products
|
||||
*/
|
||||
public function bulkCreateProducts(array $products): array
|
||||
{
|
||||
return $this->send('post', 'products/bulk', ['products' => array_values($products)]);
|
||||
}
|
||||
|
||||
public function updateProduct(int|string $id, array $data): array
|
||||
{
|
||||
return $this->send('patch', "products/{$id}", $data);
|
||||
|
||||
Reference in New Issue
Block a user