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

package db

import (
	"context"

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

type Querier interface {
	// Per-COA-account movement totals (all-time) for the cashflow page's
	// "Saldo & Aset" cards. Journal lines count when posted/reversed; cashflow
	// lines count against their account_id. Cash accounts (1xxx) read from
	// journal lines only since cashflows carry account ids of the COA.
	AccountBalancesByCode(ctx context.Context, codes []string) ([]AccountBalancesByCodeRow, error)
	// Cash/bank balances are derived from authoritative transactions only.
	// Generated rows (invoice payments etc.) carry no account yet and are
	// reported under the system-wide bucket; manual entries always carry one.
	AccountMovementTotals(ctx context.Context, arg AccountMovementTotalsParams) (AccountMovementTotalsRow, error)
	// ---------- advances ----------
	AcctCountAdvances(ctx context.Context, arg AcctCountAdvancesParams) (int64, error)
	// ---------- journal entries ----------
	AcctCountJournals(ctx context.Context, arg AcctCountJournalsParams) (int64, error)
	AcctCreateAccount(ctx context.Context, arg AcctCreateAccountParams) (Account, error)
	AcctCreateAdvance(ctx context.Context, arg AcctCreateAdvanceParams) (Advance, error)
	AcctCreateAdvanceTxn(ctx context.Context, arg AcctCreateAdvanceTxnParams) (AdvanceTransaction, error)
	AcctCreateDepartment(ctx context.Context, arg AcctCreateDepartmentParams) (AccountingDepartment, error)
	AcctCreateJournal(ctx context.Context, arg AcctCreateJournalParams) (JournalEntry, error)
	AcctCreateJournalLine(ctx context.Context, arg AcctCreateJournalLineParams) (int64, error)
	AcctDeleteJournal(ctx context.Context, id int64) (int64, error)
	AcctDeleteJournalLines(ctx context.Context, journalEntryID int64) error
	AcctGetAccount(ctx context.Context, id int64) (Account, error)
	AcctGetAccountByCode(ctx context.Context, code string) (Account, error)
	AcctGetAdvance(ctx context.Context, id int64) (AcctGetAdvanceRow, error)
	AcctGetAdvanceForUpdate(ctx context.Context, id int64) (Advance, error)
	AcctGetDepartment(ctx context.Context, id int64) (AccountingDepartment, error)
	AcctGetDepartmentByCode(ctx context.Context, code string) (AccountingDepartment, error)
	AcctGetJournal(ctx context.Context, id int64) (JournalEntry, error)
	AcctGetJournalForUpdate(ctx context.Context, id int64) (JournalEntry, error)
	// Drill-down: find the auto-drafted journal for one upstream document
	// (GR accrual, advances). Latest wins; drafts and posted both match.
	AcctJournalBySource(ctx context.Context, arg AcctJournalBySourceParams) (JournalEntry, error)
	// ---------- general ledger ----------
	// All journal entries (draft, posted, reversed) flow into the ledger with their respective status.
	AcctLedgerLines(ctx context.Context, arg AcctLedgerLinesParams) ([]AcctLedgerLinesRow, error)
	// Opening balance per account: signed movement (per normal balance) of all
	// ledger entries strictly before date_from. Same non-date filters apply.
	AcctLedgerOpening(ctx context.Context, arg AcctLedgerOpeningParams) ([]AcctLedgerOpeningRow, error)
	// Accounting module queries: COA (accounts), departments, journals,
	// general ledger, advances, trial balance. All query names carry the Acct
	// prefix to stay unique across db/query.
	// ---------- chart of accounts ----------
	AcctListAccounts(ctx context.Context, arg AcctListAccountsParams) ([]Account, error)
	AcctListAdvanceTxns(ctx context.Context, advanceID int64) ([]AdvanceTransaction, error)
	AcctListAdvances(ctx context.Context, arg AcctListAdvancesParams) ([]AcctListAdvancesRow, error)
	// ---------- departments ----------
	AcctListDepartments(ctx context.Context, arg AcctListDepartmentsParams) ([]AccountingDepartment, error)
	AcctListJournalLines(ctx context.Context, journalEntryID int64) ([]AcctListJournalLinesRow, error)
	AcctListJournalLinesByEntries(ctx context.Context, dollar_1 []int64) ([]AcctListJournalLinesByEntriesRow, error)
	AcctListJournals(ctx context.Context, arg AcctListJournalsParams) ([]JournalEntry, error)
	AcctSetAdvanceAmounts(ctx context.Context, arg AcctSetAdvanceAmountsParams) (int64, error)
	AcctSetJournalPosted(ctx context.Context, arg AcctSetJournalPostedParams) (int64, error)
	AcctSetJournalReversed(ctx context.Context, arg AcctSetJournalReversedParams) (int64, error)
	AcctSetJournalVoided(ctx context.Context, id int64) (int64, error)
	// ---------- trial balance ----------
	AcctTrialBalance(ctx context.Context, arg AcctTrialBalanceParams) ([]AcctTrialBalanceRow, error)
	AcctUpdateAccount(ctx context.Context, arg AcctUpdateAccountParams) (Account, error)
	AcctUpdateDepartment(ctx context.Context, arg AcctUpdateDepartmentParams) (AccountingDepartment, error)
	AcctUpdateJournal(ctx context.Context, arg AcctUpdateJournalParams) (int64, error)
	ActiveShipmentLocations(ctx context.Context) ([]ActiveShipmentLocationsRow, error)
	AddOrUpdateCartItem(ctx context.Context, arg AddOrUpdateCartItemParams) (CartItem, error)
	AddReceivedQuantity(ctx context.Context, arg AddReceivedQuantityParams) (int64, error)
	AddStoreUser(ctx context.Context, arg AddStoreUserParams) error
	AdjustStock(ctx context.Context, arg AdjustStockParams) error
	// Records the approver identity alongside the status flip so the printable
	// document can show a formal approval block (client feedback 2026-08-26).
	ApprovePurchaseOrder(ctx context.Context, arg ApprovePurchaseOrderParams) (int64, error)
	// Cash truth (ruling A): system-recorded money only — customer receipts
	// (payments) minus supplier payments (purchase_orders.paid_amount). Manual
	// Arus Kas entries are deliberately NOT summed here: every payment the
	// system records would otherwise be counted twice (once as the payment
	// row, once as the manual entry PayInvoice instructs). Manual cash
	// operations live on in the cashflow-statement report; they belong in
	// Neraca Kas only when booked through a module (PO, payroll), not as
	// manual entries.
	BalanceSheetSnapshot(ctx context.Context) (BalanceSheetSnapshotRow, error)
	BumpEmailVerificationAttempts(ctx context.Context, arg BumpEmailVerificationAttemptsParams) error
	// Opening cash: every cash-account line dated strictly before the period start.
	// Debits raise cash, credits lower it, so the balance is the signed sum.
	CashAccountBalanceBefore(ctx context.Context, arg CashAccountBalanceBeforeParams) (decimal.Decimal, error)
	// Cash accounts for the statement, discovered from the chart rather than
	// hardcoded, so a newly added bank account joins the statement without a code
	// change. 1000.x is the cash-and-equivalents range in this chart.
	CashAccountCodes(ctx context.Context) ([]string, error)
	CashflowAlreadyReversed(ctx context.Context, reversalOf pgtype.Int8) (bool, error)
	//
	// SCOPED (migration 000104), and the store_ids predicate is repeated on EACH
	// arm of the UNION ALL rather than once around it. A predicate outside the union
	// would have to name the alias in three different arms and, more importantly,
	// would be three separate filters that a future edit could drop from one of them.
	//
	// The third arm is the cashflows one and it is the leak this whole change is
	// about: cashier holds finance.cashflows.export (000080:17-28), so before this
	// the CSV was a company-wide cashflow dump. A CSV is also the easiest thing to
	// exfiltrate out of the five read paths, because it leaves as a file.
	//
	// The first two arms read payments and purchase_orders, which have no
	// store_id, so they are NOT filtered here. That is a real and stated gap, not
	// an oversight — see the "WHAT THIS DOES NOT CLOSE" note in the service. A
	// restricted caller's export of this kind still shows the sales and purchase
	// legs, and narrowing that needs a store column on payments/purchase_orders,
	// which is a separate migration.
	CashflowCSVRows(ctx context.Context, arg CashflowCSVRowsParams) ([]CashflowCSVRowsRow, error)
	// Cash-flow STATEMENT movements, derived from journal_lines.
	//
	// This exists because /reports/cashflow returns a flat row ARRAY (it is the
	// generic RowCashflow export: payments + purchase orders + manual entries). The
	// ERP's statement view needs operating/investing/financing sections, and reading
	// them off an array was impossible: the page's array branch filled the three
	// sections from d.operating/d.investing/d.financing, which are undefined on an
	// array, so all three rendered as empty while net_cash_flow was still summed
	// from the rows. The statement therefore showed A = B = C = Rp 0 next to a total
	// of Rp 30.108.506 and the components never added up to their own total.
	//
	// Cash accounts are an EXPLICIT list, not code LIKE '1%'. In this chart 110302
	// (Piutang Dagang), 110401 (Persediaan), 120101 (Aset Tetap) and 120102
	// (Akumulasi Penyusutan) all start with 1 and are emphatically not cash; a
	// prefix match would have swept receivables and inventory into the statement and
	// produced a number that looked computed and meant nothing.
	//
	// counterpart_code is the OTHER side of the same journal entry, and it is what
	// classifies the movement. Without it the sign of a line is all you have, which
	// cannot tell a customer receipt (operating) from a bank loan (financing).
	//
	// credit_sign is the effect on cash: +1 when cash was debited (money in),
	// -1 when cash was credited (money out), 0 for the cash side of a transfer.
	CashflowStatementMovements(ctx context.Context, arg CashflowStatementMovementsParams) ([]CashflowStatementMovementsRow, error)
	CashflowYearBreakdown(ctx context.Context, arg CashflowYearBreakdownParams) ([]CashflowYearBreakdownRow, error)
	ClearActivityLogs(ctx context.Context) error
	ClearCartItems(ctx context.Context, cartID int64) error
	ClearDefaultBilling(ctx context.Context, userID int64) error
	ClearDefaultShipping(ctx context.Context, userID int64) error
	ClearProductBaseUnit(ctx context.Context, arg ClearProductBaseUnitParams) error
	ClearProductPrimaryBarcode(ctx context.Context, arg ClearProductPrimaryBarcodeParams) error
	CloseCashierShift(ctx context.Context, arg CloseCashierShiftParams) (int64, error)
	CountActiveAdmins(ctx context.Context) (int64, error)
	CountActivityLogs(ctx context.Context, arg CountActivityLogsParams) (int64, error)
	CountAttendance(ctx context.Context, arg CountAttendanceParams) (int64, error)
	CountBrandsByName(ctx context.Context, arg CountBrandsByNameParams) (int64, error)
	CountBuyerAddresses(ctx context.Context, userID int64) (int64, error)
	// Carries the same predicate as ListCashflows. A count without it would report
	// the COMPANY's row count to a scoped caller, which tells a till operator the
	// size of a business they are not supposed to know about.
	CountCashflows(ctx context.Context, arg CountCashflowsParams) (int64, error)
	CountCashierShifts(ctx context.Context, arg CountCashierShiftsParams) (int64, error)
	CountCategories(ctx context.Context, arg CountCategoriesParams) (int64, error)
	CountCategoriesByName(ctx context.Context, arg CountCategoriesByNameParams) (int64, error)
	CountCustomers(ctx context.Context, arg CountCustomersParams) (int64, error)
	CountCustomersActive(ctx context.Context, id int64) (int64, error)
	CountCustomersActiveForVisit(ctx context.Context, id int64) (int64, error)
	CountCustomersForMembership(ctx context.Context, id int64) (int64, error)
	CountDebts(ctx context.Context, arg CountDebtsParams) (int64, error)
	CountDeliveryOrders(ctx context.Context, arg CountDeliveryOrdersParams) (int64, error)
	CountEmployees(ctx context.Context, arg CountEmployeesParams) (int64, error)
	CountFleet(ctx context.Context, isActive pgtype.Bool) (int64, error)
	CountGalonTransactions(ctx context.Context, arg CountGalonTransactionsParams) (int64, error)
	CountGoodsReceipts(ctx context.Context, status pgtype.Text) (int64, error)
	CountInvoices(ctx context.Context, arg CountInvoicesParams) (int64, error)
	CountLeaves(ctx context.Context, arg CountLeavesParams) (int64, error)
	CountLowStockLines(ctx context.Context, search pgtype.Text) (int64, error)
	CountLowStockLinesByWarehouse(ctx context.Context, arg CountLowStockLinesByWarehouseParams) (int64, error)
	CountLowStockProducts(ctx context.Context) (int64, error)
	CountMemberships(ctx context.Context, arg CountMembershipsParams) (int64, error)
	CountMovements(ctx context.Context, arg CountMovementsParams) (int64, error)
	CountOpnames(ctx context.Context, arg CountOpnamesParams) (int64, error)
	CountOrdersByShift(ctx context.Context, shiftID pgtype.Int8) (int64, error)
	CountPaymentVouchers(ctx context.Context, status pgtype.Text) (int64, error)
	CountPayments(ctx context.Context, arg CountPaymentsParams) (int64, error)
	CountPayrolls(ctx context.Context, arg CountPayrollsParams) (int64, error)
	CountPerformances(ctx context.Context) (int64, error)
	CountProducts(ctx context.Context, arg CountProductsParams) (int64, error)
	CountProductsActive(ctx context.Context, id int64) (int64, error)
	CountProductsByBrand(ctx context.Context, brandID pgtype.Int8) (int64, error)
	CountProductsByCategory(ctx context.Context, categoryID pgtype.Int8) (int64, error)
	CountProductsByID(ctx context.Context, id int64) (int64, error)
	CountPurchaseOrders(ctx context.Context, arg CountPurchaseOrdersParams) (int64, error)
	CountPurchaseRequisitions(ctx context.Context, arg CountPurchaseRequisitionsParams) (int64, error)
	CountReceivables(ctx context.Context, arg CountReceivablesParams) (int64, error)
	// Mirrors ListSalesOrders' search: sales_id resolves through employees only.
	CountSalesOrders(ctx context.Context, arg CountSalesOrdersParams) (int64, error)
	CountSalesReturns(ctx context.Context, arg CountSalesReturnsParams) (int64, error)
	CountSalesRoutes(ctx context.Context, arg CountSalesRoutesParams) (int64, error)
	CountSalesVisits(ctx context.Context, arg CountSalesVisitsParams) (int64, error)
	CountSalesVouchers(ctx context.Context, arg CountSalesVouchersParams) (int64, error)
	CountStockLines(ctx context.Context, search pgtype.Text) (int64, error)
	CountStockLinesByWarehouse(ctx context.Context, arg CountStockLinesByWarehouseParams) (int64, error)
	// Stores own their outlet warehouse: deleting the last store bound to a
	// warehouse must retire the warehouse too, or it lingers in checkout pickers
	// (B2B + POS read active-only options) with no store behind it.
	CountStoresByWarehouse(ctx context.Context, warehouseID int64) (int64, error)
	CountSuppliers(ctx context.Context, arg CountSuppliersParams) (int64, error)
	CountSuppliersActive(ctx context.Context, id int64) (int64, error)
	CountTransfers(ctx context.Context, status pgtype.Text) (int64, error)
	CountUnits(ctx context.Context, search pgtype.Text) (int64, error)
	CountUnitsByName(ctx context.Context, arg CountUnitsByNameParams) (int64, error)
	CountUsers(ctx context.Context, arg CountUsersParams) (int64, error)
	CountUsersByRole(ctx context.Context, role string) (int64, error)
	CountUsersInStores(ctx context.Context, arg CountUsersInStoresParams) (int64, error)
	CountVouchers(ctx context.Context, status pgtype.Text) (int64, error)
	CountWarehouses(ctx context.Context, dollar_1 interface{}) (int64, error)
	CountWarehousesActive(ctx context.Context, id int64) (int64, error)
	CountWarehousesByID(ctx context.Context, id int64) (int64, error)
	CreateActivityLog(ctx context.Context, arg CreateActivityLogParams) error
	CreateAttendance(ctx context.Context, arg CreateAttendanceParams) (CreateAttendanceRow, error)
	CreateBrand(ctx context.Context, arg CreateBrandParams) (Brand, error)
	CreateBuyerAddress(ctx context.Context, arg CreateBuyerAddressParams) (BuyerAddress, error)
	CreateCashAccount(ctx context.Context, arg CreateCashAccountParams) (CashAccount, error)
	// store_id is the 21st parameter and the SERVICE sets it from the caller's
	// store scope, never from the request body. A client that could name its own
	// outlet would defeat every filter in this file.
	CreateCashflow(ctx context.Context, arg CreateCashflowParams) (int64, error)
	CreateCashflowV2(ctx context.Context, arg CreateCashflowV2Params) error
	CreateCashierShift(ctx context.Context, arg CreateCashierShiftParams) (CashierShift, error)
	CreateCategory(ctx context.Context, arg CreateCategoryParams) (int64, error)
	CreateCustomer(ctx context.Context, arg CreateCustomerParams) (int64, error)
	CreateCustomerForUser(ctx context.Context, arg CreateCustomerForUserParams) (int64, error)
	CreateDeliveryOrder(ctx context.Context, arg CreateDeliveryOrderParams) (CreateDeliveryOrderRow, error)
	CreateDeliveryOrderItem(ctx context.Context, arg CreateDeliveryOrderItemParams) (int64, error)
	CreateDeliveryStatusHistory(ctx context.Context, arg CreateDeliveryStatusHistoryParams) (int64, error)
	CreateDispatch(ctx context.Context, arg CreateDispatchParams) (CreateDispatchRow, error)
	CreateDrawerEntry(ctx context.Context, arg CreateDrawerEntryParams) (CashierDrawerEntry, error)
	// Driver accounts are users in name only: a random unguessable password (never
	// surfaced), role 'employee' (this schema's lowest-privilege role, granted only
	// dashboard.view/hr.clockin/hr.clockout/hr.leaves.store — see catalogSpec), and
	// application_access='driver' so they never resolve to a real ERP/POS/ecommerce
	// surface even if somehow logged in. This exists purely so dispatches.driver_id
	// has a users.id to point at.
	CreateDriverUser(ctx context.Context, arg CreateDriverUserParams) (CreateDriverUserRow, error)
	// Storefront signup: 'retail' for perseorangan, 'wholesale' for bisnis.
	CreateEcommerceCustomer(ctx context.Context, arg CreateEcommerceCustomerParams) (int64, error)
	// Self-service storefront signup: always a buyer scoped to the e-commerce app,
	// active immediately (no approval queue yet).
	CreateEcommerceUser(ctx context.Context, arg CreateEcommerceUserParams) (CreateEcommerceUserRow, error)
	CreateEmployee(ctx context.Context, arg CreateEmployeeParams) (CreateEmployeeRow, error)
	CreateFleet(ctx context.Context, arg CreateFleetParams) (CreateFleetRow, error)
	CreateGalonTransaction(ctx context.Context, arg CreateGalonTransactionParams) (GalonTransaction, error)
	CreateGoodsReceipt(ctx context.Context, arg CreateGoodsReceiptParams) (CreateGoodsReceiptRow, error)
	// defect_notes rides with the structured rejection (000147): a GR that rejects
	// units must say WHY, or the drilldown shows a number with no reason. Updated
	// together with quantity_rejected — the migration added the column but this
	// INSERT was never extended, silently dropping the ERP's notes (7-B).
	CreateGoodsReceiptItem(ctx context.Context, arg CreateGoodsReceiptItemParams) (int64, error)
	CreateInvoice(ctx context.Context, arg CreateInvoiceParams) (CreateInvoiceRow, error)
	CreateLeave(ctx context.Context, arg CreateLeaveParams) (CreateLeaveRow, error)
	CreateMembership(ctx context.Context, arg CreateMembershipParams) (int64, error)
	CreateMembershipTier(ctx context.Context, arg CreateMembershipTierParams) (MembershipTier, error)
	CreateMembershipTierConfigHistory(ctx context.Context, arg CreateMembershipTierConfigHistoryParams) error
	CreateMembershipTierHistory(ctx context.Context, arg CreateMembershipTierHistoryParams) error
	CreateMovement(ctx context.Context, arg CreateMovementParams) (CreateMovementRow, error)
	CreateOpname(ctx context.Context, arg CreateOpnameParams) (int64, error)
	CreateOpnameItem(ctx context.Context, arg CreateOpnameItemParams) (int64, error)
	CreatePayment(ctx context.Context, arg CreatePaymentParams) (int64, error)
	CreatePaymentVoucher(ctx context.Context, arg CreatePaymentVoucherParams) (PaymentVoucher, error)
	CreatePaymentVoucherLine(ctx context.Context, arg CreatePaymentVoucherLineParams) (PaymentVoucherLine, error)
	CreatePayroll(ctx context.Context, arg CreatePayrollParams) (CreatePayrollRow, error)
	CreatePerformance(ctx context.Context, arg CreatePerformanceParams) (CreatePerformanceRow, error)
	CreateProduct(ctx context.Context, arg CreateProductParams) (CreateProductRow, error)
	CreateProductBarcode(ctx context.Context, arg CreateProductBarcodeParams) (ProductBarcode, error)
	CreateProductUnit(ctx context.Context, arg CreateProductUnitParams) (int64, error)
	CreatePurchaseCashflow(ctx context.Context, arg CreatePurchaseCashflowParams) (int64, error)
	CreatePurchaseOrder(ctx context.Context, arg CreatePurchaseOrderParams) (CreatePurchaseOrderRow, error)
	CreatePurchaseOrderItem(ctx context.Context, arg CreatePurchaseOrderItemParams) (int64, error)
	// Purchase requisitions (000151): store head requests items running out;
	// admin pembelian converts the request into a PO. Request-only records —
	// no stock movement, no money. Sort whitelist dir-gated like every other
	// list (the products ORDER BY bug pattern).
	CreatePurchaseRequisition(ctx context.Context, arg CreatePurchaseRequisitionParams) (CreatePurchaseRequisitionRow, error)
	CreatePurchaseRequisitionItem(ctx context.Context, arg CreatePurchaseRequisitionItemParams) error
	CreateRole(ctx context.Context, name string) (Role, error)
	CreateSalesActivity(ctx context.Context, arg CreateSalesActivityParams) (int64, error)
	CreateSalesCashflow(ctx context.Context, arg CreateSalesCashflowParams) (int64, error)
	CreateSalesInvoice(ctx context.Context, arg CreateSalesInvoiceParams) (int64, error)
	CreateSalesLocation(ctx context.Context, arg CreateSalesLocationParams) error
	CreateSalesOrder(ctx context.Context, arg CreateSalesOrderParams) (CreateSalesOrderRow, error)
	CreateSalesOrderItem(ctx context.Context, arg CreateSalesOrderItemParams) (int64, error)
	CreateSalesPayment(ctx context.Context, arg CreateSalesPaymentParams) (int64, error)
	CreateSalesReturn(ctx context.Context, arg CreateSalesReturnParams) (CreateSalesReturnRow, error)
	CreateSalesReturnItem(ctx context.Context, arg CreateSalesReturnItemParams) (SalesReturnItem, error)
	CreateSalesRoute(ctx context.Context, arg CreateSalesRouteParams) (int64, error)
	CreateSalesVisit(ctx context.Context, arg CreateSalesVisitParams) (int64, error)
	// Sales Voucher queries (Phase 6 Item 4)
	CreateSalesVoucher(ctx context.Context, arg CreateSalesVoucherParams) (CreateSalesVoucherRow, error)
	CreateShipment(ctx context.Context, arg CreateShipmentParams) (CreateShipmentRow, error)
	CreateShipmentItem(ctx context.Context, arg CreateShipmentItemParams) (int64, error)
	CreateShipmentTrackingEvent(ctx context.Context, arg CreateShipmentTrackingEventParams) (CreateShipmentTrackingEventRow, error)
	CreateStore(ctx context.Context, arg CreateStoreParams) (CreateStoreRow, error)
	CreateSupplier(ctx context.Context, arg CreateSupplierParams) (int64, error)
	CreateTransfer(ctx context.Context, arg CreateTransferParams) (CreateTransferRow, error)
	CreateTransferItem(ctx context.Context, arg CreateTransferItemParams) (int64, error)
	CreateUnit(ctx context.Context, arg CreateUnitParams) (int64, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error)
	CreateVoucher(ctx context.Context, arg CreateVoucherParams) (int64, error)
	CreateWarehouse(ctx context.Context, arg CreateWarehouseParams) (int64, error)
	CustomerIsEcomAdminByUserID(ctx context.Context, userID pgtype.Int8) (bool, error)
	//
	// The signed-in caller's OWN customer record, for the B2B account profile
	// page. Scoped by customers.user_id, NOT by an id in the path: a storefront
	// buyer must never be able to read or edit the company directory by guessing
	// an id, and /customers/{id} stays behind the internal PII gate.
	CustomerProfileForUser(ctx context.Context, userID pgtype.Int8) (CustomerProfileForUserRow, error)
	DeactivateWarehouse(ctx context.Context, id int64) (int64, error)
	DebtCSVRows(ctx context.Context) ([]DebtCSVRowsRow, error)
	DeductEmployeeLeave(ctx context.Context, arg DeductEmployeeLeaveParams) (decimal.Decimal, error)
	DeleteBrand(ctx context.Context, id int64) (int64, error)
	DeleteBuyerAddress(ctx context.Context, arg DeleteBuyerAddressParams) (int64, error)
	DeleteCartItem(ctx context.Context, arg DeleteCartItemParams) (int64, error)
	DeleteCashflow(ctx context.Context, id int64) (int64, error)
	DeleteCategory(ctx context.Context, id int64) (int64, error)
	DeleteEmailVerificationCode(ctx context.Context, arg DeleteEmailVerificationCodeParams) error
	DeleteInvoice(ctx context.Context, id int64) (int64, error)
	DeletePasswordResetToken(ctx context.Context, email string) error
	DeletePerformance(ctx context.Context, id int64) (int64, error)
	DeleteProductBarcode(ctx context.Context, id int64) (int64, error)
	DeleteProductUnit(ctx context.Context, id int64) (int64, error)
	DeletePurchaseOrder(ctx context.Context, id int64) (int64, error)
	DeletePurchaseOrderItems(ctx context.Context, purchaseOrderID int64) error
	DeleteRole(ctx context.Context, id int64) (int64, error)
	DeleteRolePermission(ctx context.Context, arg DeleteRolePermissionParams) (int64, error)
	DeleteRolePermissionsByRole(ctx context.Context, role string) error
	DeleteSalesOrder(ctx context.Context, id int64) (int64, error)
	DeleteSalesOrderItems(ctx context.Context, salesOrderID int64) error
	DeleteStore(ctx context.Context, id int64) (int64, error)
	// :execrows, not :exec: single-token sibling of DeleteTokensByUser, so a
	// revocation that matched no row is visible. internal/auth/repository.go
	// DeleteToken warns on a zero count (a repeat logout legitimately deletes 0).
	DeleteToken(ctx context.Context, id int64) (int64, error)
	DeleteTokensByUser(ctx context.Context, tokenableID int64) (int64, error)
	DeleteUnit(ctx context.Context, id int64) (int64, error)
	DeleteUser(ctx context.Context, id int64) (int64, error)
	DeleteWarehouse(ctx context.Context, id int64) (int64, error)
	DispatchByShipmentID(ctx context.Context, shipmentID int64) (DispatchByShipmentIDRow, error)
	EnsureSalesStockRow(ctx context.Context, arg EnsureSalesStockRowParams) error
	EnsureStockRow(ctx context.Context, arg EnsureStockRowParams) error
	ExecSetPVStatus(ctx context.Context, arg ExecSetPVStatusParams) (int64, error)
	ExecUpdateVoucherTotal(ctx context.Context, arg ExecUpdateVoucherTotalParams) (int64, error)
	FirstActiveStore(ctx context.Context) (FirstActiveStoreRow, error)
	FirstActiveWarehouse(ctx context.Context) (int64, error)
	FleetLatestLocations(ctx context.Context) ([]FleetLatestLocationsRow, error)
	//
	// Counts for the POS stat tiles. Each is a different question, so they are
	// three different predicates rather than one GROUP BY over status.
	//
	// outstanding_loans is DERIVABLE: a borrow_galon that reached 'completed' and
	// has not been returned. ReturnGalon (internal/galon/service.go) accepts only
	// borrow_galon and flips loan_returned, so this pair is exactly "galons
	// currently in a customer's hands". 'completed' is required so a pending
	// borrow — not yet handed over — is not counted as out with the customer.
	//
	// in_delivery is DERIVABLE: a delivery-mode transaction still pending, i.e.
	// ordered to be delivered and not yet fulfilled.
	//
	// There is deliberately no third column. 'diToko' (galons held at the store)
	// is a PER-UNIT state — the POS mock documents GALON_UNIT_STATUS as
	// di_toko / dipinjam / dikembalikan — and there is no galon unit registry to
	// read it from: no such table exists, gallon_code is NULL on every row, and no
	// unit status column exists anywhere. Summing completed pickups would answer a
	// different question (goods collected over time) while sitting under a label
	// that claims a physical count, which is the same fabrication this query
	// replaces. The handler returns null for it; the POS renders "—".
	//
	// The store filter matches CountGalonTransactions so the tiles are tenant
	// scoped exactly like the list behind them.
	GalonInventoryStatus(ctx context.Context, allowedStoreIds []int64) (GalonInventoryStatusRow, error)
	GetAppSetting(ctx context.Context, key string) ([]byte, error)
	// LIVE-AUTHZ AUDIT 2026-08-26: read the materialized application axis
	// (migration 000037). 'pos' cannot be expressed by DeriveApplicationAccess,
	// which maps every internal role to 'erp'; the repository honors this stored
	// value as an operator-assigned override.
	GetApplicationAccess(ctx context.Context, id int64) (string, error)
	GetAttendanceByID(ctx context.Context, id int64) (GetAttendanceByIDRow, error)
	GetAttendanceForDay(ctx context.Context, arg GetAttendanceForDayParams) (GetAttendanceForDayRow, error)
	// business-rules.md §12: brands
	GetBrandByID(ctx context.Context, id int64) (Brand, error)
	GetBuyerAddress(ctx context.Context, arg GetBuyerAddressParams) (BuyerAddress, error)
	GetCartByUserID(ctx context.Context, userID int64) (Cart, error)
	GetCashAccount(ctx context.Context, id int64) (GetCashAccountRow, error)
	// The single-row read MUST be scoped, or a scoped list is cosmetic: a caller
	// who cannot see a row in the list can still fetch it by id. store_ids is the
	// caller's store scope as an array; an EMPTY array means a restricted scope with
	// no stores, which must match nothing. A NULL array means platform-wide, which
	// matches everything including company-level (store_id IS NULL) rows.
	GetCashflowByID(ctx context.Context, arg GetCashflowByIDParams) (GetCashflowByIDRow, error)
	// FOR UPDATE, and scoped for the same reason as GetCashflowByID: the mutation
	// paths (update, delete, reverse) lock the row they are about to change, and an
	// unscoped lock would both read and WRITE another outlet's cash.
	GetCashflowByIDForUpdate(ctx context.Context, arg GetCashflowByIDForUpdateParams) (GetCashflowByIDForUpdateRow, error)
	GetCashierShiftByID(ctx context.Context, id int64) (CashierShift, error)
	GetCashierShiftByIDForUpdate(ctx context.Context, id int64) (CashierShift, error)
	GetCategoryByID(ctx context.Context, id int64) (GetCategoryByIDRow, error)
	// Referral attribution: sales user linked to a customer (nullable).
	GetCustomerAssignedSales(ctx context.Context, id int64) (pgtype.Int8, error)
	GetCustomerByCode(ctx context.Context, code string) (GetCustomerByCodeRow, error)
	GetCustomerByID(ctx context.Context, id int64) (GetCustomerByIDRow, error)
	GetCustomerIDByUserID(ctx context.Context, userID pgtype.Int8) (int64, error)
	// The linked B2B login for a customer (000151): NULL when the customer has no
	// user account (a catalog-only record). The password-reset service refuses
	// those — there is no credential to reset.
	GetCustomerLoginUser(ctx context.Context, id int64) (GetCustomerLoginUserRow, error)
	// sales_id FKs employees(id); the salesperson name resolves there, not users.
	GetDeliveryOrderByID(ctx context.Context, id int64) (GetDeliveryOrderByIDRow, error)
	// Identical column list to GetDeliveryOrderByID so the generated row structs
	// stay convertible; FOR UPDATE OF d locks only delivery_orders (the outer-
	// joined sides cannot be locked).
	// sales_id FKs employees(id); the salesperson name resolves there, not users.
	GetDeliveryOrderByIDForUpdate(ctx context.Context, id int64) (GetDeliveryOrderByIDForUpdateRow, error)
	GetDeliveryOrderItemsForUpdate(ctx context.Context, deliveryOrderID int64) ([]DeliveryOrderItem, error)
	GetEmailVerificationCode(ctx context.Context, arg GetEmailVerificationCodeParams) (GetEmailVerificationCodeRow, error)
	GetEmployeeByID(ctx context.Context, id int64) (GetEmployeeByIDRow, error)
	GetEmployeeByUserID(ctx context.Context, userID pgtype.Int8) (GetEmployeeByUserIDRow, error)
	GetFleetByID(ctx context.Context, id int64) (Fleet, error)
	GetGallonInfoByCode(ctx context.Context, arg GetGallonInfoByCodeParams) (GetGallonInfoByCodeRow, error)
	GetGalonTransactionByID(ctx context.Context, id int64) (GalonTransaction, error)
	GetGalonTransactionByIDForUpdate(ctx context.Context, id int64) (GalonTransaction, error)
	GetGoodsReceiptByID(ctx context.Context, id int64) (GetGoodsReceiptByIDRow, error)
	GetInvoiceByID(ctx context.Context, id int64) (GetInvoiceByIDRow, error)
	GetInvoiceByIDForUpdate(ctx context.Context, id int64) (GetInvoiceByIDForUpdateRow, error)
	GetInvoiceCreationStatusHistoryForUpdate(ctx context.Context, arg GetInvoiceCreationStatusHistoryForUpdateParams) (SalesOrderStatusHistory, error)
	GetLatestDispatchByDeliveryOrder(ctx context.Context, deliveryOrderID int64) (Dispatch, error)
	GetLatestEmployeeNumber(ctx context.Context) (string, error)
	GetLeaveByID(ctx context.Context, id int64) (GetLeaveByIDRow, error)
	GetMembershipByCustomer(ctx context.Context, customerID int64) (GetMembershipByCustomerRow, error)
	// Phase 6 item 3 (scaffolding): membership identity and tiers (business-rules.md
	// §13.1). Only the confirmed rules are queryable here: the
	// User -> Customer -> Membership split and exactly three tiers. Benefit
	// resolution has no queries yet because the formulas are unresolved.
	GetMembershipByID(ctx context.Context, id int64) (GetMembershipByIDRow, error)
	GetMembershipByNumber(ctx context.Context, memberNumber string) (GetMembershipByNumberRow, error)
	GetMembershipByUser(ctx context.Context, userID pgtype.Int8) (GetMembershipByUserRow, error)
	GetMembershipTier(ctx context.Context, id int64) (MembershipTier, error)
	GetMembershipTierByCode(ctx context.Context, code string) (MembershipTier, error)
	GetOpenShiftByCashier(ctx context.Context, cashierID int64) (CashierShift, error)
	GetOpnameByID(ctx context.Context, id int64) (GetOpnameByIDRow, error)
	GetOrCreateCart(ctx context.Context, userID int64) (Cart, error)
	GetPasswordResetToken(ctx context.Context, email string) (PasswordResetToken, error)
	// Locks the payment row (FOR UPDATE OF p — the outer-joined sides cannot be
	// locked) so concurrent partial payments against the same payable serialize.
	// owner_user_id resolves the payment -> invoice -> customers.user_id linkage;
	// it is NULL for non-invoice payables or customers without a linked user.
	GetPaymentByIDForUpdate(ctx context.Context, id int64) (GetPaymentByIDForUpdateRow, error)
	GetPaymentVoucher(ctx context.Context, id int64) (PaymentVoucher, error)
	GetPaymentVoucherForUpdate(ctx context.Context, id int64) (PaymentVoucher, error)
	GetPayrollByID(ctx context.Context, id int64) (GetPayrollByIDRow, error)
	GetPerformanceByID(ctx context.Context, id int64) (GetPerformanceByIDRow, error)
	GetPricingBaseUnit(ctx context.Context, productID int64) (GetPricingBaseUnitRow, error)
	// Phase 6 item 2: inputs for the authoritative pricing engine (business-rules.md
	// §11.2, §12). The engine never trusts a client-supplied price; it resolves the
	// configured product-unit price, falling back to the product selling price
	// scaled by the unit conversion factor.
	GetPricingProduct(ctx context.Context, id int64) (GetPricingProductRow, error)
	GetPricingProductUnit(ctx context.Context, id int64) (GetPricingProductUnitRow, error)
	GetProductBarcodeByID(ctx context.Context, id int64) (ProductBarcode, error)
	GetProductByCode(ctx context.Context, code string) (GetProductByCodeRow, error)
	GetProductByID(ctx context.Context, id int64) (GetProductByIDRow, error)
	GetProductSellingPrice(ctx context.Context, id int64) (decimal.Decimal, error)
	GetProductUnitByID(ctx context.Context, id int64) (GetProductUnitByIDRow, error)
	GetPurchaseOrderByID(ctx context.Context, id int64) (GetPurchaseOrderByIDRow, error)
	GetPurchaseOrderByIDForUpdate(ctx context.Context, id int64) (GetPurchaseOrderByIDForUpdateRow, error)
	GetPurchaseOrderSupplierID(ctx context.Context, id int64) (int64, error)
	GetPurchaseRequisition(ctx context.Context, id int64) (GetPurchaseRequisitionRow, error)
	GetRoleByID(ctx context.Context, id int64) (Role, error)
	GetRoleByName(ctx context.Context, name string) (Role, error)
	GetSOHeaderByID(ctx context.Context, id int64) (GetSOHeaderByIDRow, error)
	GetSOHeaderByIDForUpdate(ctx context.Context, id int64) (GetSOHeaderByIDForUpdateRow, error)
	// sales_name resolves through employees ONLY. sales_id FKs employees(id)
	// (000001_init_schema.sql:235), so the employee is the row the id actually
	// points at. See the migration that remapped the legacy users.id values.
	GetSalesOrderByID(ctx context.Context, id int64) (GetSalesOrderByIDRow, error)
	// Same employees-only resolution as GetSalesOrderByID; FOR UPDATE OF o keeps
	// the lock on the order row, not on the joined lookup tables.
	GetSalesOrderByIDForUpdate(ctx context.Context, id int64) (GetSalesOrderByIDForUpdateRow, error)
	GetSalesOrderForDelivery(ctx context.Context, id int64) (GetSalesOrderForDeliveryRow, error)
	GetSalesOrderShiftID(ctx context.Context, id int64) (pgtype.Int8, error)
	GetSalesReturnByID(ctx context.Context, id int64) (GetSalesReturnByIDRow, error)
	GetSalesStockRow(ctx context.Context, arg GetSalesStockRowParams) (GetSalesStockRowRow, error)
	GetSalesStockRowForUpdate(ctx context.Context, arg GetSalesStockRowForUpdateParams) (GetSalesStockRowForUpdateRow, error)
	// Referral signup: resolve a public sales code (employees.employee_number)
	// to the linked user id. Active sales staff with a user account only.
	GetSalesUserIDByEmployeeCode(ctx context.Context, upper interface{}) (int64, error)
	GetSalesVisitByID(ctx context.Context, id int64) (GetSalesVisitByIDRow, error)
	GetSalesVoucherByID(ctx context.Context, id int64) (GetSalesVoucherByIDRow, error)
	GetSalesVoucherByIDForUpdate(ctx context.Context, id int64) (GetSalesVoucherByIDForUpdateRow, error)
	GetSalesVoucherByNumber(ctx context.Context, voucherNumber string) (GetSalesVoucherByNumberRow, error)
	GetSalesVoucherByNumberForUpdate(ctx context.Context, voucherNumber string) (GetSalesVoucherByNumberForUpdateRow, error)
	GetShipmentByBarcode(ctx context.Context, barcode pgtype.Text) (GetShipmentByBarcodeRow, error)
	GetShipmentByID(ctx context.Context, id int64) (GetShipmentByIDRow, error)
	GetShipmentByIDForUpdate(ctx context.Context, id int64) (GetShipmentByIDForUpdateRow, error)
	GetShipmentByShipmentNumber(ctx context.Context, shipmentNumber string) (GetShipmentByShipmentNumberRow, error)
	GetShipmentByTrackingNumber(ctx context.Context, trackingNumber pgtype.Text) (GetShipmentByTrackingNumberRow, error)
	GetShipmentItemsForUpdate(ctx context.Context, shipmentID int64) ([]ShipmentItem, error)
	GetShipmentTrackingEventByProviderRef(ctx context.Context, arg GetShipmentTrackingEventByProviderRefParams) (GetShipmentTrackingEventByProviderRefRow, error)
	GetStockRow(ctx context.Context, arg GetStockRowParams) (GetStockRowRow, error)
	GetStockRowForUpdate(ctx context.Context, arg GetStockRowForUpdateParams) (GetStockRowForUpdateRow, error)
	GetStoreByID(ctx context.Context, id int64) (GetStoreByIDRow, error)
	GetSupplierByCode(ctx context.Context, code string) (GetSupplierByCodeRow, error)
	GetSupplierByID(ctx context.Context, id int64) (GetSupplierByIDRow, error)
	GetTokenByHash(ctx context.Context, token string) (GetTokenByHashRow, error)
	GetTransferByID(ctx context.Context, id int64) (GetTransferByIDRow, error)
	GetUnitByID(ctx context.Context, id int64) (GetUnitByIDRow, error)
	GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
	GetUserByID(ctx context.Context, id int64) (GetUserByIDRow, error)
	GetVoucherByID(ctx context.Context, id int64) (GetVoucherByIDRow, error)
	GetVoucherByIDForUpdate(ctx context.Context, id int64) (GetVoucherByIDForUpdateRow, error)
	GetWalkInCustomerID(ctx context.Context) (int64, error)
	GetWarehouseByID(ctx context.Context, id int64) (GetWarehouseByIDRow, error)
	InsertSOStatusHistory(ctx context.Context, arg InsertSOStatusHistoryParams) (int64, error)
	InsertToken(ctx context.Context, arg InsertTokenParams) (int64, error)
	InvoiceExistsForSO(ctx context.Context, salesOrderID pgtype.Int8) (bool, error)
	IsStoreActive(ctx context.Context, id int64) (bool, error)
	IsUserInActiveStore(ctx context.Context, arg IsUserInActiveStoreParams) (bool, error)
	// Hand the sheet to a collector (or take it back with NULL) — active sheets
	// only; a voided sheet has no carrier to record. execrows==0 distinguishes a
	// missing/voided group from a successful handover.
	LHPPAssignGroup(ctx context.Context, arg LHPPAssignGroupParams) (int64, error)
	// The collector taking the sheet must be an ACTIVE account: a handover to a
	// deactivated user would orphan the sheet (nobody to receive the setoran).
	LHPPAssigneeExists(ctx context.Context, id int64) (int64, error)
	// Every cash/giro payment recorded against this set of invoices, with its
	// Setoran linkage (deposit_id is NULL until a Setoran Tunai Driver picks it
	// up — see internal/warehousedeposit). Used to derive each LHPP item's
	// "sudah diterima kasir atau belum" status precisely, per invoice, instead
	// of approximating by driver+date.
	LHPPCashGiroPaymentsForInvoices(ctx context.Context, invoiceIds []int64) ([]LHPPCashGiroPaymentsForInvoicesRow, error)
	LHPPCountGroupItems(ctx context.Context, groupID int64) (int64, error)
	// Per-group member count for the sources, so a merge knows which ones it
	// emptied. Voided groups are excluded by the service, not here.
	LHPPCountGroupItemsInGroups(ctx context.Context, groupIds []int64) ([]LHPPCountGroupItemsInGroupsRow, error)
	LHPPDeleteGroupItems(ctx context.Context, groupIds []int64) (int64, error)
	LHPPDeleteGroupItemsByDO(ctx context.Context, doIds []int64) (int64, error)
	// ---------- persisted group maintenance (merge / split / void / dispatch) ----
	// A group header by id, INCLUDING a voided one: Get must still reach a retired
	// sheet by id so its number stays auditable long after the DOs left.
	LHPPGetGroup(ctx context.Context, id int64) (LHPPGetGroupRow, error)
	// Locks the participating group rows. Called AFTER the delivery_orders locks and
	// in ascending id order, so every mutation (merge, split, void) takes locks in
	// one global order and cannot deadlock against another. Rows of voided groups
	// are returned too: the service decides what to do with them rather than having
	// the filter hide a state transition.
	LHPPGetGroupsForUpdate(ctx context.Context, groupIds []int64) ([]LHPPGetGroupsForUpdateRow, error)
	// Audit trail for one group, newest first. to_group_id is what the two indexes
	// cover; from_group_id is looked up through the DO index (a DO's history is
	// read when answering "which sheet was this DO on before it moved?").
	LHPPGroupHistory(ctx context.Context, groupID int64) ([]LhppGroupHistory, error)
	// Which group a DO currently belongs to, or no row when it is unbatched. This
	// is also the dispatch-seam idempotency probe: a re-dispatch re-invokes the seam
	// and finds the DO already placed, so no second group is created.
	LHPPGroupItemDOIDs(ctx context.Context, deliveryOrderID int64) (int64, error)
	// Pre-lock membership read. Safe to do unlocked because every mutation re-locks
	// these same delivery_orders rows before it writes, so the set cannot change
	// underneath us once the locks are held.
	LHPPGroupMemberDOIDs(ctx context.Context, groupIds []int64) ([]int64, error)
	// lhpp_number is allocated from document_number_sequences INSIDE the caller's
	// transaction by the service, so a rollback rewinds the counter instead of
	// burning a number (000084's entire subject).
	LHPPInsertGroup(ctx context.Context, arg LHPPInsertGroupParams) (int64, error)
	// One row per DO per operation, written inside the same transaction as the
	// membership change it describes.
	LHPPInsertGroupHistory(ctx context.Context, arg LHPPInsertGroupHistoryParams) (int64, error)
	LHPPInsertGroupItem(ctx context.Context, arg LHPPInsertGroupItemParams) (int64, error)
	// The concurrency lock for every membership change. delivery_orders is the row
	// CreateDispatch already locks (internal/distribution CreateDispatch), so a
	// merge and a re-dispatch contend on the same row for free. Ascending id order
	// is mandatory — it is what makes concurrent merges deadlock-free.
	LHPPLockDeliveryOrdersForUpdate(ctx context.Context, doIds []int64) ([]LHPPLockDeliveryOrdersForUpdateRow, error)
	// Re-points membership. The DO's lhpp_number is NOT touched — the group row
	// keeps the number it was allocated, which is what makes a merge reversible
	// without invalidating a sheet the collector already printed.
	LHPPMoveGroupItems(ctx context.Context, arg LHPPMoveGroupItemsParams) (int64, error)
	// Re-points specific DOs, which is what a split does. This MUST be an UPDATE
	// and not DELETE+INSERT: lhpp_group_items_do_unique is on delivery_order_id
	// alone, so inserting the new membership while the old one still exists
	// violates the invariant — and DELETE+INSERT would also leave a window where
	// the DO is on no sheet at all. Updating one row to point elsewhere can never
	// trip it.
	LHPPMoveGroupItemsByDO(ctx context.Context, arg LHPPMoveGroupItemsByDOParams) (int64, error)
	// driver_id follows a re-dispatch only while the group holds a single DO (the
	// guard lives in internal/lhpp: a multi-member group's driver is immutable).
	// lhpp_number is deliberately absent — the sheet keeps its number.
	LHPPUpdateGroupDriver(ctx context.Context, arg LHPPUpdateGroupDriverParams) (int64, error)
	// Voiding is the empty-group mechanism: status + voided_at + voided_by, with
	// updated_at alongside. The CHECK on lhpp_groups rejects a void without a stamp.
	LHPPVoidGroups(ctx context.Context, arg LHPPVoidGroupsParams) (int64, error)
	LatestSalesLocations(ctx context.Context) ([]LatestSalesLocationsRow, error)
	ListAccounts(ctx context.Context, active pgtype.Bool) ([]ListAccountsRow, error)
	ListActiveEmployees(ctx context.Context) ([]ListActiveEmployeesRow, error)
	// Scoped to dispatch: there is no "driver" role in this schema (dispatches.driver_id
	// just FKs users), so a "driver" is tagged via application_access='driver'
	// (set only by CreateDriverUser below) rather than a real RBAC role — drivers
	// don't log into the ERP, so they never need one. Gated behind
	// distribution.dispatches.create in the handler rather than system.users.view,
	// since a warehouse dispatcher legitimately needs this list without user-admin
	// rights.
	ListActiveUsersForDriverPicker(ctx context.Context) ([]ListActiveUsersForDriverPickerRow, error)
	ListActivityLogs(ctx context.Context, arg ListActivityLogsParams) ([]ListActivityLogsRow, error)
	ListApprovedLeavesForEmployeePeriod(ctx context.Context, arg ListApprovedLeavesForEmployeePeriodParams) ([]ListApprovedLeavesForEmployeePeriodRow, error)
	ListAttendance(ctx context.Context, arg ListAttendanceParams) ([]ListAttendanceRow, error)
	ListAttendanceForEmployeePeriod(ctx context.Context, arg ListAttendanceForEmployeePeriodParams) ([]ListAttendanceForEmployeePeriodRow, error)
	ListBrands(ctx context.Context, onlyActive pgtype.Bool) ([]Brand, error)
	ListBuyerAddresses(ctx context.Context, userID int64) ([]BuyerAddress, error)
	ListCartItemsByCartID(ctx context.Context, cartID int64) ([]ListCartItemsByCartIDRow, error)
	ListCashAccounts(ctx context.Context, active pgtype.Bool) ([]ListCashAccountsRow, error)
	// The store_ids predicate is the outlet scope (migration 000104). NULL array =
	// platform-wide, which matches company-level rows too. A non-NULL array is the
	// caller's stores, and it excludes store_id IS NULL because ANY() against NULL
	// is NULL, which is not true — so company-level rows are invisible to a
	// restricted caller by construction rather than by a second condition.
	ListCashflows(ctx context.Context, arg ListCashflowsParams) ([]ListCashflowsRow, error)
	ListCashflowsByRef(ctx context.Context, arg ListCashflowsByRefParams) ([]ListCashflowsByRefRow, error)
	ListCashierShifts(ctx context.Context, arg ListCashierShiftsParams) ([]ListCashierShiftsRow, error)
	ListCategories(ctx context.Context, arg ListCategoriesParams) ([]ListCategoriesRow, error)
	ListCustomers(ctx context.Context, arg ListCustomersParams) ([]ListCustomersRow, error)
	// ERP column sort (sort_by + sort_dir) wins when present: the table headers
	// are per-column and used to be ignored, so every click returned the same
	// order. Whitelisted columns only — a sort key from the query string must
	// never reach SQL as an identifier. Ties break by po.id so paging stays
	// stable in both directions.
	ListDebts(ctx context.Context, arg ListDebtsParams) ([]ListDebtsRow, error)
	ListDeliveryOrderItems(ctx context.Context, deliveryOrderID int64) ([]ListDeliveryOrderItemsRow, error)
	// sales_id FKs employees(id); the salesperson name resolves there, not users.
	// ERP column sort (sort_by + sort_dir), whitelist-gated like products: the
	// value is compared in SQL and must never become an identifier. Each pair is
	// dir-gated so the un-gated ASC clause cannot dominate its DESC twin (the
	// products ORDER BY bug, fixed 3 Nov).
	ListDeliveryOrders(ctx context.Context, arg ListDeliveryOrdersParams) ([]ListDeliveryOrdersRow, error)
	ListDeliveryStatusHistory(ctx context.Context, deliveryOrderID int64) ([]DeliveryStatusHistory, error)
	ListDispatchesByDeliveryOrder(ctx context.Context, deliveryOrderID int64) ([]Dispatch, error)
	ListDrawerEntries(ctx context.Context, shiftID int64) ([]CashierDrawerEntry, error)
	// ERP column sort (sort_by + sort_dir), whitelist-gated and dir-gated like
	// products (the un-gated ASC clause dominating its DESC twin is the products
	// ORDER BY bug fixed 3 Nov). Default remains employee_number.
	ListEmployees(ctx context.Context, arg ListEmployeesParams) ([]ListEmployeesRow, error)
	ListFleet(ctx context.Context, arg ListFleetParams) ([]Fleet, error)
	ListGalonTransactions(ctx context.Context, arg ListGalonTransactionsParams) ([]GalonTransaction, error)
	ListGalonTransactionsByCode(ctx context.Context, arg ListGalonTransactionsByCodeParams) ([]GalonTransaction, error)
	ListGoodsReceiptItems(ctx context.Context, goodsReceiptID int64) ([]ListGoodsReceiptItemsRow, error)
	ListGoodsReceipts(ctx context.Context, arg ListGoodsReceiptsParams) ([]ListGoodsReceiptsRow, error)
	// There is no invoice_items table: an invoice's lines are the source sales
	// order's items (CreateInvoice only references the SO). The detail view
	// resolves them through invoices.sales_order_id.
	ListInvoiceItems(ctx context.Context, salesOrderID int64) ([]ListInvoiceItemsRow, error)
	ListInvoices(ctx context.Context, arg ListInvoicesParams) ([]ListInvoicesRow, error)
	// LHPP (Laporan Harian Penagihan Piutang) groups are PERSISTED, not computed.
	// A group is one manually maintained billing sheet: one group per delivery
	// order by default (created by the CreateDispatch seam), merged and split by
	// hand, one driver per group, and possibly spanning several days. Rows are
	// still read flat and folded in Go (internal/lhpp/service.go) because the
	// totals roll-up and cancellation rule are pure logic worth testing without a
	// database — but the grouping key is lhpp_groups.id, never driver+date.
	// A DO with no group row is not on any sheet and is not returned.
	// Payments post through financeSvc.PayInvoice against the invoice found here,
	// so LHPP and ReceivablesPage always read the same ledger.
	//
	// date_from/date_to are deliberately NOT selected: they are the min/max do_date
	// of a group's members, which changes on every merge, so they are derived in the
	// fold from do_date below rather than stored (see 000101).
	ListLHPPCandidateRows(ctx context.Context) ([]ListLHPPCandidateRowsRow, error)
	// Sales LHPP has no table either: a "group" is every billing (penagihan)
	// visit scheduled for the same sales rep on the same date, joined to that
	// customer's open invoices — the collection worksheet a sales rep works from
	// when Finance schedules a penagihan visit (see internal/salestracking),
	// as opposed to the driver-keyed LHPP above which covers dispatched DOs.
	// Assumes one billing visit per sales+customer+date; a duplicate schedule to
	// the same customer on the same day would double-count that customer's
	// invoice totals, which is treated as a scheduling data error, not handled here.
	ListLHPPSalesCandidateRows(ctx context.Context) ([]ListLHPPSalesCandidateRowsRow, error)
	ListLeaves(ctx context.Context, arg ListLeavesParams) ([]ListLeavesRow, error)
	// The tier CONFIG audit trail, as opposed to the per-member tier assignment
	// above. CreateTier and UpdateTier both append here inside their transaction
	// (service.go RecordTierConfigHistory), so the rows exist — they were simply
	// never readable, which made "who raised the gold discount and when"
	// unanswerable.
	//
	// Includes the min_orders / min_spend before/after columns added by migration
	// 000077. Rows written before that migration have NULLs in all four, which is
	// real history rather than a missing value: the columns did not exist yet.
	ListMembershipTierConfigHistory(ctx context.Context, membershipTierID int64) ([]MembershipTierConfigHistory, error)
	ListMembershipTierHistory(ctx context.Context, membershipID int64) ([]MembershipTierHistory, error)
	// STEP 0: database-backed membership tier configuration (business-rules.md §13.1).
	ListMembershipTiers(ctx context.Context) ([]MembershipTier, error)
	ListMemberships(ctx context.Context, arg ListMembershipsParams) ([]ListMembershipsRow, error)
	ListMovements(ctx context.Context, arg ListMovementsParams) ([]ListMovementsRow, error)
	ListOpnameItems(ctx context.Context, stockOpnameID int64) ([]ListOpnameItemsRow, error)
	ListOpnames(ctx context.Context, arg ListOpnamesParams) ([]ListOpnamesRow, error)
	ListPaymentVoucherLines(ctx context.Context, voucherID int64) ([]ListPaymentVoucherLinesRow, error)
	ListPaymentVouchers(ctx context.Context, arg ListPaymentVouchersParams) ([]ListPaymentVouchersRow, error)
	// For buyer-scoped pages (customer_id set) the WHERE pins the customer on the
	// invoice side via the join; the pagination walk stays cheap through
	// idx_payments_created_id (created_at, id DESC).
	ListPayments(ctx context.Context, arg ListPaymentsParams) ([]ListPaymentsRow, error)
	ListPayrolls(ctx context.Context, arg ListPayrollsParams) ([]ListPayrollsRow, error)
	ListPerformances(ctx context.Context, arg ListPerformancesParams) ([]ListPerformancesRow, error)
	// business-rules.md §12: product barcodes
	ListProductBarcodes(ctx context.Context, productID int64) ([]ProductBarcode, error)
	// business-rules.md §12: configured product units
	ListProductUnits(ctx context.Context, arg ListProductUnitsParams) ([]ListProductUnitsRow, error)
	// ERP column sort (sort_by + sort_dir) wins when present: the table headers
	// are per-column and used to be ignored, so every click returned the same
	// order. Whitelisted columns only — a sort key from the query string must
	// never reach SQL as an identifier.
	// A null price/stock stays at the bottom in BOTH directions, and the code
	// tiebreak makes paging stable.
	ListProducts(ctx context.Context, arg ListProductsParams) ([]ListProductsRow, error)
	ListPurchaseOrderItems(ctx context.Context, purchaseOrderID int64) ([]ListPurchaseOrderItemsRow, error)
	ListPurchaseOrderItemsForUpdate(ctx context.Context, purchaseOrderID int64) ([]ListPurchaseOrderItemsForUpdateRow, error)
	ListPurchaseOrders(ctx context.Context, arg ListPurchaseOrdersParams) ([]ListPurchaseOrdersRow, error)
	ListPurchaseRequisitionItems(ctx context.Context, requisitionID int64) ([]ListPurchaseRequisitionItemsRow, error)
	ListPurchaseRequisitions(ctx context.Context, arg ListPurchaseRequisitionsParams) ([]ListPurchaseRequisitionsRow, error)
	// sales_id FKs employees(id), so the salesperson name comes from employees.
	// See GetSalesOrderByID in sales.sql and the migration that remapped the
	// legacy users.id values.
	ListReceivables(ctx context.Context, arg ListReceivablesParams) ([]ListReceivablesRow, error)
	ListRecentActivity(ctx context.Context, limit int32) ([]ListRecentActivityRow, error)
	ListRolePermissions(ctx context.Context) ([]ListRolePermissionsRow, error)
	ListRoles(ctx context.Context) ([]Role, error)
	ListSalesEmployees(ctx context.Context) ([]ListSalesEmployeesRow, error)
	ListSalesOrderItems(ctx context.Context, salesOrderID int64) ([]ListSalesOrderItemsRow, error)
	ListSalesOrders(ctx context.Context, arg ListSalesOrdersParams) ([]ListSalesOrdersRow, error)
	ListSalesReturnItems(ctx context.Context, salesReturnID int64) ([]ListSalesReturnItemsRow, error)
	ListSalesReturns(ctx context.Context, arg ListSalesReturnsParams) ([]ListSalesReturnsRow, error)
	ListSalesRoutes(ctx context.Context, arg ListSalesRoutesParams) ([]ListSalesRoutesRow, error)
	ListSalesVisits(ctx context.Context, arg ListSalesVisitsParams) ([]ListSalesVisitsRow, error)
	ListSalesVouchers(ctx context.Context, arg ListSalesVouchersParams) ([]ListSalesVouchersRow, error)
	ListShipmentItems(ctx context.Context, shipmentID int64) ([]ListShipmentItemsRow, error)
	ListShipmentTrackingEvents(ctx context.Context, shipmentID int64) ([]ListShipmentTrackingEventsRow, error)
	ListShipmentsByDeliveryOrder(ctx context.Context, deliveryOrderID int64) ([]ListShipmentsByDeliveryOrderRow, error)
	ListShipmentsByDeliveryOrderNumber(ctx context.Context, doNumber string) ([]ListShipmentsByDeliveryOrderNumberRow, error)
	ListStockLines(ctx context.Context, arg ListStockLinesParams) ([]ListStockLinesRow, error)
	ListStockLinesByWarehouse(ctx context.Context, arg ListStockLinesByWarehouseParams) ([]ListStockLinesByWarehouseRow, error)
	ListStoreLocations(ctx context.Context) ([]ListStoreLocationsRow, error)
	ListStoreUsers(ctx context.Context, storeID int64) ([]ListStoreUsersRow, error)
	ListStores(ctx context.Context) ([]ListStoresRow, error)
	ListSuppliers(ctx context.Context, arg ListSuppliersParams) ([]ListSuppliersRow, error)
	ListTransferItems(ctx context.Context, stockTransferID int64) ([]ListTransferItemsRow, error)
	ListTransfers(ctx context.Context, arg ListTransfersParams) ([]ListTransfersRow, error)
	ListUnits(ctx context.Context, arg ListUnitsParams) ([]ListUnitsRow, error)
	ListUsers(ctx context.Context, arg ListUsersParams) ([]ListUsersRow, error)
	// Users belonging to the given tenant store(s) (store_users), further limited to
	// roles the caller may manage ($5) plus the caller themselves ($6). Used to
	// scope the ERP user list for a kepala toko to the cashier accounts of their
	// own outlet (never other managers or admins bound to the same store).
	ListUsersInStores(ctx context.Context, arg ListUsersInStoresParams) ([]ListUsersInStoresRow, error)
	ListVouchers(ctx context.Context, arg ListVouchersParams) ([]ListVouchersRow, error)
	ListWarehouseLocations(ctx context.Context) ([]ListWarehouseLocationsRow, error)
	ListWarehouseOptions(ctx context.Context) ([]ListWarehouseOptionsRow, error)
	ListWarehouses(ctx context.Context, arg ListWarehousesParams) ([]ListWarehousesRow, error)
	LockOpnameByID(ctx context.Context, id int64) (LockOpnameByIDRow, error)
	LookupProductByBarcode(ctx context.Context, barcode string) (LookupProductByBarcodeRow, error)
	MarkEmailVerified(ctx context.Context, email string) error
	MarkVoucherPrinted(ctx context.Context, arg MarkVoucherPrintedParams) (int64, error)
	MyOrdersSummary(ctx context.Context, customerID int64) (MyOrdersSummaryRow, error)
	PayPayroll(ctx context.Context, arg PayPayrollParams) (int64, error)
	// Authoritative read-path lookup for GET /uploads/{key}: the payments table is
	// the source of truth for which stored objects are private payment proofs.
	// Matches both the stored URL form ('/uploads/<key>') and a bare key so legacy
	// rows written before proofs were key-prefixed resolve identically. Any match
	// (even a NULL user_id, i.e. a payment whose customer has no linked user)
	// proves the object is a private document, so the caller can still tell
	// "private proof" from "public image".
	//
	// Both candidate strings arrive as bound parameters and are compared with
	// `= ANY(...)` so payments_proof_url_idx (000100) can serve them: the earlier
	// `col = $1 OR col = '/uploads/' || $1` form could not, because one branch
	// compares the column to an expression and BitmapOr needs every branch to be
	// indexable. `= ANY` over a bound array is character-for-character equivalent
	// to that OR, so the match set — and therefore the authorization outcome — is
	// unchanged.
	PaymentProofOwnersByKey(ctx context.Context, proofKeys []string) ([]pgtype.Int8, error)
	PaymentsExistForInvoice(ctx context.Context, payableID int64) (bool, error)
	ProductExistsByID(ctx context.Context, id int64) (bool, error)
	ProductIDBySKU(ctx context.Context, code string) (int64, error)
	// The print-once ledger (000150): first print stamps and counts; reprints
	// only pass when the CALLER ELEVATES (allow_reprint = admin/owner bypass,
	// decided in the service from auth.UserFrom before this UPDATE runs). The
	// WHERE makes two concurrent first prints atomic — exactly one wins, the
	// loser sees execrows==0 and answers 409. printed_at/by record the LAST
	// print, not the first.
	PurchaseOrdersStampPrint(ctx context.Context, arg PurchaseOrdersStampPrintParams) (int64, error)
	RawStockAdd(ctx context.Context, arg RawStockAddParams) error
	ReceivableCSVRows(ctx context.Context) ([]ReceivableCSVRowsRow, error)
	ReleaseStock(ctx context.Context, arg ReleaseStockParams) (int64, error)
	RemoveStoreUser(ctx context.Context, arg RemoveStoreUserParams) (int64, error)
	ReserveStock(ctx context.Context, arg ReserveStockParams) error
	SalesChart(ctx context.Context, arg SalesChartParams) ([]SalesChartRow, error)
	SalesReportBreakdown(ctx context.Context, arg SalesReportBreakdownParams) ([]SalesReportBreakdownRow, error)
	SetDeliveryOrderStatus(ctx context.Context, arg SetDeliveryOrderStatusParams) (int64, error)
	SetGalonLoan(ctx context.Context, arg SetGalonLoanParams) (GalonTransaction, error)
	SetGalonTransactionStatus(ctx context.Context, arg SetGalonTransactionStatusParams) (int64, error)
	// §20 (membership points): write accrued points and optional tier back.
	SetMembershipPoints(ctx context.Context, arg SetMembershipPointsParams) (int64, error)
	SetOpnameItemPhysical(ctx context.Context, arg SetOpnameItemPhysicalParams) (int64, error)
	SetPaymentProofURL(ctx context.Context, arg SetPaymentProofURLParams) (int64, error)
	// VerifyPayment audit write. The payments table has no dedicated review
	// columns (migration-light by design); the reviewer verdict is stamped onto
	// notes with a machine-readable [Verified]/[Rejected] prefix so it survives
	// alongside any human note and is idempotent (re-verify overwrites).
	//
	// sqlcarg(sqlc.arg(verdict)) NAMES the parameter. Left as a bare $2, sqlc
	// derives the field as Arg2 and SetPaymentReviewParams loses its Verdict
	// field, which breaks internal/finance/repository.go:218 at compile time —
	// so the name lives here, in the source of truth, rather than being
	// hand-patched into the generated file (which the next `sqlc generate`
	// silently overwrites, exactly as it did).
	//
	// The ::text casts are what make the generated field a plain `string`.
	// Inside the CASE arms sqlc otherwise infers the nullable pgtype.Text,
	// because notes is nullable, and the repository cannot pass that without a
	// wrapper. The verdict is never NULL by construction — every arm
	// concatenates the argument — so the cast loses nothing.
	SetPaymentReview(ctx context.Context, arg SetPaymentReviewParams) (int64, error)
	SetPaymentVoucherStatus(ctx context.Context, arg SetPaymentVoucherStatusParams) (int64, error)
	SetPurchaseOrderStatus(ctx context.Context, arg SetPurchaseOrderStatusParams) (int64, error)
	SetSOStatus(ctx context.Context, arg SetSOStatusParams) (int64, error)
	SetSalesOrderShift(ctx context.Context, arg SetSalesOrderShiftParams) (int64, error)
	SetSalesOrderStatus(ctx context.Context, arg SetSalesOrderStatusParams) (int64, error)
	SetSalesReturnItemCondition(ctx context.Context, arg SetSalesReturnItemConditionParams) (SalesReturnItem, error)
	SetShiftBinding(ctx context.Context, arg SetShiftBindingParams) (CashierShift, error)
	SetShipmentStatus(ctx context.Context, arg SetShipmentStatusParams) (int64, error)
	// :execrows, not :exec: the row count is the only proof a deactivation landed.
	// internal/system/repository.go SetUserActive refuses to report a write that
	// matched no user row.
	SetUserActive(ctx context.Context, arg SetUserActiveParams) (int64, error)
	// Promotes the users.application_access write off a raw Exec onto the generated
	// layer (:execrows so the row count survives). It must be checked, not merely
	// issued: this column is the shell a user is allowed to enter, and
	// internal/system/repository.go setApplicationAccess rolls the surrounding
	// transaction back when it matches no row.
	SetUserApplicationAccess(ctx context.Context, arg SetUserApplicationAccessParams) (int64, error)
	// Admin password reset (000151): overwrites the hash directly. The caller
	// (partners.Service.ResetCustomerPassword) is the authenticated authority —
	// no current-password check — and MUST revoke the user's bearer tokens
	// afterwards so an existing session cannot outlive the credential change.
	SetUserPassword(ctx context.Context, arg SetUserPasswordParams) (int64, error)
	ShipmentCustomerID(ctx context.Context, id int64) (int64, error)
	ShipmentLatestEvent(ctx context.Context, shipmentID int64) (ShipmentLatestEventRow, error)
	SoftDeleteCustomer(ctx context.Context, id int64) (int64, error)
	SoftDeleteEmployee(ctx context.Context, id int64) (int64, error)
	SoftDeleteProduct(ctx context.Context, id int64) (int64, error)
	SoftDeleteSupplier(ctx context.Context, id int64) (int64, error)
	StockAvailable(ctx context.Context, arg StockAvailableParams) (decimal.Decimal, error)
	StockReportBreakdown(ctx context.Context) ([]StockReportBreakdownRow, error)
	StoreDetailsForUser(ctx context.Context, userID int64) ([]StoreDetailsForUserRow, error)
	StoresForUser(ctx context.Context, userID int64) ([]int64, error)
	SumCashSalesByShift(ctx context.Context, shiftID pgtype.Int8) (decimal.Decimal, error)
	// Buyer payment total in one scan: the customer's invoices joined to their
	// payments (no LEFT-join fan-out, no extra COUNT query — MyPayments returns
	// total from the same round trip).
	SumCustomerPayments(ctx context.Context, arg SumCustomerPaymentsParams) (SumCustomerPaymentsRow, error)
	SumDebts(ctx context.Context, arg SumDebtsParams) (SumDebtsRow, error)
	SumDrawerByShift(ctx context.Context, shiftID int64) ([]SumDrawerByShiftRow, error)
	SumDrawerByShifts(ctx context.Context, dollar_1 []int64) ([]SumDrawerByShiftsRow, error)
	SumMonthPurchase(ctx context.Context, arg SumMonthPurchaseParams) (decimal.Decimal, error)
	SumMonthSales(ctx context.Context, arg SumMonthSalesParams) (decimal.Decimal, error)
	SumNonCashSalesByShift(ctx context.Context, shiftID pgtype.Int8) (decimal.Decimal, error)
	SumPayablesBalance(ctx context.Context) (decimal.Decimal, error)
	SumReceivables(ctx context.Context, arg SumReceivablesParams) (decimal.Decimal, error)
	SumReceivablesBalance(ctx context.Context) (decimal.Decimal, error)
	SumReturnedQtyByOrderItem(ctx context.Context, salesOrderItemID int64) (decimal.Decimal, error)
	// An AGGREGATE, so scoping only the row list would still leak: a sum over
	// unscoped rows is the company's total movement even when no individual row is
	// shown. This is the reason the outlet predicate has to be repeated on every
	// cashflow read rather than added once to the list.
	SummarizeCashflows(ctx context.Context, arg SummarizeCashflowsParams) (SummarizeCashflowsRow, error)
	TouchLastUsed(ctx context.Context, arg TouchLastUsedParams) error
	UpdateAttendance(ctx context.Context, arg UpdateAttendanceParams) (int64, error)
	UpdateBrand(ctx context.Context, arg UpdateBrandParams) (int64, error)
	UpdateBuyerAddress(ctx context.Context, arg UpdateBuyerAddressParams) (BuyerAddress, error)
	UpdateCartItemQuantity(ctx context.Context, arg UpdateCartItemQuantityParams) (int64, error)
	// store_id is returned so the response carries the outlet the row belongs to. A
	// mutation response that omitted it would be a response that cannot be checked
	// against the scope that authorised it.
	UpdateCashflow(ctx context.Context, arg UpdateCashflowParams) (UpdateCashflowRow, error)
	UpdateCategory(ctx context.Context, arg UpdateCategoryParams) (int64, error)
	UpdateCustomer(ctx context.Context, arg UpdateCustomerParams) (int64, error)
	//
	// The same scoping as CustomerProfileForUser: keyed by users.id, never by an
	// id in the path. Every field is COALESCE'd against the current column so an
	// omitted argument (NULL) leaves it alone.
	//
	// COALESCE, not NULLIF, on name as well. An earlier draft used
	// NULLIF(name, '') to make a blank name a no-op; that is indistinguishable
	// from the client omitting the field, so a client that sent only {"website":""}
	// could never clear its own name, and a client that sent {"name":""} got
	// silence instead of an error. A blank company name is rejected in the service
	// instead, where it can be reported.
	UpdateCustomerProfileForUser(ctx context.Context, arg UpdateCustomerProfileForUserParams) (int64, error)
	UpdateDeliveryOrderItemTotals(ctx context.Context, arg UpdateDeliveryOrderItemTotalsParams) (int64, error)
	UpdateDeliveryOrderTotals(ctx context.Context, arg UpdateDeliveryOrderTotalsParams) (int64, error)
	UpdateEmployee(ctx context.Context, arg UpdateEmployeeParams) (int64, error)
	UpdateInvoice(ctx context.Context, arg UpdateInvoiceParams) (int64, error)
	UpdateLastLogin(ctx context.Context, arg UpdateLastLoginParams) error
	UpdateLeave(ctx context.Context, arg UpdateLeaveParams) (int64, error)
	UpdateMembership(ctx context.Context, arg UpdateMembershipParams) (int64, error)
	UpdateMembershipTier(ctx context.Context, arg UpdateMembershipTierParams) (MembershipTier, error)
	UpdateOpnameStatus(ctx context.Context, arg UpdateOpnameStatusParams) (int64, error)
	UpdatePayroll(ctx context.Context, arg UpdatePayrollParams) (int64, error)
	UpdatePerformance(ctx context.Context, arg UpdatePerformanceParams) (int64, error)
	UpdateProduct(ctx context.Context, arg UpdateProductParams) (int64, error)
	UpdateProductUnit(ctx context.Context, arg UpdateProductUnitParams) (int64, error)
	UpdateProfile(ctx context.Context, arg UpdateProfileParams) (int64, error)
	UpdatePurchaseOrder(ctx context.Context, arg UpdatePurchaseOrderParams) (int64, error)
	// Reviewed (po_id set) or rejected; only a pending requisition can move.
	UpdatePurchaseRequisitionReview(ctx context.Context, arg UpdatePurchaseRequisitionReviewParams) (int64, error)
	UpdateRole(ctx context.Context, arg UpdateRoleParams) (int64, error)
	UpdateRolePermissionsRole(ctx context.Context, arg UpdateRolePermissionsRoleParams) (int64, error)
	UpdateSalesOrder(ctx context.Context, arg UpdateSalesOrderParams) (int64, error)
	UpdateSalesOrderNotes(ctx context.Context, arg UpdateSalesOrderNotesParams) (int64, error)
	UpdateSalesStockRow(ctx context.Context, arg UpdateSalesStockRowParams) (int64, error)
	UpdateSalesVisit(ctx context.Context, arg UpdateSalesVisitParams) (int64, error)
	UpdateSalesVoucherStatus(ctx context.Context, arg UpdateSalesVoucherStatusParams) (int64, error)
	UpdateShipmentItemDelivered(ctx context.Context, arg UpdateShipmentItemDeliveredParams) (int64, error)
	UpdateStockRow(ctx context.Context, arg UpdateStockRowParams) (int64, error)
	UpdateStore(ctx context.Context, arg UpdateStoreParams) (UpdateStoreRow, error)
	UpdateSupplier(ctx context.Context, arg UpdateSupplierParams) (int64, error)
	UpdateUnit(ctx context.Context, arg UpdateUnitParams) (int64, error)
	UpdateUser(ctx context.Context, arg UpdateUserParams) (UpdateUserRow, error)
	UpdateUsersRole(ctx context.Context, arg UpdateUsersRoleParams) (int64, error)
	UpdateVoucher(ctx context.Context, arg UpdateVoucherParams) (int64, error)
	UpdateVoucherStatus(ctx context.Context, arg UpdateVoucherStatusParams) (int64, error)
	UpdateVoucherStatusAny(ctx context.Context, arg UpdateVoucherStatusAnyParams) (int64, error)
	UpdateWarehouse(ctx context.Context, arg UpdateWarehouseParams) (int64, error)
	UpsertAppSetting(ctx context.Context, arg UpsertAppSettingParams) error
	// Email verification (000152): a resend replaces the code and resets the
	// attempt counter (one row per email+purpose, PK enforces it).
	UpsertEmailVerificationCode(ctx context.Context, arg UpsertEmailVerificationCodeParams) error
	UpsertLeaveAttendance(ctx context.Context, arg UpsertLeaveAttendanceParams) error
	UpsertPasswordResetToken(ctx context.Context, arg UpsertPasswordResetTokenParams) error
	UpsertPayroll(ctx context.Context, arg UpsertPayrollParams) (UpsertPayrollRow, error)
	UpsertRolePermission(ctx context.Context, arg UpsertRolePermissionParams) error
	UserByResetToken(ctx context.Context, token string) (User, error)
	UserInStores(ctx context.Context, arg UserInStoresParams) (bool, error)
	WarehouseForStore(ctx context.Context, id int64) (int64, error)
	// True when the warehouse cannot simply be deleted: stock on hand or any
	// transactional footprint. Callers deactivate instead, which hides it from
	// pickers while keeping history intact.
	WarehouseHasInventory(ctx context.Context, warehouseID int64) (bool, error)
	// TRUE while an opname for this warehouse is still open. The ERP's
	// "Terbitkan & Kunci Stok" freeze is only real if movements consult this.
	WarehouseStockFrozen(ctx context.Context, warehouseID int64) (bool, error)
	WarehousesForStores(ctx context.Context, dollar_1 []int64) ([]int64, error)
}

var _ Querier = (*Queries)(nil)
