2022-03-25 17:08:24 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-13 20:02:20 +02:00
|
|
|
module DiscourseSubscriptionClient
|
2023-02-23 19:24:11 +01:00
|
|
|
def self.find_subscriptions(resource_name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-10-16 13:52:03 +02:00
|
|
|
SubscriptionClientSupplier =
|
|
|
|
Class.new Object do
|
|
|
|
attr_reader :product_slugs
|
2023-02-23 19:24:11 +01:00
|
|
|
|
2024-10-16 13:52:03 +02:00
|
|
|
def initialize(product_slugs)
|
|
|
|
@product_slugs = product_slugs
|
|
|
|
end
|
2023-02-23 19:24:11 +01:00
|
|
|
end
|
|
|
|
|
2024-10-16 13:52:03 +02:00
|
|
|
SubscriptionClientResource =
|
|
|
|
Class.new Object do
|
|
|
|
end
|
2023-02-23 19:24:11 +01:00
|
|
|
|
2024-10-16 13:52:03 +02:00
|
|
|
SubscriptionClientSubscription =
|
|
|
|
Class.new Object do
|
|
|
|
attr_reader :product_id
|
2023-02-23 19:24:11 +01:00
|
|
|
|
2024-10-16 13:52:03 +02:00
|
|
|
def initialize(product_id)
|
|
|
|
@product_id = product_id
|
|
|
|
end
|
2023-02-23 19:24:11 +01:00
|
|
|
end
|
|
|
|
|
2023-06-13 20:02:20 +02:00
|
|
|
module DiscourseSubscriptionClient
|
2023-02-23 19:24:11 +01:00
|
|
|
class Subscriptions
|
|
|
|
class Result
|
2024-10-16 13:52:03 +02:00
|
|
|
attr_accessor :supplier, :resource, :subscriptions, :products
|
2023-02-23 19:24:11 +01:00
|
|
|
|
|
|
|
def any?
|
2023-05-04 17:25:10 +02:00
|
|
|
supplier.present? && resource.present? && subscriptions.present? && products.present?
|
2023-02-23 19:24:11 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|