customer

package
v0.0.0-...-c965c1a Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 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 Customer

type Customer struct {
	ID        uuid.UUID `json:"id"`
	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type PostgresRepository

type PostgresRepository struct {
	Db *pgxpool.Pool
}

func (PostgresRepository) Create

func (r PostgresRepository) Create(ctx context.Context, customer Customer) error

func (PostgresRepository) Delete

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

func (PostgresRepository) GetByEmail

func (r PostgresRepository) GetByEmail(ctx context.Context, email string) (Customer, error)

func (PostgresRepository) GetByID

func (r PostgresRepository) GetByID(ctx context.Context, id uuid.UUID) (Customer, error)

func (PostgresRepository) Update

func (r PostgresRepository) Update(ctx context.Context, customer Customer) error

type Repository

type Repository interface {
	Create(ctx context.Context, customer Customer) error
	GetByID(ctx context.Context, id uuid.UUID) (Customer, error)
	GetByEmail(ctx context.Context, email string) (Customer, error)
	Update(ctx context.Context, customer Customer) error
	Delete(ctx context.Context, id uuid.UUID) error
}

Jump to

Keyboard shortcuts

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