repo

package
v0.0.0-...-cd2f498 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalProposalList

func UnmarshalProposalList(list []Proposal) ([]entity.Proposal, error)

Types

type Customer

type Customer struct {
	gorm.Model
	Name     string
	Segment  string
	Vertical string
}

func (*Customer) Marshal

func (model *Customer) Marshal(ent entity.Customer) error

func (*Customer) Unmarshal

func (model *Customer) Unmarshal() (entity.Customer, error)

type CustomerContact

type CustomerContact struct {
	gorm.Model
	Name       string
	Email      string
	Phone      string
	CustomerID *uint
	Customer   *Customer
}

func (*CustomerContact) Marshal

func (model *CustomerContact) Marshal(ent entity.CustomerContact) error

func (*CustomerContact) Unmarshal

func (model *CustomerContact) Unmarshal() (entity.CustomerContact, error)

type Offering

type Offering struct {
	gorm.Model
	Name             string
	SKU              string
	UnitValue        float32
	Quantity         uint
	Addons           []Offering `gorm:"foreignKey:ParentOfferingID"`
	ProposalID       uint
	ParentOfferingID *uint
}

func (*Offering) Marshal

func (model *Offering) Marshal(ent entity.Offering) error

func (*Offering) Unmarshal

func (model *Offering) Unmarshal() (entity.Offering, error)

type Proposal

type Proposal struct {
	gorm.Model
	Offerings         []Offering
	Stage             entity.DealStage
	CustomerContactID *uint
	CustomerContact   *CustomerContact
	CreatedAt         time.Time
}

func MarshalProposalList

func MarshalProposalList(list []entity.Proposal) ([]Proposal, error)

func (*Proposal) Marshal

func (model *Proposal) Marshal(ent entity.Proposal) error

func (*Proposal) Unmarshal

func (model *Proposal) Unmarshal() (entity.Proposal, error)

type ProposalRepo

type ProposalRepo struct {
	*postgres.Postgres
}

func New

func New(pg *postgres.Postgres) *ProposalRepo

func (*ProposalRepo) CreateProposal

func (r *ProposalRepo) CreateProposal(ctx context.Context, proposal entity.Proposal) (entity.Proposal, error)

func (*ProposalRepo) GetProposal

func (r *ProposalRepo) GetProposal(ctx context.Context, ID uint) (entity.Proposal, error)

func (*ProposalRepo) ListProposals

func (r *ProposalRepo) ListProposals(ctx context.Context, page int) ([]entity.Proposal, error)

func (*ProposalRepo) UpdateProposal

func (r *ProposalRepo) UpdateProposal(ctx context.Context, proposal entity.Proposal) (entity.Proposal, error)

Jump to

Keyboard shortcuts

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