fake

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// VersionedStruct
	Version int    `json:"version"`
	ID      string `json:"id"`

	Customer AddressCustomer `json:"customer"`

	// Address info
	Type                  AddressType `json:"type"`
	FirstName             string      `json:"firstName"`
	LastName              string      `json:"lastName"`
	State                 string      `json:"state"`
	Street                string      `json:"street"`
	HouseNumber           string      `json:"houseNumber"`
	City                  string      `json:"city"`
	Zip                   string      `json:"zip"`
	Latitude              float64     `json:"latitude"`
	Longitude             float64     `json:"longitude"`
	Phone                 string      `json:"phone"`
	AdditionalAddressInfo string      `json:"additionalAddressInfo"`
	CreatedAt             time.Time   `json:"createdAt"`
	Revision              int         `json:"revision"` // Each change on the customer increments the revision
}

func NewAddress

func NewAddress(customer Customer) Address

func (*Address) Protobuf added in v1.2.0

func (a *Address) Protobuf() *protobuf.Address

type AddressCustomer

type AddressCustomer struct {
	CustomerID   string       `json:"id"`
	CustomerType CustomerType `json:"type"`
}

func (*AddressCustomer) Protobuf added in v1.2.0

func (a *AddressCustomer) Protobuf() *protobuf.Address_Customer

type AddressType

type AddressType string
const (
	AddressTypeInvoice  AddressType = "INVOICE"
	AddressTypeDelivery AddressType = "DELIVERY"
)

type Customer

type Customer struct {
	// VersionedStruct
	Version int `json:"version"`

	ID           string       `json:"id"`
	FirstName    string       `json:"firstName"`
	LastName     string       `json:"lastName"`
	Gender       string       `json:"gender"`
	CompanyName  *string      `json:"companyName"`
	Email        string       `json:"email"`
	CustomerType CustomerType `json:"customerType"` // PERSONAL | BUSINESS
	Revision     int          `json:"revision"`     // Each change on the customer increments the revision
}

func NewCustomer

func NewCustomer() Customer

func (*Customer) Protobuf added in v1.2.0

func (c *Customer) Protobuf() *protobuf.Customer

type CustomerType

type CustomerType string
const (
	CustomerTypePersonal CustomerType = "PERSONAL"
	CustomerTypeBusiness CustomerType = "BUSINESS"
)

type FrontendEvent

type FrontendEvent struct {
	// VersionedStruct
	Version int `json:"version"`

	RequestedURL    string                `json:"requestedUrl"`
	Method          string                `json:"method"`
	CorrelationID   string                `json:"correlationId"`
	IPAddress       string                `json:"ipAddress"`
	RequestDuration int                   `json:"requestDuration"`
	Response        FrontendEventResponse `json:"response"`
	Headers         map[string]string     `json:"headers"`
}

func NewFrontendEvent

func NewFrontendEvent() FrontendEvent

type FrontendEventResponse

type FrontendEventResponse struct {
	Size       int `json:"size"`
	StatusCode int `json:"statusCode"`
}

type Order

type Order struct {
	// VersionedStruct
	Version int `json:"version"`

	ID            string     `json:"id"`
	CreatedAt     time.Time  `json:"createdAt"`
	LastUpdatedAt time.Time  `json:"lastUpdatedAt"`
	DeliveredAt   *time.Time `json:"deliveredAt"`
	CompletedAt   *time.Time `json:"completedAt"`

	Customer        Customer        `json:"customer"`
	OrderValue      int             `json:"orderValue"`
	LineItems       []OrderLineItem `json:"lineItems"`
	Payment         OrderPayment    `json:"payment"`
	DeliveryAddress Address         `json:"deliveryAddress"`
	Revision        int             `json:"revision"`
}

func NewOrder

func NewOrder(customer Customer) Order

func (*Order) Protobuf added in v1.2.0

func (o *Order) Protobuf() *protobuf.Order

type OrderDeliveryAddress

type OrderDeliveryAddress struct{}

type OrderLineItem

type OrderLineItem struct {
	ArticleID    string `json:"articleId"`
	Name         string `json:"name"`
	Quantity     int    `json:"quantity"`
	QuantityUnit string `json:"quantityUnit"`
	UnitPrice    int    `json:"unitPrice"`
	TotalPrice   int    `json:"totalPrice"`
}

func (*OrderLineItem) Protobuf added in v1.2.0

func (o *OrderLineItem) Protobuf() *protobuf.Order_LineItem

type OrderPayment

type OrderPayment struct {
	PaymentID string `json:"paymentId"`
	Method    string `json:"method"` // PAYPAL | CREDIT_CARD | DEBIT | CASH
}

func (*OrderPayment) Protobuf added in v1.2.0

func (o *OrderPayment) Protobuf() *protobuf.Order_Payment

Jump to

Keyboard shortcuts

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