package com.pressing.domain.accounting;

import com.pressing.common.entity.SiteScopedEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDate;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "accounting_entries")
public class AccountingEntry extends SiteScopedEntity {

    @Column(nullable = false, unique = true, length = 40)
    private String entryNumber;

    @Column(nullable = false)
    private LocalDate entryDate;

    @Column(nullable = false, length = 80)
    private String journalCode;

    @Column(nullable = false, length = 40)
    private String accountCode;

    @Column(nullable = false, length = 200)
    private String label;

    @Column(nullable = false, precision = 12, scale = 2)
    private BigDecimal debit = BigDecimal.ZERO;

    @Column(nullable = false, precision = 12, scale = 2)
    private BigDecimal credit = BigDecimal.ZERO;

    @Column(nullable = false, length = 40)
    private String status = "DRAFT";

    @Column(length = 255)
    private String notes;
}
