2022-12-06 16:08:38 +01:00
|
|
|
# frozen_string_literal: true
|
2016-05-04 18:17:50 +02:00
|
|
|
|
2022-12-09 10:56:39 +01:00
|
|
|
json.extract! user, :id, :email, :created_at
|
2022-12-07 13:31:32 +01:00
|
|
|
json.extract! user.profile, :full_name, :first_name, :last_name if user.association(:profile).loaded?
|
2022-12-07 12:56:35 +01:00
|
|
|
json.gender user.statistic_profile.gender ? 'man' : 'woman'
|
2022-12-09 10:56:39 +01:00
|
|
|
|
|
|
|
if user.association(:invoicing_profile).loaded?
|
2023-03-08 09:43:12 +01:00
|
|
|
json.invoicing_profile_id user.invoicing_profile.id
|
2022-12-09 10:56:39 +01:00
|
|
|
json.external_id user.invoicing_profile.external_id
|
|
|
|
json.organization !user.invoicing_profile.organization.nil?
|
|
|
|
json.address user.invoicing_profile.invoicing_address
|
|
|
|
end
|
2016-05-04 18:17:50 +02:00
|
|
|
|
|
|
|
if user.association(:group).loaded?
|
|
|
|
json.group do
|
|
|
|
if user.group_id?
|
|
|
|
json.extract! user.group, :id, :name, :slug
|
|
|
|
else
|
|
|
|
json.nil!
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|