Initial commit
This commit is contained in:
49
app/api/v2/admin/entities/activity_with_user.rb
Normal file
49
app/api/v2/admin/entities/activity_with_user.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2::Admin
|
||||
module Entities
|
||||
class ActivityWithUser < API::V2::Entities::Base
|
||||
expose :user_ip,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'User IP'
|
||||
}
|
||||
|
||||
expose :user_agent,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'User Browser Agent'
|
||||
}
|
||||
|
||||
expose :topic,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Defined topic (session, adjustments) or general by default'
|
||||
}
|
||||
|
||||
expose :action,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: "API action: POST => 'create', PUT => 'update', GET => 'read', DELETE => 'delete', PATCH => 'update' or system if there is no match of HTTP method"
|
||||
}
|
||||
|
||||
expose :result,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Status of API response: succeed, failed, denied'
|
||||
}
|
||||
|
||||
expose :data,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Parameters which was sent to specific API endpoint'
|
||||
}
|
||||
|
||||
expose :user, using: API::V2::Entities::User
|
||||
|
||||
with_options(format_with: :iso_timestamp) do
|
||||
expose :created_at
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
50
app/api/v2/admin/entities/admin_activity.rb
Normal file
50
app/api/v2/admin/entities/admin_activity.rb
Normal file
@@ -0,0 +1,50 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2::Admin
|
||||
module Entities
|
||||
class AdminActivity < API::V2::Entities::Base
|
||||
expose :user_ip,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'User IP'
|
||||
}
|
||||
|
||||
expose :user_agent,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'User Browser Agent'
|
||||
}
|
||||
|
||||
expose :topic,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Defined topic (session, adjustments) or general by default'
|
||||
}
|
||||
|
||||
expose :action,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: "API action: POST => 'create', PUT => 'update', GET => 'read', DELETE => 'delete', PATCH => 'update' or system if there is no match of HTTP method"
|
||||
}
|
||||
|
||||
expose :result,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Status of API response: succeed, failed, denied'
|
||||
}
|
||||
|
||||
expose :data,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Parameters which was sent to specific API endpoint'
|
||||
}
|
||||
|
||||
expose :user, as: :admin, using: API::V2::Entities::User
|
||||
expose :target, as: :target, using: API::V2::Entities::User
|
||||
|
||||
with_options(format_with: :iso_timestamp) do
|
||||
expose :created_at
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
15
app/api/v2/admin/entities/document.rb
Normal file
15
app/api/v2/admin/entities/document.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2
|
||||
module Admin
|
||||
module Entities
|
||||
class Document < API::V2::Entities::Document
|
||||
expose :doc_number,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'document number: AB123123 type'
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
13
app/api/v2/admin/entities/phone.rb
Normal file
13
app/api/v2/admin/entities/phone.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2::Admin
|
||||
module Entities
|
||||
class Phone < API::V2::Entities::Phone
|
||||
expose :number,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Phone number'
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
32
app/api/v2/admin/entities/profile.rb
Normal file
32
app/api/v2/admin/entities/profile.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2::Admin
|
||||
module Entities
|
||||
class Profile < API::V2::Entities::Profile
|
||||
expose :first_name,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'first name'
|
||||
}
|
||||
|
||||
expose :last_name,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'Last name'
|
||||
}
|
||||
|
||||
expose :national_code,
|
||||
documentation: {
|
||||
type: 'String',
|
||||
desc: 'National Code'
|
||||
}
|
||||
|
||||
expose :dob,
|
||||
documentation: {
|
||||
type: 'Date',
|
||||
desc: 'Birth date'
|
||||
}
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
11
app/api/v2/admin/entities/user_with_kyc.rb
Normal file
11
app/api/v2/admin/entities/user_with_kyc.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2::Admin
|
||||
module Entities
|
||||
class UserWithKYC < API::V2::Entities::UserWithKYC
|
||||
expose :profiles, using: Entities::Profile
|
||||
# expose :phones, using: Entities::Phone
|
||||
expose :documents, using: Entities::Document
|
||||
end
|
||||
end
|
||||
end
|
||||
9
app/api/v2/admin/entities/user_with_profile.rb
Normal file
9
app/api/v2/admin/entities/user_with_profile.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module API::V2::Admin
|
||||
module Entities
|
||||
class UserWithProfile < API::V2::Entities::UserWithProfile
|
||||
expose :profiles, using: Entities::Profile
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user