package com.example.equipment.model;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.time.LocalDate;

/**
 * 備品エンティティ
 */
@Entity
@Table(name = "equipment")
public class Equipment {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 備品コード（例: EQ-0001） */
    @Column(name = "code", nullable = false, unique = true)
    private String code;

    /** 備品名 */
    @Column(name = "name", nullable = false)
    private String name;

    /** カテゴリ（PC周辺機器 / 事務用品 / 家具 / AV機器 / その他） */
    @Column(name = "category", nullable = false)
    private String category;

    /** 在庫数 */
    @Column(name = "stock", nullable = false)
    private Integer stock;

    /** 保管場所 */
    @Column(name = "location")
    private String location;

    /** 購入日 */
    @Column(name = "purchase_date")
    private LocalDate purchaseDate;

    /** 備考（未設定の備品もある） */
    @Column(name = "note")
    private String note;

    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getCode() { return code; }
    public void setCode(String code) { this.code = code; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getCategory() { return category; }
    public void setCategory(String category) { this.category = category; }
    public Integer getStock() { return stock; }
    public void setStock(Integer stock) { this.stock = stock; }
    public String getLocation() { return location; }
    public void setLocation(String location) { this.location = location; }
    public LocalDate getPurchaseDate() { return purchaseDate; }
    public void setPurchaseDate(LocalDate purchaseDate) { this.purchaseDate = purchaseDate; }
    public String getNote() { return note; }
    public void setNote(String note) { this.note = note; }
}
