package com.smyhub.store.mengyastorebackendjava.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Entity
@Table(name = "product_codes")
@Getter
@Setter
@NoArgsConstructor
public class ProductCode {

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

    @Column(name = "product_id", length = 36, nullable = false)
    private String productId;

    @Column(columnDefinition = "text", nullable = false)
    private String code;

    public ProductCode(String productId, String code) {
        this.productId = productId;
        this.code = code;
    }
}
