|
|
@ -1,7 +1,6 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
use App\Entities\Partners\Customer; |
|
|
use App\Entities\Partners\Customer; |
|
|
use App\Entities\Partners\Vendor; |
|
|
|
|
|
use App\Entities\Payments\Payment; |
|
|
use App\Entities\Payments\Payment; |
|
|
use App\Entities\Projects\Project; |
|
|
use App\Entities\Projects\Project; |
|
|
use App\Entities\Users\User; |
|
|
use App\Entities\Users\User; |
|
|
@ -21,46 +20,8 @@ $factory->define(Payment::class, function (Faker $faker) { |
|
|
'owner_id' => function () { |
|
|
'owner_id' => function () { |
|
|
return factory(User::class)->create()->id; |
|
|
return factory(User::class)->create()->id; |
|
|
}, |
|
|
}, |
|
|
'partner_id' => function () { |
|
|
|
|
|
|
|
|
'customer_id' => function () { |
|
|
return factory(Customer::class)->create()->id; |
|
|
return factory(Customer::class)->create()->id; |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$factory->defineAs(Payment::class, 'income', function (Faker $faker) { |
|
|
|
|
|
return [ |
|
|
|
|
|
'project_id' => function () { |
|
|
|
|
|
return factory(Project::class)->create()->id; |
|
|
|
|
|
}, |
|
|
|
|
|
'amount' => 10000, |
|
|
|
|
|
'in_out' => 1, |
|
|
|
|
|
'type_id' => rand(1, 3), |
|
|
|
|
|
'date' => $faker->dateTimeBetween('-1 year', '-1 month')->format('Y-m-d'), |
|
|
|
|
|
'description' => $faker->paragraph, |
|
|
|
|
|
'owner_id' => function () { |
|
|
|
|
|
return factory(User::class)->create()->id; |
|
|
|
|
|
}, |
|
|
|
|
|
'partner_id' => function () { |
|
|
|
|
|
return factory(Customer::class)->create()->id; |
|
|
|
|
|
}, |
|
|
|
|
|
]; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$factory->defineAs(Payment::class, 'expanse', function (Faker $faker) { |
|
|
|
|
|
return [ |
|
|
|
|
|
'project_id' => function () { |
|
|
|
|
|
return factory(Project::class)->create()->id; |
|
|
|
|
|
}, |
|
|
|
|
|
'amount' => 10000, |
|
|
|
|
|
'in_out' => 2, |
|
|
|
|
|
'type_id' => rand(1, 3), |
|
|
|
|
|
'date' => $faker->dateTimeBetween('-1 year', '-1 month')->format('Y-m-d'), |
|
|
|
|
|
'description' => $faker->paragraph, |
|
|
|
|
|
'owner_id' => function () { |
|
|
|
|
|
return factory(User::class)->create()->id; |
|
|
|
|
|
}, |
|
|
|
|
|
'partner_id' => function () { |
|
|
|
|
|
return factory(Vendor::class)->create()->id; |
|
|
|
|
|
}, |
|
|
|
|
|
]; |
|
|
|
|
|
}); |
|
|
|