Initial commit

This commit is contained in:
Yaser
2026-08-13 19:56:46 +03:30
commit de1d57a67b
474 changed files with 43185 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
# frozen_string_literal: true
module API
module V2
module Entities
# Return user document with related info
class Document < API::V2::Entities::Base
expose :upload,
documentation: {
type: 'String',
desc: 'File Upload'
}
expose :url,
documentation: {
type: 'String',
desc: 'File url'
} do |document|
document&.upload&.url
end
expose :doc_type,
documentation: {
type: 'String',
desc: 'Document type: passport, driver license, utility bill, identity card, institutional, address, residental'
}
expose :doc_number,
documentation: {
type: 'String',
desc: 'Submasked document number: AB123123 type'
} do |document|
Barong::App.config.api_data_masking_enabled ? document.sub_masked_doc_number : document.doc_number
end
expose :doc_expire,
documentation: {
type: 'String',
desc: 'Expire date of uploaded documents'
}
expose :metadata,
documentation: {
type: 'String',
desc: 'Any additional stored data'
}
with_options(format_with: :iso_timestamp) do
expose :created_at
expose :updated_at
end
end
end
end
end