ensurePricing
This commit is contained in:
@@ -70,6 +70,27 @@ type PricedProcessingResource struct {
|
||||
IsService bool
|
||||
}
|
||||
|
||||
func (r *PricedProcessingResource) ensurePricing() {
|
||||
if r.SelectedPricing == nil {
|
||||
r.SelectedPricing = &ProcessingResourcePricingProfile{}
|
||||
}
|
||||
}
|
||||
|
||||
func (r *PricedProcessingResource) IsPurchasable() bool {
|
||||
r.ensurePricing()
|
||||
return r.SelectedPricing.IsPurchasable()
|
||||
}
|
||||
|
||||
func (r *PricedProcessingResource) IsBooked() bool {
|
||||
r.ensurePricing()
|
||||
return r.SelectedPricing.IsBooked()
|
||||
}
|
||||
|
||||
func (r *PricedProcessingResource) GetPriceHT() (float64, error) {
|
||||
r.ensurePricing()
|
||||
return r.PricedResource.GetPriceHT()
|
||||
}
|
||||
|
||||
func (r *PricedProcessingResource) GetType() tools.DataType {
|
||||
return tools.PROCESSING_RESOURCE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user