Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID"`
Label string `json:"label,omitempty" jsonschema:"title=Label,description=Useful identifier, such as home, work, etc."`
PostOfficeBox string `` /* 137-byte string literal not displayed */
Number string `json:"num,omitempty" jsonschema:"title=Number,description=House or building number in the street."`
Floor string `json:"floor,omitempty" jsonschema:"title=Floor,description=Floor number within the building."`
Block string `json:"block,omitempty" jsonschema:"title=Block,description=Block number within the building."`
Door string `json:"door,omitempty" jsonschema:"title=Door,description=Door number within the building."`
Street string `json:"street,omitempty" jsonschema:"title=Street,description=Fist line of street."`
StreetExtra string `json:"street_extra,omitempty" jsonschema:"title=Extended Street,description=Additional street address details."`
Locality string `json:"locality" jsonschema:"title=Locality,description=The village, town, district, or city."`
Region string `json:"region" jsonschema:"title=Region,description=Province, County, or State."`
Code string `json:"code,omitempty" jsonschema:"title=Code,description=Post or ZIP code."`
Country l10n.Country `json:"country,omitempty" jsonschema:"title=Country,description=ISO country code."`
Coordinates *Coordinates `` /* 165-byte string literal not displayed */
Meta Meta `json:"meta,omitempty" jsonschema:"title=Meta"`
}
Address defines a globally acceptable set of attributes that describes a postal or fiscal address. Attribute names loosly based on the xCard file format.
type Coordinates ¶
type Coordinates struct {
Latitude float64 `json:"lat,omitempty" jsonschema:"title=Latitude,description=Decimal latitude coordinate."`
Longitude float64 `json:"lon,omitempty" jsonschema:"title=Longitude,description=Decimal longitude coordinate."`
W3W string `json:"w3w,omitempty" jsonschema:"title=What 3 Words,description=Text coordinates compose of three words."`
Geohash string `json:"geohash,omitempty" jsonschema:"title=Geohash,description=Single string coordinate based on geohash standard."`
}
Coordinates describes an exact geographical location in the world. We provide support for a set of different options beyond regular latitude and longitude.
type Date ¶
Date represents a simple date without time used most frequently with business documents.
func (Date) JSONSchemaType ¶
func (Date) JSONSchemaType() *jsonschema.Type
JSONSchemaType returns the jscon schema type.
type Discount ¶
type Discount struct {
Rate *num.Percentage `json:"rate,omitempty" jsonschema:"title=Rate"`
Value num.Amount `json:"value" jsonschema:"title=Value,description=How much to deduct"`
Reason string `json:"reason,omitempty" jsonschema:"title=Reason,description=Description as to why this discount was applied."`
Code string `json:"code,omitempty" jsonschema:"title=Code,description=Reason Code"`
}
Discount represents an amount and/or percentage that can be applied to a given price.
TODO: use the UNTDID 5189 code list for Discount Reason Code.
type Email ¶
type Email struct {
UUID *uuid.UUID `json:"uuid,omitempty"`
Label string `json:"label,omitempty" jsonschema:"title=Label,description=Identifier for the email."`
Address string `json:"addr" jsonschema:"title=Address,description=Electronic mailing address."`
Meta Meta `json:"meta,omitempty" jsonschema:"title=Meta,description=Additional fields."`
}
Email describes the electronic mailing details.
type Item ¶
type Item struct {
UUID string `json:"uuid,omitempty" jsonschema:"title=UUID,description=Unique identify of this item independent of the Supplier IDs"`
Ref string `` /* 160-byte string literal not displayed */
Name string `json:"name"`
Description string `json:"desc,omitempty"`
Currency string `` /* 132-byte string literal not displayed */
Price num.Amount `json:"price" jsonschema:"title=Price,description=Price of item being sold."`
Unit string `json:"unit,omitempty" jsonschema:"title=Unit,description=Code for unit of the item being sold"`
Codes []*ItemCode `` /* 195-byte string literal not displayed */
Origin l10n.Country `json:"origin,omitempty" jsonschema:"title=Country of Origin,description=Country code of where this item was from originally."`
Meta Meta `json:"meta,omitempty" jsonschema:"title=Meta"`
}
Item is used to describe a single product or service. Minimal usage implies just adding a name and price, more complete usage consists of adding descriptions, supplier IDs, SKUs, dimensions, etc.
A set of additional code, ID, or SKU can be included in the `codes` property. Each `ItemCode` can be defined with an optional type agreed upon between the supplier and customer. For general purpose use, the Item's `Ref` property is much easier to use.
We recommend setting prices with the item's "net" value, without tax, unless the document you're building supports the `price_includes_tax` option included in the `bill.Invoice` definition for example.
type ItemCode ¶ added in v0.1.0
type ItemCode struct {
Type string `json:"typ,omitempty" jsonschema:"title=Type"`
Value string `json:"val" jsonschema:"title=Value"`
}
ItemCode contains a value and optional type property that means additional codes can be added to an item.
type Meta ¶
Meta defines a structure for data about the data being defined. Typically would be used for adding additional IDs or specifications not already defined or required by the base structure.
type Name ¶
type Name struct {
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID,description=Unique identity code"`
Alias string `json:"alias,omitempty" jsonschema:"title=Alias,description=What the person would like to be called"`
Prefix string `json:"prefix,omitempty" jsonschema:"title=Prefix"`
Given string `json:"given" jsonschema:"title=Given,description=The person's given name"`
Middle string `json:"middle,omitempty" jsonschema:"title=Middle,description=Middle names or initials"`
Surname string `json:"surname" jsonschema:"title=Surname"`
Surname2 string `json:"surname2,omitempty" jsonschema:"title=Second Surname"`
Suffix string `json:"suffix,omitempty" jsonschema:"title=Suffix"`
Meta Meta `json:"meta,omitempty" jsonschema:"title=Meta"`
}
Name represents what a human is called. This is a complex subject, see this w3 article for some insights: https://www.w3.org/International/questions/qa-personal-names
type Party ¶
type Party struct {
ID string `json:"id,omitempty" jsonschema:"title=ID,description=Internal ID used to identify the party inside a document."`
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID,description=Unique identity code."`
TaxID *TaxID `` /* 205-byte string literal not displayed */
Name string `json:"name" jsonschema:"title=Name,description=Legal name or representation of the organization."`
Alias string `json:"alias,omitempty" jsonschema:"title=Alias,description=Alternate short name."`
People []*Person `json:"people,omitempty" jsonschema:"title=People,description=Details of physical people who represent the party."`
Addresses []*Address `` /* 145-byte string literal not displayed */
Emails []*Email `json:"emails,omitempty" jsonschema:"title=Email Addresses"`
Telephones []*Telephone `json:"telephones,omitempty" jsonschema:"title=Telephone Numbers"`
Registration *Registration `` /* 167-byte string literal not displayed */
Meta Meta `` /* 146-byte string literal not displayed */
}
Party represents a person or business entity.
type Person ¶
type Person struct {
ID string `json:"id,omitempty" jsonschema:"title=ID,description=Internal ID used to identify the person inside a document."`
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID,description=Unique identity code"`
Name Name `json:"name" jsonschema:"title=Name,description=Complete details on the name of the person"`
Role string `json:"role,omitempty" jsonschema:"title=Role,description=What they do within an organization"`
Emails []*Email `json:"emails,omitempty" jsonschema:"title=Email Addresses,description=Electronic mail addresses that belong to the person."`
Telephones []*Telephone `json:"telephones,omitempty" jsonschema:"title=Telephone Numbers"`
Meta Meta `json:"meta,omitempty" jsonschema:"title=Meta,description=Data about the data."`
}
Person represents a human, and how to contact them electronically.
type Registration ¶ added in v0.1.0
type Registration struct {
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID"`
Office string `json:"office,omitempty" jsonschema:"title=Office,description=Office where the company is registered."`
Book string `json:"book,omitempty" jsonschema:"title=Book"`
Volume string `json:"volume,omitempty" jsonschema:"title=Volume"`
Sheet string `json:"sheet,omitempty" jsonschema:"title=Sheet"`
Section string `json:"section,omitempty" jsonschema:"title=Section"`
Page string `json:"page,omitempty" jsonschema:"title=Page"`
Entry string `json:"entry,omitempty" jsonschema:"title=Entry"`
}
Registration is used in countries that require additional information to be associated with a company usually related to a specific registration office. The definition found here is based on the details required for spain. If your country requires additional fields, please let us know.
type TaxID ¶
type TaxID struct {
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID,description=Unique identity code"`
Country l10n.Country `json:"country" jsonschema:"title=Country,description=ISO country code for Where the tax identity was issued."`
Code string `json:"code" jsonschema:"title=Code,description=Identity code."`
Meta Meta `json:"meta,omitempty" jsonschema:"title=Meta,description=Additional details."`
}
TaxID represents a party's tax identify number for a given country.
type Telephone ¶
type Telephone struct {
UUID *uuid.UUID `json:"uuid,omitempty" jsonschema:"title=UUID"`
Label string `json:"label,omitempty" jsonschema:"title=Label,description=Identifier for this number."`
Number string `json:"num" jsonschema:"title=Number,description=The number to be dialed in ITU E.164 international format."`
}
Telephone describes what is expected for a telephone number.