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