<?php

namespace Database\Factories;

use App\Models\CompanySubscriptions; 

use Illuminate\Database\Eloquent\Factories\Factory;

use Carbon\Carbon; 

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Model>
 */
class CompanySubscriptionFactory extends Factory
{
    /**
     * The name of the factory's corresponding model 
     * 
     * @var string 
     */
    protected $model    =   CompanySubscriptions::class; 
    
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        ///! CompanySubscriptions::factory()->state(['company_id' => 1, 'subscription_rate_id' => 1])->create();

        return [
            'customer_id'        => $this->faker->bothify("cus_??????????????"),
            'invoice_no'         => $this->faker->bothify("####-######-####"),
            'mode_of_payment'    => $this->faker->randomElement(['yearly', 'monthly']),
            'duration'           => Carbon::now()->subDays(21)->addDays(365)->format('Y-m-d'),
            'date_subscribed'    => Carbon::now()->subDays(21)->format('Y-m-d'),
            'rate'               => 0,
            'current_month_paid' => Carbon::now()->subDays(21)->addDays(365)->format('Y-m-d'),
            'discount'           => 0,
            'previous_bill'      => 0,
            'current_bill'       => 0,
            'penalty_charge'     => 0,
            'amount_due'         => 0,
            'amount_paid'        => 0,
            'total_paid'         => 0,
            "is_monthly_expired" => "false",
        ];
    }
}
