orderv1

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const SnapshotEveryNEvents int32 = 50

SnapshotEveryNEvents is the snapshot interval from the proto annotation.

Variables

View Source
var (
	State_name = map[int32]string{
		0: "STATE_UNSPECIFIED",
		1: "STATE_DRAFT",
		2: "STATE_PLACED",
		3: "STATE_PAID",
		4: "STATE_SHIPPED",
		5: "STATE_DELIVERED",
		6: "STATE_CANCELLED",
	}
	State_value = map[string]int32{
		"STATE_UNSPECIFIED": 0,
		"STATE_DRAFT":       1,
		"STATE_PLACED":      2,
		"STATE_PAID":        3,
		"STATE_SHIPPED":     4,
		"STATE_DELIVERED":   5,
		"STATE_CANCELLED":   6,
	}
)

Enum value maps for State.

View Source
var File_example_app_order_v1_order_v1_proto protoreflect.FileDescriptor

ProviderSet provides the Order repository and binds it to Repo.

Functions

func NewRepository

func NewRepository(store protosource.Store, serializer protosource.Serializer, opts ...protosource.Option) *protosource.Repository

NewRepository creates a new protosource.Repository for the Order aggregate.

Types

type AddItem

type AddItem struct {
	Id    string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor string    `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	Item  *LineItem `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"`
	// contains filtered or unexported fields
}

func (*AddItem) CommandName

func (m *AddItem) CommandName() string

func (*AddItem) Descriptor deprecated

func (*AddItem) Descriptor() ([]byte, []int)

Deprecated: Use AddItem.ProtoReflect.Descriptor instead.

func (*AddItem) EmitEvents

func (m *AddItem) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*AddItem) GetActor

func (x *AddItem) GetActor() string

func (*AddItem) GetId

func (x *AddItem) GetId() string

func (*AddItem) GetItem

func (x *AddItem) GetItem() *LineItem

func (*AddItem) GuardState added in v0.1.1

func (m *AddItem) GuardState(aggregate protosource.Aggregate) error

func (*AddItem) ProtoMessage

func (*AddItem) ProtoMessage()

func (*AddItem) ProtoReflect

func (x *AddItem) ProtoReflect() protoreflect.Message

func (*AddItem) ProtoValidate

func (m *AddItem) ProtoValidate() error

func (*AddItem) Reset

func (x *AddItem) Reset()

func (*AddItem) String

func (x *AddItem) String() string

func (*AddItem) ValidateVersion

func (m *AddItem) ValidateVersion(version int64) error

type AddTag

type AddTag struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	Tag   *Tag   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTag) CommandName

func (m *AddTag) CommandName() string

func (*AddTag) Descriptor deprecated

func (*AddTag) Descriptor() ([]byte, []int)

Deprecated: Use AddTag.ProtoReflect.Descriptor instead.

func (*AddTag) EmitEvents

func (m *AddTag) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*AddTag) GetActor

func (x *AddTag) GetActor() string

func (*AddTag) GetId

func (x *AddTag) GetId() string

func (*AddTag) GetTag

func (x *AddTag) GetTag() *Tag

func (*AddTag) GuardState added in v0.1.1

func (m *AddTag) GuardState(aggregate protosource.Aggregate) error

func (*AddTag) ProtoMessage

func (*AddTag) ProtoMessage()

func (*AddTag) ProtoReflect

func (x *AddTag) ProtoReflect() protoreflect.Message

func (*AddTag) ProtoValidate

func (m *AddTag) ProtoValidate() error

func (*AddTag) Reset

func (x *AddTag) Reset()

func (*AddTag) String

func (x *AddTag) String() string

func (*AddTag) ValidateVersion

func (m *AddTag) ValidateVersion(version int64) error

type Builder

type Builder struct {
	Events []protosource.Event
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(id string, version int64) *Builder

func (*Builder) Cancelled

func (b *Builder) Cancelled(Actor string, Reason string)

func (*Builder) Created

func (b *Builder) Created(Actor string, CustomerId string, CustomerName string)

func (*Builder) ItemAdded

func (b *Builder) ItemAdded(Actor string, Item *LineItem)

func (*Builder) ItemRemoved

func (b *Builder) ItemRemoved(Actor string, ItemId string)

func (*Builder) Placed

func (b *Builder) Placed(Actor string, PlacedAt int64)

func (*Builder) ShippingSet

func (b *Builder) ShippingSet(Actor string, ShippingAddress string)

func (*Builder) Snapshot

func (b *Builder) Snapshot(aggregate *Order)

func (*Builder) TagAdded

func (b *Builder) TagAdded(Actor string, Tag *Tag)

func (*Builder) TagRemoved

func (b *Builder) TagRemoved(Actor string, Key string)

type Cancel

type Cancel struct {
	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor  string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*Cancel) CommandName

func (m *Cancel) CommandName() string

func (*Cancel) Descriptor deprecated

func (*Cancel) Descriptor() ([]byte, []int)

Deprecated: Use Cancel.ProtoReflect.Descriptor instead.

func (*Cancel) EmitEvents

func (m *Cancel) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*Cancel) GetActor

func (x *Cancel) GetActor() string

func (*Cancel) GetId

func (x *Cancel) GetId() string

func (*Cancel) GetReason

func (x *Cancel) GetReason() string

func (*Cancel) GuardState added in v0.1.1

func (m *Cancel) GuardState(aggregate protosource.Aggregate) error

func (*Cancel) ProtoMessage

func (*Cancel) ProtoMessage()

func (*Cancel) ProtoReflect

func (x *Cancel) ProtoReflect() protoreflect.Message

func (*Cancel) ProtoValidate

func (m *Cancel) ProtoValidate() error

func (*Cancel) Reset

func (x *Cancel) Reset()

func (*Cancel) String

func (x *Cancel) String() string

func (*Cancel) ValidateVersion

func (m *Cancel) ValidateVersion(version int64) error

type Cancelled

type Cancelled struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At      int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor   string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	Reason  string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*Cancelled) Descriptor deprecated

func (*Cancelled) Descriptor() ([]byte, []int)

Deprecated: Use Cancelled.ProtoReflect.Descriptor instead.

func (*Cancelled) EventName

func (m *Cancelled) EventName() string

func (*Cancelled) GetActor

