2016-05-30 15:39:19 +02:00
|
|
|
json.array!(@members) do |member|
|
2019-01-21 15:17:56 +01:00
|
|
|
json.maxMembers @max_members
|
2016-05-30 15:39:19 +02:00
|
|
|
json.id member.id
|
2022-07-14 21:11:44 +02:00
|
|
|
json.username member.username
|
2016-05-30 15:39:19 +02:00
|
|
|
json.email member.email if current_user
|
|
|
|
json.profile do
|
|
|
|
json.first_name member.profile.first_name
|
|
|
|
json.last_name member.profile.last_name
|
|
|
|
json.phone member.profile.phone
|
|
|
|
end
|
2016-08-04 12:08:33 +02:00
|
|
|
json.need_completion member.need_completion?
|
2016-05-30 15:39:19 +02:00
|
|
|
json.group do
|
|
|
|
json.name member.group.name
|
|
|
|
end
|
2019-01-21 15:17:56 +01:00
|
|
|
if member.subscribed_plan
|
|
|
|
json.subscribed_plan do
|
|
|
|
json.partial! 'api/shared/plan', plan: member.subscribed_plan
|
|
|
|
end
|
|
|
|
end
|
2022-03-18 19:44:30 +01:00
|
|
|
json.validated_at member.validated_at
|
2023-07-12 08:44:02 +02:00
|
|
|
json.children member.children.where('birthday >= ?', 18.years.ago).order(:created_at) do |child|
|
2023-05-31 18:20:14 +02:00
|
|
|
json.extract! child, :id, :first_name, :last_name, :email, :birthday, :phone, :user_id, :validated_at
|
|
|
|
json.supporting_document_files_attributes child.supporting_document_files do |f|
|
|
|
|
json.id f.id
|
|
|
|
json.supportable_id f.supportable_id
|
|
|
|
json.supportable_type f.supportable_type
|
|
|
|
json.supporting_document_type_id f.supporting_document_type_id
|
|
|
|
json.attachment f.attachment.file&.filename
|
|
|
|
json.attachment_name f.attachment_identifier
|
|
|
|
json.attachment_url f.attachment_identifier ? "/api/supporting_document_files/#{f.id}/download" : nil
|
|
|
|
end
|
|
|
|
end
|
2019-01-21 15:17:56 +01:00
|
|
|
end
|