- Implemented TransactionIndex component for displaying transactions with pagination and filtering options. - Created TransactionCardRow component for rendering individual transaction details. - Added TransactionItemSubRow component for displaying detailed order items within a transaction. - Integrated delete confirmation dialog for transaction deletion. - Updated routes to include transaction management with appropriate permissions.
32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Customer;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class OrderFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
$subtotal = fake()->numberBetween(10000, 1000000);
|
|
$discount = fake()->numberBetween(0, $subtotal);
|
|
|
|
return [
|
|
'customer_id' => Customer::factory(),
|
|
'created_by_id' => User::factory(),
|
|
'order_number' => fake()->unique()->numerify('ORD-####'),
|
|
'channel' => fake()->randomElement(['store', 'shopee', 'tiktok']),
|
|
'price_type' => fake()->randomElement(['retail', 'wholesale']),
|
|
'status' => 'pending',
|
|
'payment_type' => fake()->randomElement(['cash', 'transfer', 'marketplace', 'qris']),
|
|
'is_affiliate' => false,
|
|
'subtotal' => $subtotal,
|
|
'discount' => $discount,
|
|
'total_amount' => $subtotal - $discount,
|
|
'notes' => fake()->sentence(),
|
|
];
|
|
}
|
|
}
|