Class: Dscf::Marketplace::SupplierSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/dscf/marketplace/supplier_serializer.rb

Instance Method Summary collapse

Instance Method Details

#document_urlsObject



23
24
25
# File 'app/serializers/dscf/marketplace/supplier_serializer.rb', line 23

def document_urls
  object.document_urls
end

#review_reasonObject

Reason the admin gave on the latest review (modification request or rejection). Lives in the Review's jsonb feedback as "...". nil for approved/pending/draft. Lets the mobile "changes requested" screen show the admin's note without a push notification.



18
19
20
21
# File 'app/serializers/dscf/marketplace/supplier_serializer.rb', line 18

def review_reason
  feedback = object.current_review_for(:default)&.feedback
  feedback && (feedback["reason"] || feedback[:reason])
end

#review_statusObject



10
11
12
# File 'app/serializers/dscf/marketplace/supplier_serializer.rb', line 10

def review_status
  object.review_status
end