db

package
v0.0.0-...-5a02b3d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityLog

type ActivityLog struct {
	ID         pgtype.UUID        `json:"id"`
	EntityType string             `json:"entity_type"`
	EntityID   pgtype.UUID        `json:"entity_id"`
	Action     string             `json:"action"`
	Changes    []byte             `json:"changes"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	UserID     pgtype.UUID        `json:"user_id"`
}

type ArtCategory

type ArtCategory struct {
	ID          pgtype.UUID      `json:"id"`
	Name        string           `json:"name"`
	Description pgtype.Text      `json:"description"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type Artist

type Artist struct {
	ID          pgtype.UUID      `json:"id"`
	Name        string           `json:"name"`
	Biography   pgtype.Text      `json:"biography"`
	BirthDate   pgtype.Date      `json:"birth_date"`
	DeathDate   pgtype.Date      `json:"death_date"`
	Nationality pgtype.Text      `json:"nationality"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

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 Branch

type Branch struct {
	ID             pgtype.UUID        `json:"id"`
	Name           string             `json:"name"`
	Address        pgtype.Text        `json:"address"`
	IsDefault      pgtype.Bool        `json:"is_default"`
	OrganizationID pgtype.UUID        `json:"organization_id"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type Category

type Category struct {
	ID          pgtype.UUID        `json:"id"`
	ParentID    pgtype.UUID        `json:"parent_id"`
	Name        string             `json:"name"`
	BranchID    pgtype.UUID        `json:"branch_id"`
	Description pgtype.Text        `json:"description"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
}

type CreateActivityLogParams

type CreateActivityLogParams struct {
	EntityType string      `json:"entity_type"`
	EntityID   pgtype.UUID `json:"entity_id"`
	Action     string      `json:"action"`
	Changes    []byte      `json:"changes"`
	UserID     pgtype.UUID `json:"user_id"`
}

type CreateArtCategoryParams

type CreateArtCategoryParams struct {
	Name        string      `json:"name"`
	Description pgtype.Text `json:"description"`
}

type CreateArtistParams

type CreateArtistParams struct {
	Name        string      `json:"name"`
	Biography   pgtype.Text `json:"biography"`
	BirthDate   pgtype.Date `json:"birth_date"`
	DeathDate   pgtype.Date `json:"death_date"`
	Nationality pgtype.Text `json:"nationality"`
}

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 CreateBranchParams struct {
	Name           string      `json:"name"`
	Address        pgtype.Text `json:"address"`
	OrganizationID pgtype.UUID `json:"organization_id"`
}

type CreateCategoryParams

type CreateCategoryParams struct {
	Name        string      `json:"name"`
	Description pgtype.Text `json:"description"`
	ParentID    pgtype.UUID `json:"parent_id"`
	BranchID    pgtype.UUID `json:"branch_id"`
}

type CreateCurrencyParams

type CreateCurrencyParams struct {
	Name   string      `json:"name"`
	Symbol pgtype.Text `json:"symbol"`
	Code   string      `json:"code"`
}

type CreateCustomerParams

type CreateCustomerParams struct {
	Name           string      `json:"name"`
	Email          pgtype.Text `json:"email"`
	Phone          pgtype.Text `json:"phone"`
	BillingAddress []byte      `json:"billing_address"`
	BranchID       pgtype.UUID `json:"branch_id"`
}

type CreateInventoryRecordParams

type CreateInventoryRecordParams struct {
	VersionID   pgtype.UUID        `json:"version_id"`
	BranchID    pgtype.UUID        `json:"branch_id"`
	Quantity    pgtype.Int4        `json:"quantity"`
	UnitCost    pgtype.Numeric     `json:"unit_cost"`
	LastCounted pgtype.Timestamptz `json:"last_counted"`
}

type CreateInvoiceItemParams

type CreateInvoiceItemParams struct {
	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"`
}

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 CreateMultipleInvoiceItemsParams

type CreateMultipleInvoiceItemsParams 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"`
}

type CreateOrganizationParams

type CreateOrganizationParams struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type CreatePaymentInfoParams

type CreatePaymentInfoParams struct {
	UserID      pgtype.UUID `json:"user_id"`
	AccountNo   string      `json:"account_no"`
	RoutingNo   pgtype.Text `json:"routing_no"`
	AccountName string      `json:"account_name"`
	BankName    string      `json:"bank_name"`
}

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 CreateShiftParams struct {
	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"`
}

type CreateStaffParams

type CreateStaffParams struct {
	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 CreateStaffRoleParams

type CreateStaffRoleParams struct {
	Title       string      `json:"title"`
	Description pgtype.Text `json:"description"`
}

type CreateUserParams

type CreateUserParams struct {
	Name     string      `json:"name"`
	Email    string      `json:"email"`
	Address  pgtype.Text `json:"address"`
	BranchID pgtype.UUID `json:"branch_id"`
}

type Currency

type Currency struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Code      string             `json:"code"`
	Symbol    pgtype.Text        `json:"symbol"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type Customer

type Customer struct {
	ID             pgtype.UUID        `json:"id"`
	Name           string             `json:"name"`
	Email          pgtype.Text        `json:"email"`
	Phone          pgtype.Text        `json:"phone"`
	BillingAddress []byte             `json:"billing_address"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	BranchID       pgtype.UUID        `json:"branch_id"`
}

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 GetTotalsByStatusesRow struct {
	PaidTotal    int64 `json:"paid_total"`
	UnpaidTotal  int64 `json:"unpaid_total"`
	OverdueTotal int64 `json:"overdue_total"`
	DraftTotal   int64 `json:"draft_total"`
}

type Inventory

type Inventory struct {
	ID          pgtype.UUID        `json:"id"`
	VersionID   pgtype.UUID        `json:"version_id"`
	BranchID    pgtype.UUID        `json:"branch_id"`
	Quantity    pgtype.Int4        `json:"quantity"`
	UnitCost    pgtype.Numeric     `json:"unit_cost"`
	LastCounted pgtype.Timestamptz `json:"last_counted"`
}

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 InvoiceItem 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"`
}

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.

