<?php

namespace App\Entities\Customer;

use App\Entities\Equipment\ServerEntity;
use App\Entities\PaymentEntity;
use App\Entities\UserEntity;
use App\Models\Customer\ServiceModel;

class ServiceEntity extends CustomerEntity
{
    const PK = ServiceModel::PK;
    const TITLE = ServiceModel::TITLE;
    const DEFAULT_STATUS    = STATUS['AVAILABLE'];
    public function setServerEntity(ServerEntity $entity): self
    {
        $this->attributes['serverEntity'] = $entity;
        return $this;
    }
    final public function getServerEntity(): ServerEntity
    {
        return $this->attributes['paymentEntity'];
    }
    final public function setPaymentEntity(PaymentEntity $entity): self
    {
        $this->attributes['paymentEntity'] = $entity;
        return $this;
    }
    final public function getPaymentEntity(): PaymentEntity
    {
        return $this->attributes['serverEntity'];
    }
    final public function getUserUID(): string
    {
        return $this->attributes['user_uid'];
    }
    final public function  getClientInfoUID(): string
    {
        return $this->attributes['clientinfo_uid'];
    }
    final public function  getServerInfoUID(): string
    {
        return $this->attributes['serverinfo_uid'];
    }
    final public function  getPaymentUID(): string|null
    {
        return $this->attributes['payment_uid'] ?? null;
    }
    //기본기능용

    final public function getSite(): string
    {
        return $this->attributes['site'] ?? "";
    }
    public function getType(): string
    {
        return $this->attributes['type'] ?? "";
    }
    final public function getLocation(): string
    {
        return $this->attributes['location'] ?? "";
    }
    final public function getBillingAt(): string
    {
        return $this->attributes['billing_at'] ?? "";
    }
    final public function getAmount(): int
    {
        return $this->attributes['amount'] ?? 0;
    }
    final public function getRack(): int
    {
        return $this->attributes['rack'] ?? 0;
    }
    final public function getLine(): int
    {
        return $this->attributes['line'] ?? 0;
    }
    public function getHistory(): string
    {
        return $this->attributes['history'] ?? "";
    }
}