func (x *Cancelled) GetActor() string

func (*Cancelled) GetAt

func (x *Cancelled) GetAt() int64

func (*Cancelled) GetId

func (x *Cancelled) GetId() string

func (*Cancelled) GetReason

func (x *Cancelled) GetReason() string

func (*Cancelled) GetVersion

func (x *Cancelled) GetVersion() int64

func (*Cancelled) ProtoMessage

func (*Cancelled) ProtoMessage()

func (*Cancelled) ProtoReflect

func (x *Cancelled) ProtoReflect() protoreflect.Message

func (*Cancelled) Reset

func (x *Cancelled) Reset()

func (*Cancelled) String

func (x *Cancelled) String() string

type Create

type Create struct {
	Id           string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor        string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	CustomerId   string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	CustomerName string `protobuf:"bytes,4,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Create) CommandName

func (m *Create) CommandName() string

func (*Create) Descriptor deprecated

func (*Create) Descriptor() ([]byte, []int)

Deprecated: Use Create.ProtoReflect.Descriptor instead.

func (*Create) EmitEvents

func (m *Create) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*Create) GetActor

func (x *Create) GetActor() string

func (*Create) GetCustomerId

func (x *Create) GetCustomerId() string

func (*Create) GetCustomerName

func (x *Create) GetCustomerName() string

func (*Create) GetId

func (x *Create) GetId() string

func (*Create) ProtoMessage

func (*Create) ProtoMessage()

func (*Create) ProtoReflect

func (x *Create) ProtoReflect() protoreflect.Message

func (*Create) ProtoValidate

func (m *Create) ProtoValidate() error

func (*Create) Reset

func (x *Create) Reset()

func (*Create) String

func (x *Create) String() string

func (*Create) ValidateVersion

func (m *Create) ValidateVersion(version int64) error

type Created

type Created struct {
	Id           string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version      int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At           int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor        string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	CustomerId   string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	CustomerName string `protobuf:"bytes,6,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Created) Descriptor deprecated

func (*Created) Descriptor() ([]byte, []int)

Deprecated: Use Created.ProtoReflect.Descriptor instead.

func (*Created) EventName

func (m *Created) EventName() string

func (*Created) GetActor

func (x *Created) GetActor() string

func (*Created) GetAt

func (x *Created) GetAt() int64

func (*Created) GetCustomerId

func (x *Created) GetCustomerId() string

func (*Created) GetCustomerName

func (x *Created) GetCustomerName() string

func (*Created) GetId

func (x *Created) GetId() string

func (*Created) GetVersion

func (x *Created) GetVersion() int64

func (*Created) ProtoMessage

func (*Created) ProtoMessage()

func (*Created) ProtoReflect

func (x *Created) ProtoReflect() protoreflect.Message

func (*Created) Reset

func (x *Created) Reset()

func (*Created) String

func (x *Created) String() string

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient is a typed HTTP client for the Order aggregate.

func NewHTTPClient

func NewHTTPClient(c httpclient.Doer) *HTTPClient

NewHTTPClient creates a new Order HTTP client. Accepts httpclient.Doer for testability — use *httpclient.Client in production and a mock in tests.

func (*HTTPClient) AddItem

func (c *HTTPClient) AddItem(ctx context.Context, id string, item *LineItem) (*responsev1.CommandResponse, error)

AddItem sends the AddItem command.

func (*HTTPClient) AddTag

func (c *HTTPClient) AddTag(ctx context.Context, id string, tag *Tag) (*responsev1.CommandResponse, error)

AddTag sends the AddTag command.

func (*HTTPClient) Cancel

func (c *HTTPClient) Cancel(ctx context.Context, id string, reason string) (*responsev1.CommandResponse, error)

Cancel sends the Cancel command.

func (*HTTPClient) Create

func (c *HTTPClient) Create(ctx context.Context, id string, customerId string, customerName string) (*responsev1.CommandResponse, error)

Create sends the Create command.

func (*HTTPClient) Get

func (c *HTTPClient) Get(ctx context.Context, id string) (*Order, error)

Get retrieves the Order aggregate from the materialized store.

func (*HTTPClient) History

func (c *HTTPClient) History(ctx context.Context, id string) (*historyv1.History, error)

History retrieves the full event history for the Order aggregate.

func (*HTTPClient) Load

func (c *HTTPClient) Load(ctx context.Context, id string) (*Order, error)

Load retrieves the current state of the Order aggregate via event replay.

func (*HTTPClient) Place

func (c *HTTPClient) Place(ctx context.Context, id string, placedAt int64) (*responsev1.CommandResponse, error)

Place sends the Place command.

func (*HTTPClient) QueryByCustomerId

func (c *HTTPClient) QueryByCustomerId(ctx context.Context, customerId string) ([]*Order, error)

QueryByCustomerId queries by customer_id via GSI1.

func (*HTTPClient) QueryByCustomerIdBetweenCreateAt

func (c *HTTPClient) QueryByCustomerIdBetweenCreateAt(ctx context.Context, customerId string, createAtFrom int64, createAtTo int64) ([]*Order, error)

QueryByCustomerIdBetweenCreateAt queries with a between sort key condition (inclusive range).

func (*HTTPClient) QueryByCustomerIdWithCreateAt

func (c *HTTPClient) QueryByCustomerIdWithCreateAt(ctx context.Context, customerId string, skOp string, createAt int64) ([]*Order, error)

QueryByCustomerIdWithCreateAt queries with a sort key condition (eq, lt, le, gt, ge, begins_with). For between queries, use QueryByCustomerIdBetweenCreateAt instead.

func (*HTTPClient) RemoveItem

func (c *HTTPClient) RemoveItem(ctx context.Context, id string, itemId string) (*responsev1.CommandResponse, error)

RemoveItem sends the RemoveItem command.

func (*HTTPClient) RemoveTag

func (c *HTTPClient) RemoveTag(ctx context.Context, id string, key string) (*responsev1.CommandResponse, error)

RemoveTag sends the RemoveTag command.

func (*HTTPClient) SetShipping

func (c *HTTPClient) SetShipping(ctx context.Context, id string, shippingAddress string) (*responsev1.CommandResponse, error)

SetShipping sends the SetShipping command.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler provides request handler functions for the Order aggregate.

func NewHandler

func NewHandler(repo Repo, client *OrderClient, authorizer authz.Authorizer) *Handler

NewHandler creates a new Handler instance with the given repository, client, and authorizer. Every generated command handler calls authorizer.Authorize with the canonical function name "example.app.order.v1.{CommandMessageName}" before running the command pipeline. Applications that do not enforce authorization at this layer should wire in allowall.Authorizer.

authorizer is required; passing nil panics immediately with a descriptive message rather than deferring to an opaque nil-pointer dereference on the first request.

func (*Handler) HandleAddItem

func (h *Handler) HandleAddItem(ctx context.Context, request protosource.Request) protosource.Response

HandleAddItem processes a AddItem command.

func (*Handler) HandleAddTag

func (h *Handler) HandleAddTag(ctx context.Context, request protosource.Request) protosource.Response

HandleAddTag processes a AddTag command.

func (*Handler) HandleCancel

func (h *Handler) HandleCancel(ctx context.Context, request protosource.Request) protosource.Response

HandleCancel processes a Cancel command.

func (*Handler) HandleCreate

func (h *Handler) HandleCreate(ctx context.Context, request protosource.Request) protosource.Response

HandleCreate processes a Create command.

func (*Handler) HandleGet

func (h *Handler) HandleGet(ctx context.Context, request protosource.Request) protosource.Response

HandleGet retrieves the current state of a Order aggregate.

func (*Handler) HandleGetMaterialized

func (h *Handler) HandleGetMaterialized(ctx context.Context, request protosource.Request) protosource.Response

HandleGetMaterialized retrieves the Order aggregate from the materialized store.

func (*Handler) HandleHistory

func (h *Handler) HandleHistory(ctx context.Context, request protosource.Request) protosource.Response

HandleHistory retrieves the full event history for a Order aggregate.

func (*Handler) HandlePlace

func (h *Handler) HandlePlace(ctx context.Context, request protosource.Request) protosource.Response

HandlePlace processes a Place command.

func (*Handler) HandleQueryByCustomerId

func (h *Handler) HandleQueryByCustomerId(ctx context.Context, request protosource.Request) protosource.Response

HandleQueryByCustomerId queries GSI1 by partition key with optional sort key condition.

func (*Handler) HandleRemoveItem

func (h *Handler) HandleRemoveItem(ctx context.Context, request protosource.Request) protosource.Response

HandleRemoveItem processes a RemoveItem command.

func (*Handler) HandleRemoveTag

func (h *Handler) HandleRemoveTag(ctx context.Context, request protosource.Request) protosource.Response

HandleRemoveTag processes a RemoveTag command.

func (*Handler) HandleSetShipping

func (h *Handler) HandleSetShipping(ctx context.Context, request protosource.Request) protosource.Response

HandleSetShipping processes a SetShipping command.

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(router *protosource.Router)

RegisterRoutes registers all handler routes on the given router.

type ItemAdded

type ItemAdded struct {
	Id      string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version int64     `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At      int64     `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor   string    `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	Item    *LineItem `protobuf:"bytes,5,opt,name=item,proto3" json:"item,omitempty"`
	// contains filtered or unexported fields
}

func (*ItemAdded) Descriptor deprecated

func (*ItemAdded) Descriptor() ([]byte, []int)

Deprecated: Use ItemAdded.ProtoReflect.Descriptor instead.

func (*ItemAdded) EventName

func (m *ItemAdded) EventName() string

func (*ItemAdded) GetActor

func (x *ItemAdded) GetActor() string

func (*ItemAdded) GetAt

func (x *ItemAdded) GetAt() int64

func (*ItemAdded) GetId

func (x *ItemAdded) GetId() string

func (*ItemAdded) GetItem

func (x *ItemAdded) GetItem() *LineItem

func (*ItemAdded) GetVersion

func (x *ItemAdded) GetVersion() int64

func (*ItemAdded) ProtoMessage

func (*ItemAdded) ProtoMessage()

func (*ItemAdded) ProtoReflect

func (x *ItemAdded) ProtoReflect() protoreflect.Message

func (*ItemAdded) Reset

func (x *ItemAdded) Reset()

func (*ItemAdded) String

func (x *ItemAdded) String() string

type ItemRemoved

type ItemRemoved struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At      int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor   string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	ItemId  string `protobuf:"bytes,5,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ItemRemoved) Descriptor deprecated

func (*ItemRemoved) Descriptor() ([]byte, []int)

Deprecated: Use ItemRemoved.ProtoReflect.Descriptor instead.

func (*ItemRemoved) EventName

func (m *ItemRemoved) EventName() string

func (*ItemRemoved) GetActor

func (x *ItemRemoved) GetActor() string

func (*ItemRemoved) GetAt

func (x *ItemRemoved) GetAt() int64

func (*ItemRemoved) GetId

func (x *ItemRemoved) GetId() string

func (*ItemRemoved) GetItemId

func (x *ItemRemoved) GetItemId() string

func (*ItemRemoved) GetVersion

func (x *ItemRemoved) GetVersion() int64

func (*ItemRemoved) ProtoMessage

func (*ItemRemoved) ProtoMessage()

func (*ItemRemoved) ProtoReflect

func (x *ItemRemoved) ProtoReflect() protoreflect.Message

func (*ItemRemoved) Reset

func (x *ItemRemoved) Reset()

func (*ItemRemoved) String

func (x *ItemRemoved) String() string

type LineItem

type LineItem struct {
	ItemId      string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	PriceCents  int64  `protobuf:"varint,3,opt,name=price_cents,json=priceCents,proto3" json:"price_cents,omitempty"`
	Quantity    int32  `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

LineItem is a value type representing a single item in an order.

func (*LineItem) Descriptor deprecated

func (*LineItem) Descriptor() ([]byte, []int)

Deprecated: Use LineItem.ProtoReflect.Descriptor instead.

func (*LineItem) GetDescription

func (x *LineItem) GetDescription() string

func (*LineItem) GetItemId

func (x *LineItem) GetItemId() string

func (*LineItem) GetPriceCents

func (x *LineItem) GetPriceCents() int64

func (*LineItem) GetQuantity

func (x *LineItem) GetQuantity() int32

func (*LineItem) ProtoMessage

func (*LineItem) ProtoMessage()

func (*LineItem) ProtoReflect

func (x *LineItem) ProtoReflect() protoreflect.Message

func (*LineItem) Reset

func (x *LineItem) Reset()

func (*LineItem) String

func (x *LineItem) String() string

type Order

type Order struct {
	Id              string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version         int64                `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	State           State                `protobuf:"varint,3,opt,name=state,proto3,enum=example.app.order.v1.State" json:"state,omitempty"`
	CustomerId      string               `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	CustomerName    string               `protobuf:"bytes,5,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
	CreateAt        int64                `protobuf:"varint,6,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
	CreateBy        string               `protobuf:"bytes,7,opt,name=create_by,json=createBy,proto3" json:"create_by,omitempty"`
	ModifyAt        int64                `protobuf:"varint,8,opt,name=modify_at,json=modifyAt,proto3" json:"modify_at,omitempty"`
	ModifyBy        string               `protobuf:"bytes,9,opt,name=modify_by,json=modifyBy,proto3" json:"modify_by,omitempty"`
	TotalCents      int64                `protobuf:"varint,10,opt,name=total_cents,json=totalCents,proto3" json:"total_cents,omitempty"`
	ItemCount       int32                `protobuf:"varint,11,opt,name=item_count,json=itemCount,proto3" json:"item_count,omitempty"`
	ShippingAddress string               `protobuf:"bytes,12,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
	PlacedAt        int64                `protobuf:"varint,13,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
	Items           map[string]*LineItem `` /* 138-byte string literal not displayed */
	Tags            map[string]*Tag      `` /* 136-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Order) AfterOn

func (o *Order) AfterOn()

AfterOn computes derived fields from the items collection. Called once after full event replay in Load, once after all new events in Apply (materialization), and inside Builder.Snapshot when a snapshot is actually emitted. Not called per-event — safe to iterate collections here.

func (*Order) Descriptor deprecated

func (*Order) Descriptor() ([]byte, []int)

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GSI1PK

func (m *Order) GSI1PK() string

func (*Order) GSI1SK

func (m *Order) GSI1SK() string

func (*Order) GSI2PK

func (m *Order) GSI2PK() string

func (*Order) GSI2SK

func (m *Order) GSI2SK() string

func (*Order) GSI3PK

func (m *Order) GSI3PK() string

func (*Order) GSI3SK

func (m *Order) GSI3SK() string

func (*Order) GSI4PK

func (m *Order) GSI4PK() string

func (*Order) GSI4SK

func (m *Order) GSI4SK() string

func (*Order) GSI5PK

func (m *Order) GSI5PK() string

func (*Order) GSI5SK

func (m *Order) GSI5SK() string

func (*Order) GSI6PK

func (m *Order) GSI6PK() string

func (*Order) GSI6SK

func (m *Order) GSI6SK() string

func (*Order) GSI7PK

func (m *Order) GSI7PK() string

func (*Order) GSI7SK

func (m *Order) GSI7SK() string

func (*Order) GSI8PK

func (m *Order) GSI8PK() string

func (*Order) GSI8SK

func (m *Order) GSI8SK() string

func (*Order) GSI9PK

func (m *Order) GSI9PK() string

func (*Order) GSI9SK

func (m *Order) GSI9SK() string

func (*Order) GSI10PK

func (m *Order) GSI10PK() string

func (*Order) GSI10SK

func (m *Order) GSI10SK() string

func (*Order) GSI11PK

func (m *Order) GSI11PK() string

func (*Order) GSI11SK

func (m *Order) GSI11SK() string

func (*Order) GSI12PK

func (m *Order) GSI12PK() string

func (*Order) GSI12SK

func (m *Order) GSI12SK() string

func (*Order) GSI13PK

func (m *Order) GSI13PK() string

func (*Order) GSI13SK

func (m *Order) GSI13SK() string

func (*Order) GSI14PK

func (m *Order) GSI14PK() string

func (*Order) GSI14SK

func (m *Order) GSI14SK() string

func (*Order) GSI15PK

func (m *Order) GSI15PK() string

func (*Order) GSI15SK

func (m *Order) GSI15SK() string

func (*Order) GSI16PK

func (m *Order) GSI16PK() string

func (*Order) GSI16SK

func (m *Order) GSI16SK() string

func (*Order) GSI17PK

func (m *Order) GSI17PK() string

func (*Order) GSI17SK

func (m *Order) GSI17SK() string

func (*Order) GSI18PK

func (m *Order) GSI18PK() string

func (*Order) GSI18SK

func (m *Order) GSI18SK() string

func (*Order) GSI19PK

func (m *Order) GSI19PK() string

func (*Order) GSI19SK

func (m *Order) GSI19SK() string

func (*Order) GSI20PK

func (m *Order) GSI20PK() string

func (*Order) GSI20SK

func (m *Order) GSI20SK() string

func (*Order) GetCreateAt

func (x *Order) GetCreateAt() int64

func (*Order) GetCreateBy

func (x *Order) GetCreateBy() string

func (*Order) GetCustomerId

func (x *Order) GetCustomerId() string

func (*Order) GetCustomerName

func (x *Order) GetCustomerName() string

func (*Order) GetId

func (x *Order) GetId() string

func (*Order) GetItemCount

func (x *Order) GetItemCount() int32

func (*Order) GetItems

func (x *Order) GetItems() map[string]*LineItem

func (*Order) GetModifyAt

func (x *Order) GetModifyAt() int64

func (*Order) GetModifyBy

func (x *Order) GetModifyBy() string

func (*Order) GetPlacedAt

func (x *Order) GetPlacedAt() int64

func (*Order) GetShippingAddress

func (x *Order) GetShippingAddress() string

func (*Order) GetState

func (x *Order) GetState() State

func (*Order) GetTags

func (x *Order) GetTags() map[string]*Tag

func (*Order) GetTotalCents

func (x *Order) GetTotalCents() int64

func (*Order) GetVersion

func (x *Order) GetVersion() int64

func (*Order) Hydrate

func (m *Order) Hydrate(body []byte) error

func (*Order) On

func (aggregate *Order) On(event protosource.Event) error

On applies an event to the aggregate, rebuilding its state. This method is called during Repository.Load to reconstruct from stored events, and during test scenarios. Events represent facts — never reject based on business rules.

func (*Order) PK

func (m *Order) PK() string

PK is automatic: package#aggregate#id#<id_value>

func (*Order) ProjectOrderSummary

func (m *Order) ProjectOrderSummary() *OrderSummary

ProjectOrderSummary builds a OrderSummary projection from the aggregate.

func (*Order) Projections

func (m *Order) Projections() []proto.Message

Projections returns all projection views derived from this aggregate.

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

func (x *Order) ProtoReflect() protoreflect.Message

func (*Order) Reset

func (x *Order) Reset()

func (*Order) RestoreSnapshot

func (aggregate *Order) RestoreSnapshot(snapshot *Snapshot)

func (*Order) SK

func (m *Order) SK() string

func (*Order) Snapshot

func (aggregate *Order) Snapshot(version int64) protosource.Event

func (*Order) SnapshotInterval

func (aggregate *Order) SnapshotInterval() int32

func (*Order) String

func (x *Order) String() string

type OrderClient

type OrderClient struct {
	// contains filtered or unexported fields
}

func NewOrderClient

func NewOrderClient(store opaquedata.OpaqueStore) *OrderClient

func (*OrderClient) AddOrder

func (c *OrderClient) AddOrder(ctx context.Context, d *Order, opts ...opaquedata.Option) error

func (*OrderClient) DeleteOrder

func (c *OrderClient) DeleteOrder(ctx context.Context, id string) error

func (*OrderClient) GetOrder

func (c *OrderClient) GetOrder(ctx context.Context, id string) (*Order, error)

func (*OrderClient) SelectOrderByCustomerId

func (c *OrderClient) SelectOrderByCustomerId(ctx context.Context, customer_id string) ([]*Order, error)

SelectOrderByCustomerId queries GSI1 by partition key.

func (*OrderClient) SelectOrderByCustomerIdWithCreateAt

func (c *OrderClient) SelectOrderByCustomerIdWithCreateAt(ctx context.Context, customer_id string, op opaquedata.SortOperator, vals ...OrderGSI1SK) ([]*Order, error)

SelectOrderByCustomerIdWithCreateAt queries GSI1 with a sort key condition.

func (*OrderClient) UpdateOrder

func (c *OrderClient) UpdateOrder(ctx context.Context, d *Order, opts ...opaquedata.Option) error

type OrderGSI1SK

type OrderGSI1SK struct {
	CreateAt int64
}

func (OrderGSI1SK) String

func (v OrderGSI1SK) String() string

type OrderList

type OrderList struct {
	Items []*Order `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*OrderList) Descriptor deprecated

func (*OrderList) Descriptor() ([]byte, []int)

Deprecated: Use OrderList.ProtoReflect.Descriptor instead.

func (*OrderList) GetItems

func (x *OrderList) GetItems() []*Order

func (*OrderList) ProtoMessage

func (*OrderList) ProtoMessage()

func (*OrderList) ProtoReflect

func (x *OrderList) ProtoReflect() protoreflect.Message

func (*OrderList) Reset

func (x *OrderList) Reset()

func (*OrderList) String

func (x *OrderList) String() string

type OrderSummary

type OrderSummary struct {
	Id           string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	State        State  `protobuf:"varint,2,opt,name=state,proto3,enum=example.app.order.v1.State" json:"state,omitempty"`
	CustomerId   string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	CustomerName string `protobuf:"bytes,4,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
	TotalCents   int64  `protobuf:"varint,5,opt,name=total_cents,json=totalCents,proto3" json:"total_cents,omitempty"`
	ItemCount    int32  `protobuf:"varint,6,opt,name=item_count,json=itemCount,proto3" json:"item_count,omitempty"`
	PlacedAt     int64  `protobuf:"varint,7,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
	CreateAt     int64  `protobuf:"varint,8,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
	// contains filtered or unexported fields
}

OrderSummary is a lightweight view of the Order for listings and dashboards. Fields are a subset of the aggregate — matched by name, copied automatically. PK is the same as the aggregate; SK = "PROJ#OrderSummary". GSI2 provides a status+placed_at index not present on the aggregate itself.

func (*OrderSummary) Descriptor deprecated

func (*OrderSummary) Descriptor() ([]byte, []int)

Deprecated: Use OrderSummary.ProtoReflect.Descriptor instead.

func (*OrderSummary) GSI1PK

func (m *OrderSummary) GSI1PK() string

func (*OrderSummary) GSI1SK

func (m *OrderSummary) GSI1SK() string

func (*OrderSummary) GSI2PK

func (m *OrderSummary) GSI2PK() string

func (*OrderSummary) GSI2SK

func (m *OrderSummary) GSI2SK() string

func (*OrderSummary) GSI3PK

func (m *OrderSummary) GSI3PK() string

func (*OrderSummary) GSI3SK

func (m *OrderSummary) GSI3SK() string

func (*OrderSummary) GSI4PK

func (m *OrderSummary) GSI4PK() string

func (*OrderSummary) GSI4SK

func (m *OrderSummary) GSI4SK() string

func (*OrderSummary) GSI5PK

func (m *OrderSummary) GSI5PK() string

func (*OrderSummary) GSI5SK

func (m *OrderSummary) GSI5SK() string

func (*OrderSummary) GSI6PK

func (m *OrderSummary) GSI6PK() string

func (*OrderSummary) GSI6SK

func (m *OrderSummary) GSI6SK() string

func (*OrderSummary) GSI7PK

func (m *OrderSummary) GSI7PK() string

func (*OrderSummary) GSI7SK

func (m *OrderSummary) GSI7SK() string

func (*OrderSummary) GSI8PK

func (m *OrderSummary) GSI8PK() string

func (*OrderSummary) GSI8SK

func (m *OrderSummary) GSI8SK() string

func (*OrderSummary) GSI9PK

func (m *OrderSummary) GSI9PK() string

func (*OrderSummary) GSI9SK

func (m *OrderSummary) GSI9SK() string

func (*OrderSummary) GSI10PK

func (m *OrderSummary) GSI10PK() string

func (*OrderSummary) GSI10SK

func (m *OrderSummary) GSI10SK() string

func (*OrderSummary) GSI11PK

func (m *OrderSummary) GSI11PK() string

func (*OrderSummary) GSI11SK

func (m *OrderSummary) GSI11SK() string

func (*OrderSummary) GSI12PK

func (m *OrderSummary) GSI12PK() string

func (*OrderSummary) GSI12SK

func (m *OrderSummary) GSI12SK() string

func (*OrderSummary) GSI13PK

func (m *OrderSummary) GSI13PK() string

func (*OrderSummary) GSI13SK

func (m *OrderSummary) GSI13SK() string

func (*OrderSummary) GSI14PK

func (m *OrderSummary) GSI14PK() string

func (*OrderSummary) GSI14SK

func (m *OrderSummary) GSI14SK() string

func (*OrderSummary) GSI15PK

func (m *OrderSummary) GSI15PK() string

func (*OrderSummary) GSI15SK

func (m *OrderSummary) GSI15SK() string

func (*OrderSummary) GSI16PK

func (m *OrderSummary) GSI16PK() string

func (*OrderSummary) GSI16SK

func (m *OrderSummary) GSI16SK() string

func (*OrderSummary) GSI17PK

func (m *OrderSummary) GSI17PK() string

func (*OrderSummary) GSI17SK

func (m *OrderSummary) GSI17SK() string

func (*OrderSummary) GSI18PK

func (m *OrderSummary) GSI18PK() string

func (*OrderSummary) GSI18SK

func (m *OrderSummary) GSI18SK() string

func (*OrderSummary) GSI19PK

func (m *OrderSummary) GSI19PK() string

func (*OrderSummary) GSI19SK

func (m *OrderSummary) GSI19SK() string

func (*OrderSummary) GSI20PK

func (m *OrderSummary) GSI20PK() string

func (*OrderSummary) GSI20SK

func (m *OrderSummary) GSI20SK() string

func (*OrderSummary) GetCreateAt

func (x *OrderSummary) GetCreateAt() int64

func (*OrderSummary) GetCustomerId

func (x *OrderSummary) GetCustomerId() string

func (*OrderSummary) GetCustomerName

func (x *OrderSummary) GetCustomerName() string

func (*OrderSummary) GetId

func (x *OrderSummary) GetId() string

func (*OrderSummary) GetItemCount

func (x *OrderSummary) GetItemCount() int32

func (*OrderSummary) GetPlacedAt

func (x *OrderSummary) GetPlacedAt() int64

func (*OrderSummary) GetState

func (x *OrderSummary) GetState() State

func (*OrderSummary) GetTotalCents

func (x *OrderSummary) GetTotalCents() int64

func (*OrderSummary) Hydrate

func (m *OrderSummary) Hydrate(body []byte) error

func (*OrderSummary) PK

func (m *OrderSummary) PK() string

PK is automatic: package#aggregate#id#<id_value>

func (*OrderSummary) ProtoMessage

func (*OrderSummary) ProtoMessage()

func (*OrderSummary) ProtoReflect

func (x *OrderSummary) ProtoReflect() protoreflect.Message

func (*OrderSummary) Reset

func (x *OrderSummary) Reset()

func (*OrderSummary) SK

func (m *OrderSummary) SK() string

func (*OrderSummary) String

func (x *OrderSummary) String() string

type OrderSummaryClient

type OrderSummaryClient struct {
	// contains filtered or unexported fields
}

func NewOrderSummaryClient

func NewOrderSummaryClient(store opaquedata.OpaqueStore) *OrderSummaryClient

func (*OrderSummaryClient) AddOrderSummary

func (c *OrderSummaryClient) AddOrderSummary(ctx context.Context, d *OrderSummary, opts ...opaquedata.Option) error

func (*OrderSummaryClient) DeleteOrderSummary

func (c *OrderSummaryClient) DeleteOrderSummary(ctx context.Context, id string) error

func (*OrderSummaryClient) GetOrderSummary

func (c *OrderSummaryClient) GetOrderSummary(ctx context.Context, id string) (*OrderSummary, error)

func (*OrderSummaryClient) SelectOrderSummaryByCustomerId

func (c *OrderSummaryClient) SelectOrderSummaryByCustomerId(ctx context.Context, customer_id string) ([]*OrderSummary, error)

SelectOrderSummaryByCustomerId queries GSI1 by partition key.

func (*OrderSummaryClient) SelectOrderSummaryByCustomerIdWithCreateAt

func (c *OrderSummaryClient) SelectOrderSummaryByCustomerIdWithCreateAt(ctx context.Context, customer_id string, op opaquedata.SortOperator, vals ...OrderSummaryGSI1SK) ([]*OrderSummary, error)

SelectOrderSummaryByCustomerIdWithCreateAt queries GSI1 with a sort key condition.

func (*OrderSummaryClient) SelectOrderSummaryByState

func (c *OrderSummaryClient) SelectOrderSummaryByState(ctx context.Context, state State) ([]*OrderSummary, error)

SelectOrderSummaryByState queries GSI2 by partition key.

func (*OrderSummaryClient) SelectOrderSummaryByStateWithPlacedAt

func (c *OrderSummaryClient) SelectOrderSummaryByStateWithPlacedAt(ctx context.Context, state State, op opaquedata.SortOperator, vals ...OrderSummaryGSI2SK) ([]*OrderSummary, error)

SelectOrderSummaryByStateWithPlacedAt queries GSI2 with a sort key condition.

func (*OrderSummaryClient) UpdateOrderSummary

func (c *OrderSummaryClient) UpdateOrderSummary(ctx context.Context, d *OrderSummary, opts ...opaquedata.Option) error

type OrderSummaryGSI1SK

type OrderSummaryGSI1SK struct {
	CreateAt int64
}

func (OrderSummaryGSI1SK) String

func (v OrderSummaryGSI1SK) String() string

type OrderSummaryGSI2SK

type OrderSummaryGSI2SK struct {
	PlacedAt int64
}

func (OrderSummaryGSI2SK) String

func (v OrderSummaryGSI2SK) String() string

type Place

type Place struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor    string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	PlacedAt int64  `protobuf:"varint,3,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Place) CommandName

func (m *Place) CommandName() string

func (*Place) Descriptor deprecated

func (*Place) Descriptor() ([]byte, []int)

Deprecated: Use Place.ProtoReflect.Descriptor instead.

func (*Place) EmitEvents

func (m *Place) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*Place) GetActor

func (x *Place) GetActor() string

func (*Place) GetId

func (x *Place) GetId() string

func (*Place) GetPlacedAt

func (x *Place) GetPlacedAt() int64

func (*Place) GuardState added in v0.1.1

func (m *Place) GuardState(aggregate protosource.Aggregate) error

func (*Place) ProtoMessage

func (*Place) ProtoMessage()

func (*Place) ProtoReflect

func (x *Place) ProtoReflect() protoreflect.Message

func (*Place) ProtoValidate

func (m *Place) ProtoValidate() error

func (*Place) Reset

func (x *Place) Reset()

func (*Place) String

func (x *Place) String() string

func (*Place) ValidateVersion

func (m *Place) ValidateVersion(version int64) error

type Placed

type Placed struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version  int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At       int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor    string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	PlacedAt int64  `protobuf:"varint,5,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Placed) Descriptor deprecated

func (*Placed) Descriptor() ([]byte, []int)

Deprecated: Use Placed.ProtoReflect.Descriptor instead.

func (*Placed) EventName

func (m *Placed) EventName() string

func (*Placed) GetActor

func (x *Placed) GetActor() string

func (*Placed) GetAt

func (x *Placed) GetAt() int64

func (*Placed) GetId

func (x *Placed) GetId() string

func (*Placed) GetPlacedAt

func (x *Placed) GetPlacedAt() int64

func (*Placed) GetVersion

func (x *Placed) GetVersion() int64

func (*Placed) ProtoMessage

func (*Placed) ProtoMessage()

func (*Placed) ProtoReflect

func (x *Placed) ProtoReflect() protoreflect.Message

func (*Placed) Reset

func (x *Placed) Reset()

func (*Placed) String

func (x *Placed) String() string

type RemoveItem

type RemoveItem struct {
	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor  string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	ItemId string `protobuf:"bytes,3,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveItem) CommandName

func (m *RemoveItem) CommandName() string

func (*RemoveItem) Descriptor deprecated

func (*RemoveItem) Descriptor() ([]byte, []int)

Deprecated: Use RemoveItem.ProtoReflect.Descriptor instead.

func (*RemoveItem) EmitEvents

func (m *RemoveItem) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*RemoveItem) GetActor

func (x *RemoveItem) GetActor() string

func (*RemoveItem) GetId

func (x *RemoveItem) GetId() string

func (*RemoveItem) GetItemId

func (x *RemoveItem) GetItemId() string

func (*RemoveItem) GuardState added in v0.1.1

func (m *RemoveItem) GuardState(aggregate protosource.Aggregate) error

func (*RemoveItem) ProtoMessage

func (*RemoveItem) ProtoMessage()

func (*RemoveItem) ProtoReflect

func (x *RemoveItem) ProtoReflect() protoreflect.Message

func (*RemoveItem) ProtoValidate

func (m *RemoveItem) ProtoValidate() error

func (*RemoveItem) Reset

func (x *RemoveItem) Reset()

func (*RemoveItem) String

func (x *RemoveItem) String() string

func (*RemoveItem) ValidateVersion

func (m *RemoveItem) ValidateVersion(version int64) error

type RemoveTag

type RemoveTag struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	Key   string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveTag) CommandName

