invoice

package
v0.0.0-...-73eed44 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateInvoiceRequest

type CreateInvoiceRequest struct {
	Amount      decimal.Decimal
	Currency    string
	Token       string
	Description string
}

type CreateInvoiceResponse

type CreateInvoiceResponse struct {
	Id          string
	StoreId     string
	Description string
	Amount      decimal.Decimal
	Currency    string
	Status      string
	// TODO: implement this
	Transactions []string
}

type GetInvoiceRequest

type GetInvoiceRequest struct {
	Token     string
	InvoiceId string
}

type GetInvoiceResponse

type GetInvoiceResponse struct {
	Id          string
	StoreId     string
	Amount      decimal.Decimal
	Currency    string
	Status      string
	Description string
	// TODO: implement this
	Transactions []string
}

type GetInvoicesRequest

type GetInvoicesRequest struct {
	Token string
	Skip  int64
	Limit int64
}

type GetInvoicesResponse

type GetInvoicesResponse struct {
	Invoices []GetInvoiceResponse
}

type IInvoiceRepository

type IInvoiceRepository interface {
	Create(invoice *Invoice) (*Invoice, error)
	GetInvoice(id string) (*Invoice, error)
	GetInvoices(filter interface{}, skip int64, limit int64) (*[]Invoice, error)
	UpdateInvoice(invoice *Invoice) (*Invoice, error)
}

type Invoice

type Invoice struct {
	Id                 primitive.ObjectID `bson:"_id"`
	StoreId            primitive.ObjectID
	PaymentProcessorId string
	Description        string
	Amount             primitive.Decimal128
	Currency           string
	Status             string
	CallbackUrl        string
	// TODO: implement this
	Transactions []string
}

type InvoiceController

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

func (InvoiceController) CreateInvoice

func (ic InvoiceController) CreateInvoice(c *gin.Context)

func (InvoiceController) GetInvoice

func (ic InvoiceController) GetInvoice(c *gin.Context)

func (InvoiceController) GetInvoices

func (ic InvoiceController) GetInvoices(c *gin.Context)

type InvoiceRepository

type InvoiceRepository struct {
	Client *mongo.Client
}

func NewInvoiceRepository

func NewInvoiceRepository(client *mongo.Client) InvoiceRepository

func (InvoiceRepository) Create

func (ir InvoiceRepository) Create(invoice *Invoice) (*Invoice, error)

func (InvoiceRepository) GetInvoice

func (ir InvoiceRepository) GetInvoice(id string) (*Invoice, error)

func (InvoiceRepository) GetInvoices

func (ir InvoiceRepository) GetInvoices(filter interface{}, skip int64, limit int64) (*[]Invoice, error)

func (InvoiceRepository) UpdateInvoice

func (ir InvoiceRepository) UpdateInvoice(invoice *Invoice) (*Invoice, error)

Jump to

Keyboard shortcuts

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