checkout

package
v0.0.0-...-e4a3b16 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkout

type Checkout struct {
	ID             uint
	CartID         uint
	UserID         uint
	Subtotal       int
	Payment        string
	IsActive       bool
	StatusPayment  bool
	StatusDelivery bool
	StatusOverall  bool
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      *time.Time
}

func NewCheckout

func NewCheckout(cartID int,
	userID int,
	subTotal int,
	payment string,
	isActive bool,
	statusPayment bool,
	statusDelivery bool,
	statusOverall bool,
	createdAt time.Time,
	updatedAt time.Time,
) Checkout

func (*Checkout) ModifyCheckout

func (oldData *Checkout) ModifyCheckout(
	newActive bool,
	newStatusPay bool,
	newStatusDeliv bool,
	newStatusOver bool,
) Checkout

type CreateCheckoutData

type CreateCheckoutData struct {
	Payment string `validate:"required"`
}

type Repository

type Repository interface {
	CreateCheckout(Checkout) error
	FindCheckoutById(int) (*Checkout, error)
	UpdateCheckout(checkout Checkout) error
}

type Service

type Service interface {
	CreateCheckout(int, CreateCheckoutData) error
	UpdateCheckout(int, UpdateCheckout) error
}

func NewService

func NewService(repository Repository, cartRepo cartServ.Repository) Service

type UpdateCheckout

type UpdateCheckout struct {
	NewActive     bool
	NewStatusPay  bool
	NewStatusDeli bool
	NewStatusOver bool
}

Jump to

Keyboard shortcuts

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