Payment Flow + Access Flow Change
This commit is contained in:
@@ -17,6 +17,11 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/logs"
|
||||
"cloud.o-forge.io/core/oc-lib/models"
|
||||
"cloud.o-forge.io/core/oc-lib/models/billing"
|
||||
"cloud.o-forge.io/core/oc-lib/models/billing/discount"
|
||||
"cloud.o-forge.io/core/oc-lib/models/billing/payment"
|
||||
"cloud.o-forge.io/core/oc-lib/models/billing/refund"
|
||||
"cloud.o-forge.io/core/oc-lib/models/billing/subscription"
|
||||
"cloud.o-forge.io/core/oc-lib/models/booking"
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area"
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/rules/rule"
|
||||
@@ -67,6 +72,11 @@ const (
|
||||
ALLOWED_IMAGE = tools.ALLOWED_IMAGE
|
||||
SERVICE_RESOURCE = tools.SERVICE_RESOURCE
|
||||
LIVE_SERVICE = tools.LIVE_SERVICE
|
||||
BILL = tools.BILL
|
||||
PAYMENT = tools.PAYMENT
|
||||
REFUND = tools.REFUND
|
||||
DISCOUNT = tools.DISCOUNT
|
||||
SUBSCRIPTION = tools.SUBSCRIPTION
|
||||
)
|
||||
|
||||
func FiltersFromFlatMap(flatMap map[string]interface{}, target interface{}) *dbs.Filters {
|
||||
@@ -727,6 +737,41 @@ func (l *LibData) ToPurchasedResource() *purchase_resource.PurchaseResource {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LibData) ToBill() *billing.Bill {
|
||||
if l.Data != nil && l.Data.GetAccessor(nil).GetType() == tools.BILL {
|
||||
return l.Data.(*billing.Bill)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LibData) ToPayment() *payment.Payment {
|
||||
if l.Data != nil && l.Data.GetAccessor(nil).GetType() == tools.PAYMENT {
|
||||
return l.Data.(*payment.Payment)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LibData) ToRefund() *refund.Refund {
|
||||
if l.Data != nil && l.Data.GetAccessor(nil).GetType() == tools.REFUND {
|
||||
return l.Data.(*refund.Refund)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LibData) ToDiscount() *discount.Discount {
|
||||
if l.Data != nil && l.Data.GetAccessor(nil).GetType() == tools.DISCOUNT {
|
||||
return l.Data.(*discount.Discount)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LibData) ToSubscription() *subscription.Subscription {
|
||||
if l.Data != nil && l.Data.GetAccessor(nil).GetType() == tools.SUBSCRIPTION {
|
||||
return l.Data.(*subscription.Subscription)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ------------- Loading resources ----------GetAccessor
|
||||
|
||||
func LoadOneStorage(storageId string, user string, peerID string, groups []string) (*resources.StorageResource, error) {
|
||||
|
||||
Reference in New Issue
Block a user