refactor/checkout (#8)
Co-authored-by: matst80 <mats.tornberg@gmail.com> Reviewed-on: #8 Co-authored-by: Mats Törnberg <mats@tornberg.me> Co-committed-by: Mats Törnberg <mats@tornberg.me>
This commit was merged in pull request #8.
This commit is contained in:
16
pkg/checkout/mutation_inventory_reserved.go
Normal file
16
pkg/checkout/mutation_inventory_reserved.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package checkout
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
messages "git.k6n.net/go-cart-actor/proto/checkout"
|
||||
)
|
||||
|
||||
func HandleInventoryReserved(g *CheckoutGrain, m *messages.InventoryReserved) error {
|
||||
if m == nil {
|
||||
return fmt.Errorf("HandleInventoryReserved: nil payload")
|
||||
}
|
||||
|
||||
g.InventoryReserved = m.Status == "success"
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user