func (m *RemoveTag) CommandName() string

func (*RemoveTag) Descriptor deprecated

func (*RemoveTag) Descriptor() ([]byte, []int)

Deprecated: Use RemoveTag.ProtoReflect.Descriptor instead.

func (*RemoveTag) EmitEvents

func (m *RemoveTag) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*RemoveTag) GetActor

func (x *RemoveTag) GetActor() string

func (*RemoveTag) GetId

func (x *RemoveTag) GetId() string

func (*RemoveTag) GetKey

func (x *RemoveTag) GetKey() string

func (*RemoveTag) GuardState added in v0.1.1

func (m *RemoveTag) GuardState(aggregate protosource.Aggregate) error

func (*RemoveTag) ProtoMessage

func (*RemoveTag) ProtoMessage()

func (*RemoveTag) ProtoReflect

func (x *RemoveTag) ProtoReflect() protoreflect.Message

func (*RemoveTag) ProtoValidate

func (m *RemoveTag) ProtoValidate() error

func (*RemoveTag) Reset

func (x *RemoveTag) Reset()

func (*RemoveTag) String

func (x *RemoveTag) String() string

func (*RemoveTag) ValidateVersion

func (m *RemoveTag) ValidateVersion(version int64) error

type Repo

type Repo interface {
	protosource.Repo
}

