Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Invoice ¶
type Invoice struct {
Id uuid.UUID `gorm:"primaryKey;type:uuid"`
InvoiceeId uuid.UUID `gorm:"uniqueIndex:invoicee_id_period,where:deleted_at is null;not null;type:uuid"`
InvoiceeType InvoiceeType `gorm:"not null"`
NetworkId uuid.UUID `gorm:"type:uuid"`
Period time.Time `gorm:"uniqueIndex:invoicee_id_period,where:deleted_at is null;not null"`
RawInvoice datatypes.JSON `gorm:"not null"`
IsPaid bool `gorm:"default:false"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
type InvoiceRepo ¶
type InvoiceRepo interface {
Add(invoice *Invoice, nestedFunc func(*Invoice, *gorm.DB) error) error
Get(id uuid.UUID) (*Invoice, error)
List(invoiceeId string, invoiceeType InvoiceeType, networkId string,
isPaid bool, count uint32, sort bool) ([]Invoice, error)
// Update(orgId uint, network *Network) error
Delete(invoiceId uuid.UUID, nestedFunc func(uuid.UUID, *gorm.DB) error) error
}
func NewInvoiceRepo ¶
func NewInvoiceRepo(db sql.Db) InvoiceRepo
type InvoiceeType ¶
type InvoiceeType uint8
const ( InvoiceeTypeUnknown InvoiceeType = iota InvoiceeTypeOrg InvoiceeTypeSubscriber )
func ParseInvoiceeType ¶
func ParseInvoiceeType(value string) InvoiceeType
func (*InvoiceeType) Scan ¶
func (s *InvoiceeType) Scan(value interface{}) error
func (InvoiceeType) String ¶
func (s InvoiceeType) String() string
Click to show internal directories.
Click to hide internal directories.