feat(purchase): add checkout expiration settings and reservation status to purchase items
- Introduced a new configuration file for purchase settings, including checkout and payment expiration times. - Added a migration to include a `reservation_status` column in the `compra_items` table, defaulting to 'active' and updating existing records based on purchase status. - Created a migration to add an `expires_at` timestamp to the `compras` table, updating it for existing records based on their status. - Scoped unique indexes in the `carritos` table to only active carts, adding virtual columns for active user and guest tokens. - Implemented a console command to expire overdue purchases and release stock reservations, scheduled to run every minute. - Added tests for Google token exchange and login functionality, ensuring proper cart handling and user authentication. - Updated purchase-related tests to reflect changes in item handling and customer data validation.
This commit is contained in:
@@ -193,8 +193,12 @@ class TelepagosWebhookTest extends TestCase
|
||||
'sold_units' => 1,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseMissing('compra_items', [
|
||||
$this->assertDatabaseHas('compra_items', [
|
||||
'compra_id' => $newerPurchase->id,
|
||||
'source_catalog_item_id' => $variant->catalog_item_id,
|
||||
'source_variant_id' => $variant->id,
|
||||
'cantidad' => 2,
|
||||
'reservation_status' => 'active',
|
||||
]);
|
||||
|
||||
$this->assertSoftDeleted('carritos', [
|
||||
|
||||
Reference in New Issue
Block a user