postgres

package
v0.0.0-...-67df305 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(config config.Config) (*sql.DB, error)

Types

type BidRepo

type BidRepo struct {
	// contains filtered or unexported fields
}

func NewBidRepo

func NewBidRepo(db *sql.DB, redisClient *redis.Client) *BidRepo

func (*BidRepo) AwardBidByTenderID

func (r *BidRepo) AwardBidByTenderID(ctx context.Context, clientID, tenderID, bidID uuid.UUID) error

func (*BidRepo) Create

func (r *BidRepo) Create(ctx context.Context, bid *models.Bid) error

func (*BidRepo) DeleteByContractorID

func (r *BidRepo) DeleteByContractorID(ctx context.Context, contractorID, bidID uuid.UUID) error

func (*BidRepo) GetByID

func (r *BidRepo) GetByID(ctx context.Context, id uuid.UUID) (*models.Bid, error)

func (*BidRepo) ListByClientTenderID

func (r *BidRepo) ListByClientTenderID(ctx context.Context, clientID, tenderID uuid.UUID) ([]models.Bid, error)

func (*BidRepo) ListByContractorID

func (r *BidRepo) ListByContractorID(ctx context.Context, contractorID uuid.UUID) ([]models.Bid, error)

func (*BidRepo) ListByTenderID

func (r *BidRepo) ListByTenderID(ctx context.Context, tenderID uuid.UUID, filters repository.BidFilters) ([]models.Bid, error)

func (*BidRepo) ListByTenderIDWithFilters

func (r *BidRepo) ListByTenderIDWithFilters(ctx context.Context, tenderID uuid.UUID, filters repository.BidFilters) ([]models.Bid, error)

func (*BidRepo) Update

func (r *BidRepo) Update(ctx context.Context, bid *models.Bid) error

type HistoryRepo

type HistoryRepo struct {
	// contains filtered or unexported fields
}

Tender represents a tender history entry.

func NewHistoryRepo

func NewHistoryRepo(db *sql.DB) *HistoryRepo

NewHistoryRepo creates a new instance of HistoryRepo.

func (*HistoryRepo) GetBidHistory

func (h *HistoryRepo) GetBidHistory(userID uuid.UUID) ([]models.Bid, error)

GetBidHistory retrieves the bid history for a specific contractor.

func (*HistoryRepo) GetTenderHistory

func (h *HistoryRepo) GetTenderHistory(userID uuid.UUID) ([]models.Tender, error)

GetTenderHistory retrieves the tender history for a specific user.

type NotificationRepo

type NotificationRepo struct {
	// contains filtered or unexported fields
}

func NewNotificationRepo

func NewNotificationRepo(db *sql.DB) *NotificationRepo

func (*NotificationRepo) Create

func (r *NotificationRepo) Create(ctx context.Context, notification *models.Notification) error

func (*NotificationRepo) ListByUserID

func (r *NotificationRepo) ListByUserID(ctx context.Context, userID uuid.UUID) ([]models.Notification, error)

func (*NotificationRepo) MarkAsRead

func (r *NotificationRepo) MarkAsRead(ctx context.Context, id uuid.UUID) error

type TenderRepo

type TenderRepo struct {
	// contains filtered or unexported fields
}

func NewTenderRepo

func NewTenderRepo(db *sql.DB, redisClient *redis.Client) *TenderRepo

func (*TenderRepo) Create

func (r *TenderRepo) Create(ctx context.Context, tender *models.Tender) error

func (*TenderRepo) Delete

func (r *TenderRepo) Delete(ctx context.Context, id uuid.UUID) error

func (*TenderRepo) GetByID

func (r *TenderRepo) GetByID(ctx context.Context, id uuid.UUID) (*models.Tender, error)

func (*TenderRepo) GetClientIDByTenderID

func (r *TenderRepo) GetClientIDByTenderID(ctx context.Context, tenderID uuid.UUID) (uuid.UUID, error)

func (*TenderRepo) List

func (r *TenderRepo) List(ctx context.Context, filters repository.TenderFilters) ([]models.Tender, error)

func (*TenderRepo) ListByClientID

func (r *TenderRepo) ListByClientID(ctx context.Context, clientID uuid.UUID) ([]models.Tender, error)

func (*TenderRepo) UpdateStatus

func (r *TenderRepo) UpdateStatus(ctx context.Context, id uuid.UUID, status string) error

type UserRepo

type UserRepo struct {
	// contains filtered or unexported fields
}

func NewUserRepo

func NewUserRepo(db *sql.DB) *UserRepo

func (*UserRepo) Create

func (r *UserRepo) Create(ctx context.Context, user *models.User) error

func (*UserRepo) ExistsByEmail

func (r *UserRepo) ExistsByEmail(ctx context.Context, email string) (bool, error)

func (*UserRepo) GetByEmail

func (r *UserRepo) GetByEmail(ctx context.Context, email string) (*models.User, error)

func (*UserRepo) GetByID

func (r *UserRepo) GetByID(ctx context.Context, id uuid.UUID) (*models.User, error)

func (*UserRepo) GetByUsername

func (r *UserRepo) GetByUsername(ctx context.Context, username string) (*models.User, error)

Jump to

Keyboard shortcuts

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