invoice

package
v0.0.0-...-e64b967 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TenantAggregateType eventstore.AggregateType = "tenant"
)

Variables

This section is empty.

Functions

func GetTenantName

func GetTenantName(aggregateID string) string

Types

type BankAccount

type BankAccount struct {
	Id                  string             `json:"id"`
	CreatedAt           time.Time          `json:"createdAt"`
	UpdatedAt           time.Time          `json:"updatedAt"`
	SourceFields        commonmodel.Source `json:"source"`
	BankName            string             `json:"bankName"`
	BankTransferEnabled bool               `json:"bankTransferEnabled"`
	AllowInternational  bool               `json:"allowInternational"`
	Currency            string             `json:"currency"`
	Iban                string             `json:"iban"`
	Bic                 string             `json:"bic"`
	SortCode            string             `json:"sortCode"`
	AccountNumber       string             `json:"accountNumber"`
	RoutingNumber       string             `json:"routingNumber"`
	OtherDetails        string             `json:"otherDetails"`
}

type Tenant

type Tenant struct {
	Id              string                 `json:"id"`
	Name            string                 `json:"name"`
	CreatedAt       time.Time              `json:"createdAt"`
	UpdatedAt       time.Time              `json:"updatedAt"`
	SourceFields    commonmodel.Source     `json:"source"`
	BillingProfiles []TenantBillingProfile `json:"billingProfiles"`
	BankAccounts    []BankAccount          `json:"bankAccounts"`
	TenantSettings  TenantSettings         `json:"tenantSettings"`
}

func (Tenant) AddBankAccount

func (t Tenant) AddBankAccount(ba BankAccount)

func (Tenant) GetBankAccount

func (t Tenant) GetBankAccount(id string) *BankAccount

func (Tenant) GetBillingProfile

func (t Tenant) GetBillingProfile(id string) *TenantBillingProfile

func (Tenant) HasBankAccount

func (t Tenant) HasBankAccount(id string) bool

func (Tenant) HasBillingProfile

func (t Tenant) HasBillingProfile(id string) bool

type TenantAggregate

type TenantAggregate struct {
	*aggregate.CommonIdAggregate
	TenantDetails *Tenant
}

func NewTenantAggregate

func NewTenantAggregate(tenant string) *TenantAggregate

func (*TenantAggregate) AddBankAccount

func (*TenantAggregate) AddBillingProfile

func (a *TenantAggregate) AddBillingProfile(ctx context.Context, request *tenantpb.AddBillingProfileRequest) (string, error)

func (*TenantAggregate) DeleteBankAccount

func (*TenantAggregate) HandleGRPCRequest

func (a *TenantAggregate) HandleGRPCRequest(ctx context.Context, request any, params map[string]any) (any, error)

func (*TenantAggregate) UpdateBankAccount

func (*TenantAggregate) UpdateBillingProfile

func (a *TenantAggregate) UpdateBillingProfile(ctx context.Context, r *tenantpb.UpdateBillingProfileRequest) error

func (*TenantAggregate) UpdateTenantSettings

func (a *TenantAggregate) UpdateTenantSettings(ctx context.Context, r *tenantpb.UpdateTenantSettingsRequest) error

func (*TenantAggregate) When

func (a *TenantAggregate) When(evt eventstore.Event) error

type TenantBillingProfile

type TenantBillingProfile struct {
	Id                     string             `json:"id"`
	CreatedAt              time.Time          `json:"createdAt"`
	UpdatedAt              time.Time          `json:"updatedAt"`
	SourceFields           commonmodel.Source `json:"source"`
	Phone                  string             `json:"phone"`
	AddressLine1           string             `json:"addressLine1"`
	AddressLine2           string             `json:"addressLine2"`
	AddressLine3           string             `json:"addressLine3"`
	Locality               string             `json:"locality"`
	Country                string             `json:"country"`
	Region                 string             `json:"region"`
	Zip                    string             `json:"zip"`
	LegalName              string             `json:"legalName"`
	VatNumber              string             `json:"vatNumber"`
	SendInvoicesFrom       string             `json:"sendInvoicesFrom"`
	SendInvoicesBcc        string             `json:"sendInvoicesBcc"`
	CanPayWithPigeon       bool               `json:"canPayWithPigeon"`
	CanPayWithBankTransfer bool               `json:"canPayWithBankTransfer"`
	Check                  bool               `json:"check"`
}

type TenantSettings

type TenantSettings struct {
	InvoicingEnabled     bool   `json:"invoicingEnabled"`
	InvoicingPostpaid    bool   `json:"invoicingPostpaid"`
	BaseCurrency         string `json:"baseCurrency"`
	LogoUrl              string `json:"logoUrl"`
	LogoRepositoryFileId string `json:"logoRepositoryFileId"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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