Repo is a package-specific interface for dependency injection. It embeds protosource.Repo so that *protosource.Repository satisfies it, while giving each aggregate package a distinct type for Wire.

type Repository added in v0.1.4

type Repository struct{ *protosource.Repository }

Repository wraps *protosource.Repository for the Order aggregate, giving Wire a distinct concrete type per aggregate.

func ProvideRepository added in v0.1.4

func ProvideRepository(store protosource.Store, serializer protosource.Serializer) *Repository

ProvideRepository creates a Order repository accepting interfaces.

type SetShipping

type SetShipping struct {
	Id              string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Actor           string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
	ShippingAddress string `protobuf:"bytes,3,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
	// contains filtered or unexported fields
}

func (*SetShipping) CommandName

func (m *SetShipping) CommandName() string

func (*SetShipping) Descriptor deprecated

func (*SetShipping) Descriptor() ([]byte, []int)

Deprecated: Use SetShipping.ProtoReflect.Descriptor instead.

func (*SetShipping) EmitEvents

func (m *SetShipping) EmitEvents(aggregate protosource.Aggregate) []protosource.Event

func (*SetShipping) GetActor

func (x *SetShipping) GetActor() string

func (*SetShipping) GetId

func (x *SetShipping) GetId() string

func (*SetShipping) GetShippingAddress

func (x *SetShipping) GetShippingAddress() string

func (*SetShipping) GuardState added in v0.1.1

func (m *SetShipping) GuardState(aggregate protosource.Aggregate) error

func (*SetShipping) ProtoMessage

func (*SetShipping) ProtoMessage()

func (*SetShipping) ProtoReflect

func (x *SetShipping) ProtoReflect() protoreflect.Message

func (*SetShipping) ProtoValidate

func (m *SetShipping) ProtoValidate() error

func (*SetShipping) Reset

func (x *SetShipping) Reset()

func (*SetShipping) String

func (x *SetShipping) String() string

func (*SetShipping) ValidateVersion

func (m *SetShipping) ValidateVersion(version int64) error

type ShippingSet

type ShippingSet struct {
	Id              string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version         int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At              int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor           string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	ShippingAddress string `protobuf:"bytes,5,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
	// contains filtered or unexported fields
}