func (NullProductType) Value

func (ns NullProductType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Organization

type Organization struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Email     string             `json:"email"`
	Active    pgtype.Bool        `json:"active"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

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 PaymentInfo struct {
	ID          pgtype.UUID        `json:"id"`
	UserID      pgtype.UUID        `json:"user_id"`
	AccountNo   string             `json:"account_no"`
	RoutingNo   pgtype.Text        `json:"routing_no"`
	AccountName string             `json:"account_name"`
	BankName    string             `json:"bank_name"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
}

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 New

func New(db DBTX) *Queries

func (*Queries) CountArtCategories

func (q *Queries) CountArtCategories(ctx context.Context) (int64, error)

func (*Queries) CountArtists

func (q *Queries) CountArtists(ctx context.Context) (int64, error)

func (*Queries) CountArtworks

func (q *Queries) CountArtworks(ctx context.Context) (int64, error)

func (*Queries) CountShifts

func (q *Queries) CountShifts(ctx context.Context) (int64, error)

func (*Queries) CountStaff

func (q *Queries) CountStaff(ctx context.Context) (int64, error)

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 (q *Queries) CreateArtist(ctx context.Context, arg CreateArtistParams) (Artist, error)

func (*Queries) CreateArtwork

func (q *Queries) CreateArtwork(ctx context.Context, arg CreateArtworkParams) (Artwork, error)

func (*Queries) CreateBranch

func (q *Queries) CreateBranch(ctx context.Context, arg CreateBranchParams) (Branch, error)

func (*Queries) CreateCategory

func (q *Queries) CreateCategory(ctx context.Context, arg CreateCategoryParams) (Category, error)

func (*Queries) CreateCurrency

func (q *Queries) CreateCurrency(ctx context.Context, arg CreateCurrencyParams) (Currency, error)

func (*Queries) CreateCustomer

func (q *Queries) CreateCustomer(ctx context.Context, arg CreateCustomerParams) (Customer, error)

func (*Queries) CreateInventoryRecord

func (q *Queries) CreateInventoryRecord(ctx context.Context, arg CreateInventoryRecordParams) (Inventory, error)

