<?php

namespace App\Entities\Part;

class PartType1Entity extends PartEntity
{
  public function __construct(array|null $data = null)
  {
    parent::__construct($data);
  }
  //기본기능    
  final public function getStock(): int
  {
    return (int) ($this->stock ?? 0);
  }
  final public function getUsed(): int
  {
    return (int) ($this->used ?? 0);
  }
  final public function getAvailable(): int
  {
    return $this->getStock() - $this->getUsed();
  }
}