func (*ShippingSet) Descriptor deprecated

func (*ShippingSet) Descriptor() ([]byte, []int)

Deprecated: Use ShippingSet.ProtoReflect.Descriptor instead.

func (*ShippingSet) EventName

func (m *ShippingSet) EventName() string

func (*ShippingSet) GetActor

func (x *ShippingSet) GetActor() string

func (*ShippingSet) GetAt

func (x *ShippingSet) GetAt() int64

func (*ShippingSet) GetId

func (x *ShippingSet) GetId() string

func (*ShippingSet) GetShippingAddress

func (x *ShippingSet) GetShippingAddress() string

func (*ShippingSet) GetVersion

func (x *ShippingSet) GetVersion() int64

func (*ShippingSet) ProtoMessage

func (*ShippingSet) ProtoMessage()

func (*ShippingSet) ProtoReflect

func (x *ShippingSet) ProtoReflect() protoreflect.Message

func (*ShippingSet) Reset

func (x *ShippingSet) Reset()

func (*ShippingSet) String

func (x *ShippingSet) String() string

type Snapshot

type Snapshot struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version  int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At       int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor    string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	Snapshot *Order `protobuf:"bytes,5,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
	// contains filtered or unexported fields
}

func (*Snapshot) Descriptor deprecated

func (*Snapshot) Descriptor() ([]byte, []int)

Deprecated: Use Snapshot.ProtoReflect.Descriptor instead.

func (*Snapshot) EventName

func (m *Snapshot) EventName() string

func (*Snapshot) GetActor

func (x *Snapshot) GetActor() string

func (*Snapshot) GetAt

func (x *Snapshot) GetAt() int64

func (*Snapshot) GetId

func (x *Snapshot) GetId() string

func (*Snapshot) GetSnapshot

func (x *Snapshot) GetSnapshot() *Order

func (*Snapshot) GetVersion

func (x *Snapshot) GetVersion() int64

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) ProtoReflect

func (x *Snapshot) ProtoReflect() protoreflect.Message

func (*Snapshot) Reset

func (x *Snapshot) Reset()

func (*Snapshot) String

func (x *Snapshot) String() string

type State

type State int32
const (
	State_STATE_UNSPECIFIED State = 0
	State_STATE_DRAFT       State = 1
	State_STATE_PLACED      State = 2
	State_STATE_PAID        State = 3
	State_STATE_SHIPPED     State = 4
	State_STATE_DELIVERED   State = 5
	State_STATE_CANCELLED   State = 6
)

func (State) Descriptor

func (State) Descriptor() protoreflect.EnumDescriptor

func (State) Enum

func (x State) Enum() *State

func (State) EnumDescriptor deprecated

func (State) EnumDescriptor() ([]byte, []int)

Deprecated: Use State.Descriptor instead.

func (State) Number

func (x State) Number() protoreflect.EnumNumber

func (State) String

func (x State) String() string

func (State) Type

func (State) Type() protoreflect.EnumType

type Tag

type Tag struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Tag is a key-value label on an order (e.g. "priority"="rush", "source"="web").

func (*Tag) Descriptor deprecated

func (*Tag) Descriptor() ([]byte, []int)

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetKey

func (x *Tag) GetKey() string

func (*Tag) GetValue

func (x *Tag) GetValue() string

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

func (x *Tag) ProtoReflect() protoreflect.Message

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type TagAdded

type TagAdded struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At      int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor   string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	Tag     *Tag   `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"`
	// contains filtered or unexported fields
}