Insert inventory record

func (*Queries) CreateInvoice

func (q *Queries) CreateInvoice(ctx context.Context, arg CreateInvoiceParams) (Invoice, error)

func (*Queries) CreateInvoiceItem

func (q *Queries) CreateInvoiceItem(ctx context.Context, arg CreateInvoiceItemParams) (InvoiceItem, error)

func (*Queries) CreateMultipleInvoiceItems

func (q *Queries) CreateMultipleInvoiceItems(ctx context.Context, arg []CreateMultipleInvoiceItemsParams) (int64, error)

func (*Queries) CreateOrganization

func (q *Queries) CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error)

func (*Queries) CreatePayment

func (q *Queries) CreatePayment(ctx context.Context, arg CreatePaymentParams) (Payment, error)

func (*Queries) CreatePaymentInfo

func (q *Queries) CreatePaymentInfo(ctx context.Context, arg CreatePaymentInfoParams) (PaymentInfo, error)

Insert payment info

func (*Queries) CreateProduct

func (q *Queries) CreateProduct(ctx context.Context, arg CreateProductParams) (Product, error)

func (*Queries) CreateProductVersion

func (q *Queries) CreateProductVersion(ctx context.Context, arg CreateProductVersionParams) (ProductVersion, error)

func (*Queries) CreateShift

func (q *Queries) CreateShift(ctx context.Context, arg CreateShiftParams) (Shift, error)

func (*Queries) CreateStaff

func (q *Queries) CreateStaff(ctx context.Context, arg CreateStaffParams) (Staff, error)

func (*Queries) CreateStaffRole

func (q *Queries) CreateStaffRole(ctx context.Context, arg CreateStaffRoleParams) (StaffRole, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteArtCategory

func (q *Queries) DeleteArtCategory(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteCustomerByID

func (q *Queries) DeleteCustomerByID(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteItemsByInvoiceId

func (q *Queries) DeleteItemsByInvoiceId(ctx context.Context, invoiceID pgtype.UUID) error

func (*Queries) DeleteStaff

func (q *Queries) DeleteStaff(ctx context.Context, id pgtype.UUID) error

func (*Queries) GetActivityLogByEntityID

func (q *Queries) GetActivityLogByEntityID(ctx context.Context, entityID pgtype.UUID) ([]ActivityLog, error)

func (*Queries) GetActivityLogsByUserID

func (q *Queries) GetActivityLogsByUserID(ctx context.Context, userID pgtype.UUID) ([]ActivityLog, error)

func (*Queries) GetAllArtCategories

func (q *Queries) GetAllArtCategories(ctx context.Context) ([]ArtCategory, error)

func (*Queries) GetAllArtists

func (q *Queries) GetAllArtists(ctx context.Context) ([]Artist, error)

func (*Queries) GetAllArtwork

func (q *Queries) GetAllArtwork(ctx context.Context) (GetAllArtworkRow, error)

func (*Queries) GetAllInvoices

func (q *Queries) GetAllInvoices(ctx context.Context) ([]Invoice, error)

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 (q *Queries) GetArtCategory(ctx context.Context, id pgtype.UUID) (ArtCategory, error)

func (*Queries) GetArtist

func (q *Queries) GetArtist(ctx context.Context, id pgtype.UUID) (Artist, error)

func (*Queries) GetArtwork

func (q *Queries) GetArtwork(ctx context.Context, id pgtype.UUID) (GetArtworkRow, error)

func (*Queries) GetBranchByID

func (q *Queries) GetBranchByID(ctx context.Context, id pgtype.UUID) (Branch, error)

func (*Queries) GetCategoriesByBranchID

func (q *Queries) GetCategoriesByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Category, error)

func (*Queries) GetCurrencyByID

func (q *Queries) GetCurrencyByID(ctx context.Context, id pgtype.UUID) (Currency, error)

func (*Queries) GetCustomerByEmail

func (q *Queries) GetCustomerByEmail(ctx context.Context, email pgtype.Text) (Customer, error)

func (*Queries) GetCustomerById

func (q *Queries) GetCustomerById(ctx context.Context, id pgtype.UUID) (Customer, error)

func (*Queries) GetCustomersByBranch

func (q *Queries) GetCustomersByBranch(ctx context.Context, branchID pgtype.UUID) ([]Customer, error)

func (*Queries) GetInventoryByBranchID

func (q *Queries) GetInventoryByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Inventory, error)

Get inventory by branch ID

func (*Queries) GetInventoryByID

func (q *Queries) GetInventoryByID(ctx context.Context, id pgtype.UUID) (Inventory, error)

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 (q *Queries) GetInvoiceByID(ctx context.Context, id pgtype.UUID) (Invoice, error)

func (*Queries) GetInvoiceItemsByInvoiceID

func (q *Queries) GetInvoiceItemsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]GetInvoiceItemsByInvoiceIDRow, error)

