entity

package
v0.0.0-...-19239a5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UblFormat  = "ubl2.1"
	D16bFormat = "d16b"

	NotificationStatusNotSent = "not_sent"
	NotificationStatusSent    = "sent"
	NotificationStatusSending = "sending"

	SlovakInvoiceParties = "slovakParties"
	ForeignSupplierParty = "foreignSupplier"
	ForeignCustomerParty = "foreignCustomer"

	InvoiceDocumentType    = "invoice"
	CreditNoteDocumentType = "creditNote"

	Slovakia = "SK"
)

Variables

View Source
var InvoiceFormats = []string{UblFormat, D16bFormat}

Functions

func IcoToUri

func IcoToUri(ico string) string

func IcosToUris

func IcosToUris(icos []string) []string

func UriToIco

func UriToIco(uri string) (string, error)

Types

type Draft

type Draft struct {
	Id        string          `json:"id"`
	CreatedAt *time.Time      `json:"createdAt"`
	Name      string          `json:"name"`
	Data      json.RawMessage `json:"data,omitempty"`
}

func (*Draft) CalculateCreatedAt

func (d *Draft) CalculateCreatedAt()

Derive created at from id

type Invoice

type Invoice struct {
	Id                       string        `json:"id"`
	CreatedAt                *time.Time    `json:"createdAt,omitempty" pg:"-"`
	Sender                   string        `json:"sender"`
	Receiver                 string        `json:"receiver"`
	Format                   string        `json:"format"`
	Amount                   float64       `json:"amount"`
	AmountCurrency           string        `json:"amountCurrency"`
	AmountWithoutVat         float64       `json:"amountWithoutVat"`
	AmountWithoutVatCurrency string        `json:"amountWithoutVatCurrency"`
	SupplierIco              string        `json:"supplierIco"`
	SupplierCountry          string        `json:"-" pg:"-"`
	CustomerIco              string        `json:"customerIco"`
	CustomerCountry          string        `json:"-" pg:"-"`
	IssueDate                timeutil.Date `json:"issueDate"`
	CreatedBy                int           `json:"createdBy"` // User id of invoice creator
	Test                     bool          `json:"test"`
	NotificationsStatus      string        `json:"notificationsStatus"`
	VisualizationCreated     bool          `json:"-"`
}

func (*Invoice) CalculateCreatedAt

func (i *Invoice) CalculateCreatedAt()

Derive created at from id

func (*Invoice) GetInvoicePartiesType

func (i *Invoice) GetInvoicePartiesType() string

type Substitute

type Substitute struct {
	CreatedAt    time.Time `json:"createdAt"`
	OwnerId      int       `json:"ownerId"`
	SubstituteId int       `json:"substituteId"`
}

type User

type User struct {
	Id                      int       `json:"id"`
	CreatedAt               time.Time `json:"createdAt"`
	UpvsUri                 string    `json:"upvsUri"`
	Name                    string    `json:"name"`
	ServiceAccountPublicKey *string   `json:"serviceAccountPublicKey"`
}

Jump to

Keyboard shortcuts

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