model

package
v0.0.0-...-48cd7e5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PARAM_CANCELLED = "cancelled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BilledString

type BilledString string
const (
	NoneBilledString      BilledString = ""
	MonthlyBilledString   BilledString = "MONTHLY"
	QuarterlyBilledString BilledString = "QUARTERLY"
	AnnuallyBilledString  BilledString = "ANNUALLY"
	OnceBilledString      BilledString = "ONCE"
	UsageBilledString     BilledString = "USAGE"
)

type BilledType

type BilledType int32

BilledType enum represents the billing type for a service line item.

const (
	NoneBilled BilledType = iota
	MonthlyBilled
	AnnuallyBilled
	OnceBilled  // For One-Time
	UsageBilled // For Usage-Based
	QuarterlyBilled
)

func (BilledType) IsOneTime

func (bt BilledType) IsOneTime() bool

func (BilledType) IsRecurrent

func (bt BilledType) IsRecurrent() bool

func (BilledType) IsUsage

func (bt BilledType) IsUsage() bool

func (BilledType) String

func (bt BilledType) String() string

type ServiceLineItem

type ServiceLineItem struct {
	ID         string        `json:"id"`
	ContractId string        `json:"contractId"`
	ParentId   string        `json:"parentId"`
	Billed     string        `json:"billed"`
	Quantity   int64         `json:"quantity"`
	Price      float64       `json:"price"`
	Name       string        `json:"name"`
	Comments   string        `json:"comments,omitempty"`
	CreatedAt  time.Time     `json:"createdAt"`
	UpdatedAt  time.Time     `json:"updatedAt"`
	StartedAt  time.Time     `json:"startedAt"`
	EndedAt    *time.Time    `json:"endedAt,omitempty"`
	Source     common.Source `json:"source"`
	IsDeleted  bool          `json:"isDeleted"`
	IsCanceled bool          `json:"isCanceled"`
	VatRate    float64       `json:"vatRate"`
}

ServiceLineItem represents the state of a service line item aggregate.

func (ServiceLineItem) IsEnded

func (sli ServiceLineItem) IsEnded() bool

type ServiceLineItemDataFields

type ServiceLineItemDataFields struct {
	Billed     BilledType `json:"billed"`
	Quantity   int64      `json:"quantity"`
	Price      float64    `json:"price"`
	Name       string     `json:"name"`
	ContractId string     `json:"contractId"`
	ParentId   string     `json:"parentId"`
	Comments   string     `json:"comments,omitempty"`
	VatRate    float64    `json:"vatRate"`
}

ServiceLineItemDataFields contains all the fields that may be used to create or update a service line item.

Jump to

Keyboard shortcuts

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