Documentation ¶
Index ¶
- Variables
- func CommandPaymentApprove(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
- func CommandPaymentClose(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
- func CommandPaymentCreate(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
- func CommandPaymentReject(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
- func CommandPaymentUpdateBalance(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
- type Payment
- type PaymentService
- func (p *PaymentService) Add(ctx context.Context, in *billing.Payment) (*billing.Payment, error)
- func (p *PaymentService) Approve(ctx context.Context, id string) error
- func (p *PaymentService) Close(ctx context.Context, id string) error
- func (p *PaymentService) Get(ctx context.Context, aggregateId string) (*billing.Payment, error)
- func (p *PaymentService) Handle(ctx context.Context, aggregate *Payment, command *eventsourcing.BaseCommand) error
- func (p *PaymentService) List(ctx context.Context, filter interface{}) ([]*billing.Payment, error)
- func (p *PaymentService) PublishEvents(ctx context.Context, events []*eventsourcing.Event) error
- func (p *PaymentService) Reject(ctx context.Context, id string) error
- func (p *PaymentService) UpdateBalance(ctx context.Context, in *billing.Payment) (*billing.Payment, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var EventList map[string]uint32
EventList - event notify list
Functions ¶
func CommandPaymentApprove ¶
func CommandPaymentApprove(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
func CommandPaymentClose ¶
func CommandPaymentClose(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
func CommandPaymentCreate ¶
func CommandPaymentCreate(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
func CommandPaymentReject ¶
func CommandPaymentReject(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
func CommandPaymentUpdateBalance ¶
func CommandPaymentUpdateBalance(ctx context.Context, in *billing.Payment) (*eventsourcing.BaseCommand, error)
Types ¶
type Payment ¶
type Payment struct { *eventsourcing.BaseAggregate *billing.Payment }
func (*Payment) ApplyChange ¶
func (p *Payment) ApplyChange(event *eventsourcing.Event) error
ApplyChange to payment
func (*Payment) HandleCommand ¶
func (p *Payment) HandleCommand(ctx context.Context, command *eventsourcing.BaseCommand) error
HandleCommand create events and validate based on such command
type PaymentService ¶
type PaymentService struct { // EventSourcing eventsourcing.CommandHandle // contains filtered or unexported fields }
func New ¶
func New(logger logger.Logger, paymentRepository event_store.EventStore) (*PaymentService, error)
func (*PaymentService) Approve ¶
func (p *PaymentService) Approve(ctx context.Context, id string) error
func (*PaymentService) Handle ¶
func (p *PaymentService) Handle(ctx context.Context, aggregate *Payment, command *eventsourcing.BaseCommand) error
func (*PaymentService) PublishEvents ¶
func (p *PaymentService) PublishEvents(ctx context.Context, events []*eventsourcing.Event) error
PublishEvents - send message about a new events
func (*PaymentService) Reject ¶
func (p *PaymentService) Reject(ctx context.Context, id string) error
func (*PaymentService) UpdateBalance ¶
Click to show internal directories.
Click to hide internal directories.