func (*Queries) GetInvoicesCreatedByUser

func (q *Queries) GetInvoicesCreatedByUser(ctx context.Context, createdBy pgtype.UUID) ([]Invoice, error)

func (*Queries) GetOrganizationByID

func (q *Queries) GetOrganizationByID(ctx context.Context, id pgtype.UUID) (Organization, error)

func (*Queries) GetPaymentByID

func (q *Queries) GetPaymentByID(ctx context.Context, id pgtype.UUID) (Payment, error)

Get payment by ID

func (*Queries) GetPaymentInfoByUserID

func (q *Queries) GetPaymentInfoByUserID(ctx context.Context, userID pgtype.UUID) (PaymentInfo, error)

func (*Queries) GetPaymentsByInvoiceID

func (q *Queries) GetPaymentsByInvoiceID(ctx context.Context, invoiceID pgtype.UUID) ([]Payment, error)

Get payments by invoice ID

func (*Queries) GetProductVersionsByProductID

func (q *Queries) GetProductVersionsByProductID(ctx context.Context, productID pgtype.UUID) ([]ProductVersion, error)

func (*Queries) GetProductsByBranchID

func (q *Queries) GetProductsByBranchID(ctx context.Context, branchID pgtype.UUID) ([]Product, error)

func (*Queries) GetProductsByID

func (q *Queries) GetProductsByID(ctx context.Context, id pgtype.UUID) (Product, error)

func (*Queries) GetShift

func (q *Queries) GetShift(ctx context.Context, id pgtype.UUID) (GetShiftRow, error)

func (*Queries) GetStaff

func (q *Queries) GetStaff(ctx context.Context, id pgtype.UUID) (GetStaffRow, error)

func (*Queries) GetStaffRole

func (q *Queries) GetStaffRole(ctx context.Context, id pgtype.UUID) (StaffRole, error)

func (*Queries) GetTotalsByStatuses

func (q *Queries) GetTotalsByStatuses(ctx context.Context, createdBy pgtype.UUID) (GetTotalsByStatusesRow, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) UpdateArtCategory

func (q *Queries) UpdateArtCategory(ctx context.Context, arg UpdateArtCategoryParams) (ArtCategory, error)

func (*Queries) UpdateArtist

func (q *Queries) UpdateArtist(ctx context.Context, arg UpdateArtistParams) (Artist, error)

func (*Queries) UpdateArtwork

func (q *Queries) UpdateArtwork(ctx context.Context, arg UpdateArtworkParams) (Artwork, error)

func (*Queries) UpdateInventory

func (q *Queries) UpdateInventory(ctx context.Context, arg UpdateInventoryParams) (Inventory, error)

Update inventory

func (*Queries) UpdateInvoice

func (q *Queries) UpdateInvoice(ctx context.Context, arg UpdateInvoiceParams) (Invoice, error)

func (*Queries) UpdateInvoiceItem

func (q *Queries) UpdateInvoiceItem(ctx context.Context, arg UpdateInvoiceItemParams) (InvoiceItem, error)

func (*Queries) UpdateInvoicePayment

func (q *Queries) UpdateInvoicePayment(ctx context.Context, arg UpdateInvoicePaymentParams) (Invoice, error)

func (*Queries) UpdatePayment

func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) (Payment, error)

Update payment

