update
This commit is contained in:
@@ -111,13 +111,18 @@ type CartGrain struct {
|
|||||||
Notifications []CartNotification `json:"cartNotification,omitempty"`
|
Notifications []CartNotification `json:"cartNotification,omitempty"`
|
||||||
SubscriptionDetails map[string]*SubscriptionDetails `json:"subscriptionDetails,omitempty"`
|
SubscriptionDetails map[string]*SubscriptionDetails `json:"subscriptionDetails,omitempty"`
|
||||||
PaymentDeclinedNotices []Notice `json:"paymentDeclinedNotices,omitempty"`
|
PaymentDeclinedNotices []Notice `json:"paymentDeclinedNotices,omitempty"`
|
||||||
ConfirmationViewCount int `json:"confirmationViewCount,omitempty"`
|
Confirmation *ConfirmationStatus `json:"confirmation,omitempty"`
|
||||||
ConfirmationLastViewedAt time.Time `json:"confirmationLastViewedAt,omitempty"`
|
|
||||||
CheckoutOrderId string `json:"checkoutOrderId,omitempty"`
|
CheckoutOrderId string `json:"checkoutOrderId,omitempty"`
|
||||||
CheckoutStatus string `json:"checkoutStatus,omitempty"`
|
CheckoutStatus string `json:"checkoutStatus,omitempty"`
|
||||||
CheckoutCountry string `json:"checkoutCountry,omitempty"`
|
CheckoutCountry string `json:"checkoutCountry,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConfirmationStatus struct {
|
||||||
|
Code *string `json:"code,omitempty"`
|
||||||
|
ViewCount int `json:"viewCount"`
|
||||||
|
LastViewedAt time.Time `json:"lastViewedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
type Voucher struct {
|
type Voucher struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Applied bool `json:"applied"`
|
Applied bool `json:"applied"`
|
||||||
|
|||||||
@@ -7,7 +7,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func ConfirmationViewed(grain *CartGrain, req *messages.ConfirmationViewed) error {
|
func ConfirmationViewed(grain *CartGrain, req *messages.ConfirmationViewed) error {
|
||||||
grain.ConfirmationViewCount++
|
if grain.Confirmation == nil {
|
||||||
grain.ConfirmationLastViewedAt = time.Now()
|
grain.Confirmation = &ConfirmationStatus{
|
||||||
|
ViewCount: 1,
|
||||||
|
LastViewedAt: time.Now(),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
grain.Confirmation.ViewCount++
|
||||||
|
grain.Confirmation.LastViewedAt = time.Now()
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user