Documentation
¶
Index ¶
- Constants
- Variables
- type AcknowledgeSecurityAlertsParams
- type AddBatchItemParams
- type AddCashboxAccountBalanceParams
- type AddClientLoyaltyPointsParams
- type AddInventoryStockQuantityParams
- type AddInvoiceDiscountBranchParams
- type AddInvoiceProductParams
- type AddProductSaleOptionsForEntriesParams
- type AddPurchaseItemParams
- type AddPurchasedProductCostParams
- type AddPurchasedProductParams
- type AddStockCountItemParams
- type AddVariantTxParams
- type AddWhatsAppChatMessageParams
- type AddWhatsAppPollReplyParams
- type AdjustBatchItemRemainingQuantityParams
- type AdminActivity
- type AdoptSalespersonAttendanceIDParams
- type AppRelease
- type AppSetting
- type AppUpdateEvent
- type ApplyBranchSettlementTxParams
- type ApplyBranchSettlementTxResult
- type ApplyWhatsAppBridgeTickParams
- type ApplyWhatsAppBridgeTickRow
- type ApplyWhatsAppDeliveryStatusParams
- type Asset
- type AssetCategory
- type AttachWhatsAppPollParams
- type Attribute
- type AttributesValue
- type AuditAction
- type AuditLog
- type Batch
- type BatchItem
- type BatchSetClientPhoneFlagsParams
- type BatchUpdateClientPhonesParams
- type Branch
- type BranchAttendanceChange
- type BranchAttendanceChangeRefsPresentParams
- type BranchAttendanceEvent
- type BranchAttendanceEventRefsPresentParams
- type BranchCashboxAccount
- type BranchClientLinksPresentParams
- type BranchCommand
- type BranchCommandSummaryRow
- type BranchExpense
- type BranchExpenseImage
- type BranchExpenseRefsPresentParams
- type BranchExpenseUploadToken
- type BranchInvoice
- type BranchInvoiceItem
- type BranchInvoiceItemParams
- type BranchInvoicePayment
- type BranchInvoicePaymentParams
- type BranchInvoiceRefsPresentParams
- type BranchInvoiceSettlement
- type BranchInvoiceSettlementPayment
- type BranchLoanRefsPresentParams
- type BranchQuickAccessItem
- type BranchRegister
- type BranchSalespersonExistsParams
- type BranchSetting
- type BranchShift
- type BranchShiftIsClosedParams
- type BranchShiftReceiptImage
- type BranchShiftRefsPresentParams
- type BranchShiftUploadToken
- type BranchSyncConflict
- type BranchSyncConflictSummaryRow
- type BranchTarget
- type BranchTargetSeries
- type BranchTransferItemParams
- type BranchTransferUploadToken
- type BranchUser
- type BranchVisitorEvent
- type BranchVisitorEventRefsPresentParams
- type BulkSetDiscountListItemsParams
- type BulkSetDiscountListOptionItemsParams
- type BumpAdminActivityParams
- type BusyHoursSalesParams
- type BusyHoursSalesRow
- type BusyHoursVisitorsParams
- type BusyHoursVisitorsRow
- type CalendarEvent
- type Cashbox
- type CashboxAccount
- type ClaimEmailScheduleRunParams
- type ClaimWhatsAppPollFollowupParams
- type ClaimWhatsAppPollFollowupRow
- type ClaimWhatsAppWelcomeParams
- type Client
- type ClientLink
- type ClientMonthlySpendRow
- type ClientPaymentMixRow
- type ClientProfileStats
- type ClientRecentInvoiceRow
- type ClientSpend
- type Color
- type CompleteBranchCommandParams
- type ConfirmBranchTransferItemParams
- type ConfirmBranchTransferTxParams
- type CountAssetsParams
- type CountAttributeValuesParams
- type CountAuditLogsParams
- type CountBranchCommandsParams
- type CountBranchExpensesParams
- type CountBranchInvoicesFilteredParams
- type CountBranchSyncConflictsParams
- type CountBranchVisitorDayByDirectionParams
- type CountClientsBySpendingCachedParams
- type CountClientsBySpendingParams
- type CountCouponsParams
- type CountDashboardExpensesParams
- type CountDashboardPurchasesParams
- type CountDashboardSalesParams
- type CountDiscountListItemsWithProductParams
- type CountDiscountListRuleDecidedRow
- type CountEmployeesParams
- type CountExpensesParams
- type CountInventoryStockParams
- type CountLatestAdditionsSinceParams
- type CountLoanPaymentsParams
- type CountLoansParams
- type CountLowStockProductsParams
- type CountPriceListItemsWithProductParams
- type CountShiftsParams
- type CountSlowMovingProductsParams
- type CountStockCountsParams
- type CountStockMovementsParams
- type CountVisitorIPsParams
- type CountWhatsAppMessagesParams
- type CountWhatsAppRepliesParams
- type Coupon
- type CouponCategory
- type CouponList
- type CouponStatus
- type CouponType
- type CreateAdminActivityParams
- type CreateAppReleaseParams
- type CreateAppUpdateEventParams
- type CreateAssetCategoryParams
- type CreateAssetParams
- type CreateAuditLogParams
- type CreateBatchParams
- type CreateBatchTxParams
- type CreateBatchTxResult
- type CreateBranchAttendanceChangeParams
- type CreateBranchAttendanceEventParams
- type CreateBranchCommandParams
- type CreateBranchExpenseImageParams
- type CreateBranchExpenseParams
- type CreateBranchExpenseUploadTokenParams
- type CreateBranchInvoiceItemParams
- type CreateBranchInvoiceParams
- type CreateBranchInvoicePaymentParams
- type CreateBranchInvoiceSettlementParams
- type CreateBranchInvoiceSettlementPaymentParams
- type CreateBranchInvoiceTxParams
- type CreateBranchInvoiceTxResult
- type CreateBranchLoanParams
- type CreateBranchParams
- type CreateBranchRegisterParams
- type CreateBranchSalespersonParams
- type CreateBranchShiftParams
- type CreateBranchShiftReceiptImageParams
- type CreateBranchShiftUploadTokenParams
- type CreateBranchTargetParams
- type CreateBranchTargetSeriesParams
- type CreateBranchTransferRequestParams
- type CreateBranchTransferRequestTxParams
- type CreateBranchTransferRequestTxResult
- type CreateBranchTransferUploadTokenParams
- type CreateBranchTxParams
- type CreateBranchTxResult
- type CreateBranchUserParams
- type CreateBranchVisitorEventParams
- type CreateCalendarEventParams
- type CreateCashboxAccountParams
- type CreateCashboxParams
- type CreateCentralLoanParams
- type CreateClientParams
- type CreateClientWithUIDParams
- type CreateColorParams
- type CreateCouponCategoryParams
- type CreateCouponListParams
- type CreateCouponParams
- type CreateCouponTypeParams
- type CreateCurrencyParams
- type CreateDealParams
- type CreateDiscountListItemParams
- type CreateDiscountListParams
- type CreateDiscountListRuleGroupParams
- type CreateDiscountListRuleOptionParams
- type CreateDiscountListRuleParams
- type CreateEmailReportParams
- type CreateEmailScheduleParams
- type CreateEmployeeParams
- type CreateEntryItemParams
- type CreateExpenseCategoryParams
- type CreateExpenseParams
- type CreateGeneratedBranchTargetParams
- type CreateGooglePlaceSnapshotParams
- type CreateInventoryParams
- type CreateInvoiceDiscountParams
- type CreateInvoiceParams
- type CreateInvoicePaymentParams
- type CreateInvoiceTypeParams
- type CreateListCouponParams
- type CreateLoanCategoryParams
- type CreateLoanImageParams
- type CreateLoanPaymentParams
- type CreateLoanUploadTokenParams
- type CreatePriceListItemParams
- type CreatePriceListParams
- type CreateProductAttributeParams
- type CreateProductCategoryParams
- type CreateProductParams
- type CreateProductTxParams
- type CreateProductTxResult
- type CreateProductVariantParams
- type CreatePurchaseParams
- type CreatePurchaseTxParams
- type CreatePurchaseTxResult
- type CreateRecurringExpenseParams
- type CreateResolvedBranchInvoiceItemParams
- type CreateReturnInvoiceParams
- type CreateReviewLinkClickParams
- type CreateSaleOptionParams
- type CreateSalespersonParams
- type CreateSessionParams
- type CreateSizeParams
- type CreateStockCountParams
- type CreateStockMovementParams
- type CreateSupplierParams
- type CreateTransferItemParams
- type CreateTransferParams
- type CreateTransferTxParams
- type CreateTransferTxResult
- type CreateUnknownItemImageParams
- type CreateUnknownItemSessionParams
- type CreateUnknownItemSlotParams
- type CreateUserParams
- type CreateWhatsAppMessageParams
- type CreateWhatsAppNumberParams
- type CreateWhatsAppReplyParams
- type CreateWhatsAppRuleParams
- type Currency
- type DBTX
- type DashboardActivitiesListParams
- type DashboardActivitiesListRow
- type DashboardAdminExpenseSeriesParams
- type DashboardAdminExpenseSeriesRow
- type DashboardAdminExpensesTotalParams
- type DashboardAdminNewClientsParams
- type DashboardAdminRevenueSeriesParams
- type DashboardAdminRevenueSeriesRow
- type DashboardAdminSummaryParams
- type DashboardAdminSummaryRow
- type DashboardBranchExpenseSeriesParams
- type DashboardBranchExpenseSeriesRow
- type DashboardBranchExpensesTotalParams
- type DashboardBranchNewClientsParams
- type DashboardBranchRevenueSeriesParams
- type DashboardBranchRevenueSeriesRow
- type DashboardBranchSummaryParams
- type DashboardBranchSummaryRow
- type DashboardDueLoansParams
- type DashboardExpensesListParams
- type DashboardExpensesListRow
- type DashboardPurchaseSeriesParams
- type DashboardPurchaseSeriesRow
- type DashboardPurchasesListParams
- type DashboardPurchasesListRow
- type DashboardPurchasesTotalParams
- type DashboardSalesListParams
- type DashboardSalesListRow
- type DashboardTargetListParams
- type DashboardTargetListRow
- type DashboardTopDueLoansParams
- type DashboardTopDueLoansRow
- type Deal
- type DecrementInvoicesIndexParams
- type DefaultBranchSetting
- type DeleteCashboxAccountOverrideParams
- type DeleteDiscountListItemParams
- type DeleteDiscountListItemsParams
- type DeleteDiscountListOptionItemParams
- type DeleteDiscountListOptionItemsParams
- type DeleteDiscountListRuleGroupsExceptParams
- type DeleteDiscountListRulesExceptParams
- type DeleteFailedWhatsAppMessagesForInvoiceParams
- type DeletePriceListItemParams
- type DeletePriceListItemsParams
- type DeletePurchaseItemParams
- type DeleteTransferItemParams
- type DeleteUnknownItemSlotsNotInParams
- type DiscountList
- type DiscountListBranch
- type DiscountListBranchRemoval
- type DiscountListItem
- type DiscountListOptionItem
- type DiscountListRule
- type DiscountListRuleGroup
- type DiscountListRuleGroupInput
- type DiscountListRuleInput
- type DiscountListRuleOption
- type DiscountRuleFact
- type DiscountRulesDirty
- type EmailReport
- type EmailSchedule
- type Employee
- type Entry
- type EntryReferenceType
- type Expense
- type ExpenseCategory
- type FindUnknownInvoiceItemParams
- type GetAssetTreemapDataRow
- type GetBatchItemByBatchVariantParams
- type GetBatchRow
- type GetBranchAttendanceChangeByClientRefParams
- type GetBranchAttendanceEventByClientRefParams
- type GetBranchByCodeExcludingParams
- type GetBranchExpenseByClientRefParams
- type GetBranchInvoiceByClientRefParams
- type GetBranchInvoiceByCodeParams
- type GetBranchInvoiceSettlementByClientRefParams
- type GetBranchLoanByClientRefParams
- type GetBranchShiftByClientRefParams
- type GetBranchTargetBySeriesAndStartParams
- type GetBranchTransferByClientRefParams
- type GetBranchVisitorEventByClientRefParams
- type GetCashboxAccountBalanceParams
- type GetClientLinkParams
- type GetEmailSettingsRow
- type GetFirstActiveVariantBarcodeByCodeRow
- type GetInventoryStockParams
- type GetLowStockSummaryRow
- type GetProductAttributeValueParams
- type GetProductSupplierParams
- type GetPurchaseRow
- type GetRegisterTargetReleaseRow
- type GetReviewSettingsRow
- type GetSalespersonByAttendanceIDParams
- type GetSlowMoverSummaryRow
- type GetStockHealthOverviewRow
- type GetUnknownItemSessionByRefParams
- type GetUnknownItemSlotByRefParams
- type GetUnknownItemSlotForResolveRow
- type GetUserAccessRow
- type GetVariantDiscountFromListParams
- type GetVariantForLabelRow
- type GetVariantPriceFromListParams
- type GetWarehouseTreemapDataRow
- type GetWhatsAppChatMessageMediaRow
- type GetWhatsAppMessageByReviewCodeRow
- type GetWhatsAppMessageWithBranchRow
- type GetWhatsAppPollReplyMediaRow
- type GetWhatsAppSenderSettingsRow
- type GetWhatsAppSettingsRow
- type GooglePlaceSnapshot
- type GooglePlaceSnapshotBeforeParams
- type GoogleReview
- type HomeActivityFeedParams
- type HomeActivityFeedRow
- type HomeActivityResolution
- type IncrementInvoicesIndexParams
- type IndexType
- type InsertBranchQuickAccessItemParams
- type InventoriesAsset
- type Inventory
- type InventoryStock
- type InventoryType
- type Invoice
- type InvoiceDiscount
- type InvoiceDiscountBranch
- type InvoiceIndex
- type InvoicePayment
- type InvoiceProduct
- type InvoiceType
- type IpBan
- type LinkUnknownItemSessionParams
- type ListAdminActivitiesParams
- type ListAdminActivitiesRow
- type ListAllAttributeValuesRow
- type ListAllClientPhonesRow
- type ListAppReleasesRow
- type ListAppUpdateEventsRow
- type ListAssetsPageParams
- type ListAttributeValuesPageParams
- type ListAttributeValuesPageRow
- type ListAuditLogsParams
- type ListAuditLogsRow
- type ListAutoDeletableUnknownItemImagesParams
- type ListAutoDeletableUnknownItemImagesRow
- type ListBatchItemsStatsRow
- type ListBatchesParams
- type ListBatchesRow
- type ListBranchAttendanceChangesParams
- type ListBranchAttendanceEventsInRangeParams
- type ListBranchAttendanceEventsParams
- type ListBranchClientUIDsRow
- type ListBranchCommandsPageParams
- type ListBranchCommandsPageRow
- type ListBranchCommandsParams
- type ListBranchCommandsRow
- type ListBranchExpenseHistoryForSyncParams
- type ListBranchExpenseHistoryForSyncRow
- type ListBranchExpenseImagesParams
- type ListBranchExpenseImagesRow
- type ListBranchExpensesParams
- type ListBranchInvoiceCouponCodesForHistoryParams
- type ListBranchInvoiceCouponCodesForHistoryRow
- type ListBranchInvoiceHistoryForSyncParams
- type ListBranchInvoiceItemsForHistoryRow
- type ListBranchInvoiceItemsNamedRow
- type ListBranchInvoiceItemsRow
- type ListBranchInvoiceSettlementsParams
- type ListBranchInvoicesPageParams
- type ListBranchInvoicesParams
- type ListBranchLoanHistoryForSyncParams
- type ListBranchLoanHistoryForSyncRow
- type ListBranchPlaceIDsRow
- type ListBranchProductRevenueDailyParams
- type ListBranchProductRevenueDailyRow
- type ListBranchProductRevenueParams
- type ListBranchProductRevenueRow
- type ListBranchQuickAccessItemsRow
- type ListBranchRevenueByBranchParams
- type ListBranchRevenueByBranchRow
- type ListBranchSalesDaysRangeParams
- type ListBranchSalesDaysRangeRow
- type ListBranchShiftHistoryForSyncParams
- type ListBranchShiftReceiptImagesParams
- type ListBranchShiftReceiptImagesRow
- type ListBranchShiftsParams
- type ListBranchShiftsRow
- type ListBranchStockForSyncParams
- type ListBranchStockForSyncRow
- type ListBranchSyncConflictsPageParams
- type ListBranchSyncConflictsPageRow
- type ListBranchTargetsProgressParams
- type ListBranchTargetsProgressRow
- type ListBranchTargetsUpdatedSinceParams
- type ListBranchTransfersUpdatedSinceParams
- type ListBranchUsersUpdatedSinceParams
- type ListBranchVisitorDaysParams
- type ListBranchVisitorDaysRangeParams
- type ListBranchVisitorDaysRangeRow
- type ListBranchVisitorDaysRow
- type ListBranchWhatsAppNumbersRow
- type ListBranchesForDiscountListRow
- type ListBranchesForPriceListRow
- type ListBranchesForSyncRow
- type ListCashboxAccountOverridesForBranchRow
- type ListCashboxAccountsForBranchSyncRow
- type ListCashboxAccountsParams
- type ListCashboxesParams
- type ListClientPhoneCountriesRow
- type ListClientSyncIDsParams
- type ListClientSyncIDsRow
- type ListClientsByInvoiceCountCachedParams
- type ListClientsByInvoiceCountCachedRow
- type ListClientsByItemCountCachedParams
- type ListClientsByItemCountCachedRow
- type ListClientsBySpendingCachedParams
- type ListClientsBySpendingCachedRow
- type ListClientsBySpendingParams
- type ListClientsBySpendingRow
- type ListClientsForExportParams
- type ListClientsForExportRow
- type ListClientsMissingPhoneCountryRow
- type ListClientsParams
- type ListClientsUpdatedSincePagedParams
- type ListClientsWithLoyaltyParams
- type ListClientsWithLoyaltyRow
- type ListColorsPageParams
- type ListCouponListsRow
- type ListCouponsParams
- type ListCouponsRow
- type ListCurrenciesParams
- type ListDailyIncomeParams
- type ListDailyIncomeRow
- type ListDayBranchExpensesParams
- type ListDayBranchExpensesRow
- type ListDayBranchShiftsParams
- type ListDayBranchShiftsRow
- type ListDayInvoicesParams
- type ListDayInvoicesRow
- type ListDayPaymentsByAccountParams
- type ListDayPaymentsByAccountRow
- type ListDaySalesByBranchParams
- type ListDaySalesByBranchRow
- type ListDaySalesByHourParams
- type ListDaySalesByHourRow
- type ListDaySalesBySalespersonParams
- type ListDaySalesBySalespersonRow
- type ListDayTopProductsParams
- type ListDayTopProductsRow
- type ListDayVisitorsByHourParams
- type ListDayVisitorsByHourRow
- type ListDealsRow
- type ListDeletableUnknownItemImagesRow
- type ListDiscountListItemsForSyncRow
- type ListDiscountListItemsWithProductParams
- type ListDiscountListItemsWithProductRow
- type ListDiscountListOptionItemsForSyncRow
- type ListDiscountListRuleOptionsRow
- type ListDiscountListRulesRow
- type ListDiscountListsForBranchSyncParams
- type ListDiscountListsParams
- type ListDiscountListsRemovedFromBranchParams
- type ListDiscountListsRemovedFromBranchRow
- type ListEmailReportInvoicesParams
- type ListEmailReportInvoicesRow
- type ListEmailReportRecipientsRow
- type ListEmailReportRegistersRow
- type ListEmailReportShiftInvoicesRow
- type ListEmailReportShiftsParams
- type ListEmailReportShiftsRow
- type ListEmailReportsParams
- type ListEmployeesParams
- type ListEntriesParams
- type ListExpensesParams
- type ListGooglePlaceSnapshotsParams
- type ListGoogleReviewsParams
- type ListHomeActivityResolutionsParams
- type ListHomeActivityResolutionsRow
- type ListIgnoredLowStockProductsParams
- type ListIgnoredLowStockProductsRow
- type ListIncomingBranchTransfersUpdatedSinceParams
- type ListInventoriesParams
- type ListInventoryStockParams
- type ListInventoryStockRow
- type ListInvoiceDiscountsForBranchSyncParams
- type ListInvoiceDiscountsForBranchSyncRow
- type ListInvoicePaymentsByInvoiceRow
- type ListInvoiceProductsByInvoiceRow
- type ListInvoicesPageParams
- type ListInvoicesParams
- type ListLatestAdditionsParams
- type ListLatestAdditionsRow
- type ListLoanPaymentsParams
- type ListLoansParams
- type ListLoansRow
- type ListLowStockProductsParams
- type ListLowStockProductsRow
- type ListPriceListItemsForSyncRow
- type ListPriceListItemsWithProductParams
- type ListPriceListItemsWithProductRow
- type ListPriceListsForBranchSyncParams
- type ListPriceListsParams
- type ListPriceListsRemovedFromBranchParams
- type ListPriceListsRemovedFromBranchRow
- type ListProductAttributesParams
- type ListProductRevenueDailyParams
- type ListProductRevenueDailyRow
- type ListProductRevenueParams
- type ListProductRevenueRow
- type ListProductSaleOptionNamesRow
- type ListProductVariantIDsByUIDsRow
- type ListProductVariantsForSyncByUIDsRow
- type ListProductVariantsForSyncPagedParams
- type ListProductVariantsForSyncPagedRow
- type ListProductVariantsForSyncRow
- type ListProductVariantsParams
- type ListProductVariantsRow
- type ListProductsParams
- type ListProductsRow
- type ListPurchaseItemsRow
- type ListPurchasesParams
- type ListPurchasesRow
- type ListRegisterUpdateStatusesRow
- type ListRolesRow
- type ListSaleMovementsForInvoiceVariantParams
- type ListSaleMovementsForInvoiceVariantRow
- type ListSalespersonsParams
- type ListSalespersonsUpdatedSinceParams
- type ListSecurityAlertsParams
- type ListShiftsParams
- type ListShiftsRow
- type ListSizesPageParams
- type ListSlowMovingProductsParams
- type ListSlowMovingProductsRow
- type ListStockCountItemsRow
- type ListStockCountsParams
- type ListStockCountsRow
- type ListStockHealthByInventoryParams
- type ListStockHealthByInventoryRow
- type ListStockMovementsParams
- type ListStockMovementsRow
- type ListSuppliersParams
- type ListTransferAttachmentsParams
- type ListTransferAttachmentsRow
- type ListTransferItemsRow
- type ListTransfersParams
- type ListTransfersRow
- type ListUnknownItemImagesParams
- type ListUnknownItemImagesRow
- type ListUnknownItemsParams
- type ListUnknownItemsRow
- type ListUnresolvedUrgentHomeActivitiesRow
- type ListUsersParams
- type ListVariantSyncIDsParams
- type ListVariantSyncIDsRow
- type ListVariantsForBarcodesParams
- type ListVariantsForBarcodesRow
- type ListVariantsForDiscountEntryRow
- type ListVisitorIPsParams
- type ListWaitingUnknownItemsRow
- type ListWhatsAppChatMessagesParams
- type ListWhatsAppChatMessagesRow
- type ListWhatsAppChatsParams
- type ListWhatsAppChatsRow
- type ListWhatsAppMessageRepliesRow
- type ListWhatsAppMessagesParams
- type ListWhatsAppMessagesRow
- type ListWhatsAppRepliesParams
- type ListWhatsAppRepliesRow
- type Loan
- type LoanCategory
- type LoanImage
- type LoanPayment
- type LoanUploadToken
- type LowPollRatingsParams
- type LowPollRatingsRow
- type LoyaltyMonthlyJoinsRow
- type LoyaltyRisingClientsParams
- type LoyaltyRisingClientsRow
- type LoyaltyTierStatsParams
- type LoyaltyTierStatsRow
- type MarkBranchAttendanceEventRemovedParams
- type MarkBranchInvoicesCancelledParams
- type MarkUnknownItemSlotResolvedParams
- type NullAuditAction
- type NullCouponStatus
- type NullEntryReferenceType
- type NullIndexType
- type NullInventoryType
- type NullPurchaseStatus
- type NullStockCountStatus
- type NullStockMovementReason
- type NullTransferStatus
- type NullTransferType
- type OversoldPayload
- type Permission
- type PollRatingTotalsParams
- type PollRatingTotalsRow
- type PollRatingsByBranchParams
- type PollRatingsByBranchRow
- type PollRatingsByDayParams
- type PollRatingsByDayRow
- type PollRepliesParams
- type PollRepliesRow
- type PostStockCountTxResult
- type PriceList
- type PriceListBranch
- type PriceListBranchRemoval
- type PriceListItem
- type Product
- type ProductCategory
- type ProductSaleOption
- type ProductSupplier
- type ProductSupplierCost
- type ProductVariant
- type ProductsAttribute
- type Purchase
- type PurchaseItem
- type PurchaseItemParams
- type PurchaseReceiveTxParams
- type PurchaseReceiveTxResult
- type PurchaseStatus
- type Querier
- type Queries
- func (q *Queries) AcknowledgeSecurityAlerts(ctx context.Context, arg AcknowledgeSecurityAlertsParams) error
- func (q *Queries) ActiveDiscountListForBranch(ctx context.Context, branchID int64) (DiscountList, error)
- func (q *Queries) AddBatchItem(ctx context.Context, arg AddBatchItemParams) (BatchItem, error)
- func (q *Queries) AddCashboxAccountBalance(ctx context.Context, arg AddCashboxAccountBalanceParams) (ShiftsAccountsBalance, error)
- func (q *Queries) AddClientLoyaltyPoints(ctx context.Context, arg AddClientLoyaltyPointsParams) error
- func (q *Queries) AddInventoryStockQuantity(ctx context.Context, arg AddInventoryStockQuantityParams) (InventoryStock, error)
- func (q *Queries) AddInvoiceDiscountBranch(ctx context.Context, arg AddInvoiceDiscountBranchParams) error
- func (q *Queries) AddInvoiceProduct(ctx context.Context, arg AddInvoiceProductParams) (InvoiceProduct, error)
- func (q *Queries) AddProductSaleOptionsForEntries(ctx context.Context, arg AddProductSaleOptionsForEntriesParams) ([]int64, error)
- func (q *Queries) AddPurchaseItem(ctx context.Context, arg AddPurchaseItemParams) (PurchaseItem, error)
- func (q *Queries) AddPurchasedProduct(ctx context.Context, arg AddPurchasedProductParams) (ProductSupplier, error)
- func (q *Queries) AddPurchasedProductCost(ctx context.Context, arg AddPurchasedProductCostParams) (ProductSupplierCost, error)
- func (q *Queries) AddStockCountItem(ctx context.Context, arg AddStockCountItemParams) (StockCountItem, error)
- func (q *Queries) AddWhatsAppChatMessage(ctx context.Context, arg AddWhatsAppChatMessageParams) (int64, error)
- func (q *Queries) AddWhatsAppPollReply(ctx context.Context, arg AddWhatsAppPollReplyParams) (int64, error)
- func (q *Queries) AdjustBatchItemRemainingQuantity(ctx context.Context, arg AdjustBatchItemRemainingQuantityParams) (BatchItem, error)
- func (q *Queries) AdoptSalespersonAttendanceID(ctx context.Context, arg AdoptSalespersonAttendanceIDParams) error
- func (q *Queries) ApplyWhatsAppBridgeTick(ctx context.Context, arg ApplyWhatsAppBridgeTickParams) (ApplyWhatsAppBridgeTickRow, error)
- func (q *Queries) ApplyWhatsAppDeliveryStatus(ctx context.Context, arg ApplyWhatsAppDeliveryStatusParams) ([]int64, error)
- func (q *Queries) AttachWhatsAppPoll(ctx context.Context, arg AttachWhatsAppPollParams) error
- func (q *Queries) BatchSetClientPhoneFlags(ctx context.Context, arg BatchSetClientPhoneFlagsParams) error
- func (q *Queries) BatchUpdateClientPhones(ctx context.Context, arg BatchUpdateClientPhonesParams) error
- func (q *Queries) BranchAttendanceChangeRefsPresent(ctx context.Context, arg BranchAttendanceChangeRefsPresentParams) ([]string, error)
- func (q *Queries) BranchAttendanceEventRefsPresent(ctx context.Context, arg BranchAttendanceEventRefsPresentParams) ([]string, error)
- func (q *Queries) BranchClientLinksPresent(ctx context.Context, arg BranchClientLinksPresentParams) ([]int64, error)
- func (q *Queries) BranchCommandSummary(ctx context.Context) ([]BranchCommandSummaryRow, error)
- func (q *Queries) BranchExpenseRefsPresent(ctx context.Context, arg BranchExpenseRefsPresentParams) ([]string, error)
- func (q *Queries) BranchInvoiceRefsPresent(ctx context.Context, arg BranchInvoiceRefsPresentParams) ([]string, error)
- func (q *Queries) BranchInvoicesReferenceClient(ctx context.Context, id int64) (bool, error)
- func (q *Queries) BranchInvoicesReferenceVariant(ctx context.Context, id int64) (bool, error)
- func (q *Queries) BranchLoanRefsPresent(ctx context.Context, arg BranchLoanRefsPresentParams) ([]sql.NullString, error)
- func (q *Queries) BranchSalespersonExists(ctx context.Context, arg BranchSalespersonExistsParams) (bool, error)
- func (q *Queries) BranchShiftIsClosed(ctx context.Context, arg BranchShiftIsClosedParams) (bool, error)
- func (q *Queries) BranchShiftRefsPresent(ctx context.Context, arg BranchShiftRefsPresentParams) ([]string, error)
- func (q *Queries) BranchSyncConflictSummary(ctx context.Context) ([]BranchSyncConflictSummaryRow, error)
- func (q *Queries) BranchVisitorEventRefsPresent(ctx context.Context, arg BranchVisitorEventRefsPresentParams) ([]string, error)
- func (q *Queries) BulkSetDiscountListItems(ctx context.Context, arg BulkSetDiscountListItemsParams) ([]int64, error)
- func (q *Queries) BulkSetDiscountListOptionItems(ctx context.Context, arg BulkSetDiscountListOptionItemsParams) ([]int64, error)
- func (q *Queries) BumpAdminActivity(ctx context.Context, arg BumpAdminActivityParams) (int64, error)
- func (q *Queries) BusyHoursSales(ctx context.Context, arg BusyHoursSalesParams) ([]BusyHoursSalesRow, error)
- func (q *Queries) BusyHoursVisitors(ctx context.Context, arg BusyHoursVisitorsParams) ([]BusyHoursVisitorsRow, error)
- func (q *Queries) CancelBranchCommand(ctx context.Context, id int64) (BranchCommand, error)
- func (q *Queries) CancelBranchExpense(ctx context.Context, id int64) (BranchExpense, error)
- func (q *Queries) CancelBranchLoan(ctx context.Context, id int64) (Loan, error)
- func (q *Queries) ClaimBranchQuickAccessInit(ctx context.Context, id int64) (int64, error)
- func (q *Queries) ClaimEmailScheduleRun(ctx context.Context, arg ClaimEmailScheduleRunParams) (int64, error)
- func (q *Queries) ClaimWhatsAppPollFollowup(ctx context.Context, arg ClaimWhatsAppPollFollowupParams) (ClaimWhatsAppPollFollowupRow, error)
- func (q *Queries) ClaimWhatsAppWelcome(ctx context.Context, arg ClaimWhatsAppWelcomeParams) (int64, error)
- func (q *Queries) ClearDefaultWhatsAppNumber(ctx context.Context) error
- func (q *Queries) ClearProductSaleOptionsForEntries(ctx context.Context, entries []string) error
- func (q *Queries) ClientPhonesPresent(ctx context.Context, dollar_1 []string) ([]string, error)
- func (q *Queries) CloseShift(ctx context.Context, id int64) error
- func (q *Queries) CompleteBranchCommand(ctx context.Context, arg CompleteBranchCommandParams) (BranchCommand, error)
- func (q *Queries) CountAdminActivitiesSince(ctx context.Context, since time.Time) (int64, error)
- func (q *Queries) CountAssets(ctx context.Context, arg CountAssetsParams) (int64, error)
- func (q *Queries) CountAttributeValues(ctx context.Context, arg CountAttributeValuesParams) (int64, error)
- func (q *Queries) CountAuditLogs(ctx context.Context, arg CountAuditLogsParams) (int64, error)
- func (q *Queries) CountBatchesFiltered(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountBranchAttendanceChanges(ctx context.Context, branchID sql.NullInt64) (int64, error)
- func (q *Queries) CountBranchAttendanceEvents(ctx context.Context, branchID sql.NullInt64) (int64, error)
- func (q *Queries) CountBranchCommands(ctx context.Context, arg CountBranchCommandsParams) (int64, error)
- func (q *Queries) CountBranchExpenseImages(ctx context.Context) (int64, error)
- func (q *Queries) CountBranchExpenseImagesForExpense(ctx context.Context, branchExpenseID int64) (int64, error)
- func (q *Queries) CountBranchExpenses(ctx context.Context, arg CountBranchExpensesParams) (int64, error)
- func (q *Queries) CountBranchInvoiceSettlements(ctx context.Context, branchID sql.NullInt64) (int64, error)
- func (q *Queries) CountBranchInvoices(ctx context.Context, branchID sql.NullInt64) (int64, error)
- func (q *Queries) CountBranchInvoicesFiltered(ctx context.Context, arg CountBranchInvoicesFilteredParams) (int64, error)
- func (q *Queries) CountBranchShiftReceiptImages(ctx context.Context) (int64, error)
- func (q *Queries) CountBranchShifts(ctx context.Context, branchID sql.NullInt64) (int64, error)
- func (q *Queries) CountBranchSyncConflicts(ctx context.Context, arg CountBranchSyncConflictsParams) (int64, error)
- func (q *Queries) CountBranchVisitorDayByDirection(ctx context.Context, arg CountBranchVisitorDayByDirectionParams) (int64, error)
- func (q *Queries) CountBranchVisitorDays(ctx context.Context, branchID sql.NullInt64) (int64, error)
- func (q *Queries) CountBranchesOnDefaultDiscountList(ctx context.Context) (int64, error)
- func (q *Queries) CountCashboxAccountOverrides(ctx context.Context, cashboxAccountID int64) (int64, error)
- func (q *Queries) CountClients(ctx context.Context, clientType sql.NullString) (int64, error)
- func (q *Queries) CountClientsBySpending(ctx context.Context, arg CountClientsBySpendingParams) (int64, error)
- func (q *Queries) CountClientsBySpendingCached(ctx context.Context, arg CountClientsBySpendingCachedParams) (int64, error)
- func (q *Queries) CountColors(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountCoupons(ctx context.Context, arg CountCouponsParams) (int64, error)
- func (q *Queries) CountCouponsByTypeID(ctx context.Context, typeID sql.NullInt64) (int64, error)
- func (q *Queries) CountCurrencies(ctx context.Context) (int64, error)
- func (q *Queries) CountCurrencyUsage(ctx context.Context, code string) (int32, error)
- func (q *Queries) CountDashboardExpenses(ctx context.Context, arg CountDashboardExpensesParams) (int64, error)
- func (q *Queries) CountDashboardPurchases(ctx context.Context, arg CountDashboardPurchasesParams) (int64, error)
- func (q *Queries) CountDashboardSales(ctx context.Context, arg CountDashboardSalesParams) (int64, error)
- func (q *Queries) CountDiscountListItemsWithProduct(ctx context.Context, arg CountDiscountListItemsWithProductParams) (int64, error)
- func (q *Queries) CountDiscountListRuleDecided(ctx context.Context, discountListID int64) ([]CountDiscountListRuleDecidedRow, error)
- func (q *Queries) CountDiscountLists(ctx context.Context) (int64, error)
- func (q *Queries) CountEmailReports(ctx context.Context, status sql.NullString) (int64, error)
- func (q *Queries) CountEmployees(ctx context.Context, arg CountEmployeesParams) (int64, error)
- func (q *Queries) CountExpenses(ctx context.Context, arg CountExpensesParams) (int64, error)
- func (q *Queries) CountHomeActivitiesSince(ctx context.Context, since time.Time) (int64, error)
- func (q *Queries) CountIgnoredLowStockProducts(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountInventories(ctx context.Context) (int64, error)
- func (q *Queries) CountInventoryStock(ctx context.Context, arg CountInventoryStockParams) (int64, error)
- func (q *Queries) CountInvoices(ctx context.Context) (int64, error)
- func (q *Queries) CountInvoicesFiltered(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountLatestAdditionsSince(ctx context.Context, arg CountLatestAdditionsSinceParams) (int64, error)
- func (q *Queries) CountLoanImagesForLoan(ctx context.Context, loanID int64) (int64, error)
- func (q *Queries) CountLoanPayments(ctx context.Context, arg CountLoanPaymentsParams) (int64, error)
- func (q *Queries) CountLoans(ctx context.Context, arg CountLoansParams) (int64, error)
- func (q *Queries) CountLowStockProducts(ctx context.Context, arg CountLowStockProductsParams) (int64, error)
- func (q *Queries) CountOpenBranchSyncConflicts(ctx context.Context, branchID int64) (int64, error)
- func (q *Queries) CountOpenSecurityAlerts(ctx context.Context) (int64, error)
- func (q *Queries) CountOtherAdmins(ctx context.Context, id int64) (int64, error)
- func (q *Queries) CountPriceListItemsWithProduct(ctx context.Context, arg CountPriceListItemsWithProductParams) (int64, error)
- func (q *Queries) CountPriceListsFiltered(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountProductVariants(ctx context.Context) (int64, error)
- func (q *Queries) CountPurchasesFiltered(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountRegistersTargetingRelease(ctx context.Context, targetReleaseID sql.NullInt64) (int64, error)
- func (q *Queries) CountShifts(ctx context.Context, arg CountShiftsParams) (int64, error)
- func (q *Queries) CountSizes(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountSlowMovingProducts(ctx context.Context, arg CountSlowMovingProductsParams) (int64, error)
- func (q *Queries) CountStockCounts(ctx context.Context, arg CountStockCountsParams) (int64, error)
- func (q *Queries) CountStockHealthByInventory(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountStockMovements(ctx context.Context, arg CountStockMovementsParams) (int64, error)
- func (q *Queries) CountSuppliersFiltered(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountTransferAttachments(ctx context.Context) (int64, error)
- func (q *Queries) CountTransfers(ctx context.Context, status NullTransferStatus) (int64, error)
- func (q *Queries) CountUnknownItemImages(ctx context.Context) (int64, error)
- func (q *Queries) CountUnknownItems(ctx context.Context, resolved bool) (int64, error)
- func (q *Queries) CountVariantsForBarcodes(ctx context.Context, search string) (int64, error)
- func (q *Queries) CountVisitorIPs(ctx context.Context, arg CountVisitorIPsParams) (int64, error)
- func (q *Queries) CountWhatsAppMessages(ctx context.Context, arg CountWhatsAppMessagesParams) (int64, error)
- func (q *Queries) CountWhatsAppReplies(ctx context.Context, arg CountWhatsAppRepliesParams) (int64, error)
- func (q *Queries) CreateAdminActivity(ctx context.Context, arg CreateAdminActivityParams) (AdminActivity, error)
- func (q *Queries) CreateAppRelease(ctx context.Context, arg CreateAppReleaseParams) (AppRelease, error)
- func (q *Queries) CreateAppUpdateEvent(ctx context.Context, arg CreateAppUpdateEventParams) error
- func (q *Queries) CreateAsset(ctx context.Context, arg CreateAssetParams) (Asset, error)
- func (q *Queries) CreateAssetCategory(ctx context.Context, arg CreateAssetCategoryParams) (AssetCategory, error)
- func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error)
- func (q *Queries) CreateBatch(ctx context.Context, arg CreateBatchParams) (Batch, error)
- func (q *Queries) CreateBranch(ctx context.Context, arg CreateBranchParams) (Branch, error)
- func (q *Queries) CreateBranchAttendanceChange(ctx context.Context, arg CreateBranchAttendanceChangeParams) (BranchAttendanceChange, error)
- func (q *Queries) CreateBranchAttendanceEvent(ctx context.Context, arg CreateBranchAttendanceEventParams) (BranchAttendanceEvent, error)
- func (q *Queries) CreateBranchCommand(ctx context.Context, arg CreateBranchCommandParams) (BranchCommand, error)
- func (q *Queries) CreateBranchExpense(ctx context.Context, arg CreateBranchExpenseParams) (BranchExpense, error)
- func (q *Queries) CreateBranchExpenseImage(ctx context.Context, arg CreateBranchExpenseImageParams) (BranchExpenseImage, error)
- func (q *Queries) CreateBranchExpenseUploadToken(ctx context.Context, arg CreateBranchExpenseUploadTokenParams) (BranchExpenseUploadToken, error)
- func (q *Queries) CreateBranchInvoice(ctx context.Context, arg CreateBranchInvoiceParams) (BranchInvoice, error)
- func (q *Queries) CreateBranchInvoiceItem(ctx context.Context, arg CreateBranchInvoiceItemParams) (BranchInvoiceItem, error)
- func (q *Queries) CreateBranchInvoicePayment(ctx context.Context, arg CreateBranchInvoicePaymentParams) (BranchInvoicePayment, error)
- func (q *Queries) CreateBranchInvoiceSettlement(ctx context.Context, arg CreateBranchInvoiceSettlementParams) (BranchInvoiceSettlement, error)
- func (q *Queries) CreateBranchInvoiceSettlementPayment(ctx context.Context, arg CreateBranchInvoiceSettlementPaymentParams) (BranchInvoiceSettlementPayment, error)
- func (q *Queries) CreateBranchLoan(ctx context.Context, arg CreateBranchLoanParams) (Loan, error)
- func (q *Queries) CreateBranchRegister(ctx context.Context, arg CreateBranchRegisterParams) (BranchRegister, error)
- func (q *Queries) CreateBranchSalesperson(ctx context.Context, arg CreateBranchSalespersonParams) (Salesperson, error)
- func (q *Queries) CreateBranchShift(ctx context.Context, arg CreateBranchShiftParams) (BranchShift, error)
- func (q *Queries) CreateBranchShiftReceiptImage(ctx context.Context, arg CreateBranchShiftReceiptImageParams) (BranchShiftReceiptImage, error)
- func (q *Queries) CreateBranchShiftUploadToken(ctx context.Context, arg CreateBranchShiftUploadTokenParams) (BranchShiftUploadToken, error)
- func (q *Queries) CreateBranchTarget(ctx context.Context, arg CreateBranchTargetParams) (BranchTarget, error)
- func (q *Queries) CreateBranchTargetSeries(ctx context.Context, arg CreateBranchTargetSeriesParams) (BranchTargetSeries, error)
- func (q *Queries) CreateBranchTransferRequest(ctx context.Context, arg CreateBranchTransferRequestParams) (Transfer, error)
- func (q *Queries) CreateBranchTransferUploadToken(ctx context.Context, arg CreateBranchTransferUploadTokenParams) (BranchTransferUploadToken, error)
- func (q *Queries) CreateBranchUser(ctx context.Context, arg CreateBranchUserParams) (BranchUser, error)
- func (q *Queries) CreateBranchVisitorEvent(ctx context.Context, arg CreateBranchVisitorEventParams) (BranchVisitorEvent, error)
- func (q *Queries) CreateCalendarEvent(ctx context.Context, arg CreateCalendarEventParams) (CalendarEvent, error)
- func (q *Queries) CreateCashbox(ctx context.Context, arg CreateCashboxParams) (Cashbox, error)
- func (q *Queries) CreateCashboxAccount(ctx context.Context, arg CreateCashboxAccountParams) (CashboxAccount, error)
- func (q *Queries) CreateCentralLoan(ctx context.Context, arg CreateCentralLoanParams) (Loan, error)
- func (q *Queries) CreateClient(ctx context.Context, arg CreateClientParams) (Client, error)
- func (q *Queries) CreateClientWithUID(ctx context.Context, arg CreateClientWithUIDParams) (Client, error)
- func (q *Queries) CreateColor(ctx context.Context, arg CreateColorParams) (Color, error)
- func (q *Queries) CreateCoupon(ctx context.Context, arg CreateCouponParams) (Coupon, error)
- func (q *Queries) CreateCouponCategory(ctx context.Context, arg CreateCouponCategoryParams) (CouponCategory, error)
- func (q *Queries) CreateCouponList(ctx context.Context, arg CreateCouponListParams) (CouponList, error)
- func (q *Queries) CreateCouponType(ctx context.Context, arg CreateCouponTypeParams) (CouponType, error)
- func (q *Queries) CreateCurrency(ctx context.Context, arg CreateCurrencyParams) (Currency, error)
- func (q *Queries) CreateDeal(ctx context.Context, arg CreateDealParams) (Deal, error)
- func (q *Queries) CreateDiscountList(ctx context.Context, arg CreateDiscountListParams) (DiscountList, error)
- func (q *Queries) CreateDiscountListItem(ctx context.Context, arg CreateDiscountListItemParams) (DiscountListItem, error)
- func (q *Queries) CreateDiscountListRule(ctx context.Context, arg CreateDiscountListRuleParams) (DiscountListRule, error)
- func (q *Queries) CreateDiscountListRuleGroup(ctx context.Context, arg CreateDiscountListRuleGroupParams) (DiscountListRuleGroup, error)
- func (q *Queries) CreateDiscountListRuleOption(ctx context.Context, arg CreateDiscountListRuleOptionParams) error
- func (q *Queries) CreateEmailReport(ctx context.Context, arg CreateEmailReportParams) (EmailReport, error)
- func (q *Queries) CreateEmailSchedule(ctx context.Context, arg CreateEmailScheduleParams) (EmailSchedule, error)
- func (q *Queries) CreateEmployee(ctx context.Context, arg CreateEmployeeParams) (Employee, error)
- func (q *Queries) CreateEntryItem(ctx context.Context, arg CreateEntryItemParams) (Entry, error)
- func (q *Queries) CreateExpense(ctx context.Context, arg CreateExpenseParams) (Expense, error)
- func (q *Queries) CreateExpenseCategory(ctx context.Context, arg CreateExpenseCategoryParams) (ExpenseCategory, error)
- func (q *Queries) CreateGeneratedBranchTarget(ctx context.Context, arg CreateGeneratedBranchTargetParams) (BranchTarget, error)
- func (q *Queries) CreateGooglePlaceSnapshot(ctx context.Context, arg CreateGooglePlaceSnapshotParams) error
- func (q *Queries) CreateInventory(ctx context.Context, arg CreateInventoryParams) (Inventory, error)
- func (q *Queries) CreateInvoice(ctx context.Context, arg CreateInvoiceParams) (Invoice, error)
- func (q *Queries) CreateInvoiceDiscount(ctx context.Context, arg CreateInvoiceDiscountParams) (InvoiceDiscount, error)
- func (q *Queries) CreateInvoicePayment(ctx context.Context, arg CreateInvoicePaymentParams) (InvoicePayment, error)
- func (q *Queries) CreateInvoiceType(ctx context.Context, arg CreateInvoiceTypeParams) (InvoiceType, error)
- func (q *Queries) CreateListCoupon(ctx context.Context, arg CreateListCouponParams) (Coupon, error)
- func (q *Queries) CreateLoanCategory(ctx context.Context, arg CreateLoanCategoryParams) (LoanCategory, error)
- func (q *Queries) CreateLoanImage(ctx context.Context, arg CreateLoanImageParams) (LoanImage, error)
- func (q *Queries) CreateLoanPayment(ctx context.Context, arg CreateLoanPaymentParams) (LoanPayment, error)
- func (q *Queries) CreateLoanUploadToken(ctx context.Context, arg CreateLoanUploadTokenParams) (LoanUploadToken, error)
- func (q *Queries) CreatePriceList(ctx context.Context, arg CreatePriceListParams) (PriceList, error)
- func (q *Queries) CreatePriceListItem(ctx context.Context, arg CreatePriceListItemParams) (PriceListItem, error)
- func (q *Queries) CreateProduct(ctx context.Context, arg CreateProductParams) (Product, error)
- func (q *Queries) CreateProductAttribute(ctx context.Context, arg CreateProductAttributeParams) (ProductsAttribute, error)
- func (q *Queries) CreateProductCategory(ctx context.Context, arg CreateProductCategoryParams) (ProductCategory, error)
- func (q *Queries) CreateProductVariant(ctx context.Context, arg CreateProductVariantParams) (ProductVariant, error)
- func (q *Queries) CreatePurchase(ctx context.Context, arg CreatePurchaseParams) (Purchase, error)
- func (q *Queries) CreateRecurringExpense(ctx context.Context, arg CreateRecurringExpenseParams) (RecurringExpense, error)
- func (q *Queries) CreateResolvedBranchInvoiceItem(ctx context.Context, arg CreateResolvedBranchInvoiceItemParams) error
- func (q *Queries) CreateReturnInvoice(ctx context.Context, arg CreateReturnInvoiceParams) (ReturnInvoice, error)
- func (q *Queries) CreateReviewLinkClick(ctx context.Context, arg CreateReviewLinkClickParams) error
- func (q *Queries) CreateRole(ctx context.Context, name string) (Role, error)
- func (q *Queries) CreateSaleOption(ctx context.Context, arg CreateSaleOptionParams) (SaleOption, error)
- func (q *Queries) CreateSalesInvoice(ctx context.Context, invoiceID int64) (int64, error)
- func (q *Queries) CreateSalesperson(ctx context.Context, arg CreateSalespersonParams) (Salesperson, error)
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
- func (q *Queries) CreateShift(ctx context.Context, cashboxID int64) (Shift, error)
- func (q *Queries) CreateSize(ctx context.Context, arg CreateSizeParams) (Size, error)
- func (q *Queries) CreateStockCount(ctx context.Context, arg CreateStockCountParams) (StockCount, error)
- func (q *Queries) CreateStockMovement(ctx context.Context, arg CreateStockMovementParams) (StockMovement, error)
- func (q *Queries) CreateSupplier(ctx context.Context, arg CreateSupplierParams) (Supplier, error)
- func (q *Queries) CreateTransfer(ctx context.Context, arg CreateTransferParams) (Transfer, error)
- func (q *Queries) CreateTransferItem(ctx context.Context, arg CreateTransferItemParams) (TransferItem, error)
- func (q *Queries) CreateUnknownItemImage(ctx context.Context, arg CreateUnknownItemImageParams) (UnknownItemImage, error)
- func (q *Queries) CreateUnknownItemSession(ctx context.Context, arg CreateUnknownItemSessionParams) (UnknownItemSession, error)
- func (q *Queries) CreateUnknownItemSlot(ctx context.Context, arg CreateUnknownItemSlotParams) error
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) CreateWhatsAppMessage(ctx context.Context, arg CreateWhatsAppMessageParams) (WhatsappMessage, error)
- func (q *Queries) CreateWhatsAppNumber(ctx context.Context, arg CreateWhatsAppNumberParams) (WhatsappNumber, error)
- func (q *Queries) CreateWhatsAppReply(ctx context.Context, arg CreateWhatsAppReplyParams) error
- func (q *Queries) CreateWhatsAppRule(ctx context.Context, arg CreateWhatsAppRuleParams) (WhatsappRule, error)
- func (q *Queries) DashboardActivitiesList(ctx context.Context, arg DashboardActivitiesListParams) ([]DashboardActivitiesListRow, error)
- func (q *Queries) DashboardAdminExpenseSeries(ctx context.Context, arg DashboardAdminExpenseSeriesParams) ([]DashboardAdminExpenseSeriesRow, error)
- func (q *Queries) DashboardAdminExpensesTotal(ctx context.Context, arg DashboardAdminExpensesTotalParams) (int64, error)
- func (q *Queries) DashboardAdminNewClients(ctx context.Context, arg DashboardAdminNewClientsParams) (int64, error)
- func (q *Queries) DashboardAdminRevenueSeries(ctx context.Context, arg DashboardAdminRevenueSeriesParams) ([]DashboardAdminRevenueSeriesRow, error)
- func (q *Queries) DashboardAdminSummary(ctx context.Context, arg DashboardAdminSummaryParams) (DashboardAdminSummaryRow, error)
- func (q *Queries) DashboardBranchExpenseSeries(ctx context.Context, arg DashboardBranchExpenseSeriesParams) ([]DashboardBranchExpenseSeriesRow, error)
- func (q *Queries) DashboardBranchExpensesTotal(ctx context.Context, arg DashboardBranchExpensesTotalParams) (int64, error)
- func (q *Queries) DashboardBranchNewClients(ctx context.Context, arg DashboardBranchNewClientsParams) (int64, error)
- func (q *Queries) DashboardBranchRevenueSeries(ctx context.Context, arg DashboardBranchRevenueSeriesParams) ([]DashboardBranchRevenueSeriesRow, error)
- func (q *Queries) DashboardBranchSummary(ctx context.Context, arg DashboardBranchSummaryParams) (DashboardBranchSummaryRow, error)
- func (q *Queries) DashboardDueLoans(ctx context.Context, arg DashboardDueLoansParams) (int64, error)
- func (q *Queries) DashboardExpensesList(ctx context.Context, arg DashboardExpensesListParams) ([]DashboardExpensesListRow, error)
- func (q *Queries) DashboardPurchaseSeries(ctx context.Context, arg DashboardPurchaseSeriesParams) ([]DashboardPurchaseSeriesRow, error)
- func (q *Queries) DashboardPurchasesList(ctx context.Context, arg DashboardPurchasesListParams) ([]DashboardPurchasesListRow, error)
- func (q *Queries) DashboardPurchasesTotal(ctx context.Context, arg DashboardPurchasesTotalParams) (int64, error)
- func (q *Queries) DashboardSalesList(ctx context.Context, arg DashboardSalesListParams) ([]DashboardSalesListRow, error)
- func (q *Queries) DashboardTargetList(ctx context.Context, arg DashboardTargetListParams) ([]DashboardTargetListRow, error)
- func (q *Queries) DashboardTopDueLoans(ctx context.Context, arg DashboardTopDueLoansParams) ([]DashboardTopDueLoansRow, error)
- func (q *Queries) DeactivateBranchTargetsBySeries(ctx context.Context, seriesID sql.NullInt64) error
- func (q *Queries) DeactivateCoupon(ctx context.Context, code string) error
- func (q *Queries) DeactivateCouponList(ctx context.Context, id int64) error
- func (q *Queries) DeactivateCouponsForList(ctx context.Context, listID sql.NullInt64) (int64, error)
- func (q *Queries) DecrementInvoicesIndex(ctx context.Context, arg DecrementInvoicesIndexParams) (int64, error)
- func (q *Queries) DeleteAllWhatsAppRules(ctx context.Context) error
- func (q *Queries) DeleteAppRelease(ctx context.Context, id int64) error
- func (q *Queries) DeleteAsset(ctx context.Context, id int64) error
- func (q *Queries) DeleteAssetCategory(ctx context.Context, id int64) error
- func (q *Queries) DeleteAssets(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeleteAttributeValue(ctx context.Context, id int64) error
- func (q *Queries) DeleteAttributeValues(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeleteBatch(ctx context.Context, id int64) error
- func (q *Queries) DeleteBranchAttendanceEvent(ctx context.Context, id int64) error
- func (q *Queries) DeleteBranchInvoicePaymentsForInvoice(ctx context.Context, branchInvoiceID int64) error
- func (q *Queries) DeleteBranchQuickAccessItems(ctx context.Context, branchID int64) error
- func (q *Queries) DeleteBranchTargetSeries(ctx context.Context, id int64) (BranchTargetSeries, error)
- func (q *Queries) DeleteBranchUser(ctx context.Context, id int64) error
- func (q *Queries) DeleteCalendarEvent(ctx context.Context, id int64) error
- func (q *Queries) DeleteCashboxAccount(ctx context.Context, id int64) error
- func (q *Queries) DeleteCashboxAccountOverride(ctx context.Context, arg DeleteCashboxAccountOverrideParams) error
- func (q *Queries) DeleteClient(ctx context.Context, id int64) error
- func (q *Queries) DeleteColor(ctx context.Context, id int64) error
- func (q *Queries) DeleteColors(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeleteCouponCategory(ctx context.Context, id int64) error
- func (q *Queries) DeleteCouponType(ctx context.Context, id int64) error
- func (q *Queries) DeleteCoupons(ctx context.Context, codes []string) (int64, error)
- func (q *Queries) DeleteCurrencies(ctx context.Context, codes []string) (int64, error)
- func (q *Queries) DeleteCurrency(ctx context.Context, code string) error
- func (q *Queries) DeleteDeal(ctx context.Context, id int64) error
- func (q *Queries) DeleteDiscountList(ctx context.Context, id int64) error
- func (q *Queries) DeleteDiscountListBranch(ctx context.Context, branchID int64) error
- func (q *Queries) DeleteDiscountListBranchesForList(ctx context.Context, discountListID int64) error
- func (q *Queries) DeleteDiscountListItem(ctx context.Context, arg DeleteDiscountListItemParams) error
- func (q *Queries) DeleteDiscountListItems(ctx context.Context, arg DeleteDiscountListItemsParams) (int64, error)
- func (q *Queries) DeleteDiscountListOptionItem(ctx context.Context, arg DeleteDiscountListOptionItemParams) error
- func (q *Queries) DeleteDiscountListOptionItems(ctx context.Context, arg DeleteDiscountListOptionItemsParams) (int64, error)
- func (q *Queries) DeleteDiscountListRuleGroups(ctx context.Context, discountListID int64) error
- func (q *Queries) DeleteDiscountListRuleGroupsExcept(ctx context.Context, arg DeleteDiscountListRuleGroupsExceptParams) error
- func (q *Queries) DeleteDiscountListRuleOptions(ctx context.Context, ruleID int64) error
- func (q *Queries) DeleteDiscountListRules(ctx context.Context, discountListID int64) error
- func (q *Queries) DeleteDiscountListRulesExcept(ctx context.Context, arg DeleteDiscountListRulesExceptParams) error
- func (q *Queries) DeleteEmailSchedule(ctx context.Context, id int64) error
- func (q *Queries) DeleteEmployee(ctx context.Context, id int64) error
- func (q *Queries) DeleteExpense(ctx context.Context, id int64) error
- func (q *Queries) DeleteExpenseCategory(ctx context.Context, id int64) error
- func (q *Queries) DeleteExpenses(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeleteFailedWhatsAppMessagesForInvoice(ctx context.Context, arg DeleteFailedWhatsAppMessagesForInvoiceParams) error
- func (q *Queries) DeleteHistoricalBranchInvoice(ctx context.Context, id int64) (int64, error)
- func (q *Queries) DeleteIPBan(ctx context.Context, ip string) error
- func (q *Queries) DeleteInventories(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeleteInventory(ctx context.Context, id int64) error
- func (q *Queries) DeleteInvoiceDiscount(ctx context.Context, id int64) error
- func (q *Queries) DeleteInvoiceDiscountBranches(ctx context.Context, invoiceDiscountID int64) error
- func (q *Queries) DeleteLoan(ctx context.Context, id int64) error
- func (q *Queries) DeleteLoanCategory(ctx context.Context, id int64) error
- func (q *Queries) DeleteLoanPayment(ctx context.Context, id int64) error
- func (q *Queries) DeleteLoans(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeletePriceList(ctx context.Context, id int64) error
- func (q *Queries) DeletePriceListBranch(ctx context.Context, branchID int64) error
- func (q *Queries) DeletePriceListBranchesForList(ctx context.Context, priceListID int64) error
- func (q *Queries) DeletePriceListItem(ctx context.Context, arg DeletePriceListItemParams) error
- func (q *Queries) DeletePriceListItems(ctx context.Context, arg DeletePriceListItemsParams) (int64, error)
- func (q *Queries) DeleteProduct(ctx context.Context, id int64) error
- func (q *Queries) DeleteProductCategory(ctx context.Context, id int64) error
- func (q *Queries) DeleteProductVariant(ctx context.Context, id int64) error
- func (q *Queries) DeletePurchaseItem(ctx context.Context, arg DeletePurchaseItemParams) error
- func (q *Queries) DeleteRole(ctx context.Context, id int64) error
- func (q *Queries) DeleteRolePermissions(ctx context.Context, roleID int64) error
- func (q *Queries) DeleteSalesperson(ctx context.Context, id int64) error
- func (q *Queries) DeleteSize(ctx context.Context, id int64) error
- func (q *Queries) DeleteSizes(ctx context.Context, ids []int64) (int64, error)
- func (q *Queries) DeleteStockCountItems(ctx context.Context, stockCountID int64) error
- func (q *Queries) DeleteTransferItem(ctx context.Context, arg DeleteTransferItemParams) error
- func (q *Queries) DeleteUnknownItemImages(ctx context.Context, dollar_1 []int64) error
- func (q *Queries) DeleteUnknownItemSlotsNotIn(ctx context.Context, arg DeleteUnknownItemSlotsNotInParams) error
- func (q *Queries) DeleteUser(ctx context.Context, id int64) error
- func (q *Queries) DeleteWhatsAppNumber(ctx context.Context, id int64) error
- func (q *Queries) FindUnknownInvoiceItem(ctx context.Context, arg FindUnknownInvoiceItemParams) (BranchInvoiceItem, error)
- func (q *Queries) GetAppRelease(ctx context.Context, id int64) (AppRelease, error)
- func (q *Queries) GetAppSettings(ctx context.Context) (AppSetting, error)
- func (q *Queries) GetAsset(ctx context.Context, id int64) (Asset, error)
- func (q *Queries) GetAssetByName(ctx context.Context, name string) (Asset, error)
- func (q *Queries) GetAssetCategory(ctx context.Context, id int64) (AssetCategory, error)
- func (q *Queries) GetAssetCategoryByName(ctx context.Context, name string) (AssetCategory, error)
- func (q *Queries) GetAssetTreemapData(ctx context.Context, inventoryID sql.NullInt64) ([]GetAssetTreemapDataRow, error)
- func (q *Queries) GetAttribute(ctx context.Context, name string) (Attribute, error)
- func (q *Queries) GetAttributeValue(ctx context.Context, id int64) (AttributesValue, error)
- func (q *Queries) GetBatch(ctx context.Context, id int64) (GetBatchRow, error)
- func (q *Queries) GetBatchItemByBatchVariant(ctx context.Context, arg GetBatchItemByBatchVariantParams) (BatchItem, error)
- func (q *Queries) GetBranch(ctx context.Context, id int64) (Branch, error)
- func (q *Queries) GetBranchAttendanceChange(ctx context.Context, id int64) (BranchAttendanceChange, error)
- func (q *Queries) GetBranchAttendanceChangeByClientRef(ctx context.Context, arg GetBranchAttendanceChangeByClientRefParams) (BranchAttendanceChange, error)
- func (q *Queries) GetBranchAttendanceEvent(ctx context.Context, id int64) (BranchAttendanceEvent, error)
- func (q *Queries) GetBranchAttendanceEventByClientRef(ctx context.Context, arg GetBranchAttendanceEventByClientRefParams) (BranchAttendanceEvent, error)
- func (q *Queries) GetBranchByCode(ctx context.Context, code string) (Branch, error)
- func (q *Queries) GetBranchByCodeExcluding(ctx context.Context, arg GetBranchByCodeExcludingParams) (Branch, error)
- func (q *Queries) GetBranchCommand(ctx context.Context, id int64) (BranchCommand, error)
- func (q *Queries) GetBranchExpense(ctx context.Context, id int64) (BranchExpense, error)
- func (q *Queries) GetBranchExpenseByClientRef(ctx context.Context, arg GetBranchExpenseByClientRefParams) (BranchExpense, error)
- func (q *Queries) GetBranchExpenseImage(ctx context.Context, id int64) (BranchExpenseImage, error)
- func (q *Queries) GetBranchExpenseUploadTokenByToken(ctx context.Context, token string) (BranchExpenseUploadToken, error)
- func (q *Queries) GetBranchInvoice(ctx context.Context, id int64) (BranchInvoice, error)
- func (q *Queries) GetBranchInvoiceByClientRef(ctx context.Context, arg GetBranchInvoiceByClientRefParams) (BranchInvoice, error)
- func (q *Queries) GetBranchInvoiceByCode(ctx context.Context, arg GetBranchInvoiceByCodeParams) (BranchInvoice, error)
- func (q *Queries) GetBranchInvoiceSettlement(ctx context.Context, id int64) (BranchInvoiceSettlement, error)
- func (q *Queries) GetBranchInvoiceSettlementByClientRef(ctx context.Context, arg GetBranchInvoiceSettlementByClientRefParams) (BranchInvoiceSettlement, error)
- func (q *Queries) GetBranchLoanByClientRef(ctx context.Context, arg GetBranchLoanByClientRefParams) (Loan, error)
- func (q *Queries) GetBranchRegister(ctx context.Context, id int64) (BranchRegister, error)
- func (q *Queries) GetBranchRegisterByCode(ctx context.Context, code string) (BranchRegister, error)
- func (q *Queries) GetBranchSettings(ctx context.Context, branchID int64) (BranchSetting, error)
- func (q *Queries) GetBranchShift(ctx context.Context, id int64) (BranchShift, error)
- func (q *Queries) GetBranchShiftByClientRef(ctx context.Context, arg GetBranchShiftByClientRefParams) (BranchShift, error)
- func (q *Queries) GetBranchShiftReceiptImage(ctx context.Context, id int64) (BranchShiftReceiptImage, error)
- func (q *Queries) GetBranchShiftReceiptImageForShift(ctx context.Context, branchShiftID int64) (BranchShiftReceiptImage, error)
- func (q *Queries) GetBranchShiftUploadTokenByToken(ctx context.Context, token string) (BranchShiftUploadToken, error)
- func (q *Queries) GetBranchSyncConflict(ctx context.Context, id int64) (BranchSyncConflict, error)
- func (q *Queries) GetBranchTarget(ctx context.Context, id int64) (BranchTarget, error)
- func (q *Queries) GetBranchTargetBySeriesAndStart(ctx context.Context, arg GetBranchTargetBySeriesAndStartParams) (BranchTarget, error)
- func (q *Queries) GetBranchTargetSeries(ctx context.Context, id int64) (BranchTargetSeries, error)
- func (q *Queries) GetBranchTransferByClientRef(ctx context.Context, arg GetBranchTransferByClientRefParams) (Transfer, error)
- func (q *Queries) GetBranchTransferUploadTokenByToken(ctx context.Context, token string) (BranchTransferUploadToken, error)
- func (q *Queries) GetBranchUser(ctx context.Context, id int64) (BranchUser, error)
- func (q *Queries) GetBranchVisitorEventByClientRef(ctx context.Context, arg GetBranchVisitorEventByClientRefParams) (BranchVisitorEvent, error)
- func (q *Queries) GetCashbox(ctx context.Context, id int64) (Cashbox, error)
- func (q *Queries) GetCashboxAccount(ctx context.Context, id int64) (CashboxAccount, error)
- func (q *Queries) GetCashboxAccountBalance(ctx context.Context, arg GetCashboxAccountBalanceParams) (ShiftsAccountsBalance, error)
- func (q *Queries) GetClient(ctx context.Context, id int64) (Client, error)
- func (q *Queries) GetClientByPhone(ctx context.Context, phone string) (Client, error)
- func (q *Queries) GetClientByUID(ctx context.Context, uid uuid.UUID) (Client, error)
- func (q *Queries) GetClientHomeBranch(ctx context.Context, clientID int64) (string, error)
- func (q *Queries) GetClientLink(ctx context.Context, arg GetClientLinkParams) (int64, error)
- func (q *Queries) GetClientProfileStats(ctx context.Context, clientID int64) (ClientProfileStats, error)
- func (q *Queries) GetColorByName(ctx context.Context, name string) (Color, error)
- func (q *Queries) GetCoupon(ctx context.Context, code string) (Coupon, error)
- func (q *Queries) GetCouponCategory(ctx context.Context, id int64) (CouponCategory, error)
- func (q *Queries) GetCouponList(ctx context.Context, id int64) (CouponList, error)
- func (q *Queries) GetCouponType(ctx context.Context, id int64) (CouponType, error)
- func (q *Queries) GetCurrency(ctx context.Context, code string) (Currency, error)
- func (q *Queries) GetDeal(ctx context.Context, id int64) (Deal, error)
- func (q *Queries) GetDefaultBranchSettings(ctx context.Context) (DefaultBranchSetting, error)
- func (q *Queries) GetDefaultCurrency(ctx context.Context) (Currency, error)
- func (q *Queries) GetDefaultDiscountForVariant(ctx context.Context, productVariantID int64) (int16, error)
- func (q *Queries) GetDefaultDiscountList(ctx context.Context) (DiscountList, error)
- func (q *Queries) GetDefaultInvoiceType(ctx context.Context) (InvoiceType, error)
- func (q *Queries) GetDefaultPriceForVariant(ctx context.Context, productVariantID int64) (int64, error)
- func (q *Queries) GetDefaultPriceList(ctx context.Context) (PriceList, error)
- func (q *Queries) GetDiscountList(ctx context.Context, id int64) (DiscountList, error)
- func (q *Queries) GetDiscountListBranch(ctx context.Context, branchID int64) (DiscountListBranch, error)
- func (q *Queries) GetDiscountListByUID(ctx context.Context, uid uuid.UUID) (DiscountList, error)
- func (q *Queries) GetEmailResendAPIKey(ctx context.Context) (string, error)
- func (q *Queries) GetEmailSchedule(ctx context.Context, id int64) (EmailSchedule, error)
- func (q *Queries) GetEmailSettings(ctx context.Context) (GetEmailSettingsRow, error)
- func (q *Queries) GetEmployee(ctx context.Context, id int64) (Employee, error)
- func (q *Queries) GetEntry(ctx context.Context, id int64) (Entry, error)
- func (q *Queries) GetExpense(ctx context.Context, id int64) (Expense, error)
- func (q *Queries) GetExpenseCategory(ctx context.Context, id int64) (ExpenseCategory, error)
- func (q *Queries) GetFirstActiveVariantBarcodeByCode(ctx context.Context, code string) (GetFirstActiveVariantBarcodeByCodeRow, error)
- func (q *Queries) GetInventory(ctx context.Context, id int64) (Inventory, error)
- func (q *Queries) GetInventoryByName(ctx context.Context, name string) (Inventory, error)
- func (q *Queries) GetInventoryStock(ctx context.Context, arg GetInventoryStockParams) (InventoryStock, error)
- func (q *Queries) GetInvoice(ctx context.Context, id int64) (Invoice, error)
- func (q *Queries) GetInvoiceType(ctx context.Context, id int64) (InvoiceType, error)
- func (q *Queries) GetLoan(ctx context.Context, id int64) (Loan, error)
- func (q *Queries) GetLoanCategory(ctx context.Context, id int64) (LoanCategory, error)
- func (q *Queries) GetLoanImage(ctx context.Context, id int64) (LoanImage, error)
- func (q *Queries) GetLoanPayment(ctx context.Context, id int64) (LoanPayment, error)
- func (q *Queries) GetLoanUploadTokenByToken(ctx context.Context, token string) (LoanUploadToken, error)
- func (q *Queries) GetLowStockSummary(ctx context.Context) (GetLowStockSummaryRow, error)
- func (q *Queries) GetNextBarcodeItemValue(ctx context.Context) (int64, error)
- func (q *Queries) GetPriceList(ctx context.Context, id int64) (PriceList, error)
- func (q *Queries) GetPriceListBranch(ctx context.Context, branchID int64) (PriceListBranch, error)
- func (q *Queries) GetPriceListByUID(ctx context.Context, uid uuid.UUID) (PriceList, error)
- func (q *Queries) GetProduct(ctx context.Context, id int64) (Product, error)
- func (q *Queries) GetProductAttributeValue(ctx context.Context, arg GetProductAttributeValueParams) (ProductsAttribute, error)
- func (q *Queries) GetProductAttributes(ctx context.Context, productID int64) ([]ProductsAttribute, error)
- func (q *Queries) GetProductByCode(ctx context.Context, code string) (Product, error)
- func (q *Queries) GetProductByName(ctx context.Context, name string) (Product, error)
- func (q *Queries) GetProductCategory(ctx context.Context, id int64) (ProductCategory, error)
- func (q *Queries) GetProductCategoryByName(ctx context.Context, name string) (ProductCategory, error)
- func (q *Queries) GetProductSupplier(ctx context.Context, arg GetProductSupplierParams) (ProductSupplier, error)
- func (q *Queries) GetProductVariant(ctx context.Context, id int64) (ProductVariant, error)
- func (q *Queries) GetProductVariantByBarcode(ctx context.Context, barcode string) (ProductVariant, error)
- func (q *Queries) GetProductVariantByUID(ctx context.Context, uid uuid.UUID) (ProductVariant, error)
- func (q *Queries) GetPurchase(ctx context.Context, id int64) (GetPurchaseRow, error)
- func (q *Queries) GetRecurringExpense(ctx context.Context, id int64) (RecurringExpense, error)
- func (q *Queries) GetRegisterTargetRelease(ctx context.Context, id int64) (GetRegisterTargetReleaseRow, error)
- func (q *Queries) GetReturnInvoice(ctx context.Context, invoiceID int64) (ReturnInvoice, error)
- func (q *Queries) GetReviewSettings(ctx context.Context) (GetReviewSettingsRow, error)
- func (q *Queries) GetRole(ctx context.Context, id int64) (Role, error)
- func (q *Queries) GetSaleOption(ctx context.Context, id int64) (SaleOption, error)
- func (q *Queries) GetSalesInvoice(ctx context.Context, invoiceID int64) (int64, error)
- func (q *Queries) GetSalesperson(ctx context.Context, id int64) (Salesperson, error)
- func (q *Queries) GetSalespersonByAttendanceID(ctx context.Context, arg GetSalespersonByAttendanceIDParams) (Salesperson, error)
- func (q *Queries) GetSecuritySettings(ctx context.Context) (SecuritySetting, error)
- func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error)
- func (q *Queries) GetShift(ctx context.Context, id int64) (Shift, error)
- func (q *Queries) GetSizeByName(ctx context.Context, name string) (Size, error)
- func (q *Queries) GetSlowMoverSummary(ctx context.Context) (GetSlowMoverSummaryRow, error)
- func (q *Queries) GetStockCount(ctx context.Context, id int64) (StockCount, error)
- func (q *Queries) GetStockHealthOverview(ctx context.Context) (GetStockHealthOverviewRow, error)
- func (q *Queries) GetSupplier(ctx context.Context, id int64) (Supplier, error)
- func (q *Queries) GetTransfer(ctx context.Context, id int64) (Transfer, error)
- func (q *Queries) GetUnknownItemImage(ctx context.Context, id int64) (UnknownItemImage, error)
- func (q *Queries) GetUnknownItemSessionByRef(ctx context.Context, arg GetUnknownItemSessionByRefParams) (UnknownItemSession, error)
- func (q *Queries) GetUnknownItemSessionByToken(ctx context.Context, token string) (UnknownItemSession, error)
- func (q *Queries) GetUnknownItemSlotByRef(ctx context.Context, arg GetUnknownItemSlotByRefParams) (UnknownItemSlot, error)
- func (q *Queries) GetUnknownItemSlotForResolve(ctx context.Context, id int64) (GetUnknownItemSlotForResolveRow, error)
- func (q *Queries) GetUser(ctx context.Context, id int64) (User, error)
- func (q *Queries) GetUserAccess(ctx context.Context, id int64) ([]GetUserAccessRow, error)
- func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (q *Queries) GetVariantDiscountFromList(ctx context.Context, arg GetVariantDiscountFromListParams) (DiscountListItem, error)
- func (q *Queries) GetVariantForLabel(ctx context.Context, id int64) (GetVariantForLabelRow, error)
- func (q *Queries) GetVariantPriceFromList(ctx context.Context, arg GetVariantPriceFromListParams) (PriceListItem, error)
- func (q *Queries) GetVariantTotalOnHand(ctx context.Context, variantID int64) (int64, error)
- func (q *Queries) GetWarehouseTreemapData(ctx context.Context, inventoryID sql.NullInt64) ([]GetWarehouseTreemapDataRow, error)
- func (q *Queries) GetWhatsAppChatMessageMedia(ctx context.Context, id int64) (GetWhatsAppChatMessageMediaRow, error)
- func (q *Queries) GetWhatsAppMessageByReviewCode(ctx context.Context, reviewCode string) (GetWhatsAppMessageByReviewCodeRow, error)
- func (q *Queries) GetWhatsAppMessageCost(ctx context.Context) (int64, error)
- func (q *Queries) GetWhatsAppMessageWithBranch(ctx context.Context, id int64) (GetWhatsAppMessageWithBranchRow, error)
- func (q *Queries) GetWhatsAppNumber(ctx context.Context, id int64) (WhatsappNumber, error)
- func (q *Queries) GetWhatsAppPollReplyMedia(ctx context.Context, id int64) (GetWhatsAppPollReplyMediaRow, error)
- func (q *Queries) GetWhatsAppSenderSettings(ctx context.Context) (GetWhatsAppSenderSettingsRow, error)
- func (q *Queries) GetWhatsAppSettings(ctx context.Context) (GetWhatsAppSettingsRow, error)
- func (q *Queries) GooglePlaceSnapshotBefore(ctx context.Context, arg GooglePlaceSnapshotBeforeParams) (GooglePlaceSnapshot, error)
- func (q *Queries) HomeActivityFeed(ctx context.Context, arg HomeActivityFeedParams) ([]HomeActivityFeedRow, error)
- func (q *Queries) IncrementInvoicesIndex(ctx context.Context, arg IncrementInvoicesIndexParams) (int64, error)
- func (q *Queries) InheritBranchInvoiceCancellation(ctx context.Context, id int64) error
- func (q *Queries) InsertBranchQuickAccessItem(ctx context.Context, arg InsertBranchQuickAccessItemParams) error
- func (q *Queries) LastWhatsAppSentAt(ctx context.Context, clientPhone string) (time.Time, error)
- func (q *Queries) LatestGooglePlaceSnapshot(ctx context.Context, placeID string) (GooglePlaceSnapshot, error)
- func (q *Queries) LinkUnknownItemSession(ctx context.Context, arg LinkUnknownItemSessionParams) error
- func (q *Queries) ListActiveBranchRegisterIDs(ctx context.Context, branchID int64) ([]int64, error)
- func (q *Queries) ListActiveBranchTargetSeries(ctx context.Context) ([]BranchTargetSeries, error)
- func (q *Queries) ListActiveIPBans(ctx context.Context) ([]IpBan, error)
- func (q *Queries) ListAdminActivities(ctx context.Context, arg ListAdminActivitiesParams) ([]ListAdminActivitiesRow, error)
- func (q *Queries) ListAllAttributeValues(ctx context.Context) ([]ListAllAttributeValuesRow, error)
- func (q *Queries) ListAllBranchRegisters(ctx context.Context) ([]BranchRegister, error)
- func (q *Queries) ListAllCashboxAccounts(ctx context.Context) ([]CashboxAccount, error)
- func (q *Queries) ListAllClientPhones(ctx context.Context) ([]ListAllClientPhonesRow, error)
- func (q *Queries) ListAppReleases(ctx context.Context) ([]ListAppReleasesRow, error)
- func (q *Queries) ListAppUpdateEvents(ctx context.Context, limit int32) ([]ListAppUpdateEventsRow, error)
- func (q *Queries) ListAssetCategories(ctx context.Context) ([]AssetCategory, error)
- func (q *Queries) ListAssetsPage(ctx context.Context, arg ListAssetsPageParams) ([]Asset, error)
- func (q *Queries) ListAttributeValuesPage(ctx context.Context, arg ListAttributeValuesPageParams) ([]ListAttributeValuesPageRow, error)
- func (q *Queries) ListAttributes(ctx context.Context) ([]Attribute, error)
- func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
- func (q *Queries) ListAutoDeletableUnknownItemImages(ctx context.Context, arg ListAutoDeletableUnknownItemImagesParams) ([]ListAutoDeletableUnknownItemImagesRow, error)
- func (q *Queries) ListAvailableBatchItemsForVariant(ctx context.Context, variantID int64) ([]BatchItem, error)
- func (q *Queries) ListBatchItemsStats(ctx context.Context, batchID int64) ([]ListBatchItemsStatsRow, error)
- func (q *Queries) ListBatches(ctx context.Context, arg ListBatchesParams) ([]ListBatchesRow, error)
- func (q *Queries) ListBranchAttendanceChanges(ctx context.Context, arg ListBranchAttendanceChangesParams) ([]BranchAttendanceChange, error)
- func (q *Queries) ListBranchAttendanceEvents(ctx context.Context, arg ListBranchAttendanceEventsParams) ([]BranchAttendanceEvent, error)
- func (q *Queries) ListBranchAttendanceEventsInRange(ctx context.Context, arg ListBranchAttendanceEventsInRangeParams) ([]BranchAttendanceEvent, error)
- func (q *Queries) ListBranchClientUIDs(ctx context.Context, registerID int64) ([]ListBranchClientUIDsRow, error)
- func (q *Queries) ListBranchCommands(ctx context.Context, arg ListBranchCommandsParams) ([]ListBranchCommandsRow, error)
- func (q *Queries) ListBranchCommandsPage(ctx context.Context, arg ListBranchCommandsPageParams) ([]ListBranchCommandsPageRow, error)
- func (q *Queries) ListBranchExpenseHistoryForSync(ctx context.Context, arg ListBranchExpenseHistoryForSyncParams) ([]ListBranchExpenseHistoryForSyncRow, error)
- func (q *Queries) ListBranchExpenseImages(ctx context.Context, arg ListBranchExpenseImagesParams) ([]ListBranchExpenseImagesRow, error)
- func (q *Queries) ListBranchExpenseImagesForExpense(ctx context.Context, branchExpenseID int64) ([]BranchExpenseImage, error)
- func (q *Queries) ListBranchExpenses(ctx context.Context, arg ListBranchExpensesParams) ([]BranchExpense, error)
- func (q *Queries) ListBranchInvoiceCouponCodesForHistory(ctx context.Context, arg ListBranchInvoiceCouponCodesForHistoryParams) ([]ListBranchInvoiceCouponCodesForHistoryRow, error)
- func (q *Queries) ListBranchInvoiceHistoryForSync(ctx context.Context, arg ListBranchInvoiceHistoryForSyncParams) ([]BranchInvoice, error)
- func (q *Queries) ListBranchInvoiceItems(ctx context.Context, branchInvoiceID int64) ([]ListBranchInvoiceItemsRow, error)
- func (q *Queries) ListBranchInvoiceItemsForHistory(ctx context.Context, branchInvoiceIds []int64) ([]ListBranchInvoiceItemsForHistoryRow, error)
- func (q *Queries) ListBranchInvoiceItemsNamed(ctx context.Context, branchInvoiceID int64) ([]ListBranchInvoiceItemsNamedRow, error)
- func (q *Queries) ListBranchInvoicePayments(ctx context.Context, branchInvoiceID int64) ([]BranchInvoicePayment, error)
- func (q *Queries) ListBranchInvoicePaymentsForHistory(ctx context.Context, branchInvoiceIds []int64) ([]BranchInvoicePayment, error)
- func (q *Queries) ListBranchInvoiceSettlementPayments(ctx context.Context, branchInvoiceSettlementID int64) ([]BranchInvoiceSettlementPayment, error)
- func (q *Queries) ListBranchInvoiceSettlements(ctx context.Context, arg ListBranchInvoiceSettlementsParams) ([]BranchInvoiceSettlement, error)
- func (q *Queries) ListBranchInvoices(ctx context.Context, arg ListBranchInvoicesParams) ([]BranchInvoice, error)
- func (q *Queries) ListBranchInvoicesPage(ctx context.Context, arg ListBranchInvoicesPageParams) ([]BranchInvoice, error)
- func (q *Queries) ListBranchLoanHistoryForSync(ctx context.Context, arg ListBranchLoanHistoryForSyncParams) ([]ListBranchLoanHistoryForSyncRow, error)
- func (q *Queries) ListBranchPlaceIDs(ctx context.Context) ([]ListBranchPlaceIDsRow, error)
- func (q *Queries) ListBranchProductRevenue(ctx context.Context, arg ListBranchProductRevenueParams) ([]ListBranchProductRevenueRow, error)
- func (q *Queries) ListBranchProductRevenueDaily(ctx context.Context, arg ListBranchProductRevenueDailyParams) ([]ListBranchProductRevenueDailyRow, error)
- func (q *Queries) ListBranchQuickAccessItems(ctx context.Context, branchID int64) ([]ListBranchQuickAccessItemsRow, error)
- func (q *Queries) ListBranchRegisters(ctx context.Context, branchID int64) ([]BranchRegister, error)
- func (q *Queries) ListBranchRegistersByIDs(ctx context.Context, ids []int64) ([]BranchRegister, error)
- func (q *Queries) ListBranchRevenueByBranch(ctx context.Context, arg ListBranchRevenueByBranchParams) ([]ListBranchRevenueByBranchRow, error)
- func (q *Queries) ListBranchSalesDaysRange(ctx context.Context, arg ListBranchSalesDaysRangeParams) ([]ListBranchSalesDaysRangeRow, error)
- func (q *Queries) ListBranchShiftHistoryForSync(ctx context.Context, arg ListBranchShiftHistoryForSyncParams) ([]BranchShift, error)
- func (q *Queries) ListBranchShiftReceiptImages(ctx context.Context, arg ListBranchShiftReceiptImagesParams) ([]ListBranchShiftReceiptImagesRow, error)
- func (q *Queries) ListBranchShifts(ctx context.Context, arg ListBranchShiftsParams) ([]ListBranchShiftsRow, error)
- func (q *Queries) ListBranchStockForSync(ctx context.Context, arg ListBranchStockForSyncParams) ([]ListBranchStockForSyncRow, error)
- func (q *Queries) ListBranchSyncConflictsPage(ctx context.Context, arg ListBranchSyncConflictsPageParams) ([]ListBranchSyncConflictsPageRow, error)
- func (q *Queries) ListBranchTargetSeriesForBranch(ctx context.Context, branchID int64) ([]BranchTargetSeries, error)
- func (q *Queries) ListBranchTargetsForBranch(ctx context.Context, branchID int64) ([]BranchTarget, error)
- func (q *Queries) ListBranchTargetsProgress(ctx context.Context, arg ListBranchTargetsProgressParams) ([]ListBranchTargetsProgressRow, error)
- func (q *Queries) ListBranchTargetsUpdatedSince(ctx context.Context, arg ListBranchTargetsUpdatedSinceParams) ([]BranchTarget, error)
- func (q *Queries) ListBranchTransfersUpdatedSince(ctx context.Context, arg ListBranchTransfersUpdatedSinceParams) ([]Transfer, error)
- func (q *Queries) ListBranchUsersForBranch(ctx context.Context, branchID int64) ([]BranchUser, error)
- func (q *Queries) ListBranchUsersUpdatedSince(ctx context.Context, arg ListBranchUsersUpdatedSinceParams) ([]BranchUser, error)
- func (q *Queries) ListBranchVisitorDays(ctx context.Context, arg ListBranchVisitorDaysParams) ([]ListBranchVisitorDaysRow, error)
- func (q *Queries) ListBranchVisitorDaysRange(ctx context.Context, arg ListBranchVisitorDaysRangeParams) ([]ListBranchVisitorDaysRangeRow, error)
- func (q *Queries) ListBranchWhatsAppNumbers(ctx context.Context) ([]ListBranchWhatsAppNumbersRow, error)
- func (q *Queries) ListBranches(ctx context.Context) ([]Branch, error)
- func (q *Queries) ListBranchesForDiscountList(ctx context.Context, discountListID int64) ([]ListBranchesForDiscountListRow, error)
- func (q *Queries) ListBranchesForPriceList(ctx context.Context, priceListID int64) ([]ListBranchesForPriceListRow, error)
- func (q *Queries) ListBranchesForSync(ctx context.Context, id int64) ([]ListBranchesForSyncRow, error)
- func (q *Queries) ListCalendarEvents(ctx context.Context) ([]CalendarEvent, error)
- func (q *Queries) ListCashboxAccountOverridesForBranch(ctx context.Context, branchID int64) ([]ListCashboxAccountOverridesForBranchRow, error)
- func (q *Queries) ListCashboxAccounts(ctx context.Context, arg ListCashboxAccountsParams) ([]CashboxAccount, error)
- func (q *Queries) ListCashboxAccountsForBranchSync(ctx context.Context, branchID int64) ([]ListCashboxAccountsForBranchSyncRow, error)
- func (q *Queries) ListCashboxAccountsForSync(ctx context.Context) ([]CashboxAccount, error)
- func (q *Queries) ListCashboxAccountsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]CashboxAccount, error)
- func (q *Queries) ListCashboxes(ctx context.Context, arg ListCashboxesParams) ([]Cashbox, error)
- func (q *Queries) ListClientMonthlySpend(ctx context.Context, clientID int64) ([]ClientMonthlySpendRow, error)
- func (q *Queries) ListClientPaymentMix(ctx context.Context, clientID int64) ([]ClientPaymentMixRow, error)
- func (q *Queries) ListClientPhoneCountries(ctx context.Context) ([]ListClientPhoneCountriesRow, error)
- func (q *Queries) ListClientRecentInvoices(ctx context.Context, clientID int64) ([]ClientRecentInvoiceRow, error)
- func (q *Queries) ListClientSyncIDs(ctx context.Context, arg ListClientSyncIDsParams) ([]ListClientSyncIDsRow, error)
- func (q *Queries) ListClients(ctx context.Context, arg ListClientsParams) ([]Client, error)
- func (q *Queries) ListClientsByInvoiceCountCached(ctx context.Context, arg ListClientsByInvoiceCountCachedParams) ([]ListClientsByInvoiceCountCachedRow, error)
- func (q *Queries) ListClientsByItemCountCached(ctx context.Context, arg ListClientsByItemCountCachedParams) ([]ListClientsByItemCountCachedRow, error)
- func (q *Queries) ListClientsBySpending(ctx context.Context, arg ListClientsBySpendingParams) ([]ListClientsBySpendingRow, error)
- func (q *Queries) ListClientsBySpendingCached(ctx context.Context, arg ListClientsBySpendingCachedParams) ([]ListClientsBySpendingCachedRow, error)
- func (q *Queries) ListClientsByUIDs(ctx context.Context, uids []uuid.UUID) ([]Client, error)
- func (q *Queries) ListClientsForExport(ctx context.Context, arg ListClientsForExportParams) ([]ListClientsForExportRow, error)
- func (q *Queries) ListClientsMissingPhoneCountry(ctx context.Context) ([]ListClientsMissingPhoneCountryRow, error)
- func (q *Queries) ListClientsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Client, error)
- func (q *Queries) ListClientsUpdatedSincePaged(ctx context.Context, arg ListClientsUpdatedSincePagedParams) ([]Client, error)
- func (q *Queries) ListClientsWithLoyalty(ctx context.Context, arg ListClientsWithLoyaltyParams) ([]ListClientsWithLoyaltyRow, error)
- func (q *Queries) ListColors(ctx context.Context) ([]Color, error)
- func (q *Queries) ListColorsPage(ctx context.Context, arg ListColorsPageParams) ([]Color, error)
- func (q *Queries) ListCouponCategories(ctx context.Context, scope sql.NullString) ([]CouponCategory, error)
- func (q *Queries) ListCouponLists(ctx context.Context) ([]ListCouponListsRow, error)
- func (q *Queries) ListCouponTypes(ctx context.Context) ([]CouponType, error)
- func (q *Queries) ListCouponTypesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]CouponType, error)
- func (q *Queries) ListCoupons(ctx context.Context, arg ListCouponsParams) ([]ListCouponsRow, error)
- func (q *Queries) ListCouponsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Coupon, error)
- func (q *Queries) ListCurrencies(ctx context.Context, arg ListCurrenciesParams) ([]Currency, error)
- func (q *Queries) ListCurrenciesForSync(ctx context.Context) ([]Currency, error)
- func (q *Queries) ListCurrenciesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Currency, error)
- func (q *Queries) ListDailyIncome(ctx context.Context, arg ListDailyIncomeParams) ([]ListDailyIncomeRow, error)
- func (q *Queries) ListDayBranchExpenses(ctx context.Context, arg ListDayBranchExpensesParams) ([]ListDayBranchExpensesRow, error)
- func (q *Queries) ListDayBranchShifts(ctx context.Context, arg ListDayBranchShiftsParams) ([]ListDayBranchShiftsRow, error)
- func (q *Queries) ListDayInvoices(ctx context.Context, arg ListDayInvoicesParams) ([]ListDayInvoicesRow, error)
- func (q *Queries) ListDayPaymentsByAccount(ctx context.Context, arg ListDayPaymentsByAccountParams) ([]ListDayPaymentsByAccountRow, error)
- func (q *Queries) ListDaySalesByBranch(ctx context.Context, arg ListDaySalesByBranchParams) ([]ListDaySalesByBranchRow, error)
- func (q *Queries) ListDaySalesByHour(ctx context.Context, arg ListDaySalesByHourParams) ([]ListDaySalesByHourRow, error)
- func (q *Queries) ListDaySalesBySalesperson(ctx context.Context, arg ListDaySalesBySalespersonParams) ([]ListDaySalesBySalespersonRow, error)
- func (q *Queries) ListDayTopProducts(ctx context.Context, arg ListDayTopProductsParams) ([]ListDayTopProductsRow, error)
- func (q *Queries) ListDayVisitorsByHour(ctx context.Context, arg ListDayVisitorsByHourParams) ([]ListDayVisitorsByHourRow, error)
- func (q *Queries) ListDeals(ctx context.Context) ([]ListDealsRow, error)
- func (q *Queries) ListDealsForDiscountListSync(ctx context.Context, discountListID int64) ([]Deal, error)
- func (q *Queries) ListDeletableUnknownItemImages(ctx context.Context, ids []int64) ([]ListDeletableUnknownItemImagesRow, error)
- func (q *Queries) ListDiscountListBranchIDs(ctx context.Context, discountListID int64) ([]int64, error)
- func (q *Queries) ListDiscountListItems(ctx context.Context, discountListID int64) ([]DiscountListItem, error)
- func (q *Queries) ListDiscountListItemsForSync(ctx context.Context, discountListID int64) ([]ListDiscountListItemsForSyncRow, error)
- func (q *Queries) ListDiscountListItemsWithProduct(ctx context.Context, arg ListDiscountListItemsWithProductParams) ([]ListDiscountListItemsWithProductRow, error)
- func (q *Queries) ListDiscountListOptionItemsForSync(ctx context.Context, discountListID int64) ([]ListDiscountListOptionItemsForSyncRow, error)
- func (q *Queries) ListDiscountListRuleGroups(ctx context.Context, discountListID int64) ([]DiscountListRuleGroup, error)
- func (q *Queries) ListDiscountListRuleOptions(ctx context.Context, discountListID int64) ([]ListDiscountListRuleOptionsRow, error)
- func (q *Queries) ListDiscountListRules(ctx context.Context, discountListID int64) ([]ListDiscountListRulesRow, error)
- func (q *Queries) ListDiscountLists(ctx context.Context, arg ListDiscountListsParams) ([]DiscountList, error)
- func (q *Queries) ListDiscountListsForBranchSync(ctx context.Context, arg ListDiscountListsForBranchSyncParams) ([]DiscountList, error)
- func (q *Queries) ListDiscountListsRemovedFromBranch(ctx context.Context, arg ListDiscountListsRemovedFromBranchParams) ([]ListDiscountListsRemovedFromBranchRow, error)
- func (q *Queries) ListDueEmailSchedules(ctx context.Context) ([]EmailSchedule, error)
- func (q *Queries) ListDueRecurringExpenses(ctx context.Context, nextDueAt time.Time) ([]RecurringExpense, error)
- func (q *Queries) ListEmailReportInvoices(ctx context.Context, arg ListEmailReportInvoicesParams) ([]ListEmailReportInvoicesRow, error)
- func (q *Queries) ListEmailReportRecipients(ctx context.Context) ([]ListEmailReportRecipientsRow, error)
- func (q *Queries) ListEmailReportRegisters(ctx context.Context) ([]ListEmailReportRegistersRow, error)
- func (q *Queries) ListEmailReportShiftInvoices(ctx context.Context, shiftID int64) ([]ListEmailReportShiftInvoicesRow, error)
- func (q *Queries) ListEmailReportShifts(ctx context.Context, arg ListEmailReportShiftsParams) ([]ListEmailReportShiftsRow, error)
- func (q *Queries) ListEmailReports(ctx context.Context, arg ListEmailReportsParams) ([]EmailReport, error)
- func (q *Queries) ListEmailSchedules(ctx context.Context) ([]EmailSchedule, error)
- func (q *Queries) ListEmployees(ctx context.Context, arg ListEmployeesParams) ([]Employee, error)
- func (q *Queries) ListEntries(ctx context.Context, arg ListEntriesParams) ([]Entry, error)
- func (q *Queries) ListExpenseCategories(ctx context.Context, scope sql.NullString) ([]ExpenseCategory, error)
- func (q *Queries) ListExpenseCategoriesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]ExpenseCategory, error)
- func (q *Queries) ListExpenses(ctx context.Context, arg ListExpensesParams) ([]Expense, error)
- func (q *Queries) ListGooglePlaceSnapshots(ctx context.Context, arg ListGooglePlaceSnapshotsParams) ([]GooglePlaceSnapshot, error)
- func (q *Queries) ListGoogleReviews(ctx context.Context, arg ListGoogleReviewsParams) ([]GoogleReview, error)
- func (q *Queries) ListHomeActivityResolutions(ctx context.Context, arg ListHomeActivityResolutionsParams) ([]ListHomeActivityResolutionsRow, error)
- func (q *Queries) ListIgnoredLowStockProducts(ctx context.Context, arg ListIgnoredLowStockProductsParams) ([]ListIgnoredLowStockProductsRow, error)
- func (q *Queries) ListIncomingBranchTransfersUpdatedSince(ctx context.Context, arg ListIncomingBranchTransfersUpdatedSinceParams) ([]Transfer, error)
- func (q *Queries) ListInventories(ctx context.Context, arg ListInventoriesParams) ([]Inventory, error)
- func (q *Queries) ListInventoryStock(ctx context.Context, arg ListInventoryStockParams) ([]ListInventoryStockRow, error)
- func (q *Queries) ListInvoiceDiscountBranchIDs(ctx context.Context) ([]InvoiceDiscountBranch, error)
- func (q *Queries) ListInvoiceDiscounts(ctx context.Context) ([]InvoiceDiscount, error)
- func (q *Queries) ListInvoiceDiscountsForBranchSync(ctx context.Context, arg ListInvoiceDiscountsForBranchSyncParams) ([]ListInvoiceDiscountsForBranchSyncRow, error)
- func (q *Queries) ListInvoicePaymentsByInvoice(ctx context.Context, invoiceID int64) ([]ListInvoicePaymentsByInvoiceRow, error)
- func (q *Queries) ListInvoiceProductsByInvoice(ctx context.Context, invoiceID int64) ([]ListInvoiceProductsByInvoiceRow, error)
- func (q *Queries) ListInvoiceTypes(ctx context.Context) ([]InvoiceType, error)
- func (q *Queries) ListInvoices(ctx context.Context, arg ListInvoicesParams) ([]Invoice, error)
- func (q *Queries) ListInvoicesPage(ctx context.Context, arg ListInvoicesPageParams) ([]Invoice, error)
- func (q *Queries) ListLatestAdditions(ctx context.Context, arg ListLatestAdditionsParams) ([]ListLatestAdditionsRow, error)
- func (q *Queries) ListLoanCategories(ctx context.Context, scope sql.NullString) ([]LoanCategory, error)
- func (q *Queries) ListLoanCategoriesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]LoanCategory, error)
- func (q *Queries) ListLoanImagesForLoan(ctx context.Context, loanID int64) ([]LoanImage, error)
- func (q *Queries) ListLoanPayments(ctx context.Context, arg ListLoanPaymentsParams) ([]LoanPayment, error)
- func (q *Queries) ListLoans(ctx context.Context, arg ListLoansParams) ([]ListLoansRow, error)
- func (q *Queries) ListLowStockProducts(ctx context.Context, arg ListLowStockProductsParams) ([]ListLowStockProductsRow, error)
- func (q *Queries) ListPendingBranchAttendanceRequests(ctx context.Context, branchID sql.NullInt64) ([]BranchAttendanceChange, error)
- func (q *Queries) ListPendingBranchCommands(ctx context.Context, registerID int64) ([]BranchCommand, error)
- func (q *Queries) ListPriceListBranchIDs(ctx context.Context, priceListID int64) ([]int64, error)
- func (q *Queries) ListPriceListItems(ctx context.Context, priceListID int64) ([]PriceListItem, error)
- func (q *Queries) ListPriceListItemsForSync(ctx context.Context, priceListID int64) ([]ListPriceListItemsForSyncRow, error)
- func (q *Queries) ListPriceListItemsWithProduct(ctx context.Context, arg ListPriceListItemsWithProductParams) ([]ListPriceListItemsWithProductRow, error)
- func (q *Queries) ListPriceLists(ctx context.Context, arg ListPriceListsParams) ([]PriceList, error)
- func (q *Queries) ListPriceListsForBranchSync(ctx context.Context, arg ListPriceListsForBranchSyncParams) ([]PriceList, error)
- func (q *Queries) ListPriceListsRemovedFromBranch(ctx context.Context, arg ListPriceListsRemovedFromBranchParams) ([]ListPriceListsRemovedFromBranchRow, error)
- func (q *Queries) ListProductAttributes(ctx context.Context, arg ListProductAttributesParams) ([]ProductsAttribute, error)
- func (q *Queries) ListProductCategories(ctx context.Context) ([]ProductCategory, error)
- func (q *Queries) ListProductRevenue(ctx context.Context, arg ListProductRevenueParams) ([]ListProductRevenueRow, error)
- func (q *Queries) ListProductRevenueDaily(ctx context.Context, arg ListProductRevenueDailyParams) ([]ListProductRevenueDailyRow, error)
- func (q *Queries) ListProductSaleOptionNames(ctx context.Context, productID int64) ([]ListProductSaleOptionNamesRow, error)
- func (q *Queries) ListProductVariantIDsByUIDs(ctx context.Context, uids []uuid.UUID) ([]ListProductVariantIDsByUIDsRow, error)
- func (q *Queries) ListProductVariants(ctx context.Context, arg ListProductVariantsParams) ([]ListProductVariantsRow, error)
- func (q *Queries) ListProductVariantsByProduct(ctx context.Context, productID int64) ([]ProductVariant, error)
- func (q *Queries) ListProductVariantsForSync(ctx context.Context, updatedAt time.Time) ([]ListProductVariantsForSyncRow, error)
- func (q *Queries) ListProductVariantsForSyncByUIDs(ctx context.Context, uids []uuid.UUID) ([]ListProductVariantsForSyncByUIDsRow, error)
- func (q *Queries) ListProductVariantsForSyncPaged(ctx context.Context, arg ListProductVariantsForSyncPagedParams) ([]ListProductVariantsForSyncPagedRow, error)
- func (q *Queries) ListProductVariantsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]ProductVariant, error)
- func (q *Queries) ListProducts(ctx context.Context, arg ListProductsParams) ([]ListProductsRow, error)
- func (q *Queries) ListPurchaseItems(ctx context.Context, purchaseID sql.NullInt64) ([]ListPurchaseItemsRow, error)
- func (q *Queries) ListPurchases(ctx context.Context, arg ListPurchasesParams) ([]ListPurchasesRow, error)
- func (q *Queries) ListRecurringExpenses(ctx context.Context) ([]RecurringExpense, error)
- func (q *Queries) ListRegisterUpdateStatuses(ctx context.Context) ([]ListRegisterUpdateStatusesRow, error)
- func (q *Queries) ListRolePermissions(ctx context.Context) ([]RolePermission, error)
- func (q *Queries) ListRoles(ctx context.Context) ([]ListRolesRow, error)
- func (q *Queries) ListSaleMovementsForInvoiceVariant(ctx context.Context, arg ListSaleMovementsForInvoiceVariantParams) ([]ListSaleMovementsForInvoiceVariantRow, error)
- func (q *Queries) ListSaleOptions(ctx context.Context) ([]SaleOption, error)
- func (q *Queries) ListSalespersons(ctx context.Context, arg ListSalespersonsParams) ([]Salesperson, error)
- func (q *Queries) ListSalespersonsByCashbox(ctx context.Context, cashboxID sql.NullInt64) ([]Salesperson, error)
- func (q *Queries) ListSalespersonsForBranch(ctx context.Context, branchID sql.NullInt64) ([]Salesperson, error)
- func (q *Queries) ListSalespersonsUpdatedSince(ctx context.Context, arg ListSalespersonsUpdatedSinceParams) ([]Salesperson, error)
- func (q *Queries) ListSecurityAlerts(ctx context.Context, arg ListSecurityAlertsParams) ([]SecurityAlert, error)
- func (q *Queries) ListShifts(ctx context.Context, arg ListShiftsParams) ([]ListShiftsRow, error)
- func (q *Queries) ListSizes(ctx context.Context) ([]Size, error)
- func (q *Queries) ListSizesPage(ctx context.Context, arg ListSizesPageParams) ([]Size, error)
- func (q *Queries) ListSlowMovingProducts(ctx context.Context, arg ListSlowMovingProductsParams) ([]ListSlowMovingProductsRow, error)
- func (q *Queries) ListStockCountItems(ctx context.Context, stockCountID int64) ([]ListStockCountItemsRow, error)
- func (q *Queries) ListStockCounts(ctx context.Context, arg ListStockCountsParams) ([]ListStockCountsRow, error)
- func (q *Queries) ListStockHealthByInventory(ctx context.Context, arg ListStockHealthByInventoryParams) ([]ListStockHealthByInventoryRow, error)
- func (q *Queries) ListStockMovements(ctx context.Context, arg ListStockMovementsParams) ([]ListStockMovementsRow, error)
- func (q *Queries) ListSuppliers(ctx context.Context, arg ListSuppliersParams) ([]Supplier, error)
- func (q *Queries) ListTransferAttachments(ctx context.Context, arg ListTransferAttachmentsParams) ([]ListTransferAttachmentsRow, error)
- func (q *Queries) ListTransferItems(ctx context.Context, transferID int64) ([]ListTransferItemsRow, error)
- func (q *Queries) ListTransfers(ctx context.Context, arg ListTransfersParams) ([]ListTransfersRow, error)
- func (q *Queries) ListUnknownItemImages(ctx context.Context, arg ListUnknownItemImagesParams) ([]ListUnknownItemImagesRow, error)
- func (q *Queries) ListUnknownItemSlotsForSession(ctx context.Context, sessionID int64) ([]UnknownItemSlot, error)
- func (q *Queries) ListUnknownItems(ctx context.Context, arg ListUnknownItemsParams) ([]ListUnknownItemsRow, error)
- func (q *Queries) ListUnmatchedDiscountEntries(ctx context.Context, entries []string) ([]string, error)
- func (q *Queries) ListUnresolvedUrgentHomeActivities(ctx context.Context) ([]ListUnresolvedUrgentHomeActivitiesRow, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) ListVariantSyncIDs(ctx context.Context, arg ListVariantSyncIDsParams) ([]ListVariantSyncIDsRow, error)
- func (q *Queries) ListVariantsForBarcodes(ctx context.Context, arg ListVariantsForBarcodesParams) ([]ListVariantsForBarcodesRow, error)
- func (q *Queries) ListVariantsForDiscountEntry(ctx context.Context, entry string) ([]ListVariantsForDiscountEntryRow, error)
- func (q *Queries) ListVisitorIPs(ctx context.Context, arg ListVisitorIPsParams) ([]VisitorIp, error)
- func (q *Queries) ListWaitingUnknownItems(ctx context.Context) ([]ListWaitingUnknownItemsRow, error)
- func (q *Queries) ListWhatsAppChatMessages(ctx context.Context, arg ListWhatsAppChatMessagesParams) ([]ListWhatsAppChatMessagesRow, error)
- func (q *Queries) ListWhatsAppChats(ctx context.Context, arg ListWhatsAppChatsParams) ([]ListWhatsAppChatsRow, error)
- func (q *Queries) ListWhatsAppMessageReplies(ctx context.Context, id int64) ([]ListWhatsAppMessageRepliesRow, error)
- func (q *Queries) ListWhatsAppMessages(ctx context.Context, arg ListWhatsAppMessagesParams) ([]ListWhatsAppMessagesRow, error)
- func (q *Queries) ListWhatsAppNumbers(ctx context.Context) ([]WhatsappNumber, error)
- func (q *Queries) ListWhatsAppReplies(ctx context.Context, arg ListWhatsAppRepliesParams) ([]ListWhatsAppRepliesRow, error)
- func (q *Queries) ListWhatsAppRules(ctx context.Context) ([]WhatsappRule, error)
- func (q *Queries) LowPollRatings(ctx context.Context, arg LowPollRatingsParams) ([]LowPollRatingsRow, error)
- func (q *Queries) LoyaltyMonthlyJoins(ctx context.Context, clientType sql.NullString) ([]LoyaltyMonthlyJoinsRow, error)
- func (q *Queries) LoyaltyRisingClients(ctx context.Context, arg LoyaltyRisingClientsParams) ([]LoyaltyRisingClientsRow, error)
- func (q *Queries) LoyaltyTierStats(ctx context.Context, arg LoyaltyTierStatsParams) ([]LoyaltyTierStatsRow, error)
- func (q *Queries) MarkBranchAttendanceEventRemoved(ctx context.Context, arg MarkBranchAttendanceEventRemovedParams) error
- func (q *Queries) MarkBranchExpenseUploadTokenUsed(ctx context.Context, id int64) error
- func (q *Queries) MarkBranchInvoicesCancelled(ctx context.Context, arg MarkBranchInvoicesCancelledParams) error
- func (q *Queries) MarkBranchShiftUploadTokenUsed(ctx context.Context, id int64) error
- func (q *Queries) MarkBranchTransferUploadTokenUsed(ctx context.Context, id int64) error
- func (q *Queries) MarkLoanUploadTokenUsed(ctx context.Context, id int64) error
- func (q *Queries) MarkUnknownItemSlotResolved(ctx context.Context, arg MarkUnknownItemSlotResolvedParams) error
- func (q *Queries) MarkWhatsAppReviewClicked(ctx context.Context, id int64) error
- func (q *Queries) PollRatingTotals(ctx context.Context, arg PollRatingTotalsParams) (PollRatingTotalsRow, error)
- func (q *Queries) PollRatingsByBranch(ctx context.Context, arg PollRatingsByBranchParams) ([]PollRatingsByBranchRow, error)
- func (q *Queries) PollRatingsByDay(ctx context.Context, arg PollRatingsByDayParams) ([]PollRatingsByDayRow, error)
- func (q *Queries) PollReplies(ctx context.Context, arg PollRepliesParams) ([]PollRepliesRow, error)
- func (q *Queries) ProductBarcodesPresent(ctx context.Context, dollar_1 []string) ([]string, error)
- func (q *Queries) ReceiveInventoryStock(ctx context.Context, arg ReceiveInventoryStockParams) (InventoryStock, error)
- func (q *Queries) RecordEmailScheduleRun(ctx context.Context, arg RecordEmailScheduleRunParams) error
- func (q *Queries) RecordSecurityAlert(ctx context.Context, arg RecordSecurityAlertParams) error
- func (q *Queries) RecordWhatsAppPollVote(ctx context.Context, arg RecordWhatsAppPollVoteParams) (RecordWhatsAppPollVoteRow, error)
- func (q *Queries) RedeemCoupon(ctx context.Context, arg RedeemCouponParams) (Coupon, error)
- func (q *Queries) RefreshClientSpend(ctx context.Context) error
- func (q *Queries) RenameRole(ctx context.Context, arg RenameRoleParams) error
- func (q *Queries) ReplaceBranchExpenseImageFile(ctx context.Context, arg ReplaceBranchExpenseImageFileParams) (BranchExpenseImage, error)
- func (q *Queries) ReplaceBranchShiftReceiptImageFile(ctx context.Context, arg ReplaceBranchShiftReceiptImageFileParams) (BranchShiftReceiptImage, error)
- func (q *Queries) RepointBranchInvoicesClientUID(ctx context.Context, arg RepointBranchInvoicesClientUIDParams) error
- func (q *Queries) ReportBranchSales(ctx context.Context, arg ReportBranchSalesParams) ([]ReportBranchSalesRow, error)
- func (q *Queries) ReportCategorySales(ctx context.Context, arg ReportCategorySalesParams) ([]ReportCategorySalesRow, error)
- func (q *Queries) ReportCostOfGoods(ctx context.Context, arg ReportCostOfGoodsParams) (ReportCostOfGoodsRow, error)
- func (q *Queries) ReportCostOfGoodsSeries(ctx context.Context, arg ReportCostOfGoodsSeriesParams) ([]ReportCostOfGoodsSeriesRow, error)
- func (q *Queries) ReportDailyCosted(ctx context.Context, arg ReportDailyCostedParams) ([]ReportDailyCostedRow, error)
- func (q *Queries) ReportDailySales(ctx context.Context, arg ReportDailySalesParams) ([]ReportDailySalesRow, error)
- func (q *Queries) ReportHourlySales(ctx context.Context, arg ReportHourlySalesParams) ([]ReportHourlySalesRow, error)
- func (q *Queries) ReportInventoryValue(ctx context.Context) (int64, error)
- func (q *Queries) ReportPaymentMethods(ctx context.Context, arg ReportPaymentMethodsParams) ([]ReportPaymentMethodsRow, error)
- func (q *Queries) ReportReceivables(ctx context.Context) (int64, error)
- func (q *Queries) ReportSaleYears(ctx context.Context) ([]int32, error)
- func (q *Queries) ReportTargetsInRange(ctx context.Context, arg ReportTargetsInRangeParams) ([]ReportTargetsInRangeRow, error)
- func (q *Queries) ReportTopProducts(ctx context.Context, arg ReportTopProductsParams) ([]ReportTopProductsRow, error)
- func (q *Queries) RequestUnknownItemHelp(ctx context.Context, arg RequestUnknownItemHelpParams) error
- func (q *Queries) ResolveBranchSyncConflict(ctx context.Context, arg ResolveBranchSyncConflictParams) (BranchSyncConflict, error)
- func (q *Queries) ResolveHomeActivity(ctx context.Context, arg ResolveHomeActivityParams) error
- func (q *Queries) ResolveVariantDiscount(ctx context.Context, arg ResolveVariantDiscountParams) (int16, error)
- func (q *Queries) ResolveVariantDiscounts(ctx context.Context, arg ResolveVariantDiscountsParams) ([]ResolveVariantDiscountsRow, error)
- func (q *Queries) ResolveVariantPrice(ctx context.Context, arg ResolveVariantPriceParams) (int64, error)
- func (q *Queries) ResolveVariantPrices(ctx context.Context, arg ResolveVariantPricesParams) ([]ResolveVariantPricesRow, error)
- func (q *Queries) ReviewClicksTotal(ctx context.Context, arg ReviewClicksTotalParams) (int64, error)
- func (q *Queries) ReviewFunnel(ctx context.Context, arg ReviewFunnelParams) (ReviewFunnelRow, error)
- func (q *Queries) ReviewFunnelByBranch(ctx context.Context, arg ReviewFunnelByBranchParams) ([]ReviewFunnelByBranchRow, error)
- func (q *Queries) ReviewFunnelByDay(ctx context.Context, arg ReviewFunnelByDayParams) ([]ReviewFunnelByDayRow, error)
- func (q *Queries) RotateBranchExpenseImage(ctx context.Context, arg RotateBranchExpenseImageParams) (int16, error)
- func (q *Queries) RotateBranchShiftReceiptImage(ctx context.Context, arg RotateBranchShiftReceiptImageParams) (int16, error)
- func (q *Queries) RotateTransferAttachment(ctx context.Context, arg RotateTransferAttachmentParams) (int16, error)
- func (q *Queries) SalespersonPerformanceInvoices(ctx context.Context, arg SalespersonPerformanceInvoicesParams) ([]SalespersonPerformanceInvoicesRow, error)
- func (q *Queries) SalespersonPerformanceItems(ctx context.Context, arg SalespersonPerformanceItemsParams) ([]BranchInvoiceItem, error)
- func (q *Queries) SearchVariantsForUnknownItems(ctx context.Context, search string) ([]SearchVariantsForUnknownItemsRow, error)
- func (q *Queries) SearchWhatsAppClients(ctx context.Context, search string) ([]SearchWhatsAppClientsRow, error)
- func (q *Queries) SeedProductVariantsCostByCode(ctx context.Context, arg SeedProductVariantsCostByCodeParams) (int64, error)
- func (q *Queries) SetAssetCost(ctx context.Context, arg SetAssetCostParams) error
- func (q *Queries) SetBarcodeLabelDesign(ctx context.Context, barcodeLabelDesign json.RawMessage) (AppSetting, error)
- func (q *Queries) SetBranchActive(ctx context.Context, arg SetBranchActiveParams) error
- func (q *Queries) SetBranchExpenseCategory(ctx context.Context, arg SetBranchExpenseCategoryParams) (BranchExpense, error)
- func (q *Queries) SetBranchExpenseFromCentral(ctx context.Context, arg SetBranchExpenseFromCentralParams) (BranchExpense, error)
- func (q *Queries) SetBranchExpenseFromCentralByID(ctx context.Context, arg SetBranchExpenseFromCentralByIDParams) (BranchExpense, error)
- func (q *Queries) SetBranchHiddenFromReports(ctx context.Context, arg SetBranchHiddenFromReportsParams) error
- func (q *Queries) SetBranchInventory(ctx context.Context, arg SetBranchInventoryParams) error
- func (q *Queries) SetBranchInvoiceDiscount(ctx context.Context, arg SetBranchInvoiceDiscountParams) error
- func (q *Queries) SetBranchInvoiceItemDiscount(ctx context.Context, arg SetBranchInvoiceItemDiscountParams) error
- func (q *Queries) SetBranchInvoiceItemResolved(ctx context.Context, arg SetBranchInvoiceItemResolvedParams) error
- func (q *Queries) SetBranchInvoiceSalesperson(ctx context.Context, arg SetBranchInvoiceSalespersonParams) (int64, error)
- func (q *Queries) SetBranchLoanCategory(ctx context.Context, arg SetBranchLoanCategoryParams) (Loan, error)
- func (q *Queries) SetBranchPlaceID(ctx context.Context, arg SetBranchPlaceIDParams) error
- func (q *Queries) SetBranchRegisterActive(ctx context.Context, arg SetBranchRegisterActiveParams) error
- func (q *Queries) SetBranchRegisterHiddenFromReports(ctx context.Context, arg SetBranchRegisterHiddenFromReportsParams) error
- func (q *Queries) SetBranchRegisterQuickAccessMode(ctx context.Context, arg SetBranchRegisterQuickAccessModeParams) (int64, error)
- func (q *Queries) SetBranchRegisterReportedSettings(ctx context.Context, arg SetBranchRegisterReportedSettingsParams) error
- func (q *Queries) SetBranchSettingsManagedLocally(ctx context.Context, arg SetBranchSettingsManagedLocallyParams) (BranchSetting, error)
- func (q *Queries) SetBranchTargetActive(ctx context.Context, arg SetBranchTargetActiveParams) (BranchTarget, error)
- func (q *Queries) SetBranchTargetSeriesActive(ctx context.Context, arg SetBranchTargetSeriesActiveParams) (BranchTargetSeries, error)
- func (q *Queries) SetBranchUserActive(ctx context.Context, arg SetBranchUserActiveParams) (BranchUser, error)
- func (q *Queries) SetBranchWhatsAppNumber(ctx context.Context, arg SetBranchWhatsAppNumberParams) error
- func (q *Queries) SetCashboxAccountActive(ctx context.Context, arg SetCashboxAccountActiveParams) (CashboxAccount, error)
- func (q *Queries) SetClientActive(ctx context.Context, arg SetClientActiveParams) error
- func (q *Queries) SetClientBranchIfNull(ctx context.Context, arg SetClientBranchIfNullParams) error
- func (q *Queries) SetDefaultLowStockThreshold(ctx context.Context, defaultLowStockThreshold int64) (AppSetting, error)
- func (q *Queries) SetDefaultWhatsAppNumber(ctx context.Context, id int64) error
- func (q *Queries) SetEmailResendAPIKey(ctx context.Context, emailResendApiKey string) error
- func (q *Queries) SetEmailSettings(ctx context.Context, arg SetEmailSettingsParams) error
- func (q *Queries) SetProductAutofillRules(ctx context.Context, arg SetProductAutofillRulesParams) (AppSetting, error)
- func (q *Queries) SetProductCategory(ctx context.Context, arg SetProductCategoryParams) error
- func (q *Queries) SetProductLowStockAlertsEnabled(ctx context.Context, arg SetProductLowStockAlertsEnabledParams) error
- func (q *Queries) SetProductVariantActive(ctx context.Context, arg SetProductVariantActiveParams) error
- func (q *Queries) SetPurchaseStatus(ctx context.Context, arg SetPurchaseStatusParams) (Purchase, error)
- func (q *Queries) SetPurchaseTotals(ctx context.Context, arg SetPurchaseTotalsParams) error
- func (q *Queries) SetRecurringExpenseActive(ctx context.Context, arg SetRecurringExpenseActiveParams) (RecurringExpense, error)
- func (q *Queries) SetRegisterUpdateStatus(ctx context.Context, arg SetRegisterUpdateStatusParams) error
- func (q *Queries) SetRegistersTargetRelease(ctx context.Context, arg SetRegistersTargetReleaseParams) error
- func (q *Queries) SetReviewSettings(ctx context.Context, arg SetReviewSettingsParams) error
- func (q *Queries) SetSalespersonActive(ctx context.Context, arg SetSalespersonActiveParams) (Salesperson, error)
- func (q *Queries) SetSalespersonAttendanceID(ctx context.Context, arg SetSalespersonAttendanceIDParams) (Salesperson, error)
- func (q *Queries) SetSalespersonColor(ctx context.Context, arg SetSalespersonColorParams) (Salesperson, error)
- func (q *Queries) SetSalespersonIsSalesperson(ctx context.Context, arg SetSalespersonIsSalespersonParams) (Salesperson, error)
- func (q *Queries) SetStockCountNote(ctx context.Context, arg SetStockCountNoteParams) error
- func (q *Queries) SetStockCountStatus(ctx context.Context, arg SetStockCountStatusParams) (StockCount, error)
- func (q *Queries) SetTransferAttachmentPath(ctx context.Context, arg SetTransferAttachmentPathParams) error
- func (q *Queries) SetTransferConfirmed(ctx context.Context, arg SetTransferConfirmedParams) (Transfer, error)
- func (q *Queries) SetTransferItemReceivedQuantity(ctx context.Context, arg SetTransferItemReceivedQuantityParams) (TransferItem, error)
- func (q *Queries) SetTransferItemReceivedQuantityByVariant(ctx context.Context, arg SetTransferItemReceivedQuantityByVariantParams) (int64, error)
- func (q *Queries) SetTransferStatus(ctx context.Context, arg SetTransferStatusParams) (Transfer, error)
- func (q *Queries) SetUnknownItemSlotImage(ctx context.Context, arg SetUnknownItemSlotImageParams) error
- func (q *Queries) SetUserAvatarColor(ctx context.Context, arg SetUserAvatarColorParams) error
- func (q *Queries) SetVariantBarcode(ctx context.Context, arg SetVariantBarcodeParams) (ProductVariant, error)
- func (q *Queries) SetWhatsAppMessageCost(ctx context.Context, costMicros int64) error
- func (q *Queries) SetWhatsAppNumberPhone(ctx context.Context, arg SetWhatsAppNumberPhoneParams) error
- func (q *Queries) SetWhatsAppSenderSettings(ctx context.Context, arg SetWhatsAppSenderSettingsParams) error
- func (q *Queries) SetWhatsAppSettings(ctx context.Context, arg SetWhatsAppSettingsParams) error
- func (q *Queries) ShareUnknownLineImages(ctx context.Context, sessionID int64) error
- func (q *Queries) SkipDroppedWhatsAppMessages(ctx context.Context, arg SkipDroppedWhatsAppMessagesParams) error
- func (q *Queries) SplitUnknownInvoiceItem(ctx context.Context, arg SplitUnknownInvoiceItemParams) error
- func (q *Queries) SumBranchRevenueForRange(ctx context.Context, arg SumBranchRevenueForRangeParams) (int64, error)
- func (q *Queries) SumClientLoyaltyPoints(ctx context.Context, clientID int64) (int64, error)
- func (q *Queries) TouchBranchRegister(ctx context.Context, id int64) error
- func (q *Queries) UnresolveHomeActivity(ctx context.Context, arg UnresolveHomeActivityParams) error
- func (q *Queries) UnsetDefaultDiscountList(ctx context.Context, id int64) error
- func (q *Queries) UnsetDefaultPriceList(ctx context.Context, id int64) error
- func (q *Queries) UpdateAppReleaseNotes(ctx context.Context, arg UpdateAppReleaseNotesParams) (AppRelease, error)
- func (q *Queries) UpdateAppSettings(ctx context.Context, arg UpdateAppSettingsParams) (AppSetting, error)
- func (q *Queries) UpdateAsset(ctx context.Context, arg UpdateAssetParams) (Asset, error)
- func (q *Queries) UpdateAssetCategory(ctx context.Context, arg UpdateAssetCategoryParams) (AssetCategory, error)
- func (q *Queries) UpdateAttributeValue(ctx context.Context, arg UpdateAttributeValueParams) (AttributesValue, error)
- func (q *Queries) UpdateBranchAttendanceEvent(ctx context.Context, arg UpdateBranchAttendanceEventParams) (BranchAttendanceEvent, error)
- func (q *Queries) UpdateBranchRegister(ctx context.Context, arg UpdateBranchRegisterParams) (BranchRegister, error)
- func (q *Queries) UpdateBranchRegisterAPIKeyHash(ctx context.Context, arg UpdateBranchRegisterAPIKeyHashParams) error
- func (q *Queries) UpdateBranchSalespersonName(ctx context.Context, arg UpdateBranchSalespersonNameParams) (Salesperson, error)
- func (q *Queries) UpdateBranchTarget(ctx context.Context, arg UpdateBranchTargetParams) (BranchTarget, error)
- func (q *Queries) UpdateBranchTargetSeries(ctx context.Context, arg UpdateBranchTargetSeriesParams) (BranchTargetSeries, error)
- func (q *Queries) UpdateBranchUser(ctx context.Context, arg UpdateBranchUserParams) (BranchUser, error)
- func (q *Queries) UpdateCashbox(ctx context.Context, arg UpdateCashboxParams) (Cashbox, error)
- func (q *Queries) UpdateCashboxAccount(ctx context.Context, arg UpdateCashboxAccountParams) (CashboxAccount, error)
- func (q *Queries) UpdateClient(ctx context.Context, arg UpdateClientParams) (Client, error)
- func (q *Queries) UpdateClientPhone(ctx context.Context, arg UpdateClientPhoneParams) error
- func (q *Queries) UpdateColor(ctx context.Context, arg UpdateColorParams) (Color, error)
- func (q *Queries) UpdateCoupon(ctx context.Context, arg UpdateCouponParams) (Coupon, error)
- func (q *Queries) UpdateCouponCategory(ctx context.Context, arg UpdateCouponCategoryParams) (CouponCategory, error)
- func (q *Queries) UpdateCouponType(ctx context.Context, arg UpdateCouponTypeParams) (CouponType, error)
- func (q *Queries) UpdateCurrency(ctx context.Context, arg UpdateCurrencyParams) (Currency, error)
- func (q *Queries) UpdateDeal(ctx context.Context, arg UpdateDealParams) (Deal, error)
- func (q *Queries) UpdateDiscountList(ctx context.Context, arg UpdateDiscountListParams) error
- func (q *Queries) UpdateDiscountListItem(ctx context.Context, arg UpdateDiscountListItemParams) error
- func (q *Queries) UpdateDiscountListRule(ctx context.Context, arg UpdateDiscountListRuleParams) (int64, error)
- func (q *Queries) UpdateDiscountListRuleGroup(ctx context.Context, arg UpdateDiscountListRuleGroupParams) (int64, error)
- func (q *Queries) UpdateEmailSchedule(ctx context.Context, arg UpdateEmailScheduleParams) (EmailSchedule, error)
- func (q *Queries) UpdateEmployee(ctx context.Context, arg UpdateEmployeeParams) (Employee, error)
- func (q *Queries) UpdateEmployeeSalary(ctx context.Context, arg UpdateEmployeeSalaryParams) (Employee, error)
- func (q *Queries) UpdateExpense(ctx context.Context, arg UpdateExpenseParams) (Expense, error)
- func (q *Queries) UpdateExpenseCategory(ctx context.Context, arg UpdateExpenseCategoryParams) (ExpenseCategory, error)
- func (q *Queries) UpdateInventory(ctx context.Context, arg UpdateInventoryParams) error
- func (q *Queries) UpdateInvoiceDiscount(ctx context.Context, arg UpdateInvoiceDiscountParams) (InvoiceDiscount, error)
- func (q *Queries) UpdateInvoiceType(ctx context.Context, arg UpdateInvoiceTypeParams) (InvoiceType, error)
- func (q *Queries) UpdateLoan(ctx context.Context, arg UpdateLoanParams) (Loan, error)
- func (q *Queries) UpdateLoanCategory(ctx context.Context, arg UpdateLoanCategoryParams) (LoanCategory, error)
- func (q *Queries) UpdatePriceList(ctx context.Context, arg UpdatePriceListParams) error
- func (q *Queries) UpdatePriceListItem(ctx context.Context, arg UpdatePriceListItemParams) error
- func (q *Queries) UpdateProduct(ctx context.Context, arg UpdateProductParams) error
- func (q *Queries) UpdateProductAttribute(ctx context.Context, arg UpdateProductAttributeParams) error
- func (q *Queries) UpdateProductCategory(ctx context.Context, arg UpdateProductCategoryParams) (ProductCategory, error)
- func (q *Queries) UpdateProductLowStockThreshold(ctx context.Context, arg UpdateProductLowStockThresholdParams) error
- func (q *Queries) UpdateProductVariant(ctx context.Context, arg UpdateProductVariantParams) (ProductVariant, error)
- func (q *Queries) UpdateProductVariantAvgCost(ctx context.Context, arg UpdateProductVariantAvgCostParams) error
- func (q *Queries) UpdateRecurringExpenseNextDue(ctx context.Context, arg UpdateRecurringExpenseNextDueParams) (RecurringExpense, error)
- func (q *Queries) UpdateSalesperson(ctx context.Context, arg UpdateSalespersonParams) (Salesperson, error)
- func (q *Queries) UpdateSecuritySettings(ctx context.Context, arg UpdateSecuritySettingsParams) (SecuritySetting, error)
- func (q *Queries) UpdateSize(ctx context.Context, arg UpdateSizeParams) (Size, error)
- func (q *Queries) UpdateTransfer(ctx context.Context, arg UpdateTransferParams) error
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
- func (q *Queries) UpdateWhatsAppNumberLabel(ctx context.Context, arg UpdateWhatsAppNumberLabelParams) (WhatsappNumber, error)
- func (q *Queries) UpsertAttributeValue(ctx context.Context, arg UpsertAttributeValueParams) (AttributesValue, error)
- func (q *Queries) UpsertBranchSettings(ctx context.Context, arg UpsertBranchSettingsParams) (BranchSetting, error)
- func (q *Queries) UpsertBranchSyncConflict(ctx context.Context, arg UpsertBranchSyncConflictParams) (BranchSyncConflict, error)
- func (q *Queries) UpsertCashboxAccountOverride(ctx context.Context, arg UpsertCashboxAccountOverrideParams) (BranchCashboxAccount, error)
- func (q *Queries) UpsertClientLink(ctx context.Context, arg UpsertClientLinkParams) error
- func (q *Queries) UpsertDefaultBranchSettings(ctx context.Context, settings json.RawMessage) (DefaultBranchSetting, error)
- func (q *Queries) UpsertDiscountListBranch(ctx context.Context, arg UpsertDiscountListBranchParams) error
- func (q *Queries) UpsertDiscountListOptionItem(ctx context.Context, arg UpsertDiscountListOptionItemParams) error
- func (q *Queries) UpsertGoogleReview(ctx context.Context, arg UpsertGoogleReviewParams) error
- func (q *Queries) UpsertIPBan(ctx context.Context, arg UpsertIPBanParams) error
- func (q *Queries) UpsertInventoryAssetQuantity(ctx context.Context, arg UpsertInventoryAssetQuantityParams) (InventoriesAsset, error)
- func (q *Queries) UpsertOversoldConflict(ctx context.Context, arg UpsertOversoldConflictParams) (BranchSyncConflict, error)
- func (q *Queries) UpsertPriceListBranch(ctx context.Context, arg UpsertPriceListBranchParams) error
- func (q *Queries) UpsertProductAttribute(ctx context.Context, arg UpsertProductAttributeParams) error
- func (q *Queries) UpsertRolePermission(ctx context.Context, arg UpsertRolePermissionParams) error
- func (q *Queries) UpsertVisitorIP(ctx context.Context, arg UpsertVisitorIPParams) error
- func (q *Queries) VisitorCountries(ctx context.Context) ([]VisitorCountriesRow, error)
- func (q *Queries) WaiveUnknownItemSlots(ctx context.Context, arg WaiveUnknownItemSlotsParams) (int64, error)
- func (q *Queries) WhatsAppClientsByPhoneTail(ctx context.Context, tails []string) ([]WhatsAppClientsByPhoneTailRow, error)
- func (q *Queries) WhatsAppFailureReasons(ctx context.Context, arg WhatsAppFailureReasonsParams) ([]WhatsAppFailureReasonsRow, error)
- func (q *Queries) WhatsAppFailureWatch(ctx context.Context) (WhatsAppFailureWatchRow, error)
- func (q *Queries) WhatsAppMessageTotals(ctx context.Context, arg WhatsAppMessageTotalsParams) (WhatsAppMessageTotalsRow, error)
- func (q *Queries) WhatsAppMessagesByBranch(ctx context.Context, arg WhatsAppMessagesByBranchParams) ([]WhatsAppMessagesByBranchRow, error)
- func (q *Queries) WhatsAppMessagesByDay(ctx context.Context, arg WhatsAppMessagesByDayParams) ([]WhatsAppMessagesByDayRow, error)
- func (q *Queries) WhatsAppMessagesByHour(ctx context.Context, arg WhatsAppMessagesByHourParams) ([]WhatsAppMessagesByHourRow, error)
- func (q *Queries) WhatsAppMessagesByRule(ctx context.Context, arg WhatsAppMessagesByRuleParams) ([]WhatsAppMessagesByRuleRow, error)
- func (q *Queries) WhatsAppNumberForBranch(ctx context.Context, arg WhatsAppNumberForBranchParams) (WhatsappNumber, error)
- func (q *Queries) WhatsAppSentForInvoice(ctx context.Context, arg WhatsAppSentForInvoiceParams) (bool, error)
- func (q *Queries) WhatsAppTopRecipients(ctx context.Context, arg WhatsAppTopRecipientsParams) ([]WhatsAppTopRecipientsRow, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type QuickAccessItemInput
- type ReceiveInventoryStockParams
- type RecordEmailScheduleRunParams
- type RecordSecurityAlertParams
- type RecordWhatsAppPollVoteParams
- type RecordWhatsAppPollVoteRow
- type RecurringExpense
- type RedeemCouponParams
- type RenameRoleParams
- type ReplaceBranchExpenseImageFileParams
- type ReplaceBranchShiftReceiptImageFileParams
- type RepointBranchInvoicesClientUIDParams
- type ReportBranchSalesParams
- type ReportBranchSalesRow
- type ReportCategorySalesParams
- type ReportCategorySalesRow
- type ReportCostOfGoodsParams
- type ReportCostOfGoodsRow
- type ReportCostOfGoodsSeriesParams
- type ReportCostOfGoodsSeriesRow
- type ReportDailyCostedParams
- type ReportDailyCostedRow
- type ReportDailySalesParams
- type ReportDailySalesRow
- type ReportHourlySalesParams
- type ReportHourlySalesRow
- type ReportPaymentMethodsParams
- type ReportPaymentMethodsRow
- type ReportSaleInvoice
- type ReportSaleLine
- type ReportTargetsInRangeParams
- type ReportTargetsInRangeRow
- type ReportTopProductsParams
- type ReportTopProductsRow
- type RequestUnknownItemHelpParams
- type ResolveBranchSyncConflictParams
- type ResolveHomeActivityParams
- type ResolveVariantDiscountParams
- type ResolveVariantDiscountsParams
- type ResolveVariantDiscountsRow
- type ResolveVariantPriceParams
- type ResolveVariantPricesParams
- type ResolveVariantPricesRow
- type ReturnInvoice
- type ReturnInvoiceItem
- type ReturnInvoiceTxParams
- type ReturnInvoiceTxResult
- type ReviewClicksTotalParams
- type ReviewFunnelByBranchParams
- type ReviewFunnelByBranchRow
- type ReviewFunnelByDayParams
- type ReviewFunnelByDayRow
- type ReviewFunnelParams
- type ReviewFunnelRow
- type ReviewLinkClick
- type Role
- type RolePermission
- type RotateBranchExpenseImageParams
- type RotateBranchShiftReceiptImageParams
- type RotateTransferAttachmentParams
- type SQLStore
- func (store *SQLStore) AddVariantTx(ctx context.Context, arg AddVariantTxParams) (ProductVariant, error)
- func (store *SQLStore) ApplyBranchSettlementTx(ctx context.Context, arg ApplyBranchSettlementTxParams) (ApplyBranchSettlementTxResult, error)
- func (store *SQLStore) BatchSetEmployeeSalaries(ctx context.Context, args []UpdateEmployeeSalaryParams) ([]Employee, error)
- func (store *SQLStore) CancelPurchaseTx(ctx context.Context, purchaseID int64, cancelledBy sql.NullInt64) (PurchaseReceiveTxResult, error)
- func (store *SQLStore) CancelStockCountTx(ctx context.Context, id int64) (StockCount, error)
- func (store *SQLStore) CancelTransferTx(ctx context.Context, transferID int64, cancelledBy sql.NullInt64) (TransferStageTxResult, error)
- func (store *SQLStore) ConfirmBranchTransferTx(ctx context.Context, arg ConfirmBranchTransferTxParams) (Transfer, error)
- func (store *SQLStore) CreateBatchTx(ctx context.Context, arg CreateBatchTxParams) (CreateBatchTxResult, error)
- func (store *SQLStore) CreateBranchInvoiceTx(ctx context.Context, arg CreateBranchInvoiceTxParams) (CreateBranchInvoiceTxResult, error)
- func (store *SQLStore) CreateBranchTransferRequestTx(ctx context.Context, arg CreateBranchTransferRequestTxParams) (CreateBranchTransferRequestTxResult, error)
- func (store *SQLStore) CreateBranchTx(ctx context.Context, arg CreateBranchTxParams) (CreateBranchTxResult, error)
- func (store *SQLStore) CreateProductTx(ctx context.Context, arg CreateProductTxParams) (CreateProductTxResult, error)
- func (store *SQLStore) CreatePurchaseTx(ctx context.Context, arg CreatePurchaseTxParams) (CreatePurchaseTxResult, error)
- func (store *SQLStore) CreateTransferTx(ctx context.Context, arg CreateTransferTxParams) (CreateTransferTxResult, error)
- func (store *SQLStore) DeleteBranchTargetSeriesTx(ctx context.Context, seriesID int64) (BranchTargetSeries, error)
- func (store *SQLStore) FireRecurringExpenseTx(ctx context.Context, recurring RecurringExpense) (Expense, error)
- func (store *SQLStore) ImportBranchQuickAccessTx(ctx context.Context, branchID int64, items []QuickAccessItemInput) (bool, error)
- func (store *SQLStore) PostStockCountTx(ctx context.Context, id int64, postedBy sql.NullInt64) (PostStockCountTxResult, error)
- func (store *SQLStore) PurchaseReceiveTx(ctx context.Context, arg PurchaseReceiveTxParams) (PurchaseReceiveTxResult, error)
- func (store *SQLStore) ReplaceBranchQuickAccessTx(ctx context.Context, branchID int64, items []QuickAccessItemInput) error
- func (store *SQLStore) ReplaceDiscountListRuleGroupsTx(ctx context.Context, listID int64, groups []DiscountListRuleGroupInput) error
- func (store *SQLStore) ReplaceDiscountListRulesTx(ctx context.Context, listID int64, rules []DiscountListRuleInput) error
- func (store *SQLStore) ReplaceWhatsAppRulesTx(ctx context.Context, rules []CreateWhatsAppRuleParams) ([]WhatsappRule, error)
- func (store *SQLStore) ResolveUnknownItemsTx(ctx context.Context, slotIDs []int64, variantID int64) error
- func (store *SQLStore) ReturnInvoiceTx(ctx context.Context, arg ReturnInvoiceTxParams) (ReturnInvoiceTxResult, error)
- func (store *SQLStore) SalesInvoiceTx(ctx context.Context, arg SalesInvoiceTxParams) (SalesInvoiceTxResult, error)
- func (store *SQLStore) SaveInvoiceDiscountTx(ctx context.Context, arg SaveInvoiceDiscountTxParams) (InvoiceDiscount, error)
- func (store *SQLStore) SaveReviewSettingsTx(ctx context.Context, settings SetReviewSettingsParams, ...) error
- func (store *SQLStore) SaveRolePermissionsTx(ctx context.Context, roleID int64, perms []RolePermission) error
- func (store *SQLStore) SaveStockCountTx(ctx context.Context, arg SaveStockCountTxParams) (StockCount, error)
- func (store *SQLStore) SaveWhatsAppSenderTx(ctx context.Context, settings SetWhatsAppSenderSettingsParams, ...) error
- func (store *SQLStore) SetProductSaleOptionsTx(ctx context.Context, entries []string, saleOptionIDs []int64) (int, error)
- func (store *SQLStore) StockAdjustmentTx(ctx context.Context, arg StockAdjustmentTxParams) (StockAdjustmentTxResult, error)
- func (store *SQLStore) TransferApproveTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
- func (store *SQLStore) TransferDispatchTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
- func (store *SQLStore) TransferReceiveTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
- func (store *SQLStore) UpdateProductTx(ctx context.Context, arg UpdateProductTxParams) (UpdateProductTxResult, error)
- func (store *SQLStore) UpdateWhatsAppNumberTx(ctx context.Context, id int64, label string, makeDefault bool, ...) (WhatsappNumber, error)
- type SaleOption
- type SalesInvoice
- type SalesInvoiceItem
- type SalesInvoiceTxParams
- type SalesInvoiceTxResult
- type Salesperson
- type SalespersonPerformanceInvoicesParams
- type SalespersonPerformanceInvoicesRow
- type SalespersonPerformanceItemsParams
- type SaveInvoiceDiscountTxParams
- type SaveStockCountTxParams
- type SearchVariantsForUnknownItemsRow
- type SearchWhatsAppClientsRow
- type SecurityAlert
- type SecuritySetting
- type SeedProductVariantsCostByCodeParams
- type Session
- type SetAssetCostParams
- type SetBranchActiveParams
- type SetBranchExpenseCategoryParams
- type SetBranchExpenseFromCentralByIDParams
- type SetBranchExpenseFromCentralParams
- type SetBranchHiddenFromReportsParams
- type SetBranchInventoryParams
- type SetBranchInvoiceDiscountParams
- type SetBranchInvoiceItemDiscountParams
- type SetBranchInvoiceItemResolvedParams
- type SetBranchInvoiceSalespersonParams
- type SetBranchLoanCategoryParams
- type SetBranchPlaceIDParams
- type SetBranchRegisterActiveParams
- type SetBranchRegisterHiddenFromReportsParams
- type SetBranchRegisterQuickAccessModeParams
- type SetBranchRegisterReportedSettingsParams
- type SetBranchSettingsManagedLocallyParams
- type SetBranchTargetActiveParams
- type SetBranchTargetSeriesActiveParams
- type SetBranchUserActiveParams
- type SetBranchWhatsAppNumberParams
- type SetCashboxAccountActiveParams
- type SetClientActiveParams
- type SetClientBranchIfNullParams
- type SetEmailSettingsParams
- type SetProductAutofillRulesParams
- type SetProductCategoryParams
- type SetProductLowStockAlertsEnabledParams
- type SetProductVariantActiveParams
- type SetPurchaseStatusParams
- type SetPurchaseTotalsParams
- type SetRecurringExpenseActiveParams
- type SetRegisterUpdateStatusParams
- type SetRegistersTargetReleaseParams
- type SetReviewSettingsParams
- type SetSalespersonActiveParams
- type SetSalespersonAttendanceIDParams
- type SetSalespersonColorParams
- type SetSalespersonIsSalespersonParams
- type SetStockCountNoteParams
- type SetStockCountStatusParams
- type SetTransferAttachmentPathParams
- type SetTransferConfirmedParams
- type SetTransferItemReceivedQuantityByVariantParams
- type SetTransferItemReceivedQuantityParams
- type SetTransferStatusParams
- type SetUnknownItemSlotImageParams
- type SetUserAvatarColorParams
- type SetVariantBarcodeParams
- type SetWhatsAppNumberPhoneParams
- type SetWhatsAppSenderSettingsParams
- type SetWhatsAppSettingsParams
- type Shift
- type ShiftsAccountsBalance
- type Size
- type SkipDroppedWhatsAppMessagesParams
- type SplitUnknownInvoiceItemParams
- type StockAdjustmentMode
- type StockAdjustmentTxParams
- type StockAdjustmentTxResult
- type StockCount
- type StockCountItem
- type StockCountLineParams
- type StockCountStatus
- type StockMovement
- type StockMovementReason
- type Store
- type SumBranchRevenueForRangeParams
- type Supplier
- type Token
- type Transfer
- type TransferItem
- type TransferItemParams
- type TransferStageTxParams
- type TransferStageTxResult
- type TransferStatus
- type TransferType
- type UnknownItemImage
- type UnknownItemSession
- type UnknownItemSlot
- type UnresolveHomeActivityParams
- type UpdateAppReleaseNotesParams
- type UpdateAppSettingsParams
- type UpdateAssetCategoryParams
- type UpdateAssetParams
- type UpdateAttributeValueParams
- type UpdateBranchAttendanceEventParams
- type UpdateBranchRegisterAPIKeyHashParams
- type UpdateBranchRegisterParams
- type UpdateBranchSalespersonNameParams
- type UpdateBranchTargetParams
- type UpdateBranchTargetSeriesParams
- type UpdateBranchUserParams
- type UpdateCashboxAccountParams
- type UpdateCashboxParams
- type UpdateClientParams
- type UpdateClientPhoneParams
- type UpdateColorParams
- type UpdateCouponCategoryParams
- type UpdateCouponParams
- type UpdateCouponTypeParams
- type UpdateCurrencyParams
- type UpdateDealParams
- type UpdateDiscountListItemParams
- type UpdateDiscountListParams
- type UpdateDiscountListRuleGroupParams
- type UpdateDiscountListRuleParams
- type UpdateEmailScheduleParams
- type UpdateEmployeeParams
- type UpdateEmployeeSalaryParams
- type UpdateExpenseCategoryParams
- type UpdateExpenseParams
- type UpdateInventoryParams
- type UpdateInvoiceDiscountParams
- type UpdateInvoiceTypeParams
- type UpdateLoanCategoryParams
- type UpdateLoanParams
- type UpdatePriceListItemParams
- type UpdatePriceListParams
- type UpdateProductAttributeParams
- type UpdateProductCategoryParams
- type UpdateProductLowStockThresholdParams
- type UpdateProductParams
- type UpdateProductTxParams
- type UpdateProductTxResult
- type UpdateProductVariantAvgCostParams
- type UpdateProductVariantParams
- type UpdateRecurringExpenseNextDueParams
- type UpdateSalespersonParams
- type UpdateSecuritySettingsParams
- type UpdateSizeParams
- type UpdateTransferParams
- type UpdateUserParams
- type UpdateWhatsAppNumberLabelParams
- type UpsertAttributeValueParams
- type UpsertBranchSettingsParams
- type UpsertBranchSyncConflictParams
- type UpsertCashboxAccountOverrideParams
- type UpsertClientLinkParams
- type UpsertDiscountListBranchParams
- type UpsertDiscountListOptionItemParams
- type UpsertGoogleReviewParams
- type UpsertIPBanParams
- type UpsertInventoryAssetQuantityParams
- type UpsertOversoldConflictParams
- type UpsertPriceListBranchParams
- type UpsertProductAttributeParams
- type UpsertRolePermissionParams
- type UpsertVisitorIPParams
- type User
- type UsersPermission
- type VariantDefaultDiscount
- type VariantDefaultPrice
- type VisitorCountriesRow
- type VisitorIp
- type WaiveUnknownItemSlotsParams
- type WhatsAppClientsByPhoneTailRow
- type WhatsAppFailureReasonsParams
- type WhatsAppFailureReasonsRow
- type WhatsAppFailureWatchRow
- type WhatsAppMessageTotalsParams
- type WhatsAppMessageTotalsRow
- type WhatsAppMessagesByBranchParams
- type WhatsAppMessagesByBranchRow
- type WhatsAppMessagesByDayParams
- type WhatsAppMessagesByDayRow
- type WhatsAppMessagesByHourParams
- type WhatsAppMessagesByHourRow
- type WhatsAppMessagesByRuleParams
- type WhatsAppMessagesByRuleRow
- type WhatsAppNumberForBranchParams
- type WhatsAppSentForInvoiceParams
- type WhatsAppTopRecipientsParams
- type WhatsAppTopRecipientsRow
- type WhatsappChatMessage
- type WhatsappMessage
- type WhatsappNumber
- type WhatsappPollReply
- type WhatsappReply
- type WhatsappRule
Constants ¶
const ( SettlementStatusApplied = "applied" SettlementStatusPending = "pending" SettlementStatusIgnoredShiftClosed = "ignored_shift_closed" )
Settlement lifecycle -- see db/migrations/000075.
const UnknownItemBarcode = "UNKNOWN"
UnknownItemBarcode is the barcode a till gives its "Unknown item" placeholder product (kashi-pos's unknownProductBarcode). A sold line with this barcode is stored unresolved and flagged, until an admin says what it was (ResolveUnknownItemsTx).
Variables ¶
var ErrUnknownItemNotResolvable = errors.New("unknown item can't be resolved")
ErrUnknownItemNotResolvable is returned for a slot whose invoice line can't be found any more (already relabelled, or the invoice was never received).
Functions ¶
This section is empty.
Types ¶
type AcknowledgeSecurityAlertsParams ¶ added in v1.1.0
type AddBatchItemParams ¶
type AddInvoiceDiscountBranchParams ¶ added in v1.1.8
type AddInvoiceProductParams ¶
type AddInvoiceProductParams struct {
InvoiceID int64 `json:"invoice_id"`
ProductID int64 `json:"product_id"`
VariantID sql.NullInt64 `json:"variant_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
UnitCost int64 `json:"unit_cost"`
}
type AddProductSaleOptionsForEntriesParams ¶ added in v1.1.6
type AddPurchaseItemParams ¶
type AddStockCountItemParams ¶
type AddVariantTxParams ¶
type AddWhatsAppChatMessageParams ¶ added in v1.1.1
type AddWhatsAppChatMessageParams struct {
Instance string `json:"instance"`
WaID string `json:"wa_id"`
ChatJid string `json:"chat_jid"`
ChatPhone string `json:"chat_phone"`
ContactName string `json:"contact_name"`
FromMe bool `json:"from_me"`
Kind string `json:"kind"`
Body string `json:"body"`
MediaType string `json:"media_type"`
SentAt time.Time `json:"sent_at"`
}
type AddWhatsAppPollReplyParams ¶ added in v1.1.0
type AdminActivity ¶
type AdminActivity struct {
ID int64 `json:"id"`
UserID sql.NullInt64 `json:"user_id"`
Method string `json:"method"`
Route string `json:"route"`
EntityID sql.NullInt64 `json:"entity_id"`
Summary string `json:"summary"`
Detail string `json:"detail"`
CreatedAt time.Time `json:"created_at"`
RepeatCount int32 `json:"repeat_count"`
ReleaseType string `json:"release_type"`
}
type AdoptSalespersonAttendanceIDParams ¶ added in v1.1.0
type AppRelease ¶
type AppRelease struct {
ID int64 `json:"id"`
Version string `json:"version"`
Flavor string `json:"flavor"`
FileName string `json:"file_name"`
FilePath string `json:"file_path"`
SizeBytes int64 `json:"size_bytes"`
Sha256 string `json:"sha256"`
Signature string `json:"signature"`
Notes string `json:"notes"`
UploadedBy sql.NullInt64 `json:"uploaded_by"`
CreatedAt time.Time `json:"created_at"`
}
type AppSetting ¶
type AppSetting struct {
ID int16 `json:"id"`
FinancialsHighSeasonMonths json.RawMessage `json:"financials_high_season_months"`
UpdatedAt time.Time `json:"updated_at"`
ActivityMessageSeconds int16 `json:"activity_message_seconds"`
ActivityDisplayMode string `json:"activity_display_mode"`
BarcodeLabelWidth float32 `json:"barcode_label_width"`
BarcodeLabelHeight float32 `json:"barcode_label_height"`
UpcomingEventsDays int16 `json:"upcoming_events_days"`
UpcomingEventsMenuDays int16 `json:"upcoming_events_menu_days"`
HiddenBuiltinEvents json.RawMessage `json:"hidden_builtin_events"`
DefaultLowStockThreshold int64 `json:"default_low_stock_threshold"`
WhatsappEnabled bool `json:"whatsapp_enabled"`
WhatsappPhoneNumberID string `json:"whatsapp_phone_number_id"`
WhatsappAccessToken string `json:"whatsapp_access_token"`
WhatsappTemplateName string `json:"whatsapp_template_name"`
WhatsappTemplateLang string `json:"whatsapp_template_lang"`
WhatsappTemplateParams string `json:"whatsapp_template_params"`
ProductAutofillEnabled bool `json:"product_autofill_enabled"`
ProductAutofillRules json.RawMessage `json:"product_autofill_rules"`
ProductAutofillCodeLayout string `json:"product_autofill_code_layout"`
WhatsappMessageCostMicros int64 `json:"whatsapp_message_cost_micros"`
WhatsappWebhookVerifyToken string `json:"whatsapp_webhook_verify_token"`
WhatsappAppSecret string `json:"whatsapp_app_secret"`
EmailResendApiKey string `json:"email_resend_api_key"`
EmailSenderName string `json:"email_sender_name"`
EmailSenderAddress string `json:"email_sender_address"`
EmailReplyTo string `json:"email_reply_to"`
EmailDefaultRecipients string `json:"email_default_recipients"`
EmailBusinessName string `json:"email_business_name"`
EmailCsvColumns json.RawMessage `json:"email_csv_columns"`
EmailAttachmentFormat string `json:"email_attachment_format"`
EmailGroupByRegister bool `json:"email_group_by_register"`
EmailOldestFirst bool `json:"email_oldest_first"`
ReviewPlaceID string `json:"review_place_id"`
ReviewBaseUrl string `json:"review_base_url"`
ReviewTitle string `json:"review_title"`
ReviewDescription string `json:"review_description"`
GooglePlacesApiKey string `json:"google_places_api_key"`
WhatsappSender string `json:"whatsapp_sender"`
WhatsappBridgeUrl string `json:"whatsapp_bridge_url"`
WhatsappBridgeKey string `json:"whatsapp_bridge_key"`
WhatsappBridgeMessage string `json:"whatsapp_bridge_message"`
WhatsappPollQuestion string `json:"whatsapp_poll_question"`
WhatsappPollOptions string `json:"whatsapp_poll_options"`
WhatsappFeedbackMode string `json:"whatsapp_feedback_mode"`
WhatsappBridgeLinkMessage string `json:"whatsapp_bridge_link_message"`
WhatsappChannelUrl string `json:"whatsapp_channel_url"`
WhatsappMessageLogo bool `json:"whatsapp_message_logo"`
WhatsappFollowup bool `json:"whatsapp_followup"`
WhatsappFollowupGood string `json:"whatsapp_followup_good"`
WhatsappFollowupOkay string `json:"whatsapp_followup_okay"`
WhatsappFollowupBad string `json:"whatsapp_followup_bad"`
GoogleReviewsEnabled bool `json:"google_reviews_enabled"`
WhatsappHiddenFields string `json:"whatsapp_hidden_fields"`
WhatsappChannelFirst bool `json:"whatsapp_channel_first"`
WhatsappDeleteForMe bool `json:"whatsapp_delete_for_me"`
WhatsappDeletePollForMe bool `json:"whatsapp_delete_poll_for_me"`
UploadPagesFollowSystem bool `json:"upload_pages_follow_system"`
UnknownImagesAutoDelete bool `json:"unknown_images_auto_delete"`
TablePageSize int16 `json:"table_page_size"`
WhatsappWelcomeEarly bool `json:"whatsapp_welcome_early"`
BarcodeLabelDesign json.RawMessage `json:"barcode_label_design"`
WhatsappMessageNew bool `json:"whatsapp_message_new"`
WhatsappMessageReturning bool `json:"whatsapp_message_returning"`
WhatsappPollNew bool `json:"whatsapp_poll_new"`
WhatsappPollReturning bool `json:"whatsapp_poll_returning"`
WhatsappFollowupReturning bool `json:"whatsapp_followup_returning"`
}
type AppUpdateEvent ¶
type ApplyBranchSettlementTxResult ¶
type ApplyBranchSettlementTxResult struct {
Settlement BranchInvoiceSettlement
Payments []BranchInvoiceSettlementPayment
InvoiceUpdated bool
// Status is the resolved lifecycle of this settlement (one of the
// SettlementStatus* constants). Frozen is the shorthand the caller
// reacts to: the sale's shift was already closed, so nothing was
// replayed and the change is deliberately not surfaced.
Status string
Frozen bool
}
type ApplyWhatsAppBridgeTickParams ¶ added in v1.1.0
type ApplyWhatsAppBridgeTickRow ¶ added in v1.1.0
type ApplyWhatsAppDeliveryStatusParams ¶ added in v1.1.0
type AssetCategory ¶
type AttachWhatsAppPollParams ¶ added in v1.1.6
type AttributesValue ¶
type AuditAction ¶
type AuditAction string
const ( AuditActionCreate AuditAction = "create" AuditActionUpdate AuditAction = "update" AuditActionDelete AuditAction = "delete" )
func (*AuditAction) Scan ¶
func (e *AuditAction) Scan(src interface{}) error
type AuditLog ¶
type AuditLog struct {
ID int64 `json:"id"`
EntityType string `json:"entity_type"`
EntityID int64 `json:"entity_id"`
Action AuditAction `json:"action"`
Before pqtype.NullRawMessage `json:"before"`
After pqtype.NullRawMessage `json:"after"`
ActorID sql.NullInt64 `json:"actor_id"`
Source string `json:"source"`
CreatedAt time.Time `json:"created_at"`
}
type BatchSetClientPhoneFlagsParams ¶ added in v1.1.6
type BatchUpdateClientPhonesParams ¶ added in v1.1.3
type Branch ¶
type Branch struct {
ID int64 `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
IsActive bool `json:"is_active"`
LastSeenAt sql.NullTime `json:"last_seen_at"`
CreatedAt time.Time `json:"created_at"`
InventoryID sql.NullInt64 `json:"inventory_id"`
Timezone string `json:"timezone"`
QuickAccessInitializedAt sql.NullTime `json:"quick_access_initialized_at"`
HiddenFromReports bool `json:"hidden_from_reports"`
GooglePlaceID string `json:"google_place_id"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
WhatsappEnabled bool `json:"whatsapp_enabled"`
WhatsappHiddenFields sql.NullString `json:"whatsapp_hidden_fields"`
}
type BranchAttendanceChange ¶
type BranchAttendanceChange struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Kind string `json:"kind"`
SalespersonName string `json:"salesperson_name"`
AttendanceDate string `json:"attendance_date"`
OriginalTime string `json:"original_time"`
RequestedTime string `json:"requested_time"`
RequestedType string `json:"requested_type"`
Action string `json:"action"`
Status string `json:"status"`
Note string `json:"note"`
Actor string `json:"actor"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
RegisterID int64 `json:"register_id"`
}
type BranchAttendanceEvent ¶
type BranchAttendanceEvent struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
SalespersonName string `json:"salesperson_name"`
AttendanceUserID string `json:"attendance_user_id"`
EventDate string `json:"event_date"`
EventTime string `json:"event_time"`
EventAt string `json:"event_at"`
Type string `json:"type"`
Status string `json:"status"`
ReceivedAt time.Time `json:"received_at"`
ChangedBy string `json:"changed_by"`
ChangeNote string `json:"change_note"`
RemovedAt sql.NullTime `json:"removed_at"`
RemovedBy string `json:"removed_by"`
}
type BranchCashboxAccount ¶
type BranchCashboxAccount struct {
BranchID int64 `json:"branch_id"`
CashboxAccountID int64 `json:"cashbox_account_id"`
IsEnabled bool `json:"is_enabled"`
SortOrder sql.NullInt32 `json:"sort_order"`
Color sql.NullString `json:"color"`
CurrencyCode sql.NullString `json:"currency_code"`
UpdatedAt time.Time `json:"updated_at"`
}
type BranchCommand ¶
type BranchCommand struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
Status string `json:"status"`
Result pqtype.NullRawMessage `json:"result"`
Error sql.NullString `json:"error"`
IssuedBy int64 `json:"issued_by"`
CreatedAt time.Time `json:"created_at"`
CompletedAt sql.NullTime `json:"completed_at"`
RegisterID int64 `json:"register_id"`
}
type BranchCommandSummaryRow ¶
type BranchExpense ¶
type BranchExpense struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Description string `json:"description"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchCashboxAccountID int64 `json:"branch_cashbox_account_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
CategoryID sql.NullInt64 `json:"category_id"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
CancelledAt sql.NullTime `json:"cancelled_at"`
FromCentral bool `json:"from_central"`
}
type BranchExpenseImage ¶
type BranchInvoice ¶
type BranchInvoice struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Kind string `json:"kind"`
BranchInvoiceCode string `json:"branch_invoice_code"`
BranchCashboxAccountID int64 `json:"branch_cashbox_account_id"`
BranchShiftID int64 `json:"branch_shift_id"`
BranchInventoryID int64 `json:"branch_inventory_id"`
BranchClientID sql.NullInt64 `json:"branch_client_id"`
RelatedClientRef sql.NullString `json:"related_client_ref"`
Discount int16 `json:"discount"`
Subtotal int64 `json:"subtotal"`
DiscountedTotal int64 `json:"discounted_total"`
GrandTotal int64 `json:"grand_total"`
LoyaltyPointsDelta int64 `json:"loyalty_points_delta"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
SalespersonName string `json:"salesperson_name"`
Historical bool `json:"historical"`
ClientUid uuid.NullUUID `json:"client_uid"`
RegisterID int64 `json:"register_id"`
CancelledAt sql.NullTime `json:"cancelled_at"`
SalespersonID sql.NullInt64 `json:"salesperson_id"`
LbpTotal sql.NullInt64 `json:"lbp_total"`
LbpRate sql.NullInt64 `json:"lbp_rate"`
InvoiceDiscount int64 `json:"invoice_discount"`
InvoiceDiscountName string `json:"invoice_discount_name"`
}
type BranchInvoiceItem ¶
type BranchInvoiceItem struct {
ID int64 `json:"id"`
BranchInvoiceID int64 `json:"branch_invoice_id"`
BranchProductID int64 `json:"branch_product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
ProductUid uuid.NullUUID `json:"product_uid"`
Unknown bool `json:"unknown"`
Deal string `json:"deal"`
DealDiscount int64 `json:"deal_discount"`
InvoiceDiscount int64 `json:"invoice_discount"`
}
type BranchInvoiceItemParams ¶
type BranchInvoiceItemParams struct {
BranchProductID int64 `json:"branch_product_id"`
// Barcode is the SKU's globally-unique barcode -- the only identifier
// that resolves a branch line to a central product_variants row (see
// applySyncedProductVariant in kashi-pos). Empty from older kashi-pos
// builds; such lines are recorded but skip the central stock decrement.
Barcode string `json:"barcode"`
// ProductUID is the variant's shared identity (see 000093_sync_uid).
// When set it wins over Barcode for resolving the central variant;
// older tills leave it empty and fall back to the barcode.
ProductUID uuid.NullUUID `json:"product_uid"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
// A deal line (000202): the deal's name and what it took off the line.
Deal string `json:"deal"`
DealDiscount int64 `json:"deal_discount"`
// The line's share of the sale's invoice discount (000212), cents;
// LineTotal already has it off.
InvoiceDiscount int64 `json:"invoice_discount"`
// Unknown: the till rang this up as an "Unknown item" (its placeholder
// barcode, or the product the branch named for it). Such a line is stored
// unresolved and moves no stock until it is matched to a real product.
Unknown bool `json:"unknown"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
}
type BranchInvoicePayment ¶
type BranchInvoicePaymentParams ¶
type BranchInvoicePaymentParams struct {
AccountName string `json:"account_name"`
Amount int64 `json:"amount"`
// CouponCode is set only when this payment line was a coupon redeemed
// at checkout -- empty for every ordinary cash/card/account payment.
// See RedeemCoupon.
CouponCode string `json:"coupon_code"`
}
type BranchInvoiceSettlement ¶
type BranchInvoiceSettlement struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
SaleClientRef string `json:"sale_client_ref"`
GrandTotal int64 `json:"grand_total"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
Status string `json:"status"`
}
type BranchQuickAccessItem ¶
type BranchRegister ¶
type BranchRegister struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Code string `json:"code"`
Name string `json:"name"`
ApiKeyHash string `json:"api_key_hash"`
IsActive bool `json:"is_active"`
LastSeenAt sql.NullTime `json:"last_seen_at"`
ReportedSettings pqtype.NullRawMessage `json:"reported_settings"`
ReportedSettingsAt sql.NullTime `json:"reported_settings_at"`
CreatedAt time.Time `json:"created_at"`
QuickAccessMode string `json:"quick_access_mode"`
QuickAccessModeChangedAt time.Time `json:"quick_access_mode_changed_at"`
TargetReleaseID sql.NullInt64 `json:"target_release_id"`
AppVersion string `json:"app_version"`
AppFlavor string `json:"app_flavor"`
UpdateState string `json:"update_state"`
UpdateDetail string `json:"update_detail"`
UpdateProgress int32 `json:"update_progress"`
UpdateReportedAt sql.NullTime `json:"update_reported_at"`
HiddenFromReports bool `json:"hidden_from_reports"`
TargetForce bool `json:"target_force"`
}
type BranchSalespersonExistsParams ¶ added in v1.1.0
type BranchSetting ¶
type BranchSetting struct {
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
TaxRate float64 `json:"tax_rate"`
RoundingMode string `json:"rounding_mode"`
RoundingCurrency string `json:"rounding_currency"`
ExchangeRate int64 `json:"exchange_rate"`
ExchangeWindowHours int64 `json:"exchange_window_hours"`
MarketName string `json:"market_name"`
MarketPhone string `json:"market_phone"`
MarketDescription string `json:"market_description"`
ReturnPolicy string `json:"return_policy"`
Website string `json:"website"`
Instagram string `json:"instagram"`
SocialPlatforms json.RawMessage `json:"social_platforms"`
SocialHandles json.RawMessage `json:"social_handles"`
UpdatedAt time.Time `json:"updated_at"`
SearchButtonEnabled bool `json:"search_button_enabled"`
CustomItemDiscountsEnabled bool `json:"custom_item_discounts_enabled"`
CustomItemPricesEnabled bool `json:"custom_item_prices_enabled"`
PerUnitItemPricesEnabled bool `json:"per_unit_item_prices_enabled"`
PriceChangeManualOverrideMode bool `json:"price_change_manual_override_mode"`
InvoiceKeyboardMode bool `json:"invoice_keyboard_mode"`
ClientRequired bool `json:"client_required"`
PageUnlockClients bool `json:"page_unlock_clients"`
PageUnlockInventory bool `json:"page_unlock_inventory"`
PageUnlockTransfers bool `json:"page_unlock_transfers"`
PageUnlockAttendance bool `json:"page_unlock_attendance"`
PageUnlockSalespersons bool `json:"page_unlock_salespersons"`
PrinterSize string `json:"printer_size"`
ReceiptWidth int64 `json:"receipt_width"`
ReceiptHeight int64 `json:"receipt_height"`
ReceiptEnabled bool `json:"receipt_enabled"`
ReceiptFont string `json:"receipt_font"`
ReceiptBodyFont string `json:"receipt_body_font"`
ReceiptTitleSize float64 `json:"receipt_title_size"`
ReceiptBodySize float64 `json:"receipt_body_size"`
ReceiptCutoff bool `json:"receipt_cutoff"`
PrinterID string `json:"printer_id"`
ReceiptPrinter string `json:"receipt_printer"`
ScreenPort string `json:"screen_port"`
AkuvoxIp string `json:"akuvox_ip"`
AkuvoxUsername string `json:"akuvox_username"`
AttendanceEnabled bool `json:"attendance_enabled"`
AttendanceDuplicateIntervalSeconds int64 `json:"attendance_duplicate_interval_seconds"`
AttendanceCashierHistory bool `json:"attendance_cashier_history"`
ManagedLocally []string `json:"managed_locally"`
SplitPrimaryCurrency string `json:"split_primary_currency"`
SplitPrimaryFirst bool `json:"split_primary_first"`
SplitPrimaryStep int64 `json:"split_primary_step"`
OversellMode string `json:"oversell_mode"`
CloseShiftRequiresSync bool `json:"close_shift_requires_sync"`
SalespersonPerInvoiceRequired bool `json:"salesperson_per_invoice_required"`
OpeningFloatEnabled bool `json:"opening_float_enabled"`
CountOpeningCashOnClose bool `json:"count_opening_cash_on_close"`
OverchangeConfirmation bool `json:"overchange_confirmation"`
PageUnlockProducts bool `json:"page_unlock_products"`
HidePaymentMethodCurrency bool `json:"hide_payment_method_currency"`
AutoAppendLbpZeros bool `json:"auto_append_lbp_zeros"`
AutoCloseStaleShifts bool `json:"auto_close_stale_shifts"`
VisitorCounterEnabled bool `json:"visitor_counter_enabled"`
ShiftReceiptUploadMode int64 `json:"shift_receipt_upload_mode"`
BranchPhone string `json:"branch_phone"`
MaxOverpaymentCents int64 `json:"max_overpayment_cents"`
DefaultOpeningFloatUsd int64 `json:"default_opening_float_usd"`
DefaultOpeningFloatLbp int64 `json:"default_opening_float_lbp"`
DisplayPrefs json.RawMessage `json:"display_prefs"`
ScanByCodeEnabled bool `json:"scan_by_code_enabled"`
SoundsEnabled bool `json:"sounds_enabled"`
AttendanceManagerApprovalEnabled bool `json:"attendance_manager_approval_enabled"`
ShiftReportSignatures bool `json:"shift_report_signatures"`
ShiftReportUppercaseHeader bool `json:"shift_report_uppercase_header"`
AutoCoverNegativeLbp bool `json:"auto_cover_negative_lbp"`
ProductSearchCodeOnly bool `json:"product_search_code_only"`
PriceEditRestricted bool `json:"price_edit_restricted"`
PriceEditCodes string `json:"price_edit_codes"`
UnknownProductBarcode string `json:"unknown_product_barcode"`
ProductSearchHiddenFields string `json:"product_search_hidden_fields"`
ReceiptTheme string `json:"receipt_theme"`
ReceiptLayout string `json:"receipt_layout"`
DiscountToggle bool `json:"discount_toggle"`
DiscountToggleDefaultOff bool `json:"discount_toggle_default_off"`
DealToggle bool `json:"deal_toggle"`
}
type BranchShift ¶
type BranchShift struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
BranchShiftID int64 `json:"branch_shift_id"`
OpenedAt sql.NullTime `json:"opened_at"`
ClosedAt sql.NullTime `json:"closed_at"`
ClosingPersonName string `json:"closing_person_name"`
OpeningFloatUsd int64 `json:"opening_float_usd"`
OpeningFloatLbp int64 `json:"opening_float_lbp"`
ExpectedUsd int64 `json:"expected_usd"`
ExpectedLbp int64 `json:"expected_lbp"`
ExpectedVisa int64 `json:"expected_visa"`
ExpectedWhish int64 `json:"expected_whish"`
CountedUsd int64 `json:"counted_usd"`
CountedLbp int64 `json:"counted_lbp"`
CountedVisa int64 `json:"counted_visa"`
CountedWhish int64 `json:"counted_whish"`
VarianceUsd int64 `json:"variance_usd"`
VarianceLbp int64 `json:"variance_lbp"`
VarianceVisa int64 `json:"variance_visa"`
VarianceWhish int64 `json:"variance_whish"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
RegisterID int64 `json:"register_id"`
LbpRate int64 `json:"lbp_rate"`
}
type BranchShiftReceiptImage ¶
type BranchShiftUploadToken ¶
type BranchSyncConflict ¶
type BranchSyncConflict struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Entity string `json:"entity"`
Ref string `json:"ref"`
Kind string `json:"kind"`
BranchPayload json.RawMessage `json:"branch_payload"`
CentralClientID sql.NullInt64 `json:"central_client_id"`
Status string `json:"status"`
Resolution pqtype.NullRawMessage `json:"resolution"`
ResolvedBy sql.NullInt64 `json:"resolved_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type BranchTarget ¶
type BranchTarget struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
DateFrom time.Time `json:"date_from"`
DateTo time.Time `json:"date_to"`
TargetAmount int64 `json:"target_amount"`
Color string `json:"color"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
SeriesID sql.NullInt64 `json:"series_id"`
IsActive bool `json:"is_active"`
}
type BranchTargetSeries ¶
type BranchTargetSeries struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
TargetAmount int64 `json:"target_amount"`
Color string `json:"color"`
StartDay int32 `json:"start_day"`
IntervalCount int32 `json:"interval_count"`
Active bool `json:"active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type BranchUser ¶
type BranchVisitorEvent ¶
type BulkSetDiscountListItemsParams ¶ added in v1.1.1
type BulkSetDiscountListOptionItemsParams ¶ added in v1.1.6
type BumpAdminActivityParams ¶ added in v1.1.0
type BusyHoursSalesParams ¶ added in v1.1.0
type BusyHoursSalesRow ¶ added in v1.1.0
type BusyHoursVisitorsParams ¶ added in v1.1.0
type BusyHoursVisitorsRow ¶ added in v1.1.0
type CalendarEvent ¶
type CashboxAccount ¶
type ClaimEmailScheduleRunParams ¶ added in v1.1.0
type ClaimWhatsAppPollFollowupParams ¶ added in v1.1.0
type ClaimWhatsAppPollFollowupRow ¶ added in v1.1.0
type ClaimWhatsAppWelcomeParams ¶ added in v1.1.1
type Client ¶
type Client struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
TotalLoyaltyPoints int64 `json:"total_loyalty_points"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClientType string `json:"client_type"`
Uid uuid.UUID `json:"uid"`
IsActive bool `json:"is_active"`
BranchID sql.NullInt64 `json:"branch_id"`
PhoneValid bool `json:"phone_valid"`
PhoneCountry string `json:"phone_country"`
}
type ClientLink ¶
type ClientMonthlySpendRow ¶
ClientMonthlySpendRow is one month of the spend series.
type ClientPaymentMixRow ¶
ClientPaymentMixRow is one slice of the payment-mix breakdown.
type ClientProfileStats ¶
type ClientProfileStats struct {
TotalSpentCents int64
ItemsBought int64
FirstPurchaseAt *time.Time
}
ClientProfileStats holds aggregate purchase stats for one client.
type ClientRecentInvoiceRow ¶
type ClientRecentInvoiceRow struct {
ID int64
InvoiceCode string
GrandTotal int64
OccurredAt time.Time
BranchName string
ItemCount int64
PaymentMethods string // comma-separated
}
ClientRecentInvoiceRow is one row in the recent-purchases table.
type ClientSpend ¶ added in v1.1.6
type ClientSpend struct {
ClientID int64 `json:"client_id"`
TotalSpent int64 `json:"total_spent"`
GrossSpent int64 `json:"gross_spent"`
InvoiceCount int64 `json:"invoice_count"`
ItemCount int64 `json:"item_count"`
RefreshedAt time.Time `json:"refreshed_at"`
FirstPurchaseAt sql.NullTime `json:"first_purchase_at"`
}
type CompleteBranchCommandParams ¶
type CompleteBranchCommandParams struct {
ID int64 `json:"id"`
Status string `json:"status"`
Result pqtype.NullRawMessage `json:"result"`
Error sql.NullString `json:"error"`
}
type ConfirmBranchTransferTxParams ¶
type ConfirmBranchTransferTxParams struct {
BranchID int64 `json:"branch_id"`
TransferID int64 `json:"transfer_id"`
Note string `json:"note"`
Items []ConfirmBranchTransferItemParams `json:"items"`
}
type CountAssetsParams ¶
type CountAuditLogsParams ¶
type CountBranchInvoicesFilteredParams ¶
type CountBranchInvoicesFilteredParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
Search string `json:"search"`
RegisterID sql.NullInt64 `json:"register_id"`
Kind sql.NullString `json:"kind"`
Status sql.NullString `json:"status"`
DateFrom sql.NullTime `json:"date_from"`
DateTo sql.NullTime `json:"date_to"`
}
type CountClientsBySpendingCachedParams ¶ added in v1.1.6
type CountClientsBySpendingCachedParams struct {
ClientType sql.NullString `json:"client_type"`
Search sql.NullString `json:"search"`
PhoneValid sql.NullBool `json:"phone_valid"`
PhoneCountry sql.NullString `json:"phone_country"`
}
type CountClientsBySpendingParams ¶
type CountClientsBySpendingParams struct {
ClientType sql.NullString `json:"client_type"`
Search sql.NullString `json:"search"`
PhoneValid sql.NullBool `json:"phone_valid"`
PhoneCountry sql.NullString `json:"phone_country"`
BranchIds []int64 `json:"branch_ids"`
DateFrom sql.NullTime `json:"date_from"`
DateTo sql.NullTime `json:"date_to"`
Visit string `json:"visit"`
}
type CountCouponsParams ¶
type CountDiscountListRuleDecidedRow ¶ added in v1.1.7
type CountEmployeesParams ¶
type CountExpensesParams ¶
type CountExpensesParams struct {
CategoryID sql.NullInt64 `json:"category_id"`
Search sql.NullString `json:"search"`
}
type CountLatestAdditionsSinceParams ¶ added in v1.1.0
type CountLoanPaymentsParams ¶
type CountLoansParams ¶
type CountLoansParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
Origin sql.NullString `json:"origin"`
CategoryID sql.NullInt64 `json:"category_id"`
Search sql.NullString `json:"search"`
Status sql.NullString `json:"status"`
}
type CountLowStockProductsParams ¶
type CountLowStockProductsParams struct {
Status sql.NullString `json:"status"`
Search string `json:"search"`
}
type CountShiftsParams ¶
type CountSlowMovingProductsParams ¶
type CountSlowMovingProductsParams struct {
Category sql.NullString `json:"category"`
Search string `json:"search"`
}
type CountStockCountsParams ¶
type CountStockCountsParams struct {
InventoryID sql.NullInt64 `json:"inventory_id"`
Status NullStockCountStatus `json:"status"`
}
type CountStockMovementsParams ¶
type CountStockMovementsParams struct {
InventoryID sql.NullInt64 `json:"inventory_id"`
VariantID sql.NullInt64 `json:"variant_id"`
Reason NullStockMovementReason `json:"reason"`
ReferenceType sql.NullString `json:"reference_type"`
CreatedBy sql.NullInt64 `json:"created_by"`
FromDate sql.NullTime `json:"from_date"`
ToDate sql.NullTime `json:"to_date"`
}
type CountVisitorIPsParams ¶ added in v1.1.0
type CountWhatsAppMessagesParams ¶ added in v1.1.0
type CountWhatsAppRepliesParams ¶ added in v1.1.0
type Coupon ¶
type Coupon struct {
Code string `json:"code"`
Status CouponStatus `json:"status"`
ClientID sql.NullInt64 `json:"client_id"`
ValidUntil sql.NullTime `json:"valid_until"`
CreatedAt time.Time `json:"created_at"`
CategoryID sql.NullInt64 `json:"category_id"`
TypeID sql.NullInt64 `json:"type_id"`
ListID sql.NullInt64 `json:"list_id"`
ValueCents int64 `json:"value_cents"`
RedeemedBranchID sql.NullInt64 `json:"redeemed_branch_id"`
RedeemedInvoiceRef sql.NullString `json:"redeemed_invoice_ref"`
RedeemedAt sql.NullTime `json:"redeemed_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type CouponCategory ¶
type CouponList ¶
type CouponStatus ¶
type CouponStatus string
const ( CouponStatusActive CouponStatus = "active" CouponStatusInactive CouponStatus = "inactive" CouponStatusRedeemed CouponStatus = "redeemed" )
func (*CouponStatus) Scan ¶
func (e *CouponStatus) Scan(src interface{}) error
type CouponType ¶
type CouponType struct {
ID int64 `json:"id"`
Name string `json:"name"`
ValueCents int64 `json:"value_cents"`
CurrencyCode string `json:"currency_code"`
IsActive bool `json:"is_active"`
ReferenceOnly bool `json:"reference_only"`
CalculateOnCheckout bool `json:"calculate_on_checkout"`
CodeOptional bool `json:"code_optional"`
CategoryID sql.NullInt64 `json:"category_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type CreateAppReleaseParams ¶
type CreateAppReleaseParams struct {
Version string `json:"version"`
Flavor string `json:"flavor"`
FileName string `json:"file_name"`
FilePath string `json:"file_path"`
SizeBytes int64 `json:"size_bytes"`
Sha256 string `json:"sha256"`
Signature string `json:"signature"`
Notes string `json:"notes"`
UploadedBy sql.NullInt64 `json:"uploaded_by"`
}
type CreateAssetParams ¶
type CreateAuditLogParams ¶
type CreateAuditLogParams struct {
EntityType string `json:"entity_type"`
EntityID int64 `json:"entity_id"`
Action AuditAction `json:"action"`
Before pqtype.NullRawMessage `json:"before"`
After pqtype.NullRawMessage `json:"after"`
ActorID sql.NullInt64 `json:"actor_id"`
Source string `json:"source"`
}
type CreateBatchParams ¶
type CreateBatchTxParams ¶
type CreateBatchTxResult ¶
type CreateBranchAttendanceChangeParams ¶
type CreateBranchAttendanceChangeParams struct {
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Kind string `json:"kind"`
SalespersonName string `json:"salesperson_name"`
AttendanceDate string `json:"attendance_date"`
OriginalTime string `json:"original_time"`
RequestedTime string `json:"requested_time"`
RequestedType string `json:"requested_type"`
Action string `json:"action"`
Status string `json:"status"`
Note string `json:"note"`
Actor string `json:"actor"`
OccurredAt time.Time `json:"occurred_at"`
RegisterID int64 `json:"register_id"`
}
type CreateBranchAttendanceEventParams ¶
type CreateBranchAttendanceEventParams struct {
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
SalespersonName string `json:"salesperson_name"`
AttendanceUserID string `json:"attendance_user_id"`
EventDate string `json:"event_date"`
EventTime string `json:"event_time"`
EventAt string `json:"event_at"`
Type string `json:"type"`
Status string `json:"status"`
ChangedBy string `json:"changed_by"`
ChangeNote string `json:"change_note"`
}
type CreateBranchExpenseParams ¶
type CreateBranchExpenseParams struct {
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Description string `json:"description"`
CategoryID sql.NullInt64 `json:"category_id"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchCashboxAccountID int64 `json:"branch_cashbox_account_id"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
FromCentral bool `json:"from_central"`
}
type CreateBranchInvoiceItemParams ¶
type CreateBranchInvoiceItemParams struct {
BranchInvoiceID int64 `json:"branch_invoice_id"`
BranchProductID int64 `json:"branch_product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
ProductUid uuid.NullUUID `json:"product_uid"`
Unknown bool `json:"unknown"`
Deal string `json:"deal"`
DealDiscount int64 `json:"deal_discount"`
}
type CreateBranchInvoiceParams ¶
type CreateBranchInvoiceParams struct {
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Kind string `json:"kind"`
BranchInvoiceCode string `json:"branch_invoice_code"`
BranchCashboxAccountID int64 `json:"branch_cashbox_account_id"`
BranchShiftID int64 `json:"branch_shift_id"`
BranchInventoryID int64 `json:"branch_inventory_id"`
BranchClientID sql.NullInt64 `json:"branch_client_id"`
RelatedClientRef sql.NullString `json:"related_client_ref"`
Discount int16 `json:"discount"`
Subtotal int64 `json:"subtotal"`
DiscountedTotal int64 `json:"discounted_total"`
GrandTotal int64 `json:"grand_total"`
LoyaltyPointsDelta int64 `json:"loyalty_points_delta"`
OccurredAt time.Time `json:"occurred_at"`
SalespersonName string `json:"salesperson_name"`
Historical bool `json:"historical"`
ClientUid uuid.NullUUID `json:"client_uid"`
RegisterID int64 `json:"register_id"`
SalespersonID sql.NullInt64 `json:"salesperson_id"`
LbpTotal sql.NullInt64 `json:"lbp_total"`
LbpRate sql.NullInt64 `json:"lbp_rate"`
}
type CreateBranchInvoiceTxParams ¶
type CreateBranchInvoiceTxParams struct {
CreateBranchInvoiceParams
Items []BranchInvoiceItemParams `json:"items"`
Payments []BranchInvoicePaymentParams `json:"payments"`
// The sale's invoice discount (000212): what it took off, and the
// rule's name. 0 / "" for none.
InvoiceDiscount int64 `json:"invoice_discount"`
InvoiceDiscountName string `json:"invoice_discount_name"`
}
type CreateBranchInvoiceTxResult ¶
type CreateBranchInvoiceTxResult struct {
Invoice BranchInvoice `json:"invoice"`
Items []BranchInvoiceItem `json:"items"`
Payments []BranchInvoicePayment `json:"payments"`
// StockSkippedItems counts line items whose barcode did not resolve to
// a central variant (or whose branch has no linked inventory); those
// lines are stored but did not move central stock.
StockSkippedItems int `json:"stock_skipped_items"`
// Oversold lists the "oversold" alerts this sale opened or refreshed:
// lines that left central on-hand below zero.
Oversold []BranchSyncConflict `json:"oversold"`
}
type CreateBranchLoanParams ¶
type CreateBranchLoanParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
Description string `json:"description"`
CategoryID int64 `json:"category_id"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchCashboxAccountID sql.NullInt64 `json:"branch_cashbox_account_id"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
}
type CreateBranchParams ¶
type CreateBranchShiftParams ¶
type CreateBranchShiftParams struct {
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
BranchShiftID int64 `json:"branch_shift_id"`
OpenedAt sql.NullTime `json:"opened_at"`
ClosedAt sql.NullTime `json:"closed_at"`
ClosingPersonName string `json:"closing_person_name"`
OpeningFloatUsd int64 `json:"opening_float_usd"`
OpeningFloatLbp int64 `json:"opening_float_lbp"`
ExpectedUsd int64 `json:"expected_usd"`
ExpectedLbp int64 `json:"expected_lbp"`
ExpectedVisa int64 `json:"expected_visa"`
ExpectedWhish int64 `json:"expected_whish"`
CountedUsd int64 `json:"counted_usd"`
CountedLbp int64 `json:"counted_lbp"`
CountedVisa int64 `json:"counted_visa"`
CountedWhish int64 `json:"counted_whish"`
VarianceUsd int64 `json:"variance_usd"`
VarianceLbp int64 `json:"variance_lbp"`
VarianceVisa int64 `json:"variance_visa"`
VarianceWhish int64 `json:"variance_whish"`
OccurredAt time.Time `json:"occurred_at"`
RegisterID int64 `json:"register_id"`
LbpRate int64 `json:"lbp_rate"`
}
type CreateBranchTransferRequestParams ¶
type CreateBranchTransferRequestParams struct {
FromInventoryID int64 `json:"from_inventory_id"`
ToInventoryID int64 `json:"to_inventory_id"`
Type TransferType `json:"type"`
Note string `json:"note"`
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
RegisterID sql.NullInt64 `json:"register_id"`
}
type CreateBranchTransferRequestTxResult ¶
type CreateBranchTransferRequestTxResult struct {
Transfer Transfer `json:"transfer"`
Items []TransferItem `json:"items"`
}
type CreateBranchTxParams ¶
type CreateBranchTxResult ¶
type CreateBranchTxResult struct {
Branch Branch `json:"branch"`
Register BranchRegister `json:"register"`
Inventory Inventory `json:"inventory"`
}
type CreateBranchUserParams ¶
type CreateCashboxParams ¶
type CreateCentralLoanParams ¶
type CreateClientParams ¶
type CreateColorParams ¶
type CreateCouponListParams ¶
type CreateCouponParams ¶
type CreateCouponParams struct {
Code string `json:"code"`
Status CouponStatus `json:"status"`
TypeID sql.NullInt64 `json:"type_id"`
ValueCents int64 `json:"value_cents"`
ClientID sql.NullInt64 `json:"client_id"`
ValidUntil sql.NullTime `json:"valid_until"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type CreateCouponTypeParams ¶
type CreateCouponTypeParams struct {
Name string `json:"name"`
ValueCents int64 `json:"value_cents"`
CurrencyCode string `json:"currency_code"`
ReferenceOnly bool `json:"reference_only"`
CalculateOnCheckout bool `json:"calculate_on_checkout"`
CodeOptional bool `json:"code_optional"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type CreateCurrencyParams ¶
type CreateDealParams ¶ added in v1.1.6
type CreateDealParams struct {
Name string `json:"name"`
Kind string `json:"kind"`
BuyQty int32 `json:"buy_qty"`
GetQty int32 `json:"get_qty"`
Percent int16 `json:"percent"`
BundlePrice int64 `json:"bundle_price"`
FallbackPercent int16 `json:"fallback_percent"`
FallbackOnlyWithoutSet bool `json:"fallback_only_without_set"`
}
type CreateDiscountListRuleGroupParams ¶ added in v1.1.6
type CreateDiscountListRuleOptionParams ¶ added in v1.1.6
type CreateDiscountListRuleParams ¶ added in v1.1.6
type CreateDiscountListRuleParams struct {
DiscountListID int64 `json:"discount_list_id"`
Position int32 `json:"position"`
Name string `json:"name"`
CodePrefixes []string `json:"code_prefixes"`
ExceptCodePrefixes []string `json:"except_code_prefixes"`
Kinds []string `json:"kinds"`
Categories []string `json:"categories"`
SubCategories []string `json:"sub_categories"`
Origins []string `json:"origins"`
Brands []string `json:"brands"`
Discount int16 `json:"discount"`
DealID sql.NullInt64 `json:"deal_id"`
GroupID int64 `json:"group_id"`
IsEnabled bool `json:"is_enabled"`
MaxPrice sql.NullInt64 `json:"max_price"`
}
type CreateEmailReportParams ¶ added in v1.1.0
type CreateEmailReportParams struct {
SentBy string `json:"sent_by"`
Scope string `json:"scope"`
FromDay sql.NullTime `json:"from_day"`
ToDay sql.NullTime `json:"to_day"`
BranchID sql.NullInt64 `json:"branch_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
Label string `json:"label"`
Recipients string `json:"recipients"`
Bcc string `json:"bcc"`
Subject string `json:"subject"`
Filename string `json:"filename"`
InvoiceCount int32 `json:"invoice_count"`
TotalCents int64 `json:"total_cents"`
Status string `json:"status"`
Error string `json:"error"`
ProviderID string `json:"provider_id"`
Note string `json:"note"`
ScheduleID sql.NullInt64 `json:"schedule_id"`
}
type CreateEmailScheduleParams ¶ added in v1.1.0
type CreateEmailScheduleParams struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
Period string `json:"period"`
RegisterIds []int64 `json:"register_ids"`
Recipients string `json:"recipients"`
Bcc string `json:"bcc"`
Format string `json:"format"`
Note string `json:"note"`
SkipEmpty bool `json:"skip_empty"`
Frequency string `json:"frequency"`
AtMinute int32 `json:"at_minute"`
Weekdays []int32 `json:"weekdays"`
MonthDay int32 `json:"month_day"`
NextRunAt sql.NullTime `json:"next_run_at"`
CreatedBy string `json:"created_by"`
}
type CreateEmployeeParams ¶
type CreateEmployeeParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
Name string `json:"name"`
Role string `json:"role"`
Status string `json:"status"`
HiredOn sql.NullTime `json:"hired_on"`
BaseSalaryCents int64 `json:"base_salary_cents"`
CommissionCents int64 `json:"commission_cents"`
LateDeductionRateCents int64 `json:"late_deduction_rate_cents"`
LateDeductionUnit string `json:"late_deduction_unit"`
LateUnitsCenti int64 `json:"late_units_centi"`
}
type CreateEntryItemParams ¶
type CreateEntryItemParams struct {
CashboxID int64 `json:"cashbox_id"`
InventoryID int64 `json:"inventory_id"`
ReferenceType EntryReferenceType `json:"reference_type"`
ReferenceID int64 `json:"reference_id"`
Amount int64 `json:"amount"`
}
type CreateExpenseParams ¶
type CreateGooglePlaceSnapshotParams ¶ added in v1.1.0
type CreateInventoryParams ¶
type CreateInventoryParams struct {
Name string `json:"name"`
Type InventoryType `json:"type"`
Code string `json:"code"`
Longitude sql.NullFloat64 `json:"longitude"`
Latitude sql.NullFloat64 `json:"latitude"`
}
type CreateInvoiceDiscountParams ¶ added in v1.1.8
type CreateInvoiceDiscountParams struct {
Name string `json:"name"`
MinTotal int64 `json:"min_total"`
Kind string `json:"kind"`
Percent int16 `json:"percent"`
Amount int64 `json:"amount"`
AllBranches bool `json:"all_branches"`
ValidFrom sql.NullTime `json:"valid_from"`
ValidTo sql.NullTime `json:"valid_to"`
IsActive bool `json:"is_active"`
}
type CreateInvoiceParams ¶
type CreateInvoiceParams struct {
CashboxID int64 `json:"cashbox_id"`
ShiftID int64 `json:"shift_id"`
InvoiceCode string `json:"invoice_code"`
InvoiceIndex int64 `json:"invoice_index"`
Year int32 `json:"year"`
ClientID int64 `json:"client_id"`
InventoryID int64 `json:"inventory_id"`
Discount int16 `json:"discount"`
Subtotal int64 `json:"subtotal"`
DiscountedTotal int64 `json:"discounted_total"`
GrandTotal int64 `json:"grand_total"`
InvoiceTypeID int64 `json:"invoice_type_id"`
SalespersonID sql.NullInt64 `json:"salesperson_id"`
LoyaltyPointsDelta int64 `json:"loyalty_points_delta"`
}
type CreateInvoiceTypeParams ¶
type CreateListCouponParams ¶
type CreateLoanImageParams ¶ added in v1.1.0
type CreateLoanPaymentParams ¶
type CreateLoanUploadTokenParams ¶ added in v1.1.0
type CreatePriceListParams ¶
type CreateProductParams ¶
type CreateProductTxParams ¶
type CreateProductTxParams struct {
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
Discount int16 `json:"discount"`
AttributeValues []AttributesValue `json:"attribute_values"`
ColorID *int64 `json:"color_id"`
SizeID *int64 `json:"size_id"`
// ColorIDs/SizeIDs let one product be created with several variants at
// once -- one per colour x size combination. When both are empty the
// single ColorID/SizeID (or neither) is used, keeping the old
// one-variant behaviour.
ColorIDs []int64 `json:"color_ids"`
SizeIDs []int64 `json:"size_ids"`
Barcode *int64 `json:"barcode"`
// Price, when set, is written (in cents) to PriceListID for every
// variant created, so a new product can be sellable straight away.
// PriceListID nil means the default list.
Price *int64 `json:"price"`
PriceListID *int64 `json:"price_list_id"`
}
type CreateProductTxResult ¶
type CreateProductTxResult struct {
Product Product `json:"product"`
ProductAttributes []ProductsAttribute `json:"product_attributes"`
// Variant is the first created variant, kept for existing callers.
Variant ProductVariant `json:"variant"`
Variants []ProductVariant `json:"variants"`
}
type CreatePurchaseParams ¶
type CreatePurchaseTxParams ¶
type CreatePurchaseTxParams struct {
SupplierID int64 `json:"supplier_id"`
InventoryID int64 `json:"inventory_id"`
Code string `json:"code"`
CurrencyCode string `json:"currency_code"`
PurchasedAt sql.NullTime `json:"purchased_at"`
Note string `json:"note"`
Items []PurchaseItemParams `json:"items"`
}
type CreatePurchaseTxResult ¶
type CreatePurchaseTxResult struct {
Purchase Purchase `json:"purchase"`
Items []PurchaseItem `json:"items"`
}
type CreateRecurringExpenseParams ¶
type CreateRecurringExpenseParams struct {
Description string `json:"description"`
CategoryID sql.NullInt64 `json:"category_id"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
IntervalUnit string `json:"interval_unit"`
IntervalCount int32 `json:"interval_count"`
NextDueAt time.Time `json:"next_due_at"`
}
type CreateResolvedBranchInvoiceItemParams ¶ added in v1.1.1
type CreateResolvedBranchInvoiceItemParams struct {
BranchInvoiceID int64 `json:"branch_invoice_id"`
BranchProductID int64 `json:"branch_product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
ProductUid uuid.NullUUID `json:"product_uid"`
}
type CreateReviewLinkClickParams ¶ added in v1.1.0
type CreateSaleOptionParams ¶ added in v1.1.6
type CreateSalespersonParams ¶
type CreateSessionParams ¶
type CreateSizeParams ¶
type CreateStockCountParams ¶
type CreateStockMovementParams ¶
type CreateStockMovementParams struct {
InventoryID int64 `json:"inventory_id"`
VariantID int64 `json:"variant_id"`
Quantity int64 `json:"quantity"`
Reason StockMovementReason `json:"reason"`
ReferenceType sql.NullString `json:"reference_type"`
ReferenceID sql.NullInt64 `json:"reference_id"`
UnitCost sql.NullInt64 `json:"unit_cost"`
Note string `json:"note"`
CreatedBy sql.NullInt64 `json:"created_by"`
QuantityBefore int64 `json:"quantity_before"`
QuantityAfter int64 `json:"quantity_after"`
Metadata json.RawMessage `json:"metadata"`
BatchID sql.NullInt64 `json:"batch_id"`
}
type CreateSupplierParams ¶
type CreateSupplierParams struct {
Name string `json:"name"`
Phone string `json:"phone"`
Country string `json:"country"`
Address string `json:"address"`
AddressLatitude sql.NullFloat64 `json:"address_latitude"`
AddressLongitude sql.NullFloat64 `json:"address_longitude"`
}
type CreateTransferParams ¶
type CreateTransferParams struct {
FromInventoryID int64 `json:"from_inventory_id"`
ToInventoryID int64 `json:"to_inventory_id"`
Type TransferType `json:"type"`
Code string `json:"code"`
Note string `json:"note"`
}
type CreateTransferTxParams ¶
type CreateTransferTxParams struct {
FromInventoryID int64 `json:"from_inventory_id"`
ToInventoryID int64 `json:"to_inventory_id"`
Type TransferType `json:"type"`
Code string `json:"code"`
Note string `json:"note"`
Items []TransferItemParams `json:"items"`
}
type CreateTransferTxResult ¶
type CreateTransferTxResult struct {
Transfer Transfer `json:"transfer"`
Items []TransferItem `json:"items"`
}
type CreateUnknownItemImageParams ¶ added in v1.1.1
type CreateUnknownItemSessionParams ¶ added in v1.1.1
type CreateUnknownItemSlotParams ¶ added in v1.1.1
type CreateUserParams ¶
type CreateWhatsAppMessageParams ¶ added in v1.1.0
type CreateWhatsAppMessageParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
InvoiceCode string `json:"invoice_code"`
ClientName string `json:"client_name"`
ClientPhone string `json:"client_phone"`
GrandTotalCents int64 `json:"grand_total_cents"`
ItemCount int32 `json:"item_count"`
RuleID sql.NullInt64 `json:"rule_id"`
RuleName string `json:"rule_name"`
TemplateName string `json:"template_name"`
Status string `json:"status"`
Reason string `json:"reason"`
Wamid string `json:"wamid"`
CostMicros int64 `json:"cost_micros"`
ReviewCode string `json:"review_code"`
Sender string `json:"sender"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
PollRef string `json:"poll_ref"`
BridgeRef string `json:"bridge_ref"`
IsTest bool `json:"is_test"`
Body string `json:"body"`
PollQuestion string `json:"poll_question"`
PollOptions string `json:"poll_options"`
}
type CreateWhatsAppNumberParams ¶ added in v1.1.0
type CreateWhatsAppReplyParams ¶ added in v1.1.0
type CreateWhatsAppRuleParams ¶ added in v1.1.0
type CreateWhatsAppRuleParams struct {
Position int32 `json:"position"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Action string `json:"action"`
Conditions json.RawMessage `json:"conditions"`
TemplateName string `json:"template_name"`
TemplateLang string `json:"template_lang"`
TemplateParams string `json:"template_params"`
}
type Currency ¶
type Currency struct {
Code string `json:"code"`
Name string `json:"name"`
Symbol string `json:"symbol"`
IsDefault bool `json:"is_default"`
ValueInDefaultCurrency int64 `json:"value_in_default_currency"`
IsActive bool `json:"is_active"`
UnitsPerUsdMicros int64 `json:"units_per_usd_micros"`
CashRoundingUnit int64 `json:"cash_rounding_unit"`
UpdatedAt time.Time `json:"updated_at"`
}
type DashboardActivitiesListRow ¶
type DashboardActivitiesListRow struct {
Activity string `json:"activity"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Details string `json:"details"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
SyncedAt time.Time `json:"synced_at"`
Person string `json:"person"`
PersonColor string `json:"person_color"`
TotalCount int64 `json:"total_count"`
}
type DashboardDueLoansParams ¶
type DashboardSalesListRow ¶
type DashboardTargetListRow ¶
type DashboardTargetListRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
DateFrom time.Time `json:"date_from"`
DateTo time.Time `json:"date_to"`
TargetAmount int64 `json:"target_amount"`
Color string `json:"color"`
Revenue int64 `json:"revenue"`
}
type DashboardTopDueLoansRow ¶
type Deal ¶ added in v1.1.6
type Deal struct {
ID int64 `json:"id"`
Uid uuid.UUID `json:"uid"`
Name string `json:"name"`
Kind string `json:"kind"`
BuyQty int32 `json:"buy_qty"`
GetQty int32 `json:"get_qty"`
Percent int16 `json:"percent"`
BundlePrice int64 `json:"bundle_price"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FallbackPercent int16 `json:"fallback_percent"`
FallbackOnlyWithoutSet bool `json:"fallback_only_without_set"`
}
type DefaultBranchSetting ¶
type DefaultBranchSetting struct {
ID int16 `json:"id"`
Settings json.RawMessage `json:"settings"`
UpdatedAt time.Time `json:"updated_at"`
}
type DeleteDiscountListOptionItemParams ¶ added in v1.1.6
type DeleteDiscountListOptionItemsParams ¶ added in v1.1.6
type DeleteDiscountListRuleGroupsExceptParams ¶ added in v1.1.7
type DeleteDiscountListRulesExceptParams ¶ added in v1.1.7
type DeleteFailedWhatsAppMessagesForInvoiceParams ¶ added in v1.1.1
type DeleteUnknownItemSlotsNotInParams ¶ added in v1.1.8
type DiscountList ¶
type DiscountList struct {
ID int64 `json:"id"`
Name string `json:"name"`
IsActive bool `json:"is_active"`
IsDefault bool `json:"is_default"`
ValidFrom time.Time `json:"valid_from"`
ValidTo time.Time `json:"valid_to"`
CreatedAt time.Time `json:"created_at"`
Uid uuid.UUID `json:"uid"`
UpdatedAt time.Time `json:"updated_at"`
IsSpecial bool `json:"is_special"`
}
type DiscountListBranch ¶
type DiscountListBranchRemoval ¶ added in v1.1.7
type DiscountListItem ¶
type DiscountListOptionItem ¶ added in v1.1.6
type DiscountListRule ¶ added in v1.1.6
type DiscountListRule struct {
ID int64 `json:"id"`
DiscountListID int64 `json:"discount_list_id"`
Position int32 `json:"position"`
Name string `json:"name"`
CodePrefixes []string `json:"code_prefixes"`
ExceptCodePrefixes []string `json:"except_code_prefixes"`
Kinds []string `json:"kinds"`
Categories []string `json:"categories"`
SubCategories []string `json:"sub_categories"`
Origins []string `json:"origins"`
Brands []string `json:"brands"`
Discount int16 `json:"discount"`
CreatedAt time.Time `json:"created_at"`
DealID sql.NullInt64 `json:"deal_id"`
IsEnabled bool `json:"is_enabled"`
GroupID int64 `json:"group_id"`
MaxPrice sql.NullInt64 `json:"max_price"`
}
type DiscountListRuleGroup ¶ added in v1.1.6
type DiscountListRuleGroupInput ¶ added in v1.1.6
type DiscountListRuleGroupInput struct {
// ID is the saved group this is, 0 for a new one.
ID int64
Name string
Enabled bool
Rules []DiscountListRuleInput
}
DiscountListRuleGroupInput is one named set of rules (000203), switched on and off as one.
type DiscountListRuleInput ¶ added in v1.1.6
type DiscountListRuleInput struct {
// ID is the saved rule this is, 0 for a new one.
ID int64
Rule CreateDiscountListRuleParams
Options map[int64]int16
}
DiscountListRuleInput is one rule as the list page sends it: the rule and its option discounts (sale option id -> discount).
type DiscountListRuleOption ¶ added in v1.1.6
type DiscountRuleFact ¶ added in v1.1.6
type DiscountRuleFact struct {
ProductVariantID int64 `json:"product_variant_id"`
ProductID int64 `json:"product_id"`
Code interface{} `json:"code"`
Kind string `json:"kind"`
Category string `json:"category"`
SubCategory string `json:"sub_category"`
Origin string `json:"origin"`
Brand string `json:"brand"`
}
type DiscountRulesDirty ¶ added in v1.1.6
type DiscountRulesDirty struct {
ProductID int64 `json:"product_id"`
}
type EmailReport ¶ added in v1.1.0
type EmailReport struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at"`
SentBy string `json:"sent_by"`
Scope string `json:"scope"`
FromDay sql.NullTime `json:"from_day"`
ToDay sql.NullTime `json:"to_day"`
BranchID sql.NullInt64 `json:"branch_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
Label string `json:"label"`
Recipients string `json:"recipients"`
Subject string `json:"subject"`
Filename string `json:"filename"`
InvoiceCount int32 `json:"invoice_count"`
TotalCents int64 `json:"total_cents"`
Status string `json:"status"`
Error string `json:"error"`
ProviderID string `json:"provider_id"`
Note string `json:"note"`
ScheduleID sql.NullInt64 `json:"schedule_id"`
Bcc string `json:"bcc"`
}
type EmailSchedule ¶ added in v1.1.0
type EmailSchedule struct {
ID int64 `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Period string `json:"period"`
RegisterIds []int64 `json:"register_ids"`
Recipients string `json:"recipients"`
Format string `json:"format"`
Note string `json:"note"`
SkipEmpty bool `json:"skip_empty"`
Frequency string `json:"frequency"`
AtMinute int32 `json:"at_minute"`
Weekdays []int32 `json:"weekdays"`
MonthDay int32 `json:"month_day"`
NextRunAt sql.NullTime `json:"next_run_at"`
LastRunAt sql.NullTime `json:"last_run_at"`
LastStatus string `json:"last_status"`
LastError string `json:"last_error"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Bcc string `json:"bcc"`
}
type Employee ¶
type Employee struct {
ID int64 `json:"id"`
BranchID sql.NullInt64 `json:"branch_id"`
Name string `json:"name"`
Role string `json:"role"`
Status string `json:"status"`
HiredOn sql.NullTime `json:"hired_on"`
BaseSalaryCents int64 `json:"base_salary_cents"`
CommissionCents int64 `json:"commission_cents"`
LateDeductionRateCents int64 `json:"late_deduction_rate_cents"`
LateDeductionUnit string `json:"late_deduction_unit"`
LateUnitsCenti int64 `json:"late_units_centi"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type EntryReferenceType ¶
type EntryReferenceType string
const ( EntryReferenceTypeSalesInvoice EntryReferenceType = "sales_invoice" EntryReferenceTypeReturnInvoice EntryReferenceType = "return_invoice" EntryReferenceTypeExpense EntryReferenceType = "expense" EntryReferenceTypePurchase EntryReferenceType = "purchase" )
func (*EntryReferenceType) Scan ¶
func (e *EntryReferenceType) Scan(src interface{}) error
type Expense ¶
type Expense struct {
ID int64 `json:"id"`
Description string `json:"description"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
CreatedAt time.Time `json:"created_at"`
RecurringExpenseID sql.NullInt64 `json:"recurring_expense_id"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type ExpenseCategory ¶
type FindUnknownInvoiceItemParams ¶ added in v1.1.1
type GetAssetTreemapDataRow ¶
type GetAssetTreemapDataRow struct {
InventoryID int64 `json:"inventory_id"`
InventoryName string `json:"inventory_name"`
CategoryID int64 `json:"category_id"`
CategoryName string `json:"category_name"`
CategoryColor string `json:"category_color"`
AssetID int64 `json:"asset_id"`
AssetName string `json:"asset_name"`
AssetCode string `json:"asset_code"`
AssetCost int64 `json:"asset_cost"`
Quantity int64 `json:"quantity"`
}
type GetBatchRow ¶
type GetBatchRow struct {
ID int64 `json:"id"`
Code string `json:"code"`
PurchaseID sql.NullInt64 `json:"purchase_id"`
InventoryID sql.NullInt64 `json:"inventory_id"`
Note string `json:"note"`
CreatedAt time.Time `json:"created_at"`
PurchaseCode sql.NullString `json:"purchase_code"`
SupplierName sql.NullString `json:"supplier_name"`
InventoryName sql.NullString `json:"inventory_name"`
ItemCount int64 `json:"item_count"`
}
type GetBranchInvoiceByCodeParams ¶ added in v1.1.0
type GetBranchLoanByClientRefParams ¶
type GetBranchLoanByClientRefParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
}
type GetBranchTransferByClientRefParams ¶
type GetBranchTransferByClientRefParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
}
type GetClientLinkParams ¶
type GetEmailSettingsRow ¶ added in v1.1.0
type GetEmailSettingsRow struct {
EmailSenderName string `json:"email_sender_name"`
EmailSenderAddress string `json:"email_sender_address"`
EmailReplyTo string `json:"email_reply_to"`
EmailDefaultRecipients string `json:"email_default_recipients"`
EmailBusinessName string `json:"email_business_name"`
EmailCsvColumns json.RawMessage `json:"email_csv_columns"`
EmailAttachmentFormat string `json:"email_attachment_format"`
EmailGroupByRegister bool `json:"email_group_by_register"`
EmailOldestFirst bool `json:"email_oldest_first"`
}
type GetFirstActiveVariantBarcodeByCodeRow ¶ added in v1.1.3
type GetInventoryStockParams ¶
type GetLowStockSummaryRow ¶
type GetPurchaseRow ¶
type GetPurchaseRow struct {
ID int64 `json:"id"`
SupplierID int64 `json:"supplier_id"`
PurchasedAt time.Time `json:"purchased_at"`
InventoryID sql.NullInt64 `json:"inventory_id"`
Code string `json:"code"`
CurrencyCode string `json:"currency_code"`
Subtotal int64 `json:"subtotal"`
GrandTotal int64 `json:"grand_total"`
Status PurchaseStatus `json:"status"`
ReceivedAt sql.NullTime `json:"received_at"`
Note string `json:"note"`
SupplierName string `json:"supplier_name"`
InventoryName sql.NullString `json:"inventory_name"`
}
type GetRegisterTargetReleaseRow ¶ added in v1.1.0
type GetRegisterTargetReleaseRow struct {
ID int64 `json:"id"`
Version string `json:"version"`
Flavor string `json:"flavor"`
FileName string `json:"file_name"`
FilePath string `json:"file_path"`
SizeBytes int64 `json:"size_bytes"`
Sha256 string `json:"sha256"`
Signature string `json:"signature"`
Notes string `json:"notes"`
UploadedBy sql.NullInt64 `json:"uploaded_by"`
CreatedAt time.Time `json:"created_at"`
TargetForce bool `json:"target_force"`
}
type GetReviewSettingsRow ¶ added in v1.1.0
type GetReviewSettingsRow struct {
ReviewPlaceID string `json:"review_place_id"`
ReviewBaseUrl string `json:"review_base_url"`
ReviewTitle string `json:"review_title"`
ReviewDescription string `json:"review_description"`
GooglePlacesApiKey string `json:"google_places_api_key"`
GoogleReviewsEnabled bool `json:"google_reviews_enabled"`
}
type GetSalespersonByAttendanceIDParams ¶ added in v1.1.0
type GetSlowMoverSummaryRow ¶
type GetUnknownItemSessionByRefParams ¶ added in v1.1.1
type GetUnknownItemSlotByRefParams ¶ added in v1.1.1
type GetUnknownItemSlotForResolveRow ¶ added in v1.1.1
type GetUnknownItemSlotForResolveRow struct {
ID int64 `json:"id"`
SessionID int64 `json:"session_id"`
SlotRef string `json:"slot_ref"`
Position int32 `json:"position"`
Label string `json:"label"`
UnitPrice int64 `json:"unit_price"`
Discount int16 `json:"discount"`
ImageID sql.NullInt64 `json:"image_id"`
ResolvedVariantID sql.NullInt64 `json:"resolved_variant_id"`
ResolvedAt sql.NullTime `json:"resolved_at"`
WaivedAt sql.NullTime `json:"waived_at"`
WaivedBy string `json:"waived_by"`
LineRef string `json:"line_ref"`
BranchID int64 `json:"branch_id"`
BranchInvoiceID sql.NullInt64 `json:"branch_invoice_id"`
}
type GetUserAccessRow ¶
type GetVariantForLabelRow ¶
type GetVariantForLabelRow struct {
ID int64 `json:"id"`
Barcode string `json:"barcode"`
Price sql.NullInt64 `json:"price"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
Brand string `json:"brand"`
}
type GetWarehouseTreemapDataRow ¶
type GetWarehouseTreemapDataRow struct {
InventoryID int64 `json:"inventory_id"`
InventoryName string `json:"inventory_name"`
CategoryID int64 `json:"category_id"`
CategoryName string `json:"category_name"`
CategoryColor string `json:"category_color"`
ProductID int64 `json:"product_id"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
VariantID int64 `json:"variant_id"`
Barcode string `json:"barcode"`
VariantCost int64 `json:"variant_cost"`
ColorName string `json:"color_name"`
ColorHex string `json:"color_hex"`
Quantity int64 `json:"quantity"`
}
type GetWhatsAppChatMessageMediaRow ¶ added in v1.1.1
type GetWhatsAppMessageByReviewCodeRow ¶ added in v1.1.0
type GetWhatsAppMessageWithBranchRow ¶ added in v1.1.0
type GetWhatsAppMessageWithBranchRow struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at"`
BranchID sql.NullInt64 `json:"branch_id"`
InvoiceCode string `json:"invoice_code"`
ClientName string `json:"client_name"`
ClientPhone string `json:"client_phone"`
GrandTotalCents int64 `json:"grand_total_cents"`
ItemCount int32 `json:"item_count"`
RuleID sql.NullInt64 `json:"rule_id"`
RuleName string `json:"rule_name"`
TemplateName string `json:"template_name"`
Status string `json:"status"`
Reason string `json:"reason"`
Wamid string `json:"wamid"`
CostMicros int64 `json:"cost_micros"`
DeliveryStatus string `json:"delivery_status"`
DeliveredAt sql.NullTime `json:"delivered_at"`
ReadAt sql.NullTime `json:"read_at"`
DeliveryError string `json:"delivery_error"`
Billable sql.NullBool `json:"billable"`
PricingCategory string `json:"pricing_category"`
ReviewCode string `json:"review_code"`
ReviewClickedAt sql.NullTime `json:"review_clicked_at"`
Sender string `json:"sender"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
PollRef string `json:"poll_ref"`
PollRating sql.NullInt16 `json:"poll_rating"`
PollAnswer string `json:"poll_answer"`
PollVotedAt sql.NullTime `json:"poll_voted_at"`
PollFollowupAt sql.NullTime `json:"poll_followup_at"`
BridgeRef string `json:"bridge_ref"`
IsTest bool `json:"is_test"`
Body string `json:"body"`
PollQuestion string `json:"poll_question"`
PollOptions string `json:"poll_options"`
FollowupBody string `json:"followup_body"`
BranchName string `json:"branch_name"`
BranchHiddenFields sql.NullString `json:"branch_hidden_fields"`
}
type GetWhatsAppPollReplyMediaRow ¶ added in v1.1.0
type GetWhatsAppSenderSettingsRow ¶ added in v1.1.0
type GetWhatsAppSenderSettingsRow struct {
WhatsappSender string `json:"whatsapp_sender"`
WhatsappBridgeUrl string `json:"whatsapp_bridge_url"`
WhatsappBridgeKey string `json:"whatsapp_bridge_key"`
WhatsappBridgeMessage string `json:"whatsapp_bridge_message"`
WhatsappFeedbackMode string `json:"whatsapp_feedback_mode"`
WhatsappBridgeLinkMessage string `json:"whatsapp_bridge_link_message"`
WhatsappChannelUrl string `json:"whatsapp_channel_url"`
WhatsappPollQuestion string `json:"whatsapp_poll_question"`
WhatsappPollOptions string `json:"whatsapp_poll_options"`
WhatsappMessageLogo bool `json:"whatsapp_message_logo"`
WhatsappFollowup bool `json:"whatsapp_followup"`
WhatsappFollowupGood string `json:"whatsapp_followup_good"`
WhatsappFollowupOkay string `json:"whatsapp_followup_okay"`
WhatsappFollowupBad string `json:"whatsapp_followup_bad"`
WhatsappHiddenFields string `json:"whatsapp_hidden_fields"`
WhatsappChannelFirst bool `json:"whatsapp_channel_first"`
WhatsappWelcomeEarly bool `json:"whatsapp_welcome_early"`
WhatsappDeleteForMe bool `json:"whatsapp_delete_for_me"`
WhatsappDeletePollForMe bool `json:"whatsapp_delete_poll_for_me"`
WhatsappFollowupReturning bool `json:"whatsapp_followup_returning"`
WhatsappMessageNew bool `json:"whatsapp_message_new"`
WhatsappMessageReturning bool `json:"whatsapp_message_returning"`
WhatsappPollNew bool `json:"whatsapp_poll_new"`
WhatsappPollReturning bool `json:"whatsapp_poll_returning"`
}
type GetWhatsAppSettingsRow ¶
type GetWhatsAppSettingsRow struct {
WhatsappEnabled bool `json:"whatsapp_enabled"`
WhatsappPhoneNumberID string `json:"whatsapp_phone_number_id"`
WhatsappAccessToken string `json:"whatsapp_access_token"`
WhatsappTemplateName string `json:"whatsapp_template_name"`
WhatsappTemplateLang string `json:"whatsapp_template_lang"`
WhatsappTemplateParams string `json:"whatsapp_template_params"`
WhatsappWebhookVerifyToken string `json:"whatsapp_webhook_verify_token"`
WhatsappAppSecret string `json:"whatsapp_app_secret"`
}
type GooglePlaceSnapshot ¶ added in v1.1.0
type GooglePlaceSnapshotBeforeParams ¶ added in v1.1.0
type GoogleReview ¶ added in v1.1.0
type GoogleReview struct {
PlaceID string `json:"place_id"`
ReviewName string `json:"review_name"`
Author string `json:"author"`
AuthorPhoto string `json:"author_photo"`
Rating int32 `json:"rating"`
Body string `json:"body"`
PublishedAt sql.NullTime `json:"published_at"`
FetchedAt time.Time `json:"fetched_at"`
}
type HomeActivityFeedParams ¶ added in v1.1.0
type HomeActivityFeedRow ¶ added in v1.1.0
type HomeActivityFeedRow struct {
Activity string `json:"activity"`
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Details string `json:"details"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
SyncedAt time.Time `json:"synced_at"`
Person string `json:"person"`
PersonColor string `json:"person_color"`
}
type HomeActivityResolution ¶ added in v1.1.0
type InventoriesAsset ¶
type Inventory ¶
type Inventory struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type InventoryType `json:"type"`
Code string `json:"code"`
Longitude sql.NullFloat64 `json:"longitude"`
Latitude sql.NullFloat64 `json:"latitude"`
CreatedAt time.Time `json:"created_at"`
}
type InventoryStock ¶
type InventoryType ¶
type InventoryType string
const ( InventoryTypeWarehouse InventoryType = "warehouse" InventoryTypeStore InventoryType = "store" )
func (*InventoryType) Scan ¶
func (e *InventoryType) Scan(src interface{}) error
type Invoice ¶
type Invoice struct {
ID int64 `json:"id"`
CashboxID int64 `json:"cashbox_id"`
ShiftID int64 `json:"shift_id"`
InvoiceCode string `json:"invoice_code"`
InvoiceIndex int64 `json:"invoice_index"`
Year int32 `json:"year"`
ClientID int64 `json:"client_id"`
InventoryID int64 `json:"inventory_id"`
Discount int16 `json:"discount"`
Subtotal int64 `json:"subtotal"`
DiscountedTotal int64 `json:"discounted_total"`
GrandTotal int64 `json:"grand_total"`
CreatedAt time.Time `json:"created_at"`
InvoiceTypeID int64 `json:"invoice_type_id"`
SalespersonID sql.NullInt64 `json:"salesperson_id"`
LoyaltyPointsDelta int64 `json:"loyalty_points_delta"`
}
type InvoiceDiscount ¶ added in v1.1.8
type InvoiceDiscount struct {
ID int64 `json:"id"`
Uid uuid.UUID `json:"uid"`
Name string `json:"name"`
MinTotal int64 `json:"min_total"`
Kind string `json:"kind"`
Percent int16 `json:"percent"`
Amount int64 `json:"amount"`
AllBranches bool `json:"all_branches"`
ValidFrom sql.NullTime `json:"valid_from"`
ValidTo sql.NullTime `json:"valid_to"`
IsActive bool `json:"is_active"`
DeletedAt sql.NullTime `json:"deleted_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type InvoiceDiscountBranch ¶ added in v1.1.8
type InvoiceIndex ¶
type InvoicePayment ¶
type InvoiceProduct ¶
type InvoiceProduct struct {
InvoiceID int64 `json:"invoice_id"`
ProductID int64 `json:"product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
VariantID sql.NullInt64 `json:"variant_id"`
UnitCost int64 `json:"unit_cost"`
}
type InvoiceType ¶
type LinkUnknownItemSessionParams ¶ added in v1.1.1
type ListAdminActivitiesRow ¶
type ListAdminActivitiesRow struct {
ID int64 `json:"id"`
Method string `json:"method"`
Route string `json:"route"`
EntityID sql.NullInt64 `json:"entity_id"`
Summary string `json:"summary"`
Detail string `json:"detail"`
CreatedAt time.Time `json:"created_at"`
RepeatCount int32 `json:"repeat_count"`
ReleaseType string `json:"release_type"`
UserID sql.NullInt64 `json:"user_id"`
UserName string `json:"user_name"`
UserAvatarColor string `json:"user_avatar_color"`
}
type ListAllClientPhonesRow ¶ added in v1.1.3
type ListAppReleasesRow ¶
type ListAppReleasesRow struct {
ID int64 `json:"id"`
Version string `json:"version"`
Flavor string `json:"flavor"`
FileName string `json:"file_name"`
FilePath string `json:"file_path"`
SizeBytes int64 `json:"size_bytes"`
Sha256 string `json:"sha256"`
Signature string `json:"signature"`
Notes string `json:"notes"`
UploadedBy sql.NullInt64 `json:"uploaded_by"`
CreatedAt time.Time `json:"created_at"`
RunningCount int64 `json:"running_count"`
TargetCount int64 `json:"target_count"`
}
type ListAppUpdateEventsRow ¶
type ListAppUpdateEventsRow struct {
ID int64 `json:"id"`
RegisterID int64 `json:"register_id"`
ReleaseID sql.NullInt64 `json:"release_id"`
AppVersion string `json:"app_version"`
State string `json:"state"`
Detail string `json:"detail"`
CreatedAt time.Time `json:"created_at"`
RegisterCode string `json:"register_code"`
RegisterName string `json:"register_name"`
BranchName string `json:"branch_name"`
ReleaseVersion sql.NullString `json:"release_version"`
}
type ListAssetsPageParams ¶
type ListAuditLogsParams ¶
type ListAuditLogsParams struct {
EntityType sql.NullString `json:"entity_type"`
EntityID sql.NullInt64 `json:"entity_id"`
Action NullAuditAction `json:"action"`
ActorID sql.NullInt64 `json:"actor_id"`
FromDate sql.NullTime `json:"from_date"`
ToDate sql.NullTime `json:"to_date"`
PageOffset int32 `json:"page_offset"`
PageLimit int32 `json:"page_limit"`
}
type ListAuditLogsRow ¶
type ListAuditLogsRow struct {
ID int64 `json:"id"`
EntityType string `json:"entity_type"`
EntityID int64 `json:"entity_id"`
Action AuditAction `json:"action"`
Before pqtype.NullRawMessage `json:"before"`
After pqtype.NullRawMessage `json:"after"`
ActorID sql.NullInt64 `json:"actor_id"`
Source string `json:"source"`
CreatedAt time.Time `json:"created_at"`
ActorName string `json:"actor_name"`
}
type ListAutoDeletableUnknownItemImagesParams ¶ added in v1.1.1
type ListAutoDeletableUnknownItemImagesRow ¶ added in v1.1.1
type ListBatchItemsStatsRow ¶
type ListBatchItemsStatsRow struct {
BatchItemID int64 `json:"batch_item_id"`
BatchID int64 `json:"batch_id"`
VariantID int64 `json:"variant_id"`
QuantityBought int64 `json:"quantity_bought"`
RemainingQuantity int64 `json:"remaining_quantity"`
UnitCost int64 `json:"unit_cost"`
ProductID int64 `json:"product_id"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
VariantBarcode string `json:"variant_barcode"`
LowStockThreshold int64 `json:"low_stock_threshold"`
QuantitySold int64 `json:"quantity_sold"`
Revenue int64 `json:"revenue"`
}
type ListBatchesParams ¶
type ListBatchesRow ¶
type ListBatchesRow struct {
ID int64 `json:"id"`
Code string `json:"code"`
PurchaseID sql.NullInt64 `json:"purchase_id"`
InventoryID sql.NullInt64 `json:"inventory_id"`
Note string `json:"note"`
CreatedAt time.Time `json:"created_at"`
PurchaseCode sql.NullString `json:"purchase_code"`
SupplierName sql.NullString `json:"supplier_name"`
InventoryName sql.NullString `json:"inventory_name"`
ItemCount int64 `json:"item_count"`
}
type ListBranchAttendanceEventsInRangeParams ¶ added in v1.1.0
type ListBranchClientUIDsRow ¶
type ListBranchCommandsPageRow ¶
type ListBranchCommandsPageRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
Status string `json:"status"`
Result pqtype.NullRawMessage `json:"result"`
Error sql.NullString `json:"error"`
IssuedBy int64 `json:"issued_by"`
CreatedAt time.Time `json:"created_at"`
CompletedAt sql.NullTime `json:"completed_at"`
RegisterID int64 `json:"register_id"`
RegisterCode string `json:"register_code"`
BranchName string `json:"branch_name"`
IssuedByName sql.NullString `json:"issued_by_name"`
}
type ListBranchCommandsRow ¶
type ListBranchCommandsRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
Status string `json:"status"`
Result pqtype.NullRawMessage `json:"result"`
Error sql.NullString `json:"error"`
IssuedBy int64 `json:"issued_by"`
CreatedAt time.Time `json:"created_at"`
CompletedAt sql.NullTime `json:"completed_at"`
RegisterID int64 `json:"register_id"`
RegisterCode string `json:"register_code"`
}
type ListBranchExpenseHistoryForSyncRow ¶
type ListBranchExpenseHistoryForSyncRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
Description string `json:"description"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchCashboxAccountID int64 `json:"branch_cashbox_account_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
CategoryID sql.NullInt64 `json:"category_id"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
CancelledAt sql.NullTime `json:"cancelled_at"`
FromCentral bool `json:"from_central"`
CategoryName string `json:"category_name"`
}
type ListBranchExpenseImagesRow ¶
type ListBranchExpenseImagesRow struct {
ID int64 `json:"id"`
BranchExpenseID int64 `json:"branch_expense_id"`
FilePath string `json:"file_path"`
ContentType string `json:"content_type"`
SizeBytes int64 `json:"size_bytes"`
CreatedAt time.Time `json:"created_at"`
Rotation int16 `json:"rotation"`
ExpenseDescription string `json:"expense_description"`
ExpenseBranchID int64 `json:"expense_branch_id"`
BranchName string `json:"branch_name"`
}
type ListBranchInvoiceCouponCodesForHistoryRow ¶
type ListBranchInvoiceCouponCodesForHistoryRow struct {
RedeemedInvoiceRef sql.NullString `json:"redeemed_invoice_ref"`
Code string `json:"code"`
}
type ListBranchInvoiceItemsForHistoryRow ¶
type ListBranchInvoiceItemsForHistoryRow struct {
ID int64 `json:"id"`
BranchInvoiceID int64 `json:"branch_invoice_id"`
BranchProductID int64 `json:"branch_product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
ProductUid uuid.NullUUID `json:"product_uid"`
Unknown bool `json:"unknown"`
Deal string `json:"deal"`
DealDiscount int64 `json:"deal_discount"`
InvoiceDiscount int64 `json:"invoice_discount"`
ResolvedBarcode sql.NullString `json:"resolved_barcode"`
}
type ListBranchInvoiceItemsNamedRow ¶ added in v1.1.0
type ListBranchInvoiceItemsRow ¶ added in v1.1.0
type ListBranchInvoiceItemsRow struct {
ID int64 `json:"id"`
BranchInvoiceID int64 `json:"branch_invoice_id"`
BranchProductID int64 `json:"branch_product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
ProductUid uuid.NullUUID `json:"product_uid"`
Unknown bool `json:"unknown"`
Deal string `json:"deal"`
DealDiscount int64 `json:"deal_discount"`
InvoiceDiscount int64 `json:"invoice_discount"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
Barcode string `json:"barcode"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
}
type ListBranchInvoicesPageParams ¶
type ListBranchInvoicesPageParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
Search string `json:"search"`
RegisterID sql.NullInt64 `json:"register_id"`
Kind sql.NullString `json:"kind"`
Status sql.NullString `json:"status"`
DateFrom sql.NullTime `json:"date_from"`
DateTo sql.NullTime `json:"date_to"`
PageOffset int32 `json:"page_offset"`
PageSize int32 `json:"page_size"`
}
type ListBranchLoanHistoryForSyncRow ¶
type ListBranchLoanHistoryForSyncRow struct {
ID int64 `json:"id"`
Origin string `json:"origin"`
Description string `json:"description"`
CategoryID int64 `json:"category_id"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
BranchCashboxAccountID sql.NullInt64 `json:"branch_cashbox_account_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
CancelledAt sql.NullTime `json:"cancelled_at"`
CategoryName string `json:"category_name"`
}
type ListBranchPlaceIDsRow ¶ added in v1.1.0
type ListBranchProductRevenueDailyParams ¶
type ListBranchProductRevenueDailyParams struct {
DateFrom time.Time `json:"date_from"`
DateTo time.Time `json:"date_to"`
BranchID sql.NullInt64 `json:"branch_id"`
CategoryValueID sql.NullInt64 `json:"category_value_id"`
SubcategoryValueID sql.NullInt64 `json:"subcategory_value_id"`
BrandValueID sql.NullInt64 `json:"brand_value_id"`
}
type ListBranchProductRevenueParams ¶
type ListBranchProductRevenueParams struct {
DateFrom time.Time `json:"date_from"`
DateTo time.Time `json:"date_to"`
BranchID sql.NullInt64 `json:"branch_id"`
CategoryValueID sql.NullInt64 `json:"category_value_id"`
SubcategoryValueID sql.NullInt64 `json:"subcategory_value_id"`
BrandValueID sql.NullInt64 `json:"brand_value_id"`
}
type ListBranchProductRevenueRow ¶
type ListBranchProductRevenueRow struct {
ProductID int64 `json:"product_id"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
Category string `json:"category"`
Subcategory string `json:"subcategory"`
Brand string `json:"brand"`
Quantity int64 `json:"quantity"`
Revenue int64 `json:"revenue"`
InvoiceCount int64 `json:"invoice_count"`
}
type ListBranchQuickAccessItemsRow ¶
type ListBranchQuickAccessItemsRow struct {
ProductVariantID int64 `json:"product_variant_id"`
Position int32 `json:"position"`
Color string `json:"color"`
TextColor string `json:"text_color"`
Uid uuid.UUID `json:"uid"`
Barcode string `json:"barcode"`
IsActive bool `json:"is_active"`
Code string `json:"code"`
Name string `json:"name"`
ColorName sql.NullString `json:"color_name"`
SizeName sql.NullString `json:"size_name"`
}
type ListBranchShiftReceiptImagesRow ¶
type ListBranchShiftReceiptImagesRow struct {
ID int64 `json:"id"`
BranchShiftID int64 `json:"branch_shift_id"`
FilePath string `json:"file_path"`
ContentType string `json:"content_type"`
SizeBytes int64 `json:"size_bytes"`
CreatedAt time.Time `json:"created_at"`
Rotation int16 `json:"rotation"`
ShiftLocalID int64 `json:"shift_local_id"`
ClosingPersonName string `json:"closing_person_name"`
ShiftClosedAt sql.NullTime `json:"shift_closed_at"`
ShiftBranchID int64 `json:"shift_branch_id"`
BranchName string `json:"branch_name"`
}
type ListBranchShiftsParams ¶
type ListBranchShiftsRow ¶
type ListBranchShiftsRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
ClientRef string `json:"client_ref"`
BranchShiftID int64 `json:"branch_shift_id"`
OpenedAt sql.NullTime `json:"opened_at"`
ClosedAt sql.NullTime `json:"closed_at"`
ClosingPersonName string `json:"closing_person_name"`
OpeningFloatUsd int64 `json:"opening_float_usd"`
OpeningFloatLbp int64 `json:"opening_float_lbp"`
ExpectedUsd int64 `json:"expected_usd"`
ExpectedLbp int64 `json:"expected_lbp"`
ExpectedVisa int64 `json:"expected_visa"`
ExpectedWhish int64 `json:"expected_whish"`
CountedUsd int64 `json:"counted_usd"`
CountedLbp int64 `json:"counted_lbp"`
CountedVisa int64 `json:"counted_visa"`
CountedWhish int64 `json:"counted_whish"`
VarianceUsd int64 `json:"variance_usd"`
VarianceLbp int64 `json:"variance_lbp"`
VarianceVisa int64 `json:"variance_visa"`
VarianceWhish int64 `json:"variance_whish"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
RegisterID int64 `json:"register_id"`
LbpRate int64 `json:"lbp_rate"`
HasReceiptImage bool `json:"has_receipt_image"`
}
type ListBranchSyncConflictsPageParams ¶
type ListBranchSyncConflictsPageParams struct {
Column1 int64 `json:"column_1"`
Column2 string `json:"column_2"`
Column3 string `json:"column_3"`
Column4 string `json:"column_4"`
Column5 string `json:"column_5"`
Column6 string `json:"column_6"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
type ListBranchSyncConflictsPageRow ¶
type ListBranchSyncConflictsPageRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Entity string `json:"entity"`
Ref string `json:"ref"`
Kind string `json:"kind"`
BranchPayload json.RawMessage `json:"branch_payload"`
CentralClientID sql.NullInt64 `json:"central_client_id"`
Status string `json:"status"`
Resolution pqtype.NullRawMessage `json:"resolution"`
ResolvedBy sql.NullInt64 `json:"resolved_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
CentralName sql.NullString `json:"central_name"`
CentralPhone sql.NullString `json:"central_phone"`
}
type ListBranchWhatsAppNumbersRow ¶ added in v1.1.0
type ListBranchesForSyncRow ¶
type ListCashboxAccountOverridesForBranchRow ¶
type ListCashboxAccountOverridesForBranchRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
CurrencyCode string `json:"currency_code"`
SortOrder int32 `json:"sort_order"`
Color string `json:"color"`
IsEnabled bool `json:"is_enabled"`
OverrideSortOrder sql.NullInt32 `json:"override_sort_order"`
OverrideColor sql.NullString `json:"override_color"`
OverrideCurrencyCode sql.NullString `json:"override_currency_code"`
}
type ListCashboxesParams ¶
type ListClientPhoneCountriesRow ¶ added in v1.1.3
type ListClientSyncIDsParams ¶
type ListClientSyncIDsRow ¶
type ListClientsByInvoiceCountCachedParams ¶ added in v1.1.6
type ListClientsByInvoiceCountCachedParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
ClientType sql.NullString `json:"client_type"`
Search sql.NullString `json:"search"`
PhoneValid sql.NullBool `json:"phone_valid"`
PhoneCountry sql.NullString `json:"phone_country"`
}
type ListClientsByInvoiceCountCachedRow ¶ added in v1.1.6
type ListClientsByInvoiceCountCachedRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
TotalLoyaltyPoints int64 `json:"total_loyalty_points"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClientType string `json:"client_type"`
Uid uuid.UUID `json:"uid"`
IsActive bool `json:"is_active"`
BranchID sql.NullInt64 `json:"branch_id"`
PhoneValid bool `json:"phone_valid"`
PhoneCountry string `json:"phone_country"`
TotalSpent int64 `json:"total_spent"`
InvoiceCount int64 `json:"invoice_count"`
ItemCount int64 `json:"item_count"`
}
type ListClientsByItemCountCachedParams ¶ added in v1.1.6
type ListClientsByItemCountCachedParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
ClientType sql.NullString `json:"client_type"`
Search sql.NullString `json:"search"`
PhoneValid sql.NullBool `json:"phone_valid"`
PhoneCountry sql.NullString `json:"phone_country"`
}
type ListClientsByItemCountCachedRow ¶ added in v1.1.6
type ListClientsByItemCountCachedRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
TotalLoyaltyPoints int64 `json:"total_loyalty_points"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClientType string `json:"client_type"`
Uid uuid.UUID `json:"uid"`
IsActive bool `json:"is_active"`
BranchID sql.NullInt64 `json:"branch_id"`
PhoneValid bool `json:"phone_valid"`
PhoneCountry string `json:"phone_country"`
TotalSpent int64 `json:"total_spent"`
InvoiceCount int64 `json:"invoice_count"`
ItemCount int64 `json:"item_count"`
}
type ListClientsBySpendingCachedParams ¶ added in v1.1.6
type ListClientsBySpendingCachedParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
ClientType sql.NullString `json:"client_type"`
Search sql.NullString `json:"search"`
PhoneValid sql.NullBool `json:"phone_valid"`
PhoneCountry sql.NullString `json:"phone_country"`
}
type ListClientsBySpendingCachedRow ¶ added in v1.1.6
type ListClientsBySpendingCachedRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
TotalLoyaltyPoints int64 `json:"total_loyalty_points"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClientType string `json:"client_type"`
Uid uuid.UUID `json:"uid"`
IsActive bool `json:"is_active"`
BranchID sql.NullInt64 `json:"branch_id"`
PhoneValid bool `json:"phone_valid"`
PhoneCountry string `json:"phone_country"`
TotalSpent int64 `json:"total_spent"`
InvoiceCount int64 `json:"invoice_count"`
ItemCount int64 `json:"item_count"`
}
type ListClientsBySpendingParams ¶
type ListClientsBySpendingParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
SortBy string `json:"sort_by"`
Visit string `json:"visit"`
BranchIds []int64 `json:"branch_ids"`
DateFrom sql.NullTime `json:"date_from"`
DateTo sql.NullTime `json:"date_to"`
ClientType sql.NullString `json:"client_type"`
Search sql.NullString `json:"search"`
PhoneValid sql.NullBool `json:"phone_valid"`
PhoneCountry sql.NullString `json:"phone_country"`
}
type ListClientsBySpendingRow ¶
type ListClientsBySpendingRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
TotalLoyaltyPoints int64 `json:"total_loyalty_points"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClientType string `json:"client_type"`
Uid uuid.UUID `json:"uid"`
IsActive bool `json:"is_active"`
BranchID sql.NullInt64 `json:"branch_id"`
PhoneValid bool `json:"phone_valid"`
PhoneCountry string `json:"phone_country"`
TotalSpent int64 `json:"total_spent"`
InvoiceCount int64 `json:"invoice_count"`
ItemCount int64 `json:"item_count"`
}
type ListClientsForExportParams ¶ added in v1.1.1
type ListClientsForExportRow ¶ added in v1.1.1
type ListClientsForExportRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
ClientType string `json:"client_type"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
BranchID int64 `json:"branch_id"`
TotalSpent int64 `json:"total_spent"`
InvoiceCount int64 `json:"invoice_count"`
LastVisit time.Time `json:"last_visit"`
}
type ListClientsMissingPhoneCountryRow ¶ added in v1.1.6
type ListClientsParams ¶
type ListClientsParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
ClientType sql.NullString `json:"client_type"`
}
type ListClientsWithLoyaltyParams ¶
type ListClientsWithLoyaltyParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
ClientType sql.NullString `json:"client_type"`
}
type ListClientsWithLoyaltyRow ¶
type ListClientsWithLoyaltyRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
TotalLoyaltyPoints int64 `json:"total_loyalty_points"`
ValidLoyaltyPoints int64 `json:"valid_loyalty_points"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClientType string `json:"client_type"`
Uid uuid.UUID `json:"uid"`
IsActive bool `json:"is_active"`
BranchID sql.NullInt64 `json:"branch_id"`
PhoneValid bool `json:"phone_valid"`
PhoneCountry string `json:"phone_country"`
BranchLoyaltyPoints int64 `json:"branch_loyalty_points"`
}
type ListColorsPageParams ¶
type ListCouponListsRow ¶
type ListCouponListsRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
CouponTypeID int64 `json:"coupon_type_id"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
CouponTypeName string `json:"coupon_type_name"`
CouponCount int64 `json:"coupon_count"`
RedeemedCount int64 `json:"redeemed_count"`
}
type ListCouponsParams ¶
type ListCouponsRow ¶
type ListCouponsRow struct {
Code string `json:"code"`
Status CouponStatus `json:"status"`
ClientID sql.NullInt64 `json:"client_id"`
ValidUntil sql.NullTime `json:"valid_until"`
CreatedAt time.Time `json:"created_at"`
CategoryID sql.NullInt64 `json:"category_id"`
TypeID sql.NullInt64 `json:"type_id"`
ListID sql.NullInt64 `json:"list_id"`
ValueCents int64 `json:"value_cents"`
RedeemedBranchID sql.NullInt64 `json:"redeemed_branch_id"`
RedeemedInvoiceRef sql.NullString `json:"redeemed_invoice_ref"`
RedeemedAt sql.NullTime `json:"redeemed_at"`
UpdatedAt time.Time `json:"updated_at"`
TypeName sql.NullString `json:"type_name"`
}
type ListCurrenciesParams ¶
type ListDailyIncomeParams ¶
type ListDailyIncomeRow ¶
type ListDayBranchExpensesRow ¶
type ListDayBranchExpensesRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Description string `json:"description"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
OccurredAt time.Time `json:"occurred_at"`
CategoryName string `json:"category_name"`
}
type ListDayBranchShiftsRow ¶
type ListDayBranchShiftsRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
RegisterID int64 `json:"register_id"`
ClosingPersonName string `json:"closing_person_name"`
OpenedAt sql.NullTime `json:"opened_at"`
ClosedAt sql.NullTime `json:"closed_at"`
ExpectedUsd int64 `json:"expected_usd"`
CountedUsd int64 `json:"counted_usd"`
VarianceUsd int64 `json:"variance_usd"`
VarianceLbp int64 `json:"variance_lbp"`
VarianceVisa int64 `json:"variance_visa"`
VarianceWhish int64 `json:"variance_whish"`
}
type ListDayInvoicesParams ¶
type ListDayInvoicesRow ¶
type ListDayInvoicesRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Kind string `json:"kind"`
BranchInvoiceCode string `json:"branch_invoice_code"`
GrandTotal int64 `json:"grand_total"`
Discount int16 `json:"discount"`
SalespersonName string `json:"salesperson_name"`
OccurredAt time.Time `json:"occurred_at"`
CancelledAt sql.NullTime `json:"cancelled_at"`
ItemCount int64 `json:"item_count"`
}
type ListDaySalesByBranchRow ¶
type ListDaySalesByBranchRow struct {
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
SalesCount int64 `json:"sales_count"`
SalesTotal int64 `json:"sales_total"`
ReturnCount int64 `json:"return_count"`
ReturnTotal int64 `json:"return_total"`
NetTotal int64 `json:"net_total"`
ItemsSold int64 `json:"items_sold"`
ClientCount int64 `json:"client_count"`
}
type ListDaySalesByHourRow ¶
type ListDayTopProductsRow ¶
type ListDealsRow ¶ added in v1.1.6
type ListDealsRow struct {
ID int64 `json:"id"`
Uid uuid.UUID `json:"uid"`
Name string `json:"name"`
Kind string `json:"kind"`
BuyQty int32 `json:"buy_qty"`
GetQty int32 `json:"get_qty"`
Percent int16 `json:"percent"`
BundlePrice int64 `json:"bundle_price"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FallbackPercent int16 `json:"fallback_percent"`
FallbackOnlyWithoutSet bool `json:"fallback_only_without_set"`
Variants int64 `json:"variants"`
Rules int64 `json:"rules"`
}
type ListDeletableUnknownItemImagesRow ¶ added in v1.1.1
type ListDiscountListItemsWithProductRow ¶
type ListDiscountListItemsWithProductRow struct {
DiscountListID int64 `json:"discount_list_id"`
ProductVariantID int64 `json:"product_variant_id"`
Discount int16 `json:"discount"`
SaleOptionID int64 `json:"sale_option_id"`
SaleOption string `json:"sale_option"`
RowKey string `json:"row_key"`
ProductVariantUid uuid.UUID `json:"product_variant_uid"`
Barcode string `json:"barcode"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
RuleName string `json:"rule_name"`
FromRule bool `json:"from_rule"`
DealID int64 `json:"deal_id"`
DealName string `json:"deal_name"`
}
type ListDiscountListOptionItemsForSyncRow ¶ added in v1.1.6
type ListDiscountListRuleOptionsRow ¶ added in v1.1.6
type ListDiscountListRulesRow ¶ added in v1.1.6
type ListDiscountListRulesRow struct {
ID int64 `json:"id"`
DiscountListID int64 `json:"discount_list_id"`
Position int32 `json:"position"`
Name string `json:"name"`
CodePrefixes []string `json:"code_prefixes"`
ExceptCodePrefixes []string `json:"except_code_prefixes"`
Kinds []string `json:"kinds"`
Categories []string `json:"categories"`
SubCategories []string `json:"sub_categories"`
Origins []string `json:"origins"`
Brands []string `json:"brands"`
Discount int16 `json:"discount"`
CreatedAt time.Time `json:"created_at"`
DealID sql.NullInt64 `json:"deal_id"`
IsEnabled bool `json:"is_enabled"`
GroupID int64 `json:"group_id"`
MaxPrice sql.NullInt64 `json:"max_price"`
Variants int64 `json:"variants"`
}
type ListDiscountListsParams ¶
type ListDiscountListsRemovedFromBranchParams ¶ added in v1.1.7
type ListDiscountListsRemovedFromBranchRow ¶ added in v1.1.7
type ListEmailReportInvoicesParams ¶ added in v1.1.0
type ListEmailReportInvoicesRow ¶ added in v1.1.0
type ListEmailReportInvoicesRow struct {
ID int64 `json:"id"`
Kind string `json:"kind"`
BranchInvoiceCode string `json:"branch_invoice_code"`
GrandTotal int64 `json:"grand_total"`
Subtotal int64 `json:"subtotal"`
Discount int16 `json:"discount"`
SalespersonName string `json:"salesperson_name"`
LocalAt time.Time `json:"local_at"`
BranchName string `json:"branch_name"`
RegisterCode string `json:"register_code"`
CustomerName string `json:"customer_name"`
CustomerPhone string `json:"customer_phone"`
ExchangeRate int64 `json:"exchange_rate"`
RoundingMode string `json:"rounding_mode"`
LbpUnitsPerUsdMicros int64 `json:"lbp_units_per_usd_micros"`
LbpCashRoundingUnit int64 `json:"lbp_cash_rounding_unit"`
SoldLbpTotal sql.NullInt64 `json:"sold_lbp_total"`
SoldLbpRate sql.NullInt64 `json:"sold_lbp_rate"`
ItemCount int64 `json:"item_count"`
PaymentMethods string `json:"payment_methods"`
}
type ListEmailReportRecipientsRow ¶ added in v1.1.0
type ListEmailReportRegistersRow ¶ added in v1.1.0
type ListEmailReportShiftInvoicesRow ¶ added in v1.1.0
type ListEmailReportShiftInvoicesRow struct {
ID int64 `json:"id"`
Kind string `json:"kind"`
BranchInvoiceCode string `json:"branch_invoice_code"`
GrandTotal int64 `json:"grand_total"`
Subtotal int64 `json:"subtotal"`
Discount int16 `json:"discount"`
SalespersonName string `json:"salesperson_name"`
LocalAt time.Time `json:"local_at"`
BranchName string `json:"branch_name"`
RegisterCode string `json:"register_code"`
CustomerName string `json:"customer_name"`
CustomerPhone string `json:"customer_phone"`
ExchangeRate int64 `json:"exchange_rate"`
RoundingMode string `json:"rounding_mode"`
LbpUnitsPerUsdMicros int64 `json:"lbp_units_per_usd_micros"`
LbpCashRoundingUnit int64 `json:"lbp_cash_rounding_unit"`
SoldLbpTotal sql.NullInt64 `json:"sold_lbp_total"`
SoldLbpRate sql.NullInt64 `json:"sold_lbp_rate"`
ItemCount int64 `json:"item_count"`
PaymentMethods string `json:"payment_methods"`
}
type ListEmailReportShiftsParams ¶ added in v1.1.0
type ListEmailReportShiftsRow ¶ added in v1.1.0
type ListEmailReportShiftsRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
RegisterCode string `json:"register_code"`
ClosingPersonName string `json:"closing_person_name"`
OpenedAt sql.NullTime `json:"opened_at"`
ClosedAt sql.NullTime `json:"closed_at"`
OccurredAt time.Time `json:"occurred_at"`
}
type ListEmailReportsParams ¶ added in v1.1.0
type ListEmailReportsParams struct {
Status sql.NullString `json:"status"`
PageOffset int32 `json:"page_offset"`
PageSize int32 `json:"page_size"`
}
type ListEmployeesParams ¶
type ListEntriesParams ¶
type ListExpensesParams ¶
type ListGooglePlaceSnapshotsParams ¶ added in v1.1.0
type ListGoogleReviewsParams ¶ added in v1.1.0
type ListHomeActivityResolutionsParams ¶ added in v1.1.0
type ListHomeActivityResolutionsRow ¶ added in v1.1.0
type ListInventoriesParams ¶
type ListInventoryStockRow ¶
type ListInventoryStockRow struct {
InventoryID int64 `json:"inventory_id"`
VariantID int64 `json:"variant_id"`
Quantity int64 `json:"quantity"`
AvgCost int64 `json:"avg_cost"`
UpdatedAt time.Time `json:"updated_at"`
Barcode string `json:"barcode"`
Price sql.NullInt64 `json:"price"`
ProductID int64 `json:"product_id"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
}
type ListInvoiceDiscountsForBranchSyncParams ¶ added in v1.1.8
type ListInvoiceDiscountsForBranchSyncRow ¶ added in v1.1.8
type ListInvoiceDiscountsForBranchSyncRow struct {
Uid uuid.UUID `json:"uid"`
Name string `json:"name"`
MinTotal int64 `json:"min_total"`
Kind string `json:"kind"`
Percent int16 `json:"percent"`
Amount int64 `json:"amount"`
ValidFrom sql.NullTime `json:"valid_from"`
ValidTo sql.NullTime `json:"valid_to"`
UpdatedAt time.Time `json:"updated_at"`
Applies bool `json:"applies"`
}
type ListInvoiceProductsByInvoiceRow ¶
type ListInvoiceProductsByInvoiceRow struct {
InvoiceID int64 `json:"invoice_id"`
ProductID int64 `json:"product_id"`
UnitPrice int64 `json:"unit_price"`
LineTotal int64 `json:"line_total"`
Discount int16 `json:"discount"`
Quantity int64 `json:"quantity"`
VariantID sql.NullInt64 `json:"variant_id"`
UnitCost int64 `json:"unit_cost"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
VariantBarcode string `json:"variant_barcode"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
}
type ListInvoicesPageParams ¶
type ListInvoicesParams ¶
type ListLatestAdditionsParams ¶
type ListLatestAdditionsParams struct {
IncludeAccounting bool `json:"include_accounting"`
IncludeHr bool `json:"include_hr"`
IncludeInventory bool `json:"include_inventory"`
BeforeAt sql.NullTime `json:"before_at"`
BeforeKind sql.NullString `json:"before_kind"`
BeforeID sql.NullInt64 `json:"before_id"`
PageSize int32 `json:"page_size"`
}
type ListLatestAdditionsRow ¶
type ListLatestAdditionsRow struct {
Kind string `json:"kind"`
ID int64 `json:"id"`
AddedAt time.Time `json:"added_at"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
HasImage bool `json:"has_image"`
RefID int64 `json:"ref_id"`
BranchID int64 `json:"branch_id"`
RefDay string `json:"ref_day"`
}
type ListLoanPaymentsParams ¶
type ListLoansParams ¶
type ListLoansParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
BranchID sql.NullInt64 `json:"branch_id"`
Origin sql.NullString `json:"origin"`
CategoryID sql.NullInt64 `json:"category_id"`
Search sql.NullString `json:"search"`
Status sql.NullString `json:"status"`
}
type ListLoansRow ¶
type ListLoansRow struct {
ID int64 `json:"id"`
Origin string `json:"origin"`
Description string `json:"description"`
CategoryID int64 `json:"category_id"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
BranchCashboxAccountID sql.NullInt64 `json:"branch_cashbox_account_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
CancelledAt sql.NullTime `json:"cancelled_at"`
PaidAmount int64 `json:"paid_amount"`
Status string `json:"status"`
}
type ListLowStockProductsParams ¶
type ListLowStockProductsParams struct {
Status sql.NullString `json:"status"`
Search string `json:"search"`
PageOffset int32 `json:"page_offset"`
PageLimit int32 `json:"page_limit"`
}
type ListLowStockProductsRow ¶
type ListPriceListItemsWithProductRow ¶
type ListPriceListItemsWithProductRow struct {
PriceListID int64 `json:"price_list_id"`
ProductVariantID int64 `json:"product_variant_id"`
Price int64 `json:"price"`
ProductVariantUid uuid.UUID `json:"product_variant_uid"`
Barcode string `json:"barcode"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
}
type ListPriceListsParams ¶
type ListPriceListsRemovedFromBranchParams ¶ added in v1.1.7
type ListPriceListsRemovedFromBranchRow ¶ added in v1.1.7
type ListProductRevenueRow ¶
type ListProductRevenueRow struct {
ProductID int64 `json:"product_id"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
Category string `json:"category"`
Subcategory string `json:"subcategory"`
Brand string `json:"brand"`
Quantity int64 `json:"quantity"`
Revenue int64 `json:"revenue"`
InvoiceCount int64 `json:"invoice_count"`
}
type ListProductSaleOptionNamesRow ¶ added in v1.1.6
type ListProductVariantsForSyncByUIDsRow ¶
type ListProductVariantsForSyncByUIDsRow struct {
Uid uuid.UUID `json:"uid"`
ID int64 `json:"id"`
Barcode string `json:"barcode"`
IsActive bool `json:"is_active"`
UpdatedAt time.Time `json:"updated_at"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
ColorName sql.NullString `json:"color_name"`
SizeName sql.NullString `json:"size_name"`
Brand sql.NullString `json:"brand"`
SubCategory sql.NullString `json:"sub_category"`
Kind sql.NullString `json:"kind"`
Season sql.NullString `json:"season"`
Year sql.NullString `json:"year"`
SaleOptions []string `json:"sale_options"`
}
type ListProductVariantsForSyncPagedRow ¶
type ListProductVariantsForSyncPagedRow struct {
Uid uuid.UUID `json:"uid"`
ID int64 `json:"id"`
Barcode string `json:"barcode"`
IsActive bool `json:"is_active"`
UpdatedAt time.Time `json:"updated_at"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
ColorName sql.NullString `json:"color_name"`
SizeName sql.NullString `json:"size_name"`
Brand sql.NullString `json:"brand"`
SubCategory sql.NullString `json:"sub_category"`
Kind sql.NullString `json:"kind"`
Season sql.NullString `json:"season"`
Year sql.NullString `json:"year"`
SaleOptions []string `json:"sale_options"`
}
type ListProductVariantsForSyncRow ¶
type ListProductVariantsForSyncRow struct {
Uid uuid.UUID `json:"uid"`
ID int64 `json:"id"`
Barcode string `json:"barcode"`
IsActive bool `json:"is_active"`
UpdatedAt time.Time `json:"updated_at"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
ColorName sql.NullString `json:"color_name"`
SizeName sql.NullString `json:"size_name"`
Brand sql.NullString `json:"brand"`
SubCategory sql.NullString `json:"sub_category"`
Kind sql.NullString `json:"kind"`
Season sql.NullString `json:"season"`
Year sql.NullString `json:"year"`
SaleOptions []string `json:"sale_options"`
}
type ListProductVariantsRow ¶
type ListProductVariantsRow struct {
ProductVariant ProductVariant `json:"product_variant"`
Product Product `json:"product"`
}
type ListProductsParams ¶
type ListProductsParams struct {
Search string `json:"search"`
IsActive sql.NullBool `json:"is_active"`
CreatedFrom sql.NullTime `json:"created_from"`
CreatedTo sql.NullTime `json:"created_to"`
HasVariants sql.NullBool `json:"has_variants"`
AttributeValueIds []int64 `json:"attribute_value_ids"`
PageOffset int32 `json:"page_offset"`
PageLimit int32 `json:"page_limit"`
}
type ListProductsRow ¶
type ListPurchaseItemsRow ¶
type ListPurchaseItemsRow struct {
ID int64 `json:"id"`
PurchaseID sql.NullInt64 `json:"purchase_id"`
AssetID sql.NullInt64 `json:"asset_id"`
Quantity int64 `json:"quantity"`
UnitPrice int64 `json:"unit_price"`
CurrencyCode string `json:"currency_code"`
VariantID sql.NullInt64 `json:"variant_id"`
ProductName sql.NullString `json:"product_name"`
ProductCode sql.NullString `json:"product_code"`
VariantBarcode sql.NullString `json:"variant_barcode"`
AssetName sql.NullString `json:"asset_name"`
}
type ListPurchasesParams ¶
type ListPurchasesRow ¶
type ListPurchasesRow struct {
ID int64 `json:"id"`
SupplierID int64 `json:"supplier_id"`
PurchasedAt time.Time `json:"purchased_at"`
InventoryID sql.NullInt64 `json:"inventory_id"`
Code string `json:"code"`
CurrencyCode string `json:"currency_code"`
Subtotal int64 `json:"subtotal"`
GrandTotal int64 `json:"grand_total"`
Status PurchaseStatus `json:"status"`
ReceivedAt sql.NullTime `json:"received_at"`
Note string `json:"note"`
SupplierName string `json:"supplier_name"`
InventoryName sql.NullString `json:"inventory_name"`
ItemCount int64 `json:"item_count"`
}
type ListRegisterUpdateStatusesRow ¶
type ListRegisterUpdateStatusesRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
BranchCode string `json:"branch_code"`
Code string `json:"code"`
Name string `json:"name"`
IsActive bool `json:"is_active"`
LastSeenAt sql.NullTime `json:"last_seen_at"`
AppVersion string `json:"app_version"`
AppFlavor string `json:"app_flavor"`
UpdateState string `json:"update_state"`
UpdateDetail string `json:"update_detail"`
UpdateProgress int32 `json:"update_progress"`
UpdateReportedAt sql.NullTime `json:"update_reported_at"`
TargetReleaseID sql.NullInt64 `json:"target_release_id"`
TargetVersion sql.NullString `json:"target_version"`
}
type ListRolesRow ¶
type ListSalespersonsParams ¶
type ListSecurityAlertsParams ¶ added in v1.1.0
type ListShiftsParams ¶
type ListShiftsRow ¶
type ListSizesPageParams ¶
type ListSlowMovingProductsParams ¶
type ListSlowMovingProductsParams struct {
Category sql.NullString `json:"category"`
Search string `json:"search"`
PageOffset int32 `json:"page_offset"`
PageLimit int32 `json:"page_limit"`
}
type ListStockCountItemsRow ¶
type ListStockCountItemsRow struct {
ID int64 `json:"id"`
StockCountID int64 `json:"stock_count_id"`
VariantID int64 `json:"variant_id"`
SystemQuantity int64 `json:"system_quantity"`
CountedQuantity int64 `json:"counted_quantity"`
Difference int64 `json:"difference"`
Barcode string `json:"barcode"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
}
type ListStockCountsParams ¶
type ListStockCountsParams struct {
InventoryID sql.NullInt64 `json:"inventory_id"`
Status NullStockCountStatus `json:"status"`
PageOffset int32 `json:"page_offset"`
PageLimit int32 `json:"page_limit"`
}
type ListStockCountsRow ¶
type ListStockCountsRow struct {
ID int64 `json:"id"`
InventoryID int64 `json:"inventory_id"`
Code string `json:"code"`
Status StockCountStatus `json:"status"`
Note string `json:"note"`
CountedAt time.Time `json:"counted_at"`
PostedAt sql.NullTime `json:"posted_at"`
CreatedBy sql.NullInt64 `json:"created_by"`
PostedBy sql.NullInt64 `json:"posted_by"`
CreatedAt time.Time `json:"created_at"`
InventoryName string `json:"inventory_name"`
}
type ListStockHealthByInventoryRow ¶
type ListStockHealthByInventoryRow struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type InventoryType `json:"type"`
TotalUnits int64 `json:"total_units"`
InventoryValue int64 `json:"inventory_value"`
UnitsSold30d int64 `json:"units_sold_30d"`
DaysOfInventory interface{} `json:"days_of_inventory"`
}
type ListStockMovementsParams ¶
type ListStockMovementsParams struct {
InventoryID sql.NullInt64 `json:"inventory_id"`
VariantID sql.NullInt64 `json:"variant_id"`
Reason NullStockMovementReason `json:"reason"`
ReferenceType sql.NullString `json:"reference_type"`
CreatedBy sql.NullInt64 `json:"created_by"`
FromDate sql.NullTime `json:"from_date"`
ToDate sql.NullTime `json:"to_date"`
PageOffset int32 `json:"page_offset"`
PageLimit int32 `json:"page_limit"`
}
type ListStockMovementsRow ¶
type ListStockMovementsRow struct {
ID int64 `json:"id"`
InventoryID int64 `json:"inventory_id"`
VariantID int64 `json:"variant_id"`
Quantity int64 `json:"quantity"`
Reason StockMovementReason `json:"reason"`
ReferenceType sql.NullString `json:"reference_type"`
ReferenceID sql.NullInt64 `json:"reference_id"`
UnitCost sql.NullInt64 `json:"unit_cost"`
Note string `json:"note"`
CreatedBy sql.NullInt64 `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
QuantityBefore int64 `json:"quantity_before"`
QuantityAfter int64 `json:"quantity_after"`
Metadata json.RawMessage `json:"metadata"`
BatchID sql.NullInt64 `json:"batch_id"`
InventoryName string `json:"inventory_name"`
Barcode string `json:"barcode"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeName string `json:"size_name"`
CreatedByName string `json:"created_by_name"`
BatchCode string `json:"batch_code"`
}
type ListSuppliersParams ¶
type ListTransferAttachmentsParams ¶ added in v1.1.0
type ListTransferAttachmentsRow ¶ added in v1.1.0
type ListTransferItemsRow ¶
type ListTransferItemsRow struct {
ID int64 `json:"id"`
TransferID int64 `json:"transfer_id"`
AssetID sql.NullInt64 `json:"asset_id"`
Quantity int64 `json:"quantity"`
VariantID sql.NullInt64 `json:"variant_id"`
ReceivedQuantity sql.NullInt64 `json:"received_quantity"`
ProductName string `json:"product_name"`
ProductCode string `json:"product_code"`
VariantBarcode string `json:"variant_barcode"`
VariantUid uuid.NullUUID `json:"variant_uid"`
AssetName string `json:"asset_name"`
}
type ListTransfersParams ¶
type ListTransfersParams struct {
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
Status NullTransferStatus `json:"status"`
}
type ListTransfersRow ¶
type ListTransfersRow struct {
ID int64 `json:"id"`
FromInventoryID int64 `json:"from_inventory_id"`
ToInventoryID int64 `json:"to_inventory_id"`
Type TransferType `json:"type"`
CreatedAt time.Time `json:"created_at"`
Code string `json:"code"`
Status TransferStatus `json:"status"`
DispatchedAt sql.NullTime `json:"dispatched_at"`
ReceivedAt sql.NullTime `json:"received_at"`
Note string `json:"note"`
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
AttachmentPath string `json:"attachment_path"`
UpdatedAt time.Time `json:"updated_at"`
ConfirmedAt sql.NullTime `json:"confirmed_at"`
ConfirmedNote string `json:"confirmed_note"`
RegisterID sql.NullInt64 `json:"register_id"`
AttachmentRotation int16 `json:"attachment_rotation"`
FromInventoryName string `json:"from_inventory_name"`
ToInventoryName string `json:"to_inventory_name"`
BranchName string `json:"branch_name"`
ItemCount int64 `json:"item_count"`
}
type ListUnknownItemImagesParams ¶ added in v1.1.1
type ListUnknownItemImagesRow ¶ added in v1.1.1
type ListUnknownItemsParams ¶ added in v1.1.1
type ListUnknownItemsRow ¶ added in v1.1.1
type ListUnknownItemsRow struct {
ID int64 `json:"id"`
SlotRef string `json:"slot_ref"`
Position int32 `json:"position"`
Label string `json:"label"`
UnitPrice int64 `json:"unit_price"`
Discount int16 `json:"discount"`
ImageID sql.NullInt64 `json:"image_id"`
ResolvedVariantID sql.NullInt64 `json:"resolved_variant_id"`
ResolvedAt sql.NullTime `json:"resolved_at"`
WaivedAt sql.NullTime `json:"waived_at"`
WaivedBy string `json:"waived_by"`
SessionID int64 `json:"session_id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
BranchInvoiceID sql.NullInt64 `json:"branch_invoice_id"`
BranchInvoiceCode string `json:"branch_invoice_code"`
OccurredAt time.Time `json:"occurred_at"`
ResolvedName string `json:"resolved_name"`
ResolvedBarcode string `json:"resolved_barcode"`
}
type ListUnresolvedUrgentHomeActivitiesRow ¶ added in v1.1.0
type ListUnresolvedUrgentHomeActivitiesRow struct {
Activity string `json:"activity"`
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Details string `json:"details"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
SyncedAt time.Time `json:"synced_at"`
Person string `json:"person"`
PersonColor string `json:"person_color"`
}
type ListUsersParams ¶
type ListVariantSyncIDsRow ¶
type ListVariantsForBarcodesRow ¶
type ListVariantsForBarcodesRow struct {
ID int64 `json:"id"`
Barcode string `json:"barcode"`
Price sql.NullInt64 `json:"price"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
ProductID int64 `json:"product_id"`
ProductCode string `json:"product_code"`
ProductName string `json:"product_name"`
ColorName string `json:"color_name"`
SizeType string `json:"size_type"`
SizeName string `json:"size_name"`
Brand string `json:"brand"`
}
type ListVariantsForDiscountEntryRow ¶ added in v1.1.6
type ListVisitorIPsParams ¶ added in v1.1.0
type ListWaitingUnknownItemsRow ¶ added in v1.1.1
type ListWaitingUnknownItemsRow struct {
ID int64 `json:"id"`
SlotRef string `json:"slot_ref"`
Position int32 `json:"position"`
Label string `json:"label"`
UnitPrice int64 `json:"unit_price"`
Discount int16 `json:"discount"`
ImageID sql.NullInt64 `json:"image_id"`
WaivedAt sql.NullTime `json:"waived_at"`
SessionID int64 `json:"session_id"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
HelpRequestedAt sql.NullTime `json:"help_requested_at"`
CreatedAt time.Time `json:"created_at"`
}
type ListWhatsAppChatMessagesParams ¶ added in v1.1.1
type ListWhatsAppChatMessagesRow ¶ added in v1.1.1
type ListWhatsAppChatMessagesRow struct {
ID int64 `json:"id"`
Instance string `json:"instance"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
WaID string `json:"wa_id"`
ChatJid string `json:"chat_jid"`
ChatPhone string `json:"chat_phone"`
ContactName string `json:"contact_name"`
FromMe bool `json:"from_me"`
Kind string `json:"kind"`
Body string `json:"body"`
MediaType string `json:"media_type"`
SentAt time.Time `json:"sent_at"`
CreatedAt time.Time `json:"created_at"`
NumberLabel string `json:"number_label"`
}
type ListWhatsAppChatsParams ¶ added in v1.1.1
type ListWhatsAppChatsRow ¶ added in v1.1.1
type ListWhatsAppChatsRow struct {
ChatPhone string `json:"chat_phone"`
Instance string `json:"instance"`
FromMe bool `json:"from_me"`
Kind string `json:"kind"`
Body string `json:"body"`
SentAt time.Time `json:"sent_at"`
Total int64 `json:"total"`
ContactName string `json:"contact_name"`
NumberLabel string `json:"number_label"`
}
type ListWhatsAppMessageRepliesRow ¶ added in v1.1.0
type ListWhatsAppMessagesParams ¶ added in v1.1.0
type ListWhatsAppMessagesRow ¶ added in v1.1.0
type ListWhatsAppMessagesRow struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at"`
BranchID sql.NullInt64 `json:"branch_id"`
InvoiceCode string `json:"invoice_code"`
ClientName string `json:"client_name"`
ClientPhone string `json:"client_phone"`
GrandTotalCents int64 `json:"grand_total_cents"`
ItemCount int32 `json:"item_count"`
RuleID sql.NullInt64 `json:"rule_id"`
RuleName string `json:"rule_name"`
TemplateName string `json:"template_name"`
Status string `json:"status"`
Reason string `json:"reason"`
Wamid string `json:"wamid"`
CostMicros int64 `json:"cost_micros"`
DeliveryStatus string `json:"delivery_status"`
DeliveredAt sql.NullTime `json:"delivered_at"`
ReadAt sql.NullTime `json:"read_at"`
DeliveryError string `json:"delivery_error"`
Billable sql.NullBool `json:"billable"`
PricingCategory string `json:"pricing_category"`
ReviewCode string `json:"review_code"`
ReviewClickedAt sql.NullTime `json:"review_clicked_at"`
Sender string `json:"sender"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
PollRef string `json:"poll_ref"`
PollRating sql.NullInt16 `json:"poll_rating"`
PollAnswer string `json:"poll_answer"`
PollVotedAt sql.NullTime `json:"poll_voted_at"`
PollFollowupAt sql.NullTime `json:"poll_followup_at"`
BridgeRef string `json:"bridge_ref"`
IsTest bool `json:"is_test"`
Body string `json:"body"`
PollQuestion string `json:"poll_question"`
PollOptions string `json:"poll_options"`
FollowupBody string `json:"followup_body"`
BranchName string `json:"branch_name"`
}
type ListWhatsAppRepliesParams ¶ added in v1.1.0
type ListWhatsAppRepliesRow ¶ added in v1.1.0
type ListWhatsAppRepliesRow struct {
ID int64 `json:"id"`
Wamid string `json:"wamid"`
ReceivedAt time.Time `json:"received_at"`
ClientPhone string `json:"client_phone"`
ClientName string `json:"client_name"`
Kind string `json:"kind"`
Body string `json:"body"`
MessageID sql.NullInt64 `json:"message_id"`
InvoiceCode string `json:"invoice_code"`
RuleName string `json:"rule_name"`
TemplateName string `json:"template_name"`
BranchName string `json:"branch_name"`
}
type Loan ¶
type Loan struct {
ID int64 `json:"id"`
Origin string `json:"origin"`
Description string `json:"description"`
CategoryID int64 `json:"category_id"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
BranchCashboxAccountID sql.NullInt64 `json:"branch_cashbox_account_id"`
BranchShiftID sql.NullInt64 `json:"branch_shift_id"`
OccurredAt time.Time `json:"occurred_at"`
ReceivedAt time.Time `json:"received_at"`
BranchCashboxAccountName sql.NullString `json:"branch_cashbox_account_name"`
CancelledAt sql.NullTime `json:"cancelled_at"`
}
type LoanCategory ¶
type LoanPayment ¶
type LoanUploadToken ¶ added in v1.1.0
type LowPollRatingsParams ¶ added in v1.1.0
type LowPollRatingsRow ¶ added in v1.1.0
type LowPollRatingsRow struct {
ID int64 `json:"id"`
PollVotedAt sql.NullTime `json:"poll_voted_at"`
PollRating sql.NullInt16 `json:"poll_rating"`
PollAnswer string `json:"poll_answer"`
ClientName string `json:"client_name"`
ClientPhone string `json:"client_phone"`
InvoiceCode string `json:"invoice_code"`
GrandTotalCents int64 `json:"grand_total_cents"`
BranchName string `json:"branch_name"`
Replies string `json:"replies"`
}
type LoyaltyMonthlyJoinsRow ¶ added in v1.1.6
type LoyaltyRisingClientsParams ¶ added in v1.1.6
type LoyaltyRisingClientsParams struct {
TierMins []int64 `json:"tier_mins"`
ClientType sql.NullString `json:"client_type"`
}
type LoyaltyRisingClientsRow ¶ added in v1.1.6
type LoyaltyTierStatsParams ¶ added in v1.1.6
type LoyaltyTierStatsRow ¶ added in v1.1.6
type MarkBranchAttendanceEventRemovedParams ¶ added in v1.1.0
type MarkBranchInvoicesCancelledParams ¶ added in v1.1.0
type MarkUnknownItemSlotResolvedParams ¶ added in v1.1.1
type NullAuditAction ¶
type NullAuditAction struct {
AuditAction AuditAction `json:"audit_action"`
Valid bool `json:"valid"` // Valid is true if AuditAction is not NULL
}
func (*NullAuditAction) Scan ¶
func (ns *NullAuditAction) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullCouponStatus ¶
type NullCouponStatus struct {
CouponStatus CouponStatus `json:"coupon_status"`
Valid bool `json:"valid"` // Valid is true if CouponStatus is not NULL
}
func (*NullCouponStatus) Scan ¶
func (ns *NullCouponStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullEntryReferenceType ¶
type NullEntryReferenceType struct {
EntryReferenceType EntryReferenceType `json:"entry_reference_type"`
Valid bool `json:"valid"` // Valid is true if EntryReferenceType is not NULL
}
func (*NullEntryReferenceType) Scan ¶
func (ns *NullEntryReferenceType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullIndexType ¶
type NullIndexType struct {
IndexType IndexType `json:"index_type"`
Valid bool `json:"valid"` // Valid is true if IndexType is not NULL
}
func (*NullIndexType) Scan ¶
func (ns *NullIndexType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullInventoryType ¶
type NullInventoryType struct {
InventoryType InventoryType `json:"inventory_type"`
Valid bool `json:"valid"` // Valid is true if InventoryType is not NULL
}
func (*NullInventoryType) Scan ¶
func (ns *NullInventoryType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPurchaseStatus ¶
type NullPurchaseStatus struct {
PurchaseStatus PurchaseStatus `json:"purchase_status"`
Valid bool `json:"valid"` // Valid is true if PurchaseStatus is not NULL
}
func (*NullPurchaseStatus) Scan ¶
func (ns *NullPurchaseStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullStockCountStatus ¶
type NullStockCountStatus struct {
StockCountStatus StockCountStatus `json:"stock_count_status"`
Valid bool `json:"valid"` // Valid is true if StockCountStatus is not NULL
}
func (*NullStockCountStatus) Scan ¶
func (ns *NullStockCountStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullStockMovementReason ¶
type NullStockMovementReason struct {
StockMovementReason StockMovementReason `json:"stock_movement_reason"`
Valid bool `json:"valid"` // Valid is true if StockMovementReason is not NULL
}
func (*NullStockMovementReason) Scan ¶
func (ns *NullStockMovementReason) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransferStatus ¶
type NullTransferStatus struct {
TransferStatus TransferStatus `json:"transfer_status"`
Valid bool `json:"valid"` // Valid is true if TransferStatus is not NULL
}
func (*NullTransferStatus) Scan ¶
func (ns *NullTransferStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransferType ¶
type NullTransferType struct {
TransferType TransferType `json:"transfer_type"`
Valid bool `json:"valid"` // Valid is true if TransferType is not NULL
}
func (*NullTransferType) Scan ¶
func (ns *NullTransferType) Scan(value interface{}) error
Scan implements the Scanner interface.
type OversoldPayload ¶
type OversoldPayload struct {
VariantID int64 `json:"variant_id"`
Barcode string `json:"barcode"`
OnHand int64 `json:"on_hand"`
RegisterID int64 `json:"register_id"`
InvoiceID int64 `json:"invoice_id"`
InvoiceCode string `json:"invoice_code"`
InvoiceRef string `json:"invoice_ref"`
QuantitySold int64 `json:"quantity_sold"`
OccurredAtUTC string `json:"occurred_at"`
}
OversoldPayload is the branch_payload of an "oversold" stock alert.
type Permission ¶
type PollRatingTotalsParams ¶ added in v1.1.0
type PollRatingTotalsRow ¶ added in v1.1.0
type PollRatingsByBranchParams ¶ added in v1.1.0
type PollRatingsByBranchRow ¶ added in v1.1.0
type PollRatingsByBranchRow struct {
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Polls int64 `json:"polls"`
Answers int64 `json:"answers"`
Average float64 `json:"average"`
Stars5 int64 `json:"stars5"`
Stars4 int64 `json:"stars4"`
Stars3 int64 `json:"stars3"`
Stars2 int64 `json:"stars2"`
Stars1 int64 `json:"stars1"`
}
type PollRatingsByDayParams ¶ added in v1.1.0
type PollRatingsByDayRow ¶ added in v1.1.0
type PollRepliesParams ¶ added in v1.1.0
type PollRepliesRow ¶ added in v1.1.0
type PollRepliesRow struct {
ID int64 `json:"id"`
Body string `json:"body"`
Kind string `json:"kind"`
ReceivedAt time.Time `json:"received_at"`
PollRating sql.NullInt16 `json:"poll_rating"`
PollAnswer string `json:"poll_answer"`
ClientName string `json:"client_name"`
ClientPhone string `json:"client_phone"`
InvoiceCode string `json:"invoice_code"`
BranchName string `json:"branch_name"`
}
type PostStockCountTxResult ¶
type PostStockCountTxResult struct {
StockCount StockCount `json:"stock_count"`
Movements []StockMovement `json:"movements"`
}
type PriceList ¶
type PriceList struct {
ID int64 `json:"id"`
Name string `json:"name"`
IsActive bool `json:"is_active"`
IsDefault bool `json:"is_default"`
ValidFrom time.Time `json:"valid_from"`
ValidTo time.Time `json:"valid_to"`
CreatedAt time.Time `json:"created_at"`
Uid uuid.UUID `json:"uid"`
UpdatedAt time.Time `json:"updated_at"`
IsSpecial bool `json:"is_special"`
}
type PriceListBranch ¶
type PriceListBranchRemoval ¶ added in v1.1.7
type PriceListItem ¶
type Product ¶
type Product struct {
ID int64 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
LowStockThreshold sql.NullInt64 `json:"low_stock_threshold"`
LowStockAlertsEnabled bool `json:"low_stock_alerts_enabled"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type ProductCategory ¶
type ProductSaleOption ¶ added in v1.1.6
type ProductSupplier ¶
type ProductSupplierCost ¶
type ProductVariant ¶
type ProductVariant struct {
ID int64 `json:"id"`
ProductID int64 `json:"product_id"`
ColorID sql.NullInt64 `json:"color_id"`
SizeID sql.NullInt64 `json:"size_id"`
Barcode string `json:"barcode"`
Price sql.NullInt64 `json:"price"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AvgCost int64 `json:"avg_cost"`
Uid uuid.UUID `json:"uid"`
}
type ProductsAttribute ¶
type Purchase ¶
type Purchase struct {
ID int64 `json:"id"`
SupplierID int64 `json:"supplier_id"`
PurchasedAt time.Time `json:"purchased_at"`
InventoryID sql.NullInt64 `json:"inventory_id"`
Code string `json:"code"`
CurrencyCode string `json:"currency_code"`
Subtotal int64 `json:"subtotal"`
GrandTotal int64 `json:"grand_total"`
Status PurchaseStatus `json:"status"`
ReceivedAt sql.NullTime `json:"received_at"`
Note string `json:"note"`
}
type PurchaseItem ¶
type PurchaseItemParams ¶
type PurchaseItemParams struct {
VariantID sql.NullInt64 `json:"variant_id"`
AssetID sql.NullInt64 `json:"asset_id"`
Quantity int64 `json:"quantity"`
UnitPrice int64 `json:"unit_price"`
}
PurchaseItemParams is one line on a draft purchase invoice. A line is either a product variant (variant_id set) or an asset (asset_id set).
type PurchaseReceiveTxParams ¶
type PurchaseReceiveTxResult ¶
type PurchaseReceiveTxResult struct {
Purchase Purchase `json:"purchase"`
Movements []StockMovement `json:"movements"`
}
type PurchaseStatus ¶
type PurchaseStatus string
const ( PurchaseStatusDraft PurchaseStatus = "draft" PurchaseStatusReceived PurchaseStatus = "received" PurchaseStatusCancelled PurchaseStatus = "cancelled" )
func (*PurchaseStatus) Scan ¶
func (e *PurchaseStatus) Scan(src interface{}) error
type Querier ¶
type Querier interface {
// Marks the given alerts seen; an empty list marks every open one except
// those of kept_kinds (critical ones, resolved only one by one).
AcknowledgeSecurityAlerts(ctx context.Context, arg AcknowledgeSecurityAlertsParams) error
// The list a branch is discounted from: its own assigned list when that one
// is active and in date, otherwise the default -- the same choice
// ResolveVariantDiscount makes, and the till makes from what it's sent.
ActiveDiscountListForBranch(ctx context.Context, branchID int64) (DiscountList, error)
// remaining_quantity starts equal to quantity_bought -- FIFO consumption
// (applyStockMovement) draws it down as sales are attributed to this
// batch, and returns of those sales put it back.
AddBatchItem(ctx context.Context, arg AddBatchItemParams) (BatchItem, error)
AddCashboxAccountBalance(ctx context.Context, arg AddCashboxAccountBalanceParams) (ShiftsAccountsBalance, error)
AddClientLoyaltyPoints(ctx context.Context, arg AddClientLoyaltyPointsParams) error
// Apply a signed quantity delta to one SKU's on-hand in one inventory,
// creating the row if this SKU has never been stocked there. Cost is left
// untouched (used for sales, returns, transfers, adjustments).
AddInventoryStockQuantity(ctx context.Context, arg AddInventoryStockQuantityParams) (InventoryStock, error)
AddInvoiceDiscountBranch(ctx context.Context, arg AddInvoiceDiscountBranchParams) error
AddInvoiceProduct(ctx context.Context, arg AddInvoiceProductParams) (InvoiceProduct, error)
// Gives every product named by entries each of the options; returns the
// product ids it matched.
AddProductSaleOptionsForEntries(ctx context.Context, arg AddProductSaleOptionsForEntriesParams) ([]int64, error)
AddPurchaseItem(ctx context.Context, arg AddPurchaseItemParams) (PurchaseItem, error)
AddPurchasedProduct(ctx context.Context, arg AddPurchasedProductParams) (ProductSupplier, error)
AddPurchasedProductCost(ctx context.Context, arg AddPurchasedProductCostParams) (ProductSupplierCost, error)
AddStockCountItem(ctx context.Context, arg AddStockCountItemParams) (StockCountItem, error)
// The Inbox tab: every message on our own WhatsApp numbers (api/whatsapp_chat.go).
// ErrNoRows when the bridge already reported this message.
AddWhatsAppChatMessage(ctx context.Context, arg AddWhatsAppChatMessageParams) (int64, error)
// A client's message after the poll, reported by the bridge. No rows when the
// poll is unknown or the bridge already reported this message.
AddWhatsAppPollReply(ctx context.Context, arg AddWhatsAppPollReplyParams) (int64, error)
// Signed delta: negative consumes (a sale), positive replenishes (a return
// of that sale). No floor at zero -- same "ledger stays authoritative, UI
// surfaces negatives" rule as inventory_stock.
AdjustBatchItemRemainingQuantity(ctx context.Context, arg AdjustBatchItemRemainingQuantityParams) (BatchItem, error)
// A till's own value, reported up, for a salesperson kashi hasn't set one
// for. updated_at is left alone: nothing about it needs to go back down.
AdoptSalespersonAttendanceID(ctx context.Context, arg AdoptSalespersonAttendanceIDParams) error
// A tick the bridge saw on one of our own messages. Like Meta's statuses it
// only moves forward (sent -> delivered -> read), so a late one changes nothing.
ApplyWhatsAppBridgeTick(ctx context.Context, arg ApplyWhatsAppBridgeTickParams) (ApplyWhatsAppBridgeTickRow, error)
// Meta's WhatsApp webhook (api/whatsapp_webhook.go).
// Delivery only moves forward (sent -> delivered -> read), so an update that
// arrives late doesn't undo a newer one; 'failed' always wins. A message Meta
// couldn't deliver, or says it doesn't charge for, costs nothing.
ApplyWhatsAppDeliveryStatus(ctx context.Context, arg ApplyWhatsAppDeliveryStatusParams) ([]int64, error)
// The rating poll a new client gets at checkout, recorded on the welcome row
// that checkout claimed, so one client's welcome and poll are one row (its
// ticks are the welcome's; votes find it by poll_ref).
AttachWhatsAppPoll(ctx context.Context, arg AttachWhatsAppPollParams) error
// Sets only phone_valid/phone_country, leaving the phone text and updated_at
// alone: bumping updated_at would make every till re-download the client on
// its next catch-up.
BatchSetClientPhoneFlags(ctx context.Context, arg BatchSetClientPhoneFlagsParams) error
// Bulk counterpart to UpdateClientPhone for normalizeClientPhones: one
// round trip for a whole chunk instead of one per row, which is what made
// the first version of this job time out at Cloudflare's gateway on 60k+
// individual updates. Also backfills phone_valid/phone_country for every
// row the job passes (even one whose phone text didn't change), since
// those columns start out at their just-migrated-in defaults until this
// runs once.
BatchUpdateClientPhones(ctx context.Context, arg BatchUpdateClientPhonesParams) error
BranchAttendanceChangeRefsPresent(ctx context.Context, arg BranchAttendanceChangeRefsPresentParams) ([]string, error)
BranchAttendanceEventRefsPresent(ctx context.Context, arg BranchAttendanceEventRefsPresentParams) ([]string, error)
BranchClientLinksPresent(ctx context.Context, arg BranchClientLinksPresentParams) ([]int64, error)
// One row per branch: what's still queued and what failed in the last day,
// for the Commands page sidebar and its nav dot.
BranchCommandSummary(ctx context.Context) ([]BranchCommandSummaryRow, error)
BranchExpenseRefsPresent(ctx context.Context, arg BranchExpenseRefsPresentParams) ([]string, error)
// Reconcile queries: given the refs a branch believes it has pushed, return
// the subset kashi actually holds. The branch diffs its own list against
// this to decide what still needs (re)queuing -- the basis of "sync
// everything to a (possibly new) central server". Each is a single indexed
// `= ANY` lookup; the handler caps the input array size.
BranchInvoiceRefsPresent(ctx context.Context, arg BranchInvoiceRefsPresentParams) ([]string, error)
BranchInvoicesReferenceClient(ctx context.Context, id int64) (bool, error)
BranchInvoicesReferenceVariant(ctx context.Context, id int64) (bool, error)
BranchLoanRefsPresent(ctx context.Context, arg BranchLoanRefsPresentParams) ([]sql.NullString, error)
BranchSalespersonExists(ctx context.Context, arg BranchSalespersonExistsParams) (bool, error)
// A branch_shifts row exists only once kashi-pos has reported that shift's
// close, so its mere presence is the "this shift is closed" signal --
// closed_at itself can be NULL for an older till build that omitted it.
BranchShiftIsClosed(ctx context.Context, arg BranchShiftIsClosedParams) (bool, error)
BranchShiftRefsPresent(ctx context.Context, arg BranchShiftRefsPresentParams) ([]string, error)
// One row per branch: open conflicts, and how many of those are oversold
// stock (the kind that needs a stock fix), for the Conflicts page sidebar
// and its nav dot.
BranchSyncConflictSummary(ctx context.Context) ([]BranchSyncConflictSummaryRow, error)
BranchVisitorEventRefsPresent(ctx context.Context, arg BranchVisitorEventRefsPresentParams) ([]string, error)
// Puts every variant whose barcode, or whose product's code, is in entries on
// the list at one discount (adding it or changing it). A code names all of its
// product's variants. deal_id, when set, puts them on that deal instead
// (discount 0). Returns the variant ids it set.
BulkSetDiscountListItems(ctx context.Context, arg BulkSetDiscountListItemsParams) ([]int64, error)
// BulkSetDiscountListItems for one option: the discount applies to the
// matched variants only when they are sold as that option.
BulkSetDiscountListOptionItems(ctx context.Context, arg BulkSetDiscountListOptionItemsParams) ([]int64, error)
// Folds a repeat into the feed's newest entry when it's the same change by
// the same person, made less than an hour after it: the count goes up and
// the time moves to now. No row back (sql.ErrNoRows) means it wasn't a
// repeat, and the caller adds a new entry.
BumpAdminActivity(ctx context.Context, arg BumpAdminActivityParams) (int64, error)
// Sales (not returns or exchanges): how many, and what they came to.
BusyHoursSales(ctx context.Context, arg BusyHoursSalesParams) ([]BusyHoursSalesRow, error)
// The Busy Hours page (api/busy_hours.go): when people come in and buy, by
// weekday (ISO: 1 Monday .. 7 Sunday) and hour, in each branch's own time
// zone. Hidden branches/registers and cancelled sales are left out, like the
// other reports. Empty branch_ids = every branch.
// Presses of the till's people counter (customers in).
BusyHoursVisitors(ctx context.Context, arg BusyHoursVisitorsParams) ([]BusyHoursVisitorsRow, error)
// Only a command no till has acked yet can be withdrawn.
CancelBranchCommand(ctx context.Context, id int64) (BranchCommand, error)
// Stamps cancelled_at once; a second cancel matches no row (the handler
// reads the row first, so that's an idempotent no-op, not an error).
CancelBranchExpense(ctx context.Context, id int64) (BranchExpense, error)
// Branch-reported loans only: a central loan is deleted, there's no till to
// tell. Stamps cancelled_at once, like CancelBranchExpense.
CancelBranchLoan(ctx context.Context, id int64) (Loan, error)
// The once-only gate on a branch's list: 1 row the first time it's set up
// (by a till's import or an admin save), 0 ever after.
ClaimBranchQuickAccessInit(ctx context.Context, id int64) (int64, error)
// Moves a due schedule on to its next run before it sends, and only if no
// one else already did -- so a run is never sent twice.
ClaimEmailScheduleRun(ctx context.Context, arg ClaimEmailScheduleRunParams) (int64, error)
// Marks the poll's follow-up as sent and says where to send it; no rows when
// it already went (a changed vote) or the number is gone. Also none when the
// follow-up is off for this client: for_new / for_returning, a returning client
// being one messaged before this message.
ClaimWhatsAppPollFollowup(ctx context.Context, arg ClaimWhatsAppPollFollowupParams) (ClaimWhatsAppPollFollowupRow, error)
// A sale's checkout finds the welcome sent to its client earlier (no invoice
// yet, within the last 12 hours) and takes it over, so it isn't messaged twice.
ClaimWhatsAppWelcome(ctx context.Context, arg ClaimWhatsAppWelcomeParams) (int64, error)
ClearDefaultWhatsAppNumber(ctx context.Context) error
// Entries are matched the way BulkSetDiscountListItems matches them: a
// variant barcode names its product, a code names the product directly.
ClearProductSaleOptionsForEntries(ctx context.Context, entries []string) error
ClientPhonesPresent(ctx context.Context, dollar_1 []string) ([]string, error)
CloseShift(ctx context.Context, id int64) error
CompleteBranchCommand(ctx context.Context, arg CompleteBranchCommandParams) (BranchCommand, error)
// The home page's "today" count next to the IT Management feed.
CountAdminActivitiesSince(ctx context.Context, since time.Time) (int64, error)
CountAssets(ctx context.Context, arg CountAssetsParams) (int64, error)
CountAttributeValues(ctx context.Context, arg CountAttributeValuesParams) (int64, error)
CountAuditLogs(ctx context.Context, arg CountAuditLogsParams) (int64, error)
CountBatchesFiltered(ctx context.Context, search string) (int64, error)
CountBranchAttendanceChanges(ctx context.Context, branchID sql.NullInt64) (int64, error)
CountBranchAttendanceEvents(ctx context.Context, branchID sql.NullInt64) (int64, error)
CountBranchCommands(ctx context.Context, arg CountBranchCommandsParams) (int64, error)
CountBranchExpenseImages(ctx context.Context) (int64, error)
CountBranchExpenseImagesForExpense(ctx context.Context, branchExpenseID int64) (int64, error)
CountBranchExpenses(ctx context.Context, arg CountBranchExpensesParams) (int64, error)
CountBranchInvoiceSettlements(ctx context.Context, branchID sql.NullInt64) (int64, error)
CountBranchInvoices(ctx context.Context, branchID sql.NullInt64) (int64, error)
CountBranchInvoicesFiltered(ctx context.Context, arg CountBranchInvoicesFilteredParams) (int64, error)
CountBranchShiftReceiptImages(ctx context.Context) (int64, error)
CountBranchShifts(ctx context.Context, branchID sql.NullInt64) (int64, error)
CountBranchSyncConflicts(ctx context.Context, arg CountBranchSyncConflictsParams) (int64, error)
// Running gross tally for one branch, one local day, one direction -- used
// to tell the admin toast "customer in -- 42 in today".
CountBranchVisitorDayByDirection(ctx context.Context, arg CountBranchVisitorDayByDirectionParams) (int64, error)
CountBranchVisitorDays(ctx context.Context, branchID sql.NullInt64) (int64, error)
// Branches with no active list of their own, i.e. discounted from the default.
CountBranchesOnDefaultDiscountList(ctx context.Context) (int64, error)
// How many branches reference this method, either via an explicit override
// row or by inheriting it as-is. A payment method that any branch still
// overrides can't be hard-deleted without leaving that override dangling
// (or silently cascading it away), so the delete handler blocks on this and
// points the admin at deactivating instead.
CountCashboxAccountOverrides(ctx context.Context, cashboxAccountID int64) (int64, error)
CountClients(ctx context.Context, clientType sql.NullString) (int64, error)
// Same filters as ListClientsBySpending, minus the spend computation --
// used for the rest-of-clients table's pagination total. With a branch
// picked it counts that branch's clients: home branch, or a branch invoice
// there (same cancelled/hidden rules as the list).
CountClientsBySpending(ctx context.Context, arg CountClientsBySpendingParams) (int64, error)
// Count for ListClientsBySpendingCached.
CountClientsBySpendingCached(ctx context.Context, arg CountClientsBySpendingCachedParams) (int64, error)
CountColors(ctx context.Context, search string) (int64, error)
CountCoupons(ctx context.Context, arg CountCouponsParams) (int64, error)
CountCouponsByTypeID(ctx context.Context, typeID sql.NullInt64) (int64, error)
CountCurrencies(ctx context.Context) (int64, error)
// Whether anything in kashi's own tables still points at this currency --
// a payment method priced in it, or a branch override that prices one in it.
// A currency that's still referenced can't be hard-deleted (it would either
// violate the FK or silently orphan those rows); the delete handler blocks
// on this and points the admin at deactivating instead.
CountCurrencyUsage(ctx context.Context, code string) (int32, error)
CountDashboardExpenses(ctx context.Context, arg CountDashboardExpensesParams) (int64, error)
CountDashboardPurchases(ctx context.Context, arg CountDashboardPurchasesParams) (int64, error)
CountDashboardSales(ctx context.Context, arg CountDashboardSalesParams) (int64, error)
CountDiscountListItemsWithProduct(ctx context.Context, arg CountDiscountListItemsWithProductParams) (int64, error)
// How many variants each rule of a list decides, first match wins, the way
// refresh_discount_rules (000208) picks them. A rule giving no discount and
// no deal writes no rows, so ListDiscountListRules counts it as 0; this is
// what it keeps out (or gives) all the same.
CountDiscountListRuleDecided(ctx context.Context, discountListID int64) ([]CountDiscountListRuleDecidedRow, error)
CountDiscountLists(ctx context.Context) (int64, error)
CountEmailReports(ctx context.Context, status sql.NullString) (int64, error)
CountEmployees(ctx context.Context, arg CountEmployeesParams) (int64, error)
CountExpenses(ctx context.Context, arg CountExpensesParams) (int64, error)
// The "N synced" count beside the Recent activity feed: the same rows as
// HomeActivityFeed received from `since` on. A plain count per table rides
// the received_at indexes; it used to come from the feed query's windowed
// total, which built (and coloured) every row of the week to count them.
CountHomeActivitiesSince(ctx context.Context, since time.Time) (int64, error)
CountIgnoredLowStockProducts(ctx context.Context, search string) (int64, error)
CountInventories(ctx context.Context) (int64, error)
CountInventoryStock(ctx context.Context, arg CountInventoryStockParams) (int64, error)
CountInvoices(ctx context.Context) (int64, error)
CountInvoicesFiltered(ctx context.Context, search string) (int64, error)
// The home page's "today" count next to the Latest added feed: the same
// kinds, access flags and timestamps as ListLatestAdditions, counted from
// `since` on.
CountLatestAdditionsSince(ctx context.Context, arg CountLatestAdditionsSinceParams) (int64, error)
CountLoanImagesForLoan(ctx context.Context, loanID int64) (int64, error)
CountLoanPayments(ctx context.Context, arg CountLoanPaymentsParams) (int64, error)
CountLoans(ctx context.Context, arg CountLoansParams) (int64, error)
CountLowStockProducts(ctx context.Context, arg CountLowStockProductsParams) (int64, error)
CountOpenBranchSyncConflicts(ctx context.Context, branchID int64) (int64, error)
CountOpenSecurityAlerts(ctx context.Context) (int64, error)
// Admin users besides $1, so the last admin can't be deleted or demoted.
CountOtherAdmins(ctx context.Context, id int64) (int64, error)
CountPriceListItemsWithProduct(ctx context.Context, arg CountPriceListItemsWithProductParams) (int64, error)
CountPriceListsFiltered(ctx context.Context, search string) (int64, error)
CountProductVariants(ctx context.Context) (int64, error)
CountPurchasesFiltered(ctx context.Context, search string) (int64, error)
CountRegistersTargetingRelease(ctx context.Context, targetReleaseID sql.NullInt64) (int64, error)
CountShifts(ctx context.Context, arg CountShiftsParams) (int64, error)
CountSizes(ctx context.Context, search string) (int64, error)
CountSlowMovingProducts(ctx context.Context, arg CountSlowMovingProductsParams) (int64, error)
CountStockCounts(ctx context.Context, arg CountStockCountsParams) (int64, error)
CountStockHealthByInventory(ctx context.Context, search string) (int64, error)
CountStockMovements(ctx context.Context, arg CountStockMovementsParams) (int64, error)
CountSuppliersFiltered(ctx context.Context, search string) (int64, error)
CountTransferAttachments(ctx context.Context) (int64, error)
CountTransfers(ctx context.Context, status NullTransferStatus) (int64, error)
CountUnknownItemImages(ctx context.Context) (int64, error)
CountUnknownItems(ctx context.Context, resolved bool) (int64, error)
CountVariantsForBarcodes(ctx context.Context, search string) (int64, error)
CountVisitorIPs(ctx context.Context, arg CountVisitorIPsParams) (int64, error)
CountWhatsAppMessages(ctx context.Context, arg CountWhatsAppMessagesParams) (int64, error)
CountWhatsAppReplies(ctx context.Context, arg CountWhatsAppRepliesParams) (int64, error)
CreateAdminActivity(ctx context.Context, arg CreateAdminActivityParams) (AdminActivity, error)
CreateAppRelease(ctx context.Context, arg CreateAppReleaseParams) (AppRelease, error)
CreateAppUpdateEvent(ctx context.Context, arg CreateAppUpdateEventParams) error
CreateAsset(ctx context.Context, arg CreateAssetParams) (Asset, error)
CreateAssetCategory(ctx context.Context, arg CreateAssetCategoryParams) (AssetCategory, error)
CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error)
CreateBatch(ctx context.Context, arg CreateBatchParams) (Batch, error)
CreateBranch(ctx context.Context, arg CreateBranchParams) (Branch, error)
CreateBranchAttendanceChange(ctx context.Context, arg CreateBranchAttendanceChangeParams) (BranchAttendanceChange, error)
CreateBranchAttendanceEvent(ctx context.Context, arg CreateBranchAttendanceEventParams) (BranchAttendanceEvent, error)
CreateBranchCommand(ctx context.Context, arg CreateBranchCommandParams) (BranchCommand, error)
CreateBranchExpense(ctx context.Context, arg CreateBranchExpenseParams) (BranchExpense, error)
CreateBranchExpenseImage(ctx context.Context, arg CreateBranchExpenseImageParams) (BranchExpenseImage, error)
CreateBranchExpenseUploadToken(ctx context.Context, arg CreateBranchExpenseUploadTokenParams) (BranchExpenseUploadToken, error)
CreateBranchInvoice(ctx context.Context, arg CreateBranchInvoiceParams) (BranchInvoice, error)
CreateBranchInvoiceItem(ctx context.Context, arg CreateBranchInvoiceItemParams) (BranchInvoiceItem, error)
CreateBranchInvoicePayment(ctx context.Context, arg CreateBranchInvoicePaymentParams) (BranchInvoicePayment, error)
CreateBranchInvoiceSettlement(ctx context.Context, arg CreateBranchInvoiceSettlementParams) (BranchInvoiceSettlement, error)
CreateBranchInvoiceSettlementPayment(ctx context.Context, arg CreateBranchInvoiceSettlementPaymentParams) (BranchInvoiceSettlementPayment, error)
CreateBranchLoan(ctx context.Context, arg CreateBranchLoanParams) (Loan, error)
CreateBranchRegister(ctx context.Context, arg CreateBranchRegisterParams) (BranchRegister, error)
CreateBranchSalesperson(ctx context.Context, arg CreateBranchSalespersonParams) (Salesperson, error)
CreateBranchShift(ctx context.Context, arg CreateBranchShiftParams) (BranchShift, error)
CreateBranchShiftReceiptImage(ctx context.Context, arg CreateBranchShiftReceiptImageParams) (BranchShiftReceiptImage, error)
CreateBranchShiftUploadToken(ctx context.Context, arg CreateBranchShiftUploadTokenParams) (BranchShiftUploadToken, error)
CreateBranchTarget(ctx context.Context, arg CreateBranchTargetParams) (BranchTarget, error)
CreateBranchTargetSeries(ctx context.Context, arg CreateBranchTargetSeriesParams) (BranchTargetSeries, error)
// A branch's own proposed transfer: always starts 'requested', always
// carries branch_id + client_ref (the idempotency key -- see
// idx_transfers_branch_client_ref).
CreateBranchTransferRequest(ctx context.Context, arg CreateBranchTransferRequestParams) (Transfer, error)
CreateBranchTransferUploadToken(ctx context.Context, arg CreateBranchTransferUploadTokenParams) (BranchTransferUploadToken, error)
CreateBranchUser(ctx context.Context, arg CreateBranchUserParams) (BranchUser, error)
CreateBranchVisitorEvent(ctx context.Context, arg CreateBranchVisitorEventParams) (BranchVisitorEvent, error)
CreateCalendarEvent(ctx context.Context, arg CreateCalendarEventParams) (CalendarEvent, error)
CreateCashbox(ctx context.Context, arg CreateCashboxParams) (Cashbox, error)
CreateCashboxAccount(ctx context.Context, arg CreateCashboxAccountParams) (CashboxAccount, error)
CreateCentralLoan(ctx context.Context, arg CreateCentralLoanParams) (Loan, error)
CreateClient(ctx context.Context, arg CreateClientParams) (Client, error)
// A till-created client keeps the uid the till minted, so the till never
// has to rewrite anything once kashi accepts it.
CreateClientWithUID(ctx context.Context, arg CreateClientWithUIDParams) (Client, error)
CreateColor(ctx context.Context, arg CreateColorParams) (Color, error)
// A one-off coupon, not part of a list -- list_id stays NULL.
CreateCoupon(ctx context.Context, arg CreateCouponParams) (Coupon, error)
CreateCouponCategory(ctx context.Context, arg CreateCouponCategoryParams) (CouponCategory, error)
CreateCouponList(ctx context.Context, arg CreateCouponListParams) (CouponList, error)
CreateCouponType(ctx context.Context, arg CreateCouponTypeParams) (CouponType, error)
CreateCurrency(ctx context.Context, arg CreateCurrencyParams) (Currency, error)
CreateDeal(ctx context.Context, arg CreateDealParams) (Deal, error)
CreateDiscountList(ctx context.Context, arg CreateDiscountListParams) (DiscountList, error)
// A row written here is set by hand: it takes the row over from the rules
// (000200), which then leave the variant alone. deal_id puts the variant on a
// deal (000201) instead of a discount.
CreateDiscountListItem(ctx context.Context, arg CreateDiscountListItemParams) (DiscountListItem, error)
CreateDiscountListRule(ctx context.Context, arg CreateDiscountListRuleParams) (DiscountListRule, error)
CreateDiscountListRuleGroup(ctx context.Context, arg CreateDiscountListRuleGroupParams) (DiscountListRuleGroup, error)
CreateDiscountListRuleOption(ctx context.Context, arg CreateDiscountListRuleOptionParams) error
CreateEmailReport(ctx context.Context, arg CreateEmailReportParams) (EmailReport, error)
CreateEmailSchedule(ctx context.Context, arg CreateEmailScheduleParams) (EmailSchedule, error)
CreateEmployee(ctx context.Context, arg CreateEmployeeParams) (Employee, error)
CreateEntryItem(ctx context.Context, arg CreateEntryItemParams) (Entry, error)
CreateExpense(ctx context.Context, arg CreateExpenseParams) (Expense, error)
CreateExpenseCategory(ctx context.Context, arg CreateExpenseCategoryParams) (ExpenseCategory, error)
// Fires one period for a recurring series -- target_amount/color are
// passed in (a snapshot of the series at generation time) rather than
// joined live, so a later edit to the series template never rewrites a
// period that's already in progress or past, same as recurring_expenses'
// FireRecurringExpenseTx snapshotting its template's amount into the
// created expense row.
CreateGeneratedBranchTarget(ctx context.Context, arg CreateGeneratedBranchTargetParams) (BranchTarget, error)
CreateGooglePlaceSnapshot(ctx context.Context, arg CreateGooglePlaceSnapshotParams) error
CreateInventory(ctx context.Context, arg CreateInventoryParams) (Inventory, error)
CreateInvoice(ctx context.Context, arg CreateInvoiceParams) (Invoice, error)
CreateInvoiceDiscount(ctx context.Context, arg CreateInvoiceDiscountParams) (InvoiceDiscount, error)
CreateInvoicePayment(ctx context.Context, arg CreateInvoicePaymentParams) (InvoicePayment, error)
CreateInvoiceType(ctx context.Context, arg CreateInvoiceTypeParams) (InvoiceType, error)
// One code minted as part of a coupon_lists batch (see coupon_list.sql).
// Not pre-assigned to a client -- whoever redeems it first claims it.
CreateListCoupon(ctx context.Context, arg CreateListCouponParams) (Coupon, error)
CreateLoanCategory(ctx context.Context, arg CreateLoanCategoryParams) (LoanCategory, error)
CreateLoanImage(ctx context.Context, arg CreateLoanImageParams) (LoanImage, error)
CreateLoanPayment(ctx context.Context, arg CreateLoanPaymentParams) (LoanPayment, error)
CreateLoanUploadToken(ctx context.Context, arg CreateLoanUploadTokenParams) (LoanUploadToken, error)
CreatePriceList(ctx context.Context, arg CreatePriceListParams) (PriceList, error)
CreatePriceListItem(ctx context.Context, arg CreatePriceListItemParams) (PriceListItem, error)
CreateProduct(ctx context.Context, arg CreateProductParams) (Product, error)
CreateProductAttribute(ctx context.Context, arg CreateProductAttributeParams) (ProductsAttribute, error)
CreateProductCategory(ctx context.Context, arg CreateProductCategoryParams) (ProductCategory, error)
// No price column: since 000094 a variant's price is an entry in a price
// list, not a property of the variant, so a newly created variant starts with
// no price and is unsellable until it is added to one.
CreateProductVariant(ctx context.Context, arg CreateProductVariantParams) (ProductVariant, error)
CreatePurchase(ctx context.Context, arg CreatePurchaseParams) (Purchase, error)
CreateRecurringExpense(ctx context.Context, arg CreateRecurringExpenseParams) (RecurringExpense, error)
CreateResolvedBranchInvoiceItem(ctx context.Context, arg CreateResolvedBranchInvoiceItemParams) error
CreateReturnInvoice(ctx context.Context, arg CreateReturnInvoiceParams) (ReturnInvoice, error)
CreateReviewLinkClick(ctx context.Context, arg CreateReviewLinkClickParams) error
CreateRole(ctx context.Context, name string) (Role, error)
CreateSaleOption(ctx context.Context, arg CreateSaleOptionParams) (SaleOption, error)
CreateSalesInvoice(ctx context.Context, invoiceID int64) (int64, error)
CreateSalesperson(ctx context.Context, arg CreateSalespersonParams) (Salesperson, error)
CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
CreateShift(ctx context.Context, cashboxID int64) (Shift, error)
CreateSize(ctx context.Context, arg CreateSizeParams) (Size, error)
CreateStockCount(ctx context.Context, arg CreateStockCountParams) (StockCount, error)
// ---------------------------------------------------------------------------
// Stock movement ledger (append-only).
// ---------------------------------------------------------------------------
CreateStockMovement(ctx context.Context, arg CreateStockMovementParams) (StockMovement, error)
CreateSupplier(ctx context.Context, arg CreateSupplierParams) (Supplier, error)
CreateTransfer(ctx context.Context, arg CreateTransferParams) (Transfer, error)
CreateTransferItem(ctx context.Context, arg CreateTransferItemParams) (TransferItem, error)
CreateUnknownItemImage(ctx context.Context, arg CreateUnknownItemImageParams) (UnknownItemImage, error)
CreateUnknownItemSession(ctx context.Context, arg CreateUnknownItemSessionParams) (UnknownItemSession, error)
// A till re-sending its session as the cart changes moves and relabels the
// units it already sent; their pictures stay.
CreateUnknownItemSlot(ctx context.Context, arg CreateUnknownItemSlotParams) error
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
CreateWhatsAppMessage(ctx context.Context, arg CreateWhatsAppMessageParams) (WhatsappMessage, error)
// The first number becomes the default.
CreateWhatsAppNumber(ctx context.Context, arg CreateWhatsAppNumberParams) (WhatsappNumber, error)
// Linked to the message it answers: the one the client replied to, else the
// last one sent to that number in the week before. Meta can deliver the same
// webhook twice; the wamid keeps it to one row.
CreateWhatsAppReply(ctx context.Context, arg CreateWhatsAppReplyParams) error
CreateWhatsAppRule(ctx context.Context, arg CreateWhatsAppRuleParams) (WhatsappRule, error)
// Queries behind the home dashboard's Overview tab: the summary cards, the
// revenue/expense trend charts, and the aggregated Sales / Purchases /
// Recent Expenses tables. Every query takes a half-open [date_from,
// date_to) timestamptz range (the handler passes start-of-next-day as
// date_to) and, where a branch dimension exists, a nullable branch_id
// (NULL = all branches, same convention as ListBranchInvoices).
//
// "branch" data is what the POS branches sync up (branch_invoices,
// branch_expenses); "admin" data is kashi's own centrally-entered records
// (invoices/sales_invoices, expenses). The dashboard's scope filter picks
// one or both; the list queries take that as an explicit `scope` arg so a
// single UNION ALL can serve all three modes, while the scalar summary
// queries are split per source and the handler adds up whichever apply.
// One chronological feed across every kind of persisted branch sync. The
// union happens before LIMIT/OFFSET so pagination is correct globally, not
// independently per source table. received_at is used deliberately: this
// table answers "what synced recently", even when a branch catches up an
// older occurred_at record.
// person is who did it on the till (salesperson / closing cashier), ” when
// the till doesn't record one; person_color is that salesperson's own
// colour, ” when they have none.
DashboardActivitiesList(ctx context.Context, arg DashboardActivitiesListParams) ([]DashboardActivitiesListRow, error)
DashboardAdminExpenseSeries(ctx context.Context, arg DashboardAdminExpenseSeriesParams) ([]DashboardAdminExpenseSeriesRow, error)
DashboardAdminExpensesTotal(ctx context.Context, arg DashboardAdminExpensesTotalParams) (int64, error)
DashboardAdminNewClients(ctx context.Context, arg DashboardAdminNewClientsParams) (int64, error)
DashboardAdminRevenueSeries(ctx context.Context, arg DashboardAdminRevenueSeriesParams) ([]DashboardAdminRevenueSeriesRow, error)
DashboardAdminSummary(ctx context.Context, arg DashboardAdminSummaryParams) (DashboardAdminSummaryRow, error)
DashboardBranchExpenseSeries(ctx context.Context, arg DashboardBranchExpenseSeriesParams) ([]DashboardBranchExpenseSeriesRow, error)
DashboardBranchExpensesTotal(ctx context.Context, arg DashboardBranchExpensesTotalParams) (int64, error)
// Clients first seen at a branch in the range. With a branch selected,
// count distinct linked clients whose central row was created in-range;
// with no branch, every client created in-range.
DashboardBranchNewClients(ctx context.Context, arg DashboardBranchNewClientsParams) (int64, error)
DashboardBranchRevenueSeries(ctx context.Context, arg DashboardBranchRevenueSeriesParams) ([]DashboardBranchRevenueSeriesRow, error)
// items_sold / revenue / invoice count for branch sales in the range.
// Returns are excluded from items_sold and the count (they aren't sales),
// but revenue sums every kind so refunds net out, matching ListDailyIncome.
DashboardBranchSummary(ctx context.Context, arg DashboardBranchSummaryParams) (DashboardBranchSummaryRow, error)
// Outstanding loan balance = disbursed - repaid. loans has no due date, so
// "due" here just means still owed. Branch arm = origin 'branch_loan'
// (scoped by branch_id when set); admin arm = origin 'central_loan'.
// loan_payments carry no branch dimension of their own, so they follow
// their parent loan's arm. Not date-range bound -- a balance, not a flow.
DashboardDueLoans(ctx context.Context, arg DashboardDueLoansParams) (int64, error)
// image_id is 0, not NULL, when an expense has no receipt photo (admin
// expenses never do): keeps the generated column a plain int64 and lets
// the frontend treat 0 as "no image".
DashboardExpensesList(ctx context.Context, arg DashboardExpensesListParams) ([]DashboardExpensesListRow, error)
DashboardPurchaseSeries(ctx context.Context, arg DashboardPurchaseSeriesParams) ([]DashboardPurchaseSeriesRow, error)
// Purchases are admin-only -- there is no branch purchase concept -- so the
// scope arg only ever excludes them (scope = 'branch'), never adds a second
// source. total is summed from purchase_items since purchases carries no
// amount column of its own.
DashboardPurchasesList(ctx context.Context, arg DashboardPurchasesListParams) ([]DashboardPurchasesListRow, error)
// Cost of goods bought in the range. Admin-only (no branch purchase
// concept); total is summed from purchase_items since purchases carries no
// amount column of its own, matching DashboardPurchasesList.
DashboardPurchasesTotal(ctx context.Context, arg DashboardPurchasesTotalParams) (int64, error)
// currency is the app's single default currency code (every amount in the
// schema is stored in its minor unit -- see 000009_create_currencies).
// The branch-invoice client name is resolved through client_links; when
// the branch never synced a client link it comes back empty.
DashboardSalesList(ctx context.Context, arg DashboardSalesListParams) ([]DashboardSalesListRow, error)
// Every branch_target that is active and spans `as_of` (today), with its
// live revenue (the target's own [date_from, date_to] window against its
// own branch). One progress bar per row on the dashboard; the handler also
// sums these for the overall attainment percentage. branch_targets are
// branch-only, so the handler skips this under admin scope.
DashboardTargetList(ctx context.Context, arg DashboardTargetListParams) ([]DashboardTargetListRow, error)
// The loans with the largest outstanding balance, for the dashboard's
// "Due Loans" list. Same scope/branch gating as DashboardDueLoans; fully
// repaid loans (outstanding <= 0) are dropped.
DashboardTopDueLoans(ctx context.Context, arg DashboardTopDueLoansParams) ([]DashboardTopDueLoansRow, error)
// Part of deleting a whole recurring series (see DeleteBranchTargetSeriesTx
// in tx_branch_target_series.go) -- every period it ever generated needs
// to disappear the same way a single deleted target does, not just stop
// getting new ones.
DeactivateBranchTargetsBySeries(ctx context.Context, seriesID sql.NullInt64) error
DeactivateCoupon(ctx context.Context, code string) error
// Deactivating the list itself just stops it appearing as "open" in the
// admin UI; the codes it already minted are deactivated separately below
// so an in-flight redemption on a disconnected till isn't silently
// resurrected once it reconnects.
DeactivateCouponList(ctx context.Context, id int64) error
DeactivateCouponsForList(ctx context.Context, listID sql.NullInt64) (int64, error)
DecrementInvoicesIndex(ctx context.Context, arg DecrementInvoicesIndexParams) (int64, error)
DeleteAllWhatsAppRules(ctx context.Context) error
DeleteAppRelease(ctx context.Context, id int64) error
DeleteAsset(ctx context.Context, id int64) error
DeleteAssetCategory(ctx context.Context, id int64) error
DeleteAssets(ctx context.Context, ids []int64) (int64, error)
DeleteAttributeValue(ctx context.Context, id int64) error
DeleteAttributeValues(ctx context.Context, ids []int64) (int64, error)
DeleteBatch(ctx context.Context, id int64) error
DeleteBranchAttendanceEvent(ctx context.Context, id int64) error
DeleteBranchInvoicePaymentsForInvoice(ctx context.Context, branchInvoiceID int64) error
DeleteBranchQuickAccessItems(ctx context.Context, branchID int64) error
DeleteBranchTargetSeries(ctx context.Context, id int64) (BranchTargetSeries, error)
DeleteBranchUser(ctx context.Context, id int64) error
DeleteCalendarEvent(ctx context.Context, id int64) error
DeleteCashboxAccount(ctx context.Context, id int64) error
// Back to inheriting central. Deleting the row rather than writing one full
// of NULLs keeps "no override" a single state instead of two.
DeleteCashboxAccountOverride(ctx context.Context, arg DeleteCashboxAccountOverrideParams) error
DeleteClient(ctx context.Context, id int64) error
DeleteColor(ctx context.Context, id int64) error
DeleteColors(ctx context.Context, ids []int64) (int64, error)
DeleteCouponCategory(ctx context.Context, id int64) error
DeleteCouponType(ctx context.Context, id int64) error
DeleteCoupons(ctx context.Context, codes []string) (int64, error)
DeleteCurrencies(ctx context.Context, codes []string) (int64, error)
DeleteCurrency(ctx context.Context, code string) error
DeleteDeal(ctx context.Context, id int64) error
DeleteDiscountList(ctx context.Context, id int64) error
DeleteDiscountListBranch(ctx context.Context, branchID int64) error
DeleteDiscountListBranchesForList(ctx context.Context, discountListID int64) error
DeleteDiscountListItem(ctx context.Context, arg DeleteDiscountListItemParams) error
DeleteDiscountListItems(ctx context.Context, arg DeleteDiscountListItemsParams) (int64, error)
DeleteDiscountListOptionItem(ctx context.Context, arg DeleteDiscountListOptionItemParams) error
// Rows are named by (variant, option) pairs, given as two parallel arrays;
// two unnests in one select list zip them pairwise.
DeleteDiscountListOptionItems(ctx context.Context, arg DeleteDiscountListOptionItemsParams) (int64, error)
// Their rules go with them (ON DELETE CASCADE).
DeleteDiscountListRuleGroups(ctx context.Context, discountListID int64) error
DeleteDiscountListRuleGroupsExcept(ctx context.Context, arg DeleteDiscountListRuleGroupsExceptParams) error
DeleteDiscountListRuleOptions(ctx context.Context, ruleID int64) error
DeleteDiscountListRules(ctx context.Context, discountListID int64) error
DeleteDiscountListRulesExcept(ctx context.Context, arg DeleteDiscountListRulesExceptParams) error
DeleteEmailSchedule(ctx context.Context, id int64) error
DeleteEmployee(ctx context.Context, id int64) error
DeleteExpense(ctx context.Context, id int64) error
DeleteExpenseCategory(ctx context.Context, id int64) error
DeleteExpenses(ctx context.Context, ids []int64) (int64, error)
// A till retrying a thank-you after a temporary failure: its earlier failed
// rows go, so the log keeps one row per sale showing how it ended.
DeleteFailedWhatsAppMessagesForInvoice(ctx context.Context, arg DeleteFailedWhatsAppMessagesForInvoiceParams) error
// Deletes a historical backfill invoice (and, via ON DELETE CASCADE, its
// items and payments) so it can be re-imported with corrected data. The
// historical=true guard means this can never remove a real till's sale,
// even given a wrong id -- see deleteBranchInvoice in api/branch_invoice.go.
DeleteHistoricalBranchInvoice(ctx context.Context, id int64) (int64, error)
DeleteIPBan(ctx context.Context, ip string) error
DeleteInventories(ctx context.Context, ids []int64) (int64, error)
DeleteInventory(ctx context.Context, id int64) error
// Kept, marked deleted: the tills drop it when it comes down as not
// applying to them (000212).
DeleteInvoiceDiscount(ctx context.Context, id int64) error
DeleteInvoiceDiscountBranches(ctx context.Context, invoiceDiscountID int64) error
DeleteLoan(ctx context.Context, id int64) error
DeleteLoanCategory(ctx context.Context, id int64) error
DeleteLoanPayment(ctx context.Context, id int64) error
// Central loans only, same read-only guard as DeleteLoan.
DeleteLoans(ctx context.Context, ids []int64) (int64, error)
DeletePriceList(ctx context.Context, id int64) error
DeletePriceListBranch(ctx context.Context, branchID int64) error
DeletePriceListBranchesForList(ctx context.Context, priceListID int64) error
DeletePriceListItem(ctx context.Context, arg DeletePriceListItemParams) error
DeletePriceListItems(ctx context.Context, arg DeletePriceListItemsParams) (int64, error)
DeleteProduct(ctx context.Context, id int64) error
DeleteProductCategory(ctx context.Context, id int64) error
DeleteProductVariant(ctx context.Context, id int64) error
DeletePurchaseItem(ctx context.Context, arg DeletePurchaseItemParams) error
DeleteRole(ctx context.Context, id int64) error
DeleteRolePermissions(ctx context.Context, roleID int64) error
DeleteSalesperson(ctx context.Context, id int64) error
DeleteSize(ctx context.Context, id int64) error
DeleteSizes(ctx context.Context, ids []int64) (int64, error)
DeleteStockCountItems(ctx context.Context, stockCountID int64) error
DeleteTransferItem(ctx context.Context, arg DeleteTransferItemParams) error
DeleteUnknownItemImages(ctx context.Context, dollar_1 []int64) error
// Units taken off the cart since the session was last sent.
DeleteUnknownItemSlotsNotIn(ctx context.Context, arg DeleteUnknownItemSlotsNotInParams) error
DeleteUser(ctx context.Context, id int64) error
DeleteWhatsAppNumber(ctx context.Context, id int64) error
FindUnknownInvoiceItem(ctx context.Context, arg FindUnknownInvoiceItemParams) (BranchInvoiceItem, error)
GetAppRelease(ctx context.Context, id int64) (AppRelease, error)
GetAppSettings(ctx context.Context) (AppSetting, error)
GetAsset(ctx context.Context, id int64) (Asset, error)
GetAssetByName(ctx context.Context, name string) (Asset, error)
GetAssetCategory(ctx context.Context, id int64) (AssetCategory, error)
GetAssetCategoryByName(ctx context.Context, name string) (AssetCategory, error)
GetAssetTreemapData(ctx context.Context, inventoryID sql.NullInt64) ([]GetAssetTreemapDataRow, error)
GetAttribute(ctx context.Context, name string) (Attribute, error)
// upserting instead of inserting makes product creation with attributes easier
GetAttributeValue(ctx context.Context, id int64) (AttributesValue, error)
GetBatch(ctx context.Context, id int64) (GetBatchRow, error)
GetBatchItemByBatchVariant(ctx context.Context, arg GetBatchItemByBatchVariantParams) (BatchItem, error)
GetBranch(ctx context.Context, id int64) (Branch, error)
GetBranchAttendanceChange(ctx context.Context, id int64) (BranchAttendanceChange, error)
GetBranchAttendanceChangeByClientRef(ctx context.Context, arg GetBranchAttendanceChangeByClientRefParams) (BranchAttendanceChange, error)
GetBranchAttendanceEvent(ctx context.Context, id int64) (BranchAttendanceEvent, error)
GetBranchAttendanceEventByClientRef(ctx context.Context, arg GetBranchAttendanceEventByClientRefParams) (BranchAttendanceEvent, error)
GetBranchByCode(ctx context.Context, code string) (Branch, error)
// Resolves a till's chosen transfer destination by branch code, refusing
// a branch naming itself as its own destination.
GetBranchByCodeExcluding(ctx context.Context, arg GetBranchByCodeExcludingParams) (Branch, error)
GetBranchCommand(ctx context.Context, id int64) (BranchCommand, error)
GetBranchExpense(ctx context.Context, id int64) (BranchExpense, error)
GetBranchExpenseByClientRef(ctx context.Context, arg GetBranchExpenseByClientRefParams) (BranchExpense, error)
GetBranchExpenseImage(ctx context.Context, id int64) (BranchExpenseImage, error)
GetBranchExpenseUploadTokenByToken(ctx context.Context, token string) (BranchExpenseUploadToken, error)
GetBranchInvoice(ctx context.Context, id int64) (BranchInvoice, error)
GetBranchInvoiceByClientRef(ctx context.Context, arg GetBranchInvoiceByClientRefParams) (BranchInvoice, error)
// The sale a WhatsApp message was about (whatsapp_conversation.go).
GetBranchInvoiceByCode(ctx context.Context, arg GetBranchInvoiceByCodeParams) (BranchInvoice, error)
GetBranchInvoiceSettlement(ctx context.Context, id int64) (BranchInvoiceSettlement, error)
GetBranchInvoiceSettlementByClientRef(ctx context.Context, arg GetBranchInvoiceSettlementByClientRefParams) (BranchInvoiceSettlement, error)
GetBranchLoanByClientRef(ctx context.Context, arg GetBranchLoanByClientRefParams) (Loan, error)
GetBranchRegister(ctx context.Context, id int64) (BranchRegister, error)
GetBranchRegisterByCode(ctx context.Context, code string) (BranchRegister, error)
GetBranchSettings(ctx context.Context, branchID int64) (BranchSetting, error)
GetBranchShift(ctx context.Context, id int64) (BranchShift, error)
GetBranchShiftByClientRef(ctx context.Context, arg GetBranchShiftByClientRefParams) (BranchShift, error)
GetBranchShiftReceiptImage(ctx context.Context, id int64) (BranchShiftReceiptImage, error)
GetBranchShiftReceiptImageForShift(ctx context.Context, branchShiftID int64) (BranchShiftReceiptImage, error)
GetBranchShiftUploadTokenByToken(ctx context.Context, token string) (BranchShiftUploadToken, error)
GetBranchSyncConflict(ctx context.Context, id int64) (BranchSyncConflict, error)
GetBranchTarget(ctx context.Context, id int64) (BranchTarget, error)
GetBranchTargetBySeriesAndStart(ctx context.Context, arg GetBranchTargetBySeriesAndStartParams) (BranchTarget, error)
GetBranchTargetSeries(ctx context.Context, id int64) (BranchTargetSeries, error)
GetBranchTransferByClientRef(ctx context.Context, arg GetBranchTransferByClientRefParams) (Transfer, error)
GetBranchTransferUploadTokenByToken(ctx context.Context, token string) (BranchTransferUploadToken, error)
GetBranchUser(ctx context.Context, id int64) (BranchUser, error)
GetBranchVisitorEventByClientRef(ctx context.Context, arg GetBranchVisitorEventByClientRefParams) (BranchVisitorEvent, error)
GetCashbox(ctx context.Context, id int64) (Cashbox, error)
GetCashboxAccount(ctx context.Context, id int64) (CashboxAccount, error)
GetCashboxAccountBalance(ctx context.Context, arg GetCashboxAccountBalanceParams) (ShiftsAccountsBalance, error)
GetClient(ctx context.Context, id int64) (Client, error)
GetClientByPhone(ctx context.Context, phone string) (Client, error)
// Shared-identity (uid) queries for branch sync. See 000093_sync_uid.up.sql.
GetClientByUID(ctx context.Context, uid uuid.UUID) (Client, error)
GetClientLink(ctx context.Context, arg GetClientLinkParams) (int64, error)
GetColorByName(ctx context.Context, name string) (Color, error)
GetCoupon(ctx context.Context, code string) (Coupon, error)
GetCouponCategory(ctx context.Context, id int64) (CouponCategory, error)
GetCouponList(ctx context.Context, id int64) (CouponList, error)
GetCouponType(ctx context.Context, id int64) (CouponType, error)
GetCurrency(ctx context.Context, code string) (Currency, error)
GetDeal(ctx context.Context, id int64) (Deal, error)
GetDefaultBranchSettings(ctx context.Context) (DefaultBranchSetting, error)
GetDefaultCurrency(ctx context.Context) (Currency, error)
GetDefaultDiscountForVariant(ctx context.Context, productVariantID int64) (int16, error)
GetDefaultDiscountList(ctx context.Context) (DiscountList, error)
GetDefaultInvoiceType(ctx context.Context) (InvoiceType, error)
// Branch-independent price, for the contexts that have no branch to speak of:
// printed labels, stock listings, head-office reporting.
GetDefaultPriceForVariant(ctx context.Context, productVariantID int64) (int64, error)
GetDefaultPriceList(ctx context.Context) (PriceList, error)
GetDiscountList(ctx context.Context, id int64) (DiscountList, error)
GetDiscountListBranch(ctx context.Context, branchID int64) (DiscountListBranch, error)
GetDiscountListByUID(ctx context.Context, uid uuid.UUID) (DiscountList, error)
GetEmailResendAPIKey(ctx context.Context) (string, error)
GetEmailSchedule(ctx context.Context, id int64) (EmailSchedule, error)
GetEmailSettings(ctx context.Context) (GetEmailSettingsRow, error)
GetEmployee(ctx context.Context, id int64) (Employee, error)
GetEntry(ctx context.Context, id int64) (Entry, error)
GetExpense(ctx context.Context, id int64) (Expense, error)
GetExpenseCategory(ctx context.Context, id int64) (ExpenseCategory, error)
// One representative barcode per product code, for linking an external
// sales import's line (which only ever has the product code, not a
// specific color/size) to a real product_variants row -- see
// api/product_cost_import.go's sibling, the invoice line-linking script.
// Picks the lowest-id active variant; which exact variant doesn't matter
// for revenue/cost attribution, only that the line resolves to the right
// product instead of staying an unlinked placeholder.
GetFirstActiveVariantBarcodeByCode(ctx context.Context, code string) (GetFirstActiveVariantBarcodeByCodeRow, error)
GetInventory(ctx context.Context, id int64) (Inventory, error)
GetInventoryByName(ctx context.Context, name string) (Inventory, error)
// ---------------------------------------------------------------------------
// Per-variant stock: cached on-hand quantity + moving-average cost.
// ---------------------------------------------------------------------------
GetInventoryStock(ctx context.Context, arg GetInventoryStockParams) (InventoryStock, error)
GetInvoice(ctx context.Context, id int64) (Invoice, error)
GetInvoiceType(ctx context.Context, id int64) (InvoiceType, error)
GetLoan(ctx context.Context, id int64) (Loan, error)
GetLoanCategory(ctx context.Context, id int64) (LoanCategory, error)
GetLoanImage(ctx context.Context, id int64) (LoanImage, error)
GetLoanPayment(ctx context.Context, id int64) (LoanPayment, error)
GetLoanUploadTokenByToken(ctx context.Context, token string) (LoanUploadToken, error)
// Counts across all active, alert-enabled products, ignoring search --
// backs the summary cards, which should reflect the whole picture even
// while the table below is filtered.
GetLowStockSummary(ctx context.Context) (GetLowStockSummaryRow, error)
GetNextBarcodeItemValue(ctx context.Context) (int64, error)
GetPriceList(ctx context.Context, id int64) (PriceList, error)
GetPriceListBranch(ctx context.Context, branchID int64) (PriceListBranch, error)
GetPriceListByUID(ctx context.Context, uid uuid.UUID) (PriceList, error)
GetProduct(ctx context.Context, id int64) (Product, error)
GetProductAttributeValue(ctx context.Context, arg GetProductAttributeValueParams) (ProductsAttribute, error)
GetProductAttributes(ctx context.Context, productID int64) ([]ProductsAttribute, error)
// -- name: CreatePriceList :one
// INSERT INTO price_lists (
// name,
// is_active,
// is_default,
// valid_from,
// valid_to
// ) VALUES (
// $1, $2, $3, $4, $5
// ) RETURNING *;
// -- name: ListPriceLists :many
// SELECT * FROM price_lists
// ORDER BY name
// LIMIT $1
// OFFSET $2;
// -- name: UpdatePriceList :exec
// UPDATE price_lists
// SET name = $2,
// is_active = $3,
// is_default = $4,
// valid_from = $5,
// valid_to = $6
// WHERE id = $1;
// -- name: CreateProductPrice :one
// INSERT INTO price_list_items (
// price_list_id,
// product_id,
// price
// ) VALUES (
// $1, $2, $3
// ) RETURNING *;
// -- name: UpdateProductPrice :exec
// UPDATE price_list_items
// SET price = $3
// WHERE product_id = $1 AND price_list_id = $2;
// -- name: CreateDiscountList :one
// INSERT INTO discount_lists (
// name,
// is_active,
// is_default,
// valid_from,
// valid_to
// ) VALUES (
// $1, $2, $3, $4, $5
// ) RETURNING *;
// -- name: ListDiscountLists :many
// SELECT * FROM discount_lists
// ORDER BY name
// LIMIT $1
// OFFSET $2;
// -- name: UpdateDiscountList :exec
// UPDATE price_lists
// SET name = $2,
// is_active = $3,
// is_default = $4,
// valid_from = $5,
// valid_to = $6
// WHERE id = $1;
// -- name: UnsetDefaultPriceList :exec
// UPDATE price_lists
// SET is_default = false
// WHERE is_default = true;
// -- name: CreateProductDiscount :one
// INSERT INTO discount_list_items (
// discount_list_id,
// product_id,
// discount
// ) VALUES (
// $1, $2, $3
// ) RETURNING *;
// -- name: UpdateProductDiscount :exec
// UPDATE discount_list_items
// SET discount = $3
// WHERE product_id = $1 AND discount_list_id = $2;
GetProductByCode(ctx context.Context, code string) (Product, error)
GetProductByName(ctx context.Context, name string) (Product, error)
GetProductCategory(ctx context.Context, id int64) (ProductCategory, error)
GetProductCategoryByName(ctx context.Context, name string) (ProductCategory, error)
GetProductSupplier(ctx context.Context, arg GetProductSupplierParams) (ProductSupplier, error)
GetProductVariant(ctx context.Context, id int64) (ProductVariant, error)
GetProductVariantByBarcode(ctx context.Context, barcode string) (ProductVariant, error)
GetProductVariantByUID(ctx context.Context, uid uuid.UUID) (ProductVariant, error)
GetPurchase(ctx context.Context, id int64) (GetPurchaseRow, error)
GetRecurringExpense(ctx context.Context, id int64) (RecurringExpense, error)
GetRegisterTargetRelease(ctx context.Context, id int64) (GetRegisterTargetReleaseRow, error)
GetReturnInvoice(ctx context.Context, invoiceID int64) (ReturnInvoice, error)
// Review links in the post-sale WhatsApp message and the Google data behind
// the Reviews page (api/review_link.go, api/google_places.go).
GetReviewSettings(ctx context.Context) (GetReviewSettingsRow, error)
GetRole(ctx context.Context, id int64) (Role, error)
GetSaleOption(ctx context.Context, id int64) (SaleOption, error)
GetSalesInvoice(ctx context.Context, invoiceID int64) (int64, error)
GetSalesperson(ctx context.Context, id int64) (Salesperson, error)
// Another salesperson of the same branch already using this device number.
GetSalespersonByAttendanceID(ctx context.Context, arg GetSalespersonByAttendanceIDParams) (Salesperson, error)
GetSecuritySettings(ctx context.Context) (SecuritySetting, error)
GetSession(ctx context.Context, id uuid.UUID) (Session, error)
GetShift(ctx context.Context, id int64) (Shift, error)
GetSizeByName(ctx context.Context, name string) (Size, error)
GetSlowMoverSummary(ctx context.Context) (GetSlowMoverSummaryRow, error)
GetStockCount(ctx context.Context, id int64) (StockCount, error)
// Inventory health: overall days-of-inventory (on-hand / trailing daily
// sell-through), total inventory value at moving-average cost, and the
// same breakdown per inventory location.
GetStockHealthOverview(ctx context.Context) (GetStockHealthOverviewRow, error)
GetSupplier(ctx context.Context, id int64) (Supplier, error)
GetTransfer(ctx context.Context, id int64) (Transfer, error)
GetUnknownItemImage(ctx context.Context, id int64) (UnknownItemImage, error)
GetUnknownItemSessionByRef(ctx context.Context, arg GetUnknownItemSessionByRefParams) (UnknownItemSession, error)
GetUnknownItemSessionByToken(ctx context.Context, token string) (UnknownItemSession, error)
GetUnknownItemSlotByRef(ctx context.Context, arg GetUnknownItemSlotByRefParams) (UnknownItemSlot, error)
GetUnknownItemSlotForResolve(ctx context.Context, id int64) (GetUnknownItemSlotForResolveRow, error)
GetUser(ctx context.Context, id int64) (User, error)
// One row per permission of the user's role, or a single row with NULL
// section for a role that has none (an admin, or a brand-new role). No rows
// at all means the user no longer exists.
GetUserAccess(ctx context.Context, id int64) ([]GetUserAccessRow, error)
GetUserByUsername(ctx context.Context, username string) (User, error)
GetVariantDiscountFromList(ctx context.Context, arg GetVariantDiscountFromListParams) (DiscountListItem, error)
GetVariantForLabel(ctx context.Context, id int64) (GetVariantForLabelRow, error)
GetVariantPriceFromList(ctx context.Context, arg GetVariantPriceFromListParams) (PriceListItem, error)
GetVariantTotalOnHand(ctx context.Context, variantID int64) (int64, error)
// Feeds the Warehouses Treemap: on-hand quantity per product, grouped by
// product_categories and by inventory. The inner join on product_categories
// means only products we've explicitly categorized show up here -- ordinary
// POS-sellable products with no category_id are never pulled into this view.
GetWarehouseTreemapData(ctx context.Context, inventoryID sql.NullInt64) ([]GetWarehouseTreemapDataRow, error)
GetWhatsAppChatMessageMedia(ctx context.Context, id int64) (GetWhatsAppChatMessageMediaRow, error)
GetWhatsAppMessageByReviewCode(ctx context.Context, reviewCode string) (GetWhatsAppMessageByReviewCodeRow, error)
GetWhatsAppMessageCost(ctx context.Context) (int64, error)
GetWhatsAppMessageWithBranch(ctx context.Context, id int64) (GetWhatsAppMessageWithBranchRow, error)
GetWhatsAppNumber(ctx context.Context, id int64) (WhatsappNumber, error)
// Where a reply's media is kept: the bridge number that got it, and its id.
GetWhatsAppPollReplyMedia(ctx context.Context, id int64) (GetWhatsAppPollReplyMediaRow, error)
// Sending post-sale messages from our own numbers through the WhatsApp
// bridge (api/whatsapp_bridge.go).
GetWhatsAppSenderSettings(ctx context.Context) (GetWhatsAppSenderSettingsRow, error)
GetWhatsAppSettings(ctx context.Context) (GetWhatsAppSettingsRow, error)
// The place as it stood at `at`: its last snapshot taken before then.
GooglePlaceSnapshotBefore(ctx context.Context, arg GooglePlaceSnapshotBeforeParams) (GooglePlaceSnapshot, error)
// The home page's "Recent activity" feed: the same rows as
// DashboardActivitiesList (every kind of branch sync, newest received
// first, hidden branches and registers left out), but paged by a keyset
// cursor instead of a date window and an offset, and without the windowed
// total. Each page is the next page_size rows after (before_at,
// before_activity, before_id) -- the last row the feed already has -- so
// the per-table received_at indexes do the work and a page costs the same
// however far down the feed is scrolled. The salesperson colour is looked
// up for the page's rows only.
HomeActivityFeed(ctx context.Context, arg HomeActivityFeedParams) ([]HomeActivityFeedRow, error)
IncrementInvoicesIndex(ctx context.Context, arg IncrementInvoicesIndexParams) (int64, error)
// A sale can reach kashi after the return that cancelled it (a resync pushes
// whatever kashi is missing, in no guaranteed order); it picks up the mark the
// cancellation already left waiting for it.
InheritBranchInvoiceCancellation(ctx context.Context, id int64) error
InsertBranchQuickAccessItem(ctx context.Context, arg InsertBranchQuickAccessItemParams) error
// When this phone was last actually messaged; no rows when never.
LastWhatsAppSentAt(ctx context.Context, clientPhone string) (time.Time, error)
LatestGooglePlaceSnapshot(ctx context.Context, placeID string) (GooglePlaceSnapshot, error)
LinkUnknownItemSession(ctx context.Context, arg LinkUnknownItemSessionParams) error
ListActiveBranchRegisterIDs(ctx context.Context, branchID int64) ([]int64, error)
ListActiveBranchTargetSeries(ctx context.Context) ([]BranchTargetSeries, error)
ListActiveIPBans(ctx context.Context) ([]IpBan, error)
// User and role changes are admin housekeeping, kept out of the feed.
ListAdminActivities(ctx context.Context, arg ListAdminActivitiesParams) ([]ListAdminActivitiesRow, error)
ListAllAttributeValues(ctx context.Context) ([]ListAllAttributeValuesRow, error)
ListAllBranchRegisters(ctx context.Context) ([]BranchRegister, error)
ListAllCashboxAccounts(ctx context.Context) ([]CashboxAccount, error)
// Every client's raw stored phone, for the one-off admin normalize job
// (api/client_phone_cleanup.go) -- unlike ListClients this is never paged,
// since the job needs every row in one pass to detect collisions.
ListAllClientPhones(ctx context.Context) ([]ListAllClientPhonesRow, error)
// Newest first, with how many active registers run each release and how
// many are told to.
ListAppReleases(ctx context.Context) ([]ListAppReleasesRow, error)
ListAppUpdateEvents(ctx context.Context, limit int32) ([]ListAppUpdateEventsRow, error)
ListAssetCategories(ctx context.Context) ([]AssetCategory, error)
ListAssetsPage(ctx context.Context, arg ListAssetsPageParams) ([]Asset, error)
ListAttributeValuesPage(ctx context.Context, arg ListAttributeValuesPageParams) ([]ListAttributeValuesPageRow, error)
ListAttributes(ctx context.Context) ([]Attribute, error)
ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
// What the daily clean-up removes: pictures whose units were all matched
// before resolved_before, and pictures of checkouts that never became a sale
// and whose link expired before abandoned_before.
ListAutoDeletableUnknownItemImages(ctx context.Context, arg ListAutoDeletableUnknownItemImagesParams) ([]ListAutoDeletableUnknownItemImagesRow, error)
// FIFO order: oldest batch (by receipt/creation date) first. Walked by
// applyStockMovement to decide which batch(es) a sold unit debits.
// FOR UPDATE so two sales racing on the same variant can't both allocate
// the same remaining units.
ListAvailableBatchItemsForVariant(ctx context.Context, variantID int64) ([]BatchItem, error)
// Per-item numbers for the batch's "Products" tab, scoped to this batch's
// own units via FIFO-tagged stock_movements: remaining_quantity is exactly
// what's left of this batch unsold, and quantity_sold/revenue are summed
// only from sale movements this batch's FIFO consumption actually
// produced (revenue prorated off the source invoice line's price/unit).
ListBatchItemsStats(ctx context.Context, batchID int64) ([]ListBatchItemsStatsRow, error)
ListBatches(ctx context.Context, arg ListBatchesParams) ([]ListBatchesRow, error)
ListBranchAttendanceChanges(ctx context.Context, arg ListBranchAttendanceChangesParams) ([]BranchAttendanceChange, error)
// Newest punch first by its own local date/time, not insertion order: a
// backfilled import gets the newest ids but holds the oldest punches.
// A punch an approved change replaced or deleted (removed_at) is left out;
// it stays in the table for the audit trail.
ListBranchAttendanceEvents(ctx context.Context, arg ListBranchAttendanceEventsParams) ([]BranchAttendanceEvent, error)
// Every live punch between two dates (inclusive) for the timesheet views,
// which pair each person's IN/OUT punches per day. event_date is the
// device's own YYYY-MM-DD text, so a plain text comparison orders it.
// Capped as a guard against an all-branches, all-time request.
ListBranchAttendanceEventsInRange(ctx context.Context, arg ListBranchAttendanceEventsInRangeParams) ([]BranchAttendanceEvent, error)
// Adoption: which central client each of this register's local client ids
// is linked to, so a till can stamp the right uid without guessing by phone.
ListBranchClientUIDs(ctx context.Context, registerID int64) ([]ListBranchClientUIDsRow, error)
ListBranchCommands(ctx context.Context, arg ListBranchCommandsParams) ([]ListBranchCommandsRow, error)
// The Commands page: every branch (branch_id 0) or one, optionally one
// register / status / type, newest first.
ListBranchCommandsPage(ctx context.Context, arg ListBranchCommandsPageParams) ([]ListBranchCommandsPageRow, error)
ListBranchExpenseHistoryForSync(ctx context.Context, arg ListBranchExpenseHistoryForSyncParams) ([]ListBranchExpenseHistoryForSyncRow, error)
// Storage-explorer feed: every uploaded image, newest first, joined with
// its expense and branch so the admin UI never needs a second round trip
// per row.
ListBranchExpenseImages(ctx context.Context, arg ListBranchExpenseImagesParams) ([]ListBranchExpenseImagesRow, error)
ListBranchExpenseImagesForExpense(ctx context.Context, branchExpenseID int64) ([]BranchExpenseImage, error)
// sqlc.narg(branch_id) is nullable: NULL means "all branches", matching
// ListBranchInvoices' admin-filter convention. search ” means no filter.
ListBranchExpenses(ctx context.Context, arg ListBranchExpensesParams) ([]BranchExpense, error)
// At most one coupon redemption per invoice (see CreateBranchInvoiceTx's own
// comment) -- the code a redeemed coupon carries for the given invoices'
// client_refs, so the branch can reattach it to whichever payment line it
// recognizes as its own coupon-settlement placeholder account. Coupon codes
// are never persisted on branch_invoice_payments itself (see
// CreateBranchInvoiceTx: a coupon payment only ever calls RedeemCoupon), so
// this is the only way to recover which line was the coupon.
ListBranchInvoiceCouponCodesForHistory(ctx context.Context, arg ListBranchInvoiceCouponCodesForHistoryParams) ([]ListBranchInvoiceCouponCodesForHistoryRow, error)
// ---------------------------------------------------------------------------
// Branch-scoped historical read-back (see api/branch_catchup.go's
// branchSyncChanges "branch_invoice_history"/"branch_expense_history"/
// "branch_loan_history"/"branch_shift_history" cases). Lets a branch pull
// its OWN previously-submitted invoices/expenses/loans/shift-closes back
// down -- e.g. re-provisioning a wiped till for a branch that already has
// real history on kashi. branch_id always comes from the authenticated
// branch (ctx.MustGet(branchIDKey)), never a request parameter, so a
// branch can only ever pull its own data. Keyset-paginated on
// (received_at, id), same cursor shape as ListBranchStockForSync.
//
// Invoices and shift closes are per register: a re-provisioned till gets
// back only what it itself sold and closed, so its invoice numbering and
// local shift ids carry on without colliding with its branch's other tills.
// Expenses and loans aren't tracked per register and stay branch-wide.
// ---------------------------------------------------------------------------
ListBranchInvoiceHistoryForSync(ctx context.Context, arg ListBranchInvoiceHistoryForSyncParams) ([]BranchInvoice, error)
// With the product each line is, for the admin views: the till only sends
// its own local product id, which means nothing here, so the name comes
// from the variant product_uid resolves to (blank for an old line that
// never resolved -- see resolveVariantByUIDOrBarcode).
ListBranchInvoiceItems(ctx context.Context, branchInvoiceID int64) ([]ListBranchInvoiceItemsRow, error)
// Items for a whole page of invoices at once, batched by id -- distinct
// from ListBranchInvoiceItems (branch_invoice.sql), which is the
// single-invoice admin detail view. resolved_barcode comes from
// product_variants via product_uid (nullable: an item pushed before
// product_uid existed, and whose barcode never resolved to a variant at
// push time either, has neither -- see resolveVariantByUIDOrBarcode in
// tx_branch_invoice.go).
ListBranchInvoiceItemsForHistory(ctx context.Context, branchInvoiceIds []int64) ([]ListBranchInvoiceItemsForHistoryRow, error)
// An invoice's lines with the product each one sold, for the Recent
// activity details dialog. A line whose product_uid never resolved to a
// variant keeps an empty name.
ListBranchInvoiceItemsNamed(ctx context.Context, branchInvoiceID int64) ([]ListBranchInvoiceItemsNamedRow, error)
ListBranchInvoicePayments(ctx context.Context, branchInvoiceID int64) ([]BranchInvoicePayment, error)
ListBranchInvoicePaymentsForHistory(ctx context.Context, branchInvoiceIds []int64) ([]BranchInvoicePayment, error)
ListBranchInvoiceSettlementPayments(ctx context.Context, branchInvoiceSettlementID int64) ([]BranchInvoiceSettlementPayment, error)
ListBranchInvoiceSettlements(ctx context.Context, arg ListBranchInvoiceSettlementsParams) ([]BranchInvoiceSettlement, error)
// sqlc.narg(branch_id) is nullable: NULL means "all branches", matching how
// the admin UI's branch filter works (a dropdown with an "All branches"
// option, not a required selection).
ListBranchInvoices(ctx context.Context, arg ListBranchInvoicesParams) ([]BranchInvoice, error)
ListBranchInvoicesPage(ctx context.Context, arg ListBranchInvoicesPageParams) ([]BranchInvoice, error)
ListBranchLoanHistoryForSync(ctx context.Context, arg ListBranchLoanHistoryForSyncParams) ([]ListBranchLoanHistoryForSyncRow, error)
ListBranchPlaceIDs(ctx context.Context) ([]ListBranchPlaceIDsRow, error)
// ---------------------------------------------------------------------------
// Branch (kashi-pos) sales. branch_invoice_items itself carries no product
// link (branch_product_id is a branch-local id, not an FK -- see
// 000025_create_branch_invoices.up.sql), so it can't be the source. But
// CreateBranchInvoiceTx (tx_branch_invoice.go) already resolves each line's
// barcode to a real product_variants row at sync time and records the sale
// as a stock_movements row (reason='sale', reference_type='branch_invoice',
// inventory_id = the branch's own store inventory) purely to decrement
// central stock -- that ledger is the only place a branch sale is linked to
// a real product. It carries quantity but no transaction price, so revenue
// here is an ESTIMATE: each unit priced at the variant's *current* catalog
// price (its entry in the default price list -- see the variant_default_prices
// view in 000094), not whatever kashi-pos actually charged
// at checkout (which may have included a since-changed price or a
// branch-side discount neither table records at this granularity). A line
// whose barcode never resolved (old kashi-pos build, unknown barcode, or a
// historical backfill -- see CreateBranchInvoiceTx's Historical branch)
// never got a stock_movements row at all and so is silently absent here,
// same as it's absent from central stock.
// ---------------------------------------------------------------------------
ListBranchProductRevenue(ctx context.Context, arg ListBranchProductRevenueParams) ([]ListBranchProductRevenueRow, error)
// Same scope/filters/estimate caveat as ListBranchProductRevenue, rolled up
// by local calendar day -- the trend line for the kashi-pos tab.
ListBranchProductRevenueDaily(ctx context.Context, arg ListBranchProductRevenueDailyParams) ([]ListBranchProductRevenueDailyRow, error)
// A branch's central Quick Access list, in card order, with enough of each
// product to show it in the admin editor; tills only use uid/position/colours.
ListBranchQuickAccessItems(ctx context.Context, branchID int64) ([]ListBranchQuickAccessItemsRow, error)
ListBranchRegisters(ctx context.Context, branchID int64) ([]BranchRegister, error)
ListBranchRegistersByIDs(ctx context.Context, ids []int64) ([]BranchRegister, error)
// Same scope/filters/estimate caveat as ListBranchProductRevenue, rolled up
// by branch instead of by product -- backs the "revenue by branch" chart,
// deliberately with no branch_id filter of its own (that would defeat the
// point of a per-branch breakdown).
ListBranchRevenueByBranch(ctx context.Context, arg ListBranchRevenueByBranchParams) ([]ListBranchRevenueByBranchRow, error)
// Per (branch, local day) sales-invoice count and gross sales revenue in an
// inclusive "YYYY-MM-DD" range, oldest first. Deliberately shaped like
// ListBranchVisitorDaysRange so the Footfall page can line footfall up
// against sales for the same window -- conversion rate, average ticket --
// with one extra request and no per-day query.
//
// Only kind = 'sales' counts: a return or exchange isn't a walk-in turning
// into a buyer, and its grand_total carries the branch's own signed
// refund/top-up convention (see ListDailyIncome) which would distort an
// "average sale" figure. The occurred_at range is compared against plain
// date bounds (not AT TIME ZONE per row) so idx_branch_invoices_occurred_at
// stays usable, same reasoning as ListDailyIncome.
ListBranchSalesDaysRange(ctx context.Context, arg ListBranchSalesDaysRangeParams) ([]ListBranchSalesDaysRangeRow, error)
ListBranchShiftHistoryForSync(ctx context.Context, arg ListBranchShiftHistoryForSyncParams) ([]BranchShift, error)
// Storage-explorer feed: every uploaded close-shift receipt photo, newest
// first, joined with its shift and branch so the admin UI never needs a
// second round trip per row. Mirrors ListBranchExpenseImages.
ListBranchShiftReceiptImages(ctx context.Context, arg ListBranchShiftReceiptImagesParams) ([]ListBranchShiftReceiptImagesRow, error)
// sqlc.narg(branch_id) is nullable: NULL means "all branches", matching
// ListBranchExpenses' admin-filter convention. has_receipt_image lets the
// admin Shifts page show a per-row indicator without an extra request per
// shift (see branch_shift_receipt_images / api/branch_shift_receipt_image.go).
ListBranchShifts(ctx context.Context, arg ListBranchShiftsParams) ([]ListBranchShiftsRow, error)
// ---------------------------------------------------------------------------
// Cross-branch stock visibility: every OTHER branch's on-hand quantity and
// resolved selling price for a variant, so a till can search what a
// different branch is carrying. Keyset-paginated on inventory_stock's
// surrogate id (000101 -- the table's real key, (inventory_id,
// variant_id), has no single ordering column), same cursor shape as
// ListProductVariantsForSyncPaged.
// ---------------------------------------------------------------------------
ListBranchStockForSync(ctx context.Context, arg ListBranchStockForSyncParams) ([]ListBranchStockForSyncRow, error)
ListBranchSyncConflictsPage(ctx context.Context, arg ListBranchSyncConflictsPageParams) ([]ListBranchSyncConflictsPageRow, error)
ListBranchTargetSeriesForBranch(ctx context.Context, branchID int64) ([]BranchTargetSeries, error)
ListBranchTargetsForBranch(ctx context.Context, branchID int64) ([]BranchTarget, error)
// Branch-wide progress for a till's target bars: what every register of
// this branch has sold in each live target's range, as kashi has received
// it. The till adds its own not-yet-synced sales on top.
ListBranchTargetsProgress(ctx context.Context, arg ListBranchTargetsProgressParams) ([]ListBranchTargetsProgressRow, error)
ListBranchTargetsUpdatedSince(ctx context.Context, arg ListBranchTargetsUpdatedSinceParams) ([]BranchTarget, error)
// The till's own poll: what happened to the requests it made -- see
// approveTransfer/rejectTransfer, which both bump updated_at.
ListBranchTransfersUpdatedSince(ctx context.Context, arg ListBranchTransfersUpdatedSinceParams) ([]Transfer, error)
ListBranchUsersForBranch(ctx context.Context, branchID int64) ([]BranchUser, error)
// Branch-scoped catch-up feed, same contract as ListSalespersonsUpdatedSince.
ListBranchUsersUpdatedSince(ctx context.Context, arg ListBranchUsersUpdatedSinceParams) ([]BranchUser, error)
// One row per (branch, local day): gross customers-in vs customers-out,
// newest day first. sqlc.narg(branch_id) NULL means "all branches",
// matching ListBranchShifts' admin-filter convention.
ListBranchVisitorDays(ctx context.Context, arg ListBranchVisitorDaysParams) ([]ListBranchVisitorDaysRow, error)
// Every (branch, day) rollup within an inclusive "YYYY-MM-DD" day range,
// oldest first. No pagination: footfall data is one row per branch per day,
// so even a year across every branch is a small result the Footfall page
// slices into months / branch comparisons / weekday profiles client-side.
ListBranchVisitorDaysRange(ctx context.Context, arg ListBranchVisitorDaysRangeParams) ([]ListBranchVisitorDaysRangeRow, error)
ListBranchWhatsAppNumbers(ctx context.Context) ([]ListBranchWhatsAppNumbersRow, error)
ListBranches(ctx context.Context) ([]Branch, error)
ListBranchesForDiscountList(ctx context.Context, discountListID int64) ([]ListBranchesForDiscountListRow, error)
ListBranchesForPriceList(ctx context.Context, priceListID int64) ([]ListBranchesForPriceListRow, error)
// Whole set, small table like currencies -- a till needs to see a branch
// go inactive (and so disappear from its destination picker), which an
// updated-since delta can't express. Excludes the requesting branch
// itself: it can't transfer to itself.
ListBranchesForSync(ctx context.Context, id int64) ([]ListBranchesForSyncRow, error)
ListCalendarEvents(ctx context.Context) ([]CalendarEvent, error)
// The admin view: every central method with this branch's override state, so
// the UI can show what is inherited and what is explicitly set. Unlike the
// sync query this keeps disabled rows -- switching one back on is the whole
// point of the screen.
ListCashboxAccountOverridesForBranch(ctx context.Context, branchID int64) ([]ListCashboxAccountOverridesForBranchRow, error)
ListCashboxAccounts(ctx context.Context, arg ListCashboxAccountsParams) ([]CashboxAccount, error)
// What one branch's tills should actually show: the central set with that
// branch's overrides folded in, and the methods it switched off left out
// entirely. Absence is the signal kashi-pos reconciles on, so an excluded
// method needs no flag of its own -- not sending it is what deactivates it
// at the till (see reconcileCashboxAccounts in kashi-pos).
//
// COALESCE per column rather than per row: an override that only sets
// sort_order keeps inheriting central's color and currency, so a later
// central color change still reaches a branch that reordered its buttons.
ListCashboxAccountsForBranchSync(ctx context.Context, branchID int64) ([]ListCashboxAccountsForBranchSyncRow, error)
// The whole set, not a "changed since" delta. A branch has to be able to tell
// that kashi no longer has a payment method at all, and an incremental feed
// can only say what changed -- it has no way to say what is gone. Sending
// every row lets the till reconcile by absence, the same shape the price and
// discount lists use. The table is a handful of rows, so the cost is nil.
//
// Inactive methods are left out on purpose: absence is what the till
// reconciles a deactivation on (see ListCashboxAccountsForBranchSync and
// reconcileCashboxAccounts in kashi-pos), so a centrally deactivated method
// reaches every branch the same way a deleted one would, without kashi-pos
// ever needing to know about is_active at all.
ListCashboxAccountsForSync(ctx context.Context) ([]CashboxAccount, error)
ListCashboxAccountsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]CashboxAccount, error)
ListCashboxes(ctx context.Context, arg ListCashboxesParams) ([]Cashbox, error)
// Distinct countries actually present among clients' phones, for the
// clients page's country filter dropdown -- so it only ever offers a
// country that would return at least one result, instead of the full
// ~240-country ISO list.
ListClientPhoneCountries(ctx context.Context) ([]ListClientPhoneCountriesRow, error)
// Completeness check: every retail client's uid + updated_at, keyset-paged
// by uid. Inactive clients are included -- a till must learn they're
// inactive, not just stop hearing about them.
ListClientSyncIDs(ctx context.Context, arg ListClientSyncIDsParams) ([]ListClientSyncIDsRow, error)
// sqlc.narg(client_type) is nullable: NULL means "all types" -- the admin
// clients page passes it when a Retail/Wholesale tab is selected, and
// omits it for a combined view if one is ever added.
ListClients(ctx context.Context, arg ListClientsParams) ([]Client, error)
// ListClientsBySpendingCached, ranked by invoice count.
ListClientsByInvoiceCountCached(ctx context.Context, arg ListClientsByInvoiceCountCachedParams) ([]ListClientsByInvoiceCountCachedRow, error)
// ListClientsBySpendingCached, ranked by item count.
ListClientsByItemCountCached(ctx context.Context, arg ListClientsByItemCountCachedParams) ([]ListClientsByItemCountCachedRow, error)
// Powers the clients "loyalty pyramid" + rest-of-clients table: every
// client ranked by total_spent, invoice_count, or item_count (chosen via
// sort_by -- see the ORDER BY at the bottom). Two sources feed each metric:
// kashi's own admin invoices (sales positive, returns negative --
// invoices.grand_total is always stored as a positive magnitude regardless
// of kind, see ReturnInvoiceTx) and branch-reported sales
// (branch_invoices.grand_total, which already carries the correct net sign
// -- see ListDailyIncome). sqlc.arg(branch_ids) scopes to one branch's
// till (or several, via the branch_ids array; empty means every branch);
// central admin invoices aren't attributed to any branch, so they're
// excluded entirely once any branch is selected (an "All Branches"
// view is the only one where they belong). invoice_count/item_count follow
// the same all-or-selected-branches rule for consistency with total_spent.
// invoice_count/item_count are computed in the `ranked` CTE rather than as
// plain SELECT-list aliases so the ORDER BY's CASE expression can actually
// reference them: Postgres only resolves an output alias in ORDER BY when
// it's used bare, not when it's embedded in a larger expression (there it's
// looked up as an ordinary column instead, which fails since it isn't one
// of the FROM clause's columns). Wrapping in a CTE turns them into real
// columns of the derived table, so the CASE inside ORDER BY resolves fine.
ListClientsBySpending(ctx context.Context, arg ListClientsBySpendingParams) ([]ListClientsBySpendingRow, error)
// ListClientsBySpending for the unfiltered case (no branch, no dates, no
// first/returning): reads the client_spend cache instead of aggregating every
// invoice, so a page costs an index scan. Same ordering and the other filters
// (type, search, phone) as the live query. One query per sort, rather than a
// CASE in ORDER BY, so Postgres can read the top rows straight off that
// column's index. Every client has a client_spend row (see migration 197).
ListClientsBySpendingCached(ctx context.Context, arg ListClientsBySpendingCachedParams) ([]ListClientsBySpendingCachedRow, error)
ListClientsByUIDs(ctx context.Context, uids []uuid.UUID) ([]Client, error)
// Feeds the clients CSV export: one row per (client, branch) for every
// client who bought something, so the caller can write a file per branch.
// A client "belongs" to a branch because a non-cancelled invoice there is
// theirs. The invoice's client is resolved by either identity a till has
// used: the shared client_uid (current), or the older (register,
// branch_client_id) client_links entry -- an invoice carrying only one of
// them still counts. branch_ids (empty = every branch) and the
// [date_from, date_to) window (either bound optional) narrow which
// invoices count; spend/invoice figures are for that same scope, not
// lifetime. Central admin invoices have no branch (branch_id 0) and are only
// included when no branch is selected, the same rule as
// ListClientsBySpending. With no branch and no date set, clients who never
// bought anything are listed too (branch_id 0, zero spend). A client is
// listed under every branch they bought from, not only their home branch
// (clients.branch_id, the first one); the home branch adds a zero-spend row
// when they have no purchases there. Cancelled and
// hidden-from-reports branch invoices are skipped as everywhere else, unless
// include_excluded is set.
// Home branch (clients.branch_id): a client is also listed under it when
// they haven't bought there in this scope, e.g. one imported with a branch
// and no sales yet. Only for an explicit branch pick and no dates, since
// zero spend can't match a date window; the same hidden-branch rule as
// purchases applies.
ListClientsForExport(ctx context.Context, arg ListClientsForExportParams) ([]ListClientsForExportRow, error)
// Clients with no phone_country yet: ones a till created or edited before the
// sync path started filling it in. "nophone-..." placeholders aren't phone
// numbers, so they're left alone.
ListClientsMissingPhoneCountry(ctx context.Context) ([]ListClientsMissingPhoneCountryRow, error)
// Feeds the branch catch-up endpoint (see branch_catchup.go), same pattern
// as currencies/cashbox_accounts/products. Wholesale clients never appear
// here -- they're a central-office concept, not something a branch till
// should ever see in its client search. Converting an already-synced
// retail client to wholesale won't retract it from branches that already
// have it locally (no delete propagation exists for any synced entity
// today); acceptable since that conversion is expected to be rare.
ListClientsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Client, error)
// Keyset-paginated form of ListClientsUpdatedSince for a branch doing a
// full catch-up (cursor reset): ordered by (updated_at, id) so a page
// boundary that falls between two rows sharing an updated_at can't drop or
// repeat one. after_updated_at/after_id are the last row of the previous
// page (zero-time / 0 for the first page).
ListClientsUpdatedSincePaged(ctx context.Context, arg ListClientsUpdatedSincePagedParams) ([]Client, error)
// Same rows as ListClients, but with each branch's reported loyalty points
// (branch_invoices.loyalty_points_delta, via client_links) summed in
// alongside kashi's own admin-invoice points. Used by the admin clients
// page so the displayed balance isn't missing everything earned at a
// branch till.
ListClientsWithLoyalty(ctx context.Context, arg ListClientsWithLoyaltyParams) ([]ListClientsWithLoyaltyRow, error)
ListColors(ctx context.Context) ([]Color, error)
ListColorsPage(ctx context.Context, arg ListColorsPageParams) ([]Color, error)
ListCouponCategories(ctx context.Context, scope sql.NullString) ([]CouponCategory, error)
ListCouponLists(ctx context.Context) ([]ListCouponListsRow, error)
ListCouponTypes(ctx context.Context) ([]CouponType, error)
ListCouponTypesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]CouponType, error)
ListCoupons(ctx context.Context, arg ListCouponsParams) ([]ListCouponsRow, error)
// Sent whole (every status, not just active): absence can't express
// "redeemed elsewhere" or "deactivated" to a till that already has the
// row, so the row itself carries the new status down. See
// ListPriceListsForBranchSync's comment in branch_sync_lists.go for the
// same reasoning.
ListCouponsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Coupon, error)
// page_size = 0 returns every currency (the CurrencySelect picker needs the
// whole list); any positive value pages. Order is always by code, so the
// picker and the paged table agree.
ListCurrencies(ctx context.Context, arg ListCurrenciesParams) ([]Currency, error)
// The whole set -- see ListCashboxAccountsForSync for why this is not a delta.
ListCurrenciesForSync(ctx context.Context) ([]Currency, error)
ListCurrenciesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Currency, error)
// Sums grand_total across both kinds ('sales' and 'return') rather than
// treating them separately: a branch's return/exchange grand_total is
// already the net signed cash effect it reported (negative for a refund,
// positive for an even-or-up exchange -- see tx_exchange.go's netDifference
// in kashi-pos), so a plain sum already nets returns against sales
// correctly without this query needing to know or guess that sign
// convention itself.
// The year filter is a >=/< range against a fixed pair of dates rather than
// EXTRACT(YEAR FROM occurred_at) = $1 -- EXTRACT on every row can't use a
// plain btree index on occurred_at (idx_branch_invoices_occurred_at), while
// a range comparison can.
ListDailyIncome(ctx context.Context, arg ListDailyIncomeParams) ([]ListDailyIncomeRow, error)
ListDayBranchExpenses(ctx context.Context, arg ListDayBranchExpensesParams) ([]ListDayBranchExpensesRow, error)
// Shifts closed on the day (a shift belongs to the day its till was
// counted, which is what the variance figures describe).
ListDayBranchShifts(ctx context.Context, arg ListDayBranchShiftsParams) ([]ListDayBranchShiftsRow, error)
// Every invoice of the day, newest first. Capped well above a real day's
// volume; the page only lists them.
ListDayInvoices(ctx context.Context, arg ListDayInvoicesParams) ([]ListDayInvoicesRow, error)
// How the day's money came in, by the branch-reported account display name
// (cashbox accounts aren't shared across the branch boundary -- see
// migration 000054).
ListDayPaymentsByAccount(ctx context.Context, arg ListDayPaymentsByAccountParams) ([]ListDayPaymentsByAccountRow, error)
// Queries backing the Daily Income heatmap's per-day drill-down page
// (GET /branch_invoices/day_summary). Every query scopes to one *local*
// calendar day: occurred_at converted to the owning branch's timezone, the
// same rule ListDailyIncome uses to bucket the heatmap cell that was
// clicked, so the page's totals always agree with that cell.
//
// The occurred_at range against day-1 .. day+2 is a coarse prefilter that
// keeps idx_branch_invoices_occurred_at usable (a per-row AT TIME ZONE
// can't use the index on its own); two days of slack on either side covers
// every real timezone offset, and the AT TIME ZONE equality does the exact
// cut.
// Per-branch totals for the day. net_total is the plain grand_total sum
// across sales and returns, same signed-return convention as
// ListDailyIncome, so the page's headline matches the heatmap cell.
ListDaySalesByBranch(ctx context.Context, arg ListDaySalesByBranchParams) ([]ListDaySalesByBranchRow, error)
// Local-hour buckets (0-23); hours with no invoices are absent and the
// frontend fills zeros.
ListDaySalesByHour(ctx context.Context, arg ListDaySalesByHourParams) ([]ListDaySalesByHourRow, error)
ListDaySalesBySalesperson(ctx context.Context, arg ListDaySalesBySalespersonParams) ([]ListDaySalesBySalespersonRow, error)
// Best sellers of the day by line revenue, sales invoices only. Items whose
// product_uid never resolved to a variant (see resolveVariantByUIDOrBarcode)
// fold into one "unknown" row rather than disappearing from the totals.
ListDayTopProducts(ctx context.Context, arg ListDayTopProductsParams) ([]ListDayTopProductsRow, error)
// branch_visitor_events.day is already the branch's local day (stamped by
// the till), so it's matched directly; only the hour needs the timezone.
ListDayVisitorsByHour(ctx context.Context, arg ListDayVisitorsByHourParams) ([]ListDayVisitorsByHourRow, error)
// Every deal, with how many list rows and rules put it on products, so the
// page can say where a deal is used before it is changed or deleted.
ListDeals(ctx context.Context) ([]ListDealsRow, error)
// The deals a list's rows name: they travel with the list, so the till
// always has the terms of every deal it can price.
ListDealsForDiscountListSync(ctx context.Context, discountListID int64) ([]Deal, error)
// Of the given pictures, the ones that can go: not the picture of a unit still
// waiting to be matched on a sale that has arrived. A checkout whose sale never
// came (the till or kashi was down) is not waiting on anyone, so it can go.
ListDeletableUnknownItemImages(ctx context.Context, ids []int64) ([]ListDeletableUnknownItemImagesRow, error)
ListDiscountListBranchIDs(ctx context.Context, discountListID int64) ([]int64, error)
ListDiscountListItems(ctx context.Context, discountListID int64) ([]DiscountListItem, error)
ListDiscountListItemsForSync(ctx context.Context, discountListID int64) ([]ListDiscountListItemsForSyncRow, error)
// See ListPriceListItemsWithProduct: rows are variant-level, so the label needs
// the barcode and color/size to be identifiable. Option rows (000199) are
// listed alongside the plain ones; sale_option_id 0 / sale_option ” marks a
// plain row. Only a plain row can name a deal (000201).
ListDiscountListItemsWithProduct(ctx context.Context, arg ListDiscountListItemsWithProductParams) ([]ListDiscountListItemsWithProductRow, error)
// Options travel by name, like colors and attributes: a till has no copy of
// kashi's sale_options ids.
ListDiscountListOptionItemsForSync(ctx context.Context, discountListID int64) ([]ListDiscountListOptionItemsForSyncRow, error)
// A list's rule groups in order (000203).
ListDiscountListRuleGroups(ctx context.Context, discountListID int64) ([]DiscountListRuleGroup, error)
// Option discounts of a list's rules; options travel by name, as on the tills.
ListDiscountListRuleOptions(ctx context.Context, discountListID int64) ([]ListDiscountListRuleOptionsRow, error)
// A list's rules in the order they run, with how many variants each one
// decides now (counted from the rows it wrote: a rule giving 0 writes none).
ListDiscountListRules(ctx context.Context, discountListID int64) ([]ListDiscountListRulesRow, error)
ListDiscountLists(ctx context.Context, arg ListDiscountListsParams) ([]DiscountList, error)
// See ListPriceListsForBranchSync -- same scoping and same reason for
// carrying is_active rather than filtering on it.
ListDiscountListsForBranchSync(ctx context.Context, arg ListDiscountListsForBranchSyncParams) ([]DiscountList, error)
// Lists the branch was taken off since the till's cursor (000206), which it
// is sent as inactive so it drops its copy. Not the default list, which
// every branch keeps, nor one the branch is back on.
ListDiscountListsRemovedFromBranch(ctx context.Context, arg ListDiscountListsRemovedFromBranchParams) ([]ListDiscountListsRemovedFromBranchRow, error)
ListDueEmailSchedules(ctx context.Context) ([]EmailSchedule, error)
ListDueRecurringExpenses(ctx context.Context, nextDueAt time.Time) ([]RecurringExpense, error)
// Every non-cancelled invoice on local days from_day..to_day, newest first
// (the order kashi-admin's CSV used), optionally one branch. Days are cut
// per branch timezone exactly like ListDayInvoices; the occurred_at range
// with a day of slack each side keeps idx_branch_invoices_occurred_at
// usable. Carries more than the default CSV needs so extra columns picked
// in Settings need no new query. ListEmailReportShiftInvoices returns the
// same columns for one shift.
// One grouped pass over the picked invoices' items and payments rather than
// a subquery per invoice.
ListEmailReportInvoices(ctx context.Context, arg ListEmailReportInvoicesParams) ([]ListEmailReportInvoicesRow, error)
// Everyone a report went out to, most recently used first, for the send
// dialog's suggestions.
ListEmailReportRecipients(ctx context.Context) ([]ListEmailReportRecipientsRow, error)
// The registers the send dialog can pick, by branch.
ListEmailReportRegisters(ctx context.Context) ([]ListEmailReportRegistersRow, error)
// A closed shift's invoices, matched the way settlements match a till's
// shift: register plus the till's own shift id.
// One grouped pass over the picked invoices' items and payments rather than
// a subquery per invoice.
ListEmailReportShiftInvoices(ctx context.Context, shiftID int64) ([]ListEmailReportShiftInvoicesRow, error)
// Closed shifts to pick from in the send dialog: those counted on local
// days from_day..to_day, optionally one branch, newest first.
ListEmailReportShifts(ctx context.Context, arg ListEmailReportShiftsParams) ([]ListEmailReportShiftsRow, error)
ListEmailReports(ctx context.Context, arg ListEmailReportsParams) ([]EmailReport, error)
ListEmailSchedules(ctx context.Context) ([]EmailSchedule, error)
ListEmployees(ctx context.Context, arg ListEmployeesParams) ([]Employee, error)
ListEntries(ctx context.Context, arg ListEntriesParams) ([]Entry, error)
ListExpenseCategories(ctx context.Context, scope sql.NullString) ([]ExpenseCategory, error)
// Only branch-scoped categories are synced down to kashi-pos.
ListExpenseCategoriesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]ExpenseCategory, error)
ListExpenses(ctx context.Context, arg ListExpensesParams) ([]Expense, error)
ListGooglePlaceSnapshots(ctx context.Context, arg ListGooglePlaceSnapshotsParams) ([]GooglePlaceSnapshot, error)
// Newest first, for the given places.
ListGoogleReviews(ctx context.Context, arg ListGoogleReviewsParams) ([]GoogleReview, error)
// Which of a page's rows of one kind are resolved, and by whom.
ListHomeActivityResolutions(ctx context.Context, arg ListHomeActivityResolutionsParams) ([]ListHomeActivityResolutionsRow, error)
// Products that have opted out of low-stock alerting entirely, regardless
// of on-hand or threshold -- lets the muted list be reviewed and reversed.
ListIgnoredLowStockProducts(ctx context.Context, arg ListIgnoredLowStockProductsParams) ([]ListIgnoredLowStockProductsRow, error)
// The destination branch's own poll: transfers addressed to it, whoever
// sent them. Matched by to_inventory_id, not branch_id -- that column is
// always the sender's.
ListIncomingBranchTransfersUpdatedSince(ctx context.Context, arg ListIncomingBranchTransfersUpdatedSinceParams) ([]Transfer, error)
ListInventories(ctx context.Context, arg ListInventoriesParams) ([]Inventory, error)
ListInventoryStock(ctx context.Context, arg ListInventoryStockParams) ([]ListInventoryStockRow, error)
ListInvoiceDiscountBranchIDs(ctx context.Context) ([]InvoiceDiscountBranch, error)
ListInvoiceDiscounts(ctx context.Context) ([]InvoiceDiscount, error)
// Every rule changed since the branch last asked, deleted ones included,
// with whether it applies to the branch: a rule that doesn't (deleted,
// switched off, or the branch taken off it) tells the till to drop it.
ListInvoiceDiscountsForBranchSync(ctx context.Context, arg ListInvoiceDiscountsForBranchSyncParams) ([]ListInvoiceDiscountsForBranchSyncRow, error)
ListInvoicePaymentsByInvoice(ctx context.Context, invoiceID int64) ([]ListInvoicePaymentsByInvoiceRow, error)
ListInvoiceProductsByInvoice(ctx context.Context, invoiceID int64) ([]ListInvoiceProductsByInvoiceRow, error)
ListInvoiceTypes(ctx context.Context) ([]InvoiceType, error)
ListInvoices(ctx context.Context, arg ListInvoicesParams) ([]Invoice, error)
ListInvoicesPage(ctx context.Context, arg ListInvoicesPageParams) ([]Invoice, error)
// The home page's "Latest added" feed: the newest photos (expense,
// close-shift receipt), transfers, central expenses and purchases, merged
// newest first. Each include_* flag is the caller's view access to that
// section, so a kind the user can't open never appears.
//
// ref_id is the record a row belongs to (the expense or shift a photo was
// attached to, or the transfer/expense/purchase itself), and for a branch
// photo branch_id + ref_day (the branch's local day) say which day page
// shows it, so the feed can open "the thing it was attached to".
// Keyset paging: the next page starts after the last row the feed has. ids
// come from five tables, so kind breaks a tie between two rows added at the
// same instant with the same id.
ListLatestAdditions(ctx context.Context, arg ListLatestAdditionsParams) ([]ListLatestAdditionsRow, error)
ListLoanCategories(ctx context.Context, scope sql.NullString) ([]LoanCategory, error)
// Only branch-scoped categories are synced down to kashi-pos -- central
// ones are managed in kashi only.
ListLoanCategoriesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]LoanCategory, error)
ListLoanImagesForLoan(ctx context.Context, loanID int64) ([]LoanImage, error)
// sqlc.narg(loan_id) is nullable: NULL means "all loans". sqlc.narg(category_id)
// filters by the parent loan's lender-source category.
ListLoanPayments(ctx context.Context, arg ListLoanPaymentsParams) ([]LoanPayment, error)
// sqlc.narg(branch_id)/sqlc.narg(origin) are nullable: NULL means "no
// filter", matching ListBranchExpenses' admin-filter convention.
// paid_amount is the running total of loan_payments against the loan;
// status is derived from it (never stored) -- 'paid' once payments cover
// the loan amount, 'partial' while some but not all is covered, else
// 'unpaid' -- or 'cancelled' once cancelled_at is stamped. sqlc.narg(status) filters on that same derived value.
ListLoans(ctx context.Context, arg ListLoansParams) ([]ListLoansRow, error)
// Low stock alerts. A product's on-hand is the sum of inventory_stock
// across every SKU (variant) and every inventory it's stocked in; its
// effective threshold is its own override if set, else the single global
// app_settings.default_low_stock_threshold.
// status narrows to one bucket: 'out_of_stock' (on_hand <= 0) or
// 'low_stock' (on_hand > 0, i.e. low but not yet out); NULL keeps both,
// matching the "at or below threshold" definition used everywhere else.
ListLowStockProducts(ctx context.Context, arg ListLowStockProductsParams) ([]ListLowStockProductsRow, error)
// Requests a till filed ("acr-<id>-complaint") that no review has answered
// yet ("acr-<id>-review" from the same register -- each till numbers its own
// requests). These are the ones an admin can approve or reject from kashi.
ListPendingBranchAttendanceRequests(ctx context.Context, branchID sql.NullInt64) ([]BranchAttendanceChange, error)
ListPendingBranchCommands(ctx context.Context, registerID int64) ([]BranchCommand, error)
ListPriceListBranchIDs(ctx context.Context, priceListID int64) ([]int64, error)
ListPriceListItems(ctx context.Context, priceListID int64) ([]PriceListItem, error)
// Items of one list, keyed by the variant's uid -- the till's own row ids are
// a different number space, so nothing crosses the boundary by integer id.
ListPriceListItemsForSync(ctx context.Context, priceListID int64) ([]ListPriceListItemsForSyncRow, error)
// Rows are variant-level now, so the display label needs the variant's own
// barcode and its color/size -- a product code and name alone no longer
// identify which row a price belongs to.
ListPriceListItemsWithProduct(ctx context.Context, arg ListPriceListItemsWithProductParams) ([]ListPriceListItemsWithProductRow, error)
ListPriceLists(ctx context.Context, arg ListPriceListsParams) ([]PriceList, error)
// The only price lists a branch is allowed to know about: the default one
// (its fallback) and the one it is assigned, if any. Deliberately not every
// list -- a till has no business holding another branch's pricing.
//
// is_active is carried rather than filtered on, because a list going inactive
// is exactly the event the till needs in order to drop its local copy; filter
// it out here and the till would keep pricing from a list kashi has retired.
ListPriceListsForBranchSync(ctx context.Context, arg ListPriceListsForBranchSyncParams) ([]PriceList, error)
// See ListDiscountListsRemovedFromBranch.
ListPriceListsRemovedFromBranch(ctx context.Context, arg ListPriceListsRemovedFromBranchParams) ([]ListPriceListsRemovedFromBranchRow, error)
ListProductAttributes(ctx context.Context, arg ListProductAttributesParams) ([]ProductsAttribute, error)
ListProductCategories(ctx context.Context) ([]ProductCategory, error)
// Revenue per product from kashi's own admin sales invoices (invoice_products
// joined through sales_invoices, so returns don't count as revenue). Branch
// (POS) sales are deliberately excluded here -- see ListBranchProductRevenue
// below for those; branch_invoice_items itself still isn't linkable to a
// product (its branch_product_id has no FK), so the two sources stay
// separate rather than merged into one figure. category/subcategory/brand
// are the EAV attributes seeded in 000005_create_products_attributes_table
// (ids 0/1/2), joined once per attribute the same way
// ListProductVariantsForSync does.
ListProductRevenue(ctx context.Context, arg ListProductRevenueParams) ([]ListProductRevenueRow, error)
// Same scope and filters as ListProductRevenue, rolled up by local calendar
// day instead of by product -- the trend line for the Product Revenues page.
ListProductRevenueDaily(ctx context.Context, arg ListProductRevenueDailyParams) ([]ListProductRevenueDailyRow, error)
ListProductSaleOptionNames(ctx context.Context, productID int64) ([]ListProductSaleOptionNamesRow, error)
ListProductVariantIDsByUIDs(ctx context.Context, uids []uuid.UUID) ([]ListProductVariantIDsByUIDsRow, error)
ListProductVariants(ctx context.Context, arg ListProductVariantsParams) ([]ListProductVariantsRow, error)
ListProductVariantsByProduct(ctx context.Context, productID int64) ([]ProductVariant, error)
// Flattened for kashi-pos, which has no separate "product" row -- each
// variant carries everything a branch needs to create or update its own
// flat product row. Colors/sizes/attributes are resolved to their name
// here (not sent as ids) since kashi-pos matches everything by name, not
// by kashi's internal ids.
//
// Price is deliberately absent: since 000094 a variant has no price of its
// own, it has an entry in a price list, and those sync down as their own
// entities (see the price_lists/discount_lists cases in branch_catchup.go).
// A till receiving no price here keeps whatever the lists last told it,
// which is what applySyncedProductVariant already does for an absent price.
//
// Attribute ids (2=brand, 1=sub-category, 3=kind, 7=season, 6=year) match
// the fixed seed in 000005_create_products_attributes_table.up.sql.
// Editing a product's attributes doesn't currently bump
// product_variants.updated_at (no endpoint does that edit yet -- see
// api/product.go), so an attribute-only change wouldn't be picked up by
// this filter if one ever existed; today attributes are only ever set at
// creation time, in the same moment the variant's own updated_at is set,
// so this doesn't miss anything in practice yet.
ListProductVariantsForSync(ctx context.Context, updatedAt time.Time) ([]ListProductVariantsForSyncRow, error)
// Same flattened row as ListProductVariantsForSyncPaged, for the uids a
// till's completeness check found missing or stale.
ListProductVariantsForSyncByUIDs(ctx context.Context, uids []uuid.UUID) ([]ListProductVariantsForSyncByUIDsRow, error)
// Keyset-paginated ListProductVariantsForSync -- same flattened row, same
// joins, ordered by (product_variants.updated_at, product_variants.id) for
// a stable page boundary during a branch's full catch-up.
ListProductVariantsForSyncPaged(ctx context.Context, arg ListProductVariantsForSyncPagedParams) ([]ListProductVariantsForSyncPagedRow, error)
ListProductVariantsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]ProductVariant, error)
// Search matches code/name/description (case-insensitive). Every filter is
// optional: empty search string, NULL narg, or empty attribute_value_ids
// array all mean "don't filter on this". attribute_value_ids is an AND --
// the product must carry every selected value.
//
// total_count is carried alongside each row via a window function so the
// caller doesn't need a second CountProducts round-trip that re-scans the
// same filtered set again.
ListProducts(ctx context.Context, arg ListProductsParams) ([]ListProductsRow, error)
ListPurchaseItems(ctx context.Context, purchaseID sql.NullInt64) ([]ListPurchaseItemsRow, error)
ListPurchases(ctx context.Context, arg ListPurchasesParams) ([]ListPurchasesRow, error)
ListRecurringExpenses(ctx context.Context) ([]RecurringExpense, error)
ListRegisterUpdateStatuses(ctx context.Context) ([]ListRegisterUpdateStatusesRow, error)
ListRolePermissions(ctx context.Context) ([]RolePermission, error)
ListRoles(ctx context.Context) ([]ListRolesRow, error)
// Which batch(es) a specific sales-invoice line actually drew from, so a
// return of that line can replenish the same batches instead of going
// untracked. quantity is negative (sale); batch_id is null for the
// unattributed remainder, if the sale outran every tracked batch.
ListSaleMovementsForInvoiceVariant(ctx context.Context, arg ListSaleMovementsForInvoiceVariantParams) ([]ListSaleMovementsForInvoiceVariantRow, error)
ListSaleOptions(ctx context.Context) ([]SaleOption, error)
ListSalespersons(ctx context.Context, arg ListSalespersonsParams) ([]Salesperson, error)
ListSalespersonsByCashbox(ctx context.Context, cashboxID sql.NullInt64) ([]Salesperson, error)
ListSalespersonsForBranch(ctx context.Context, branchID sql.NullInt64) ([]Salesperson, error)
ListSalespersonsUpdatedSince(ctx context.Context, arg ListSalespersonsUpdatedSinceParams) ([]Salesperson, error)
// Open alerts of the pinned (critical) kinds come first, so the page limit
// never pushes one off the list before someone resolves it.
ListSecurityAlerts(ctx context.Context, arg ListSecurityAlertsParams) ([]SecurityAlert, error)
ListShifts(ctx context.Context, arg ListShiftsParams) ([]ListShiftsRow, error)
ListSizes(ctx context.Context) ([]Size, error)
ListSizesPage(ctx context.Context, arg ListSizesPageParams) ([]Size, error)
// ---------------------------------------------------------------------------
// Slow movers: money tied up in stock that isn't selling. Deliberately
// separate from the low-stock alerts (too little stock) -- this is the
// opposite problem, too much. A product qualifies when it's carrying stock
// (on_hand > 0) and either never sold in the last 90 days ("dead": put it
// on clearance) or would take unreasonably long to sell through at its
// current pace ("overstocked": more than 90 days on hand).
// ---------------------------------------------------------------------------
ListSlowMovingProducts(ctx context.Context, arg ListSlowMovingProductsParams) ([]ListSlowMovingProductsRow, error)
ListStockCountItems(ctx context.Context, stockCountID int64) ([]ListStockCountItemsRow, error)
ListStockCounts(ctx context.Context, arg ListStockCountsParams) ([]ListStockCountsRow, error)
ListStockHealthByInventory(ctx context.Context, arg ListStockHealthByInventoryParams) ([]ListStockHealthByInventoryRow, error)
ListStockMovements(ctx context.Context, arg ListStockMovementsParams) ([]ListStockMovementsRow, error)
// TOOD: add UpdateSupplier
ListSuppliers(ctx context.Context, arg ListSuppliersParams) ([]Supplier, error)
// Storage page feed: transfers that have a photo, newest first. The photo
// itself is served by GET /transfers/:id/attachment.
ListTransferAttachments(ctx context.Context, arg ListTransferAttachmentsParams) ([]ListTransferAttachmentsRow, error)
ListTransferItems(ctx context.Context, transferID int64) ([]ListTransferItemsRow, error)
ListTransfers(ctx context.Context, arg ListTransfersParams) ([]ListTransfersRow, error)
// Every stored unknown-item picture, newest first, for the Attachments page.
ListUnknownItemImages(ctx context.Context, arg ListUnknownItemImagesParams) ([]ListUnknownItemImagesRow, error)
ListUnknownItemSlotsForSession(ctx context.Context, sessionID int64) ([]UnknownItemSlot, error)
// Pictured units of sold invoices, pending or resolved, newest first.
ListUnknownItems(ctx context.Context, arg ListUnknownItemsParams) ([]ListUnknownItemsRow, error)
// The entries that name no variant barcode and no product code.
ListUnmatchedDiscountEntries(ctx context.Context, entries []string) ([]string, error)
// The urgent Recent activity rows nobody has resolved yet, pinned above the
// feed: a shift closed short (negative USD variance) -- the rows the feed
// tints red. Same columns as HomeActivityFeed, so the feed draws them with
// the same row, newest received first, like the feed.
ListUnresolvedUrgentHomeActivities(ctx context.Context) ([]ListUnresolvedUrgentHomeActivitiesRow, error)
ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
ListVariantSyncIDs(ctx context.Context, arg ListVariantSyncIDsParams) ([]ListVariantSyncIDsRow, error)
ListVariantsForBarcodes(ctx context.Context, arg ListVariantsForBarcodesParams) ([]ListVariantsForBarcodesRow, error)
// What one typed or scanned entry names, matched like
// BulkSetDiscountListItems: a barcode names its variant, a code all of its
// product's variants.
ListVariantsForDiscountEntry(ctx context.Context, entry string) ([]ListVariantsForDiscountEntryRow, error)
// Most recently seen first. search matches the IP, place, network, user or
// branch; country narrows to one country code.
ListVisitorIPs(ctx context.Context, arg ListVisitorIPsParams) ([]VisitorIp, error)
// Every unit of the checkouts still in progress that are missing at least one
// picture or pass, for the "Waiting" tab: pictured units come along so the
// manager sees what has already been taken. Cashiers who asked for help first.
ListWaitingUnknownItems(ctx context.Context) ([]ListWaitingUnknownItemsRow, error)
// Newest first, a page at a time: before_id 0 is the latest page.
ListWhatsAppChatMessages(ctx context.Context, arg ListWhatsAppChatMessagesParams) ([]ListWhatsAppChatMessagesRow, error)
// One row per customer phone, the most recently active first.
ListWhatsAppChats(ctx context.Context, arg ListWhatsAppChatsParams) ([]ListWhatsAppChatsRow, error)
// What the client sent back to one message: after its poll (the bridge) or
// answering it (Meta's webhook), oldest first.
// id and media_type: a bridge reply's media (GET /whatsapp/poll_replies/:id/media).
ListWhatsAppMessageReplies(ctx context.Context, id int64) ([]ListWhatsAppMessageRepliesRow, error)
// Newest first. branch_id 0 = every branch, status ” = any; search matches
// the client's name or phone, the invoice code or the rule.
ListWhatsAppMessages(ctx context.Context, arg ListWhatsAppMessagesParams) ([]ListWhatsAppMessagesRow, error)
ListWhatsAppNumbers(ctx context.Context) ([]WhatsappNumber, error)
// Newest first. A reply not linked to one of our messages only shows under
// every branch.
ListWhatsAppReplies(ctx context.Context, arg ListWhatsAppRepliesParams) ([]ListWhatsAppRepliesRow, error)
// The WhatsApp page: post-sale message rules and the message log
// (api/whatsapp_rules.go).
ListWhatsAppRules(ctx context.Context) ([]WhatsappRule, error)
// Clients who answered 1 or 2 stars, newest first: the ones to call back.
LowPollRatings(ctx context.Context, arg LowPollRatingsParams) ([]LowPollRatingsRow, error)
// Loyalty page: new clients per calendar month (UTC) over the last 12 months.
LoyaltyMonthlyJoins(ctx context.Context, clientType sql.NullString) ([]LoyaltyMonthlyJoinsRow, error)
// Loyalty page, "close to leveling up": the clients (up to 25) within 30% of
// the next tier's minimum, closest first. tier_mins as in LoyaltyTierStats.
LoyaltyRisingClients(ctx context.Context, arg LoyaltyRisingClientsParams) ([]LoyaltyRisingClientsRow, error)
// Loyalty page: one row per tier that has members. tier_mins is the tiers'
// minimum spends in cents, ascending; a client's tier index is the highest
// minimum their lifetime spend clears (the lowest tier if none), counted from
// 0 at the entry tier -- the same rule as the page's tierFor. Lifetime spend
// (gross_spent, before the On Account deduction) and points come from the
// client_spend cache; the period figures (revenue, active members) cover
// [date_from, date_to), either bound optional, and are computed live from just
// the invoices inside the window. With no bound the period is all time, so the
// cached figures are used as is.
//
// Same two sources and sign conventions as RefreshClientSpend: central
// invoices (sales positive, returns negative) plus non-cancelled branch
// invoices of reported-on branches/registers.
LoyaltyTierStats(ctx context.Context, arg LoyaltyTierStatsParams) ([]LoyaltyTierStatsRow, error)
// The original punch of an approved replace/delete on the till. Kept, not
// deleted, so the audit trail shows what was there and who took it away.
MarkBranchAttendanceEventRemoved(ctx context.Context, arg MarkBranchAttendanceEventRemovedParams) error
MarkBranchExpenseUploadTokenUsed(ctx context.Context, id int64) error
// A till's cancellation return names the sale it cancels (related_client_ref);
// both rows get the mark. COALESCE keeps the first stamp on a replayed push.
MarkBranchInvoicesCancelled(ctx context.Context, arg MarkBranchInvoicesCancelledParams) error
MarkBranchShiftUploadTokenUsed(ctx context.Context, id int64) error
MarkBranchTransferUploadTokenUsed(ctx context.Context, id int64) error
MarkLoanUploadTokenUsed(ctx context.Context, id int64) error
MarkUnknownItemSlotResolved(ctx context.Context, arg MarkUnknownItemSlotResolvedParams) error
MarkWhatsAppReviewClicked(ctx context.Context, id int64) error
// The WhatsApp rating poll over the range: polls sent, answers, and how many
// of each star.
PollRatingTotals(ctx context.Context, arg PollRatingTotalsParams) (PollRatingTotalsRow, error)
PollRatingsByBranch(ctx context.Context, arg PollRatingsByBranchParams) ([]PollRatingsByBranchRow, error)
PollRatingsByDay(ctx context.Context, arg PollRatingsByDayParams) ([]PollRatingsByDayRow, error)
// What clients wrote back after the rating poll, newest first, with their
// answer: why it wasn't great, and what they looked for and didn't find.
PollReplies(ctx context.Context, arg PollRepliesParams) ([]PollRepliesRow, error)
ProductBarcodesPresent(ctx context.Context, dollar_1 []string) ([]string, error)
// Apply an inbound quantity delta and roll the per-location moving-average
// cost forward. When existing on-hand is <= 0 the average is just reset to
// the incoming cost (no meaningful prior average to blend).
ReceiveInventoryStock(ctx context.Context, arg ReceiveInventoryStockParams) (InventoryStock, error)
RecordEmailScheduleRun(ctx context.Context, arg RecordEmailScheduleRunParams) error
// Opens an alert, or bumps the open one of the same kind for the same IP
// seen within the last hour.
RecordSecurityAlert(ctx context.Context, arg RecordSecurityAlertParams) error
// A client's answer to the rating poll; a NULL rating is a vote taken back.
RecordWhatsAppPollVote(ctx context.Context, arg RecordWhatsAppPollVoteParams) (RecordWhatsAppPollVoteRow, error)
// Idempotent: a retried invoice post that already redeemed this code just
// returns the row unchanged rather than erroring (matches
// CreateBranchInvoice's own idempotent-retry shape). Only actually moves
// an 'active' coupon to 'redeemed' -- an inactive/already-redeemed code is
// left alone so a stale retry never resurrects it.
RedeemCoupon(ctx context.Context, arg RedeemCouponParams) (Coupon, error)
// Rebuilds client_spend for every client from all invoices. Same two sources
// and sign conventions as ListClientsBySpending (see the comment there):
// central invoices (sales positive, returns negative; grand_total is always
// a positive magnitude) and non-cancelled branch invoices of reported-on
// branches/registers, whose grand_total already carries its sign. total_spent
// drops what was paid "On Account"; gross_spent keeps it. Line items are
// pre-aggregated per invoice so they can't multiply grand_total.
RefreshClientSpend(ctx context.Context) error
RenameRole(ctx context.Context, arg RenameRoleParams) error
// Points the row at a replacement photo (api/photo_replace.go); the new
// photo starts upright.
ReplaceBranchExpenseImageFile(ctx context.Context, arg ReplaceBranchExpenseImageFileParams) (BranchExpenseImage, error)
// Same as ReplaceBranchExpenseImageFile.
ReplaceBranchShiftReceiptImageFile(ctx context.Context, arg ReplaceBranchShiftReceiptImageFileParams) (BranchShiftReceiptImage, error)
// A till's client turned out to be an existing central client (same phone):
// invoices the till already sent under its own uid now point at the
// canonical one.
RepointBranchInvoicesClientUID(ctx context.Context, arg RepointBranchInvoicesClientUIDParams) error
// Sales per branch; sales entered in kashi come back with branch_id 0 and
// an empty name.
ReportBranchSales(ctx context.Context, arg ReportBranchSalesParams) ([]ReportBranchSalesRow, error)
// Revenue per product category. Lines without a product or whose product
// has no category come back with an empty name.
ReportCategorySales(ctx context.Context, arg ReportCategorySalesParams) ([]ReportCategorySalesRow, error)
// Sales reports over report_sale_invoices / report_sale_lines (migration
// 000134): the Dashboard's cost of goods and the Sales Dashboard
// (api/sales_dashboard.go). Ranges are half-open [date_from, date_to), days
// are Beirut calendar days (businessZone in api/business_zone.go) like the
// rest of the dashboard.
// Cost of goods sold for the Dashboard, scoped like its other figures:
// till sales (optionally one branch) and/or sales entered in kashi. Only
// lines with a known cost count; costed_revenue is what those lines sold
// for, so the caller can say how much of revenue the cost covers.
ReportCostOfGoods(ctx context.Context, arg ReportCostOfGoodsParams) (ReportCostOfGoodsRow, error)
// ReportCostOfGoods per day.
ReportCostOfGoodsSeries(ctx context.Context, arg ReportCostOfGoodsSeriesParams) ([]ReportCostOfGoodsSeriesRow, error)
// Per day, what lines with a known cost sold for and what they cost --
// the Sales Dashboard's profit is the difference.
ReportDailyCosted(ctx context.Context, arg ReportDailyCostedParams) ([]ReportDailyCostedRow, error)
// Sales (net of returns) per day.
ReportDailySales(ctx context.Context, arg ReportDailySalesParams) ([]ReportDailySalesRow, error)
// Sales by day of week (0 = Sunday) and hour, in each branch's own time
// zone (Beirut for sales entered in kashi), for the Financials heatmap.
ReportHourlySales(ctx context.Context, arg ReportHourlySalesParams) ([]ReportHourlySalesRow, error)
// What the stock on hand cost, across every inventory: each stock row at
// its own average cost, or the variant's when the row has none (stock
// counts set only the variant's).
ReportInventoryValue(ctx context.Context) (int64, error)
// What sales were paid with: the till's payment accounts by name ("Cash
// $$", "Visa", ...) plus kashi's own cashbox accounts, merged by name.
ReportPaymentMethods(ctx context.Context, arg ReportPaymentMethodsParams) ([]ReportPaymentMethodsRow, error)
// What customers still owe on till sales put "On Account". Settling a sale
// later rewrites its payment lines (createBranchInvoiceSettlement), so the
// On Account lines left are exactly what's outstanding.
ReportReceivables(ctx context.Context) (int64, error)
// Every year that has a sale, newest first, for the Sales Dashboard's
// year picker.
ReportSaleYears(ctx context.Context) ([]int32, error)
// Active branch sales targets overlapping [date_from, date_to), for the
// Sales Analysis page, which spreads each one over its days to get the
// target for any month (api/sales_analysis.go). date_to is inclusive.
ReportTargetsInRange(ctx context.Context, arg ReportTargetsInRangeParams) ([]ReportTargetsInRangeRow, error)
// Best-selling products by revenue. Till lines whose product never
// resolved to a kashi variant have no product and are left out.
ReportTopProducts(ctx context.Context, arg ReportTopProductsParams) ([]ReportTopProductsRow, error)
RequestUnknownItemHelp(ctx context.Context, arg RequestUnknownItemHelpParams) error
ResolveBranchSyncConflict(ctx context.Context, arg ResolveBranchSyncConflictParams) (BranchSyncConflict, error)
// Idempotent: resolving a row twice keeps who resolved it first.
ResolveHomeActivity(ctx context.Context, arg ResolveHomeActivityParams) error
// Mirrors ResolveVariantPrice: a branch assigned a discount list is discounted
// from it, everyone else from the default list. Unlike price, no row here means
// no discount (i.e. zero), not "unsellable" -- a product with no discount is a
// product sold at full price.
ResolveVariantDiscount(ctx context.Context, arg ResolveVariantDiscountParams) (int16, error)
ResolveVariantDiscounts(ctx context.Context, arg ResolveVariantDiscountsParams) ([]ResolveVariantDiscountsRow, error)
// The one place that answers "what does this variant cost at this branch".
// A branch assigned a list via price_list_branches is priced from it; every
// other branch, and any variant the assigned list doesn't mention, falls back
// to the default list. No row means no price, which callers must treat as
// "not sellable" rather than as zero.
ResolveVariantPrice(ctx context.Context, arg ResolveVariantPriceParams) (int64, error)
// Batch form of ResolveVariantPrice, for listings and the branch sync payload,
// so pricing N variants costs one query rather than N. DISTINCT ON keeps the
// branch list's row ahead of the default list's for the same variant.
ResolveVariantPrices(ctx context.Context, arg ResolveVariantPricesParams) ([]ResolveVariantPricesRow, error)
// Every open of a review link in the range, the plain link included.
ReviewClicksTotal(ctx context.Context, arg ReviewClicksTotalParams) (int64, error)
// Messages sent in the range and how far they got: delivered/read come from
// Meta's webhook, clicked from the review link.
ReviewFunnel(ctx context.Context, arg ReviewFunnelParams) (ReviewFunnelRow, error)
ReviewFunnelByBranch(ctx context.Context, arg ReviewFunnelByBranchParams) ([]ReviewFunnelByBranchRow, error)
// Per Beirut day: messages sent with a link, and link opens.
ReviewFunnelByDay(ctx context.Context, arg ReviewFunnelByDayParams) ([]ReviewFunnelByDayRow, error)
// Turns the photo by delta degrees (a multiple of 90, either sign) on top
// of its saved rotation.
RotateBranchExpenseImage(ctx context.Context, arg RotateBranchExpenseImageParams) (int16, error)
// Same as RotateBranchExpenseImage.
RotateBranchShiftReceiptImage(ctx context.Context, arg RotateBranchShiftReceiptImageParams) (int16, error)
// Turns the photo by delta degrees (a multiple of 90, either sign) on top
// of its saved rotation. Not a change to the transfer itself, so
// updated_at is left alone.
RotateTransferAttachment(ctx context.Context, arg RotateTransferAttachmentParams) (int16, error)
// Sales in [from_at, to_at), not cancelled. A linked invoice shows its
// salesperson's current name, so a renamed salesperson stays one person.
SalespersonPerformanceInvoices(ctx context.Context, arg SalespersonPerformanceInvoicesParams) ([]SalespersonPerformanceInvoicesRow, error)
SalespersonPerformanceItems(ctx context.Context, arg SalespersonPerformanceItemsParams) ([]BranchInvoiceItem, error)
// The picker an admin matches a pictured item with: active variants whose
// product name, code or barcode contains the text.
SearchVariantsForUnknownItems(ctx context.Context, search string) ([]SearchVariantsForUnknownItemsRow, error)
// Clients with a phone, for picking in a rule.
SearchWhatsAppClients(ctx context.Context, search string) ([]SearchWhatsAppClientsRow, error)
// Fills in avg_cost for every variant of one product, but only where it is
// still at the 0 default -- i.e. never seeded by an actual stock receipt
// (UpdateProductVariantAvgCost above). Used to backfill a starting cost
// basis from an external cost list (cmd/import_costs-style one-off); it
// never overwrites a real moving-average cost built from real receipts.
SeedProductVariantsCostByCode(ctx context.Context, arg SeedProductVariantsCostByCodeParams) (int64, error)
SetAssetCost(ctx context.Context, arg SetAssetCostParams) error
SetBarcodeLabelDesign(ctx context.Context, barcodeLabelDesign json.RawMessage) (AppSetting, error)
SetBranchActive(ctx context.Context, arg SetBranchActiveParams) error
// A till re-categorising one of its own expenses (kashi-pos expense
// detail). NULL category_id is "no category".
SetBranchExpenseCategory(ctx context.Context, arg SetBranchExpenseCategoryParams) (BranchExpense, error)
// A till marking one of its own expenses as paid by central, or not.
SetBranchExpenseFromCentral(ctx context.Context, arg SetBranchExpenseFromCentralParams) (BranchExpense, error)
// The same, from kashi's expenses page.
SetBranchExpenseFromCentralByID(ctx context.Context, arg SetBranchExpenseFromCentralByIDParams) (BranchExpense, error)
SetBranchHiddenFromReports(ctx context.Context, arg SetBranchHiddenFromReportsParams) error
SetBranchInventory(ctx context.Context, arg SetBranchInventoryParams) error
SetBranchInvoiceDiscount(ctx context.Context, arg SetBranchInvoiceDiscountParams) error
SetBranchInvoiceItemDiscount(ctx context.Context, arg SetBranchInvoiceItemDiscountParams) error
SetBranchInvoiceItemResolved(ctx context.Context, arg SetBranchInvoiceItemResolvedParams) error
// Salesperson Performance (api/salesperson_performance.go) and the tills'
// one-time report of who made their past sales.
// Only a salesperson of the invoice's own branch is accepted.
SetBranchInvoiceSalesperson(ctx context.Context, arg SetBranchInvoiceSalespersonParams) (int64, error)
// A till re-categorising one of its own loans (kashi-pos loan detail).
// Only the category: the rest of a branch loan stays as reported.
SetBranchLoanCategory(ctx context.Context, arg SetBranchLoanCategoryParams) (Loan, error)
SetBranchPlaceID(ctx context.Context, arg SetBranchPlaceIDParams) error
SetBranchRegisterActive(ctx context.Context, arg SetBranchRegisterActiveParams) error
SetBranchRegisterHiddenFromReports(ctx context.Context, arg SetBranchRegisterHiddenFromReportsParams) error
// Later flip wins: a flip only applies if it's newer than the one stored, so
// a till's offline flip that arrives late can't undo a more recent one made
// in kashi (or vice versa). 0 rows = this flip was older, ignored.
SetBranchRegisterQuickAccessMode(ctx context.Context, arg SetBranchRegisterQuickAccessModeParams) (int64, error)
SetBranchRegisterReportedSettings(ctx context.Context, arg SetBranchRegisterReportedSettingsParams) error
// managed_locally is admin-owned, not branch-reported: a branch's settings
// push (UpsertBranchSettings) never touches it. Only the admin UI sets it.
SetBranchSettingsManagedLocally(ctx context.Context, arg SetBranchSettingsManagedLocallyParams) (BranchSetting, error)
// The sync-facing "delete" -- see 000046_branch_target_soft_delete.up.sql
// for why this flips a flag instead of removing the row.
SetBranchTargetActive(ctx context.Context, arg SetBranchTargetActiveParams) (BranchTarget, error)
SetBranchTargetSeriesActive(ctx context.Context, arg SetBranchTargetSeriesActiveParams) (BranchTargetSeries, error)
SetBranchUserActive(ctx context.Context, arg SetBranchUserActiveParams) (BranchUser, error)
SetBranchWhatsAppNumber(ctx context.Context, arg SetBranchWhatsAppNumberParams) error
SetCashboxAccountActive(ctx context.Context, arg SetCashboxAccountActiveParams) (CashboxAccount, error)
SetClientActive(ctx context.Context, arg SetClientActiveParams) error
// A client's home branch is the first branch they bought from, so a branch
// invoice only sets it when none is set yet. The client is resolved by
// either identity a till has used (client_uid, else the register's local
// client id), as in ListClientsForExport. updated_at is left alone: the
// column isn't synced to tills, so this mustn't make them re-pull the client.
SetClientBranchIfNull(ctx context.Context, arg SetClientBranchIfNullParams) error
SetDefaultLowStockThreshold(ctx context.Context, defaultLowStockThreshold int64) (AppSetting, error)
SetDefaultWhatsAppNumber(ctx context.Context, id int64) error
SetEmailResendAPIKey(ctx context.Context, emailResendApiKey string) error
SetEmailSettings(ctx context.Context, arg SetEmailSettingsParams) error
SetProductAutofillRules(ctx context.Context, arg SetProductAutofillRulesParams) (AppSetting, error)
SetProductCategory(ctx context.Context, arg SetProductCategoryParams) error
SetProductLowStockAlertsEnabled(ctx context.Context, arg SetProductLowStockAlertsEnabledParams) error
SetProductVariantActive(ctx context.Context, arg SetProductVariantActiveParams) error
SetPurchaseStatus(ctx context.Context, arg SetPurchaseStatusParams) (Purchase, error)
SetPurchaseTotals(ctx context.Context, arg SetPurchaseTotalsParams) error
SetRecurringExpenseActive(ctx context.Context, arg SetRecurringExpenseActiveParams) (RecurringExpense, error)
SetRegisterUpdateStatus(ctx context.Context, arg SetRegisterUpdateStatusParams) error
SetRegistersTargetRelease(ctx context.Context, arg SetRegistersTargetReleaseParams) error
SetReviewSettings(ctx context.Context, arg SetReviewSettingsParams) error
SetSalespersonActive(ctx context.Context, arg SetSalespersonActiveParams) (Salesperson, error)
// Set from kashi: from now on the till takes this value (see 000127).
SetSalespersonAttendanceID(ctx context.Context, arg SetSalespersonAttendanceIDParams) (Salesperson, error)
SetSalespersonColor(ctx context.Context, arg SetSalespersonColorParams) (Salesperson, error)
// Whether the till offers this person at checkout; attendance applies to
// everyone on the roster either way.
SetSalespersonIsSalesperson(ctx context.Context, arg SetSalespersonIsSalespersonParams) (Salesperson, error)
SetStockCountNote(ctx context.Context, arg SetStockCountNoteParams) error
SetStockCountStatus(ctx context.Context, arg SetStockCountStatusParams) (StockCount, error)
// A new photo starts upright, whatever the previous one was turned to.
SetTransferAttachmentPath(ctx context.Context, arg SetTransferAttachmentPathParams) error
SetTransferConfirmed(ctx context.Context, arg SetTransferConfirmedParams) (Transfer, error)
// The admin's own edit, keyed by transfer_item id directly (unlike the
// branch's own confirm, which only ever knows an item by variant) --
// lets kashi correct a destination's count, or fill one in before it
// ever arrives, from the transfer detail dialog.
SetTransferItemReceivedQuantity(ctx context.Context, arg SetTransferItemReceivedQuantityParams) (TransferItem, error)
// The destination branch reporting what it actually counted for one line.
// Keyed by variant, not transfer_item id -- the till only ever knows an
// item by barcode/uid, resolved to variant_id the same way
// CreateBranchTransferRequestTx resolves an outgoing line.
SetTransferItemReceivedQuantityByVariant(ctx context.Context, arg SetTransferItemReceivedQuantityByVariantParams) (int64, error)
SetTransferStatus(ctx context.Context, arg SetTransferStatusParams) (Transfer, error)
// The picture goes to the slot and to every other unit of its cart line. A
// slot already matched to a product keeps the picture it was matched with.
SetUnknownItemSlotImage(ctx context.Context, arg SetUnknownItemSlotImageParams) error
SetUserAvatarColor(ctx context.Context, arg SetUserAvatarColorParams) error
SetVariantBarcode(ctx context.Context, arg SetVariantBarcodeParams) (ProductVariant, error)
SetWhatsAppMessageCost(ctx context.Context, costMicros int64) error
SetWhatsAppNumberPhone(ctx context.Context, arg SetWhatsAppNumberPhoneParams) error
SetWhatsAppSenderSettings(ctx context.Context, arg SetWhatsAppSenderSettingsParams) error
SetWhatsAppSettings(ctx context.Context, arg SetWhatsAppSettingsParams) error
ShareUnknownLineImages(ctx context.Context, sessionID int64) error
// Messages the bridge dropped from a paused number's queue on resume (refs
// from POST /instance/resume): logged as sent when queued, they never went.
SkipDroppedWhatsAppMessages(ctx context.Context, arg SkipDroppedWhatsAppMessagesParams) error
SplitUnknownInvoiceItem(ctx context.Context, arg SplitUnknownInvoiceItemParams) error
// Net sales revenue: same grand_total-sum convention as ListDailyIncome in
// branch_invoice.sql (returns already net out via their signed grand_total).
SumBranchRevenueForRange(ctx context.Context, arg SumBranchRevenueForRangeParams) (int64, error)
// The redemption-time query: every branch's contribution to this client's
// loyalty balance, added up. Each branch is decisive for what it reports
// (loyalty_points_delta on branch_invoices) -- this never recomputes that
// number, only sums what's already been reported.
SumClientLoyaltyPoints(ctx context.Context, clientID int64) (int64, error)
// Bumps both the register's and its branch's last_seen_at: the branch is
// "seen" whenever any of its registers is.
TouchBranchRegister(ctx context.Context, id int64) error
// Reopens a resolved urgent row, pinning it on Home again.
UnresolveHomeActivity(ctx context.Context, arg UnresolveHomeActivityParams) error
UnsetDefaultDiscountList(ctx context.Context, id int64) error
UnsetDefaultPriceList(ctx context.Context, id int64) error
UpdateAppReleaseNotes(ctx context.Context, arg UpdateAppReleaseNotesParams) (AppRelease, error)
UpdateAppSettings(ctx context.Context, arg UpdateAppSettingsParams) (AppSetting, error)
UpdateAsset(ctx context.Context, arg UpdateAssetParams) (Asset, error)
UpdateAssetCategory(ctx context.Context, arg UpdateAssetCategoryParams) (AssetCategory, error)
UpdateAttributeValue(ctx context.Context, arg UpdateAttributeValueParams) (AttributesValue, error)
UpdateBranchAttendanceEvent(ctx context.Context, arg UpdateBranchAttendanceEventParams) (BranchAttendanceEvent, error)
UpdateBranchRegister(ctx context.Context, arg UpdateBranchRegisterParams) (BranchRegister, error)
UpdateBranchRegisterAPIKeyHash(ctx context.Context, arg UpdateBranchRegisterAPIKeyHashParams) error
UpdateBranchSalespersonName(ctx context.Context, arg UpdateBranchSalespersonNameParams) (Salesperson, error)
UpdateBranchTarget(ctx context.Context, arg UpdateBranchTargetParams) (BranchTarget, error)
// Only affects future periods -- see CreateGeneratedBranchTarget's note on
// generation snapshotting a series' fields, never joining them live.
UpdateBranchTargetSeries(ctx context.Context, arg UpdateBranchTargetSeriesParams) (BranchTargetSeries, error)
UpdateBranchUser(ctx context.Context, arg UpdateBranchUserParams) (BranchUser, error)
UpdateCashbox(ctx context.Context, arg UpdateCashboxParams) (Cashbox, error)
UpdateCashboxAccount(ctx context.Context, arg UpdateCashboxAccountParams) (CashboxAccount, error)
UpdateClient(ctx context.Context, arg UpdateClientParams) (Client, error)
UpdateClientPhone(ctx context.Context, arg UpdateClientPhoneParams) error
UpdateColor(ctx context.Context, arg UpdateColorParams) (Color, error)
UpdateCoupon(ctx context.Context, arg UpdateCouponParams) (Coupon, error)
UpdateCouponCategory(ctx context.Context, arg UpdateCouponCategoryParams) (CouponCategory, error)
UpdateCouponType(ctx context.Context, arg UpdateCouponTypeParams) (CouponType, error)
UpdateCurrency(ctx context.Context, arg UpdateCurrencyParams) (Currency, error)
UpdateDeal(ctx context.Context, arg UpdateDealParams) (Deal, error)
UpdateDiscountList(ctx context.Context, arg UpdateDiscountListParams) error
UpdateDiscountListItem(ctx context.Context, arg UpdateDiscountListItemParams) error
// Saved in place: the rows a rule wrote carry its id (rule_id), so a rule
// re-created with a new id would have every one of them rewritten.
UpdateDiscountListRule(ctx context.Context, arg UpdateDiscountListRuleParams) (int64, error)
// Saved in place, so a group (and its rules) keeps its id.
UpdateDiscountListRuleGroup(ctx context.Context, arg UpdateDiscountListRuleGroupParams) (int64, error)
UpdateEmailSchedule(ctx context.Context, arg UpdateEmailScheduleParams) (EmailSchedule, error)
UpdateEmployee(ctx context.Context, arg UpdateEmployeeParams) (Employee, error)
UpdateEmployeeSalary(ctx context.Context, arg UpdateEmployeeSalaryParams) (Employee, error)
UpdateExpense(ctx context.Context, arg UpdateExpenseParams) (Expense, error)
UpdateExpenseCategory(ctx context.Context, arg UpdateExpenseCategoryParams) (ExpenseCategory, error)
UpdateInventory(ctx context.Context, arg UpdateInventoryParams) error
UpdateInvoiceDiscount(ctx context.Context, arg UpdateInvoiceDiscountParams) (InvoiceDiscount, error)
UpdateInvoiceType(ctx context.Context, arg UpdateInvoiceTypeParams) (InvoiceType, error)
// Central loans only -- branch-origin loans are a synced record of what a
// branch reported and stay read-only here (WHERE origin filter makes a
// branch-loan id return no rows, surfaced as a 404 by the handler).
UpdateLoan(ctx context.Context, arg UpdateLoanParams) (Loan, error)
UpdateLoanCategory(ctx context.Context, arg UpdateLoanCategoryParams) (LoanCategory, error)
UpdatePriceList(ctx context.Context, arg UpdatePriceListParams) error
UpdatePriceListItem(ctx context.Context, arg UpdatePriceListItemParams) error
UpdateProduct(ctx context.Context, arg UpdateProductParams) error
UpdateProductAttribute(ctx context.Context, arg UpdateProductAttributeParams) error
UpdateProductCategory(ctx context.Context, arg UpdateProductCategoryParams) (ProductCategory, error)
// A null threshold clears the override, falling back to the app-wide default.
UpdateProductLowStockThreshold(ctx context.Context, arg UpdateProductLowStockThresholdParams) error
// price is deliberately not settable here -- see CreateProductVariant.
UpdateProductVariant(ctx context.Context, arg UpdateProductVariantParams) (ProductVariant, error)
// Roll the variant's global moving-average cost forward on a stock receipt.
// current_qty is the on-hand across all locations before this receipt.
UpdateProductVariantAvgCost(ctx context.Context, arg UpdateProductVariantAvgCostParams) error
UpdateRecurringExpenseNextDue(ctx context.Context, arg UpdateRecurringExpenseNextDueParams) (RecurringExpense, error)
UpdateSalesperson(ctx context.Context, arg UpdateSalespersonParams) (Salesperson, error)
UpdateSecuritySettings(ctx context.Context, arg UpdateSecuritySettingsParams) (SecuritySetting, error)
UpdateSize(ctx context.Context, arg UpdateSizeParams) (Size, error)
UpdateTransfer(ctx context.Context, arg UpdateTransferParams) error
UpdateUser(ctx context.Context, arg UpdateUserParams) error
UpdateWhatsAppNumberLabel(ctx context.Context, arg UpdateWhatsAppNumberLabelParams) (WhatsappNumber, error)
UpsertAttributeValue(ctx context.Context, arg UpsertAttributeValueParams) (AttributesValue, error)
UpsertBranchSettings(ctx context.Context, arg UpsertBranchSettingsParams) (BranchSetting, error)
// Idempotent on (branch_id, entity, ref): a retried outbox push re-reports
// the same conflict. A row an admin already resolved/dismissed is left
// alone (nothing to re-open).
UpsertBranchSyncConflict(ctx context.Context, arg UpsertBranchSyncConflictParams) (BranchSyncConflict, error)
UpsertCashboxAccountOverride(ctx context.Context, arg UpsertCashboxAccountOverrideParams) (BranchCashboxAccount, error)
UpsertClientLink(ctx context.Context, arg UpsertClientLinkParams) error
UpsertDefaultBranchSettings(ctx context.Context, settings json.RawMessage) (DefaultBranchSetting, error)
UpsertDiscountListBranch(ctx context.Context, arg UpsertDiscountListBranchParams) error
UpsertDiscountListOptionItem(ctx context.Context, arg UpsertDiscountListOptionItemParams) error
UpsertGoogleReview(ctx context.Context, arg UpsertGoogleReviewParams) error
UpsertIPBan(ctx context.Context, arg UpsertIPBanParams) error
// Reactivates inventories_assets (created 000012, never wired up until now):
// per-location unit counts for fixed assets, feeding the Assets Treemap.
// One assets row is a distinct item *type*; the same asset can sit in more
// than one location, each with its own counted quantity here.
UpsertInventoryAssetQuantity(ctx context.Context, arg UpsertInventoryAssetQuantityParams) (InventoriesAsset, error)
// One open "oversold" alert per (branch, variant). Unlike
// UpsertBranchSyncConflict, an alert an admin already resolved is reopened:
// going negative again after a fix is a new problem.
UpsertOversoldConflict(ctx context.Context, arg UpsertOversoldConflictParams) (BranchSyncConflict, error)
UpsertPriceListBranch(ctx context.Context, arg UpsertPriceListBranchParams) error
UpsertProductAttribute(ctx context.Context, arg UpsertProductAttributeParams) error
UpsertRolePermission(ctx context.Context, arg UpsertRolePermissionParams) error
// The Security page and its request middleware (api/security.go).
// Folds one flush's worth of requests from an IP into its row: counters
// add up, the "last" columns and the location are overwritten.
UpsertVisitorIP(ctx context.Context, arg UpsertVisitorIPParams) error
// IPs and requests per country, busiest first.
VisitorCountries(ctx context.Context) ([]VisitorCountriesRow, error)
// Lets units through with no picture. A unit that already has one is left alone.
WaiveUnknownItemSlots(ctx context.Context, arg WaiveUnknownItemSlotsParams) (int64, error)
// Names for a rule's phones, matched on their last 8 digits (whatsAppSamePhone).
WhatsAppClientsByPhoneTail(ctx context.Context, tails []string) ([]WhatsAppClientsByPhoneTailRow, error)
// Both kashi's failures (Meta refused the send) and Meta's own (accepted,
// then couldn't deliver).
WhatsAppFailureReasons(ctx context.Context, arg WhatsAppFailureReasonsParams) ([]WhatsAppFailureReasonsRow, error)
// Sale messages that failed lately (a retried one that then went out is no
// longer counted, see DeleteFailedWhatsAppMessagesForInvoice), and the
// latest failure's reason.
WhatsAppFailureWatch(ctx context.Context) (WhatsAppFailureWatchRow, error)
// delivered/read/undelivered come from Meta's webhook (delivery_status).
WhatsAppMessageTotals(ctx context.Context, arg WhatsAppMessageTotalsParams) (WhatsAppMessageTotalsRow, error)
WhatsAppMessagesByBranch(ctx context.Context, arg WhatsAppMessagesByBranchParams) ([]WhatsAppMessagesByBranchRow, error)
// Days are Beirut calendar days, like the rest of the business.
WhatsAppMessagesByDay(ctx context.Context, arg WhatsAppMessagesByDayParams) ([]WhatsAppMessagesByDayRow, error)
WhatsAppMessagesByHour(ctx context.Context, arg WhatsAppMessagesByHourParams) ([]WhatsAppMessagesByHourRow, error)
// ” rule_name is "no rule matched" (the default template).
WhatsAppMessagesByRule(ctx context.Context, arg WhatsAppMessagesByRuleParams) ([]WhatsAppMessagesByRuleRow, error)
// The number a branch's sale goes out from: its own, else the default, else
// (no default, as when the first number was removed) the oldest one. A number
// whose minimum invoice the sale is under is passed over for the next one.
WhatsAppNumberForBranch(ctx context.Context, arg WhatsAppNumberForBranchParams) (WhatsappNumber, error)
// A till that reports the same sale twice doesn't message the client twice.
WhatsAppSentForInvoice(ctx context.Context, arg WhatsAppSentForInvoiceParams) (bool, error)
WhatsAppTopRecipients(ctx context.Context, arg WhatsAppTopRecipientsParams) ([]WhatsAppTopRecipientsRow, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AcknowledgeSecurityAlerts ¶ added in v1.1.0
func (q *Queries) AcknowledgeSecurityAlerts(ctx context.Context, arg AcknowledgeSecurityAlertsParams) error
Marks the given alerts seen; an empty list marks every open one except those of kept_kinds (critical ones, resolved only one by one).
func (*Queries) ActiveDiscountListForBranch ¶ added in v1.1.6
func (q *Queries) ActiveDiscountListForBranch(ctx context.Context, branchID int64) (DiscountList, error)
The list a branch is discounted from: its own assigned list when that one is active and in date, otherwise the default -- the same choice ResolveVariantDiscount makes, and the till makes from what it's sent.
func (*Queries) AddBatchItem ¶
remaining_quantity starts equal to quantity_bought -- FIFO consumption (applyStockMovement) draws it down as sales are attributed to this batch, and returns of those sales put it back.
func (*Queries) AddCashboxAccountBalance ¶
func (q *Queries) AddCashboxAccountBalance(ctx context.Context, arg AddCashboxAccountBalanceParams) (ShiftsAccountsBalance, error)
func (*Queries) AddClientLoyaltyPoints ¶
func (q *Queries) AddClientLoyaltyPoints(ctx context.Context, arg AddClientLoyaltyPointsParams) error
func (*Queries) AddInventoryStockQuantity ¶
func (q *Queries) AddInventoryStockQuantity(ctx context.Context, arg AddInventoryStockQuantityParams) (InventoryStock, error)
Apply a signed quantity delta to one SKU's on-hand in one inventory, creating the row if this SKU has never been stocked there. Cost is left untouched (used for sales, returns, transfers, adjustments).
func (*Queries) AddInvoiceDiscountBranch ¶ added in v1.1.8
func (q *Queries) AddInvoiceDiscountBranch(ctx context.Context, arg AddInvoiceDiscountBranchParams) error
func (*Queries) AddInvoiceProduct ¶
func (q *Queries) AddInvoiceProduct(ctx context.Context, arg AddInvoiceProductParams) (InvoiceProduct, error)
func (*Queries) AddProductSaleOptionsForEntries ¶ added in v1.1.6
func (q *Queries) AddProductSaleOptionsForEntries(ctx context.Context, arg AddProductSaleOptionsForEntriesParams) ([]int64, error)
Gives every product named by entries each of the options; returns the product ids it matched.
func (*Queries) AddPurchaseItem ¶
func (q *Queries) AddPurchaseItem(ctx context.Context, arg AddPurchaseItemParams) (PurchaseItem, error)
func (*Queries) AddPurchasedProduct ¶
func (q *Queries) AddPurchasedProduct(ctx context.Context, arg AddPurchasedProductParams) (ProductSupplier, error)
func (*Queries) AddPurchasedProductCost ¶
func (q *Queries) AddPurchasedProductCost(ctx context.Context, arg AddPurchasedProductCostParams) (ProductSupplierCost, error)
func (*Queries) AddStockCountItem ¶
func (q *Queries) AddStockCountItem(ctx context.Context, arg AddStockCountItemParams) (StockCountItem, error)
func (*Queries) AddWhatsAppChatMessage ¶ added in v1.1.1
func (q *Queries) AddWhatsAppChatMessage(ctx context.Context, arg AddWhatsAppChatMessageParams) (int64, error)
The Inbox tab: every message on our own WhatsApp numbers (api/whatsapp_chat.go). ErrNoRows when the bridge already reported this message.
func (*Queries) AddWhatsAppPollReply ¶ added in v1.1.0
func (q *Queries) AddWhatsAppPollReply(ctx context.Context, arg AddWhatsAppPollReplyParams) (int64, error)
A client's message after the poll, reported by the bridge. No rows when the poll is unknown or the bridge already reported this message.
func (*Queries) AdjustBatchItemRemainingQuantity ¶
func (q *Queries) AdjustBatchItemRemainingQuantity(ctx context.Context, arg AdjustBatchItemRemainingQuantityParams) (BatchItem, error)
Signed delta: negative consumes (a sale), positive replenishes (a return of that sale). No floor at zero -- same "ledger stays authoritative, UI surfaces negatives" rule as inventory_stock.
func (*Queries) AdoptSalespersonAttendanceID ¶ added in v1.1.0
func (q *Queries) AdoptSalespersonAttendanceID(ctx context.Context, arg AdoptSalespersonAttendanceIDParams) error
A till's own value, reported up, for a salesperson kashi hasn't set one for. updated_at is left alone: nothing about it needs to go back down.
func (*Queries) ApplyWhatsAppBridgeTick ¶ added in v1.1.0
func (q *Queries) ApplyWhatsAppBridgeTick(ctx context.Context, arg ApplyWhatsAppBridgeTickParams) (ApplyWhatsAppBridgeTickRow, error)
A tick the bridge saw on one of our own messages. Like Meta's statuses it only moves forward (sent -> delivered -> read), so a late one changes nothing.
func (*Queries) ApplyWhatsAppDeliveryStatus ¶ added in v1.1.0
func (q *Queries) ApplyWhatsAppDeliveryStatus(ctx context.Context, arg ApplyWhatsAppDeliveryStatusParams) ([]int64, error)
Meta's WhatsApp webhook (api/whatsapp_webhook.go). Delivery only moves forward (sent -> delivered -> read), so an update that arrives late doesn't undo a newer one; 'failed' always wins. A message Meta couldn't deliver, or says it doesn't charge for, costs nothing.
func (*Queries) AttachWhatsAppPoll ¶ added in v1.1.6
func (q *Queries) AttachWhatsAppPoll(ctx context.Context, arg AttachWhatsAppPollParams) error
The rating poll a new client gets at checkout, recorded on the welcome row that checkout claimed, so one client's welcome and poll are one row (its ticks are the welcome's; votes find it by poll_ref).
func (*Queries) BatchSetClientPhoneFlags ¶ added in v1.1.6
func (q *Queries) BatchSetClientPhoneFlags(ctx context.Context, arg BatchSetClientPhoneFlagsParams) error
Sets only phone_valid/phone_country, leaving the phone text and updated_at alone: bumping updated_at would make every till re-download the client on its next catch-up.
func (*Queries) BatchUpdateClientPhones ¶ added in v1.1.3
func (q *Queries) BatchUpdateClientPhones(ctx context.Context, arg BatchUpdateClientPhonesParams) error
Bulk counterpart to UpdateClientPhone for normalizeClientPhones: one round trip for a whole chunk instead of one per row, which is what made the first version of this job time out at Cloudflare's gateway on 60k+ individual updates. Also backfills phone_valid/phone_country for every row the job passes (even one whose phone text didn't change), since those columns start out at their just-migrated-in defaults until this runs once.
func (*Queries) BranchAttendanceChangeRefsPresent ¶
func (*Queries) BranchAttendanceEventRefsPresent ¶
func (*Queries) BranchClientLinksPresent ¶
func (*Queries) BranchCommandSummary ¶
func (q *Queries) BranchCommandSummary(ctx context.Context) ([]BranchCommandSummaryRow, error)
One row per branch: what's still queued and what failed in the last day, for the Commands page sidebar and its nav dot.
func (*Queries) BranchExpenseRefsPresent ¶
func (*Queries) BranchInvoiceRefsPresent ¶
func (q *Queries) BranchInvoiceRefsPresent(ctx context.Context, arg BranchInvoiceRefsPresentParams) ([]string, error)
Reconcile queries: given the refs a branch believes it has pushed, return the subset kashi actually holds. The branch diffs its own list against this to decide what still needs (re)queuing -- the basis of "sync everything to a (possibly new) central server". Each is a single indexed `= ANY` lookup; the handler caps the input array size.
func (*Queries) BranchInvoicesReferenceClient ¶
func (*Queries) BranchInvoicesReferenceVariant ¶
func (*Queries) BranchLoanRefsPresent ¶
func (q *Queries) BranchLoanRefsPresent(ctx context.Context, arg BranchLoanRefsPresentParams) ([]sql.NullString, error)
func (*Queries) BranchSalespersonExists ¶ added in v1.1.0
func (*Queries) BranchShiftIsClosed ¶
func (q *Queries) BranchShiftIsClosed(ctx context.Context, arg BranchShiftIsClosedParams) (bool, error)
A branch_shifts row exists only once kashi-pos has reported that shift's close, so its mere presence is the "this shift is closed" signal -- closed_at itself can be NULL for an older till build that omitted it.
func (*Queries) BranchShiftRefsPresent ¶
func (*Queries) BranchSyncConflictSummary ¶
func (q *Queries) BranchSyncConflictSummary(ctx context.Context) ([]BranchSyncConflictSummaryRow, error)
One row per branch: open conflicts, and how many of those are oversold stock (the kind that needs a stock fix), for the Conflicts page sidebar and its nav dot.
func (*Queries) BranchVisitorEventRefsPresent ¶
func (*Queries) BulkSetDiscountListItems ¶ added in v1.1.1
func (q *Queries) BulkSetDiscountListItems(ctx context.Context, arg BulkSetDiscountListItemsParams) ([]int64, error)
Puts every variant whose barcode, or whose product's code, is in entries on the list at one discount (adding it or changing it). A code names all of its product's variants. deal_id, when set, puts them on that deal instead (discount 0). Returns the variant ids it set.
func (*Queries) BulkSetDiscountListOptionItems ¶ added in v1.1.6
func (q *Queries) BulkSetDiscountListOptionItems(ctx context.Context, arg BulkSetDiscountListOptionItemsParams) ([]int64, error)
BulkSetDiscountListItems for one option: the discount applies to the matched variants only when they are sold as that option.
func (*Queries) BumpAdminActivity ¶ added in v1.1.0
func (q *Queries) BumpAdminActivity(ctx context.Context, arg BumpAdminActivityParams) (int64, error)
Folds a repeat into the feed's newest entry when it's the same change by the same person, made less than an hour after it: the count goes up and the time moves to now. No row back (sql.ErrNoRows) means it wasn't a repeat, and the caller adds a new entry.
func (*Queries) BusyHoursSales ¶ added in v1.1.0
func (q *Queries) BusyHoursSales(ctx context.Context, arg BusyHoursSalesParams) ([]BusyHoursSalesRow, error)
Sales (not returns or exchanges): how many, and what they came to.
func (*Queries) BusyHoursVisitors ¶ added in v1.1.0
func (q *Queries) BusyHoursVisitors(ctx context.Context, arg BusyHoursVisitorsParams) ([]BusyHoursVisitorsRow, error)
The Busy Hours page (api/busy_hours.go): when people come in and buy, by weekday (ISO: 1 Monday .. 7 Sunday) and hour, in each branch's own time zone. Hidden branches/registers and cancelled sales are left out, like the other reports. Empty branch_ids = every branch. Presses of the till's people counter (customers in).
func (*Queries) CancelBranchCommand ¶
Only a command no till has acked yet can be withdrawn.
func (*Queries) CancelBranchExpense ¶ added in v1.1.2
Stamps cancelled_at once; a second cancel matches no row (the handler reads the row first, so that's an idempotent no-op, not an error).
func (*Queries) CancelBranchLoan ¶ added in v1.1.2
Branch-reported loans only: a central loan is deleted, there's no till to tell. Stamps cancelled_at once, like CancelBranchExpense.
func (*Queries) ClaimBranchQuickAccessInit ¶
The once-only gate on a branch's list: 1 row the first time it's set up (by a till's import or an admin save), 0 ever after.
func (*Queries) ClaimEmailScheduleRun ¶ added in v1.1.0
func (q *Queries) ClaimEmailScheduleRun(ctx context.Context, arg ClaimEmailScheduleRunParams) (int64, error)
Moves a due schedule on to its next run before it sends, and only if no one else already did -- so a run is never sent twice.
func (*Queries) ClaimWhatsAppPollFollowup ¶ added in v1.1.0
func (q *Queries) ClaimWhatsAppPollFollowup(ctx context.Context, arg ClaimWhatsAppPollFollowupParams) (ClaimWhatsAppPollFollowupRow, error)
Marks the poll's follow-up as sent and says where to send it; no rows when it already went (a changed vote) or the number is gone. Also none when the follow-up is off for this client: for_new / for_returning, a returning client being one messaged before this message.
func (*Queries) ClaimWhatsAppWelcome ¶ added in v1.1.1
func (q *Queries) ClaimWhatsAppWelcome(ctx context.Context, arg ClaimWhatsAppWelcomeParams) (int64, error)
A sale's checkout finds the welcome sent to its client earlier (no invoice yet, within the last 12 hours) and takes it over, so it isn't messaged twice.
func (*Queries) ClearDefaultWhatsAppNumber ¶ added in v1.1.0
func (*Queries) ClearProductSaleOptionsForEntries ¶ added in v1.1.6
Entries are matched the way BulkSetDiscountListItems matches them: a variant barcode names its product, a code names the product directly.
func (*Queries) ClientPhonesPresent ¶
func (*Queries) CompleteBranchCommand ¶
func (q *Queries) CompleteBranchCommand(ctx context.Context, arg CompleteBranchCommandParams) (BranchCommand, error)
func (*Queries) CountAdminActivitiesSince ¶ added in v1.1.0
The home page's "today" count next to the IT Management feed.
func (*Queries) CountAssets ¶
func (*Queries) CountAttributeValues ¶
func (*Queries) CountAuditLogs ¶
func (*Queries) CountBatchesFiltered ¶
func (*Queries) CountBranchAttendanceChanges ¶
func (*Queries) CountBranchAttendanceEvents ¶
func (*Queries) CountBranchCommands ¶
func (*Queries) CountBranchExpenseImages ¶
func (*Queries) CountBranchExpenseImagesForExpense ¶ added in v1.1.0
func (*Queries) CountBranchExpenses ¶
func (*Queries) CountBranchInvoiceSettlements ¶
func (*Queries) CountBranchInvoices ¶
func (*Queries) CountBranchInvoicesFiltered ¶
func (*Queries) CountBranchShiftReceiptImages ¶
func (*Queries) CountBranchShifts ¶
func (*Queries) CountBranchSyncConflicts ¶
func (*Queries) CountBranchVisitorDayByDirection ¶
func (q *Queries) CountBranchVisitorDayByDirection(ctx context.Context, arg CountBranchVisitorDayByDirectionParams) (int64, error)
Running gross tally for one branch, one local day, one direction -- used to tell the admin toast "customer in -- 42 in today".
func (*Queries) CountBranchVisitorDays ¶
func (*Queries) CountBranchesOnDefaultDiscountList ¶ added in v1.1.6
Branches with no active list of their own, i.e. discounted from the default.
func (*Queries) CountCashboxAccountOverrides ¶
func (q *Queries) CountCashboxAccountOverrides(ctx context.Context, cashboxAccountID int64) (int64, error)
How many branches reference this method, either via an explicit override row or by inheriting it as-is. A payment method that any branch still overrides can't be hard-deleted without leaving that override dangling (or silently cascading it away), so the delete handler blocks on this and points the admin at deactivating instead.
func (*Queries) CountClients ¶
func (*Queries) CountClientsBySpending ¶
func (q *Queries) CountClientsBySpending(ctx context.Context, arg CountClientsBySpendingParams) (int64, error)
Same filters as ListClientsBySpending, minus the spend computation -- used for the rest-of-clients table's pagination total. With a branch picked it counts that branch's clients: home branch, or a branch invoice there (same cancelled/hidden rules as the list).
func (*Queries) CountClientsBySpendingCached ¶ added in v1.1.6
func (q *Queries) CountClientsBySpendingCached(ctx context.Context, arg CountClientsBySpendingCachedParams) (int64, error)
Count for ListClientsBySpendingCached.
func (*Queries) CountColors ¶
func (*Queries) CountCoupons ¶
func (*Queries) CountCouponsByTypeID ¶
func (*Queries) CountCurrencies ¶
func (*Queries) CountCurrencyUsage ¶
Whether anything in kashi's own tables still points at this currency -- a payment method priced in it, or a branch override that prices one in it. A currency that's still referenced can't be hard-deleted (it would either violate the FK or silently orphan those rows); the delete handler blocks on this and points the admin at deactivating instead.
func (*Queries) CountDashboardExpenses ¶
func (*Queries) CountDashboardPurchases ¶
func (*Queries) CountDashboardSales ¶
func (*Queries) CountDiscountListItemsWithProduct ¶
func (*Queries) CountDiscountListRuleDecided ¶ added in v1.1.7
func (q *Queries) CountDiscountListRuleDecided(ctx context.Context, discountListID int64) ([]CountDiscountListRuleDecidedRow, error)
How many variants each rule of a list decides, first match wins, the way refresh_discount_rules (000208) picks them. A rule giving no discount and no deal writes no rows, so ListDiscountListRules counts it as 0; this is what it keeps out (or gives) all the same.
func (*Queries) CountDiscountLists ¶
func (*Queries) CountEmailReports ¶ added in v1.1.0
func (*Queries) CountEmployees ¶
func (*Queries) CountExpenses ¶
func (*Queries) CountHomeActivitiesSince ¶ added in v1.1.0
The "N synced" count beside the Recent activity feed: the same rows as HomeActivityFeed received from `since` on. A plain count per table rides the received_at indexes; it used to come from the feed query's windowed total, which built (and coloured) every row of the week to count them.
func (*Queries) CountIgnoredLowStockProducts ¶
func (*Queries) CountInventories ¶
func (*Queries) CountInventoryStock ¶
func (*Queries) CountInvoicesFiltered ¶
func (*Queries) CountLatestAdditionsSince ¶ added in v1.1.0
func (q *Queries) CountLatestAdditionsSince(ctx context.Context, arg CountLatestAdditionsSinceParams) (int64, error)
The home page's "today" count next to the Latest added feed: the same kinds, access flags and timestamps as ListLatestAdditions, counted from `since` on.
func (*Queries) CountLoanImagesForLoan ¶ added in v1.1.0
func (*Queries) CountLoanPayments ¶
func (*Queries) CountLoans ¶
func (*Queries) CountLowStockProducts ¶
func (*Queries) CountOpenBranchSyncConflicts ¶
func (*Queries) CountOpenSecurityAlerts ¶ added in v1.1.0
func (*Queries) CountOtherAdmins ¶
Admin users besides $1, so the last admin can't be deleted or demoted.
func (*Queries) CountPriceListItemsWithProduct ¶
func (*Queries) CountPriceListsFiltered ¶
func (*Queries) CountProductVariants ¶
func (*Queries) CountPurchasesFiltered ¶
func (*Queries) CountRegistersTargetingRelease ¶
func (*Queries) CountShifts ¶
func (*Queries) CountSizes ¶
func (*Queries) CountSlowMovingProducts ¶
func (*Queries) CountStockCounts ¶
func (*Queries) CountStockHealthByInventory ¶
func (*Queries) CountStockMovements ¶
func (*Queries) CountSuppliersFiltered ¶
func (*Queries) CountTransferAttachments ¶ added in v1.1.0
func (*Queries) CountTransfers ¶
func (*Queries) CountUnknownItemImages ¶ added in v1.1.1
func (*Queries) CountUnknownItems ¶ added in v1.1.1
func (*Queries) CountVariantsForBarcodes ¶
func (*Queries) CountVisitorIPs ¶ added in v1.1.0
func (*Queries) CountWhatsAppMessages ¶ added in v1.1.0
func (*Queries) CountWhatsAppReplies ¶ added in v1.1.0
func (*Queries) CreateAdminActivity ¶
func (q *Queries) CreateAdminActivity(ctx context.Context, arg CreateAdminActivityParams) (AdminActivity, error)
func (*Queries) CreateAppRelease ¶
func (q *Queries) CreateAppRelease(ctx context.Context, arg CreateAppReleaseParams) (AppRelease, error)
func (*Queries) CreateAppUpdateEvent ¶
func (q *Queries) CreateAppUpdateEvent(ctx context.Context, arg CreateAppUpdateEventParams) error
func (*Queries) CreateAsset ¶
func (*Queries) CreateAssetCategory ¶
func (q *Queries) CreateAssetCategory(ctx context.Context, arg CreateAssetCategoryParams) (AssetCategory, error)
func (*Queries) CreateAuditLog ¶
func (*Queries) CreateBatch ¶
func (*Queries) CreateBranch ¶
func (*Queries) CreateBranchAttendanceChange ¶
func (q *Queries) CreateBranchAttendanceChange(ctx context.Context, arg CreateBranchAttendanceChangeParams) (BranchAttendanceChange, error)
func (*Queries) CreateBranchAttendanceEvent ¶
func (q *Queries) CreateBranchAttendanceEvent(ctx context.Context, arg CreateBranchAttendanceEventParams) (BranchAttendanceEvent, error)
func (*Queries) CreateBranchCommand ¶
func (q *Queries) CreateBranchCommand(ctx context.Context, arg CreateBranchCommandParams) (BranchCommand, error)
func (*Queries) CreateBranchExpense ¶
func (q *Queries) CreateBranchExpense(ctx context.Context, arg CreateBranchExpenseParams) (BranchExpense, error)
func (*Queries) CreateBranchExpenseImage ¶
func (q *Queries) CreateBranchExpenseImage(ctx context.Context, arg CreateBranchExpenseImageParams) (BranchExpenseImage, error)
func (*Queries) CreateBranchExpenseUploadToken ¶
func (q *Queries) CreateBranchExpenseUploadToken(ctx context.Context, arg CreateBranchExpenseUploadTokenParams) (BranchExpenseUploadToken, error)
func (*Queries) CreateBranchInvoice ¶
func (q *Queries) CreateBranchInvoice(ctx context.Context, arg CreateBranchInvoiceParams) (BranchInvoice, error)
func (*Queries) CreateBranchInvoiceItem ¶
func (q *Queries) CreateBranchInvoiceItem(ctx context.Context, arg CreateBranchInvoiceItemParams) (BranchInvoiceItem, error)
func (*Queries) CreateBranchInvoicePayment ¶
func (q *Queries) CreateBranchInvoicePayment(ctx context.Context, arg CreateBranchInvoicePaymentParams) (BranchInvoicePayment, error)
func (*Queries) CreateBranchInvoiceSettlement ¶
func (q *Queries) CreateBranchInvoiceSettlement(ctx context.Context, arg CreateBranchInvoiceSettlementParams) (BranchInvoiceSettlement, error)
func (*Queries) CreateBranchInvoiceSettlementPayment ¶
func (q *Queries) CreateBranchInvoiceSettlementPayment(ctx context.Context, arg CreateBranchInvoiceSettlementPaymentParams) (BranchInvoiceSettlementPayment, error)
func (*Queries) CreateBranchLoan ¶
func (*Queries) CreateBranchRegister ¶
func (q *Queries) CreateBranchRegister(ctx context.Context, arg CreateBranchRegisterParams) (BranchRegister, error)
func (*Queries) CreateBranchSalesperson ¶
func (q *Queries) CreateBranchSalesperson(ctx context.Context, arg CreateBranchSalespersonParams) (Salesperson, error)
func (*Queries) CreateBranchShift ¶
func (q *Queries) CreateBranchShift(ctx context.Context, arg CreateBranchShiftParams) (BranchShift, error)
func (*Queries) CreateBranchShiftReceiptImage ¶
func (q *Queries) CreateBranchShiftReceiptImage(ctx context.Context, arg CreateBranchShiftReceiptImageParams) (BranchShiftReceiptImage, error)
func (*Queries) CreateBranchShiftUploadToken ¶
func (q *Queries) CreateBranchShiftUploadToken(ctx context.Context, arg CreateBranchShiftUploadTokenParams) (BranchShiftUploadToken, error)
func (*Queries) CreateBranchTarget ¶
func (q *Queries) CreateBranchTarget(ctx context.Context, arg CreateBranchTargetParams) (BranchTarget, error)
func (*Queries) CreateBranchTargetSeries ¶
func (q *Queries) CreateBranchTargetSeries(ctx context.Context, arg CreateBranchTargetSeriesParams) (BranchTargetSeries, error)
func (*Queries) CreateBranchTransferRequest ¶
func (q *Queries) CreateBranchTransferRequest(ctx context.Context, arg CreateBranchTransferRequestParams) (Transfer, error)
A branch's own proposed transfer: always starts 'requested', always carries branch_id + client_ref (the idempotency key -- see idx_transfers_branch_client_ref).
func (*Queries) CreateBranchTransferUploadToken ¶
func (q *Queries) CreateBranchTransferUploadToken(ctx context.Context, arg CreateBranchTransferUploadTokenParams) (BranchTransferUploadToken, error)
func (*Queries) CreateBranchUser ¶
func (q *Queries) CreateBranchUser(ctx context.Context, arg CreateBranchUserParams) (BranchUser, error)
func (*Queries) CreateBranchVisitorEvent ¶
func (q *Queries) CreateBranchVisitorEvent(ctx context.Context, arg CreateBranchVisitorEventParams) (BranchVisitorEvent, error)
func (*Queries) CreateCalendarEvent ¶
func (q *Queries) CreateCalendarEvent(ctx context.Context, arg CreateCalendarEventParams) (CalendarEvent, error)
func (*Queries) CreateCashbox ¶
func (*Queries) CreateCashboxAccount ¶
func (q *Queries) CreateCashboxAccount(ctx context.Context, arg CreateCashboxAccountParams) (CashboxAccount, error)
func (*Queries) CreateCentralLoan ¶
func (*Queries) CreateClient ¶
func (*Queries) CreateClientWithUID ¶
func (q *Queries) CreateClientWithUID(ctx context.Context, arg CreateClientWithUIDParams) (Client, error)
A till-created client keeps the uid the till minted, so the till never has to rewrite anything once kashi accepts it.
func (*Queries) CreateColor ¶
func (*Queries) CreateCoupon ¶
A one-off coupon, not part of a list -- list_id stays NULL.
func (*Queries) CreateCouponCategory ¶
func (q *Queries) CreateCouponCategory(ctx context.Context, arg CreateCouponCategoryParams) (CouponCategory, error)
func (*Queries) CreateCouponList ¶
func (q *Queries) CreateCouponList(ctx context.Context, arg CreateCouponListParams) (CouponList, error)
func (*Queries) CreateCouponType ¶
func (q *Queries) CreateCouponType(ctx context.Context, arg CreateCouponTypeParams) (CouponType, error)
func (*Queries) CreateCurrency ¶
func (*Queries) CreateDeal ¶ added in v1.1.6
func (*Queries) CreateDiscountList ¶
func (q *Queries) CreateDiscountList(ctx context.Context, arg CreateDiscountListParams) (DiscountList, error)
func (*Queries) CreateDiscountListItem ¶
func (q *Queries) CreateDiscountListItem(ctx context.Context, arg CreateDiscountListItemParams) (DiscountListItem, error)
A row written here is set by hand: it takes the row over from the rules (000200), which then leave the variant alone. deal_id puts the variant on a deal (000201) instead of a discount.
func (*Queries) CreateDiscountListRule ¶ added in v1.1.6
func (q *Queries) CreateDiscountListRule(ctx context.Context, arg CreateDiscountListRuleParams) (DiscountListRule, error)
func (*Queries) CreateDiscountListRuleGroup ¶ added in v1.1.6
func (q *Queries) CreateDiscountListRuleGroup(ctx context.Context, arg CreateDiscountListRuleGroupParams) (DiscountListRuleGroup, error)
func (*Queries) CreateDiscountListRuleOption ¶ added in v1.1.6
func (q *Queries) CreateDiscountListRuleOption(ctx context.Context, arg CreateDiscountListRuleOptionParams) error
func (*Queries) CreateEmailReport ¶ added in v1.1.0
func (q *Queries) CreateEmailReport(ctx context.Context, arg CreateEmailReportParams) (EmailReport, error)
func (*Queries) CreateEmailSchedule ¶ added in v1.1.0
func (q *Queries) CreateEmailSchedule(ctx context.Context, arg CreateEmailScheduleParams) (EmailSchedule, error)
func (*Queries) CreateEmployee ¶
func (*Queries) CreateEntryItem ¶
func (*Queries) CreateExpense ¶
func (*Queries) CreateExpenseCategory ¶
func (q *Queries) CreateExpenseCategory(ctx context.Context, arg CreateExpenseCategoryParams) (ExpenseCategory, error)
func (*Queries) CreateGeneratedBranchTarget ¶
func (q *Queries) CreateGeneratedBranchTarget(ctx context.Context, arg CreateGeneratedBranchTargetParams) (BranchTarget, error)
Fires one period for a recurring series -- target_amount/color are passed in (a snapshot of the series at generation time) rather than joined live, so a later edit to the series template never rewrites a period that's already in progress or past, same as recurring_expenses' FireRecurringExpenseTx snapshotting its template's amount into the created expense row.
func (*Queries) CreateGooglePlaceSnapshot ¶ added in v1.1.0
func (q *Queries) CreateGooglePlaceSnapshot(ctx context.Context, arg CreateGooglePlaceSnapshotParams) error
func (*Queries) CreateInventory ¶
func (*Queries) CreateInvoice ¶
func (*Queries) CreateInvoiceDiscount ¶ added in v1.1.8
func (q *Queries) CreateInvoiceDiscount(ctx context.Context, arg CreateInvoiceDiscountParams) (InvoiceDiscount, error)
func (*Queries) CreateInvoicePayment ¶
func (q *Queries) CreateInvoicePayment(ctx context.Context, arg CreateInvoicePaymentParams) (InvoicePayment, error)
func (*Queries) CreateInvoiceType ¶
func (q *Queries) CreateInvoiceType(ctx context.Context, arg CreateInvoiceTypeParams) (InvoiceType, error)
func (*Queries) CreateListCoupon ¶
One code minted as part of a coupon_lists batch (see coupon_list.sql). Not pre-assigned to a client -- whoever redeems it first claims it.
func (*Queries) CreateLoanCategory ¶
func (q *Queries) CreateLoanCategory(ctx context.Context, arg CreateLoanCategoryParams) (LoanCategory, error)
func (*Queries) CreateLoanImage ¶ added in v1.1.0
func (*Queries) CreateLoanPayment ¶
func (q *Queries) CreateLoanPayment(ctx context.Context, arg CreateLoanPaymentParams) (LoanPayment, error)
func (*Queries) CreateLoanUploadToken ¶ added in v1.1.0
func (q *Queries) CreateLoanUploadToken(ctx context.Context, arg CreateLoanUploadTokenParams) (LoanUploadToken, error)
func (*Queries) CreatePriceList ¶
func (*Queries) CreatePriceListItem ¶
func (q *Queries) CreatePriceListItem(ctx context.Context, arg CreatePriceListItemParams) (PriceListItem, error)
func (*Queries) CreateProduct ¶
func (*Queries) CreateProductAttribute ¶
func (q *Queries) CreateProductAttribute(ctx context.Context, arg CreateProductAttributeParams) (ProductsAttribute, error)
func (*Queries) CreateProductCategory ¶
func (q *Queries) CreateProductCategory(ctx context.Context, arg CreateProductCategoryParams) (ProductCategory, error)
func (*Queries) CreateProductVariant ¶
func (q *Queries) CreateProductVariant(ctx context.Context, arg CreateProductVariantParams) (ProductVariant, error)
No price column: since 000094 a variant's price is an entry in a price list, not a property of the variant, so a newly created variant starts with no price and is unsellable until it is added to one.
func (*Queries) CreatePurchase ¶
func (*Queries) CreateRecurringExpense ¶
func (q *Queries) CreateRecurringExpense(ctx context.Context, arg CreateRecurringExpenseParams) (RecurringExpense, error)
func (*Queries) CreateResolvedBranchInvoiceItem ¶ added in v1.1.1
func (q *Queries) CreateResolvedBranchInvoiceItem(ctx context.Context, arg CreateResolvedBranchInvoiceItemParams) error
func (*Queries) CreateReturnInvoice ¶
func (q *Queries) CreateReturnInvoice(ctx context.Context, arg CreateReturnInvoiceParams) (ReturnInvoice, error)
func (*Queries) CreateReviewLinkClick ¶ added in v1.1.0
func (q *Queries) CreateReviewLinkClick(ctx context.Context, arg CreateReviewLinkClickParams) error
func (*Queries) CreateRole ¶
func (*Queries) CreateSaleOption ¶ added in v1.1.6
func (q *Queries) CreateSaleOption(ctx context.Context, arg CreateSaleOptionParams) (SaleOption, error)
func (*Queries) CreateSalesInvoice ¶
func (*Queries) CreateSalesperson ¶
func (q *Queries) CreateSalesperson(ctx context.Context, arg CreateSalespersonParams) (Salesperson, error)
func (*Queries) CreateSession ¶
func (*Queries) CreateShift ¶
func (*Queries) CreateSize ¶
func (*Queries) CreateStockCount ¶
func (q *Queries) CreateStockCount(ctx context.Context, arg CreateStockCountParams) (StockCount, error)
func (*Queries) CreateStockMovement ¶
func (q *Queries) CreateStockMovement(ctx context.Context, arg CreateStockMovementParams) (StockMovement, error)
--------------------------------------------------------------------------- Stock movement ledger (append-only). ---------------------------------------------------------------------------
func (*Queries) CreateSupplier ¶
func (*Queries) CreateTransfer ¶
func (*Queries) CreateTransferItem ¶
func (q *Queries) CreateTransferItem(ctx context.Context, arg CreateTransferItemParams) (TransferItem, error)
func (*Queries) CreateUnknownItemImage ¶ added in v1.1.1
func (q *Queries) CreateUnknownItemImage(ctx context.Context, arg CreateUnknownItemImageParams) (UnknownItemImage, error)
func (*Queries) CreateUnknownItemSession ¶ added in v1.1.1
func (q *Queries) CreateUnknownItemSession(ctx context.Context, arg CreateUnknownItemSessionParams) (UnknownItemSession, error)
func (*Queries) CreateUnknownItemSlot ¶ added in v1.1.1
func (q *Queries) CreateUnknownItemSlot(ctx context.Context, arg CreateUnknownItemSlotParams) error
A till re-sending its session as the cart changes moves and relabels the units it already sent; their pictures stay.
func (*Queries) CreateUser ¶
func (*Queries) CreateWhatsAppMessage ¶ added in v1.1.0
func (q *Queries) CreateWhatsAppMessage(ctx context.Context, arg CreateWhatsAppMessageParams) (WhatsappMessage, error)
func (*Queries) CreateWhatsAppNumber ¶ added in v1.1.0
func (q *Queries) CreateWhatsAppNumber(ctx context.Context, arg CreateWhatsAppNumberParams) (WhatsappNumber, error)
The first number becomes the default.
func (*Queries) CreateWhatsAppReply ¶ added in v1.1.0
func (q *Queries) CreateWhatsAppReply(ctx context.Context, arg CreateWhatsAppReplyParams) error
Linked to the message it answers: the one the client replied to, else the last one sent to that number in the week before. Meta can deliver the same webhook twice; the wamid keeps it to one row.
func (*Queries) CreateWhatsAppRule ¶ added in v1.1.0
func (q *Queries) CreateWhatsAppRule(ctx context.Context, arg CreateWhatsAppRuleParams) (WhatsappRule, error)
func (*Queries) DashboardActivitiesList ¶
func (q *Queries) DashboardActivitiesList(ctx context.Context, arg DashboardActivitiesListParams) ([]DashboardActivitiesListRow, error)
Queries behind the home dashboard's Overview tab: the summary cards, the revenue/expense trend charts, and the aggregated Sales / Purchases / Recent Expenses tables. Every query takes a half-open [date_from, date_to) timestamptz range (the handler passes start-of-next-day as date_to) and, where a branch dimension exists, a nullable branch_id (NULL = all branches, same convention as ListBranchInvoices).
"branch" data is what the POS branches sync up (branch_invoices, branch_expenses); "admin" data is kashi's own centrally-entered records (invoices/sales_invoices, expenses). The dashboard's scope filter picks one or both; the list queries take that as an explicit `scope` arg so a single UNION ALL can serve all three modes, while the scalar summary queries are split per source and the handler adds up whichever apply. One chronological feed across every kind of persisted branch sync. The union happens before LIMIT/OFFSET so pagination is correct globally, not independently per source table. received_at is used deliberately: this table answers "what synced recently", even when a branch catches up an older occurred_at record. person is who did it on the till (salesperson / closing cashier), ” when the till doesn't record one; person_color is that salesperson's own colour, ” when they have none.
func (*Queries) DashboardAdminExpenseSeries ¶
func (q *Queries) DashboardAdminExpenseSeries(ctx context.Context, arg DashboardAdminExpenseSeriesParams) ([]DashboardAdminExpenseSeriesRow, error)
func (*Queries) DashboardAdminExpensesTotal ¶
func (*Queries) DashboardAdminNewClients ¶
func (*Queries) DashboardAdminRevenueSeries ¶
func (q *Queries) DashboardAdminRevenueSeries(ctx context.Context, arg DashboardAdminRevenueSeriesParams) ([]DashboardAdminRevenueSeriesRow, error)
func (*Queries) DashboardAdminSummary ¶
func (q *Queries) DashboardAdminSummary(ctx context.Context, arg DashboardAdminSummaryParams) (DashboardAdminSummaryRow, error)
func (*Queries) DashboardBranchExpenseSeries ¶
func (q *Queries) DashboardBranchExpenseSeries(ctx context.Context, arg DashboardBranchExpenseSeriesParams) ([]DashboardBranchExpenseSeriesRow, error)
func (*Queries) DashboardBranchExpensesTotal ¶
func (*Queries) DashboardBranchNewClients ¶
func (q *Queries) DashboardBranchNewClients(ctx context.Context, arg DashboardBranchNewClientsParams) (int64, error)
Clients first seen at a branch in the range. With a branch selected, count distinct linked clients whose central row was created in-range; with no branch, every client created in-range.
func (*Queries) DashboardBranchRevenueSeries ¶
func (q *Queries) DashboardBranchRevenueSeries(ctx context.Context, arg DashboardBranchRevenueSeriesParams) ([]DashboardBranchRevenueSeriesRow, error)
func (*Queries) DashboardBranchSummary ¶
func (q *Queries) DashboardBranchSummary(ctx context.Context, arg DashboardBranchSummaryParams) (DashboardBranchSummaryRow, error)
items_sold / revenue / invoice count for branch sales in the range. Returns are excluded from items_sold and the count (they aren't sales), but revenue sums every kind so refunds net out, matching ListDailyIncome.
func (*Queries) DashboardDueLoans ¶
func (q *Queries) DashboardDueLoans(ctx context.Context, arg DashboardDueLoansParams) (int64, error)
Outstanding loan balance = disbursed - repaid. loans has no due date, so "due" here just means still owed. Branch arm = origin 'branch_loan' (scoped by branch_id when set); admin arm = origin 'central_loan'. loan_payments carry no branch dimension of their own, so they follow their parent loan's arm. Not date-range bound -- a balance, not a flow.
func (*Queries) DashboardExpensesList ¶
func (q *Queries) DashboardExpensesList(ctx context.Context, arg DashboardExpensesListParams) ([]DashboardExpensesListRow, error)
image_id is 0, not NULL, when an expense has no receipt photo (admin expenses never do): keeps the generated column a plain int64 and lets the frontend treat 0 as "no image".
func (*Queries) DashboardPurchaseSeries ¶
func (q *Queries) DashboardPurchaseSeries(ctx context.Context, arg DashboardPurchaseSeriesParams) ([]DashboardPurchaseSeriesRow, error)
func (*Queries) DashboardPurchasesList ¶
func (q *Queries) DashboardPurchasesList(ctx context.Context, arg DashboardPurchasesListParams) ([]DashboardPurchasesListRow, error)
Purchases are admin-only -- there is no branch purchase concept -- so the scope arg only ever excludes them (scope = 'branch'), never adds a second source. total is summed from purchase_items since purchases carries no amount column of its own.
func (*Queries) DashboardPurchasesTotal ¶
func (q *Queries) DashboardPurchasesTotal(ctx context.Context, arg DashboardPurchasesTotalParams) (int64, error)
Cost of goods bought in the range. Admin-only (no branch purchase concept); total is summed from purchase_items since purchases carries no amount column of its own, matching DashboardPurchasesList.
func (*Queries) DashboardSalesList ¶
func (q *Queries) DashboardSalesList(ctx context.Context, arg DashboardSalesListParams) ([]DashboardSalesListRow, error)
currency is the app's single default currency code (every amount in the schema is stored in its minor unit -- see 000009_create_currencies). The branch-invoice client name is resolved through client_links; when the branch never synced a client link it comes back empty.
func (*Queries) DashboardTargetList ¶
func (q *Queries) DashboardTargetList(ctx context.Context, arg DashboardTargetListParams) ([]DashboardTargetListRow, error)
Every branch_target that is active and spans `as_of` (today), with its live revenue (the target's own [date_from, date_to] window against its own branch). One progress bar per row on the dashboard; the handler also sums these for the overall attainment percentage. branch_targets are branch-only, so the handler skips this under admin scope.
func (*Queries) DashboardTopDueLoans ¶
func (q *Queries) DashboardTopDueLoans(ctx context.Context, arg DashboardTopDueLoansParams) ([]DashboardTopDueLoansRow, error)
The loans with the largest outstanding balance, for the dashboard's "Due Loans" list. Same scope/branch gating as DashboardDueLoans; fully repaid loans (outstanding <= 0) are dropped.
func (*Queries) DeactivateBranchTargetsBySeries ¶
func (q *Queries) DeactivateBranchTargetsBySeries(ctx context.Context, seriesID sql.NullInt64) error
Part of deleting a whole recurring series (see DeleteBranchTargetSeriesTx in tx_branch_target_series.go) -- every period it ever generated needs to disappear the same way a single deleted target does, not just stop getting new ones.
func (*Queries) DeactivateCoupon ¶
func (*Queries) DeactivateCouponList ¶
Deactivating the list itself just stops it appearing as "open" in the admin UI; the codes it already minted are deactivated separately below so an in-flight redemption on a disconnected till isn't silently resurrected once it reconnects.
func (*Queries) DeactivateCouponsForList ¶
func (*Queries) DecrementInvoicesIndex ¶
func (*Queries) DeleteAllWhatsAppRules ¶ added in v1.1.0
func (*Queries) DeleteAppRelease ¶
func (*Queries) DeleteAssetCategory ¶
func (*Queries) DeleteAssets ¶
func (*Queries) DeleteAttributeValue ¶
func (*Queries) DeleteAttributeValues ¶
func (*Queries) DeleteBranchAttendanceEvent ¶
func (*Queries) DeleteBranchInvoicePaymentsForInvoice ¶
func (*Queries) DeleteBranchQuickAccessItems ¶
func (*Queries) DeleteBranchTargetSeries ¶
func (*Queries) DeleteBranchUser ¶
func (*Queries) DeleteCalendarEvent ¶
func (*Queries) DeleteCashboxAccount ¶
func (*Queries) DeleteCashboxAccountOverride ¶
func (q *Queries) DeleteCashboxAccountOverride(ctx context.Context, arg DeleteCashboxAccountOverrideParams) error
Back to inheriting central. Deleting the row rather than writing one full of NULLs keeps "no override" a single state instead of two.
func (*Queries) DeleteColors ¶
func (*Queries) DeleteCouponCategory ¶
func (*Queries) DeleteCouponType ¶
func (*Queries) DeleteCoupons ¶
func (*Queries) DeleteCurrencies ¶
func (*Queries) DeleteCurrency ¶
func (*Queries) DeleteDeal ¶ added in v1.1.6
func (*Queries) DeleteDiscountList ¶
func (*Queries) DeleteDiscountListBranch ¶
func (*Queries) DeleteDiscountListBranchesForList ¶
func (*Queries) DeleteDiscountListItem ¶
func (q *Queries) DeleteDiscountListItem(ctx context.Context, arg DeleteDiscountListItemParams) error
func (*Queries) DeleteDiscountListItems ¶
func (*Queries) DeleteDiscountListOptionItem ¶ added in v1.1.6
func (q *Queries) DeleteDiscountListOptionItem(ctx context.Context, arg DeleteDiscountListOptionItemParams) error
func (*Queries) DeleteDiscountListOptionItems ¶ added in v1.1.6
func (q *Queries) DeleteDiscountListOptionItems(ctx context.Context, arg DeleteDiscountListOptionItemsParams) (int64, error)
Rows are named by (variant, option) pairs, given as two parallel arrays; two unnests in one select list zip them pairwise.
func (*Queries) DeleteDiscountListRuleGroups ¶ added in v1.1.6
Their rules go with them (ON DELETE CASCADE).
func (*Queries) DeleteDiscountListRuleGroupsExcept ¶ added in v1.1.7
func (q *Queries) DeleteDiscountListRuleGroupsExcept(ctx context.Context, arg DeleteDiscountListRuleGroupsExceptParams) error
func (*Queries) DeleteDiscountListRuleOptions ¶ added in v1.1.7
func (*Queries) DeleteDiscountListRules ¶ added in v1.1.6
func (*Queries) DeleteDiscountListRulesExcept ¶ added in v1.1.7
func (q *Queries) DeleteDiscountListRulesExcept(ctx context.Context, arg DeleteDiscountListRulesExceptParams) error
func (*Queries) DeleteEmailSchedule ¶ added in v1.1.0
func (*Queries) DeleteEmployee ¶
func (*Queries) DeleteExpense ¶
func (*Queries) DeleteExpenseCategory ¶
func (*Queries) DeleteExpenses ¶
func (*Queries) DeleteFailedWhatsAppMessagesForInvoice ¶ added in v1.1.1
func (q *Queries) DeleteFailedWhatsAppMessagesForInvoice(ctx context.Context, arg DeleteFailedWhatsAppMessagesForInvoiceParams) error
A till retrying a thank-you after a temporary failure: its earlier failed rows go, so the log keeps one row per sale showing how it ended.
func (*Queries) DeleteHistoricalBranchInvoice ¶ added in v1.1.3
Deletes a historical backfill invoice (and, via ON DELETE CASCADE, its items and payments) so it can be re-imported with corrected data. The historical=true guard means this can never remove a real till's sale, even given a wrong id -- see deleteBranchInvoice in api/branch_invoice.go.
func (*Queries) DeleteIPBan ¶ added in v1.1.0
func (*Queries) DeleteInventories ¶
func (*Queries) DeleteInventory ¶
func (*Queries) DeleteInvoiceDiscount ¶ added in v1.1.8
Kept, marked deleted: the tills drop it when it comes down as not applying to them (000212).
func (*Queries) DeleteInvoiceDiscountBranches ¶ added in v1.1.8
func (*Queries) DeleteLoanCategory ¶
func (*Queries) DeleteLoanPayment ¶
func (*Queries) DeleteLoans ¶
Central loans only, same read-only guard as DeleteLoan.
func (*Queries) DeletePriceList ¶
func (*Queries) DeletePriceListBranch ¶
func (*Queries) DeletePriceListBranchesForList ¶
func (*Queries) DeletePriceListItem ¶
func (q *Queries) DeletePriceListItem(ctx context.Context, arg DeletePriceListItemParams) error
func (*Queries) DeletePriceListItems ¶
func (*Queries) DeleteProduct ¶
func (*Queries) DeleteProductCategory ¶
func (*Queries) DeleteProductVariant ¶
func (*Queries) DeletePurchaseItem ¶
func (q *Queries) DeletePurchaseItem(ctx context.Context, arg DeletePurchaseItemParams) error
func (*Queries) DeleteRolePermissions ¶
func (*Queries) DeleteSalesperson ¶
func (*Queries) DeleteSizes ¶
func (*Queries) DeleteStockCountItems ¶
func (*Queries) DeleteTransferItem ¶
func (q *Queries) DeleteTransferItem(ctx context.Context, arg DeleteTransferItemParams) error
func (*Queries) DeleteUnknownItemImages ¶ added in v1.1.1
func (*Queries) DeleteUnknownItemSlotsNotIn ¶ added in v1.1.8
func (q *Queries) DeleteUnknownItemSlotsNotIn(ctx context.Context, arg DeleteUnknownItemSlotsNotInParams) error
Units taken off the cart since the session was last sent.
func (*Queries) DeleteWhatsAppNumber ¶ added in v1.1.0
func (*Queries) FindUnknownInvoiceItem ¶ added in v1.1.1
func (q *Queries) FindUnknownInvoiceItem(ctx context.Context, arg FindUnknownInvoiceItemParams) (BranchInvoiceItem, error)
func (*Queries) GetAppRelease ¶
func (*Queries) GetAppSettings ¶
func (q *Queries) GetAppSettings(ctx context.Context) (AppSetting, error)
func (*Queries) GetAssetByName ¶
func (*Queries) GetAssetCategory ¶
func (*Queries) GetAssetCategoryByName ¶
func (*Queries) GetAssetTreemapData ¶
func (*Queries) GetAttribute ¶
func (*Queries) GetAttributeValue ¶
upserting instead of inserting makes product creation with attributes easier
func (*Queries) GetBatchItemByBatchVariant ¶
func (*Queries) GetBranchAttendanceChange ¶ added in v1.1.0
func (*Queries) GetBranchAttendanceChangeByClientRef ¶
func (q *Queries) GetBranchAttendanceChangeByClientRef(ctx context.Context, arg GetBranchAttendanceChangeByClientRefParams) (BranchAttendanceChange, error)
func (*Queries) GetBranchAttendanceEvent ¶
func (*Queries) GetBranchAttendanceEventByClientRef ¶
func (q *Queries) GetBranchAttendanceEventByClientRef(ctx context.Context, arg GetBranchAttendanceEventByClientRefParams) (BranchAttendanceEvent, error)
func (*Queries) GetBranchByCode ¶
func (*Queries) GetBranchByCodeExcluding ¶
func (q *Queries) GetBranchByCodeExcluding(ctx context.Context, arg GetBranchByCodeExcludingParams) (Branch, error)
Resolves a till's chosen transfer destination by branch code, refusing a branch naming itself as its own destination.
func (*Queries) GetBranchCommand ¶
func (*Queries) GetBranchExpense ¶
func (*Queries) GetBranchExpenseByClientRef ¶
func (q *Queries) GetBranchExpenseByClientRef(ctx context.Context, arg GetBranchExpenseByClientRefParams) (BranchExpense, error)
func (*Queries) GetBranchExpenseImage ¶
func (*Queries) GetBranchExpenseUploadTokenByToken ¶
func (*Queries) GetBranchInvoice ¶
func (*Queries) GetBranchInvoiceByClientRef ¶
func (q *Queries) GetBranchInvoiceByClientRef(ctx context.Context, arg GetBranchInvoiceByClientRefParams) (BranchInvoice, error)
func (*Queries) GetBranchInvoiceByCode ¶ added in v1.1.0
func (q *Queries) GetBranchInvoiceByCode(ctx context.Context, arg GetBranchInvoiceByCodeParams) (BranchInvoice, error)
The sale a WhatsApp message was about (whatsapp_conversation.go).
func (*Queries) GetBranchInvoiceSettlement ¶ added in v1.1.0
func (*Queries) GetBranchInvoiceSettlementByClientRef ¶
func (q *Queries) GetBranchInvoiceSettlementByClientRef(ctx context.Context, arg GetBranchInvoiceSettlementByClientRefParams) (BranchInvoiceSettlement, error)
func (*Queries) GetBranchLoanByClientRef ¶
func (*Queries) GetBranchRegister ¶
func (*Queries) GetBranchRegisterByCode ¶
func (*Queries) GetBranchSettings ¶
func (*Queries) GetBranchShift ¶
func (*Queries) GetBranchShiftByClientRef ¶
func (q *Queries) GetBranchShiftByClientRef(ctx context.Context, arg GetBranchShiftByClientRefParams) (BranchShift, error)
func (*Queries) GetBranchShiftReceiptImage ¶
func (*Queries) GetBranchShiftReceiptImageForShift ¶
func (*Queries) GetBranchShiftUploadTokenByToken ¶
func (*Queries) GetBranchSyncConflict ¶
func (*Queries) GetBranchTarget ¶
func (*Queries) GetBranchTargetBySeriesAndStart ¶
func (q *Queries) GetBranchTargetBySeriesAndStart(ctx context.Context, arg GetBranchTargetBySeriesAndStartParams) (BranchTarget, error)
func (*Queries) GetBranchTargetSeries ¶
func (*Queries) GetBranchTransferByClientRef ¶
func (*Queries) GetBranchTransferUploadTokenByToken ¶
func (*Queries) GetBranchUser ¶
func (*Queries) GetBranchVisitorEventByClientRef ¶
func (q *Queries) GetBranchVisitorEventByClientRef(ctx context.Context, arg GetBranchVisitorEventByClientRefParams) (BranchVisitorEvent, error)
func (*Queries) GetCashbox ¶
func (*Queries) GetCashboxAccount ¶
func (*Queries) GetCashboxAccountBalance ¶
func (q *Queries) GetCashboxAccountBalance(ctx context.Context, arg GetCashboxAccountBalanceParams) (ShiftsAccountsBalance, error)
func (*Queries) GetClientByPhone ¶
func (*Queries) GetClientByUID ¶
Shared-identity (uid) queries for branch sync. See 000093_sync_uid.up.sql.
func (*Queries) GetClientHomeBranch ¶
func (*Queries) GetClientLink ¶
func (*Queries) GetClientProfileStats ¶
func (*Queries) GetColorByName ¶
func (*Queries) GetCouponCategory ¶
func (*Queries) GetCouponList ¶
func (*Queries) GetCouponType ¶
func (*Queries) GetCurrency ¶
func (*Queries) GetDefaultBranchSettings ¶
func (q *Queries) GetDefaultBranchSettings(ctx context.Context) (DefaultBranchSetting, error)
func (*Queries) GetDefaultCurrency ¶
func (*Queries) GetDefaultDiscountForVariant ¶
func (*Queries) GetDefaultDiscountList ¶
func (q *Queries) GetDefaultDiscountList(ctx context.Context) (DiscountList, error)
func (*Queries) GetDefaultInvoiceType ¶
func (q *Queries) GetDefaultInvoiceType(ctx context.Context) (InvoiceType, error)
func (*Queries) GetDefaultPriceForVariant ¶
func (q *Queries) GetDefaultPriceForVariant(ctx context.Context, productVariantID int64) (int64, error)
Branch-independent price, for the contexts that have no branch to speak of: printed labels, stock listings, head-office reporting.
func (*Queries) GetDefaultPriceList ¶
func (*Queries) GetDiscountList ¶
func (*Queries) GetDiscountListBranch ¶
func (*Queries) GetDiscountListByUID ¶
func (*Queries) GetEmailResendAPIKey ¶ added in v1.1.0
func (*Queries) GetEmailSchedule ¶ added in v1.1.0
func (*Queries) GetEmailSettings ¶ added in v1.1.0
func (q *Queries) GetEmailSettings(ctx context.Context) (GetEmailSettingsRow, error)
func (*Queries) GetEmployee ¶
func (*Queries) GetExpense ¶
func (*Queries) GetExpenseCategory ¶
func (*Queries) GetFirstActiveVariantBarcodeByCode ¶ added in v1.1.3
func (q *Queries) GetFirstActiveVariantBarcodeByCode(ctx context.Context, code string) (GetFirstActiveVariantBarcodeByCodeRow, error)
One representative barcode per product code, for linking an external sales import's line (which only ever has the product code, not a specific color/size) to a real product_variants row -- see api/product_cost_import.go's sibling, the invoice line-linking script. Picks the lowest-id active variant; which exact variant doesn't matter for revenue/cost attribution, only that the line resolves to the right product instead of staying an unlinked placeholder.
func (*Queries) GetInventory ¶
func (*Queries) GetInventoryByName ¶
func (*Queries) GetInventoryStock ¶
func (q *Queries) GetInventoryStock(ctx context.Context, arg GetInventoryStockParams) (InventoryStock, error)
--------------------------------------------------------------------------- Per-variant stock: cached on-hand quantity + moving-average cost. ---------------------------------------------------------------------------
func (*Queries) GetInvoice ¶
func (*Queries) GetInvoiceType ¶
func (*Queries) GetLoanCategory ¶
func (*Queries) GetLoanImage ¶ added in v1.1.0
func (*Queries) GetLoanPayment ¶
func (*Queries) GetLoanUploadTokenByToken ¶ added in v1.1.0
func (*Queries) GetLowStockSummary ¶
func (q *Queries) GetLowStockSummary(ctx context.Context) (GetLowStockSummaryRow, error)
Counts across all active, alert-enabled products, ignoring search -- backs the summary cards, which should reflect the whole picture even while the table below is filtered.
func (*Queries) GetNextBarcodeItemValue ¶
func (*Queries) GetPriceList ¶
func (*Queries) GetPriceListBranch ¶
func (*Queries) GetPriceListByUID ¶
func (*Queries) GetProduct ¶
func (*Queries) GetProductAttributeValue ¶
func (q *Queries) GetProductAttributeValue(ctx context.Context, arg GetProductAttributeValueParams) (ProductsAttribute, error)
func (*Queries) GetProductAttributes ¶
func (*Queries) GetProductByCode ¶
-- name: CreatePriceList :one INSERT INTO price_lists (
name, is_active, is_default, valid_from, valid_to
) VALUES (
$1, $2, $3, $4, $5
) RETURNING *; -- name: ListPriceLists :many SELECT * FROM price_lists ORDER BY name LIMIT $1 OFFSET $2; -- name: UpdatePriceList :exec UPDATE price_lists
SET name = $2, is_active = $3, is_default = $4, valid_from = $5, valid_to = $6
WHERE id = $1; -- name: CreateProductPrice :one INSERT INTO price_list_items (
price_list_id, product_id, price
) VALUES (
$1, $2, $3
) RETURNING *; -- name: UpdateProductPrice :exec UPDATE price_list_items
SET price = $3
WHERE product_id = $1 AND price_list_id = $2; -- name: CreateDiscountList :one INSERT INTO discount_lists (
name, is_active, is_default, valid_from, valid_to
) VALUES (
$1, $2, $3, $4, $5
) RETURNING *; -- name: ListDiscountLists :many SELECT * FROM discount_lists ORDER BY name LIMIT $1 OFFSET $2; -- name: UpdateDiscountList :exec UPDATE price_lists
SET name = $2, is_active = $3, is_default = $4, valid_from = $5, valid_to = $6
WHERE id = $1; -- name: UnsetDefaultPriceList :exec UPDATE price_lists
SET is_default = false
WHERE is_default = true; -- name: CreateProductDiscount :one INSERT INTO discount_list_items (
discount_list_id, product_id, discount
) VALUES (
$1, $2, $3
) RETURNING *; -- name: UpdateProductDiscount :exec UPDATE discount_list_items
SET discount = $3
WHERE product_id = $1 AND discount_list_id = $2;
func (*Queries) GetProductByName ¶
func (*Queries) GetProductCategory ¶
func (*Queries) GetProductCategoryByName ¶
func (*Queries) GetProductSupplier ¶
func (q *Queries) GetProductSupplier(ctx context.Context, arg GetProductSupplierParams) (ProductSupplier, error)
func (*Queries) GetProductVariant ¶
func (*Queries) GetProductVariantByBarcode ¶
func (*Queries) GetProductVariantByUID ¶
func (*Queries) GetPurchase ¶
func (*Queries) GetRecurringExpense ¶
func (*Queries) GetRegisterTargetRelease ¶
func (*Queries) GetReturnInvoice ¶
func (*Queries) GetReviewSettings ¶ added in v1.1.0
func (q *Queries) GetReviewSettings(ctx context.Context) (GetReviewSettingsRow, error)
Review links in the post-sale WhatsApp message and the Google data behind the Reviews page (api/review_link.go, api/google_places.go).
func (*Queries) GetSaleOption ¶ added in v1.1.6
func (*Queries) GetSalesInvoice ¶
func (*Queries) GetSalesperson ¶
func (*Queries) GetSalespersonByAttendanceID ¶ added in v1.1.0
func (q *Queries) GetSalespersonByAttendanceID(ctx context.Context, arg GetSalespersonByAttendanceIDParams) (Salesperson, error)
Another salesperson of the same branch already using this device number.
func (*Queries) GetSecuritySettings ¶ added in v1.1.0
func (q *Queries) GetSecuritySettings(ctx context.Context) (SecuritySetting, error)
func (*Queries) GetSession ¶
func (*Queries) GetSizeByName ¶
func (*Queries) GetSlowMoverSummary ¶
func (q *Queries) GetSlowMoverSummary(ctx context.Context) (GetSlowMoverSummaryRow, error)
func (*Queries) GetStockCount ¶
func (*Queries) GetStockHealthOverview ¶
func (q *Queries) GetStockHealthOverview(ctx context.Context) (GetStockHealthOverviewRow, error)
Inventory health: overall days-of-inventory (on-hand / trailing daily sell-through), total inventory value at moving-average cost, and the same breakdown per inventory location.
func (*Queries) GetSupplier ¶
func (*Queries) GetTransfer ¶
func (*Queries) GetUnknownItemImage ¶ added in v1.1.1
func (*Queries) GetUnknownItemSessionByRef ¶ added in v1.1.1
func (q *Queries) GetUnknownItemSessionByRef(ctx context.Context, arg GetUnknownItemSessionByRefParams) (UnknownItemSession, error)
func (*Queries) GetUnknownItemSessionByToken ¶ added in v1.1.1
func (*Queries) GetUnknownItemSlotByRef ¶ added in v1.1.1
func (q *Queries) GetUnknownItemSlotByRef(ctx context.Context, arg GetUnknownItemSlotByRefParams) (UnknownItemSlot, error)
func (*Queries) GetUnknownItemSlotForResolve ¶ added in v1.1.1
func (*Queries) GetUserAccess ¶
One row per permission of the user's role, or a single row with NULL section for a role that has none (an admin, or a brand-new role). No rows at all means the user no longer exists.
func (*Queries) GetUserByUsername ¶
func (*Queries) GetVariantDiscountFromList ¶
func (q *Queries) GetVariantDiscountFromList(ctx context.Context, arg GetVariantDiscountFromListParams) (DiscountListItem, error)
func (*Queries) GetVariantForLabel ¶
func (*Queries) GetVariantPriceFromList ¶
func (q *Queries) GetVariantPriceFromList(ctx context.Context, arg GetVariantPriceFromListParams) (PriceListItem, error)
func (*Queries) GetVariantTotalOnHand ¶
func (*Queries) GetWarehouseTreemapData ¶
func (q *Queries) GetWarehouseTreemapData(ctx context.Context, inventoryID sql.NullInt64) ([]GetWarehouseTreemapDataRow, error)
Feeds the Warehouses Treemap: on-hand quantity per product, grouped by product_categories and by inventory. The inner join on product_categories means only products we've explicitly categorized show up here -- ordinary POS-sellable products with no category_id are never pulled into this view.
func (*Queries) GetWhatsAppChatMessageMedia ¶ added in v1.1.1
func (*Queries) GetWhatsAppMessageByReviewCode ¶ added in v1.1.0
func (*Queries) GetWhatsAppMessageCost ¶ added in v1.1.0
func (*Queries) GetWhatsAppMessageWithBranch ¶ added in v1.1.0
func (*Queries) GetWhatsAppNumber ¶ added in v1.1.0
func (*Queries) GetWhatsAppPollReplyMedia ¶ added in v1.1.0
func (q *Queries) GetWhatsAppPollReplyMedia(ctx context.Context, id int64) (GetWhatsAppPollReplyMediaRow, error)
Where a reply's media is kept: the bridge number that got it, and its id.
func (*Queries) GetWhatsAppSenderSettings ¶ added in v1.1.0
func (q *Queries) GetWhatsAppSenderSettings(ctx context.Context) (GetWhatsAppSenderSettingsRow, error)
Sending post-sale messages from our own numbers through the WhatsApp bridge (api/whatsapp_bridge.go).
func (*Queries) GetWhatsAppSettings ¶
func (q *Queries) GetWhatsAppSettings(ctx context.Context) (GetWhatsAppSettingsRow, error)
func (*Queries) GooglePlaceSnapshotBefore ¶ added in v1.1.0
func (q *Queries) GooglePlaceSnapshotBefore(ctx context.Context, arg GooglePlaceSnapshotBeforeParams) (GooglePlaceSnapshot, error)
The place as it stood at `at`: its last snapshot taken before then.
func (*Queries) HomeActivityFeed ¶ added in v1.1.0
func (q *Queries) HomeActivityFeed(ctx context.Context, arg HomeActivityFeedParams) ([]HomeActivityFeedRow, error)
The home page's "Recent activity" feed: the same rows as DashboardActivitiesList (every kind of branch sync, newest received first, hidden branches and registers left out), but paged by a keyset cursor instead of a date window and an offset, and without the windowed total. Each page is the next page_size rows after (before_at, before_activity, before_id) -- the last row the feed already has -- so the per-table received_at indexes do the work and a page costs the same however far down the feed is scrolled. The salesperson colour is looked up for the page's rows only.
func (*Queries) IncrementInvoicesIndex ¶
func (*Queries) InheritBranchInvoiceCancellation ¶ added in v1.1.0
A sale can reach kashi after the return that cancelled it (a resync pushes whatever kashi is missing, in no guaranteed order); it picks up the mark the cancellation already left waiting for it.
func (*Queries) InsertBranchQuickAccessItem ¶
func (q *Queries) InsertBranchQuickAccessItem(ctx context.Context, arg InsertBranchQuickAccessItemParams) error
func (*Queries) LastWhatsAppSentAt ¶ added in v1.1.0
When this phone was last actually messaged; no rows when never.
func (*Queries) LatestGooglePlaceSnapshot ¶ added in v1.1.0
func (*Queries) LinkUnknownItemSession ¶ added in v1.1.1
func (q *Queries) LinkUnknownItemSession(ctx context.Context, arg LinkUnknownItemSessionParams) error
func (*Queries) ListActiveBranchRegisterIDs ¶
func (*Queries) ListActiveBranchTargetSeries ¶
func (q *Queries) ListActiveBranchTargetSeries(ctx context.Context) ([]BranchTargetSeries, error)
func (*Queries) ListActiveIPBans ¶ added in v1.1.0
func (*Queries) ListAdminActivities ¶
func (q *Queries) ListAdminActivities(ctx context.Context, arg ListAdminActivitiesParams) ([]ListAdminActivitiesRow, error)
User and role changes are admin housekeeping, kept out of the feed.
func (*Queries) ListAllAttributeValues ¶
func (q *Queries) ListAllAttributeValues(ctx context.Context) ([]ListAllAttributeValuesRow, error)
func (*Queries) ListAllBranchRegisters ¶
func (q *Queries) ListAllBranchRegisters(ctx context.Context) ([]BranchRegister, error)
func (*Queries) ListAllCashboxAccounts ¶
func (q *Queries) ListAllCashboxAccounts(ctx context.Context) ([]CashboxAccount, error)
func (*Queries) ListAllClientPhones ¶ added in v1.1.3
func (q *Queries) ListAllClientPhones(ctx context.Context) ([]ListAllClientPhonesRow, error)
Every client's raw stored phone, for the one-off admin normalize job (api/client_phone_cleanup.go) -- unlike ListClients this is never paged, since the job needs every row in one pass to detect collisions.
func (*Queries) ListAppReleases ¶
func (q *Queries) ListAppReleases(ctx context.Context) ([]ListAppReleasesRow, error)
Newest first, with how many active registers run each release and how many are told to.
func (*Queries) ListAppUpdateEvents ¶
func (*Queries) ListAssetCategories ¶
func (q *Queries) ListAssetCategories(ctx context.Context) ([]AssetCategory, error)
func (*Queries) ListAssetsPage ¶
func (*Queries) ListAttributeValuesPage ¶
func (q *Queries) ListAttributeValuesPage(ctx context.Context, arg ListAttributeValuesPageParams) ([]ListAttributeValuesPageRow, error)
func (*Queries) ListAttributes ¶
func (*Queries) ListAuditLogs ¶
func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
func (*Queries) ListAutoDeletableUnknownItemImages ¶ added in v1.1.1
func (q *Queries) ListAutoDeletableUnknownItemImages(ctx context.Context, arg ListAutoDeletableUnknownItemImagesParams) ([]ListAutoDeletableUnknownItemImagesRow, error)
What the daily clean-up removes: pictures whose units were all matched before resolved_before, and pictures of checkouts that never became a sale and whose link expired before abandoned_before.
func (*Queries) ListAvailableBatchItemsForVariant ¶
func (q *Queries) ListAvailableBatchItemsForVariant(ctx context.Context, variantID int64) ([]BatchItem, error)
FIFO order: oldest batch (by receipt/creation date) first. Walked by applyStockMovement to decide which batch(es) a sold unit debits. FOR UPDATE so two sales racing on the same variant can't both allocate the same remaining units.
func (*Queries) ListBatchItemsStats ¶
func (q *Queries) ListBatchItemsStats(ctx context.Context, batchID int64) ([]ListBatchItemsStatsRow, error)
Per-item numbers for the batch's "Products" tab, scoped to this batch's own units via FIFO-tagged stock_movements: remaining_quantity is exactly what's left of this batch unsold, and quantity_sold/revenue are summed only from sale movements this batch's FIFO consumption actually produced (revenue prorated off the source invoice line's price/unit).
func (*Queries) ListBatches ¶
func (q *Queries) ListBatches(ctx context.Context, arg ListBatchesParams) ([]ListBatchesRow, error)
func (*Queries) ListBranchAttendanceChanges ¶
func (q *Queries) ListBranchAttendanceChanges(ctx context.Context, arg ListBranchAttendanceChangesParams) ([]BranchAttendanceChange, error)
func (*Queries) ListBranchAttendanceEvents ¶
func (q *Queries) ListBranchAttendanceEvents(ctx context.Context, arg ListBranchAttendanceEventsParams) ([]BranchAttendanceEvent, error)
Newest punch first by its own local date/time, not insertion order: a backfilled import gets the newest ids but holds the oldest punches. A punch an approved change replaced or deleted (removed_at) is left out; it stays in the table for the audit trail.
func (*Queries) ListBranchAttendanceEventsInRange ¶ added in v1.1.0
func (q *Queries) ListBranchAttendanceEventsInRange(ctx context.Context, arg ListBranchAttendanceEventsInRangeParams) ([]BranchAttendanceEvent, error)
Every live punch between two dates (inclusive) for the timesheet views, which pair each person's IN/OUT punches per day. event_date is the device's own YYYY-MM-DD text, so a plain text comparison orders it. Capped as a guard against an all-branches, all-time request.
func (*Queries) ListBranchClientUIDs ¶
func (q *Queries) ListBranchClientUIDs(ctx context.Context, registerID int64) ([]ListBranchClientUIDsRow, error)
Adoption: which central client each of this register's local client ids is linked to, so a till can stamp the right uid without guessing by phone.
func (*Queries) ListBranchCommands ¶
func (q *Queries) ListBranchCommands(ctx context.Context, arg ListBranchCommandsParams) ([]ListBranchCommandsRow, error)
func (*Queries) ListBranchCommandsPage ¶
func (q *Queries) ListBranchCommandsPage(ctx context.Context, arg ListBranchCommandsPageParams) ([]ListBranchCommandsPageRow, error)
The Commands page: every branch (branch_id 0) or one, optionally one register / status / type, newest first.
func (*Queries) ListBranchExpenseHistoryForSync ¶
func (q *Queries) ListBranchExpenseHistoryForSync(ctx context.Context, arg ListBranchExpenseHistoryForSyncParams) ([]ListBranchExpenseHistoryForSyncRow, error)
func (*Queries) ListBranchExpenseImages ¶
func (q *Queries) ListBranchExpenseImages(ctx context.Context, arg ListBranchExpenseImagesParams) ([]ListBranchExpenseImagesRow, error)
Storage-explorer feed: every uploaded image, newest first, joined with its expense and branch so the admin UI never needs a second round trip per row.
func (*Queries) ListBranchExpenseImagesForExpense ¶
func (*Queries) ListBranchExpenses ¶
func (q *Queries) ListBranchExpenses(ctx context.Context, arg ListBranchExpensesParams) ([]BranchExpense, error)
sqlc.narg(branch_id) is nullable: NULL means "all branches", matching ListBranchInvoices' admin-filter convention. search ” means no filter.
func (*Queries) ListBranchInvoiceCouponCodesForHistory ¶
func (q *Queries) ListBranchInvoiceCouponCodesForHistory(ctx context.Context, arg ListBranchInvoiceCouponCodesForHistoryParams) ([]ListBranchInvoiceCouponCodesForHistoryRow, error)
At most one coupon redemption per invoice (see CreateBranchInvoiceTx's own comment) -- the code a redeemed coupon carries for the given invoices' client_refs, so the branch can reattach it to whichever payment line it recognizes as its own coupon-settlement placeholder account. Coupon codes are never persisted on branch_invoice_payments itself (see CreateBranchInvoiceTx: a coupon payment only ever calls RedeemCoupon), so this is the only way to recover which line was the coupon.
func (*Queries) ListBranchInvoiceHistoryForSync ¶
func (q *Queries) ListBranchInvoiceHistoryForSync(ctx context.Context, arg ListBranchInvoiceHistoryForSyncParams) ([]BranchInvoice, error)
--------------------------------------------------------------------------- Branch-scoped historical read-back (see api/branch_catchup.go's branchSyncChanges "branch_invoice_history"/"branch_expense_history"/ "branch_loan_history"/"branch_shift_history" cases). Lets a branch pull its OWN previously-submitted invoices/expenses/loans/shift-closes back down -- e.g. re-provisioning a wiped till for a branch that already has real history on kashi. branch_id always comes from the authenticated branch (ctx.MustGet(branchIDKey)), never a request parameter, so a branch can only ever pull its own data. Keyset-paginated on (received_at, id), same cursor shape as ListBranchStockForSync.
Invoices and shift closes are per register: a re-provisioned till gets back only what it itself sold and closed, so its invoice numbering and local shift ids carry on without colliding with its branch's other tills. Expenses and loans aren't tracked per register and stay branch-wide. ---------------------------------------------------------------------------
func (*Queries) ListBranchInvoiceItems ¶
func (q *Queries) ListBranchInvoiceItems(ctx context.Context, branchInvoiceID int64) ([]ListBranchInvoiceItemsRow, error)
With the product each line is, for the admin views: the till only sends its own local product id, which means nothing here, so the name comes from the variant product_uid resolves to (blank for an old line that never resolved -- see resolveVariantByUIDOrBarcode).
func (*Queries) ListBranchInvoiceItemsForHistory ¶
func (q *Queries) ListBranchInvoiceItemsForHistory(ctx context.Context, branchInvoiceIds []int64) ([]ListBranchInvoiceItemsForHistoryRow, error)
Items for a whole page of invoices at once, batched by id -- distinct from ListBranchInvoiceItems (branch_invoice.sql), which is the single-invoice admin detail view. resolved_barcode comes from product_variants via product_uid (nullable: an item pushed before product_uid existed, and whose barcode never resolved to a variant at push time either, has neither -- see resolveVariantByUIDOrBarcode in tx_branch_invoice.go).
func (*Queries) ListBranchInvoiceItemsNamed ¶ added in v1.1.0
func (q *Queries) ListBranchInvoiceItemsNamed(ctx context.Context, branchInvoiceID int64) ([]ListBranchInvoiceItemsNamedRow, error)
An invoice's lines with the product each one sold, for the Recent activity details dialog. A line whose product_uid never resolved to a variant keeps an empty name.
func (*Queries) ListBranchInvoicePayments ¶
func (*Queries) ListBranchInvoicePaymentsForHistory ¶
func (*Queries) ListBranchInvoiceSettlementPayments ¶
func (*Queries) ListBranchInvoiceSettlements ¶
func (q *Queries) ListBranchInvoiceSettlements(ctx context.Context, arg ListBranchInvoiceSettlementsParams) ([]BranchInvoiceSettlement, error)
func (*Queries) ListBranchInvoices ¶
func (q *Queries) ListBranchInvoices(ctx context.Context, arg ListBranchInvoicesParams) ([]BranchInvoice, error)
sqlc.narg(branch_id) is nullable: NULL means "all branches", matching how the admin UI's branch filter works (a dropdown with an "All branches" option, not a required selection).
func (*Queries) ListBranchInvoicesPage ¶
func (q *Queries) ListBranchInvoicesPage(ctx context.Context, arg ListBranchInvoicesPageParams) ([]BranchInvoice, error)
func (*Queries) ListBranchLoanHistoryForSync ¶
func (q *Queries) ListBranchLoanHistoryForSync(ctx context.Context, arg ListBranchLoanHistoryForSyncParams) ([]ListBranchLoanHistoryForSyncRow, error)
func (*Queries) ListBranchPlaceIDs ¶ added in v1.1.0
func (q *Queries) ListBranchPlaceIDs(ctx context.Context) ([]ListBranchPlaceIDsRow, error)
func (*Queries) ListBranchProductRevenue ¶
func (q *Queries) ListBranchProductRevenue(ctx context.Context, arg ListBranchProductRevenueParams) ([]ListBranchProductRevenueRow, error)
--------------------------------------------------------------------------- Branch (kashi-pos) sales. branch_invoice_items itself carries no product link (branch_product_id is a branch-local id, not an FK -- see 000025_create_branch_invoices.up.sql), so it can't be the source. But CreateBranchInvoiceTx (tx_branch_invoice.go) already resolves each line's barcode to a real product_variants row at sync time and records the sale as a stock_movements row (reason='sale', reference_type='branch_invoice', inventory_id = the branch's own store inventory) purely to decrement central stock -- that ledger is the only place a branch sale is linked to a real product. It carries quantity but no transaction price, so revenue here is an ESTIMATE: each unit priced at the variant's *current* catalog price (its entry in the default price list -- see the variant_default_prices view in 000094), not whatever kashi-pos actually charged at checkout (which may have included a since-changed price or a branch-side discount neither table records at this granularity). A line whose barcode never resolved (old kashi-pos build, unknown barcode, or a historical backfill -- see CreateBranchInvoiceTx's Historical branch) never got a stock_movements row at all and so is silently absent here, same as it's absent from central stock. ---------------------------------------------------------------------------
func (*Queries) ListBranchProductRevenueDaily ¶
func (q *Queries) ListBranchProductRevenueDaily(ctx context.Context, arg ListBranchProductRevenueDailyParams) ([]ListBranchProductRevenueDailyRow, error)
Same scope/filters/estimate caveat as ListBranchProductRevenue, rolled up by local calendar day -- the trend line for the kashi-pos tab.
func (*Queries) ListBranchQuickAccessItems ¶
func (q *Queries) ListBranchQuickAccessItems(ctx context.Context, branchID int64) ([]ListBranchQuickAccessItemsRow, error)
A branch's central Quick Access list, in card order, with enough of each product to show it in the admin editor; tills only use uid/position/colours.
func (*Queries) ListBranchRegisters ¶
func (*Queries) ListBranchRegistersByIDs ¶
func (*Queries) ListBranchRevenueByBranch ¶
func (q *Queries) ListBranchRevenueByBranch(ctx context.Context, arg ListBranchRevenueByBranchParams) ([]ListBranchRevenueByBranchRow, error)
Same scope/filters/estimate caveat as ListBranchProductRevenue, rolled up by branch instead of by product -- backs the "revenue by branch" chart, deliberately with no branch_id filter of its own (that would defeat the point of a per-branch breakdown).
func (*Queries) ListBranchSalesDaysRange ¶
func (q *Queries) ListBranchSalesDaysRange(ctx context.Context, arg ListBranchSalesDaysRangeParams) ([]ListBranchSalesDaysRangeRow, error)
Per (branch, local day) sales-invoice count and gross sales revenue in an inclusive "YYYY-MM-DD" range, oldest first. Deliberately shaped like ListBranchVisitorDaysRange so the Footfall page can line footfall up against sales for the same window -- conversion rate, average ticket -- with one extra request and no per-day query.
Only kind = 'sales' counts: a return or exchange isn't a walk-in turning into a buyer, and its grand_total carries the branch's own signed refund/top-up convention (see ListDailyIncome) which would distort an "average sale" figure. The occurred_at range is compared against plain date bounds (not AT TIME ZONE per row) so idx_branch_invoices_occurred_at stays usable, same reasoning as ListDailyIncome.
func (*Queries) ListBranchShiftHistoryForSync ¶
func (q *Queries) ListBranchShiftHistoryForSync(ctx context.Context, arg ListBranchShiftHistoryForSyncParams) ([]BranchShift, error)
func (*Queries) ListBranchShiftReceiptImages ¶
func (q *Queries) ListBranchShiftReceiptImages(ctx context.Context, arg ListBranchShiftReceiptImagesParams) ([]ListBranchShiftReceiptImagesRow, error)
Storage-explorer feed: every uploaded close-shift receipt photo, newest first, joined with its shift and branch so the admin UI never needs a second round trip per row. Mirrors ListBranchExpenseImages.
func (*Queries) ListBranchShifts ¶
func (q *Queries) ListBranchShifts(ctx context.Context, arg ListBranchShiftsParams) ([]ListBranchShiftsRow, error)
sqlc.narg(branch_id) is nullable: NULL means "all branches", matching ListBranchExpenses' admin-filter convention. has_receipt_image lets the admin Shifts page show a per-row indicator without an extra request per shift (see branch_shift_receipt_images / api/branch_shift_receipt_image.go).
func (*Queries) ListBranchStockForSync ¶
func (q *Queries) ListBranchStockForSync(ctx context.Context, arg ListBranchStockForSyncParams) ([]ListBranchStockForSyncRow, error)
--------------------------------------------------------------------------- Cross-branch stock visibility: every OTHER branch's on-hand quantity and resolved selling price for a variant, so a till can search what a different branch is carrying. Keyset-paginated on inventory_stock's surrogate id (000101 -- the table's real key, (inventory_id, variant_id), has no single ordering column), same cursor shape as ListProductVariantsForSyncPaged. ---------------------------------------------------------------------------
func (*Queries) ListBranchSyncConflictsPage ¶
func (q *Queries) ListBranchSyncConflictsPage(ctx context.Context, arg ListBranchSyncConflictsPageParams) ([]ListBranchSyncConflictsPageRow, error)
func (*Queries) ListBranchTargetSeriesForBranch ¶
func (*Queries) ListBranchTargetsForBranch ¶
func (*Queries) ListBranchTargetsProgress ¶
func (q *Queries) ListBranchTargetsProgress(ctx context.Context, arg ListBranchTargetsProgressParams) ([]ListBranchTargetsProgressRow, error)
Branch-wide progress for a till's target bars: what every register of this branch has sold in each live target's range, as kashi has received it. The till adds its own not-yet-synced sales on top.
func (*Queries) ListBranchTargetsUpdatedSince ¶
func (q *Queries) ListBranchTargetsUpdatedSince(ctx context.Context, arg ListBranchTargetsUpdatedSinceParams) ([]BranchTarget, error)
func (*Queries) ListBranchTransfersUpdatedSince ¶
func (q *Queries) ListBranchTransfersUpdatedSince(ctx context.Context, arg ListBranchTransfersUpdatedSinceParams) ([]Transfer, error)
The till's own poll: what happened to the requests it made -- see approveTransfer/rejectTransfer, which both bump updated_at.
func (*Queries) ListBranchUsersForBranch ¶
func (*Queries) ListBranchUsersUpdatedSince ¶
func (q *Queries) ListBranchUsersUpdatedSince(ctx context.Context, arg ListBranchUsersUpdatedSinceParams) ([]BranchUser, error)
Branch-scoped catch-up feed, same contract as ListSalespersonsUpdatedSince.
func (*Queries) ListBranchVisitorDays ¶
func (q *Queries) ListBranchVisitorDays(ctx context.Context, arg ListBranchVisitorDaysParams) ([]ListBranchVisitorDaysRow, error)
One row per (branch, local day): gross customers-in vs customers-out, newest day first. sqlc.narg(branch_id) NULL means "all branches", matching ListBranchShifts' admin-filter convention.
func (*Queries) ListBranchVisitorDaysRange ¶
func (q *Queries) ListBranchVisitorDaysRange(ctx context.Context, arg ListBranchVisitorDaysRangeParams) ([]ListBranchVisitorDaysRangeRow, error)
Every (branch, day) rollup within an inclusive "YYYY-MM-DD" day range, oldest first. No pagination: footfall data is one row per branch per day, so even a year across every branch is a small result the Footfall page slices into months / branch comparisons / weekday profiles client-side.
func (*Queries) ListBranchWhatsAppNumbers ¶ added in v1.1.0
func (q *Queries) ListBranchWhatsAppNumbers(ctx context.Context) ([]ListBranchWhatsAppNumbersRow, error)
func (*Queries) ListBranches ¶
func (*Queries) ListBranchesForDiscountList ¶
func (*Queries) ListBranchesForPriceList ¶
func (*Queries) ListBranchesForSync ¶
func (q *Queries) ListBranchesForSync(ctx context.Context, id int64) ([]ListBranchesForSyncRow, error)
Whole set, small table like currencies -- a till needs to see a branch go inactive (and so disappear from its destination picker), which an updated-since delta can't express. Excludes the requesting branch itself: it can't transfer to itself.
func (*Queries) ListCalendarEvents ¶
func (q *Queries) ListCalendarEvents(ctx context.Context) ([]CalendarEvent, error)
func (*Queries) ListCashboxAccountOverridesForBranch ¶
func (q *Queries) ListCashboxAccountOverridesForBranch(ctx context.Context, branchID int64) ([]ListCashboxAccountOverridesForBranchRow, error)
The admin view: every central method with this branch's override state, so the UI can show what is inherited and what is explicitly set. Unlike the sync query this keeps disabled rows -- switching one back on is the whole point of the screen.
func (*Queries) ListCashboxAccounts ¶
func (q *Queries) ListCashboxAccounts(ctx context.Context, arg ListCashboxAccountsParams) ([]CashboxAccount, error)
func (*Queries) ListCashboxAccountsForBranchSync ¶
func (q *Queries) ListCashboxAccountsForBranchSync(ctx context.Context, branchID int64) ([]ListCashboxAccountsForBranchSyncRow, error)
What one branch's tills should actually show: the central set with that branch's overrides folded in, and the methods it switched off left out entirely. Absence is the signal kashi-pos reconciles on, so an excluded method needs no flag of its own -- not sending it is what deactivates it at the till (see reconcileCashboxAccounts in kashi-pos).
COALESCE per column rather than per row: an override that only sets sort_order keeps inheriting central's color and currency, so a later central color change still reaches a branch that reordered its buttons.
func (*Queries) ListCashboxAccountsForSync ¶
func (q *Queries) ListCashboxAccountsForSync(ctx context.Context) ([]CashboxAccount, error)
The whole set, not a "changed since" delta. A branch has to be able to tell that kashi no longer has a payment method at all, and an incremental feed can only say what changed -- it has no way to say what is gone. Sending every row lets the till reconcile by absence, the same shape the price and discount lists use. The table is a handful of rows, so the cost is nil.
Inactive methods are left out on purpose: absence is what the till reconciles a deactivation on (see ListCashboxAccountsForBranchSync and reconcileCashboxAccounts in kashi-pos), so a centrally deactivated method reaches every branch the same way a deleted one would, without kashi-pos ever needing to know about is_active at all.
func (*Queries) ListCashboxAccountsUpdatedSince ¶
func (*Queries) ListCashboxes ¶
func (*Queries) ListClientMonthlySpend ¶
func (*Queries) ListClientPaymentMix ¶
func (*Queries) ListClientPhoneCountries ¶ added in v1.1.3
func (q *Queries) ListClientPhoneCountries(ctx context.Context) ([]ListClientPhoneCountriesRow, error)
Distinct countries actually present among clients' phones, for the clients page's country filter dropdown -- so it only ever offers a country that would return at least one result, instead of the full ~240-country ISO list.
func (*Queries) ListClientRecentInvoices ¶
func (*Queries) ListClientSyncIDs ¶
func (q *Queries) ListClientSyncIDs(ctx context.Context, arg ListClientSyncIDsParams) ([]ListClientSyncIDsRow, error)
Completeness check: every retail client's uid + updated_at, keyset-paged by uid. Inactive clients are included -- a till must learn they're inactive, not just stop hearing about them.
func (*Queries) ListClients ¶
sqlc.narg(client_type) is nullable: NULL means "all types" -- the admin clients page passes it when a Retail/Wholesale tab is selected, and omits it for a combined view if one is ever added.
func (*Queries) ListClientsByInvoiceCountCached ¶ added in v1.1.6
func (q *Queries) ListClientsByInvoiceCountCached(ctx context.Context, arg ListClientsByInvoiceCountCachedParams) ([]ListClientsByInvoiceCountCachedRow, error)
ListClientsBySpendingCached, ranked by invoice count.
func (*Queries) ListClientsByItemCountCached ¶ added in v1.1.6
func (q *Queries) ListClientsByItemCountCached(ctx context.Context, arg ListClientsByItemCountCachedParams) ([]ListClientsByItemCountCachedRow, error)
ListClientsBySpendingCached, ranked by item count.
func (*Queries) ListClientsBySpending ¶
func (q *Queries) ListClientsBySpending(ctx context.Context, arg ListClientsBySpendingParams) ([]ListClientsBySpendingRow, error)
Powers the clients "loyalty pyramid" + rest-of-clients table: every client ranked by total_spent, invoice_count, or item_count (chosen via sort_by -- see the ORDER BY at the bottom). Two sources feed each metric: kashi's own admin invoices (sales positive, returns negative -- invoices.grand_total is always stored as a positive magnitude regardless of kind, see ReturnInvoiceTx) and branch-reported sales (branch_invoices.grand_total, which already carries the correct net sign -- see ListDailyIncome). sqlc.arg(branch_ids) scopes to one branch's till (or several, via the branch_ids array; empty means every branch); central admin invoices aren't attributed to any branch, so they're excluded entirely once any branch is selected (an "All Branches" view is the only one where they belong). invoice_count/item_count follow the same all-or-selected-branches rule for consistency with total_spent. invoice_count/item_count are computed in the `ranked` CTE rather than as plain SELECT-list aliases so the ORDER BY's CASE expression can actually reference them: Postgres only resolves an output alias in ORDER BY when it's used bare, not when it's embedded in a larger expression (there it's looked up as an ordinary column instead, which fails since it isn't one of the FROM clause's columns). Wrapping in a CTE turns them into real columns of the derived table, so the CASE inside ORDER BY resolves fine.
func (*Queries) ListClientsBySpendingCached ¶ added in v1.1.6
func (q *Queries) ListClientsBySpendingCached(ctx context.Context, arg ListClientsBySpendingCachedParams) ([]ListClientsBySpendingCachedRow, error)
ListClientsBySpending for the unfiltered case (no branch, no dates, no first/returning): reads the client_spend cache instead of aggregating every invoice, so a page costs an index scan. Same ordering and the other filters (type, search, phone) as the live query. One query per sort, rather than a CASE in ORDER BY, so Postgres can read the top rows straight off that column's index. Every client has a client_spend row (see migration 197).
func (*Queries) ListClientsByUIDs ¶
func (*Queries) ListClientsForExport ¶ added in v1.1.1
func (q *Queries) ListClientsForExport(ctx context.Context, arg ListClientsForExportParams) ([]ListClientsForExportRow, error)
Feeds the clients CSV export: one row per (client, branch) for every client who bought something, so the caller can write a file per branch. A client "belongs" to a branch because a non-cancelled invoice there is theirs. The invoice's client is resolved by either identity a till has used: the shared client_uid (current), or the older (register, branch_client_id) client_links entry -- an invoice carrying only one of them still counts. branch_ids (empty = every branch) and the [date_from, date_to) window (either bound optional) narrow which invoices count; spend/invoice figures are for that same scope, not lifetime. Central admin invoices have no branch (branch_id 0) and are only included when no branch is selected, the same rule as ListClientsBySpending. With no branch and no date set, clients who never bought anything are listed too (branch_id 0, zero spend). A client is listed under every branch they bought from, not only their home branch (clients.branch_id, the first one); the home branch adds a zero-spend row when they have no purchases there. Cancelled and hidden-from-reports branch invoices are skipped as everywhere else, unless include_excluded is set. Home branch (clients.branch_id): a client is also listed under it when they haven't bought there in this scope, e.g. one imported with a branch and no sales yet. Only for an explicit branch pick and no dates, since zero spend can't match a date window; the same hidden-branch rule as purchases applies.
func (*Queries) ListClientsMissingPhoneCountry ¶ added in v1.1.6
func (q *Queries) ListClientsMissingPhoneCountry(ctx context.Context) ([]ListClientsMissingPhoneCountryRow, error)
Clients with no phone_country yet: ones a till created or edited before the sync path started filling it in. "nophone-..." placeholders aren't phone numbers, so they're left alone.
func (*Queries) ListClientsUpdatedSince ¶
func (q *Queries) ListClientsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Client, error)
Feeds the branch catch-up endpoint (see branch_catchup.go), same pattern as currencies/cashbox_accounts/products. Wholesale clients never appear here -- they're a central-office concept, not something a branch till should ever see in its client search. Converting an already-synced retail client to wholesale won't retract it from branches that already have it locally (no delete propagation exists for any synced entity today); acceptable since that conversion is expected to be rare.
func (*Queries) ListClientsUpdatedSincePaged ¶
func (q *Queries) ListClientsUpdatedSincePaged(ctx context.Context, arg ListClientsUpdatedSincePagedParams) ([]Client, error)
Keyset-paginated form of ListClientsUpdatedSince for a branch doing a full catch-up (cursor reset): ordered by (updated_at, id) so a page boundary that falls between two rows sharing an updated_at can't drop or repeat one. after_updated_at/after_id are the last row of the previous page (zero-time / 0 for the first page).
func (*Queries) ListClientsWithLoyalty ¶
func (q *Queries) ListClientsWithLoyalty(ctx context.Context, arg ListClientsWithLoyaltyParams) ([]ListClientsWithLoyaltyRow, error)
Same rows as ListClients, but with each branch's reported loyalty points (branch_invoices.loyalty_points_delta, via client_links) summed in alongside kashi's own admin-invoice points. Used by the admin clients page so the displayed balance isn't missing everything earned at a branch till.
func (*Queries) ListColorsPage ¶
func (*Queries) ListCouponCategories ¶
func (q *Queries) ListCouponCategories(ctx context.Context, scope sql.NullString) ([]CouponCategory, error)
func (*Queries) ListCouponLists ¶
func (q *Queries) ListCouponLists(ctx context.Context) ([]ListCouponListsRow, error)
func (*Queries) ListCouponTypes ¶
func (q *Queries) ListCouponTypes(ctx context.Context) ([]CouponType, error)
func (*Queries) ListCouponTypesUpdatedSince ¶
func (*Queries) ListCoupons ¶
func (q *Queries) ListCoupons(ctx context.Context, arg ListCouponsParams) ([]ListCouponsRow, error)
func (*Queries) ListCouponsUpdatedSince ¶
func (q *Queries) ListCouponsUpdatedSince(ctx context.Context, updatedAt time.Time) ([]Coupon, error)
Sent whole (every status, not just active): absence can't express "redeemed elsewhere" or "deactivated" to a till that already has the row, so the row itself carries the new status down. See ListPriceListsForBranchSync's comment in branch_sync_lists.go for the same reasoning.
func (*Queries) ListCurrencies ¶
page_size = 0 returns every currency (the CurrencySelect picker needs the whole list); any positive value pages. Order is always by code, so the picker and the paged table agree.
func (*Queries) ListCurrenciesForSync ¶
The whole set -- see ListCashboxAccountsForSync for why this is not a delta.
func (*Queries) ListCurrenciesUpdatedSince ¶
func (*Queries) ListDailyIncome ¶
func (q *Queries) ListDailyIncome(ctx context.Context, arg ListDailyIncomeParams) ([]ListDailyIncomeRow, error)
Sums grand_total across both kinds ('sales' and 'return') rather than treating them separately: a branch's return/exchange grand_total is already the net signed cash effect it reported (negative for a refund, positive for an even-or-up exchange -- see tx_exchange.go's netDifference in kashi-pos), so a plain sum already nets returns against sales correctly without this query needing to know or guess that sign convention itself. The year filter is a >=/< range against a fixed pair of dates rather than EXTRACT(YEAR FROM occurred_at) = $1 -- EXTRACT on every row can't use a plain btree index on occurred_at (idx_branch_invoices_occurred_at), while a range comparison can.
func (*Queries) ListDayBranchExpenses ¶
func (q *Queries) ListDayBranchExpenses(ctx context.Context, arg ListDayBranchExpensesParams) ([]ListDayBranchExpensesRow, error)
func (*Queries) ListDayBranchShifts ¶
func (q *Queries) ListDayBranchShifts(ctx context.Context, arg ListDayBranchShiftsParams) ([]ListDayBranchShiftsRow, error)
Shifts closed on the day (a shift belongs to the day its till was counted, which is what the variance figures describe).
func (*Queries) ListDayInvoices ¶
func (q *Queries) ListDayInvoices(ctx context.Context, arg ListDayInvoicesParams) ([]ListDayInvoicesRow, error)
Every invoice of the day, newest first. Capped well above a real day's volume; the page only lists them.
func (*Queries) ListDayPaymentsByAccount ¶
func (q *Queries) ListDayPaymentsByAccount(ctx context.Context, arg ListDayPaymentsByAccountParams) ([]ListDayPaymentsByAccountRow, error)
How the day's money came in, by the branch-reported account display name (cashbox accounts aren't shared across the branch boundary -- see migration 000054).
func (*Queries) ListDaySalesByBranch ¶
func (q *Queries) ListDaySalesByBranch(ctx context.Context, arg ListDaySalesByBranchParams) ([]ListDaySalesByBranchRow, error)
Queries backing the Daily Income heatmap's per-day drill-down page (GET /branch_invoices/day_summary). Every query scopes to one *local* calendar day: occurred_at converted to the owning branch's timezone, the same rule ListDailyIncome uses to bucket the heatmap cell that was clicked, so the page's totals always agree with that cell.
The occurred_at range against day-1 .. day+2 is a coarse prefilter that keeps idx_branch_invoices_occurred_at usable (a per-row AT TIME ZONE can't use the index on its own); two days of slack on either side covers every real timezone offset, and the AT TIME ZONE equality does the exact cut. Per-branch totals for the day. net_total is the plain grand_total sum across sales and returns, same signed-return convention as ListDailyIncome, so the page's headline matches the heatmap cell.
func (*Queries) ListDaySalesByHour ¶
func (q *Queries) ListDaySalesByHour(ctx context.Context, arg ListDaySalesByHourParams) ([]ListDaySalesByHourRow, error)
Local-hour buckets (0-23); hours with no invoices are absent and the frontend fills zeros.
func (*Queries) ListDaySalesBySalesperson ¶
func (q *Queries) ListDaySalesBySalesperson(ctx context.Context, arg ListDaySalesBySalespersonParams) ([]ListDaySalesBySalespersonRow, error)
func (*Queries) ListDayTopProducts ¶
func (q *Queries) ListDayTopProducts(ctx context.Context, arg ListDayTopProductsParams) ([]ListDayTopProductsRow, error)
Best sellers of the day by line revenue, sales invoices only. Items whose product_uid never resolved to a variant (see resolveVariantByUIDOrBarcode) fold into one "unknown" row rather than disappearing from the totals.
func (*Queries) ListDayVisitorsByHour ¶
func (q *Queries) ListDayVisitorsByHour(ctx context.Context, arg ListDayVisitorsByHourParams) ([]ListDayVisitorsByHourRow, error)
branch_visitor_events.day is already the branch's local day (stamped by the till), so it's matched directly; only the hour needs the timezone.
func (*Queries) ListDeals ¶ added in v1.1.6
func (q *Queries) ListDeals(ctx context.Context) ([]ListDealsRow, error)
Every deal, with how many list rows and rules put it on products, so the page can say where a deal is used before it is changed or deleted.
func (*Queries) ListDealsForDiscountListSync ¶ added in v1.1.6
func (q *Queries) ListDealsForDiscountListSync(ctx context.Context, discountListID int64) ([]Deal, error)
The deals a list's rows name: they travel with the list, so the till always has the terms of every deal it can price.
func (*Queries) ListDeletableUnknownItemImages ¶ added in v1.1.1
func (q *Queries) ListDeletableUnknownItemImages(ctx context.Context, ids []int64) ([]ListDeletableUnknownItemImagesRow, error)
Of the given pictures, the ones that can go: not the picture of a unit still waiting to be matched on a sale that has arrived. A checkout whose sale never came (the till or kashi was down) is not waiting on anyone, so it can go.
func (*Queries) ListDiscountListBranchIDs ¶
func (*Queries) ListDiscountListItems ¶
func (*Queries) ListDiscountListItemsForSync ¶
func (*Queries) ListDiscountListItemsWithProduct ¶
func (q *Queries) ListDiscountListItemsWithProduct(ctx context.Context, arg ListDiscountListItemsWithProductParams) ([]ListDiscountListItemsWithProductRow, error)
See ListPriceListItemsWithProduct: rows are variant-level, so the label needs the barcode and color/size to be identifiable. Option rows (000199) are listed alongside the plain ones; sale_option_id 0 / sale_option ” marks a plain row. Only a plain row can name a deal (000201).
func (*Queries) ListDiscountListOptionItemsForSync ¶ added in v1.1.6
func (q *Queries) ListDiscountListOptionItemsForSync(ctx context.Context, discountListID int64) ([]ListDiscountListOptionItemsForSyncRow, error)
Options travel by name, like colors and attributes: a till has no copy of kashi's sale_options ids.
func (*Queries) ListDiscountListRuleGroups ¶ added in v1.1.6
func (q *Queries) ListDiscountListRuleGroups(ctx context.Context, discountListID int64) ([]DiscountListRuleGroup, error)
A list's rule groups in order (000203).
func (*Queries) ListDiscountListRuleOptions ¶ added in v1.1.6
func (q *Queries) ListDiscountListRuleOptions(ctx context.Context, discountListID int64) ([]ListDiscountListRuleOptionsRow, error)
Option discounts of a list's rules; options travel by name, as on the tills.
func (*Queries) ListDiscountListRules ¶ added in v1.1.6
func (q *Queries) ListDiscountListRules(ctx context.Context, discountListID int64) ([]ListDiscountListRulesRow, error)
A list's rules in the order they run, with how many variants each one decides now (counted from the rows it wrote: a rule giving 0 writes none).
func (*Queries) ListDiscountLists ¶
func (q *Queries) ListDiscountLists(ctx context.Context, arg ListDiscountListsParams) ([]DiscountList, error)
func (*Queries) ListDiscountListsForBranchSync ¶
func (q *Queries) ListDiscountListsForBranchSync(ctx context.Context, arg ListDiscountListsForBranchSyncParams) ([]DiscountList, error)
See ListPriceListsForBranchSync -- same scoping and same reason for carrying is_active rather than filtering on it.
func (*Queries) ListDiscountListsRemovedFromBranch ¶ added in v1.1.7
func (q *Queries) ListDiscountListsRemovedFromBranch(ctx context.Context, arg ListDiscountListsRemovedFromBranchParams) ([]ListDiscountListsRemovedFromBranchRow, error)
Lists the branch was taken off since the till's cursor (000206), which it is sent as inactive so it drops its copy. Not the default list, which every branch keeps, nor one the branch is back on.
func (*Queries) ListDueEmailSchedules ¶ added in v1.1.0
func (q *Queries) ListDueEmailSchedules(ctx context.Context) ([]EmailSchedule, error)
func (*Queries) ListDueRecurringExpenses ¶
func (*Queries) ListEmailReportInvoices ¶ added in v1.1.0
func (q *Queries) ListEmailReportInvoices(ctx context.Context, arg ListEmailReportInvoicesParams) ([]ListEmailReportInvoicesRow, error)
Every non-cancelled invoice on local days from_day..to_day, newest first (the order kashi-admin's CSV used), optionally one branch. Days are cut per branch timezone exactly like ListDayInvoices; the occurred_at range with a day of slack each side keeps idx_branch_invoices_occurred_at usable. Carries more than the default CSV needs so extra columns picked in Settings need no new query. ListEmailReportShiftInvoices returns the same columns for one shift. One grouped pass over the picked invoices' items and payments rather than a subquery per invoice.
func (*Queries) ListEmailReportRecipients ¶ added in v1.1.0
func (q *Queries) ListEmailReportRecipients(ctx context.Context) ([]ListEmailReportRecipientsRow, error)
Everyone a report went out to, most recently used first, for the send dialog's suggestions.
func (*Queries) ListEmailReportRegisters ¶ added in v1.1.0
func (q *Queries) ListEmailReportRegisters(ctx context.Context) ([]ListEmailReportRegistersRow, error)
The registers the send dialog can pick, by branch.
func (*Queries) ListEmailReportShiftInvoices ¶ added in v1.1.0
func (q *Queries) ListEmailReportShiftInvoices(ctx context.Context, shiftID int64) ([]ListEmailReportShiftInvoicesRow, error)
A closed shift's invoices, matched the way settlements match a till's shift: register plus the till's own shift id. One grouped pass over the picked invoices' items and payments rather than a subquery per invoice.
func (*Queries) ListEmailReportShifts ¶ added in v1.1.0
func (q *Queries) ListEmailReportShifts(ctx context.Context, arg ListEmailReportShiftsParams) ([]ListEmailReportShiftsRow, error)
Closed shifts to pick from in the send dialog: those counted on local days from_day..to_day, optionally one branch, newest first.
func (*Queries) ListEmailReports ¶ added in v1.1.0
func (q *Queries) ListEmailReports(ctx context.Context, arg ListEmailReportsParams) ([]EmailReport, error)
func (*Queries) ListEmailSchedules ¶ added in v1.1.0
func (q *Queries) ListEmailSchedules(ctx context.Context) ([]EmailSchedule, error)
func (*Queries) ListEmployees ¶
func (*Queries) ListEntries ¶
func (*Queries) ListExpenseCategories ¶
func (q *Queries) ListExpenseCategories(ctx context.Context, scope sql.NullString) ([]ExpenseCategory, error)
func (*Queries) ListExpenseCategoriesUpdatedSince ¶
func (q *Queries) ListExpenseCategoriesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]ExpenseCategory, error)
Only branch-scoped categories are synced down to kashi-pos.
func (*Queries) ListExpenses ¶
func (*Queries) ListGooglePlaceSnapshots ¶ added in v1.1.0
func (q *Queries) ListGooglePlaceSnapshots(ctx context.Context, arg ListGooglePlaceSnapshotsParams) ([]GooglePlaceSnapshot, error)
func (*Queries) ListGoogleReviews ¶ added in v1.1.0
func (q *Queries) ListGoogleReviews(ctx context.Context, arg ListGoogleReviewsParams) ([]GoogleReview, error)
Newest first, for the given places.
func (*Queries) ListHomeActivityResolutions ¶ added in v1.1.0
func (q *Queries) ListHomeActivityResolutions(ctx context.Context, arg ListHomeActivityResolutionsParams) ([]ListHomeActivityResolutionsRow, error)
Which of a page's rows of one kind are resolved, and by whom.
func (*Queries) ListIgnoredLowStockProducts ¶
func (q *Queries) ListIgnoredLowStockProducts(ctx context.Context, arg ListIgnoredLowStockProductsParams) ([]ListIgnoredLowStockProductsRow, error)
Products that have opted out of low-stock alerting entirely, regardless of on-hand or threshold -- lets the muted list be reviewed and reversed.
func (*Queries) ListIncomingBranchTransfersUpdatedSince ¶
func (q *Queries) ListIncomingBranchTransfersUpdatedSince(ctx context.Context, arg ListIncomingBranchTransfersUpdatedSinceParams) ([]Transfer, error)
The destination branch's own poll: transfers addressed to it, whoever sent them. Matched by to_inventory_id, not branch_id -- that column is always the sender's.
func (*Queries) ListInventories ¶
func (*Queries) ListInventoryStock ¶
func (q *Queries) ListInventoryStock(ctx context.Context, arg ListInventoryStockParams) ([]ListInventoryStockRow, error)
func (*Queries) ListInvoiceDiscountBranchIDs ¶ added in v1.1.8
func (q *Queries) ListInvoiceDiscountBranchIDs(ctx context.Context) ([]InvoiceDiscountBranch, error)
func (*Queries) ListInvoiceDiscounts ¶ added in v1.1.8
func (q *Queries) ListInvoiceDiscounts(ctx context.Context) ([]InvoiceDiscount, error)
func (*Queries) ListInvoiceDiscountsForBranchSync ¶ added in v1.1.8
func (q *Queries) ListInvoiceDiscountsForBranchSync(ctx context.Context, arg ListInvoiceDiscountsForBranchSyncParams) ([]ListInvoiceDiscountsForBranchSyncRow, error)
Every rule changed since the branch last asked, deleted ones included, with whether it applies to the branch: a rule that doesn't (deleted, switched off, or the branch taken off it) tells the till to drop it.
func (*Queries) ListInvoicePaymentsByInvoice ¶
func (*Queries) ListInvoiceProductsByInvoice ¶
func (*Queries) ListInvoiceTypes ¶
func (q *Queries) ListInvoiceTypes(ctx context.Context) ([]InvoiceType, error)
func (*Queries) ListInvoices ¶
func (*Queries) ListInvoicesPage ¶
func (*Queries) ListLatestAdditions ¶
func (q *Queries) ListLatestAdditions(ctx context.Context, arg ListLatestAdditionsParams) ([]ListLatestAdditionsRow, error)
The home page's "Latest added" feed: the newest photos (expense, close-shift receipt), transfers, central expenses and purchases, merged newest first. Each include_* flag is the caller's view access to that section, so a kind the user can't open never appears.
ref_id is the record a row belongs to (the expense or shift a photo was attached to, or the transfer/expense/purchase itself), and for a branch photo branch_id + ref_day (the branch's local day) say which day page shows it, so the feed can open "the thing it was attached to". Keyset paging: the next page starts after the last row the feed has. ids come from five tables, so kind breaks a tie between two rows added at the same instant with the same id.
func (*Queries) ListLoanCategories ¶
func (q *Queries) ListLoanCategories(ctx context.Context, scope sql.NullString) ([]LoanCategory, error)
func (*Queries) ListLoanCategoriesUpdatedSince ¶
func (q *Queries) ListLoanCategoriesUpdatedSince(ctx context.Context, updatedAt time.Time) ([]LoanCategory, error)
Only branch-scoped categories are synced down to kashi-pos -- central ones are managed in kashi only.
func (*Queries) ListLoanImagesForLoan ¶ added in v1.1.0
func (*Queries) ListLoanPayments ¶
func (q *Queries) ListLoanPayments(ctx context.Context, arg ListLoanPaymentsParams) ([]LoanPayment, error)
sqlc.narg(loan_id) is nullable: NULL means "all loans". sqlc.narg(category_id) filters by the parent loan's lender-source category.
func (*Queries) ListLoans ¶
func (q *Queries) ListLoans(ctx context.Context, arg ListLoansParams) ([]ListLoansRow, error)
sqlc.narg(branch_id)/sqlc.narg(origin) are nullable: NULL means "no filter", matching ListBranchExpenses' admin-filter convention. paid_amount is the running total of loan_payments against the loan; status is derived from it (never stored) -- 'paid' once payments cover the loan amount, 'partial' while some but not all is covered, else 'unpaid' -- or 'cancelled' once cancelled_at is stamped. sqlc.narg(status) filters on that same derived value.
func (*Queries) ListLowStockProducts ¶
func (q *Queries) ListLowStockProducts(ctx context.Context, arg ListLowStockProductsParams) ([]ListLowStockProductsRow, error)
Low stock alerts. A product's on-hand is the sum of inventory_stock across every SKU (variant) and every inventory it's stocked in; its effective threshold is its own override if set, else the single global app_settings.default_low_stock_threshold. status narrows to one bucket: 'out_of_stock' (on_hand <= 0) or 'low_stock' (on_hand > 0, i.e. low but not yet out); NULL keeps both, matching the "at or below threshold" definition used everywhere else.
func (*Queries) ListPendingBranchAttendanceRequests ¶ added in v1.1.0
func (q *Queries) ListPendingBranchAttendanceRequests(ctx context.Context, branchID sql.NullInt64) ([]BranchAttendanceChange, error)
Requests a till filed ("acr-<id>-complaint") that no review has answered yet ("acr-<id>-review" from the same register -- each till numbers its own requests). These are the ones an admin can approve or reject from kashi.
func (*Queries) ListPendingBranchCommands ¶
func (*Queries) ListPriceListBranchIDs ¶
func (*Queries) ListPriceListItems ¶
func (*Queries) ListPriceListItemsForSync ¶
func (q *Queries) ListPriceListItemsForSync(ctx context.Context, priceListID int64) ([]ListPriceListItemsForSyncRow, error)
Items of one list, keyed by the variant's uid -- the till's own row ids are a different number space, so nothing crosses the boundary by integer id.
func (*Queries) ListPriceListItemsWithProduct ¶
func (q *Queries) ListPriceListItemsWithProduct(ctx context.Context, arg ListPriceListItemsWithProductParams) ([]ListPriceListItemsWithProductRow, error)
Rows are variant-level now, so the display label needs the variant's own barcode and its color/size -- a product code and name alone no longer identify which row a price belongs to.
func (*Queries) ListPriceLists ¶
func (*Queries) ListPriceListsForBranchSync ¶
func (q *Queries) ListPriceListsForBranchSync(ctx context.Context, arg ListPriceListsForBranchSyncParams) ([]PriceList, error)
The only price lists a branch is allowed to know about: the default one (its fallback) and the one it is assigned, if any. Deliberately not every list -- a till has no business holding another branch's pricing.
is_active is carried rather than filtered on, because a list going inactive is exactly the event the till needs in order to drop its local copy; filter it out here and the till would keep pricing from a list kashi has retired.
func (*Queries) ListPriceListsRemovedFromBranch ¶ added in v1.1.7
func (q *Queries) ListPriceListsRemovedFromBranch(ctx context.Context, arg ListPriceListsRemovedFromBranchParams) ([]ListPriceListsRemovedFromBranchRow, error)
See ListDiscountListsRemovedFromBranch.
func (*Queries) ListProductAttributes ¶
func (q *Queries) ListProductAttributes(ctx context.Context, arg ListProductAttributesParams) ([]ProductsAttribute, error)
func (*Queries) ListProductCategories ¶
func (q *Queries) ListProductCategories(ctx context.Context) ([]ProductCategory, error)
func (*Queries) ListProductRevenue ¶
func (q *Queries) ListProductRevenue(ctx context.Context, arg ListProductRevenueParams) ([]ListProductRevenueRow, error)
Revenue per product from kashi's own admin sales invoices (invoice_products joined through sales_invoices, so returns don't count as revenue). Branch (POS) sales are deliberately excluded here -- see ListBranchProductRevenue below for those; branch_invoice_items itself still isn't linkable to a product (its branch_product_id has no FK), so the two sources stay separate rather than merged into one figure. category/subcategory/brand are the EAV attributes seeded in 000005_create_products_attributes_table (ids 0/1/2), joined once per attribute the same way ListProductVariantsForSync does.
func (*Queries) ListProductRevenueDaily ¶
func (q *Queries) ListProductRevenueDaily(ctx context.Context, arg ListProductRevenueDailyParams) ([]ListProductRevenueDailyRow, error)
Same scope and filters as ListProductRevenue, rolled up by local calendar day instead of by product -- the trend line for the Product Revenues page.
func (*Queries) ListProductSaleOptionNames ¶ added in v1.1.6
func (*Queries) ListProductVariantIDsByUIDs ¶
func (*Queries) ListProductVariants ¶
func (q *Queries) ListProductVariants(ctx context.Context, arg ListProductVariantsParams) ([]ListProductVariantsRow, error)
func (*Queries) ListProductVariantsByProduct ¶
func (*Queries) ListProductVariantsForSync ¶
func (q *Queries) ListProductVariantsForSync(ctx context.Context, updatedAt time.Time) ([]ListProductVariantsForSyncRow, error)
Flattened for kashi-pos, which has no separate "product" row -- each variant carries everything a branch needs to create or update its own flat product row. Colors/sizes/attributes are resolved to their name here (not sent as ids) since kashi-pos matches everything by name, not by kashi's internal ids.
Price is deliberately absent: since 000094 a variant has no price of its own, it has an entry in a price list, and those sync down as their own entities (see the price_lists/discount_lists cases in branch_catchup.go). A till receiving no price here keeps whatever the lists last told it, which is what applySyncedProductVariant already does for an absent price.
Attribute ids (2=brand, 1=sub-category, 3=kind, 7=season, 6=year) match the fixed seed in 000005_create_products_attributes_table.up.sql. Editing a product's attributes doesn't currently bump product_variants.updated_at (no endpoint does that edit yet -- see api/product.go), so an attribute-only change wouldn't be picked up by this filter if one ever existed; today attributes are only ever set at creation time, in the same moment the variant's own updated_at is set, so this doesn't miss anything in practice yet.
func (*Queries) ListProductVariantsForSyncByUIDs ¶
func (q *Queries) ListProductVariantsForSyncByUIDs(ctx context.Context, uids []uuid.UUID) ([]ListProductVariantsForSyncByUIDsRow, error)
Same flattened row as ListProductVariantsForSyncPaged, for the uids a till's completeness check found missing or stale.
func (*Queries) ListProductVariantsForSyncPaged ¶
func (q *Queries) ListProductVariantsForSyncPaged(ctx context.Context, arg ListProductVariantsForSyncPagedParams) ([]ListProductVariantsForSyncPagedRow, error)
Keyset-paginated ListProductVariantsForSync -- same flattened row, same joins, ordered by (product_variants.updated_at, product_variants.id) for a stable page boundary during a branch's full catch-up.
func (*Queries) ListProductVariantsUpdatedSince ¶
func (*Queries) ListProducts ¶
func (q *Queries) ListProducts(ctx context.Context, arg ListProductsParams) ([]ListProductsRow, error)
Search matches code/name/description (case-insensitive). Every filter is optional: empty search string, NULL narg, or empty attribute_value_ids array all mean "don't filter on this". attribute_value_ids is an AND -- the product must carry every selected value.
total_count is carried alongside each row via a window function so the caller doesn't need a second CountProducts round-trip that re-scans the same filtered set again.
func (*Queries) ListPurchaseItems ¶
func (*Queries) ListPurchases ¶
func (q *Queries) ListPurchases(ctx context.Context, arg ListPurchasesParams) ([]ListPurchasesRow, error)
func (*Queries) ListRecurringExpenses ¶
func (q *Queries) ListRecurringExpenses(ctx context.Context) ([]RecurringExpense, error)
func (*Queries) ListRegisterUpdateStatuses ¶
func (q *Queries) ListRegisterUpdateStatuses(ctx context.Context) ([]ListRegisterUpdateStatusesRow, error)
func (*Queries) ListRolePermissions ¶
func (q *Queries) ListRolePermissions(ctx context.Context) ([]RolePermission, error)
func (*Queries) ListRoles ¶
func (q *Queries) ListRoles(ctx context.Context) ([]ListRolesRow, error)
func (*Queries) ListSaleMovementsForInvoiceVariant ¶
func (q *Queries) ListSaleMovementsForInvoiceVariant(ctx context.Context, arg ListSaleMovementsForInvoiceVariantParams) ([]ListSaleMovementsForInvoiceVariantRow, error)
Which batch(es) a specific sales-invoice line actually drew from, so a return of that line can replenish the same batches instead of going untracked. quantity is negative (sale); batch_id is null for the unattributed remainder, if the sale outran every tracked batch.
func (*Queries) ListSaleOptions ¶ added in v1.1.6
func (q *Queries) ListSaleOptions(ctx context.Context) ([]SaleOption, error)
func (*Queries) ListSalespersons ¶
func (q *Queries) ListSalespersons(ctx context.Context, arg ListSalespersonsParams) ([]Salesperson, error)
func (*Queries) ListSalespersonsByCashbox ¶
func (*Queries) ListSalespersonsForBranch ¶
func (*Queries) ListSalespersonsUpdatedSince ¶
func (q *Queries) ListSalespersonsUpdatedSince(ctx context.Context, arg ListSalespersonsUpdatedSinceParams) ([]Salesperson, error)
func (*Queries) ListSecurityAlerts ¶ added in v1.1.0
func (q *Queries) ListSecurityAlerts(ctx context.Context, arg ListSecurityAlertsParams) ([]SecurityAlert, error)
Open alerts of the pinned (critical) kinds come first, so the page limit never pushes one off the list before someone resolves it.
func (*Queries) ListShifts ¶
func (q *Queries) ListShifts(ctx context.Context, arg ListShiftsParams) ([]ListShiftsRow, error)
func (*Queries) ListSizesPage ¶
func (*Queries) ListSlowMovingProducts ¶
func (q *Queries) ListSlowMovingProducts(ctx context.Context, arg ListSlowMovingProductsParams) ([]ListSlowMovingProductsRow, error)
--------------------------------------------------------------------------- Slow movers: money tied up in stock that isn't selling. Deliberately separate from the low-stock alerts (too little stock) -- this is the opposite problem, too much. A product qualifies when it's carrying stock (on_hand > 0) and either never sold in the last 90 days ("dead": put it on clearance) or would take unreasonably long to sell through at its current pace ("overstocked": more than 90 days on hand). ---------------------------------------------------------------------------
func (*Queries) ListStockCountItems ¶
func (*Queries) ListStockCounts ¶
func (q *Queries) ListStockCounts(ctx context.Context, arg ListStockCountsParams) ([]ListStockCountsRow, error)
func (*Queries) ListStockHealthByInventory ¶
func (q *Queries) ListStockHealthByInventory(ctx context.Context, arg ListStockHealthByInventoryParams) ([]ListStockHealthByInventoryRow, error)
func (*Queries) ListStockMovements ¶
func (q *Queries) ListStockMovements(ctx context.Context, arg ListStockMovementsParams) ([]ListStockMovementsRow, error)
func (*Queries) ListSuppliers ¶
TOOD: add UpdateSupplier
func (*Queries) ListTransferAttachments ¶ added in v1.1.0
func (q *Queries) ListTransferAttachments(ctx context.Context, arg ListTransferAttachmentsParams) ([]ListTransferAttachmentsRow, error)
Storage page feed: transfers that have a photo, newest first. The photo itself is served by GET /transfers/:id/attachment.
func (*Queries) ListTransferItems ¶
func (*Queries) ListTransfers ¶
func (q *Queries) ListTransfers(ctx context.Context, arg ListTransfersParams) ([]ListTransfersRow, error)
func (*Queries) ListUnknownItemImages ¶ added in v1.1.1
func (q *Queries) ListUnknownItemImages(ctx context.Context, arg ListUnknownItemImagesParams) ([]ListUnknownItemImagesRow, error)
Every stored unknown-item picture, newest first, for the Attachments page.
func (*Queries) ListUnknownItemSlotsForSession ¶ added in v1.1.1
func (*Queries) ListUnknownItems ¶ added in v1.1.1
func (q *Queries) ListUnknownItems(ctx context.Context, arg ListUnknownItemsParams) ([]ListUnknownItemsRow, error)
Pictured units of sold invoices, pending or resolved, newest first.
func (*Queries) ListUnmatchedDiscountEntries ¶ added in v1.1.1
func (q *Queries) ListUnmatchedDiscountEntries(ctx context.Context, entries []string) ([]string, error)
The entries that name no variant barcode and no product code.
func (*Queries) ListUnresolvedUrgentHomeActivities ¶ added in v1.1.0
func (q *Queries) ListUnresolvedUrgentHomeActivities(ctx context.Context) ([]ListUnresolvedUrgentHomeActivitiesRow, error)
The urgent Recent activity rows nobody has resolved yet, pinned above the feed: a shift closed short (negative USD variance) -- the rows the feed tints red. Same columns as HomeActivityFeed, so the feed draws them with the same row, newest received first, like the feed.
func (*Queries) ListVariantSyncIDs ¶
func (q *Queries) ListVariantSyncIDs(ctx context.Context, arg ListVariantSyncIDsParams) ([]ListVariantSyncIDsRow, error)
func (*Queries) ListVariantsForBarcodes ¶
func (q *Queries) ListVariantsForBarcodes(ctx context.Context, arg ListVariantsForBarcodesParams) ([]ListVariantsForBarcodesRow, error)
func (*Queries) ListVariantsForDiscountEntry ¶ added in v1.1.6
func (q *Queries) ListVariantsForDiscountEntry(ctx context.Context, entry string) ([]ListVariantsForDiscountEntryRow, error)
What one typed or scanned entry names, matched like BulkSetDiscountListItems: a barcode names its variant, a code all of its product's variants.
func (*Queries) ListVisitorIPs ¶ added in v1.1.0
func (q *Queries) ListVisitorIPs(ctx context.Context, arg ListVisitorIPsParams) ([]VisitorIp, error)
Most recently seen first. search matches the IP, place, network, user or branch; country narrows to one country code.
func (*Queries) ListWaitingUnknownItems ¶ added in v1.1.1
func (q *Queries) ListWaitingUnknownItems(ctx context.Context) ([]ListWaitingUnknownItemsRow, error)
Every unit of the checkouts still in progress that are missing at least one picture or pass, for the "Waiting" tab: pictured units come along so the manager sees what has already been taken. Cashiers who asked for help first.
func (*Queries) ListWhatsAppChatMessages ¶ added in v1.1.1
func (q *Queries) ListWhatsAppChatMessages(ctx context.Context, arg ListWhatsAppChatMessagesParams) ([]ListWhatsAppChatMessagesRow, error)
Newest first, a page at a time: before_id 0 is the latest page.
func (*Queries) ListWhatsAppChats ¶ added in v1.1.1
func (q *Queries) ListWhatsAppChats(ctx context.Context, arg ListWhatsAppChatsParams) ([]ListWhatsAppChatsRow, error)
One row per customer phone, the most recently active first.
func (*Queries) ListWhatsAppMessageReplies ¶ added in v1.1.0
func (q *Queries) ListWhatsAppMessageReplies(ctx context.Context, id int64) ([]ListWhatsAppMessageRepliesRow, error)
What the client sent back to one message: after its poll (the bridge) or answering it (Meta's webhook), oldest first. id and media_type: a bridge reply's media (GET /whatsapp/poll_replies/:id/media).
func (*Queries) ListWhatsAppMessages ¶ added in v1.1.0
func (q *Queries) ListWhatsAppMessages(ctx context.Context, arg ListWhatsAppMessagesParams) ([]ListWhatsAppMessagesRow, error)
Newest first. branch_id 0 = every branch, status ” = any; search matches the client's name or phone, the invoice code or the rule.
func (*Queries) ListWhatsAppNumbers ¶ added in v1.1.0
func (q *Queries) ListWhatsAppNumbers(ctx context.Context) ([]WhatsappNumber, error)
func (*Queries) ListWhatsAppReplies ¶ added in v1.1.0
func (q *Queries) ListWhatsAppReplies(ctx context.Context, arg ListWhatsAppRepliesParams) ([]ListWhatsAppRepliesRow, error)
Newest first. A reply not linked to one of our messages only shows under every branch.
func (*Queries) ListWhatsAppRules ¶ added in v1.1.0
func (q *Queries) ListWhatsAppRules(ctx context.Context) ([]WhatsappRule, error)
The WhatsApp page: post-sale message rules and the message log (api/whatsapp_rules.go).
func (*Queries) LowPollRatings ¶ added in v1.1.0
func (q *Queries) LowPollRatings(ctx context.Context, arg LowPollRatingsParams) ([]LowPollRatingsRow, error)
Clients who answered 1 or 2 stars, newest first: the ones to call back.
func (*Queries) LoyaltyMonthlyJoins ¶ added in v1.1.6
func (q *Queries) LoyaltyMonthlyJoins(ctx context.Context, clientType sql.NullString) ([]LoyaltyMonthlyJoinsRow, error)
Loyalty page: new clients per calendar month (UTC) over the last 12 months.
func (*Queries) LoyaltyRisingClients ¶ added in v1.1.6
func (q *Queries) LoyaltyRisingClients(ctx context.Context, arg LoyaltyRisingClientsParams) ([]LoyaltyRisingClientsRow, error)
Loyalty page, "close to leveling up": the clients (up to 25) within 30% of the next tier's minimum, closest first. tier_mins as in LoyaltyTierStats.
func (*Queries) LoyaltyTierStats ¶ added in v1.1.6
func (q *Queries) LoyaltyTierStats(ctx context.Context, arg LoyaltyTierStatsParams) ([]LoyaltyTierStatsRow, error)
Loyalty page: one row per tier that has members. tier_mins is the tiers' minimum spends in cents, ascending; a client's tier index is the highest minimum their lifetime spend clears (the lowest tier if none), counted from 0 at the entry tier -- the same rule as the page's tierFor. Lifetime spend (gross_spent, before the On Account deduction) and points come from the client_spend cache; the period figures (revenue, active members) cover [date_from, date_to), either bound optional, and are computed live from just the invoices inside the window. With no bound the period is all time, so the cached figures are used as is.
Same two sources and sign conventions as RefreshClientSpend: central invoices (sales positive, returns negative) plus non-cancelled branch invoices of reported-on branches/registers.
func (*Queries) MarkBranchAttendanceEventRemoved ¶ added in v1.1.0
func (q *Queries) MarkBranchAttendanceEventRemoved(ctx context.Context, arg MarkBranchAttendanceEventRemovedParams) error
The original punch of an approved replace/delete on the till. Kept, not deleted, so the audit trail shows what was there and who took it away.
func (*Queries) MarkBranchExpenseUploadTokenUsed ¶
func (*Queries) MarkBranchInvoicesCancelled ¶ added in v1.1.0
func (q *Queries) MarkBranchInvoicesCancelled(ctx context.Context, arg MarkBranchInvoicesCancelledParams) error
A till's cancellation return names the sale it cancels (related_client_ref); both rows get the mark. COALESCE keeps the first stamp on a replayed push.
func (*Queries) MarkBranchShiftUploadTokenUsed ¶
func (*Queries) MarkBranchTransferUploadTokenUsed ¶
func (*Queries) MarkLoanUploadTokenUsed ¶ added in v1.1.0
func (*Queries) MarkUnknownItemSlotResolved ¶ added in v1.1.1
func (q *Queries) MarkUnknownItemSlotResolved(ctx context.Context, arg MarkUnknownItemSlotResolvedParams) error
func (*Queries) MarkWhatsAppReviewClicked ¶ added in v1.1.0
func (*Queries) PollRatingTotals ¶ added in v1.1.0
func (q *Queries) PollRatingTotals(ctx context.Context, arg PollRatingTotalsParams) (PollRatingTotalsRow, error)
The WhatsApp rating poll over the range: polls sent, answers, and how many of each star.
func (*Queries) PollRatingsByBranch ¶ added in v1.1.0
func (q *Queries) PollRatingsByBranch(ctx context.Context, arg PollRatingsByBranchParams) ([]PollRatingsByBranchRow, error)
func (*Queries) PollRatingsByDay ¶ added in v1.1.0
func (q *Queries) PollRatingsByDay(ctx context.Context, arg PollRatingsByDayParams) ([]PollRatingsByDayRow, error)
func (*Queries) PollReplies ¶ added in v1.1.0
func (q *Queries) PollReplies(ctx context.Context, arg PollRepliesParams) ([]PollRepliesRow, error)
What clients wrote back after the rating poll, newest first, with their answer: why it wasn't great, and what they looked for and didn't find.
func (*Queries) ProductBarcodesPresent ¶
func (*Queries) ReceiveInventoryStock ¶
func (q *Queries) ReceiveInventoryStock(ctx context.Context, arg ReceiveInventoryStockParams) (InventoryStock, error)
Apply an inbound quantity delta and roll the per-location moving-average cost forward. When existing on-hand is <= 0 the average is just reset to the incoming cost (no meaningful prior average to blend).
func (*Queries) RecordEmailScheduleRun ¶ added in v1.1.0
func (q *Queries) RecordEmailScheduleRun(ctx context.Context, arg RecordEmailScheduleRunParams) error
func (*Queries) RecordSecurityAlert ¶ added in v1.1.0
func (q *Queries) RecordSecurityAlert(ctx context.Context, arg RecordSecurityAlertParams) error
Opens an alert, or bumps the open one of the same kind for the same IP seen within the last hour.
func (*Queries) RecordWhatsAppPollVote ¶ added in v1.1.0
func (q *Queries) RecordWhatsAppPollVote(ctx context.Context, arg RecordWhatsAppPollVoteParams) (RecordWhatsAppPollVoteRow, error)
A client's answer to the rating poll; a NULL rating is a vote taken back.
func (*Queries) RedeemCoupon ¶
Idempotent: a retried invoice post that already redeemed this code just returns the row unchanged rather than erroring (matches CreateBranchInvoice's own idempotent-retry shape). Only actually moves an 'active' coupon to 'redeemed' -- an inactive/already-redeemed code is left alone so a stale retry never resurrects it.
func (*Queries) RefreshClientSpend ¶ added in v1.1.6
Rebuilds client_spend for every client from all invoices. Same two sources and sign conventions as ListClientsBySpending (see the comment there): central invoices (sales positive, returns negative; grand_total is always a positive magnitude) and non-cancelled branch invoices of reported-on branches/registers, whose grand_total already carries its sign. total_spent drops what was paid "On Account"; gross_spent keeps it. Line items are pre-aggregated per invoice so they can't multiply grand_total.
func (*Queries) RenameRole ¶
func (q *Queries) RenameRole(ctx context.Context, arg RenameRoleParams) error
func (*Queries) ReplaceBranchExpenseImageFile ¶ added in v1.1.0
func (q *Queries) ReplaceBranchExpenseImageFile(ctx context.Context, arg ReplaceBranchExpenseImageFileParams) (BranchExpenseImage, error)
Points the row at a replacement photo (api/photo_replace.go); the new photo starts upright.
func (*Queries) ReplaceBranchShiftReceiptImageFile ¶ added in v1.1.0
func (q *Queries) ReplaceBranchShiftReceiptImageFile(ctx context.Context, arg ReplaceBranchShiftReceiptImageFileParams) (BranchShiftReceiptImage, error)
Same as ReplaceBranchExpenseImageFile.
func (*Queries) RepointBranchInvoicesClientUID ¶
func (q *Queries) RepointBranchInvoicesClientUID(ctx context.Context, arg RepointBranchInvoicesClientUIDParams) error
A till's client turned out to be an existing central client (same phone): invoices the till already sent under its own uid now point at the canonical one.
func (*Queries) ReportBranchSales ¶ added in v1.1.0
func (q *Queries) ReportBranchSales(ctx context.Context, arg ReportBranchSalesParams) ([]ReportBranchSalesRow, error)
Sales per branch; sales entered in kashi come back with branch_id 0 and an empty name.
func (*Queries) ReportCategorySales ¶ added in v1.1.0
func (q *Queries) ReportCategorySales(ctx context.Context, arg ReportCategorySalesParams) ([]ReportCategorySalesRow, error)
Revenue per product category. Lines without a product or whose product has no category come back with an empty name.
func (*Queries) ReportCostOfGoods ¶ added in v1.1.0
func (q *Queries) ReportCostOfGoods(ctx context.Context, arg ReportCostOfGoodsParams) (ReportCostOfGoodsRow, error)
Sales reports over report_sale_invoices / report_sale_lines (migration 000134): the Dashboard's cost of goods and the Sales Dashboard (api/sales_dashboard.go). Ranges are half-open [date_from, date_to), days are Beirut calendar days (businessZone in api/business_zone.go) like the rest of the dashboard. Cost of goods sold for the Dashboard, scoped like its other figures: till sales (optionally one branch) and/or sales entered in kashi. Only lines with a known cost count; costed_revenue is what those lines sold for, so the caller can say how much of revenue the cost covers.
func (*Queries) ReportCostOfGoodsSeries ¶ added in v1.1.0
func (q *Queries) ReportCostOfGoodsSeries(ctx context.Context, arg ReportCostOfGoodsSeriesParams) ([]ReportCostOfGoodsSeriesRow, error)
ReportCostOfGoods per day.
func (*Queries) ReportDailyCosted ¶ added in v1.1.0
func (q *Queries) ReportDailyCosted(ctx context.Context, arg ReportDailyCostedParams) ([]ReportDailyCostedRow, error)
Per day, what lines with a known cost sold for and what they cost -- the Sales Dashboard's profit is the difference.
func (*Queries) ReportDailySales ¶ added in v1.1.0
func (q *Queries) ReportDailySales(ctx context.Context, arg ReportDailySalesParams) ([]ReportDailySalesRow, error)
Sales (net of returns) per day.
func (*Queries) ReportHourlySales ¶ added in v1.1.0
func (q *Queries) ReportHourlySales(ctx context.Context, arg ReportHourlySalesParams) ([]ReportHourlySalesRow, error)
Sales by day of week (0 = Sunday) and hour, in each branch's own time zone (Beirut for sales entered in kashi), for the Financials heatmap.
func (*Queries) ReportInventoryValue ¶ added in v1.1.0
What the stock on hand cost, across every inventory: each stock row at its own average cost, or the variant's when the row has none (stock counts set only the variant's).
func (*Queries) ReportPaymentMethods ¶ added in v1.1.0
func (q *Queries) ReportPaymentMethods(ctx context.Context, arg ReportPaymentMethodsParams) ([]ReportPaymentMethodsRow, error)
What sales were paid with: the till's payment accounts by name ("Cash $$", "Visa", ...) plus kashi's own cashbox accounts, merged by name.
func (*Queries) ReportReceivables ¶ added in v1.1.0
What customers still owe on till sales put "On Account". Settling a sale later rewrites its payment lines (createBranchInvoiceSettlement), so the On Account lines left are exactly what's outstanding.
func (*Queries) ReportSaleYears ¶ added in v1.1.0
Every year that has a sale, newest first, for the Sales Dashboard's year picker.
func (*Queries) ReportTargetsInRange ¶ added in v1.1.0
func (q *Queries) ReportTargetsInRange(ctx context.Context, arg ReportTargetsInRangeParams) ([]ReportTargetsInRangeRow, error)
Active branch sales targets overlapping [date_from, date_to), for the Sales Analysis page, which spreads each one over its days to get the target for any month (api/sales_analysis.go). date_to is inclusive.
func (*Queries) ReportTopProducts ¶ added in v1.1.0
func (q *Queries) ReportTopProducts(ctx context.Context, arg ReportTopProductsParams) ([]ReportTopProductsRow, error)
Best-selling products by revenue. Till lines whose product never resolved to a kashi variant have no product and are left out.
func (*Queries) RequestUnknownItemHelp ¶ added in v1.1.1
func (q *Queries) RequestUnknownItemHelp(ctx context.Context, arg RequestUnknownItemHelpParams) error
func (*Queries) ResolveBranchSyncConflict ¶
func (q *Queries) ResolveBranchSyncConflict(ctx context.Context, arg ResolveBranchSyncConflictParams) (BranchSyncConflict, error)
func (*Queries) ResolveHomeActivity ¶ added in v1.1.0
func (q *Queries) ResolveHomeActivity(ctx context.Context, arg ResolveHomeActivityParams) error
Idempotent: resolving a row twice keeps who resolved it first.
func (*Queries) ResolveVariantDiscount ¶
func (q *Queries) ResolveVariantDiscount(ctx context.Context, arg ResolveVariantDiscountParams) (int16, error)
Mirrors ResolveVariantPrice: a branch assigned a discount list is discounted from it, everyone else from the default list. Unlike price, no row here means no discount (i.e. zero), not "unsellable" -- a product with no discount is a product sold at full price.
func (*Queries) ResolveVariantDiscounts ¶
func (q *Queries) ResolveVariantDiscounts(ctx context.Context, arg ResolveVariantDiscountsParams) ([]ResolveVariantDiscountsRow, error)
func (*Queries) ResolveVariantPrice ¶
func (q *Queries) ResolveVariantPrice(ctx context.Context, arg ResolveVariantPriceParams) (int64, error)
The one place that answers "what does this variant cost at this branch". A branch assigned a list via price_list_branches is priced from it; every other branch, and any variant the assigned list doesn't mention, falls back to the default list. No row means no price, which callers must treat as "not sellable" rather than as zero.
func (*Queries) ResolveVariantPrices ¶
func (q *Queries) ResolveVariantPrices(ctx context.Context, arg ResolveVariantPricesParams) ([]ResolveVariantPricesRow, error)
Batch form of ResolveVariantPrice, for listings and the branch sync payload, so pricing N variants costs one query rather than N. DISTINCT ON keeps the branch list's row ahead of the default list's for the same variant.
func (*Queries) ReviewClicksTotal ¶ added in v1.1.0
func (q *Queries) ReviewClicksTotal(ctx context.Context, arg ReviewClicksTotalParams) (int64, error)
Every open of a review link in the range, the plain link included.
func (*Queries) ReviewFunnel ¶ added in v1.1.0
func (q *Queries) ReviewFunnel(ctx context.Context, arg ReviewFunnelParams) (ReviewFunnelRow, error)
Messages sent in the range and how far they got: delivered/read come from Meta's webhook, clicked from the review link.
func (*Queries) ReviewFunnelByBranch ¶ added in v1.1.0
func (q *Queries) ReviewFunnelByBranch(ctx context.Context, arg ReviewFunnelByBranchParams) ([]ReviewFunnelByBranchRow, error)
func (*Queries) ReviewFunnelByDay ¶ added in v1.1.0
func (q *Queries) ReviewFunnelByDay(ctx context.Context, arg ReviewFunnelByDayParams) ([]ReviewFunnelByDayRow, error)
Per Beirut day: messages sent with a link, and link opens.
func (*Queries) RotateBranchExpenseImage ¶ added in v1.1.0
func (q *Queries) RotateBranchExpenseImage(ctx context.Context, arg RotateBranchExpenseImageParams) (int16, error)
Turns the photo by delta degrees (a multiple of 90, either sign) on top of its saved rotation.
func (*Queries) RotateBranchShiftReceiptImage ¶ added in v1.1.0
func (q *Queries) RotateBranchShiftReceiptImage(ctx context.Context, arg RotateBranchShiftReceiptImageParams) (int16, error)
Same as RotateBranchExpenseImage.
func (*Queries) RotateTransferAttachment ¶ added in v1.1.0
func (q *Queries) RotateTransferAttachment(ctx context.Context, arg RotateTransferAttachmentParams) (int16, error)
Turns the photo by delta degrees (a multiple of 90, either sign) on top of its saved rotation. Not a change to the transfer itself, so updated_at is left alone.
func (*Queries) SalespersonPerformanceInvoices ¶ added in v1.1.0
func (q *Queries) SalespersonPerformanceInvoices(ctx context.Context, arg SalespersonPerformanceInvoicesParams) ([]SalespersonPerformanceInvoicesRow, error)
Sales in [from_at, to_at), not cancelled. A linked invoice shows its salesperson's current name, so a renamed salesperson stays one person.
func (*Queries) SalespersonPerformanceItems ¶ added in v1.1.0
func (q *Queries) SalespersonPerformanceItems(ctx context.Context, arg SalespersonPerformanceItemsParams) ([]BranchInvoiceItem, error)
func (*Queries) SearchVariantsForUnknownItems ¶ added in v1.1.1
func (q *Queries) SearchVariantsForUnknownItems(ctx context.Context, search string) ([]SearchVariantsForUnknownItemsRow, error)
The picker an admin matches a pictured item with: active variants whose product name, code or barcode contains the text.
func (*Queries) SearchWhatsAppClients ¶ added in v1.1.0
func (q *Queries) SearchWhatsAppClients(ctx context.Context, search string) ([]SearchWhatsAppClientsRow, error)
Clients with a phone, for picking in a rule.
func (*Queries) SeedProductVariantsCostByCode ¶ added in v1.1.3
func (q *Queries) SeedProductVariantsCostByCode(ctx context.Context, arg SeedProductVariantsCostByCodeParams) (int64, error)
Fills in avg_cost for every variant of one product, but only where it is still at the 0 default -- i.e. never seeded by an actual stock receipt (UpdateProductVariantAvgCost above). Used to backfill a starting cost basis from an external cost list (cmd/import_costs-style one-off); it never overwrites a real moving-average cost built from real receipts.
func (*Queries) SetAssetCost ¶
func (q *Queries) SetAssetCost(ctx context.Context, arg SetAssetCostParams) error
func (*Queries) SetBarcodeLabelDesign ¶ added in v1.1.2
func (q *Queries) SetBarcodeLabelDesign(ctx context.Context, barcodeLabelDesign json.RawMessage) (AppSetting, error)
func (*Queries) SetBranchActive ¶
func (q *Queries) SetBranchActive(ctx context.Context, arg SetBranchActiveParams) error
func (*Queries) SetBranchExpenseCategory ¶ added in v1.1.1
func (q *Queries) SetBranchExpenseCategory(ctx context.Context, arg SetBranchExpenseCategoryParams) (BranchExpense, error)
A till re-categorising one of its own expenses (kashi-pos expense detail). NULL category_id is "no category".
func (*Queries) SetBranchExpenseFromCentral ¶ added in v1.1.3
func (q *Queries) SetBranchExpenseFromCentral(ctx context.Context, arg SetBranchExpenseFromCentralParams) (BranchExpense, error)
A till marking one of its own expenses as paid by central, or not.
func (*Queries) SetBranchExpenseFromCentralByID ¶ added in v1.1.3
func (q *Queries) SetBranchExpenseFromCentralByID(ctx context.Context, arg SetBranchExpenseFromCentralByIDParams) (BranchExpense, error)
The same, from kashi's expenses page.
func (*Queries) SetBranchHiddenFromReports ¶
func (q *Queries) SetBranchHiddenFromReports(ctx context.Context, arg SetBranchHiddenFromReportsParams) error
func (*Queries) SetBranchInventory ¶
func (q *Queries) SetBranchInventory(ctx context.Context, arg SetBranchInventoryParams) error
func (*Queries) SetBranchInvoiceDiscount ¶ added in v1.1.8
func (q *Queries) SetBranchInvoiceDiscount(ctx context.Context, arg SetBranchInvoiceDiscountParams) error
func (*Queries) SetBranchInvoiceItemDiscount ¶ added in v1.1.8
func (q *Queries) SetBranchInvoiceItemDiscount(ctx context.Context, arg SetBranchInvoiceItemDiscountParams) error
func (*Queries) SetBranchInvoiceItemResolved ¶ added in v1.1.1
func (q *Queries) SetBranchInvoiceItemResolved(ctx context.Context, arg SetBranchInvoiceItemResolvedParams) error
func (*Queries) SetBranchInvoiceSalesperson ¶ added in v1.1.0
func (q *Queries) SetBranchInvoiceSalesperson(ctx context.Context, arg SetBranchInvoiceSalespersonParams) (int64, error)
Salesperson Performance (api/salesperson_performance.go) and the tills' one-time report of who made their past sales. Only a salesperson of the invoice's own branch is accepted.
func (*Queries) SetBranchLoanCategory ¶ added in v1.1.1
func (q *Queries) SetBranchLoanCategory(ctx context.Context, arg SetBranchLoanCategoryParams) (Loan, error)
A till re-categorising one of its own loans (kashi-pos loan detail). Only the category: the rest of a branch loan stays as reported.
func (*Queries) SetBranchPlaceID ¶ added in v1.1.0
func (q *Queries) SetBranchPlaceID(ctx context.Context, arg SetBranchPlaceIDParams) error
func (*Queries) SetBranchRegisterActive ¶
func (q *Queries) SetBranchRegisterActive(ctx context.Context, arg SetBranchRegisterActiveParams) error
func (*Queries) SetBranchRegisterHiddenFromReports ¶
func (q *Queries) SetBranchRegisterHiddenFromReports(ctx context.Context, arg SetBranchRegisterHiddenFromReportsParams) error
func (*Queries) SetBranchRegisterQuickAccessMode ¶
func (q *Queries) SetBranchRegisterQuickAccessMode(ctx context.Context, arg SetBranchRegisterQuickAccessModeParams) (int64, error)
Later flip wins: a flip only applies if it's newer than the one stored, so a till's offline flip that arrives late can't undo a more recent one made in kashi (or vice versa). 0 rows = this flip was older, ignored.
func (*Queries) SetBranchRegisterReportedSettings ¶
func (q *Queries) SetBranchRegisterReportedSettings(ctx context.Context, arg SetBranchRegisterReportedSettingsParams) error
func (*Queries) SetBranchSettingsManagedLocally ¶
func (q *Queries) SetBranchSettingsManagedLocally(ctx context.Context, arg SetBranchSettingsManagedLocallyParams) (BranchSetting, error)
managed_locally is admin-owned, not branch-reported: a branch's settings push (UpsertBranchSettings) never touches it. Only the admin UI sets it.
func (*Queries) SetBranchTargetActive ¶
func (q *Queries) SetBranchTargetActive(ctx context.Context, arg SetBranchTargetActiveParams) (BranchTarget, error)
The sync-facing "delete" -- see 000046_branch_target_soft_delete.up.sql for why this flips a flag instead of removing the row.
func (*Queries) SetBranchTargetSeriesActive ¶
func (q *Queries) SetBranchTargetSeriesActive(ctx context.Context, arg SetBranchTargetSeriesActiveParams) (BranchTargetSeries, error)
func (*Queries) SetBranchUserActive ¶
func (q *Queries) SetBranchUserActive(ctx context.Context, arg SetBranchUserActiveParams) (BranchUser, error)
func (*Queries) SetBranchWhatsAppNumber ¶ added in v1.1.0
func (q *Queries) SetBranchWhatsAppNumber(ctx context.Context, arg SetBranchWhatsAppNumberParams) error
func (*Queries) SetCashboxAccountActive ¶
func (q *Queries) SetCashboxAccountActive(ctx context.Context, arg SetCashboxAccountActiveParams) (CashboxAccount, error)
func (*Queries) SetClientActive ¶
func (q *Queries) SetClientActive(ctx context.Context, arg SetClientActiveParams) error
func (*Queries) SetClientBranchIfNull ¶ added in v1.1.1
func (q *Queries) SetClientBranchIfNull(ctx context.Context, arg SetClientBranchIfNullParams) error
A client's home branch is the first branch they bought from, so a branch invoice only sets it when none is set yet. The client is resolved by either identity a till has used (client_uid, else the register's local client id), as in ListClientsForExport. updated_at is left alone: the column isn't synced to tills, so this mustn't make them re-pull the client.
func (*Queries) SetDefaultLowStockThreshold ¶
func (*Queries) SetDefaultWhatsAppNumber ¶ added in v1.1.0
func (*Queries) SetEmailResendAPIKey ¶ added in v1.1.0
func (*Queries) SetEmailSettings ¶ added in v1.1.0
func (q *Queries) SetEmailSettings(ctx context.Context, arg SetEmailSettingsParams) error
func (*Queries) SetProductAutofillRules ¶
func (q *Queries) SetProductAutofillRules(ctx context.Context, arg SetProductAutofillRulesParams) (AppSetting, error)
func (*Queries) SetProductCategory ¶
func (q *Queries) SetProductCategory(ctx context.Context, arg SetProductCategoryParams) error
func (*Queries) SetProductLowStockAlertsEnabled ¶
func (q *Queries) SetProductLowStockAlertsEnabled(ctx context.Context, arg SetProductLowStockAlertsEnabledParams) error
func (*Queries) SetProductVariantActive ¶
func (q *Queries) SetProductVariantActive(ctx context.Context, arg SetProductVariantActiveParams) error
func (*Queries) SetPurchaseStatus ¶
func (*Queries) SetPurchaseTotals ¶
func (q *Queries) SetPurchaseTotals(ctx context.Context, arg SetPurchaseTotalsParams) error
func (*Queries) SetRecurringExpenseActive ¶
func (q *Queries) SetRecurringExpenseActive(ctx context.Context, arg SetRecurringExpenseActiveParams) (RecurringExpense, error)
func (*Queries) SetRegisterUpdateStatus ¶
func (q *Queries) SetRegisterUpdateStatus(ctx context.Context, arg SetRegisterUpdateStatusParams) error
func (*Queries) SetRegistersTargetRelease ¶
func (q *Queries) SetRegistersTargetRelease(ctx context.Context, arg SetRegistersTargetReleaseParams) error
func (*Queries) SetReviewSettings ¶ added in v1.1.0
func (q *Queries) SetReviewSettings(ctx context.Context, arg SetReviewSettingsParams) error
func (*Queries) SetSalespersonActive ¶
func (q *Queries) SetSalespersonActive(ctx context.Context, arg SetSalespersonActiveParams) (Salesperson, error)
func (*Queries) SetSalespersonAttendanceID ¶ added in v1.1.0
func (q *Queries) SetSalespersonAttendanceID(ctx context.Context, arg SetSalespersonAttendanceIDParams) (Salesperson, error)
Set from kashi: from now on the till takes this value (see 000127).
func (*Queries) SetSalespersonColor ¶
func (q *Queries) SetSalespersonColor(ctx context.Context, arg SetSalespersonColorParams) (Salesperson, error)
func (*Queries) SetSalespersonIsSalesperson ¶ added in v1.1.0
func (q *Queries) SetSalespersonIsSalesperson(ctx context.Context, arg SetSalespersonIsSalespersonParams) (Salesperson, error)
Whether the till offers this person at checkout; attendance applies to everyone on the roster either way.
func (*Queries) SetStockCountNote ¶
func (q *Queries) SetStockCountNote(ctx context.Context, arg SetStockCountNoteParams) error
func (*Queries) SetStockCountStatus ¶
func (q *Queries) SetStockCountStatus(ctx context.Context, arg SetStockCountStatusParams) (StockCount, error)
func (*Queries) SetTransferAttachmentPath ¶
func (q *Queries) SetTransferAttachmentPath(ctx context.Context, arg SetTransferAttachmentPathParams) error
A new photo starts upright, whatever the previous one was turned to.
func (*Queries) SetTransferConfirmed ¶
func (*Queries) SetTransferItemReceivedQuantity ¶
func (q *Queries) SetTransferItemReceivedQuantity(ctx context.Context, arg SetTransferItemReceivedQuantityParams) (TransferItem, error)
The admin's own edit, keyed by transfer_item id directly (unlike the branch's own confirm, which only ever knows an item by variant) -- lets kashi correct a destination's count, or fill one in before it ever arrives, from the transfer detail dialog.
func (*Queries) SetTransferItemReceivedQuantityByVariant ¶
func (q *Queries) SetTransferItemReceivedQuantityByVariant(ctx context.Context, arg SetTransferItemReceivedQuantityByVariantParams) (int64, error)
The destination branch reporting what it actually counted for one line. Keyed by variant, not transfer_item id -- the till only ever knows an item by barcode/uid, resolved to variant_id the same way CreateBranchTransferRequestTx resolves an outgoing line.
func (*Queries) SetTransferStatus ¶
func (*Queries) SetUnknownItemSlotImage ¶ added in v1.1.1
func (q *Queries) SetUnknownItemSlotImage(ctx context.Context, arg SetUnknownItemSlotImageParams) error
The picture goes to the slot and to every other unit of its cart line. A slot already matched to a product keeps the picture it was matched with.
func (*Queries) SetUserAvatarColor ¶ added in v1.1.0
func (q *Queries) SetUserAvatarColor(ctx context.Context, arg SetUserAvatarColorParams) error
func (*Queries) SetVariantBarcode ¶
func (q *Queries) SetVariantBarcode(ctx context.Context, arg SetVariantBarcodeParams) (ProductVariant, error)
func (*Queries) SetWhatsAppMessageCost ¶ added in v1.1.0
func (*Queries) SetWhatsAppNumberPhone ¶ added in v1.1.0
func (q *Queries) SetWhatsAppNumberPhone(ctx context.Context, arg SetWhatsAppNumberPhoneParams) error
func (*Queries) SetWhatsAppSenderSettings ¶ added in v1.1.0
func (q *Queries) SetWhatsAppSenderSettings(ctx context.Context, arg SetWhatsAppSenderSettingsParams) error
func (*Queries) SetWhatsAppSettings ¶
func (q *Queries) SetWhatsAppSettings(ctx context.Context, arg SetWhatsAppSettingsParams) error
func (*Queries) ShareUnknownLineImages ¶ added in v1.1.8
A unit added to a cart line that already has its picture shares it.
func (*Queries) SkipDroppedWhatsAppMessages ¶ added in v1.1.9
func (q *Queries) SkipDroppedWhatsAppMessages(ctx context.Context, arg SkipDroppedWhatsAppMessagesParams) error
Messages the bridge dropped from a paused number's queue on resume (refs from POST /instance/resume): logged as sent when queued, they never went.
func (*Queries) SplitUnknownInvoiceItem ¶ added in v1.1.1
func (q *Queries) SplitUnknownInvoiceItem(ctx context.Context, arg SplitUnknownInvoiceItemParams) error
func (*Queries) SumBranchRevenueForRange ¶
func (q *Queries) SumBranchRevenueForRange(ctx context.Context, arg SumBranchRevenueForRangeParams) (int64, error)
Net sales revenue: same grand_total-sum convention as ListDailyIncome in branch_invoice.sql (returns already net out via their signed grand_total).
func (*Queries) SumClientLoyaltyPoints ¶
The redemption-time query: every branch's contribution to this client's loyalty balance, added up. Each branch is decisive for what it reports (loyalty_points_delta on branch_invoices) -- this never recomputes that number, only sums what's already been reported.
func (*Queries) TouchBranchRegister ¶
Bumps both the register's and its branch's last_seen_at: the branch is "seen" whenever any of its registers is.
func (*Queries) UnresolveHomeActivity ¶ added in v1.1.0
func (q *Queries) UnresolveHomeActivity(ctx context.Context, arg UnresolveHomeActivityParams) error
Reopens a resolved urgent row, pinning it on Home again.
func (*Queries) UnsetDefaultDiscountList ¶
func (*Queries) UnsetDefaultPriceList ¶
func (*Queries) UpdateAppReleaseNotes ¶
func (q *Queries) UpdateAppReleaseNotes(ctx context.Context, arg UpdateAppReleaseNotesParams) (AppRelease, error)
func (*Queries) UpdateAppSettings ¶
func (q *Queries) UpdateAppSettings(ctx context.Context, arg UpdateAppSettingsParams) (AppSetting, error)
func (*Queries) UpdateAsset ¶
func (*Queries) UpdateAssetCategory ¶
func (q *Queries) UpdateAssetCategory(ctx context.Context, arg UpdateAssetCategoryParams) (AssetCategory, error)
func (*Queries) UpdateAttributeValue ¶
func (q *Queries) UpdateAttributeValue(ctx context.Context, arg UpdateAttributeValueParams) (AttributesValue, error)
func (*Queries) UpdateBranchAttendanceEvent ¶
func (q *Queries) UpdateBranchAttendanceEvent(ctx context.Context, arg UpdateBranchAttendanceEventParams) (BranchAttendanceEvent, error)
func (*Queries) UpdateBranchRegister ¶
func (q *Queries) UpdateBranchRegister(ctx context.Context, arg UpdateBranchRegisterParams) (BranchRegister, error)
func (*Queries) UpdateBranchRegisterAPIKeyHash ¶
func (q *Queries) UpdateBranchRegisterAPIKeyHash(ctx context.Context, arg UpdateBranchRegisterAPIKeyHashParams) error
func (*Queries) UpdateBranchSalespersonName ¶
func (q *Queries) UpdateBranchSalespersonName(ctx context.Context, arg UpdateBranchSalespersonNameParams) (Salesperson, error)
func (*Queries) UpdateBranchTarget ¶
func (q *Queries) UpdateBranchTarget(ctx context.Context, arg UpdateBranchTargetParams) (BranchTarget, error)
func (*Queries) UpdateBranchTargetSeries ¶
func (q *Queries) UpdateBranchTargetSeries(ctx context.Context, arg UpdateBranchTargetSeriesParams) (BranchTargetSeries, error)
Only affects future periods -- see CreateGeneratedBranchTarget's note on generation snapshotting a series' fields, never joining them live.
func (*Queries) UpdateBranchUser ¶
func (q *Queries) UpdateBranchUser(ctx context.Context, arg UpdateBranchUserParams) (BranchUser, error)
func (*Queries) UpdateCashbox ¶
func (*Queries) UpdateCashboxAccount ¶
func (q *Queries) UpdateCashboxAccount(ctx context.Context, arg UpdateCashboxAccountParams) (CashboxAccount, error)
func (*Queries) UpdateClient ¶
func (*Queries) UpdateClientPhone ¶ added in v1.1.3
func (q *Queries) UpdateClientPhone(ctx context.Context, arg UpdateClientPhoneParams) error
func (*Queries) UpdateColor ¶
func (*Queries) UpdateCoupon ¶
func (*Queries) UpdateCouponCategory ¶
func (q *Queries) UpdateCouponCategory(ctx context.Context, arg UpdateCouponCategoryParams) (CouponCategory, error)
func (*Queries) UpdateCouponType ¶
func (q *Queries) UpdateCouponType(ctx context.Context, arg UpdateCouponTypeParams) (CouponType, error)
func (*Queries) UpdateCurrency ¶
func (*Queries) UpdateDeal ¶ added in v1.1.6
func (*Queries) UpdateDiscountList ¶
func (q *Queries) UpdateDiscountList(ctx context.Context, arg UpdateDiscountListParams) error
func (*Queries) UpdateDiscountListItem ¶
func (q *Queries) UpdateDiscountListItem(ctx context.Context, arg UpdateDiscountListItemParams) error
func (*Queries) UpdateDiscountListRule ¶ added in v1.1.7
func (q *Queries) UpdateDiscountListRule(ctx context.Context, arg UpdateDiscountListRuleParams) (int64, error)
Saved in place: the rows a rule wrote carry its id (rule_id), so a rule re-created with a new id would have every one of them rewritten.
func (*Queries) UpdateDiscountListRuleGroup ¶ added in v1.1.7
func (q *Queries) UpdateDiscountListRuleGroup(ctx context.Context, arg UpdateDiscountListRuleGroupParams) (int64, error)
Saved in place, so a group (and its rules) keeps its id.
func (*Queries) UpdateEmailSchedule ¶ added in v1.1.0
func (q *Queries) UpdateEmailSchedule(ctx context.Context, arg UpdateEmailScheduleParams) (EmailSchedule, error)
func (*Queries) UpdateEmployee ¶
func (*Queries) UpdateEmployeeSalary ¶
func (*Queries) UpdateExpense ¶
func (*Queries) UpdateExpenseCategory ¶
func (q *Queries) UpdateExpenseCategory(ctx context.Context, arg UpdateExpenseCategoryParams) (ExpenseCategory, error)
func (*Queries) UpdateInventory ¶
func (q *Queries) UpdateInventory(ctx context.Context, arg UpdateInventoryParams) error
func (*Queries) UpdateInvoiceDiscount ¶ added in v1.1.8
func (q *Queries) UpdateInvoiceDiscount(ctx context.Context, arg UpdateInvoiceDiscountParams) (InvoiceDiscount, error)
func (*Queries) UpdateInvoiceType ¶
func (q *Queries) UpdateInvoiceType(ctx context.Context, arg UpdateInvoiceTypeParams) (InvoiceType, error)
func (*Queries) UpdateLoan ¶
Central loans only -- branch-origin loans are a synced record of what a branch reported and stay read-only here (WHERE origin filter makes a branch-loan id return no rows, surfaced as a 404 by the handler).
func (*Queries) UpdateLoanCategory ¶
func (q *Queries) UpdateLoanCategory(ctx context.Context, arg UpdateLoanCategoryParams) (LoanCategory, error)
func (*Queries) UpdatePriceList ¶
func (q *Queries) UpdatePriceList(ctx context.Context, arg UpdatePriceListParams) error
func (*Queries) UpdatePriceListItem ¶
func (q *Queries) UpdatePriceListItem(ctx context.Context, arg UpdatePriceListItemParams) error
func (*Queries) UpdateProduct ¶
func (q *Queries) UpdateProduct(ctx context.Context, arg UpdateProductParams) error
func (*Queries) UpdateProductAttribute ¶
func (q *Queries) UpdateProductAttribute(ctx context.Context, arg UpdateProductAttributeParams) error
func (*Queries) UpdateProductCategory ¶
func (q *Queries) UpdateProductCategory(ctx context.Context, arg UpdateProductCategoryParams) (ProductCategory, error)
func (*Queries) UpdateProductLowStockThreshold ¶
func (q *Queries) UpdateProductLowStockThreshold(ctx context.Context, arg UpdateProductLowStockThresholdParams) error
A null threshold clears the override, falling back to the app-wide default.
func (*Queries) UpdateProductVariant ¶
func (q *Queries) UpdateProductVariant(ctx context.Context, arg UpdateProductVariantParams) (ProductVariant, error)
price is deliberately not settable here -- see CreateProductVariant.
func (*Queries) UpdateProductVariantAvgCost ¶
func (q *Queries) UpdateProductVariantAvgCost(ctx context.Context, arg UpdateProductVariantAvgCostParams) error
Roll the variant's global moving-average cost forward on a stock receipt. current_qty is the on-hand across all locations before this receipt.
func (*Queries) UpdateRecurringExpenseNextDue ¶
func (q *Queries) UpdateRecurringExpenseNextDue(ctx context.Context, arg UpdateRecurringExpenseNextDueParams) (RecurringExpense, error)
func (*Queries) UpdateSalesperson ¶
func (q *Queries) UpdateSalesperson(ctx context.Context, arg UpdateSalespersonParams) (Salesperson, error)
func (*Queries) UpdateSecuritySettings ¶ added in v1.1.0
func (q *Queries) UpdateSecuritySettings(ctx context.Context, arg UpdateSecuritySettingsParams) (SecuritySetting, error)
func (*Queries) UpdateSize ¶
func (*Queries) UpdateTransfer ¶
func (q *Queries) UpdateTransfer(ctx context.Context, arg UpdateTransferParams) error
func (*Queries) UpdateUser ¶
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
func (*Queries) UpdateWhatsAppNumberLabel ¶ added in v1.1.0
func (q *Queries) UpdateWhatsAppNumberLabel(ctx context.Context, arg UpdateWhatsAppNumberLabelParams) (WhatsappNumber, error)
func (*Queries) UpsertAttributeValue ¶
func (q *Queries) UpsertAttributeValue(ctx context.Context, arg UpsertAttributeValueParams) (AttributesValue, error)
func (*Queries) UpsertBranchSettings ¶
func (q *Queries) UpsertBranchSettings(ctx context.Context, arg UpsertBranchSettingsParams) (BranchSetting, error)
func (*Queries) UpsertBranchSyncConflict ¶
func (q *Queries) UpsertBranchSyncConflict(ctx context.Context, arg UpsertBranchSyncConflictParams) (BranchSyncConflict, error)
Idempotent on (branch_id, entity, ref): a retried outbox push re-reports the same conflict. A row an admin already resolved/dismissed is left alone (nothing to re-open).
func (*Queries) UpsertCashboxAccountOverride ¶
func (q *Queries) UpsertCashboxAccountOverride(ctx context.Context, arg UpsertCashboxAccountOverrideParams) (BranchCashboxAccount, error)
func (*Queries) UpsertClientLink ¶
func (q *Queries) UpsertClientLink(ctx context.Context, arg UpsertClientLinkParams) error
func (*Queries) UpsertDefaultBranchSettings ¶
func (q *Queries) UpsertDefaultBranchSettings(ctx context.Context, settings json.RawMessage) (DefaultBranchSetting, error)
func (*Queries) UpsertDiscountListBranch ¶
func (q *Queries) UpsertDiscountListBranch(ctx context.Context, arg UpsertDiscountListBranchParams) error
func (*Queries) UpsertDiscountListOptionItem ¶ added in v1.1.6
func (q *Queries) UpsertDiscountListOptionItem(ctx context.Context, arg UpsertDiscountListOptionItemParams) error
func (*Queries) UpsertGoogleReview ¶ added in v1.1.0
func (q *Queries) UpsertGoogleReview(ctx context.Context, arg UpsertGoogleReviewParams) error
func (*Queries) UpsertIPBan ¶ added in v1.1.0
func (q *Queries) UpsertIPBan(ctx context.Context, arg UpsertIPBanParams) error
func (*Queries) UpsertInventoryAssetQuantity ¶
func (q *Queries) UpsertInventoryAssetQuantity(ctx context.Context, arg UpsertInventoryAssetQuantityParams) (InventoriesAsset, error)
Reactivates inventories_assets (created 000012, never wired up until now): per-location unit counts for fixed assets, feeding the Assets Treemap. One assets row is a distinct item *type*; the same asset can sit in more than one location, each with its own counted quantity here.
func (*Queries) UpsertOversoldConflict ¶
func (q *Queries) UpsertOversoldConflict(ctx context.Context, arg UpsertOversoldConflictParams) (BranchSyncConflict, error)
One open "oversold" alert per (branch, variant). Unlike UpsertBranchSyncConflict, an alert an admin already resolved is reopened: going negative again after a fix is a new problem.
func (*Queries) UpsertPriceListBranch ¶
func (q *Queries) UpsertPriceListBranch(ctx context.Context, arg UpsertPriceListBranchParams) error
func (*Queries) UpsertProductAttribute ¶
func (q *Queries) UpsertProductAttribute(ctx context.Context, arg UpsertProductAttributeParams) error
func (*Queries) UpsertRolePermission ¶
func (q *Queries) UpsertRolePermission(ctx context.Context, arg UpsertRolePermissionParams) error
func (*Queries) UpsertVisitorIP ¶ added in v1.1.0
func (q *Queries) UpsertVisitorIP(ctx context.Context, arg UpsertVisitorIPParams) error
The Security page and its request middleware (api/security.go). Folds one flush's worth of requests from an IP into its row: counters add up, the "last" columns and the location are overwritten.
func (*Queries) VisitorCountries ¶ added in v1.1.0
func (q *Queries) VisitorCountries(ctx context.Context) ([]VisitorCountriesRow, error)
IPs and requests per country, busiest first.
func (*Queries) WaiveUnknownItemSlots ¶ added in v1.1.1
func (q *Queries) WaiveUnknownItemSlots(ctx context.Context, arg WaiveUnknownItemSlotsParams) (int64, error)
Lets units through with no picture. A unit that already has one is left alone.
func (*Queries) WhatsAppClientsByPhoneTail ¶ added in v1.1.0
func (q *Queries) WhatsAppClientsByPhoneTail(ctx context.Context, tails []string) ([]WhatsAppClientsByPhoneTailRow, error)
Names for a rule's phones, matched on their last 8 digits (whatsAppSamePhone).
func (*Queries) WhatsAppFailureReasons ¶ added in v1.1.0
func (q *Queries) WhatsAppFailureReasons(ctx context.Context, arg WhatsAppFailureReasonsParams) ([]WhatsAppFailureReasonsRow, error)
Both kashi's failures (Meta refused the send) and Meta's own (accepted, then couldn't deliver).
func (*Queries) WhatsAppFailureWatch ¶ added in v1.1.1
func (q *Queries) WhatsAppFailureWatch(ctx context.Context) (WhatsAppFailureWatchRow, error)
Sale messages that failed lately (a retried one that then went out is no longer counted, see DeleteFailedWhatsAppMessagesForInvoice), and the latest failure's reason.
func (*Queries) WhatsAppMessageTotals ¶ added in v1.1.0
func (q *Queries) WhatsAppMessageTotals(ctx context.Context, arg WhatsAppMessageTotalsParams) (WhatsAppMessageTotalsRow, error)
delivered/read/undelivered come from Meta's webhook (delivery_status).
func (*Queries) WhatsAppMessagesByBranch ¶ added in v1.1.0
func (q *Queries) WhatsAppMessagesByBranch(ctx context.Context, arg WhatsAppMessagesByBranchParams) ([]WhatsAppMessagesByBranchRow, error)
func (*Queries) WhatsAppMessagesByDay ¶ added in v1.1.0
func (q *Queries) WhatsAppMessagesByDay(ctx context.Context, arg WhatsAppMessagesByDayParams) ([]WhatsAppMessagesByDayRow, error)
Days are Beirut calendar days, like the rest of the business.
func (*Queries) WhatsAppMessagesByHour ¶ added in v1.1.0
func (q *Queries) WhatsAppMessagesByHour(ctx context.Context, arg WhatsAppMessagesByHourParams) ([]WhatsAppMessagesByHourRow, error)
func (*Queries) WhatsAppMessagesByRule ¶ added in v1.1.0
func (q *Queries) WhatsAppMessagesByRule(ctx context.Context, arg WhatsAppMessagesByRuleParams) ([]WhatsAppMessagesByRuleRow, error)
” rule_name is "no rule matched" (the default template).
func (*Queries) WhatsAppNumberForBranch ¶ added in v1.1.0
func (q *Queries) WhatsAppNumberForBranch(ctx context.Context, arg WhatsAppNumberForBranchParams) (WhatsappNumber, error)
The number a branch's sale goes out from: its own, else the default, else (no default, as when the first number was removed) the oldest one. A number whose minimum invoice the sale is under is passed over for the next one.
func (*Queries) WhatsAppSentForInvoice ¶ added in v1.1.0
func (q *Queries) WhatsAppSentForInvoice(ctx context.Context, arg WhatsAppSentForInvoiceParams) (bool, error)
A till that reports the same sale twice doesn't message the client twice.
func (*Queries) WhatsAppTopRecipients ¶ added in v1.1.0
func (q *Queries) WhatsAppTopRecipients(ctx context.Context, arg WhatsAppTopRecipientsParams) ([]WhatsAppTopRecipientsRow, error)
type QuickAccessItemInput ¶
QuickAccessItemInput is one card of a branch's Quick Access list, in the order the list is given (its index becomes the card's position).
type RecordEmailScheduleRunParams ¶ added in v1.1.0
type RecordSecurityAlertParams ¶ added in v1.1.0
type RecordWhatsAppPollVoteParams ¶ added in v1.1.0
type RecordWhatsAppPollVoteRow ¶ added in v1.1.0
type RecurringExpense ¶
type RecurringExpense struct {
ID int64 `json:"id"`
Description string `json:"description"`
Amount int64 `json:"amount"`
CurrencyCode string `json:"currency_code"`
IntervalUnit string `json:"interval_unit"`
IntervalCount int32 `json:"interval_count"`
NextDueAt time.Time `json:"next_due_at"`
Active bool `json:"active"`
CreatedAt time.Time `json:"created_at"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type RedeemCouponParams ¶
type RedeemCouponParams struct {
Code string `json:"code"`
RedeemedBranchID sql.NullInt64 `json:"redeemed_branch_id"`
RedeemedInvoiceRef sql.NullString `json:"redeemed_invoice_ref"`
}
type RenameRoleParams ¶
type ReplaceBranchExpenseImageFileParams ¶ added in v1.1.0
type ReplaceBranchShiftReceiptImageFileParams ¶ added in v1.1.0
type ReportBranchSalesParams ¶ added in v1.1.0
type ReportBranchSalesRow ¶ added in v1.1.0
type ReportCategorySalesParams ¶ added in v1.1.0
type ReportCategorySalesRow ¶ added in v1.1.0
type ReportCostOfGoodsParams ¶ added in v1.1.0
type ReportCostOfGoodsRow ¶ added in v1.1.0
type ReportCostOfGoodsSeriesParams ¶ added in v1.1.0
type ReportCostOfGoodsSeriesRow ¶ added in v1.1.0
type ReportDailyCostedParams ¶ added in v1.1.0
type ReportDailyCostedRow ¶ added in v1.1.0
type ReportDailySalesParams ¶ added in v1.1.0
type ReportDailySalesRow ¶ added in v1.1.0
type ReportHourlySalesParams ¶ added in v1.1.0
type ReportHourlySalesRow ¶ added in v1.1.0
type ReportPaymentMethodsParams ¶ added in v1.1.0
type ReportPaymentMethodsRow ¶ added in v1.1.0
type ReportSaleInvoice ¶ added in v1.1.0
type ReportSaleLine ¶ added in v1.1.0
type ReportTargetsInRangeParams ¶ added in v1.1.0
type ReportTargetsInRangeRow ¶ added in v1.1.0
type ReportTopProductsParams ¶ added in v1.1.0
type ReportTopProductsRow ¶ added in v1.1.0
type RequestUnknownItemHelpParams ¶ added in v1.1.1
type ResolveHomeActivityParams ¶ added in v1.1.0
type ResolveVariantPricesRow ¶
type ReturnInvoice ¶
type ReturnInvoiceItem ¶
type ReturnInvoiceTxParams ¶
type ReturnInvoiceTxParams struct {
CashboxID int64 `json:"cashbox_id"`
ShiftID int64 `json:"shift_id"`
Year int32 `json:"year"`
ClientID int64 `json:"client_id"`
InventoryID int64 `json:"inventory_id"`
Discount int16 `json:"discount"`
SubTotal int64 `json:"sub_total"`
DiscountedTotal int64 `json:"discounted_total"`
GrandTotal int64 `json:"grand_total"`
SalesInvoiceID int64 `json:"sales_invoice_id"`
CashboxAccountID int64 `json:"cashbox_account_id"`
PriceListID sql.NullInt64 `json:"price_list_id"`
SalespersonID sql.NullInt64 `json:"salesperson_id"`
CreatedBy sql.NullInt64 `json:"created_by"`
Items []ReturnInvoiceItem `json:"items"`
}
type ReturnInvoiceTxResult ¶
type ReturnInvoiceTxResult struct {
Invoice Invoice `json:"invoice"`
SalesInvoiceID int64 `json:"sales_invoice_id"`
Entry Entry `json:"entry"`
ShiftsAccountsBalance ShiftsAccountsBalance `json:"shift_account_balance"`
}
type ReviewClicksTotalParams ¶ added in v1.1.0
type ReviewFunnelByBranchParams ¶ added in v1.1.0
type ReviewFunnelByBranchRow ¶ added in v1.1.0
type ReviewFunnelByDayParams ¶ added in v1.1.0
type ReviewFunnelByDayRow ¶ added in v1.1.0
type ReviewFunnelParams ¶ added in v1.1.0
type ReviewFunnelRow ¶ added in v1.1.0
type ReviewLinkClick ¶ added in v1.1.0
type RolePermission ¶
type RotateBranchExpenseImageParams ¶ added in v1.1.0
type RotateBranchShiftReceiptImageParams ¶ added in v1.1.0
type RotateTransferAttachmentParams ¶ added in v1.1.0
type SQLStore ¶
type SQLStore struct {
*Queries
// contains filtered or unexported fields
}
provides all the functions to execute SQL queries
func (*SQLStore) AddVariantTx ¶
func (store *SQLStore) AddVariantTx(ctx context.Context, arg AddVariantTxParams) (ProductVariant, error)
AddVariantTx adds a single variant to an existing product, reusing the same auto-barcode generation CreateProductTx uses for the first variant.
func (*SQLStore) ApplyBranchSettlementTx ¶
func (store *SQLStore) ApplyBranchSettlementTx(ctx context.Context, arg ApplyBranchSettlementTxParams) (ApplyBranchSettlementTxResult, error)
ApplyBranchSettlementTx records a branch "change settlement" edit and, if the re-settled sale is already on the cloud AND still belongs to the branch's open shift, replays the new per-account split onto that sale's branch_invoice_payments so the admin view stays correct.
Three cases, all recorded (settlement row + its payment lines, for the audit trail) so a retried outbox entry always gets its 200:
- sale on cloud, its shift still open -> replayed (status "applied")
- sale not on cloud yet -> not replayed (status "pending")
- sale on cloud, its shift already closed -> not replayed, and the caller is told Frozen so it doesn't emit a "settlement changed" notification (status "ignored_shift_closed")
The whole thing is one transaction so a partial replay can never leave the sale's payments half-rewritten.
func (*SQLStore) BatchSetEmployeeSalaries ¶
func (store *SQLStore) BatchSetEmployeeSalaries(ctx context.Context, args []UpdateEmployeeSalaryParams) ([]Employee, error)
BatchSetEmployeeSalaries applies a batch of payroll edits from the admin "edit salaries" table in one transaction, so a partial save can never leave half the roster on new figures and half on old ones -- if any row's id is unknown (0 rows updated) or violates a check constraint, the whole batch rolls back. Returns the updated rows in input order.
func (*SQLStore) CancelPurchaseTx ¶
func (store *SQLStore) CancelPurchaseTx(ctx context.Context, purchaseID int64, cancelledBy sql.NullInt64) (PurchaseReceiveTxResult, error)
CancelPurchaseTx moves a purchase to 'cancelled'. A draft purchase never touched stock, so this just flips status. A received purchase already moved stock in, so this unwinds every line with a compensating negative movement before flipping status -- on-hand returns to exactly where it was before the purchase was received.
func (*SQLStore) CancelStockCountTx ¶
CancelStockCountTx discards a draft count. A count that has already been posted has moved stock and is not reversible through this path.
func (*SQLStore) CancelTransferTx ¶
func (store *SQLStore) CancelTransferTx(ctx context.Context, transferID int64, cancelledBy sql.NullInt64) (TransferStageTxResult, error)
CancelTransferTx moves a transfer to 'cancelled', unwinding whichever legs already ran: a draft never touched stock; a dispatched transfer returns its lines to the source inventory; a received transfer also removes them again from the destination. Either way on-hand ends up exactly where it was before the transfer started.
func (*SQLStore) ConfirmBranchTransferTx ¶
func (store *SQLStore) ConfirmBranchTransferTx(ctx context.Context, arg ConfirmBranchTransferTxParams) (Transfer, error)
ConfirmBranchTransferTx is the destination branch reporting what it actually counted on physical receipt. It never moves stock itself -- that's still TransferApproveTx's job, reading these counts back via transfer_items.received_quantity -- so a confirmation can arrive (and be re-sent, overwriting the previous one) any time before or after kashi's approval with no ordering requirement between the two.
An item the till reports that doesn't resolve to a known variant, or that doesn't match any line on the transfer, is silently skipped rather than failing the whole confirmation -- kashi's admin sees the gap (that line's received_quantity stays NULL) and can follow up, same tolerance CreateBranchInvoiceTx gives an unresolved barcode.
func (*SQLStore) CreateBatchTx ¶
func (store *SQLStore) CreateBatchTx(ctx context.Context, arg CreateBatchTxParams) (CreateBatchTxResult, error)
CreateBatchTx snapshots a purchase invoice into a batch: one batch_items row per variant line on the purchase, freezing quantity and cost as of right now. Asset lines (no variant_id) are skipped -- batches track SKUs.
func (*SQLStore) CreateBranchInvoiceTx ¶
func (store *SQLStore) CreateBranchInvoiceTx(ctx context.Context, arg CreateBranchInvoiceTxParams) (CreateBranchInvoiceTxResult, error)
CreateBranchInvoiceTx inserts a branch invoice header and its line items together, so a crash mid-write can never leave an idempotency-key row with no items behind (which would make a legitimate retry think the invoice was already fully recorded).
func (*SQLStore) CreateBranchTransferRequestTx ¶
func (store *SQLStore) CreateBranchTransferRequestTx(ctx context.Context, arg CreateBranchTransferRequestTxParams) (CreateBranchTransferRequestTxResult, error)
CreateBranchTransferRequestTx records a till-proposed transfer out of its own store inventory. It moves no stock -- that only happens on TransferApproveTx -- so every line must resolve to a real central variant up front (unlike a branch invoice line, which is recorded even unresolved and just skips the stock effect): a transfer with an item kashi can't identify would leave a central admin approving a request they can't actually see the contents of.
func (*SQLStore) CreateBranchTx ¶
func (store *SQLStore) CreateBranchTx(ctx context.Context, arg CreateBranchTxParams) (CreateBranchTxResult, error)
CreateBranchTx creates a branch together with its first register and its own store inventory, so branch (POS) sales can decrement central stock for that location from day one.
func (*SQLStore) CreateProductTx ¶
func (store *SQLStore) CreateProductTx(ctx context.Context, arg CreateProductTxParams) (CreateProductTxResult, error)
CreateProductTx creates a product together with its first variant. A product is never created without at least one sellable variant — a product with zero variants has no barcode a till could ring up, so there'd be nothing to actually sell.
func (*SQLStore) CreatePurchaseTx ¶
func (store *SQLStore) CreatePurchaseTx(ctx context.Context, arg CreatePurchaseTxParams) (CreatePurchaseTxResult, error)
CreatePurchaseTx writes a draft purchase invoice and its lines together, and stamps the header subtotal/grand_total from the lines. It does not touch stock -- that happens on receive.
func (*SQLStore) CreateTransferTx ¶
func (store *SQLStore) CreateTransferTx(ctx context.Context, arg CreateTransferTxParams) (CreateTransferTxResult, error)
CreateTransferTx writes a draft transfer and its lines. No stock moves until the transfer is dispatched.
func (*SQLStore) DeleteBranchTargetSeriesTx ¶
func (store *SQLStore) DeleteBranchTargetSeriesTx(ctx context.Context, seriesID int64) (BranchTargetSeries, error)
DeleteBranchTargetSeriesTx removes a recurring series and every period it generated. Deactivating the occurrences before deleting the series row matters: branch_targets.series_id is ON DELETE SET NULL, so deleting the series first would silently orphan those rows as still-active fixed targets instead of removing them.
func (*SQLStore) FireRecurringExpenseTx ¶
func (store *SQLStore) FireRecurringExpenseTx(ctx context.Context, recurring RecurringExpense) (Expense, error)
FireRecurringExpenseTx creates the real expense row for a due recurring template and advances its next_due_at in the same transaction, so a crash between the two can never leave a template stuck re-firing the same due date on the next scheduler tick (which would create duplicate expenses) or advanced with no expense created (which would silently drop one).
func (*SQLStore) ImportBranchQuickAccessTx ¶
func (store *SQLStore) ImportBranchQuickAccessTx(ctx context.Context, branchID int64, items []QuickAccessItemInput) (bool, error)
ImportBranchQuickAccessTx seeds a branch's list from a till's own list -- only the first time any list is set up for the branch. It reports whether it imported; false means the branch already had a list, left untouched. An empty list imports nothing and doesn't count as setting one up, so the branch's next register (which may have real cards) can still seed it.
func (*SQLStore) PostStockCountTx ¶
func (store *SQLStore) PostStockCountTx(ctx context.Context, id int64, postedBy sql.NullInt64) (PostStockCountTxResult, error)
PostStockCountTx moves a draft count to 'posted'. For each line it compares the counted quantity against *live* on-hand (not the snapshot taken at save time, which may be stale by now) and writes exactly one applyStockMovement covering the difference -- a line whose live on-hand already matches the count writes no movement. Metadata records both figures so drift between counting and posting stays visible.
func (*SQLStore) PurchaseReceiveTx ¶
func (store *SQLStore) PurchaseReceiveTx(ctx context.Context, arg PurchaseReceiveTxParams) (PurchaseReceiveTxResult, error)
PurchaseReceiveTx moves a draft purchase to 'received': every product line lands in the purchase's destination inventory as a 'purchase' stock movement, rolls that SKU's per-location and global moving-average cost forward, and records the supplier's cost for the product. Idempotent -- a purchase that is already received is returned unchanged.
func (*SQLStore) ReplaceBranchQuickAccessTx ¶
func (store *SQLStore) ReplaceBranchQuickAccessTx(ctx context.Context, branchID int64, items []QuickAccessItemInput) error
ReplaceBranchQuickAccessTx saves a branch's whole list, as edited in the admin UI. It also marks the list as set up, so a till reporting its own list afterwards can't overwrite it (see ImportBranchQuickAccessTx).
func (*SQLStore) ReplaceDiscountListRuleGroupsTx ¶ added in v1.1.6
func (store *SQLStore) ReplaceDiscountListRuleGroupsTx(ctx context.Context, listID int64, groups []DiscountListRuleGroupInput) error
ReplaceDiscountListRuleGroupsTx makes a list's rule groups exactly groups, in that order. Rules are numbered straight through the groups, so the first rule that is on and matches wins, top to bottom.
Groups and rules that are already saved (their ID) are updated in place and keep their ids; only new ones are inserted and only those left out are deleted. The rows a rule wrote carry its id, so re-creating every rule would have every one of those rows deleted and written again on each save -- most of the 13s a save of the Centro list took. One transaction, so the rows are worked out once (000200, at commit) from the finished set.
func (*SQLStore) ReplaceDiscountListRulesTx ¶ added in v1.1.6
func (store *SQLStore) ReplaceDiscountListRulesTx(ctx context.Context, listID int64, rules []DiscountListRuleInput) error
ReplaceDiscountListRulesTx makes a list's rules exactly rules, all on, in one group named "Rules" -- a list's rules as they were before groups.
func (*SQLStore) ReplaceWhatsAppRulesTx ¶ added in v1.1.0
func (store *SQLStore) ReplaceWhatsAppRulesTx(ctx context.Context, rules []CreateWhatsAppRuleParams) ([]WhatsappRule, error)
ReplaceWhatsAppRulesTx swaps the whole rule list for rules, in order: the WhatsApp page saves the list as one edit, like the auto-fill rules. Positions are taken from the slice order.
func (*SQLStore) ResolveUnknownItemsTx ¶ added in v1.1.1
func (store *SQLStore) ResolveUnknownItemsTx(ctx context.Context, slotIDs []int64, variantID int64) error
ResolveUnknownItemsTx says the given pictured units were really variantID: each unit's sold line is split off the unknown line (or relabelled whole, when it was the line's last unit) with that variant's uid, central stock is reduced by one per unit exactly as a normal sale would have, and the slot is stamped resolved. Prices paid are untouched. All or nothing.
func (*SQLStore) ReturnInvoiceTx ¶
func (store *SQLStore) ReturnInvoiceTx(ctx context.Context, arg ReturnInvoiceTxParams) (ReturnInvoiceTxResult, error)
func (*SQLStore) SalesInvoiceTx ¶
func (store *SQLStore) SalesInvoiceTx(ctx context.Context, arg SalesInvoiceTxParams) (SalesInvoiceTxResult, error)
func (*SQLStore) SaveInvoiceDiscountTx ¶ added in v1.1.8
func (store *SQLStore) SaveInvoiceDiscountTx(ctx context.Context, arg SaveInvoiceDiscountTxParams) (InvoiceDiscount, error)
SaveInvoiceDiscountTx writes a rule and the branches it is for together, so a till never pulls a rule whose branch list is half written. Saving moves updated_at, which re-sends the rule to every till -- a branch taken off it learns that way (000212).
func (*SQLStore) SaveReviewSettingsTx ¶ added in v1.1.0
func (store *SQLStore) SaveReviewSettingsTx(ctx context.Context, settings SetReviewSettingsParams, branches []SetBranchPlaceIDParams) error
SaveReviewSettingsTx saves the review link settings and every branch's own Google place together, so the Reviews tab never half-saves.
func (*SQLStore) SaveRolePermissionsTx ¶
func (store *SQLStore) SaveRolePermissionsTx(ctx context.Context, roleID int64, perms []RolePermission) error
SaveRolePermissionsTx replaces a role's permission rows wholesale, so the role never briefly has a half-applied mix of old and new access.
func (*SQLStore) SaveStockCountTx ¶
func (store *SQLStore) SaveStockCountTx(ctx context.Context, arg SaveStockCountTxParams) (StockCount, error)
SaveStockCountTx writes (or rewrites) a draft stock count's header and lines. It re-snapshots system_quantity from live on-hand and recomputes difference every time -- saving never touches stock. Editing a count that is no longer a draft is refused.
func (*SQLStore) SaveWhatsAppSenderTx ¶ added in v1.1.0
func (store *SQLStore) SaveWhatsAppSenderTx(ctx context.Context, settings SetWhatsAppSenderSettingsParams, branches []SetBranchWhatsAppNumberParams) error
SaveWhatsAppSenderTx saves how messages go out and which number each branch sends from, together.
func (*SQLStore) SetProductSaleOptionsTx ¶ added in v1.1.6
func (store *SQLStore) SetProductSaleOptionsTx(ctx context.Context, entries []string, saleOptionIDs []int64) (int, error)
SetProductSaleOptionsTx makes the options of every product named by entries exactly saleOptionIDs: an empty set clears them. One transaction, so a till pulling mid-way never sees a product with its options half replaced. Returns how many products it matched.
func (*SQLStore) StockAdjustmentTx ¶
func (store *SQLStore) StockAdjustmentTx(ctx context.Context, arg StockAdjustmentTxParams) (StockAdjustmentTxResult, error)
func (*SQLStore) TransferApproveTx ¶
func (store *SQLStore) TransferApproveTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
TransferApproveTx is how a kashi admin approves a branch-requested transfer: dispatch and receive collapsed into one atomic step (a branch's request either lands in full or not at all -- there's no "in transit" state a human approval workflow needs to expose, unlike the manual draft->dispatched->received flow above, which stays separate for that reason). Legal from 'requested' or 'draft', so it also works as a one-click approve for a transfer a kashi operator drafted centrally.
func (*SQLStore) TransferDispatchTx ¶
func (store *SQLStore) TransferDispatchTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
TransferDispatchTx moves a draft transfer to 'dispatched': every product line leaves the source inventory as a 'transfer_out' movement. Stock in transit is simply absent from both locations until received.
func (*SQLStore) TransferReceiveTx ¶
func (store *SQLStore) TransferReceiveTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
TransferReceiveTx moves a dispatched transfer to 'received': every product line lands in the destination inventory as a 'transfer_in' movement, carrying the source location's moving-average cost so the destination's average is blended correctly. The variant's global average is untouched -- a transfer moves neither total quantity nor total cost.
func (*SQLStore) UpdateProductTx ¶
func (store *SQLStore) UpdateProductTx(ctx context.Context, arg UpdateProductTxParams) (UpdateProductTxResult, error)
UpdateProductTx edits the shared product fields and upserts its attributes in one transaction -- the write-side mirror of CreateProductTx's attribute handling, for products that already exist.
func (*SQLStore) UpdateWhatsAppNumberTx ¶ added in v1.1.0
func (store *SQLStore) UpdateWhatsAppNumberTx(ctx context.Context, id int64, label string, makeDefault bool, minTotalCents int64) (WhatsappNumber, error)
UpdateWhatsAppNumberTx renames a number, sets the smallest invoice it sends for and, when makeDefault, makes it the one number every branch without its own sends from.
type SaleOption ¶ added in v1.1.6
type SalesInvoice ¶
type SalesInvoice struct {
InvoiceID int64 `json:"invoice_id"`
}
type SalesInvoiceItem ¶
type SalesInvoiceTxParams ¶
type SalesInvoiceTxParams struct {
CashboxID int64 `json:"cashbox_id"`
ShiftID int64 `json:"shift_id"`
Year int32 `json:"year"`
ClientID int64 `json:"client_id"`
InventoryID int64 `json:"inventory_id"`
Discount int16 `json:"discount"`
SubTotal int64 `json:"sub_total"`
DiscountedTotal int64 `json:"discounted_total"`
GrandTotal int64 `json:"grand_total"`
Items []SalesInvoiceItem `json:"items"`
CashboxAccountID int64 `json:"cashbox_account_id"`
PriceListID sql.NullInt64 `json:"price_list_id"`
InvoiceTypeID int64 `json:"invoice_type_id"`
SalespersonID sql.NullInt64 `json:"salesperson_id"`
CreatedBy sql.NullInt64 `json:"created_by"`
}
type SalesInvoiceTxResult ¶
type SalesInvoiceTxResult struct {
Invoice Invoice `json:"invoice"`
Entry Entry `json:"entry"`
Balance ShiftsAccountsBalance `json:"balance"`
}
type Salesperson ¶
type Salesperson struct {
ID int64 `json:"id"`
Name string `json:"name"`
CashboxID sql.NullInt64 `json:"cashbox_id"`
BranchID sql.NullInt64 `json:"branch_id"`
IsActive bool `json:"is_active"`
UpdatedAt time.Time `json:"updated_at"`
Color string `json:"color"`
AttendanceUserID string `json:"attendance_user_id"`
AttendanceUserIDSet bool `json:"attendance_user_id_set"`
IsSalesperson bool `json:"is_salesperson"`
}
type SalespersonPerformanceInvoicesParams ¶ added in v1.1.0
type SalespersonPerformanceInvoicesRow ¶ added in v1.1.0
type SalespersonPerformanceInvoicesRow struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
Kind string `json:"kind"`
BranchInvoiceCode string `json:"branch_invoice_code"`
GrandTotal int64 `json:"grand_total"`
OccurredAt time.Time `json:"occurred_at"`
SalespersonID int64 `json:"salesperson_id"`
SalespersonName string `json:"salesperson_name"`
}
type SalespersonPerformanceItemsParams ¶ added in v1.1.0
type SaveInvoiceDiscountTxParams ¶ added in v1.1.8
type SaveInvoiceDiscountTxParams struct {
// 0 creates a rule.
ID int64
Create CreateInvoiceDiscountParams
BranchIDs []int64
}
type SaveStockCountTxParams ¶
type SearchVariantsForUnknownItemsRow ¶ added in v1.1.1
type SearchWhatsAppClientsRow ¶ added in v1.1.0
type SecurityAlert ¶ added in v1.1.0
type SecurityAlert struct {
ID int64 `json:"id"`
Kind string `json:"kind"`
Ip string `json:"ip"`
CountryCode string `json:"country_code"`
Detail string `json:"detail"`
Count int64 `json:"count"`
FirstAt time.Time `json:"first_at"`
LastAt time.Time `json:"last_at"`
AcknowledgedAt sql.NullTime `json:"acknowledged_at"`
AcknowledgedBy string `json:"acknowledged_by"`
}
type SecuritySetting ¶ added in v1.1.0
type SecuritySetting struct {
ID int32 `json:"id"`
CountryFilterEnabled bool `json:"country_filter_enabled"`
AllowedCountries []string `json:"allowed_countries"`
AlwaysAllowed []string `json:"always_allowed"`
AutoBanEnabled bool `json:"auto_ban_enabled"`
AutoBanFailedLogins int32 `json:"auto_ban_failed_logins"`
AutoBanMinutes int32 `json:"auto_ban_minutes"`
UpdatedAt time.Time `json:"updated_at"`
}
type SeedProductVariantsCostByCodeParams ¶ added in v1.1.3
type Session ¶
type Session struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
RefreshToken string `json:"refresh_token"`
UserAgent string `json:"user_agent"`
ClientIp string `json:"client_ip"`
IsBlocked bool `json:"is_blocked"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
}
type SetAssetCostParams ¶
type SetBranchActiveParams ¶
type SetBranchExpenseCategoryParams ¶ added in v1.1.1
type SetBranchExpenseFromCentralByIDParams ¶ added in v1.1.3
type SetBranchExpenseFromCentralParams ¶ added in v1.1.3
type SetBranchInvoiceDiscountParams ¶ added in v1.1.8
type SetBranchInvoiceItemDiscountParams ¶ added in v1.1.8
type SetBranchInvoiceItemResolvedParams ¶ added in v1.1.1
type SetBranchInvoiceSalespersonParams ¶ added in v1.1.0
type SetBranchLoanCategoryParams ¶ added in v1.1.1
type SetBranchLoanCategoryParams struct {
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
CategoryID int64 `json:"category_id"`
}
type SetBranchPlaceIDParams ¶ added in v1.1.0
type SetBranchRegisterReportedSettingsParams ¶
type SetBranchRegisterReportedSettingsParams struct {
ID int64 `json:"id"`
ReportedSettings pqtype.NullRawMessage `json:"reported_settings"`
}
type SetBranchWhatsAppNumberParams ¶ added in v1.1.0
type SetClientActiveParams ¶
type SetClientBranchIfNullParams ¶ added in v1.1.1
type SetEmailSettingsParams ¶ added in v1.1.0
type SetEmailSettingsParams struct {
EmailSenderName string `json:"email_sender_name"`
EmailSenderAddress string `json:"email_sender_address"`
EmailReplyTo string `json:"email_reply_to"`
EmailDefaultRecipients string `json:"email_default_recipients"`
EmailBusinessName string `json:"email_business_name"`
EmailCsvColumns json.RawMessage `json:"email_csv_columns"`
EmailAttachmentFormat string `json:"email_attachment_format"`
EmailGroupByRegister bool `json:"email_group_by_register"`
EmailOldestFirst bool `json:"email_oldest_first"`
}
type SetProductAutofillRulesParams ¶ added in v1.1.0
type SetProductAutofillRulesParams struct {
ProductAutofillRules json.RawMessage `json:"product_autofill_rules"`
ProductAutofillCodeLayout string `json:"product_autofill_code_layout"`
}
type SetPurchaseStatusParams ¶
type SetPurchaseStatusParams struct {
Status PurchaseStatus `json:"status"`
ReceivedAt sql.NullTime `json:"received_at"`
ID int64 `json:"id"`
}
type SetPurchaseTotalsParams ¶
type SetReviewSettingsParams ¶ added in v1.1.0
type SetReviewSettingsParams struct {
ReviewPlaceID string `json:"review_place_id"`
ReviewBaseUrl string `json:"review_base_url"`
ReviewTitle string `json:"review_title"`
ReviewDescription string `json:"review_description"`
GooglePlacesApiKey string `json:"google_places_api_key"`
GoogleReviewsEnabled bool `json:"google_reviews_enabled"`
}
type SetSalespersonAttendanceIDParams ¶ added in v1.1.0
type SetSalespersonIsSalespersonParams ¶ added in v1.1.0
type SetStockCountNoteParams ¶
type SetStockCountStatusParams ¶
type SetStockCountStatusParams struct {
ID int64 `json:"id"`
Status StockCountStatus `json:"status"`
PostedBy sql.NullInt64 `json:"posted_by"`
}
type SetTransferStatusParams ¶
type SetUnknownItemSlotImageParams ¶ added in v1.1.1
type SetUserAvatarColorParams ¶ added in v1.1.0
type SetVariantBarcodeParams ¶
type SetWhatsAppNumberPhoneParams ¶ added in v1.1.0
type SetWhatsAppSenderSettingsParams ¶ added in v1.1.0
type SetWhatsAppSenderSettingsParams struct {
WhatsappSender string `json:"whatsapp_sender"`
WhatsappBridgeUrl string `json:"whatsapp_bridge_url"`
WhatsappBridgeKey string `json:"whatsapp_bridge_key"`
WhatsappBridgeMessage string `json:"whatsapp_bridge_message"`
WhatsappFeedbackMode string `json:"whatsapp_feedback_mode"`
WhatsappBridgeLinkMessage string `json:"whatsapp_bridge_link_message"`
WhatsappChannelUrl string `json:"whatsapp_channel_url"`
WhatsappMessageLogo bool `json:"whatsapp_message_logo"`
WhatsappPollQuestion string `json:"whatsapp_poll_question"`
WhatsappPollOptions string `json:"whatsapp_poll_options"`
WhatsappFollowup bool `json:"whatsapp_followup"`
WhatsappFollowupGood string `json:"whatsapp_followup_good"`
WhatsappFollowupOkay string `json:"whatsapp_followup_okay"`
WhatsappFollowupBad string `json:"whatsapp_followup_bad"`
WhatsappHiddenFields string `json:"whatsapp_hidden_fields"`
WhatsappChannelFirst bool `json:"whatsapp_channel_first"`
WhatsappWelcomeEarly bool `json:"whatsapp_welcome_early"`
WhatsappDeleteForMe bool `json:"whatsapp_delete_for_me"`
WhatsappDeletePollForMe bool `json:"whatsapp_delete_poll_for_me"`
WhatsappFollowupReturning bool `json:"whatsapp_followup_returning"`
WhatsappMessageNew bool `json:"whatsapp_message_new"`
WhatsappMessageReturning bool `json:"whatsapp_message_returning"`
WhatsappPollNew bool `json:"whatsapp_poll_new"`
WhatsappPollReturning bool `json:"whatsapp_poll_returning"`
}
type SetWhatsAppSettingsParams ¶
type SetWhatsAppSettingsParams struct {
WhatsappEnabled bool `json:"whatsapp_enabled"`
WhatsappPhoneNumberID string `json:"whatsapp_phone_number_id"`
WhatsappAccessToken string `json:"whatsapp_access_token"`
WhatsappTemplateName string `json:"whatsapp_template_name"`
WhatsappTemplateLang string `json:"whatsapp_template_lang"`
WhatsappTemplateParams string `json:"whatsapp_template_params"`
WhatsappWebhookVerifyToken string `json:"whatsapp_webhook_verify_token"`
WhatsappAppSecret string `json:"whatsapp_app_secret"`
}
type ShiftsAccountsBalance ¶
type SkipDroppedWhatsAppMessagesParams ¶ added in v1.1.9
type SplitUnknownInvoiceItemParams ¶ added in v1.1.1
type StockAdjustmentMode ¶
type StockAdjustmentMode string
const ( // StockAdjustmentModeDelta adds a signed quantity to on-hand. StockAdjustmentModeDelta StockAdjustmentMode = "delta" // StockAdjustmentModeCount sets on-hand to an absolute counted figure. StockAdjustmentModeCount StockAdjustmentMode = "count" )
type StockAdjustmentTxParams ¶
type StockAdjustmentTxParams struct {
InventoryID int64 `json:"inventory_id"`
VariantID int64 `json:"variant_id"`
Mode StockAdjustmentMode `json:"mode"`
Quantity int64 `json:"quantity"` // delta: signed change; count: target on-hand
Note string `json:"note"`
CreatedBy sql.NullInt64 `json:"created_by"`
}
type StockAdjustmentTxResult ¶
type StockAdjustmentTxResult struct {
Movement StockMovement `json:"movement"`
OnHand int64 `json:"on_hand"`
}
type StockCount ¶
type StockCount struct {
ID int64 `json:"id"`
InventoryID int64 `json:"inventory_id"`
Code string `json:"code"`
Status StockCountStatus `json:"status"`
Note string `json:"note"`
CountedAt time.Time `json:"counted_at"`
PostedAt sql.NullTime `json:"posted_at"`
CreatedBy sql.NullInt64 `json:"created_by"`
PostedBy sql.NullInt64 `json:"posted_by"`
CreatedAt time.Time `json:"created_at"`
}
type StockCountItem ¶
type StockCountLineParams ¶
type StockCountLineParams struct {
VariantID int64 `json:"variant_id"`
CountedQuantity int64 `json:"counted_quantity"`
}
StockCountLineParams is one line on a draft stock count sheet: the SKU and what was physically counted. system_quantity is snapshotted from live on-hand at save time, not supplied by the caller.
type StockCountStatus ¶
type StockCountStatus string
const ( StockCountStatusDraft StockCountStatus = "draft" StockCountStatusPosted StockCountStatus = "posted" StockCountStatusCancelled StockCountStatus = "cancelled" )
func (*StockCountStatus) Scan ¶
func (e *StockCountStatus) Scan(src interface{}) error
type StockMovement ¶
type StockMovement struct {
ID int64 `json:"id"`
InventoryID int64 `json:"inventory_id"`
VariantID int64 `json:"variant_id"`
Quantity int64 `json:"quantity"`
Reason StockMovementReason `json:"reason"`
ReferenceType sql.NullString `json:"reference_type"`
ReferenceID sql.NullInt64 `json:"reference_id"`
UnitCost sql.NullInt64 `json:"unit_cost"`
Note string `json:"note"`
CreatedBy sql.NullInt64 `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
QuantityBefore int64 `json:"quantity_before"`
QuantityAfter int64 `json:"quantity_after"`
Metadata json.RawMessage `json:"metadata"`
BatchID sql.NullInt64 `json:"batch_id"`
}
type StockMovementReason ¶
type StockMovementReason string
const ( StockMovementReasonPurchase StockMovementReason = "purchase" StockMovementReasonSale StockMovementReason = "sale" StockMovementReasonReturn StockMovementReason = "return" StockMovementReasonTransferOut StockMovementReason = "transfer_out" StockMovementReasonTransferIn StockMovementReason = "transfer_in" StockMovementReasonAdjustment StockMovementReason = "adjustment" StockMovementReasonCount StockMovementReason = "count" )
func (*StockMovementReason) Scan ¶
func (e *StockMovementReason) Scan(src interface{}) error
type Store ¶
type Store interface {
Querier
SalesInvoiceTx(ctx context.Context, arg SalesInvoiceTxParams) (SalesInvoiceTxResult, error)
CreateProductTx(ctx context.Context, arg CreateProductTxParams) (CreateProductTxResult, error)
UpdateProductTx(ctx context.Context, arg UpdateProductTxParams) (UpdateProductTxResult, error)
AddVariantTx(ctx context.Context, arg AddVariantTxParams) (ProductVariant, error)
ReturnInvoiceTx(ctx context.Context, arg ReturnInvoiceTxParams) (ReturnInvoiceTxResult, error)
CreateBranchTx(ctx context.Context, arg CreateBranchTxParams) (CreateBranchTxResult, error)
CreatePurchaseTx(ctx context.Context, arg CreatePurchaseTxParams) (CreatePurchaseTxResult, error)
PurchaseReceiveTx(ctx context.Context, arg PurchaseReceiveTxParams) (PurchaseReceiveTxResult, error)
CreateTransferTx(ctx context.Context, arg CreateTransferTxParams) (CreateTransferTxResult, error)
TransferDispatchTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
TransferReceiveTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
TransferApproveTx(ctx context.Context, arg TransferStageTxParams) (TransferStageTxResult, error)
StockAdjustmentTx(ctx context.Context, arg StockAdjustmentTxParams) (StockAdjustmentTxResult, error)
CreateBranchInvoiceTx(ctx context.Context, arg CreateBranchInvoiceTxParams) (CreateBranchInvoiceTxResult, error)
SaveInvoiceDiscountTx(ctx context.Context, arg SaveInvoiceDiscountTxParams) (InvoiceDiscount, error)
CreateBranchTransferRequestTx(ctx context.Context, arg CreateBranchTransferRequestTxParams) (CreateBranchTransferRequestTxResult, error)
ConfirmBranchTransferTx(ctx context.Context, arg ConfirmBranchTransferTxParams) (Transfer, error)
ApplyBranchSettlementTx(ctx context.Context, arg ApplyBranchSettlementTxParams) (ApplyBranchSettlementTxResult, error)
FireRecurringExpenseTx(ctx context.Context, recurring RecurringExpense) (Expense, error)
DeleteBranchTargetSeriesTx(ctx context.Context, seriesID int64) (BranchTargetSeries, error)
BatchSetEmployeeSalaries(ctx context.Context, args []UpdateEmployeeSalaryParams) ([]Employee, error)
SaveStockCountTx(ctx context.Context, arg SaveStockCountTxParams) (StockCount, error)
PostStockCountTx(ctx context.Context, id int64, postedBy sql.NullInt64) (PostStockCountTxResult, error)
CancelStockCountTx(ctx context.Context, id int64) (StockCount, error)
CancelPurchaseTx(ctx context.Context, purchaseID int64, cancelledBy sql.NullInt64) (PurchaseReceiveTxResult, error)
CancelTransferTx(ctx context.Context, transferID int64, cancelledBy sql.NullInt64) (TransferStageTxResult, error)
CreateBatchTx(ctx context.Context, arg CreateBatchTxParams) (CreateBatchTxResult, error)
SaveRolePermissionsTx(ctx context.Context, roleID int64, perms []RolePermission) error
ReplaceBranchQuickAccessTx(ctx context.Context, branchID int64, items []QuickAccessItemInput) error
ImportBranchQuickAccessTx(ctx context.Context, branchID int64, items []QuickAccessItemInput) (bool, error)
ReplaceWhatsAppRulesTx(ctx context.Context, rules []CreateWhatsAppRuleParams) ([]WhatsappRule, error)
SaveReviewSettingsTx(ctx context.Context, settings SetReviewSettingsParams, branches []SetBranchPlaceIDParams) error
SaveWhatsAppSenderTx(ctx context.Context, settings SetWhatsAppSenderSettingsParams, branches []SetBranchWhatsAppNumberParams) error
UpdateWhatsAppNumberTx(ctx context.Context, id int64, label string, makeDefault bool, minTotalCents int64) (WhatsappNumber, error)
ResolveUnknownItemsTx(ctx context.Context, slotIDs []int64, variantID int64) error
SetProductSaleOptionsTx(ctx context.Context, entries []string, saleOptionIDs []int64) (int, error)
ReplaceDiscountListRulesTx(ctx context.Context, listID int64, rules []DiscountListRuleInput) error
ReplaceDiscountListRuleGroupsTx(ctx context.Context, listID int64, groups []DiscountListRuleGroupInput) error
}
type Supplier ¶
type Supplier struct {
ID int64 `json:"id"`
Name string `json:"name"`
Phone string `json:"phone"`
Country string `json:"country"`
Address string `json:"address"`
AddressLatitude sql.NullFloat64 `json:"address_latitude"`
AddressLongitude sql.NullFloat64 `json:"address_longitude"`
CreatedAt time.Time `json:"created_at"`
}
type Transfer ¶
type Transfer struct {
ID int64 `json:"id"`
FromInventoryID int64 `json:"from_inventory_id"`
ToInventoryID int64 `json:"to_inventory_id"`
Type TransferType `json:"type"`
CreatedAt time.Time `json:"created_at"`
Code string `json:"code"`
Status TransferStatus `json:"status"`
DispatchedAt sql.NullTime `json:"dispatched_at"`
ReceivedAt sql.NullTime `json:"received_at"`
Note string `json:"note"`
BranchID sql.NullInt64 `json:"branch_id"`
ClientRef sql.NullString `json:"client_ref"`
AttachmentPath string `json:"attachment_path"`
UpdatedAt time.Time `json:"updated_at"`
ConfirmedAt sql.NullTime `json:"confirmed_at"`
ConfirmedNote string `json:"confirmed_note"`
RegisterID sql.NullInt64 `json:"register_id"`
AttachmentRotation int16 `json:"attachment_rotation"`
}
type TransferItem ¶
type TransferItem struct {
ID int64 `json:"id"`
TransferID int64 `json:"transfer_id"`
AssetID sql.NullInt64 `json:"asset_id"`
Quantity int64 `json:"quantity"`
VariantID sql.NullInt64 `json:"variant_id"`
ReceivedQuantity sql.NullInt64 `json:"received_quantity"`
}
Each row references either a product or an asset. Never both.
type TransferItemParams ¶
type TransferItemParams struct {
VariantID sql.NullInt64 `json:"variant_id"`
AssetID sql.NullInt64 `json:"asset_id"`
Quantity int64 `json:"quantity"`
}
TransferItemParams is one line on a draft transfer.
type TransferStageTxParams ¶
type TransferStageTxResult ¶
type TransferStageTxResult struct {
Transfer Transfer `json:"transfer"`
Movements []StockMovement `json:"movements"`
}
type TransferStatus ¶
type TransferStatus string
const ( TransferStatusDraft TransferStatus = "draft" TransferStatusDispatched TransferStatus = "dispatched" TransferStatusReceived TransferStatus = "received" TransferStatusCancelled TransferStatus = "cancelled" TransferStatusRequested TransferStatus = "requested" )
func (*TransferStatus) Scan ¶
func (e *TransferStatus) Scan(src interface{}) error
type TransferType ¶
type TransferType string
const ( TransferTypeAssets TransferType = "assets" TransferTypeProducts TransferType = "products" )
func (*TransferType) Scan ¶
func (e *TransferType) Scan(src interface{}) error
type UnknownItemImage ¶ added in v1.1.1
type UnknownItemSession ¶ added in v1.1.1
type UnknownItemSession struct {
ID int64 `json:"id"`
BranchID int64 `json:"branch_id"`
RegisterID int64 `json:"register_id"`
ClientRef string `json:"client_ref"`
Token string `json:"token"`
ExpiresAt time.Time `json:"expires_at"`
BranchInvoiceID sql.NullInt64 `json:"branch_invoice_id"`
HelpRequestedAt sql.NullTime `json:"help_requested_at"`
CreatedAt time.Time `json:"created_at"`
}
type UnknownItemSlot ¶ added in v1.1.1
type UnknownItemSlot struct {
ID int64 `json:"id"`
SessionID int64 `json:"session_id"`
SlotRef string `json:"slot_ref"`
Position int32 `json:"position"`
Label string `json:"label"`
UnitPrice int64 `json:"unit_price"`
Discount int16 `json:"discount"`
ImageID sql.NullInt64 `json:"image_id"`
ResolvedVariantID sql.NullInt64 `json:"resolved_variant_id"`
ResolvedAt sql.NullTime `json:"resolved_at"`
WaivedAt sql.NullTime `json:"waived_at"`
WaivedBy string `json:"waived_by"`
LineRef string `json:"line_ref"`
}
type UnresolveHomeActivityParams ¶ added in v1.1.0
type UpdateAppSettingsParams ¶
type UpdateAppSettingsParams struct {
FinancialsHighSeasonMonths json.RawMessage `json:"financials_high_season_months"`
ActivityMessageSeconds int16 `json:"activity_message_seconds"`
ActivityDisplayMode string `json:"activity_display_mode"`
BarcodeLabelWidth float32 `json:"barcode_label_width"`
BarcodeLabelHeight float32 `json:"barcode_label_height"`
UpcomingEventsDays int16 `json:"upcoming_events_days"`
UpcomingEventsMenuDays int16 `json:"upcoming_events_menu_days"`
HiddenBuiltinEvents json.RawMessage `json:"hidden_builtin_events"`
ProductAutofillEnabled bool `json:"product_autofill_enabled"`
UploadPagesFollowSystem bool `json:"upload_pages_follow_system"`
UnknownImagesAutoDelete bool `json:"unknown_images_auto_delete"`
TablePageSize int16 `json:"table_page_size"`
}
type UpdateAssetParams ¶
type UpdateBranchAttendanceEventParams ¶
type UpdateBranchAttendanceEventParams struct {
ID int64 `json:"id"`
SalespersonName string `json:"salesperson_name"`
AttendanceUserID string `json:"attendance_user_id"`
EventDate string `json:"event_date"`
EventTime string `json:"event_time"`
EventAt string `json:"event_at"`
Type string `json:"type"`
Status string `json:"status"`
}
type UpdateBranchUserParams ¶
type UpdateCashboxParams ¶
type UpdateClientParams ¶
type UpdateClientPhoneParams ¶ added in v1.1.3
type UpdateColorParams ¶
type UpdateCouponParams ¶
type UpdateCouponParams struct {
Code string `json:"code"`
Status CouponStatus `json:"status"`
TypeID sql.NullInt64 `json:"type_id"`
ValueCents int64 `json:"value_cents"`
ClientID sql.NullInt64 `json:"client_id"`
ValidUntil sql.NullTime `json:"valid_until"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type UpdateCouponTypeParams ¶
type UpdateCouponTypeParams struct {
ID int64 `json:"id"`
Name string `json:"name"`
ValueCents int64 `json:"value_cents"`
CurrencyCode string `json:"currency_code"`
IsActive bool `json:"is_active"`
ReferenceOnly bool `json:"reference_only"`
CalculateOnCheckout bool `json:"calculate_on_checkout"`
CodeOptional bool `json:"code_optional"`
CategoryID sql.NullInt64 `json:"category_id"`
}
type UpdateCurrencyParams ¶
type UpdateCurrencyParams struct {
Code string `json:"code"`
Name string `json:"name"`
Symbol string `json:"symbol"`
ValueInDefaultCurrency int64 `json:"value_in_default_currency"`
IsActive bool `json:"is_active"`
UnitsPerUsdMicros int64 `json:"units_per_usd_micros"`
CashRoundingUnit int64 `json:"cash_rounding_unit"`
}
type UpdateDealParams ¶ added in v1.1.6
type UpdateDealParams struct {
ID int64 `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
BuyQty int32 `json:"buy_qty"`
GetQty int32 `json:"get_qty"`
Percent int16 `json:"percent"`
BundlePrice int64 `json:"bundle_price"`
FallbackPercent int16 `json:"fallback_percent"`
FallbackOnlyWithoutSet bool `json:"fallback_only_without_set"`
}
type UpdateDiscountListRuleGroupParams ¶ added in v1.1.7
type UpdateDiscountListRuleParams ¶ added in v1.1.7
type UpdateDiscountListRuleParams struct {
Position int32 `json:"position"`
Name string `json:"name"`
CodePrefixes []string `json:"code_prefixes"`
ExceptCodePrefixes []string `json:"except_code_prefixes"`
Kinds []string `json:"kinds"`
Categories []string `json:"categories"`
SubCategories []string `json:"sub_categories"`
Origins []string `json:"origins"`
Brands []string `json:"brands"`
Discount int16 `json:"discount"`
DealID sql.NullInt64 `json:"deal_id"`
GroupID int64 `json:"group_id"`
IsEnabled bool `json:"is_enabled"`
MaxPrice sql.NullInt64 `json:"max_price"`
ID int64 `json:"id"`
DiscountListID int64 `json:"discount_list_id"`
}
type UpdateEmailScheduleParams ¶ added in v1.1.0
type UpdateEmailScheduleParams struct {
ID int64 `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Period string `json:"period"`
RegisterIds []int64 `json:"register_ids"`
Recipients string `json:"recipients"`
Bcc string `json:"bcc"`
Format string `json:"format"`
Note string `json:"note"`
SkipEmpty bool `json:"skip_empty"`
Frequency string `json:"frequency"`
AtMinute int32 `json:"at_minute"`
Weekdays []int32 `json:"weekdays"`
MonthDay int32 `json:"month_day"`
NextRunAt sql.NullTime `json:"next_run_at"`
}
type UpdateEmployeeParams ¶
type UpdateEmployeeParams struct {
ID int64 `json:"id"`
BranchID sql.NullInt64 `json:"branch_id"`
Name string `json:"name"`
Role string `json:"role"`
Status string `json:"status"`
HiredOn sql.NullTime `json:"hired_on"`
BaseSalaryCents int64 `json:"base_salary_cents"`
CommissionCents int64 `json:"commission_cents"`
LateDeductionRateCents int64 `json:"late_deduction_rate_cents"`
LateDeductionUnit string `json:"late_deduction_unit"`
LateUnitsCenti int64 `json:"late_units_centi"`
}
type UpdateEmployeeSalaryParams ¶
type UpdateEmployeeSalaryParams struct {
ID int64 `json:"id"`
BaseSalaryCents int64 `json:"base_salary_cents"`
CommissionCents int64 `json:"commission_cents"`
LateDeductionRateCents int64 `json:"late_deduction_rate_cents"`
LateDeductionUnit string `json:"late_deduction_unit"`
LateUnitsCenti int64 `json:"late_units_centi"`
}
type UpdateExpenseParams ¶
type UpdateInventoryParams ¶
type UpdateInvoiceDiscountParams ¶ added in v1.1.8
type UpdateInvoiceDiscountParams struct {
ID int64 `json:"id"`
Name string `json:"name"`
MinTotal int64 `json:"min_total"`
Kind string `json:"kind"`
Percent int16 `json:"percent"`
Amount int64 `json:"amount"`
AllBranches bool `json:"all_branches"`
ValidFrom sql.NullTime `json:"valid_from"`
ValidTo sql.NullTime `json:"valid_to"`
IsActive bool `json:"is_active"`
}
type UpdateInvoiceTypeParams ¶
type UpdateLoanParams ¶
type UpdatePriceListParams ¶
type UpdateProductParams ¶
type UpdateProductTxParams ¶
type UpdateProductTxParams struct {
ID int64 `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
IsActive bool `json:"is_active"`
// AttributeValues carries the attribute id (0-8) plus its free-text
// value; a blank value clears nothing (it's simply skipped) so callers
// only need to send the attributes they want set.
AttributeValues []AttributesValue `json:"attribute_values"`
}
type UpdateProductTxResult ¶
type UpdateProductTxResult struct {
Product Product `json:"product"`
ProductAttributes []ProductsAttribute `json:"product_attributes"`
}
type UpdateSalespersonParams ¶
type UpdateSecuritySettingsParams ¶ added in v1.1.0
type UpdateSecuritySettingsParams struct {
CountryFilterEnabled bool `json:"country_filter_enabled"`
AllowedCountries []string `json:"allowed_countries"`
AlwaysAllowed []string `json:"always_allowed"`
AutoBanEnabled bool `json:"auto_ban_enabled"`
AutoBanFailedLogins int32 `json:"auto_ban_failed_logins"`
AutoBanMinutes int32 `json:"auto_ban_minutes"`
}
type UpdateSizeParams ¶
type UpdateTransferParams ¶
type UpdateTransferParams struct {
ID int64 `json:"id"`
FromInventoryID int64 `json:"from_inventory_id"`
ToInventoryID int64 `json:"to_inventory_id"`
Type TransferType `json:"type"`
Note string `json:"note"`
}
type UpdateUserParams ¶
type UpdateWhatsAppNumberLabelParams ¶ added in v1.1.0
type UpsertBranchSettingsParams ¶
type UpsertBranchSettingsParams struct {
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
TaxRate float64 `json:"tax_rate"`
RoundingMode string `json:"rounding_mode"`
RoundingCurrency string `json:"rounding_currency"`
ExchangeRate int64 `json:"exchange_rate"`
ExchangeWindowHours int64 `json:"exchange_window_hours"`
MarketName string `json:"market_name"`
MarketPhone string `json:"market_phone"`
MarketDescription string `json:"market_description"`
ReturnPolicy string `json:"return_policy"`
Website string `json:"website"`
Instagram string `json:"instagram"`
SocialPlatforms json.RawMessage `json:"social_platforms"`
SocialHandles json.RawMessage `json:"social_handles"`
SearchButtonEnabled bool `json:"search_button_enabled"`
CustomItemDiscountsEnabled bool `json:"custom_item_discounts_enabled"`
CustomItemPricesEnabled bool `json:"custom_item_prices_enabled"`
PerUnitItemPricesEnabled bool `json:"per_unit_item_prices_enabled"`
PriceChangeManualOverrideMode bool `json:"price_change_manual_override_mode"`
InvoiceKeyboardMode bool `json:"invoice_keyboard_mode"`
ClientRequired bool `json:"client_required"`
PageUnlockClients bool `json:"page_unlock_clients"`
PageUnlockInventory bool `json:"page_unlock_inventory"`
PageUnlockTransfers bool `json:"page_unlock_transfers"`
PageUnlockAttendance bool `json:"page_unlock_attendance"`
PageUnlockSalespersons bool `json:"page_unlock_salespersons"`
PrinterSize string `json:"printer_size"`
ReceiptWidth int64 `json:"receipt_width"`
ReceiptHeight int64 `json:"receipt_height"`
ReceiptEnabled bool `json:"receipt_enabled"`
ReceiptFont string `json:"receipt_font"`
ReceiptBodyFont string `json:"receipt_body_font"`
ReceiptTitleSize float64 `json:"receipt_title_size"`
ReceiptBodySize float64 `json:"receipt_body_size"`
ReceiptCutoff bool `json:"receipt_cutoff"`
PrinterID string `json:"printer_id"`
ReceiptPrinter string `json:"receipt_printer"`
ScreenPort string `json:"screen_port"`
AkuvoxIp string `json:"akuvox_ip"`
AkuvoxUsername string `json:"akuvox_username"`
AttendanceEnabled bool `json:"attendance_enabled"`
AttendanceDuplicateIntervalSeconds int64 `json:"attendance_duplicate_interval_seconds"`
AttendanceCashierHistory bool `json:"attendance_cashier_history"`
SplitPrimaryCurrency string `json:"split_primary_currency"`
SplitPrimaryFirst bool `json:"split_primary_first"`
SplitPrimaryStep int64 `json:"split_primary_step"`
OversellMode string `json:"oversell_mode"`
CloseShiftRequiresSync bool `json:"close_shift_requires_sync"`
SalespersonPerInvoiceRequired bool `json:"salesperson_per_invoice_required"`
OpeningFloatEnabled bool `json:"opening_float_enabled"`
CountOpeningCashOnClose bool `json:"count_opening_cash_on_close"`
OverchangeConfirmation bool `json:"overchange_confirmation"`
PageUnlockProducts bool `json:"page_unlock_products"`
HidePaymentMethodCurrency bool `json:"hide_payment_method_currency"`
AutoAppendLbpZeros bool `json:"auto_append_lbp_zeros"`
AutoCloseStaleShifts bool `json:"auto_close_stale_shifts"`
VisitorCounterEnabled bool `json:"visitor_counter_enabled"`
ShiftReceiptUploadMode int64 `json:"shift_receipt_upload_mode"`
BranchPhone string `json:"branch_phone"`
MaxOverpaymentCents int64 `json:"max_overpayment_cents"`
DefaultOpeningFloatUsd int64 `json:"default_opening_float_usd"`
DefaultOpeningFloatLbp int64 `json:"default_opening_float_lbp"`
DisplayPrefs json.RawMessage `json:"display_prefs"`
ScanByCodeEnabled bool `json:"scan_by_code_enabled"`
SoundsEnabled bool `json:"sounds_enabled"`
AttendanceManagerApprovalEnabled bool `json:"attendance_manager_approval_enabled"`
ShiftReportSignatures bool `json:"shift_report_signatures"`
ShiftReportUppercaseHeader bool `json:"shift_report_uppercase_header"`
AutoCoverNegativeLbp bool `json:"auto_cover_negative_lbp"`
ProductSearchCodeOnly bool `json:"product_search_code_only"`
PriceEditRestricted bool `json:"price_edit_restricted"`
PriceEditCodes string `json:"price_edit_codes"`
UnknownProductBarcode string `json:"unknown_product_barcode"`
ProductSearchHiddenFields string `json:"product_search_hidden_fields"`
ReceiptTheme string `json:"receipt_theme"`
ReceiptLayout string `json:"receipt_layout"`
DiscountToggle bool `json:"discount_toggle"`
DiscountToggleDefaultOff bool `json:"discount_toggle_default_off"`
DealToggle bool `json:"deal_toggle"`
}
type UpsertCashboxAccountOverrideParams ¶
type UpsertCashboxAccountOverrideParams struct {
BranchID int64 `json:"branch_id"`
CashboxAccountID int64 `json:"cashbox_account_id"`
IsEnabled bool `json:"is_enabled"`
SortOrder sql.NullInt32 `json:"sort_order"`
Color sql.NullString `json:"color"`
CurrencyCode sql.NullString `json:"currency_code"`
}
type UpsertClientLinkParams ¶
type UpsertDiscountListOptionItemParams ¶ added in v1.1.6
type UpsertGoogleReviewParams ¶ added in v1.1.0
type UpsertIPBanParams ¶ added in v1.1.0
type UpsertOversoldConflictParams ¶
type UpsertOversoldConflictParams struct {
BranchID int64 `json:"branch_id"`
Ref string `json:"ref"`
BranchPayload json.RawMessage `json:"branch_payload"`
}
type UpsertVisitorIPParams ¶ added in v1.1.0
type UpsertVisitorIPParams struct {
Ip string `json:"ip"`
SeenAt time.Time `json:"seen_at"`
Requests int64 `json:"requests"`
FailedLogins int64 `json:"failed_logins"`
Logins int64 `json:"logins"`
NotFound int64 `json:"not_found"`
Blocked int64 `json:"blocked"`
LastKind string `json:"last_kind"`
LastUserName string `json:"last_user_name"`
LastBranchName string `json:"last_branch_name"`
LastMethod string `json:"last_method"`
LastPath string `json:"last_path"`
LastStatus int32 `json:"last_status"`
UserAgent string `json:"user_agent"`
CountryCode string `json:"country_code"`
Country string `json:"country"`
Region string `json:"region"`
City string `json:"city"`
Asn int64 `json:"asn"`
Network string `json:"network"`
}
type User ¶
type User struct {
ID int64 `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
PasswordHash string `json:"password_hash"`
PasswordChangedAt time.Time `json:"password_changed_at"`
Activated bool `json:"activated"`
Version int32 `json:"version"`
CreatedAt time.Time `json:"created_at"`
RoleID int64 `json:"role_id"`
Username string `json:"username"`
AvatarColor string `json:"avatar_color"`
}
type UsersPermission ¶
type VariantDefaultDiscount ¶
type VariantDefaultPrice ¶
type VisitorCountriesRow ¶ added in v1.1.0
type VisitorIp ¶ added in v1.1.0
type VisitorIp struct {
Ip string `json:"ip"`
FirstSeenAt time.Time `json:"first_seen_at"`
LastSeenAt time.Time `json:"last_seen_at"`
Requests int64 `json:"requests"`
FailedLogins int64 `json:"failed_logins"`
Logins int64 `json:"logins"`
NotFound int64 `json:"not_found"`
Blocked int64 `json:"blocked"`
LastKind string `json:"last_kind"`
LastUserName string `json:"last_user_name"`
LastBranchName string `json:"last_branch_name"`
LastMethod string `json:"last_method"`
LastPath string `json:"last_path"`
LastStatus int32 `json:"last_status"`
UserAgent string `json:"user_agent"`
CountryCode string `json:"country_code"`
Country string `json:"country"`
Region string `json:"region"`
City string `json:"city"`
Asn int64 `json:"asn"`
Network string `json:"network"`
}
type WaiveUnknownItemSlotsParams ¶ added in v1.1.1
type WhatsAppClientsByPhoneTailRow ¶ added in v1.1.0
type WhatsAppFailureReasonsParams ¶ added in v1.1.0
type WhatsAppFailureReasonsRow ¶ added in v1.1.0
type WhatsAppFailureWatchRow ¶ added in v1.1.1
type WhatsAppMessageTotalsParams ¶ added in v1.1.0
type WhatsAppMessageTotalsRow ¶ added in v1.1.0
type WhatsAppMessageTotalsRow struct {
Sent int64 `json:"sent"`
Skipped int64 `json:"skipped"`
Failed int64 `json:"failed"`
Delivered int64 `json:"delivered"`
Read int64 `json:"read"`
Undelivered int64 `json:"undelivered"`
CostMicros int64 `json:"cost_micros"`
Recipients int64 `json:"recipients"`
SentSalesCents int64 `json:"sent_sales_cents"`
}
type WhatsAppMessagesByBranchParams ¶ added in v1.1.0
type WhatsAppMessagesByBranchRow ¶ added in v1.1.0
type WhatsAppMessagesByDayParams ¶ added in v1.1.0
type WhatsAppMessagesByDayRow ¶ added in v1.1.0
type WhatsAppMessagesByHourParams ¶ added in v1.1.0
type WhatsAppMessagesByHourRow ¶ added in v1.1.0
type WhatsAppMessagesByRuleParams ¶ added in v1.1.0
type WhatsAppMessagesByRuleRow ¶ added in v1.1.0
type WhatsAppNumberForBranchParams ¶ added in v1.1.9
type WhatsAppSentForInvoiceParams ¶ added in v1.1.0
type WhatsAppTopRecipientsParams ¶ added in v1.1.0
type WhatsAppTopRecipientsRow ¶ added in v1.1.0
type WhatsappChatMessage ¶ added in v1.1.1
type WhatsappChatMessage struct {
ID int64 `json:"id"`
Instance string `json:"instance"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
WaID string `json:"wa_id"`
ChatJid string `json:"chat_jid"`
ChatPhone string `json:"chat_phone"`
ContactName string `json:"contact_name"`
FromMe bool `json:"from_me"`
Kind string `json:"kind"`
Body string `json:"body"`
MediaType string `json:"media_type"`
SentAt time.Time `json:"sent_at"`
CreatedAt time.Time `json:"created_at"`
}
type WhatsappMessage ¶ added in v1.1.0
type WhatsappMessage struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at"`
BranchID sql.NullInt64 `json:"branch_id"`
InvoiceCode string `json:"invoice_code"`
ClientName string `json:"client_name"`
ClientPhone string `json:"client_phone"`
GrandTotalCents int64 `json:"grand_total_cents"`
ItemCount int32 `json:"item_count"`
RuleID sql.NullInt64 `json:"rule_id"`
RuleName string `json:"rule_name"`
TemplateName string `json:"template_name"`
Status string `json:"status"`
Reason string `json:"reason"`
Wamid string `json:"wamid"`
CostMicros int64 `json:"cost_micros"`
DeliveryStatus string `json:"delivery_status"`
DeliveredAt sql.NullTime `json:"delivered_at"`
ReadAt sql.NullTime `json:"read_at"`
DeliveryError string `json:"delivery_error"`
Billable sql.NullBool `json:"billable"`
PricingCategory string `json:"pricing_category"`
ReviewCode string `json:"review_code"`
ReviewClickedAt sql.NullTime `json:"review_clicked_at"`
Sender string `json:"sender"`
WhatsappNumberID sql.NullInt64 `json:"whatsapp_number_id"`
PollRef string `json:"poll_ref"`
PollRating sql.NullInt16 `json:"poll_rating"`
PollAnswer string `json:"poll_answer"`
PollVotedAt sql.NullTime `json:"poll_voted_at"`
PollFollowupAt sql.NullTime `json:"poll_followup_at"`
BridgeRef string `json:"bridge_ref"`
IsTest bool `json:"is_test"`
Body string `json:"body"`
PollQuestion string `json:"poll_question"`
PollOptions string `json:"poll_options"`
FollowupBody string `json:"followup_body"`
}
type WhatsappNumber ¶ added in v1.1.0
type WhatsappPollReply ¶ added in v1.1.0
type WhatsappReply ¶ added in v1.1.0
type WhatsappRule ¶ added in v1.1.0
type WhatsappRule struct {
ID int64 `json:"id"`
Position int32 `json:"position"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Action string `json:"action"`
Conditions json.RawMessage `json:"conditions"`
TemplateName string `json:"template_name"`
TemplateLang string `json:"template_lang"`
TemplateParams string `json:"template_params"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Source Files
¶
- admin_activity.sql.go
- app_settings.sql.go
- app_update.sql.go
- asset.sql.go
- asset_category.sql.go
- attributes.sql.go
- audit.go
- audit_log.sql.go
- barcode.sql.go
- batch.sql.go
- branch.sql.go
- branch_attendance.sql.go
- branch_command.sql.go
- branch_day_summary.sql.go
- branch_expense.sql.go
- branch_expense_image.sql.go
- branch_history_sync.sql.go
- branch_invoice.sql.go
- branch_invoice_settlement.sql.go
- branch_quick_access.sql.go
- branch_reconcile.sql.go
- branch_register.sql.go
- branch_settings.sql.go
- branch_shift.sql.go
- branch_shift_receipt_image.sql.go
- branch_shift_upload_token.sql.go
- branch_sync_conflict.sql.go
- branch_target.sql.go
- branch_target_series.sql.go
- branch_transfer_upload_token.sql.go
- branch_user.sql.go
- branch_visitor_event.sql.go
- busy_hours.sql.go
- calendar_event.sql.go
- cashbox.sql.go
- client.sql.go
- client_profile.go
- colors.sql.go
- coupon.sql.go
- coupon_category.sql.go
- coupon_list.sql.go
- coupon_type.sql.go
- currency.sql.go
- dashboard.sql.go
- db.go
- deal.sql.go
- default_branch_settings.sql.go
- discount_list.sql.go
- discount_list_branch.sql.go
- discount_list_rule.sql.go
- email_report.sql.go
- email_schedule.sql.go
- employee.sql.go
- entry.sql.go
- expense.sql.go
- expense_category.sql.go
- home_latest.sql.go
- inventory.sql.go
- inventory_asset.sql.go
- invoice.sql.go
- invoice_discount.sql.go
- invoice_discount_tx.go
- invoice_payment.sql.go
- invoice_type.sql.go
- loan.sql.go
- loan_category.sql.go
- loan_image.sql.go
- loan_payment.sql.go
- low_stock.sql.go
- models.go
- price_list.sql.go
- price_list_branch.sql.go
- price_list_item.sql.go
- product.sql.go
- product_attributes.sql.go
- product_category.sql.go
- product_revenue.sql.go
- product_variants.sql.go
- purchase.sql.go
- querier.go
- recurring_expense.sql.go
- review_link.sql.go
- role.sql.go
- sale_option.sql.go
- sales_report.sql.go
- salesperson_performance.sql.go
- security.sql.go
- sessions.sql.go
- shift.sql.go
- sizes.sql.go
- stock_count.sql.go
- stock_health.sql.go
- store.go
- supplier.sql.go
- sync_uid.sql.go
- transfer.sql.go
- tx_batch.go
- tx_branch.go
- tx_branch_invoice.go
- tx_branch_quick_access.go
- tx_branch_settlement.go
- tx_branch_target_series.go
- tx_branch_transfer.go
- tx_discount_rules.go
- tx_employee.go
- tx_invoice.go
- tx_product.go
- tx_purchase.go
- tx_recurring_expense.go
- tx_return_invoice.go
- tx_review_settings.go
- tx_role.go
- tx_sale_options.go
- tx_stock.go
- tx_stock_count.go
- tx_transfer.go
- tx_unknown_items.go
- tx_whatsapp_bridge.go
- tx_whatsapp_rules.go
- unknown_item.sql.go
- user.sql.go
- warehouse_treemap.sql.go
- whatsapp_bridge.sql.go
- whatsapp_chat.sql.go
- whatsapp_rules.sql.go
- whatsapp_settings.sql.go
- whatsapp_webhook.sql.go