Skip to content

Commit

Permalink
Merge pull request #1657 from dmitry-sinina/payments_add_created_at
Browse files Browse the repository at this point in the history
Admin API: add more payment attributes
  • Loading branch information
dmitry-sinina authored Dec 17, 2024
2 parents b26b5d1 + 41e5e2f commit 6b5517b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/resources/api/rest/admin/payment_resource.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

class Api::Rest::Admin::PaymentResource < BaseResource
attributes :amount,
attributes :created_at,
:amount,
:notes,
:private_notes,
:status,
:type_name

Expand All @@ -13,8 +15,10 @@ class Api::Rest::Admin::PaymentResource < BaseResource
relationship_filter :account

ransack_filter :id, type: :number
ransack_filter :created_at, type: :datetime
ransack_filter :amount, type: :number
ransack_filter :notes, type: :string
ransack_filter :private_notes, type: :string
ransack_filter :status, type: :enum, collection: Payment::CONST::STATUS_IDS.values
ransack_filter :type_name, type: :enum, collection: Payment::CONST::TYPE_IDS.values

Expand All @@ -23,10 +27,11 @@ def self.creatable_fields(_context)
account
amount
notes
private_notes
]
end

def self.sortable_fields(_context)
%i[amount notes]
%i[amount created_at]
end
end

0 comments on commit 6b5517b

Please sign in to comment.