package com.mvrent.carrental.model;

import jakarta.persistence.*;
import lombok.*;

import java.math.BigDecimal;

/**
 * Master configuration singleton (id = 1): currency, tax, default charges and
 * commission rules used across booking, billing and settlement calculations.
 */
@Entity
@Table(name = "system_config")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SystemConfig {

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

    @Builder.Default
    private String currencyCode = "INR";

    /** Default GST/tax percent applied to bookings, e.g. 18.00 */
    @Builder.Default
    private BigDecimal defaultTaxPercent = new BigDecimal("18.00");

    /** Default organization commission on vendor revenue, e.g. 15.00 */
    @Builder.Default
    private BigDecimal defaultCommissionPercent = new BigDecimal("15.00");

    /** Fallback driver day charge when a driver has none set. */
    @Builder.Default
    private BigDecimal defaultDriverDailyCharge = new BigDecimal("800.00");

    @Builder.Default
    private String invoicePrefix = "INV";

    @Enumerated(EnumType.STRING)
    @Builder.Default
    private SettlementCycle settlementCycle = SettlementCycle.MONTHLY;
}
