<?php
declare(strict_types=1);

namespace App\Model\Entity;

use Cake\ORM\Entity;

class Booking extends Entity
{
    protected array $_accessible = [
        'slot_id' => true,
        'teacher_id' => true,
        'customer_name' => true,
        'customer_email' => true,
        'customer_phone' => true,
        'amount_cents' => true,
        'status' => true,
        'stripe_session_id' => true,
        'stripe_payment_intent' => true,
        'notes' => true,
        'slot' => true,
        'teacher' => true,
        'created' => true,
        'modified' => true,
    ];

    public function getAmountDollars(): string
    {
        return number_format(((int)$this->amount_cents) / 100, 2);
    }
}
