Documentation
¶
Index ¶
- type ActivityLog
- type ArtCategory
- type Artist
- type Artwork
- type Branch
- type Category
- type CreateActivityLogParams
- type CreateArtCategoryParams
- type CreateArtistParams
- type CreateArtworkParams
- type CreateBranchParams
- type CreateCategoryParams
- type CreateCurrencyParams
- type CreateCustomerParams
- type CreateInventoryRecordParams
- type CreateInvoiceItemParams
- type CreateInvoiceParams
- type CreateMultipleInvoiceItemsParams
- type CreateOrganizationParams
- type CreatePaymentInfoParams
- type CreatePaymentParams
- type CreateProductParams
- type CreateProductVersionParams
- type CreateShiftParams
- type CreateStaffParams
- type CreateStaffRoleParams
- type CreateUserParams
- type Currency
- type Customer
- type DBTX
- type GetAllArtworkRow
- type GetAllShiftsRow
- type GetAllStaffRow
- type GetArtworkRow
- type GetInvoiceItemsByInvoiceIDRow
- type GetShiftRow
- type GetStaffRow
- type GetTotalsByStatusesRow
- type Inventory
- type Invoice
- type InvoiceItem
- type NullProductType
- type Organization
- type Payment
- type PaymentInfo
- type Product
- type ProductType
- type ProductVersion
- type Querier
- type Queries
- func (q *Queries) CountArtCategories(ctx context.Context) (int64, error)
- func (q *Queries) CountArtists(ctx context.Context) (int64, error)
- func (q *Queries) CountArtworks(ctx context.Context) (int64, error)
- func (q *Queries) CountShifts(ctx context.Context) (int64, error)
- func (q *Queries) CountStaff(ctx context.Context) (int64, error)
- func (q *Queries) CreateActivityLog(ctx context.Context, arg CreateActivityLogParams) (ActivityLog, error)
- func (q *Queries) CreateArtCategory(ctx context.Context, arg CreateArtCategoryParams) (ArtCategory, error)
- func (q *Queries) CreateArtist(ctx context.Context, arg CreateArtistParams) (Artist, error)
- func (q *Queries) CreateArtwork(ctx context.Context, arg CreateArtworkParams) (Artwork, error)
- func (q *Queries) CreateBranch(ctx context.Context, arg CreateBranchParams) (Branch, error)
- func (q *Queries) CreateCategory(ctx context.Context, arg CreateCategoryParams) (Category, error)
- func (q *Queries) CreateCurrency(ctx context.Context, arg CreateCurrencyParams) (Currency, error)
- func (q *Queries) CreateCustomer(ctx context.Context, arg CreateCustomerParams) (Customer, error)
- func (q *Queries) CreateInventoryRecord(ctx context.Context, arg CreateInventoryRecordParams) (Inventory, error)
- func (q *Queries) CreateInvoice(ctx context.Context, arg CreateInvoiceParams) (Invoice, error)
- func (q *Queries) CreateInvoiceItem(ctx context.Context, arg CreateInvoiceItemParams) (InvoiceItem, error)
- func (q *Queries) CreateMultipleInvoiceItems(ctx context.Context, arg []CreateMultipleInvoiceItemsParams) (int64, error)
- func (q *Queries) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error)
- func (q *Queries) CreatePayment(ctx context.Context, arg CreatePaymentParams) (Payment, error)
- func (q *Queries) CreatePaymentInfo(ctx context.Context, arg CreatePaymentInfoParams) (PaymentInfo, error)
- func (q *Queries) CreateProduct(ctx context.Context, arg CreateProductParams) (Product, error)
- func (q *Queries) CreateProductVersion(ctx context.Context, arg CreateProductVersionParams) (ProductVersion, error)
- func (q *Queries) CreateShift(ctx context.Context, arg CreateShiftParams) (Shift, error)
- func (q *Queries) CreateStaff(ctx context.Context, arg CreateStaffParams) (Staff, error)
- func (q *Queries) CreateStaffRole(ctx context.Context, arg CreateStaffRoleParams) (StaffRole, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteArtCategory(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteCustomerByID(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteItemsByInvoiceId(ctx context.Context, invoiceID pgtype.UUID) error
- func (q *Queries) DeleteStaff(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) GetActivityLogByEntityID(ctx context.Context, entityID pgtype.UUID) ([]ActivityLog, error)
- func (q *Queries) GetActivityLogsByUserID(ctx context.Context, userID pgtype.UUID) ([]ActivityLog, error)
- func (q *Queries) GetAllArtCategories(ctx context.Context) ([]ArtCategory, error)
- func (q *Queries) GetAllArtists(ctx context.Context) ([]Artist, error)
- func (q *Queries) GetAllArtwork(ctx context.Context) (GetAllArtworkRow, error)
- func (q *Queries) GetAllInvoices(ctx context.Context) ([]Invoice, error)
- func (q *Queries) GetAllShifts(ctx context.Context) (GetAllShiftsRow, error)
- func (q *Queries) GetAllStaff(ctx context.Context) ([]GetAllStaffRow, error)
- func (q *Queries) GetArtCategory(ctx context.Context, id pgtype.UUID) (ArtCategory, error)
- func (q *Queries) GetArtist(ctx context.Context, id pgtype.UUID) (Artist, error)
- func (q *Queries) GetArtwork(ctx context.Context, id pgtype.UUID) (GetArtworkRow, error)
- func (q *Queries) GetBranchByID(ctx context.Context, id pgtype.UUID) (Branch, error)
- func (q *Queries) GetCategoriesByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Category, error)
- func (q *Queries) GetCurrencyByID(ctx context.Context, id pgtype.UUID) (Currency, error)
- func (q *Queries) GetCustomerByEmail(ctx context.Context, email pgtype.Text) (Customer, error)
- func (q *Queries) GetCustomerById(ctx context.Context, id pgtype.UUID) (Customer, error)
- func (q *Queries) GetCustomersByBranch(ctx context.Context, branchID pgtype.UUID) ([]Customer, error)
- func (q *Queries) GetInventoryByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Inventory, error)
- func (q *Queries) GetInventoryByID(ctx context.Context, id pgtype.UUID) (Inventory, error)
- func (q *Queries) GetInventoryByVersionID(ctx context.Context, versionID pgtype.UUID) (Inventory, error)
- func (q *Queries) GetInvoiceByID(ctx context.Context, id pgtype.UUID) (Invoice, error)
- func (q *Queries) GetInvoiceItemsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]GetInvoiceItemsByInvoiceIDRow, error)
- func (q *Queries) GetInvoicesCreatedByUser(ctx context.Context, createdBy pgtype.UUID) ([]Invoice, error)
- func (q *Queries) GetOrganizationByID(ctx context.Context, id pgtype.UUID) (Organization, error)
- func (q *Queries) GetPaymentByID(ctx context.Context, id pgtype.UUID) (Payment, error)
- func (q *Queries) GetPaymentInfoByUserID(ctx context.Context, userID pgtype.UUID) (PaymentInfo, error)
- func (q *Queries) GetPaymentsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]Payment, error)
- func (q *Queries) GetProductVersionsByProductID(ctx context.Context, productID pgtype.UUID) ([]ProductVersion, error)
- func (q *Queries) GetProductsByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Product, error)
- func (q *Queries) GetProductsByID(ctx context.Context, id pgtype.UUID) (Product, error)
- func (q *Queries) GetShift(ctx context.Context, id pgtype.UUID) (GetShiftRow, error)
- func (q *Queries) GetStaff(ctx context.Context, id pgtype.UUID) (GetStaffRow, error)
- func (q *Queries) GetStaffRole(ctx context.Context, id pgtype.UUID) (StaffRole, error)
- func (q *Queries) GetTotalsByStatuses(ctx context.Context, createdBy pgtype.UUID) (GetTotalsByStatusesRow, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserById(ctx context.Context, id pgtype.UUID) (User, error)
- func (q *Queries) UpdateArtCategory(ctx context.Context, arg UpdateArtCategoryParams) (ArtCategory, error)
- func (q *Queries) UpdateArtist(ctx context.Context, arg UpdateArtistParams) (Artist, error)
- func (q *Queries) UpdateArtwork(ctx context.Context, arg UpdateArtworkParams) (Artwork, error)
- func (q *Queries) UpdateInventory(ctx context.Context, arg UpdateInventoryParams) (Inventory, error)
- func (q *Queries) UpdateInvoice(ctx context.Context, arg UpdateInvoiceParams) (Invoice, error)
- func (q *Queries) UpdateInvoiceItem(ctx context.Context, arg UpdateInvoiceItemParams) (InvoiceItem, error)
- func (q *Queries) UpdateInvoicePayment(ctx context.Context, arg UpdateInvoicePaymentParams) (Invoice, error)
- func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (Payment, error)
- func (q *Queries) UpdatePaymentInfo(ctx context.Context, arg UpdatePaymentInfoParams) error
- func (q *Queries) UpdateProduct(ctx context.Context, arg UpdateProductParams) (Product, error)
- func (q *Queries) UpdateProductVersion(ctx context.Context, arg UpdateProductVersionParams) (ProductVersion, error)
- func (q *Queries) UpdateShift(ctx context.Context, arg UpdateShiftParams) (Shift, error)
- func (q *Queries) UpdateStaff(ctx context.Context, arg UpdateStaffParams) (Staff, error)
- func (q *Queries) UpdateStaffRole(ctx context.Context, arg UpdateStaffRoleParams) (StaffRole, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SQLStore
- type Shift
- type Staff
- type StaffRole
- type Store
- type UpdateArtCategoryParams
- type UpdateArtistParams
- type UpdateArtworkParams
- type UpdateInventoryParams
- type UpdateInvoiceItemParams
- type UpdateInvoiceParams
- type UpdateInvoicePaymentParams
- type UpdatePaymentInfoParams
- type UpdatePaymentParams
- type UpdateProductParams
- type UpdateProductVersionParams
- type UpdateShiftParams
- type UpdateStaffParams
- type UpdateStaffRoleParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityLog ¶
type ArtCategory ¶
type Artwork ¶
type Artwork struct { ID pgtype.UUID `json:"id"` Title string `json:"title"` ArtistID pgtype.UUID `json:"artist_id"` CategoryID pgtype.UUID `json:"category_id"` YearCreated pgtype.Int4 `json:"year_created"` Medium pgtype.Text `json:"medium"` Dimensions pgtype.Text `json:"dimensions"` Description pgtype.Text `json:"description"` AcquisitionDate pgtype.Date `json:"acquisition_date"` ConditionStatus pgtype.Text `json:"condition_status"` LocationInMuseum pgtype.Text `json:"location_in_museum"` ImageUrl pgtype.Text `json:"image_url"` CreatedAt pgtype.Timestamp `json:"created_at"` }
type CreateActivityLogParams ¶
type CreateArtCategoryParams ¶
type CreateArtistParams ¶
type CreateArtworkParams ¶
type CreateArtworkParams struct { Title string `json:"title"` ArtistID pgtype.UUID `json:"artist_id"` CategoryID pgtype.UUID `json:"category_id"` YearCreated pgtype.Int4 `json:"year_created"` Medium pgtype.Text `json:"medium"` Dimensions pgtype.Text `json:"dimensions"` Description pgtype.Text `json:"description"` AcquisitionDate pgtype.Date `json:"acquisition_date"` ConditionStatus pgtype.Text `json:"condition_status"` LocationInMuseum pgtype.Text `json:"location_in_museum"` ImageUrl pgtype.Text `json:"image_url"` }
type CreateBranchParams ¶
type CreateCategoryParams ¶
type CreateCurrencyParams ¶
type CreateCustomerParams ¶
type CreateInvoiceItemParams ¶
type CreateInvoiceParams ¶
type CreateInvoiceParams struct { CustomerID pgtype.UUID `json:"customer_id"` InvoiceNumber string `json:"invoice_number"` Subtotal pgtype.Numeric `json:"subtotal"` Discount pgtype.Numeric `json:"discount"` Total pgtype.Numeric `json:"total"` Status string `json:"status"` CreatedBy pgtype.UUID `json:"created_by"` CurrencyID pgtype.UUID `json:"currency_id"` DueDate pgtype.Timestamptz `json:"due_date"` Reminders []byte `json:"reminders"` PaymentInfoID pgtype.UUID `json:"payment_info_id"` }
type CreatePaymentInfoParams ¶
type CreatePaymentParams ¶
type CreatePaymentParams struct { InvoiceID pgtype.UUID `json:"invoice_id"` PaymentMethod pgtype.Text `json:"payment_method"` PaymentAmount pgtype.Numeric `json:"payment_amount"` PaymentRef pgtype.Text `json:"payment_ref"` PaymentDate pgtype.Timestamptz `json:"payment_date"` Metadata []byte `json:"metadata"` CreatedBy pgtype.UUID `json:"created_by"` }
type CreateProductParams ¶
type CreateProductParams struct { CategoryID pgtype.UUID `json:"category_id"` BranchID pgtype.UUID `json:"branch_id"` Name string `json:"name"` ProductType string `json:"product_type"` ServicePricingModel pgtype.Text `json:"service_pricing_model"` DefaultUnit pgtype.Text `json:"default_unit"` IsBillable pgtype.Bool `json:"is_billable"` Sku string `json:"sku"` Description pgtype.Text `json:"description"` BasePrice pgtype.Numeric `json:"base_price"` }
type CreateProductVersionParams ¶
type CreateProductVersionParams struct { ProductID pgtype.UUID `json:"product_id"` BranchID pgtype.UUID `json:"branch_id"` Name string `json:"name"` PriceAdjustment pgtype.Numeric `json:"price_adjustment"` Attributes []byte `json:"attributes"` StockQuantity pgtype.Int4 `json:"stock_quantity"` ReorderPoint pgtype.Int4 `json:"reorder_point"` }
type CreateShiftParams ¶
type CreateStaffParams ¶
type CreateStaffRoleParams ¶
type CreateUserParams ¶
type DBTX ¶
type DBTX interface { Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) Query(context.Context, string, ...interface{}) (pgx.Rows, error) QueryRow(context.Context, string, ...interface{}) pgx.Row CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) }
type GetAllArtworkRow ¶
type GetAllArtworkRow struct { ID pgtype.UUID `json:"id"` Title string `json:"title"` ArtistID pgtype.UUID `json:"artist_id"` CategoryID pgtype.UUID `json:"category_id"` YearCreated pgtype.Int4 `json:"year_created"` Medium pgtype.Text `json:"medium"` Dimensions pgtype.Text `json:"dimensions"` Description pgtype.Text `json:"description"` AcquisitionDate pgtype.Date `json:"acquisition_date"` ConditionStatus pgtype.Text `json:"condition_status"` LocationInMuseum pgtype.Text `json:"location_in_museum"` ImageUrl pgtype.Text `json:"image_url"` CreatedAt pgtype.Timestamp `json:"created_at"` ArtistName pgtype.Text `json:"artist_name"` CategoryName pgtype.Text `json:"category_name"` }
type GetAllShiftsRow ¶
type GetAllShiftsRow struct { ID pgtype.UUID `json:"id"` StaffID pgtype.UUID `json:"staff_id"` ShiftDate pgtype.Date `json:"shift_date"` StartTime pgtype.Time `json:"start_time"` EndTime pgtype.Time `json:"end_time"` Status pgtype.Text `json:"status"` Notes pgtype.Text `json:"notes"` CreatedAt pgtype.Timestamp `json:"created_at"` StaffFirstName pgtype.Text `json:"staff_first_name"` StaffLastName pgtype.Text `json:"staff_last_name"` }
type GetAllStaffRow ¶
type GetAllStaffRow struct { ID pgtype.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` RoleID pgtype.UUID `json:"role_id"` Email string `json:"email"` Phone pgtype.Text `json:"phone"` HireDate pgtype.Date `json:"hire_date"` Status pgtype.Text `json:"status"` CreatedAt pgtype.Timestamp `json:"created_at"` RoleTitle pgtype.Text `json:"role_title"` }
type GetArtworkRow ¶
type GetArtworkRow struct { ID pgtype.UUID `json:"id"` Title string `json:"title"` ArtistID pgtype.UUID `json:"artist_id"` CategoryID pgtype.UUID `json:"category_id"` YearCreated pgtype.Int4 `json:"year_created"` Medium pgtype.Text `json:"medium"` Dimensions pgtype.Text `json:"dimensions"` Description pgtype.Text `json:"description"` AcquisitionDate pgtype.Date `json:"acquisition_date"` ConditionStatus pgtype.Text `json:"condition_status"` LocationInMuseum pgtype.Text `json:"location_in_museum"` ImageUrl pgtype.Text `json:"image_url"` CreatedAt pgtype.Timestamp `json:"created_at"` ArtistName pgtype.Text `json:"artist_name"` CategoryName pgtype.Text `json:"category_name"` }
type GetInvoiceItemsByInvoiceIDRow ¶
type GetInvoiceItemsByInvoiceIDRow struct { ID pgtype.UUID `json:"id"` InvoiceID pgtype.UUID `json:"invoice_id"` VersionID pgtype.UUID `json:"version_id"` Quantity int32 `json:"quantity"` UnitPrice pgtype.Numeric `json:"unit_price"` Subtotal pgtype.Numeric `json:"subtotal"` Metadata []byte `json:"metadata"` ID_2 pgtype.UUID `json:"id_2"` ProductID pgtype.UUID `json:"product_id"` BranchID pgtype.UUID `json:"branch_id"` Name string `json:"name"` PriceAdjustment pgtype.Numeric `json:"price_adjustment"` Attributes []byte `json:"attributes"` StockQuantity pgtype.Int4 `json:"stock_quantity"` ReorderPoint pgtype.Int4 `json:"reorder_point"` CreatedAt pgtype.Timestamptz `json:"created_at"` }
type GetShiftRow ¶
type GetShiftRow struct { ID pgtype.UUID `json:"id"` StaffID pgtype.UUID `json:"staff_id"` ShiftDate pgtype.Date `json:"shift_date"` StartTime pgtype.Time `json:"start_time"` EndTime pgtype.Time `json:"end_time"` Status pgtype.Text `json:"status"` Notes pgtype.Text `json:"notes"` CreatedAt pgtype.Timestamp `json:"created_at"` StaffFirstName pgtype.Text `json:"staff_first_name"` StaffLastName pgtype.Text `json:"staff_last_name"` }
type GetStaffRow ¶
type GetStaffRow struct { ID pgtype.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` RoleID pgtype.UUID `json:"role_id"` Email string `json:"email"` Phone pgtype.Text `json:"phone"` HireDate pgtype.Date `json:"hire_date"` Status pgtype.Text `json:"status"` CreatedAt pgtype.Timestamp `json:"created_at"` RoleTitle pgtype.Text `json:"role_title"` }
type GetTotalsByStatusesRow ¶
type Invoice ¶
type Invoice struct { ID pgtype.UUID `json:"id"` CustomerID pgtype.UUID `json:"customer_id"` InvoiceNumber string `json:"invoice_number"` Subtotal pgtype.Numeric `json:"subtotal"` Discount pgtype.Numeric `json:"discount"` Total pgtype.Numeric `json:"total"` Status string `json:"status"` CreatedBy pgtype.UUID `json:"created_by"` CreatedAt pgtype.Timestamptz `json:"created_at"` CurrencyID pgtype.UUID `json:"currency_id"` DueDate pgtype.Timestamptz `json:"due_date"` Reminders []byte `json:"reminders"` Metadata []byte `json:"metadata"` AmountPaid pgtype.Numeric `json:"amount_paid"` BalanceDue pgtype.Numeric `json:"balance_due"` PaymentInfoID pgtype.UUID `json:"payment_info_id"` }
type InvoiceItem ¶
type NullProductType ¶
type NullProductType struct { ProductType ProductType `json:"product_type"` Valid bool `json:"valid"` // Valid is true if ProductType is not NULL }
func (*NullProductType) Scan ¶
func (ns *NullProductType) Scan(value interface{}) error
Scan implements the Scanner interface.
type Organization ¶
type Payment ¶
type Payment struct { ID pgtype.UUID `json:"id"` InvoiceID pgtype.UUID `json:"invoice_id"` PaymentMethod pgtype.Text `json:"payment_method"` PaymentAmount pgtype.Numeric `json:"payment_amount"` PaymentRef pgtype.Text `json:"payment_ref"` PaymentDate pgtype.Timestamptz `json:"payment_date"` Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` CreatedBy pgtype.UUID `json:"created_by"` }
type PaymentInfo ¶
type Product ¶
type Product struct { ID pgtype.UUID `json:"id"` CategoryID pgtype.UUID `json:"category_id"` BranchID pgtype.UUID `json:"branch_id"` Name string `json:"name"` ProductType string `json:"product_type"` ServicePricingModel pgtype.Text `json:"service_pricing_model"` DefaultUnit pgtype.Text `json:"default_unit"` IsBillable pgtype.Bool `json:"is_billable"` Sku string `json:"sku"` Description pgtype.Text `json:"description"` BasePrice pgtype.Numeric `json:"base_price"` CustomFields []byte `json:"custom_fields"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
type ProductType ¶
type ProductType string
const ( ProductTypePhysical ProductType = "physical" ProductTypeService ProductType = "service" )
func (*ProductType) Scan ¶
func (e *ProductType) Scan(src interface{}) error
type ProductVersion ¶
type ProductVersion struct { ID pgtype.UUID `json:"id"` ProductID pgtype.UUID `json:"product_id"` BranchID pgtype.UUID `json:"branch_id"` Name string `json:"name"` PriceAdjustment pgtype.Numeric `json:"price_adjustment"` Attributes []byte `json:"attributes"` StockQuantity pgtype.Int4 `json:"stock_quantity"` ReorderPoint pgtype.Int4 `json:"reorder_point"` CreatedAt pgtype.Timestamptz `json:"created_at"` }
type Querier ¶
type Querier interface { CountArtCategories(ctx context.Context) (int64, error) CountArtists(ctx context.Context) (int64, error) CountArtworks(ctx context.Context) (int64, error) CountShifts(ctx context.Context) (int64, error) CountStaff(ctx context.Context) (int64, error) CreateActivityLog(ctx context.Context, arg CreateActivityLogParams) (ActivityLog, error) CreateArtCategory(ctx context.Context, arg CreateArtCategoryParams) (ArtCategory, error) CreateArtist(ctx context.Context, arg CreateArtistParams) (Artist, error) CreateArtwork(ctx context.Context, arg CreateArtworkParams) (Artwork, error) CreateBranch(ctx context.Context, arg CreateBranchParams) (Branch, error) CreateCategory(ctx context.Context, arg CreateCategoryParams) (Category, error) CreateCurrency(ctx context.Context, arg CreateCurrencyParams) (Currency, error) CreateCustomer(ctx context.Context, arg CreateCustomerParams) (Customer, error) // Insert inventory record CreateInventoryRecord(ctx context.Context, arg CreateInventoryRecordParams) (Inventory, error) CreateInvoice(ctx context.Context, arg CreateInvoiceParams) (Invoice, error) CreateInvoiceItem(ctx context.Context, arg CreateInvoiceItemParams) (InvoiceItem, error) CreateMultipleInvoiceItems(ctx context.Context, arg []CreateMultipleInvoiceItemsParams) (int64, error) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error) CreatePayment(ctx context.Context, arg CreatePaymentParams) (Payment, error) // Insert payment info CreatePaymentInfo(ctx context.Context, arg CreatePaymentInfoParams) (PaymentInfo, error) CreateProduct(ctx context.Context, arg CreateProductParams) (Product, error) CreateProductVersion(ctx context.Context, arg CreateProductVersionParams) (ProductVersion, error) CreateShift(ctx context.Context, arg CreateShiftParams) (Shift, error) CreateStaff(ctx context.Context, arg CreateStaffParams) (Staff, error) CreateStaffRole(ctx context.Context, arg CreateStaffRoleParams) (StaffRole, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeleteArtCategory(ctx context.Context, id pgtype.UUID) error DeleteCustomerByID(ctx context.Context, id pgtype.UUID) error DeleteItemsByInvoiceId(ctx context.Context, invoiceID pgtype.UUID) error DeleteStaff(ctx context.Context, id pgtype.UUID) error GetActivityLogByEntityID(ctx context.Context, entityID pgtype.UUID) ([]ActivityLog, error) GetActivityLogsByUserID(ctx context.Context, userID pgtype.UUID) ([]ActivityLog, error) GetAllArtCategories(ctx context.Context) ([]ArtCategory, error) GetAllArtists(ctx context.Context) ([]Artist, error) GetAllArtwork(ctx context.Context) (GetAllArtworkRow, error) GetAllInvoices(ctx context.Context) ([]Invoice, error) GetAllShifts(ctx context.Context) (GetAllShiftsRow, error) GetAllStaff(ctx context.Context) ([]GetAllStaffRow, error) GetArtCategory(ctx context.Context, id pgtype.UUID) (ArtCategory, error) GetArtist(ctx context.Context, id pgtype.UUID) (Artist, error) GetArtwork(ctx context.Context, id pgtype.UUID) (GetArtworkRow, error) GetBranchByID(ctx context.Context, id pgtype.UUID) (Branch, error) GetCategoriesByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Category, error) GetCurrencyByID(ctx context.Context, id pgtype.UUID) (Currency, error) GetCustomerByEmail(ctx context.Context, email pgtype.Text) (Customer, error) GetCustomerById(ctx context.Context, id pgtype.UUID) (Customer, error) GetCustomersByBranch(ctx context.Context, branchID pgtype.UUID) ([]Customer, error) // Get inventory by branch ID GetInventoryByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Inventory, error) // Get inventory by ID GetInventoryByID(ctx context.Context, id pgtype.UUID) (Inventory, error) // Get inventory by version ID GetInventoryByVersionID(ctx context.Context, versionID pgtype.UUID) (Inventory, error) GetInvoiceByID(ctx context.Context, id pgtype.UUID) (Invoice, error) GetInvoiceItemsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]GetInvoiceItemsByInvoiceIDRow, error) GetInvoicesCreatedByUser(ctx context.Context, createdBy pgtype.UUID) ([]Invoice, error) GetOrganizationByID(ctx context.Context, id pgtype.UUID) (Organization, error) // Get payment by ID GetPaymentByID(ctx context.Context, id pgtype.UUID) (Payment, error) GetPaymentInfoByUserID(ctx context.Context, userID pgtype.UUID) (PaymentInfo, error) // Get payments by invoice ID GetPaymentsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]Payment, error) GetProductVersionsByProductID(ctx context.Context, productID pgtype.UUID) ([]ProductVersion, error) GetProductsByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Product, error) GetProductsByID(ctx context.Context, id pgtype.UUID) (Product, error) GetShift(ctx context.Context, id pgtype.UUID) (GetShiftRow, error) GetStaff(ctx context.Context, id pgtype.UUID) (GetStaffRow, error) GetStaffRole(ctx context.Context, id pgtype.UUID) (StaffRole, error) GetTotalsByStatuses(ctx context.Context, createdBy pgtype.UUID) (GetTotalsByStatusesRow, error) GetUserByEmail(ctx context.Context, email string) (User, error) GetUserById(ctx context.Context, id pgtype.UUID) (User, error) UpdateArtCategory(ctx context.Context, arg UpdateArtCategoryParams) (ArtCategory, error) UpdateArtist(ctx context.Context, arg UpdateArtistParams) (Artist, error) UpdateArtwork(ctx context.Context, arg UpdateArtworkParams) (Artwork, error) // Update inventory UpdateInventory(ctx context.Context, arg UpdateInventoryParams) (Inventory, error) UpdateInvoice(ctx context.Context, arg UpdateInvoiceParams) (Invoice, error) UpdateInvoiceItem(ctx context.Context, arg UpdateInvoiceItemParams) (InvoiceItem, error) UpdateInvoicePayment(ctx context.Context, arg UpdateInvoicePaymentParams) (Invoice, error) // Update payment UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (Payment, error) UpdatePaymentInfo(ctx context.Context, arg UpdatePaymentInfoParams) error UpdateProduct(ctx context.Context, arg UpdateProductParams) (Product, error) UpdateProductVersion(ctx context.Context, arg UpdateProductVersionParams) (ProductVersion, error) UpdateShift(ctx context.Context, arg UpdateShiftParams) (Shift, error) UpdateStaff(ctx context.Context, arg UpdateStaffParams) (Staff, error) UpdateStaffRole(ctx context.Context, arg UpdateStaffRoleParams) (StaffRole, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountArtCategories ¶
func (*Queries) CreateActivityLog ¶
func (q *Queries) CreateActivityLog(ctx context.Context, arg CreateActivityLogParams) (ActivityLog, error)
func (*Queries) CreateArtCategory ¶
func (q *Queries) CreateArtCategory(ctx context.Context, arg CreateArtCategoryParams) (ArtCategory, error)
func (*Queries) CreateArtist ¶
func (*Queries) CreateArtwork ¶
func (*Queries) CreateBranch ¶
func (*Queries) CreateCategory ¶
func (*Queries) CreateCurrency ¶
func (*Queries) CreateCustomer ¶
func (*Queries) CreateInventoryRecord ¶
func (q *Queries) CreateInventoryRecord(ctx context.Context, arg CreateInventoryRecordParams) (Inventory, error)
Insert inventory record
func (*Queries) CreateInvoice ¶
func (*Queries) CreateInvoiceItem ¶
func (q *Queries) CreateInvoiceItem(ctx context.Context, arg CreateInvoiceItemParams) (InvoiceItem, error)
func (*Queries) CreateMultipleInvoiceItems ¶
func (*Queries) CreateOrganization ¶
func (q *Queries) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error)
func (*Queries) CreatePayment ¶
func (*Queries) CreatePaymentInfo ¶
func (q *Queries) CreatePaymentInfo(ctx context.Context, arg CreatePaymentInfoParams) (PaymentInfo, error)
Insert payment info
func (*Queries) CreateProduct ¶
func (*Queries) CreateProductVersion ¶
func (q *Queries) CreateProductVersion(ctx context.Context, arg CreateProductVersionParams) (ProductVersion, error)
func (*Queries) CreateShift ¶
func (*Queries) CreateStaff ¶
func (*Queries) CreateStaffRole ¶
func (*Queries) CreateUser ¶
func (*Queries) DeleteArtCategory ¶
func (*Queries) DeleteCustomerByID ¶
func (*Queries) DeleteItemsByInvoiceId ¶
func (*Queries) DeleteStaff ¶
func (*Queries) GetActivityLogByEntityID ¶
func (*Queries) GetActivityLogsByUserID ¶
func (*Queries) GetAllArtCategories ¶
func (q *Queries) GetAllArtCategories(ctx context.Context) ([]ArtCategory, error)
func (*Queries) GetAllArtists ¶
func (*Queries) GetAllArtwork ¶
func (q *Queries) GetAllArtwork(ctx context.Context) (GetAllArtworkRow, error)
func (*Queries) GetAllInvoices ¶
func (*Queries) GetAllShifts ¶
func (q *Queries) GetAllShifts(ctx context.Context) (GetAllShiftsRow, error)
func (*Queries) GetAllStaff ¶
func (q *Queries) GetAllStaff(ctx context.Context) ([]GetAllStaffRow, error)
func (*Queries) GetArtCategory ¶
func (*Queries) GetArtwork ¶
func (*Queries) GetBranchByID ¶
func (*Queries) GetCategoriesByBranchID ¶
func (*Queries) GetCurrencyByID ¶
func (*Queries) GetCustomerByEmail ¶
func (*Queries) GetCustomerById ¶
func (*Queries) GetCustomersByBranch ¶
func (*Queries) GetInventoryByBranchID ¶
func (q *Queries) GetInventoryByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Inventory, error)
Get inventory by branch ID
func (*Queries) GetInventoryByID ¶
Get inventory by ID
func (*Queries) GetInventoryByVersionID ¶
func (q *Queries) GetInventoryByVersionID(ctx context.Context, versionID pgtype.UUID) (Inventory, error)
Get inventory by version ID
func (*Queries) GetInvoiceByID ¶
func (*Queries) GetInvoiceItemsByInvoiceID ¶
func (*Queries) GetInvoicesCreatedByUser ¶
func (*Queries) GetOrganizationByID ¶
func (*Queries) GetPaymentByID ¶
Get payment by ID
func (*Queries) GetPaymentInfoByUserID ¶
func (*Queries) GetPaymentsByInvoiceID ¶
func (q *Queries) GetPaymentsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]Payment, error)
Get payments by invoice ID
func (*Queries) GetProductVersionsByProductID ¶
func (*Queries) GetProductsByBranchID ¶
func (*Queries) GetProductsByID ¶
func (*Queries) GetStaffRole ¶
func (*Queries) GetTotalsByStatuses ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserById ¶
func (*Queries) UpdateArtCategory ¶
func (q *Queries) UpdateArtCategory(ctx context.Context, arg UpdateArtCategoryParams) (ArtCategory, error)
func (*Queries) UpdateArtist ¶
func (*Queries) UpdateArtwork ¶
func (*Queries) UpdateInventory ¶
func (q *Queries) UpdateInventory(ctx context.Context, arg UpdateInventoryParams) (Inventory, error)
Update inventory
func (*Queries) UpdateInvoice ¶
func (*Queries) UpdateInvoiceItem ¶
func (q *Queries) UpdateInvoiceItem(ctx context.Context, arg UpdateInvoiceItemParams) (InvoiceItem, error)
func (*Queries) UpdateInvoicePayment ¶
func (*Queries) UpdatePayment ¶
Update payment
func (*Queries) UpdatePaymentInfo ¶
func (q *Queries) UpdatePaymentInfo(ctx context.Context, arg UpdatePaymentInfoParams) error
func (*Queries) UpdateProduct ¶
func (*Queries) UpdateProductVersion ¶
func (q *Queries) UpdateProductVersion(ctx context.Context, arg UpdateProductVersionParams) (ProductVersion, error)
func (*Queries) UpdateShift ¶
func (*Queries) UpdateStaff ¶
func (*Queries) UpdateStaffRole ¶
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
func (*SQLStore) ExecTx ¶
Takes a context and a callback function as input, starts a new database transaction, creat a new Queries object and with that transaction and calls the callback function with the created Queries object and finally commit or rollback the transaction based on the error returned by the callback function.
type Shift ¶
type Shift struct { ID pgtype.UUID `json:"id"` StaffID pgtype.UUID `json:"staff_id"` ShiftDate pgtype.Date `json:"shift_date"` StartTime pgtype.Time `json:"start_time"` EndTime pgtype.Time `json:"end_time"` Status pgtype.Text `json:"status"` Notes pgtype.Text `json:"notes"` CreatedAt pgtype.Timestamp `json:"created_at"` }
type Staff ¶
type Staff struct { ID pgtype.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` RoleID pgtype.UUID `json:"role_id"` Email string `json:"email"` Phone pgtype.Text `json:"phone"` HireDate pgtype.Date `json:"hire_date"` Status pgtype.Text `json:"status"` CreatedAt pgtype.Timestamp `json:"created_at"` }
type UpdateArtCategoryParams ¶
type UpdateArtistParams ¶
type UpdateArtworkParams ¶
type UpdateArtworkParams struct { ID pgtype.UUID `json:"id"` Title string `json:"title"` ArtistID pgtype.UUID `json:"artist_id"` CategoryID pgtype.UUID `json:"category_id"` YearCreated pgtype.Int4 `json:"year_created"` Medium pgtype.Text `json:"medium"` Dimensions pgtype.Text `json:"dimensions"` Description pgtype.Text `json:"description"` AcquisitionDate pgtype.Date `json:"acquisition_date"` ConditionStatus pgtype.Text `json:"condition_status"` LocationInMuseum pgtype.Text `json:"location_in_museum"` ImageUrl pgtype.Text `json:"image_url"` }
type UpdateInventoryParams ¶
type UpdateInvoiceItemParams ¶
type UpdateInvoiceParams ¶
type UpdateInvoiceParams struct { ID pgtype.UUID `json:"id"` CustomerID pgtype.UUID `json:"customer_id"` Subtotal pgtype.Numeric `json:"subtotal"` Discount pgtype.Numeric `json:"discount"` Total pgtype.Numeric `json:"total"` Status string `json:"status"` Reminders []byte `json:"reminders"` CurrencyID pgtype.UUID `json:"currency_id"` Metadata []byte `json:"metadata"` DueDate pgtype.Timestamptz `json:"due_date"` PaymentInfoID pgtype.UUID `json:"payment_info_id"` }
type UpdatePaymentInfoParams ¶
type UpdatePaymentParams ¶
type UpdateProductParams ¶
type UpdateProductParams struct { ID pgtype.UUID `json:"id"` CategoryID pgtype.UUID `json:"category_id"` Name string `json:"name"` ProductType string `json:"product_type"` ServicePricingModel pgtype.Text `json:"service_pricing_model"` DefaultUnit pgtype.Text `json:"default_unit"` IsBillable pgtype.Bool `json:"is_billable"` Sku string `json:"sku"` Description pgtype.Text `json:"description"` BasePrice pgtype.Numeric `json:"base_price"` }
type UpdateShiftParams ¶
type UpdateStaffParams ¶
type UpdateStaffParams struct { ID pgtype.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` RoleID pgtype.UUID `json:"role_id"` Email string `json:"email"` Phone pgtype.Text `json:"phone"` HireDate pgtype.Date `json:"hire_date"` Status pgtype.Text `json:"status"` }
type UpdateStaffRoleParams ¶
Source Files
¶
- activity_logs.sql.go
- art_categories.sql.go
- artists.sql.go
- artworks.sql.go
- branches.sql.go
- categories.sql.go
- copyfrom.go
- currency.sql.go
- customers.sql.go
- db.go
- inventory.sql.go
- invoice_items.sql.go
- invoices.sql.go
- models.go
- organizations.sql.go
- payment_info.sql.go
- payments.sql.go
- product_versions.sql.go
- products.sql.go
- querier.go
- shifts.sql.go
- staff.sql.go
- staff_roles.sql.go
- store.go
- users.sql.go
Click to show internal directories.
Click to hide internal directories.