Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IOrderRepository ¶
type IOrderRepository interface { FindOneById(ctx context.Context, id primitive.ObjectID) (*Order, error) FindOneByOrderNumber(ctx context.Context, orderNumber string) (*Order, error) Add(ctx context.Context, order *Order) error Update(ctx context.Context, order *Order) error }
func NewOrderRepository ¶
func NewOrderRepository(db *mongo.Database) IOrderRepository
type IOrderService ¶
type IOrderService interface { AddNew(ctx context.Context, orderNumber string, price shared.Money) (*Order, error) RejectPayment(ctx context.Context, orderNumber string, paymentRejectReason string) (*Order, error) GetByOrderNumber(ctx context.Context, orderNumber string) (*Order, error) }
func NewOrderService ¶
func NewOrderService(repository IOrderRepository) IOrderService
type Order ¶
type Order struct { Id primitive.ObjectID `json:"id" bson:"_id"` OrderNumber string `json:"orderNumber" bson:"OrderNumber"` Price shared.Money `json:"price" bson:"Price"` FinalPrice shared.Money `json:"finalPrice" bson:"FinalPrice"` PaymentStatus string `json:"paymentStatus" bson:"PaymentStatus"` PaymentRejectReason string `json:"paymentRejectReason" bson:"PaymentRejectReason"` // contains filtered or unexported fields }
func (*Order) ClearDomainEvents ¶
func (u *Order) ClearDomainEvents()
func (*Order) GetDomainEvents ¶
func (u *Order) GetDomainEvents() []ddd.IBaseEvent
func (*Order) RaiseEvent ¶
func (u *Order) RaiseEvent(event ddd.IBaseEvent)
func (*Order) RejectPayment ¶
Click to show internal directories.
Click to hide internal directories.