company

package
v1.49.21 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package company is the B2B company domain: a customer organization that buys through the store. Employees (models/employee) belong to a company and buy on its behalf, gated by per-employee spending limits and (optionally) spend-approval workflows (models/approval).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Company

type Company struct {
	mixin.Model[Company]

	Name  string `json:"name"`
	Phone string `json:"phone,omitempty"`
	Email string `json:"email,omitempty"`

	AddressLine1 string `json:"addressLine1,omitempty"`
	AddressLine2 string `json:"addressLine2,omitempty"`
	City         string `json:"city,omitempty"`
	State        string `json:"state,omitempty"`
	Zip          string `json:"zip,omitempty"`
	Country      string `json:"country,omitempty"`

	CurrencyCode currency.Type `json:"currencyCode" orm:"default:usd"`

	// SpendingLimitResetFrequency governs how often committed spend resets
	// against employee limits: never/daily/weekly/monthly/yearly.
	SpendingLimitResetFrequency string `json:"spendingLimitResetFrequency" orm:"default:never"`

	Metadata  Map    `json:"metadata,omitempty" datastore:"-"`
	Metadata_ string `json:"-" datastore:",noindex"`
}

Company is a B2B customer organization scoped to the issuing store's namespace. Its CurrencyCode governs the currency employee spending limits and quote totals are denominated in.

func New

func New(db *datastore.Datastore) *Company

func (*Company) Address

func (c *Company) Address() string

Address joins the company's address lines into a single comma-separated string, skipping any empty segments.

func (*Company) Load

func (c *Company) Load(ps []datastore.Property) (err error)

func (*Company) Save

func (c *Company) Save() ([]datastore.Property, error)

Jump to

Keyboard shortcuts

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