import { z } from "zod"
import {
    SellRatesTaxInclusive,
    GiveDiscounts,
    PurchaseRatesTaxInclusive,
    ReceiveDiscounts,
} from "@garage/api"

export const salesConfigFormSchema = z.object({
    sell_rates_tax_inclusive: z.enum(SellRatesTaxInclusive).optional(),
    give_discounts: z.enum(GiveDiscounts).optional(),
})

export type SalesConfigFormValues = z.infer<typeof salesConfigFormSchema>

export const purchaseConfigFormSchema = z.object({
    purchase_rates_tax_inclusive: z.enum(PurchaseRatesTaxInclusive).optional(),
    receive_discounts: z.enum(ReceiveDiscounts).optional(),
})

export type PurchaseConfigFormValues = z.infer<typeof purchaseConfigFormSchema>

export const generalPreferencesFormSchema = z.object({
    sell_rates_tax_inclusive: z.enum(SellRatesTaxInclusive).optional(),
    give_discounts: z.enum(GiveDiscounts).optional(),
    purchase_rates_tax_inclusive: z.enum(PurchaseRatesTaxInclusive).optional(),
    receive_discounts: z.enum(ReceiveDiscounts).optional(),
})

export type GeneralPreferencesFormValues = z.infer<typeof generalPreferencesFormSchema>
