diff --git a/api/app/views/mno_enterprise/jpi/v1/admin/products/_product.json.jbuilder b/api/app/views/mno_enterprise/jpi/v1/admin/products/_product.json.jbuilder index 08992a542..702243d19 100644 --- a/api/app/views/mno_enterprise/jpi/v1/admin/products/_product.json.jbuilder +++ b/api/app/views/mno_enterprise/jpi/v1/admin/products/_product.json.jbuilder @@ -1,4 +1,4 @@ -json.extract! product, :id, :nid, :name, :active, :product_type, :logo, :external_id, :externally_provisioned, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :single_billing_enabled, :billed_locally, :created_at, :updated_at +json.extract! product, :id, :nid, :name, :active, :product_type, :logo, :external_id, :externally_provisioned, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :single_billing_enabled, :billed_locally, :notification_on_success, :notification_on_failure, :notification_on_approval, :created_at, :updated_at json.values_attributes do json.array! product.values.each do |value| diff --git a/api/app/views/mno_enterprise/jpi/v1/products/_product.json.jbuilder b/api/app/views/mno_enterprise/jpi/v1/products/_product.json.jbuilder index 123d81617..26dbfb5a9 100644 --- a/api/app/views/mno_enterprise/jpi/v1/products/_product.json.jbuilder +++ b/api/app/views/mno_enterprise/jpi/v1/products/_product.json.jbuilder @@ -1,4 +1,4 @@ -json.extract! product, :id, :nid, :name, :active, :product_type, :logo, :external_id, :externally_provisioned, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :local, :single_billing_enabled, :billed_locally +json.extract! product, :id, :nid, :name, :active, :product_type, :logo, :external_id, :externally_provisioned, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :local, :single_billing_enabled, :billed_locally, :notification_on_success, :notification_on_failure, :notification_on_approval json.values_attributes do json.array! product.values.each do |value| diff --git a/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb b/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb index e4a15431e..48f08d262 100644 --- a/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/products_controller.rb @@ -1,7 +1,7 @@ module MnoEnterprise::Concerns::Controllers::Jpi::V1::Admin::ProductsController extend ActiveSupport::Concern - ATTRIBUTES = [:name, :active, :logo, :external_id, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :single_billing_enabled, :billed_locally] + ATTRIBUTES = [:name, :active, :logo, :external_id, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :single_billing_enabled, :billed_locally, :notification_on_success, :notification_on_failure, :notification_on_approval] DEPENDENCIES = [:'values.field', :assets, :categories, :product_pricings, :product_contracts] PRICING_ATTRIBUTES = [:name, :description, :position, :free, :pricing_type, :free_trial_enabled, :free_trial_duration, :free_trial_unit, :per_duration, :per_unit, {:prices => [:currency, :price_cents] }, :external_id] diff --git a/api/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb b/api/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb index d1d9b845a..77d018051 100644 --- a/api/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb +++ b/api/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb @@ -73,6 +73,9 @@ def partial_hash_for_product(product) "local" => product.local, "single_billing_enabled" => product.single_billing_enabled, "billed_locally" => product.billed_locally, + "notification_on_success" => product.notification_on_success, + "notification_on_failure" => product.notification_on_failure, + "notification_on_approval" => product.notification_on_approval, "values_attributes" => product.values, "assets_attributes" => product.assets, # "product_pricings" => product.product_pricings diff --git a/core/app/models/mno_enterprise/product.rb b/core/app/models/mno_enterprise/product.rb index a15ff4684..a7e418836 100644 --- a/core/app/models/mno_enterprise/product.rb +++ b/core/app/models/mno_enterprise/product.rb @@ -20,7 +20,9 @@ class Product < BaseResource property :single_billing_enabled, type: :boolean property :billed_locally, type: :boolean property :available_actions - + property :notification_on_success + property :notification_on_failure + property :notification_on_approval def to_audit_event { diff --git a/core/lib/mno_enterprise/testing_support/factories/product.rb b/core/lib/mno_enterprise/testing_support/factories/product.rb index 2bb25b94d..e238d67f3 100644 --- a/core/lib/mno_enterprise/testing_support/factories/product.rb +++ b/core/lib/mno_enterprise/testing_support/factories/product.rb @@ -8,6 +8,9 @@ externally_provisioned true custom_schema nil local false + notification_on_success false + notification_on_failure false + notification_on_approval false values [] assets [] categories []