// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.27.0

package db

import (
	"github.com/jackc/pgx/v5/pgtype"
	"github.com/shopspring/decimal"
)

type Account struct {
	ID            int64              `json:"id"`
	Code          string             `json:"code"`
	Name          string             `json:"name"`
	Type          string             `json:"type"`
	ParentID      pgtype.Int8        `json:"parent_id"`
	NormalBalance string             `json:"normal_balance"`
	IsPostable    bool               `json:"is_postable"`
	IsPlaceholder bool               `json:"is_placeholder"`
	IsActive      bool               `json:"is_active"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type AccountingDepartment struct {
	ID        int64              `json:"id"`
	Code      string             `json:"code"`
	Name      string             `json:"name"`
	IsActive  bool               `json:"is_active"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type AccountingPeriod struct {
	ID            int64              `json:"id"`
	PeriodYear    int16              `json:"period_year"`
	PeriodMonth   int16              `json:"period_month"`
	Status        string             `json:"status"`
	LockedAt      pgtype.Timestamptz `json:"locked_at"`
	LockedBy      pgtype.Int8        `json:"locked_by"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	CloseSnapshot []byte             `json:"close_snapshot"`
	ReopenedAt    pgtype.Timestamptz `json:"reopened_at"`
	ReopenedBy    pgtype.Int8        `json:"reopened_by"`
	ReopenReason  pgtype.Text        `json:"reopen_reason"`
}

type AccountingPeriodLog struct {
	ID          int64              `json:"id"`
	PeriodYear  int16              `json:"period_year"`
	PeriodMonth int16              `json:"period_month"`
	Action      string             `json:"action"`
	ActorID     int64              `json:"actor_id"`
	Reason      pgtype.Text        `json:"reason"`
	Snapshot    []byte             `json:"snapshot"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
}

type ActivityLog struct {
	ID          int64              `json:"id"`
	UserID      pgtype.Int8        `json:"user_id"`
	Module      pgtype.Text        `json:"module"`
	Action      pgtype.Text        `json:"action"`
	Description pgtype.Text        `json:"description"`
	ModelType   pgtype.Text        `json:"model_type"`
	ModelID     pgtype.Int8        `json:"model_id"`
	OldValues   []byte             `json:"old_values"`
	NewValues   []byte             `json:"new_values"`
	IpAddress   pgtype.Text        `json:"ip_address"`
	UserAgent   pgtype.Text        `json:"user_agent"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type Advance struct {
	ID              int64              `json:"id"`
	AdvanceNumber   string             `json:"advance_number"`
	AdvanceType     string             `json:"advance_type"`
	CustomerID      pgtype.Int8        `json:"customer_id"`
	SupplierID      pgtype.Int8        `json:"supplier_id"`
	Amount          decimal.Decimal    `json:"amount"`
	AllocatedAmount decimal.Decimal    `json:"allocated_amount"`
	RefundedAmount  decimal.Decimal    `json:"refunded_amount"`
	Status          string             `json:"status"`
	AdvanceDate     pgtype.Date        `json:"advance_date"`
	Notes           pgtype.Text        `json:"notes"`
	JournalEntryID  pgtype.Int8        `json:"journal_entry_id"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type AdvanceTransaction struct {
	ID              int64              `json:"id"`
	AdvanceID       int64              `json:"advance_id"`
	TxnType         string             `json:"txn_type"`
	Amount          decimal.Decimal    `json:"amount"`
	Reference       pgtype.Text        `json:"reference"`
	InvoiceID       pgtype.Int8        `json:"invoice_id"`
	PurchaseOrderID pgtype.Int8        `json:"purchase_order_id"`
	JournalEntryID  pgtype.Int8        `json:"journal_entry_id"`
	Notes           pgtype.Text        `json:"notes"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type AppSetting struct {
	Key       string             `json:"key"`
	Value     []byte             `json:"value"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type Attendance struct {
	ID             int64               `json:"id"`
	EmployeeID     int64               `json:"employee_id"`
	AttendanceDate pgtype.Date         `json:"attendance_date"`
	ClockIn        pgtype.Timestamptz  `json:"clock_in"`
	ClockOut       pgtype.Timestamptz  `json:"clock_out"`
	ClockInLat     decimal.NullDecimal `json:"clock_in_lat"`
	ClockInLng     decimal.NullDecimal `json:"clock_in_lng"`
	ClockOutLat    decimal.NullDecimal `json:"clock_out_lat"`
	ClockOutLng    decimal.NullDecimal `json:"clock_out_lng"`
	Status         string              `json:"status"`
	WorkHours      decimal.NullDecimal `json:"work_hours"`
	OvertimeHours  decimal.NullDecimal `json:"overtime_hours"`
	Notes          pgtype.Text         `json:"notes"`
	PhotoClockIn   pgtype.Text         `json:"photo_clock_in"`
	PhotoClockOut  pgtype.Text         `json:"photo_clock_out"`
	CreatedAt      pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz  `json:"updated_at"`
}

type Brand struct {
	ID          int64              `json:"id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	IsActive    bool               `json:"is_active"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type BuyerAddress struct {
	ID                int64              `json:"id"`
	UserID            int64              `json:"user_id"`
	Label             string             `json:"label"`
	ContactName       string             `json:"contact_name"`
	Phone             string             `json:"phone"`
	Line1             string             `json:"line1"`
	Line2             pgtype.Text        `json:"line2"`
	City              string             `json:"city"`
	Province          pgtype.Text        `json:"province"`
	PostalCode        string             `json:"postal_code"`
	Country           string             `json:"country"`
	Latitude          pgtype.Float8      `json:"latitude"`
	Longitude         pgtype.Float8      `json:"longitude"`
	IsDefaultShipping bool               `json:"is_default_shipping"`
	IsDefaultBilling  bool               `json:"is_default_billing"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type Cache struct {
	Key        string `json:"key"`
	Value      string `json:"value"`
	Expiration int32  `json:"expiration"`
}

type CacheLock struct {
	Key        string `json:"key"`
	Owner      string `json:"owner"`
	Expiration int32  `json:"expiration"`
}

type Cart struct {
	ID        int64              `json:"id"`
	UserID    int64              `json:"user_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type CartItem struct {
	ID        int64              `json:"id"`
	CartID    int64              `json:"cart_id"`
	ProductID int64              `json:"product_id"`
	Quantity  decimal.Decimal    `json:"quantity"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type CashAccount struct {
	ID                int64              `json:"id"`
	Name              string             `json:"name"`
	AccountType       string             `json:"account_type"`
	BankName          pgtype.Text        `json:"bank_name"`
	BankAccountNumber pgtype.Text        `json:"bank_account_number"`
	IsActive          bool               `json:"is_active"`
	CreatedBy         pgtype.Int8        `json:"created_by"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type Cashflow struct {
	ID                    int64              `json:"id"`
	TransactionNumber     string             `json:"transaction_number"`
	Type                  string             `json:"type"`
	Category              string             `json:"category"`
	TransactionDate       pgtype.Date        `json:"transaction_date"`
	Amount                decimal.Decimal    `json:"amount"`
	Description           pgtype.Text        `json:"description"`
	ReferenceType         pgtype.Text        `json:"reference_type"`
	ReferenceID           pgtype.Int8        `json:"reference_id"`
	CreatedBy             pgtype.Int8        `json:"created_by"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
	ReversalOf            pgtype.Int8        `json:"reversal_of"`
	AccountID             pgtype.Int8        `json:"account_id"`
	CounterpartAccountID  pgtype.Int8        `json:"counterpart_account_id"`
	FlowType              pgtype.Text        `json:"flow_type"`
	PaymentMethod         pgtype.Text        `json:"payment_method"`
	AttachmentKey         pgtype.Text        `json:"attachment_key"`
	AttachmentFilename    pgtype.Text        `json:"attachment_filename"`
	AttachmentContentType pgtype.Text        `json:"attachment_content_type"`
	AttachmentSize        pgtype.Int8        `json:"attachment_size"`
	AttachmentUploadedBy  pgtype.Int8        `json:"attachment_uploaded_by"`
	AttachmentUploadedAt  pgtype.Timestamptz `json:"attachment_uploaded_at"`
	StoreID               pgtype.Int8        `json:"store_id"`
}

type CashierDrawerEntry struct {
	ID        int64              `json:"id"`
	ShiftID   int64              `json:"shift_id"`
	Type      string             `json:"type"`
	Amount    decimal.Decimal    `json:"amount"`
	Notes     pgtype.Text        `json:"notes"`
	CreatedBy pgtype.Int8        `json:"created_by"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type CashierShift struct {
	ID          int64               `json:"id"`
	ShiftNumber string              `json:"shift_number"`
	CashierID   int64               `json:"cashier_id"`
	Status      string              `json:"status"`
	OpenedAt    pgtype.Timestamptz  `json:"opened_at"`
	OpeningCash decimal.Decimal     `json:"opening_cash"`
	ClosedAt    pgtype.Timestamptz  `json:"closed_at"`
	ActualCash  decimal.NullDecimal `json:"actual_cash"`
	Variance    decimal.NullDecimal `json:"variance"`
	Notes       pgtype.Text         `json:"notes"`
	RegisterID  pgtype.Int8         `json:"register_id"`
	StoreID     pgtype.Int8         `json:"store_id"`
	CreatedAt   pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz  `json:"updated_at"`
}

type CashierShiftClosure struct {
	ID           int64              `json:"id"`
	ShiftID      int64              `json:"shift_id"`
	ExpectedCash decimal.Decimal    `json:"expected_cash"`
	ActualCash   decimal.Decimal    `json:"actual_cash"`
	Difference   decimal.Decimal    `json:"difference"`
	ActorID      int64              `json:"actor_id"`
	Reason       string             `json:"reason"`
	Override     bool               `json:"override"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
}

type Category struct {
	ID          int64              `json:"id"`
	Name        string             `json:"name"`
	Description pgtype.Text        `json:"description"`
	IsActive    bool               `json:"is_active"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type CheckoutReceipt struct {
	UserID         int64              `json:"user_id"`
	IdempotencyKey string             `json:"idempotency_key"`
	Fingerprint    string             `json:"fingerprint"`
	SalesOrderID   int64              `json:"sales_order_id"`
	Response       []byte             `json:"response"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type Customer struct {
	ID                int64               `json:"id"`
	Code              string              `json:"code"`
	Name              string              `json:"name"`
	ContactPerson     pgtype.Text         `json:"contact_person"`
	Phone             pgtype.Text         `json:"phone"`
	Email             pgtype.Text         `json:"email"`
	Address           pgtype.Text         `json:"address"`
	City              pgtype.Text         `json:"city"`
	Kecamatan         pgtype.Text         `json:"kecamatan"`
	Kelurahan         pgtype.Text         `json:"kelurahan"`
	Desa              pgtype.Text         `json:"desa"`
	TaxNumber         pgtype.Text         `json:"tax_number"`
	CreditLimit       decimal.Decimal     `json:"credit_limit"`
	PaymentTerms      int32               `json:"payment_terms"`
	CustomerType      string              `json:"customer_type"`
	AssignedSalesID   pgtype.Int8         `json:"assigned_sales_id"`
	IsActive          bool                `json:"is_active"`
	DeletedAt         pgtype.Timestamptz  `json:"deleted_at"`
	CreatedAt         pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz  `json:"updated_at"`
	UserID            pgtype.Int8         `json:"user_id"`
	Website           pgtype.Text         `json:"website"`
	BillingAddressID  pgtype.Int8         `json:"billing_address_id"`
	ShippingAddressID pgtype.Int8         `json:"shipping_address_id"`
	IsEcommerceAdmin  bool                `json:"is_ecommerce_admin"`
	Latitude          decimal.NullDecimal `json:"latitude"`
	Longitude         decimal.NullDecimal `json:"longitude"`
	DeliveryNote      pgtype.Text         `json:"delivery_note"`
}

type DeliveryOrder struct {
	ID                int64              `json:"id"`
	DoNumber          string             `json:"do_number"`
	SalesOrderID      int64              `json:"sales_order_id"`
	CustomerID        int64              `json:"customer_id"`
	WarehouseID       int64              `json:"warehouse_id"`
	DoDate            pgtype.Date        `json:"do_date"`
	Priority          string             `json:"priority"`
	Status            string             `json:"status"`
	RequestedQuantity decimal.Decimal    `json:"requested_quantity"`
	ShippedQuantity   decimal.Decimal    `json:"shipped_quantity"`
	DeliveredQuantity decimal.Decimal    `json:"delivered_quantity"`
	RemainingQuantity decimal.Decimal    `json:"remaining_quantity"`
	Notes             pgtype.Text        `json:"notes"`
	CreatedBy         pgtype.Int8        `json:"created_by"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	ProofPhotoUrl     pgtype.Text        `json:"proof_photo_url"`
	RecipientName     pgtype.Text        `json:"recipient_name"`
}

type DeliveryOrderItem struct {
	ID                int64           `json:"id"`
	DeliveryOrderID   int64           `json:"delivery_order_id"`
	ProductID         int64           `json:"product_id"`
	RequestedQuantity decimal.Decimal `json:"requested_quantity"`
	ShippedQuantity   decimal.Decimal `json:"shipped_quantity"`
	DeliveredQuantity decimal.Decimal `json:"delivered_quantity"`
	RemainingQuantity decimal.Decimal `json:"remaining_quantity"`
}

type DeliveryStatusHistory struct {
	ID              int64              `json:"id"`
	DeliveryOrderID int64              `json:"delivery_order_id"`
	FromStatus      string             `json:"from_status"`
	ToStatus        string             `json:"to_status"`
	Reason          string             `json:"reason"`
	ReferenceType   pgtype.Text        `json:"reference_type"`
	ReferenceID     pgtype.Int8        `json:"reference_id"`
	ChangedBy       pgtype.Int8        `json:"changed_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type Dispatch struct {
	ID              int64              `json:"id"`
	DeliveryOrderID int64              `json:"delivery_order_id"`
	ShipmentID      int64              `json:"shipment_id"`
	FleetID         int64              `json:"fleet_id"`
	Priority        string             `json:"priority"`
	QueueOrder      int32              `json:"queue_order"`
	DriverID        pgtype.Int8        `json:"driver_id"`
	ScheduledFor    pgtype.Timestamptz `json:"scheduled_for"`
	Status          string             `json:"status"`
	DispatchedAt    pgtype.Timestamptz `json:"dispatched_at"`
	DispatcherID    pgtype.Int8        `json:"dispatcher_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type DocumentNumberSequence struct {
	Prefix  string      `json:"prefix"`
	DocDate pgtype.Date `json:"doc_date"`
	Counter int64       `json:"counter"`
}

type EmailVerificationCode struct {
	Email     string             `json:"email"`
	Purpose   string             `json:"purpose"`
	CodeHash  string             `json:"code_hash"`
	Attempts  int32              `json:"attempts"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type Employee struct {
	ID                    int64              `json:"id"`
	EmployeeNumber        string             `json:"employee_number"`
	UserID                pgtype.Int8        `json:"user_id"`
	Name                  string             `json:"name"`
	Nik                   pgtype.Text        `json:"nik"`
	Department            string             `json:"department"`
	JobLevel              string             `json:"job_level"`
	Position              pgtype.Text        `json:"position"`
	EmploymentType        string             `json:"employment_type"`
	JoinDate              pgtype.Date        `json:"join_date"`
	EndDate               pgtype.Date        `json:"end_date"`
	BasicSalary           decimal.Decimal    `json:"basic_salary"`
	Phone                 pgtype.Text        `json:"phone"`
	Email                 pgtype.Text        `json:"email"`
	Address               pgtype.Text        `json:"address"`
	City                  pgtype.Text        `json:"city"`
	BankName              pgtype.Text        `json:"bank_name"`
	BankAccount           pgtype.Text        `json:"bank_account"`
	BankAccountName       pgtype.Text        `json:"bank_account_name"`
	Photo                 pgtype.Text        `json:"photo"`
	IsActive              bool               `json:"is_active"`
	LeaveBalance          decimal.Decimal    `json:"leave_balance"`
	LeaveUsed             decimal.Decimal    `json:"leave_used"`
	Allowance             decimal.Decimal    `json:"allowance"`
	Npwp                  pgtype.Text        `json:"npwp"`
	BpjsKetenagakerjaanNo pgtype.Text        `json:"bpjs_ketenagakerjaan_no"`
	BpjsKesehatanNo       pgtype.Text        `json:"bpjs_kesehatan_no"`
	DeletedAt             pgtype.Timestamptz `json:"deleted_at"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
}

type FailedJob struct {
	ID         int64              `json:"id"`
	Uuid       string             `json:"uuid"`
	Connection string             `json:"connection"`
	Queue      string             `json:"queue"`
	Payload    string             `json:"payload"`
	Exception  string             `json:"exception"`
	FailedAt   pgtype.Timestamptz `json:"failed_at"`
}

type Fleet struct {
	ID             int64               `json:"id"`
	PlateNumber    string              `json:"plate_number"`
	VehicleName    string              `json:"vehicle_name"`
	VehicleType    pgtype.Text         `json:"vehicle_type"`
	CapacityWeight decimal.NullDecimal `json:"capacity_weight"`
	CapacityVolume decimal.NullDecimal `json:"capacity_volume"`
	IsActive       bool                `json:"is_active"`
	CreatedAt      pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz  `json:"updated_at"`
}

type GalonTransaction struct {
	ID                int64              `json:"id"`
	TransactionNumber string             `json:"transaction_number"`
	CustomerID        int64              `json:"customer_id"`
	Type              string             `json:"type"`
	FulfillmentMode   string             `json:"fulfillment_mode"`
	ProductID         pgtype.Int8        `json:"product_id"`
	Quantity          decimal.Decimal    `json:"quantity"`
	UnitPrice         decimal.Decimal    `json:"unit_price"`
	DepositAmount     decimal.Decimal    `json:"deposit_amount"`
	LoanAmount        decimal.Decimal    `json:"loan_amount"`
	LoanReturned      bool               `json:"loan_returned"`
	Status            string             `json:"status"`
	GallonCode        pgtype.Text        `json:"gallon_code"`
	Notes             pgtype.Text        `json:"notes"`
	CreatedBy         pgtype.Int8        `json:"created_by"`
	StoreID           pgtype.Int8        `json:"store_id"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type GoodsReceipt struct {
	ID              int64              `json:"id"`
	GrNumber        string             `json:"gr_number"`
	PurchaseOrderID int64              `json:"purchase_order_id"`
	WarehouseID     int64              `json:"warehouse_id"`
	ReceivedBy      pgtype.Int8        `json:"received_by"`
	ReceivedDate    pgtype.Date        `json:"received_date"`
	Notes           pgtype.Text        `json:"notes"`
	Status          string             `json:"status"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type GoodsReceiptItem struct {
	ID                  int64           `json:"id"`
	GoodsReceiptID      int64           `json:"goods_receipt_id"`
	PurchaseOrderItemID pgtype.Int8     `json:"purchase_order_item_id"`
	ProductID           int64           `json:"product_id"`
	QuantityOrdered     decimal.Decimal `json:"quantity_ordered"`
	QuantityReceived    decimal.Decimal `json:"quantity_received"`
	QuantityRejected    decimal.Decimal `json:"quantity_rejected"`
	DefectNotes         pgtype.Text     `json:"defect_notes"`
	BatchNumber         pgtype.Text     `json:"batch_number"`
	ExpiredDate         pgtype.Date     `json:"expired_date"`
}

type Invoice struct {
	ID              int64              `json:"id"`
	InvoiceNumber   string             `json:"invoice_number"`
	SalesOrderID    pgtype.Int8        `json:"sales_order_id"`
	CustomerID      int64              `json:"customer_id"`
	InvoiceDate     pgtype.Date        `json:"invoice_date"`
	DueDate         pgtype.Date        `json:"due_date"`
	Status          string             `json:"status"`
	Subtotal        decimal.Decimal    `json:"subtotal"`
	TaxAmount       decimal.Decimal    `json:"tax_amount"`
	TotalAmount     decimal.Decimal    `json:"total_amount"`
	PaidAmount      decimal.Decimal    `json:"paid_amount"`
	RemainingAmount decimal.Decimal    `json:"remaining_amount"`
	Notes           pgtype.Text        `json:"notes"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type Job struct {
	ID          int64       `json:"id"`
	Queue       string      `json:"queue"`
	Payload     string      `json:"payload"`
	Attempts    int16       `json:"attempts"`
	ReservedAt  pgtype.Int4 `json:"reserved_at"`
	AvailableAt int32       `json:"available_at"`
	CreatedAt   int32       `json:"created_at"`
}

type JobBatch struct {
	ID           string      `json:"id"`
	Name         string      `json:"name"`
	TotalJobs    int32       `json:"total_jobs"`
	PendingJobs  int32       `json:"pending_jobs"`
	FailedJobs   int32       `json:"failed_jobs"`
	FailedJobIds string      `json:"failed_job_ids"`
	Options      pgtype.Text `json:"options"`
	CancelledAt  pgtype.Int4 `json:"cancelled_at"`
	CreatedAt    int32       `json:"created_at"`
	FinishedAt   pgtype.Int4 `json:"finished_at"`
}

type JournalEntry struct {
	ID              int64              `json:"id"`
	JournalNumber   string             `json:"journal_number"`
	JournalType     string             `json:"journal_type"`
	EntryDate       pgtype.Date        `json:"entry_date"`
	Reference       pgtype.Text        `json:"reference"`
	Description     pgtype.Text        `json:"description"`
	Status          string             `json:"status"`
	StoreID         pgtype.Int8        `json:"store_id"`
	TotalDebit      decimal.Decimal    `json:"total_debit"`
	TotalCredit     decimal.Decimal    `json:"total_credit"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	PostedBy        pgtype.Int8        `json:"posted_by"`
	PostedAt        pgtype.Timestamptz `json:"posted_at"`
	ReversedAt      pgtype.Timestamptz `json:"reversed_at"`
	ReversalOf      pgtype.Int8        `json:"reversal_of"`
	ReversalEntryID pgtype.Int8        `json:"reversal_entry_id"`
	SourceType      pgtype.Text        `json:"source_type"`
	SourceID        pgtype.Int8        `json:"source_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type JournalLine struct {
	ID             int64           `json:"id"`
	JournalEntryID int64           `json:"journal_entry_id"`
	AccountID      int64           `json:"account_id"`
	DepartmentID   pgtype.Int8     `json:"department_id"`
	Debit          decimal.Decimal `json:"debit"`
	Credit         decimal.Decimal `json:"credit"`
	Description    pgtype.Text     `json:"description"`
}

type Leafe struct {
	ID         int64              `json:"id"`
	EmployeeID int64              `json:"employee_id"`
	LeaveType  string             `json:"leave_type"`
	StartDate  pgtype.Date        `json:"start_date"`
	EndDate    pgtype.Date        `json:"end_date"`
	TotalDays  int32              `json:"total_days"`
	Reason     pgtype.Text        `json:"reason"`
	Status     string             `json:"status"`
	ApprovedBy pgtype.Int8        `json:"approved_by"`
	ApprovedAt pgtype.Timestamptz `json:"approved_at"`
	Notes      pgtype.Text        `json:"notes"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt  pgtype.Timestamptz `json:"updated_at"`
}

type LhppGroup struct {
	ID         int64              `json:"id"`
	LhppNumber string             `json:"lhpp_number"`
	DriverID   int64              `json:"driver_id"`
	LhppDate   pgtype.Date        `json:"lhpp_date"`
	Status     string             `json:"status"`
	AssignedTo pgtype.Int8        `json:"assigned_to"`
	AssignedAt pgtype.Timestamptz `json:"assigned_at"`
	VoidedAt   pgtype.Timestamptz `json:"voided_at"`
	VoidedBy   pgtype.Int8        `json:"voided_by"`
	CreatedBy  pgtype.Int8        `json:"created_by"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt  pgtype.Timestamptz `json:"updated_at"`
}

type LhppGroupHistory struct {
	ID              int64              `json:"id"`
	DeliveryOrderID pgtype.Int8        `json:"delivery_order_id"`
	Action          string             `json:"action"`
	FromGroupID     pgtype.Int8        `json:"from_group_id"`
	ToGroupID       pgtype.Int8        `json:"to_group_id"`
	FromDriverID    pgtype.Int8        `json:"from_driver_id"`
	ToDriverID      pgtype.Int8        `json:"to_driver_id"`
	Reason          string             `json:"reason"`
	ChangedBy       pgtype.Int8        `json:"changed_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type LhppGroupItem struct {
	ID              int64              `json:"id"`
	GroupID         int64              `json:"group_id"`
	DeliveryOrderID int64              `json:"delivery_order_id"`
	AddedBy         pgtype.Int8        `json:"added_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type Membership struct {
	ID           int64              `json:"id"`
	MemberNumber string             `json:"member_number"`
	CustomerID   int64              `json:"customer_id"`
	Tier         string             `json:"tier"`
	JoinedDate   pgtype.Date        `json:"joined_date"`
	IsActive     bool               `json:"is_active"`
	Points       int64              `json:"points"`
	Notes        pgtype.Text        `json:"notes"`
	CreatedBy    pgtype.Int8        `json:"created_by"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type MembershipTier struct {
	ID            int64              `json:"id"`
	Code          string             `json:"code"`
	Name          string             `json:"name"`
	DiscountType  string             `json:"discount_type"`
	DiscountValue decimal.Decimal    `json:"discount_value"`
	MinOrders     int32              `json:"min_orders"`
	MinSpend      decimal.Decimal    `json:"min_spend"`
	IsActive      bool               `json:"is_active"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type MembershipTierConfigHistory struct {
	ID                int64               `json:"id"`
	MembershipTierID  int64               `json:"membership_tier_id"`
	FromDiscountType  pgtype.Text         `json:"from_discount_type"`
	FromDiscountValue decimal.NullDecimal `json:"from_discount_value"`
	ToDiscountType    string              `json:"to_discount_type"`
	ToDiscountValue   decimal.Decimal     `json:"to_discount_value"`
	FromMinOrders     pgtype.Int4         `json:"from_min_orders"`
	ToMinOrders       pgtype.Int4         `json:"to_min_orders"`
	FromMinSpend      decimal.NullDecimal `json:"from_min_spend"`
	ToMinSpend        decimal.NullDecimal `json:"to_min_spend"`
	Reason            pgtype.Text         `json:"reason"`
	ChangedBy         pgtype.Int8         `json:"changed_by"`
	ChangedAt         pgtype.Timestamptz  `json:"changed_at"`
}

type MembershipTierHistory struct {
	ID           int64              `json:"id"`
	MembershipID int64              `json:"membership_id"`
	FromTier     pgtype.Text        `json:"from_tier"`
	ToTier       string             `json:"to_tier"`
	Reason       string             `json:"reason"`
	ChangedBy    pgtype.Int8        `json:"changed_by"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
}

type Migration struct {
	ID        int64  `json:"id"`
	Migration string `json:"migration"`
	Batch     int32  `json:"batch"`
}

type PasswordResetToken struct {
	Email     string             `json:"email"`
	Token     string             `json:"token"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type Payment struct {
	ID              int64              `json:"id"`
	PaymentNumber   string             `json:"payment_number"`
	PayableType     string             `json:"payable_type"`
	PayableID       int64              `json:"payable_id"`
	PaymentDate     pgtype.Date        `json:"payment_date"`
	Amount          decimal.Decimal    `json:"amount"`
	PaymentMethod   string             `json:"payment_method"`
	BankName        pgtype.Text        `json:"bank_name"`
	BankAccount     pgtype.Text        `json:"bank_account"`
	ReferenceNumber pgtype.Text        `json:"reference_number"`
	Notes           pgtype.Text        `json:"notes"`
	ProofUrl        pgtype.Text        `json:"proof_url"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	DepositID       pgtype.Int8        `json:"deposit_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type PaymentVoucher struct {
	ID            int64              `json:"id"`
	VoucherNumber string             `json:"voucher_number"`
	VoucherDate   pgtype.Date        `json:"voucher_date"`
	AccountID     int64              `json:"account_id"`
	Payee         string             `json:"payee"`
	PaymentMethod string             `json:"payment_method"`
	Reference     pgtype.Text        `json:"reference"`
	Description   pgtype.Text        `json:"description"`
	TotalAmount   decimal.Decimal    `json:"total_amount"`
	Status        string             `json:"status"`
	AttachmentKey pgtype.Text        `json:"attachment_key"`
	CreatedBy     pgtype.Int8        `json:"created_by"`
	ApprovedBy    pgtype.Int8        `json:"approved_by"`
	ApprovedAt    pgtype.Timestamptz `json:"approved_at"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type PaymentVoucherLine struct {
	ID          int64           `json:"id"`
	VoucherID   int64           `json:"voucher_id"`
	AccountID   int64           `json:"account_id"`
	Description pgtype.Text     `json:"description"`
	Amount      decimal.Decimal `json:"amount"`
	Reference   pgtype.Text     `json:"reference"`
}

type Payroll struct {
	ID                  int64              `json:"id"`
	PayrollNumber       string             `json:"payroll_number"`
	EmployeeID          int64              `json:"employee_id"`
	PeriodMonth         int16              `json:"period_month"`
	PeriodYear          int16              `json:"period_year"`
	BasicSalary         decimal.Decimal    `json:"basic_salary"`
	Allowances          decimal.Decimal    `json:"allowances"`
	OvertimePay         decimal.Decimal    `json:"overtime_pay"`
	Bonus               decimal.Decimal    `json:"bonus"`
	Deductions          decimal.Decimal    `json:"deductions"`
	BpjsKetenagakerjaan decimal.Decimal    `json:"bpjs_ketenagakerjaan"`
	BpjsKesehatan       decimal.Decimal    `json:"bpjs_kesehatan"`
	Pph21               decimal.Decimal    `json:"pph21"`
	NetSalary           decimal.Decimal    `json:"net_salary"`
	PaymentDate         pgtype.Date        `json:"payment_date"`
	Status              string             `json:"status"`
	Notes               pgtype.Text        `json:"notes"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
}

type Performance struct {
	ID               int64               `json:"id"`
	EmployeeID       int64               `json:"employee_id"`
	EvaluatorID      pgtype.Int8         `json:"evaluator_id"`
	PeriodMonth      int16               `json:"period_month"`
	PeriodYear       int16               `json:"period_year"`
	KpiScore         decimal.NullDecimal `json:"kpi_score"`
	AttitudeScore    decimal.NullDecimal `json:"attitude_score"`
	TeamworkScore    decimal.NullDecimal `json:"teamwork_score"`
	AchievementScore decimal.NullDecimal `json:"achievement_score"`
	TotalScore       decimal.NullDecimal `json:"total_score"`
	Grade            pgtype.Text         `json:"grade"`
	Achievements     pgtype.Text         `json:"achievements"`
	Improvements     pgtype.Text         `json:"improvements"`
	Notes            pgtype.Text         `json:"notes"`
	CreatedAt        pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz  `json:"updated_at"`
}

type PersonalAccessToken struct {
	ID            int64              `json:"id"`
	TokenableType string             `json:"tokenable_type"`
	TokenableID   int64              `json:"tokenable_id"`
	Name          string             `json:"name"`
	Token         string             `json:"token"`
	Abilities     pgtype.Text        `json:"abilities"`
	LastUsedAt    pgtype.Timestamptz `json:"last_used_at"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type Product struct {
	ID            int64              `json:"id"`
	Code          string             `json:"code"`
	Name          string             `json:"name"`
	Description   pgtype.Text        `json:"description"`
	CategoryID    pgtype.Int8        `json:"category_id"`
	UnitID        pgtype.Int8        `json:"unit_id"`
	PurchasePrice decimal.Decimal    `json:"purchase_price"`
	SellingPrice  decimal.Decimal    `json:"selling_price"`
	CurrentStock  int32              `json:"current_stock"`
	MinStock      decimal.Decimal    `json:"min_stock"`
	IsActive      bool               `json:"is_active"`
	IsFeatured    bool               `json:"is_featured"`
	Image         pgtype.Text        `json:"image"`
	DeletedAt     pgtype.Timestamptz `json:"deleted_at"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	BrandID       pgtype.Int8        `json:"brand_id"`
}

type ProductBarcode struct {
	ID            int64              `json:"id"`
	ProductID     int64              `json:"product_id"`
	ProductUnitID pgtype.Int8        `json:"product_unit_id"`
	Barcode       string             `json:"barcode"`
	IsPrimary     bool               `json:"is_primary"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type ProductUnit struct {
	ID               int64               `json:"id"`
	ProductID        int64               `json:"product_id"`
	UnitID           int64               `json:"unit_id"`
	ConversionFactor decimal.Decimal     `json:"conversion_factor"`
	SellingPrice     decimal.NullDecimal `json:"selling_price"`
	MinPurchase      decimal.Decimal     `json:"min_purchase"`
	IsBase           bool                `json:"is_base"`
	IsActive         bool                `json:"is_active"`
	CreatedAt        pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz  `json:"updated_at"`
}

type PurchaseOrder struct {
	ID              int64              `json:"id"`
	PoNumber        string             `json:"po_number"`
	SupplierID      int64              `json:"supplier_id"`
	WarehouseID     int64              `json:"warehouse_id"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	OrderDate       pgtype.Date        `json:"order_date"`
	ExpectedDate    pgtype.Date        `json:"expected_date"`
	DueDate         pgtype.Date        `json:"due_date"`
	Status          string             `json:"status"`
	ApprovedBy      pgtype.Int8        `json:"approved_by"`
	ApprovedAt      pgtype.Timestamptz `json:"approved_at"`
	PrintedAt       pgtype.Timestamptz `json:"printed_at"`
	PrintedBy       pgtype.Int8        `json:"printed_by"`
	PrintCount      int32              `json:"print_count"`
	Subtotal        decimal.Decimal    `json:"subtotal"`
	TaxAmount       decimal.Decimal    `json:"tax_amount"`
	DiscountAmount  decimal.Decimal    `json:"discount_amount"`
	TotalAmount     decimal.Decimal    `json:"total_amount"`
	PaidAmount      decimal.Decimal    `json:"paid_amount"`
	RemainingAmount decimal.Decimal    `json:"remaining_amount"`
	Notes           pgtype.Text        `json:"notes"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type PurchaseOrderItem struct {
	ID               int64           `json:"id"`
	PurchaseOrderID  int64           `json:"purchase_order_id"`
	ProductID        int64           `json:"product_id"`
	Quantity         decimal.Decimal `json:"quantity"`
	ReceivedQuantity decimal.Decimal `json:"received_quantity"`
	UnitPrice        decimal.Decimal `json:"unit_price"`
	Discount         decimal.Decimal `json:"discount"`
	Subtotal         decimal.Decimal `json:"subtotal"`
}

type PurchaseRequisition struct {
	ID                int64              `json:"id"`
	RequisitionNumber string             `json:"requisition_number"`
	StoreID           int64              `json:"store_id"`
	WarehouseID       pgtype.Int8        `json:"warehouse_id"`
	RequestedBy       int64              `json:"requested_by"`
	Status            string             `json:"status"`
	PoID              pgtype.Int8        `json:"po_id"`
	ReviewedBy        pgtype.Int8        `json:"reviewed_by"`
	ReviewedAt        pgtype.Timestamptz `json:"reviewed_at"`
	ReviewNote        pgtype.Text        `json:"review_note"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type PurchaseRequisitionItem struct {
	ID            int64           `json:"id"`
	RequisitionID int64           `json:"requisition_id"`
	ProductID     int64           `json:"product_id"`
	Quantity      decimal.Decimal `json:"quantity"`
	Note          pgtype.Text     `json:"note"`
}

type Role struct {
	ID        int64              `json:"id"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type RolePermission struct {
	Role       string             `json:"role"`
	Permission string             `json:"permission"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
}

type SalesActivity struct {
	ID            int64              `json:"id"`
	SalesID       pgtype.Int8        `json:"sales_id"`
	SalesVisitID  pgtype.Int8        `json:"sales_visit_id"`
	ActivityDate  pgtype.Date        `json:"activity_date"`
	ActivityType  string             `json:"activity_type"`
	Description   pgtype.Text        `json:"description"`
	Result        pgtype.Text        `json:"result"`
	FollowUpDate  pgtype.Date        `json:"follow_up_date"`
	FollowUpNotes pgtype.Text        `json:"follow_up_notes"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type SalesLocation struct {
	ID           int64               `json:"id"`
	SalesID      pgtype.Int8         `json:"sales_id"`
	Latitude     decimal.NullDecimal `json:"latitude"`
	Longitude    decimal.NullDecimal `json:"longitude"`
	Accuracy     decimal.NullDecimal `json:"accuracy"`
	Speed        decimal.NullDecimal `json:"speed"`
	Heading      decimal.NullDecimal `json:"heading"`
	RecordedAt   pgtype.Timestamptz  `json:"recorded_at"`
	BatteryLevel pgtype.Int2         `json:"battery_level"`
	CreatedAt    pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz  `json:"updated_at"`
}

type SalesOrder struct {
	ID               int64              `json:"id"`
	SoNumber         string             `json:"so_number"`
	CustomerID       int64              `json:"customer_id"`
	WarehouseID      pgtype.Int8        `json:"warehouse_id"`
	SalesID          pgtype.Int8        `json:"sales_id"`
	OrderDate        pgtype.Date        `json:"order_date"`
	DeliveryDate     pgtype.Date        `json:"delivery_date"`
	Status           string             `json:"status"`
	OrderType        string             `json:"order_type"`
	Subtotal         decimal.Decimal    `json:"subtotal"`
	TaxAmount        decimal.Decimal    `json:"tax_amount"`
	DiscountAmount   decimal.Decimal    `json:"discount_amount"`
	TotalAmount      decimal.Decimal    `json:"total_amount"`
	PaidAmount       decimal.Decimal    `json:"paid_amount"`
	RemainingAmount  decimal.Decimal    `json:"remaining_amount"`
	ShippingCost     decimal.Decimal    `json:"shipping_cost"`
	ShippingAddress  pgtype.Text        `json:"shipping_address"`
	Notes            pgtype.Text        `json:"notes"`
	ShiftID          pgtype.Int8        `json:"shift_id"`
	StoreID          pgtype.Int8        `json:"store_id"`
	SourceType       pgtype.Text        `json:"source_type"`
	PaymentTerms     int32              `json:"payment_terms"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	ReceivedProofUrl pgtype.Text        `json:"received_proof_url"`
}

type SalesOrderItem struct {
	ID                       int64           `json:"id"`
	SalesOrderID             int64           `json:"sales_order_id"`
	ProductID                int64           `json:"product_id"`
	Quantity                 decimal.Decimal `json:"quantity"`
	UnitPrice                decimal.Decimal `json:"unit_price"`
	DiscountPercent          decimal.Decimal `json:"discount_percent"`
	DiscountAmount           decimal.Decimal `json:"discount_amount"`
	Subtotal                 decimal.Decimal `json:"subtotal"`
	ProductUnitID            pgtype.Int8     `json:"product_unit_id"`
	UnitID                   pgtype.Int8     `json:"unit_id"`
	UnitName                 string          `json:"unit_name"`
	UnitSymbol               string          `json:"unit_symbol"`
	ConversionFactor         decimal.Decimal `json:"conversion_factor"`
	BaseQuantity             decimal.Decimal `json:"base_quantity"`
	MinPurchase              decimal.Decimal `json:"min_purchase"`
	MembershipTier           string          `json:"membership_tier"`
	MembershipDiscountAmount decimal.Decimal `json:"membership_discount_amount"`
}

type SalesOrderStatusHistory struct {
	ID            int64              `json:"id"`
	SalesOrderID  int64              `json:"sales_order_id"`
	FromStatus    string             `json:"from_status"`
	ToStatus      string             `json:"to_status"`
	Reason        string             `json:"reason"`
	ReferenceType pgtype.Text        `json:"reference_type"`
	ReferenceID   pgtype.Int8        `json:"reference_id"`
	ChangedBy     pgtype.Int8        `json:"changed_by"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
}

type SalesReturn struct {
	ID           int64              `json:"id"`
	ReturnNumber string             `json:"return_number"`
	SalesOrderID int64              `json:"sales_order_id"`
	CustomerID   int64              `json:"customer_id"`
	WarehouseID  pgtype.Int8        `json:"warehouse_id"`
	ReturnDate   pgtype.Date        `json:"return_date"`
	RefundAmount decimal.Decimal    `json:"refund_amount"`
	RefundMethod string             `json:"refund_method"`
	Status       string             `json:"status"`
	Reason       pgtype.Text        `json:"reason"`
	CreatedBy    pgtype.Int8        `json:"created_by"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type SalesReturnItem struct {
	ID               int64              `json:"id"`
	SalesReturnID    int64              `json:"sales_return_id"`
	SalesOrderItemID int64              `json:"sales_order_item_id"`
	ProductID        int64              `json:"product_id"`
	Quantity         decimal.Decimal    `json:"quantity"`
	UnitPrice        decimal.Decimal    `json:"unit_price"`
	RefundAmount     decimal.Decimal    `json:"refund_amount"`
	Reason           pgtype.Text        `json:"reason"`
	Condition        string             `json:"condition"`
	Restocked        bool               `json:"restocked"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
}

type SalesRoute struct {
	ID               int64              `json:"id"`
	SalesID          pgtype.Int8        `json:"sales_id"`
	RouteDate        pgtype.Date        `json:"route_date"`
	Name             pgtype.Text        `json:"name"`
	PlannedCustomers []byte             `json:"planned_customers"`
	Status           string             `json:"status"`
	Notes            pgtype.Text        `json:"notes"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type SalesVisit struct {
	ID            int64               `json:"id"`
	SalesID       pgtype.Int8         `json:"sales_id"`
	CustomerID    pgtype.Int8         `json:"customer_id"`
	VisitDate     pgtype.Date         `json:"visit_date"`
	CheckInTime   pgtype.Timestamptz  `json:"check_in_time"`
	CheckOutTime  pgtype.Timestamptz  `json:"check_out_time"`
	CheckInLat    decimal.NullDecimal `json:"check_in_lat"`
	CheckInLng    decimal.NullDecimal `json:"check_in_lng"`
	CheckOutLat   decimal.NullDecimal `json:"check_out_lat"`
	CheckOutLng   decimal.NullDecimal `json:"check_out_lng"`
	Purpose       pgtype.Text         `json:"purpose"`
	Result        pgtype.Text         `json:"result"`
	Notes         pgtype.Text         `json:"notes"`
	SalesOrderID  pgtype.Int8         `json:"sales_order_id"`
	Status        string              `json:"status"`
	PhotoCheckIn  pgtype.Text         `json:"photo_check_in"`
	PhotoCheckOut pgtype.Text         `json:"photo_check_out"`
	CreatedAt     pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz  `json:"updated_at"`
	VisitType     string              `json:"visit_type"`
	ScheduledBy   pgtype.Int8         `json:"scheduled_by"`
}

type SalesVoucher struct {
	ID            int64              `json:"id"`
	VoucherNumber string             `json:"voucher_number"`
	Type          string             `json:"type"`
	Description   pgtype.Text        `json:"description"`
	VoucherDate   pgtype.Date        `json:"voucher_date"`
	Amount        decimal.Decimal    `json:"amount"`
	Status        string             `json:"status"`
	CreatedBy     pgtype.Int8        `json:"created_by"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	ExpiredAt     pgtype.Date        `json:"expired_at"`
}

type Session struct {
	ID           string      `json:"id"`
	UserID       pgtype.Int8 `json:"user_id"`
	IpAddress    pgtype.Text `json:"ip_address"`
	UserAgent    pgtype.Text `json:"user_agent"`
	Payload      string      `json:"payload"`
	LastActivity int32       `json:"last_activity"`
}

type Shipment struct {
	ID              int64              `json:"id"`
	ShipmentNumber  string             `json:"shipment_number"`
	DeliveryOrderID int64              `json:"delivery_order_id"`
	Status          string             `json:"status"`
	ShipDate        pgtype.Date        `json:"ship_date"`
	Notes           pgtype.Text        `json:"notes"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	TrackingNumber  pgtype.Text        `json:"tracking_number"`
	Barcode         pgtype.Text        `json:"barcode"`
}

type ShipmentItem struct {
	ID                  int64           `json:"id"`
	ShipmentID          int64           `json:"shipment_id"`
	DeliveryOrderItemID int64           `json:"delivery_order_item_id"`
	ProductID           int64           `json:"product_id"`
	ShippedQuantity     decimal.Decimal `json:"shipped_quantity"`
	DeliveredQuantity   decimal.Decimal `json:"delivered_quantity"`
}

type ShipmentTrackingEvent struct {
	ID          int64               `json:"id"`
	ShipmentID  int64               `json:"shipment_id"`
	EventTime   pgtype.Timestamptz  `json:"event_time"`
	Status      string              `json:"status"`
	Source      string              `json:"source"`
	Latitude    decimal.NullDecimal `json:"latitude"`
	Longitude   decimal.NullDecimal `json:"longitude"`
	AccuracyM   decimal.NullDecimal `json:"accuracy_m"`
	Note        pgtype.Text         `json:"note"`
	ProviderRef pgtype.Text         `json:"provider_ref"`
	CreatedBy   pgtype.Int8         `json:"created_by"`
	CreatedAt   pgtype.Timestamptz  `json:"created_at"`
	SpeedMps    decimal.NullDecimal `json:"speed_mps"`
	HeadingDeg  decimal.NullDecimal `json:"heading_deg"`
}

type Stock struct {
	ID               int64              `json:"id"`
	ProductID        int64              `json:"product_id"`
	WarehouseID      int64              `json:"warehouse_id"`
	Quantity         decimal.Decimal    `json:"quantity"`
	ReservedQuantity decimal.Decimal    `json:"reserved_quantity"`
	LastUpdatedAt    pgtype.Timestamptz `json:"last_updated_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type StockMovement struct {
	ID             int64              `json:"id"`
	MovementNumber string             `json:"movement_number"`
	ProductID      int64              `json:"product_id"`
	WarehouseID    int64              `json:"warehouse_id"`
	MovementType   string             `json:"movement_type"`
	Quantity       decimal.Decimal    `json:"quantity"`
	QuantityBefore decimal.Decimal    `json:"quantity_before"`
	QuantityAfter  decimal.Decimal    `json:"quantity_after"`
	ReferenceType  pgtype.Text        `json:"reference_type"`
	ReferenceID    pgtype.Int8        `json:"reference_id"`
	Notes          pgtype.Text        `json:"notes"`
	CreatedBy      pgtype.Int8        `json:"created_by"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
}

type StockOperationReceipt struct {
	UserID         int64              `json:"user_id"`
	Operation      string             `json:"operation"`
	IdempotencyKey string             `json:"idempotency_key"`
	Fingerprint    string             `json:"fingerprint"`
	Response       []byte             `json:"response"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type StockOpname struct {
	ID           int64              `json:"id"`
	OpnameNumber string             `json:"opname_number"`
	WarehouseID  int64              `json:"warehouse_id"`
	OpnameDate   pgtype.Date        `json:"opname_date"`
	Status       string             `json:"status"`
	Notes        pgtype.Text        `json:"notes"`
	CreatedBy    pgtype.Int8        `json:"created_by"`
	ApprovedBy   pgtype.Int8        `json:"approved_by"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type StockOpnameItem struct {
	ID               int64               `json:"id"`
	StockOpnameID    int64               `json:"stock_opname_id"`
	ProductID        int64               `json:"product_id"`
	SystemQuantity   decimal.Decimal     `json:"system_quantity"`
	PhysicalQuantity decimal.NullDecimal `json:"physical_quantity"`
	Difference       decimal.NullDecimal `json:"difference"`
	Notes            pgtype.Text         `json:"notes"`
}

type StockTransfer struct {
	ID               int64              `json:"id"`
	TransferNumber   string             `json:"transfer_number"`
	FromWarehouseID  int64              `json:"from_warehouse_id"`
	ToWarehouseID    int64              `json:"to_warehouse_id"`
	TransferDate     pgtype.Date        `json:"transfer_date"`
	Status           string             `json:"status"`
	Notes            pgtype.Text        `json:"notes"`
	CreatedBy        pgtype.Int8        `json:"created_by"`
	ApprovedBy       pgtype.Int8        `json:"approved_by"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	VoucherNumber    pgtype.Text        `json:"voucher_number"`
	DispatchedAt     pgtype.Timestamptz `json:"dispatched_at"`
	VoucherSnapshot  []byte             `json:"voucher_snapshot"`
	LifecycleVersion int16              `json:"lifecycle_version"`
}

type StockTransferEvent struct {
	ID              int64              `json:"id"`
	StockTransferID int64              `json:"stock_transfer_id"`
	RequestKey      string             `json:"request_key"`
	Action          string             `json:"action"`
	ActorID         int64              `json:"actor_id"`
	OccurredAt      pgtype.Timestamptz `json:"occurred_at"`
	Reason          string             `json:"reason"`
	Payload         []byte             `json:"payload"`
}

type StockTransferItem struct {
	ID                int64           `json:"id"`
	StockTransferID   int64           `json:"stock_transfer_id"`
	ProductID         int64           `json:"product_id"`
	QuantityRequested decimal.Decimal `json:"quantity_requested"`
	QuantitySent      decimal.Decimal `json:"quantity_sent"`
	QuantityReceived  decimal.Decimal `json:"quantity_received"`
	QuantityTransit   decimal.Decimal `json:"quantity_transit"`
	QuantityDamaged   decimal.Decimal `json:"quantity_damaged"`
	QuantityLost      decimal.Decimal `json:"quantity_lost"`
}

type Store struct {
	ID                  int64               `json:"id"`
	Code                string              `json:"code"`
	Name                string              `json:"name"`
	Address             pgtype.Text         `json:"address"`
	Phone               pgtype.Text         `json:"phone"`
	IsActive            bool                `json:"is_active"`
	CreatedAt           pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz  `json:"updated_at"`
	Latitude            decimal.NullDecimal `json:"latitude"`
	Longitude           decimal.NullDecimal `json:"longitude"`
	CoordinatePrecision pgtype.Text         `json:"coordinate_precision"`
	LocationNote        pgtype.Text         `json:"location_note"`
	WarehouseID         int64               `json:"warehouse_id"`
}

type StoreUser struct {
	StoreID   int64              `json:"store_id"`
	UserID    int64              `json:"user_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type Supplier struct {
	ID            int64              `json:"id"`
	Code          string             `json:"code"`
	Name          string             `json:"name"`
	ContactPerson pgtype.Text        `json:"contact_person"`
	Phone         pgtype.Text        `json:"phone"`
	Email         pgtype.Text        `json:"email"`
	Address       pgtype.Text        `json:"address"`
	City          pgtype.Text        `json:"city"`
	TaxNumber     pgtype.Text        `json:"tax_number"`
	BankName      pgtype.Text        `json:"bank_name"`
	BankAccount   pgtype.Text        `json:"bank_account"`
	CreditLimit   decimal.Decimal    `json:"credit_limit"`
	PaymentTerms  int32              `json:"payment_terms"`
	IsActive      bool               `json:"is_active"`
	DeletedAt     pgtype.Timestamptz `json:"deleted_at"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type Unit struct {
	ID          int64              `json:"id"`
	Name        string             `json:"name"`
	Symbol      pgtype.Text        `json:"symbol"`
	Description pgtype.Text        `json:"description"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type User struct {
	ID                int64              `json:"id"`
	Name              string             `json:"name"`
	Email             string             `json:"email"`
	EmailVerifiedAt   pgtype.Timestamptz `json:"email_verified_at"`
	Password          string             `json:"password"`
	RememberToken     pgtype.Text        `json:"remember_token"`
	Role              string             `json:"role"`
	ApplicationAccess string             `json:"application_access"`
	Permissions       []byte             `json:"permissions"`
	IsActive          bool               `json:"is_active"`
	LastLoginAt       pgtype.Timestamptz `json:"last_login_at"`
	Avatar            pgtype.Text        `json:"avatar"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type Voucher struct {
	ID              int64              `json:"id"`
	VoucherNumber   string             `json:"voucher_number"`
	Type            string             `json:"type"`
	Description     pgtype.Text        `json:"description"`
	VoucherDate     pgtype.Date        `json:"voucher_date"`
	Amount          decimal.Decimal    `json:"amount"`
	Status          string             `json:"status"`
	CreatedBy       pgtype.Int8        `json:"created_by"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	SupplierID      pgtype.Int8        `json:"supplier_id"`
	PoID            pgtype.Int8        `json:"po_id"`
	CashAccountCode pgtype.Text        `json:"cash_account_code"`
	PrintedAt       pgtype.Timestamptz `json:"printed_at"`
	PrintedBy       pgtype.Int8        `json:"printed_by"`
}

type Warehouse struct {
	ID                  int64               `json:"id"`
	Code                string              `json:"code"`
	Name                string              `json:"name"`
	Address             pgtype.Text         `json:"address"`
	City                pgtype.Text         `json:"city"`
	Phone               pgtype.Text         `json:"phone"`
	ManagerID           pgtype.Int8         `json:"manager_id"`
	IsActive            bool                `json:"is_active"`
	CreatedAt           pgtype.Timestamptz  `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz  `json:"updated_at"`
	Latitude            decimal.NullDecimal `json:"latitude"`
	Longitude           decimal.NullDecimal `json:"longitude"`
	CoordinatePrecision pgtype.Text         `json:"coordinate_precision"`
}
