mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 23:05:44 +00:00
feat(BE-229,234,235,230,231,232,233): purchase request and purchase order and fix master data dto
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
entity "gitlab.com/mbugroup/lti-api.git/internal/entities"
|
||||
)
|
||||
|
||||
// PurchaseExpenseBridge defines hooks that allow purchase flows to stay in sync with expense data once it exists.
|
||||
type PurchaseExpenseBridge interface {
|
||||
OnItemsCreated(ctx context.Context, purchaseID uint64, items []entity.PurchaseItem) error
|
||||
OnItemsDeleted(ctx context.Context, purchaseID uint64, itemIDs []uint64) error
|
||||
OnItemsReceived(ctx context.Context, purchaseID uint64, updates []ExpenseReceivingPayload) error
|
||||
}
|
||||
|
||||
// ExpenseReceivingPayload captures the minimum data expense integration will need once available.
|
||||
type ExpenseReceivingPayload struct {
|
||||
PurchaseItemID uint64
|
||||
ProductID uint64
|
||||
WarehouseID uint64
|
||||
ReceivedQty float64
|
||||
ReceivedDate *time.Time
|
||||
}
|
||||
|
||||
// noopPurchaseExpenseBridge is the default implementation until the expense module is ready.
|
||||
type noopPurchaseExpenseBridge struct{}
|
||||
|
||||
func NewNoopPurchaseExpenseBridge() PurchaseExpenseBridge {
|
||||
return &noopPurchaseExpenseBridge{}
|
||||
}
|
||||
|
||||
func (n *noopPurchaseExpenseBridge) OnItemsCreated(_ context.Context, _ uint64, _ []entity.PurchaseItem) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *noopPurchaseExpenseBridge) OnItemsDeleted(_ context.Context, _ uint64, _ []uint64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *noopPurchaseExpenseBridge) OnItemsReceived(_ context.Context, _ uint64, _ []ExpenseReceivingPayload) error {
|
||||
return nil
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user