func (*TagAdded) Descriptor deprecated

func (*TagAdded) Descriptor() ([]byte, []int)

Deprecated: Use TagAdded.ProtoReflect.Descriptor instead.

func (*TagAdded) EventName

func (m *TagAdded) EventName() string

func (*TagAdded) GetActor

func (x *TagAdded) GetActor() string

func (*TagAdded) GetAt

func (x *TagAdded) GetAt() int64

func (*TagAdded) GetId

func (x *TagAdded) GetId() string

func (*TagAdded) GetTag

func (x *TagAdded) GetTag() *Tag

func (*TagAdded) GetVersion

func (x *TagAdded) GetVersion() int64

func (*TagAdded) ProtoMessage

func (*TagAdded) ProtoMessage()

func (*TagAdded) ProtoReflect

func (x *TagAdded) ProtoReflect() protoreflect.Message

func (*TagAdded) Reset

func (x *TagAdded) Reset()

func (*TagAdded) String

func (x *TagAdded) String() string

type TagRemoved

type TagRemoved struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	At      int64  `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
	Actor   string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
	Key     string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*TagRemoved) Descriptor deprecated

func (*TagRemoved) Descriptor() ([]byte, []int)

Deprecated: Use TagRemoved.ProtoReflect.Descriptor instead.

func (*TagRemoved) EventName

func (m *TagRemoved) EventName() string

func (*TagRemoved) GetActor

func (x *TagRemoved) GetActor() string

func (*TagRemoved) GetAt

func (x *TagRemoved) GetAt() int64

func (*TagRemoved) GetId

func (x *TagRemoved) GetId() string

func (*TagRemoved) GetKey

func (x *TagRemoved) GetKey() string

func (*TagRemoved) GetVersion

func (x *TagRemoved) GetVersion() int64

func (*TagRemoved) ProtoMessage

func (*TagRemoved) ProtoMessage()

func (*TagRemoved) ProtoReflect

func (x *TagRemoved) ProtoReflect() protoreflect.Message

func (*TagRemoved) Reset

func (x *TagRemoved) Reset()

func (*TagRemoved) String

func (x *TagRemoved) String() string

Directories

Path Synopsis
Code generated by protoc-gen-protosource.
Code generated by protoc-gen-protosource.

Jump to

Keyboard shortcuts

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