func (*Queries) UpdatePaymentInfo

func (q *Queries) UpdatePaymentInfo(ctx context.Context, arg UpdatePaymentInfoParams) error

func (*Queries) UpdateProduct

func (q *Queries) UpdateProduct(ctx context.Context, arg UpdateProductParams) (Product, error)

func (*Queries) UpdateProductVersion

func (q *Queries) UpdateProductVersion(ctx context.Context, arg UpdateProductVersionParams) (ProductVersion, error)

func (*Queries) UpdateShift

func (q *Queries) UpdateShift(ctx context.Context, arg UpdateShiftParams) (Shift, error)

func (*Queries) UpdateStaff

func (q *Queries) UpdateStaff(ctx context.Context, arg UpdateStaffParams) (Staff, error)

func (*Queries) UpdateStaffRole

func (q *Queries) UpdateStaffRole(ctx context.Context, arg UpdateStaffRoleParams) (StaffRole, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type SQLStore

type SQLStore struct {
	*Queries
	// contains filtered or unexported fields
}

func (*SQLStore) ExecTx

func (store *SQLStore) ExecTx(ctx context.Context, fn func(*Queries) error) error

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 StaffRole

type StaffRole struct {
	ID          pgtype.UUID      `json:"id"`
	Title       string           `json:"title"`
	Description pgtype.Text      `json:"description"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type Store

type Store interface {
	Querier
	ExecTx(ctx context.Context, fn func(*Queries) error) error
}

func NewStore

func NewStore(db *pgxpool.Pool) Store

NewStore creates a new Store

type UpdateArtCategoryParams

type UpdateArtCategoryParams struct {
	ID          pgtype.UUID `json:"id"`
	Name        string      `json:"name"`
	Description pgtype.Text `json:"description"`
}

type UpdateArtistParams

type UpdateArtistParams struct {
	ID          pgtype.UUID `json:"id"`
	Name        string      `json:"name"`
	Biography   pgtype.Text `json:"biography"`
	BirthDate   pgtype.Date `json:"birth_date"`
	DeathDate   pgtype.Date `json:"death_date"`
	Nationality pgtype.Text `json:"nationality"`
}

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 UpdateInventoryParams struct {
	ID          pgtype.UUID        `json:"id"`
	Quantity    pgtype.Int4        `json:"quantity"`
	UnitCost    pgtype.Numeric     `json:"unit_cost"`
	LastCounted pgtype.Timestamptz `json:"last_counted"`
}

type UpdateInvoiceItemParams

type UpdateInvoiceItemParams struct {
	ID        pgtype.UUID    `json:"id"`
	VersionID pgtype.UUID    `json:"version_id"`
	Quantity  int32          `json:"quantity"`
	UnitPrice pgtype.Numeric `json:"unit_price"`
	Subtotal  pgtype.Numeric `json:"subtotal"`
}

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 UpdateInvoicePaymentParams

type UpdateInvoicePaymentParams struct {
	ID         pgtype.UUID    `json:"id"`
	AmountPaid pgtype.Numeric `json:"amount_paid"`
	Status     string         `json:"status"`
}

type UpdatePaymentInfoParams

type UpdatePaymentInfoParams struct {
	UserID      pgtype.UUID `json:"user_id"`
	AccountNo   string      `json:"account_no"`
	RoutingNo   pgtype.Text `json:"routing_no"`
	AccountName string      `json:"account_name"`
	BankName    string      `json:"bank_name"`
}

type UpdatePaymentParams

type UpdatePaymentParams struct {
	ID            pgtype.UUID        `json:"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"`
}

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 UpdateProductVersionParams

type UpdateProductVersionParams struct {
	ID              pgtype.UUID    `json:"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 UpdateShiftParams

type UpdateShiftParams 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"`
}

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

type UpdateStaffRoleParams struct {
	ID          pgtype.UUID `json:"id"`
	Title       string      `json:"title"`
	Description pgtype.Text `json:"description"`
}

type User

type User struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Email     string             `json:"email"`
	Address   pgtype.Text        `json:"address"`
	BranchID  pgtype.UUID        `json:"branch_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL