Initial commit
This commit is contained in:
44
app/api/v2/entities/treasury.rb
Normal file
44
app/api/v2/entities/treasury.rb
Normal file
@@ -0,0 +1,44 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2
|
||||
module Entities
|
||||
class Treasury < API::V2::Entities::Base
|
||||
expose :id,
|
||||
documentation: {
|
||||
type: 'Integer',
|
||||
desc: 'id of record'
|
||||
}
|
||||
|
||||
expose :title,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'title'
|
||||
}
|
||||
|
||||
expose :state,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'state'
|
||||
}
|
||||
|
||||
expose :kind,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'kind'
|
||||
}
|
||||
|
||||
expose :data,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Submasked data'
|
||||
} do |treasury|
|
||||
Barong::App.config.api_data_masking_enabled ? treasury.sub_masked_data : treasury.data
|
||||
end
|
||||
|
||||
with_options(format_with: :iso_timestamp) do
|
||||
expose :created_at
|
||||
expose :updated_at
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user