1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-12 23:09:03 +01:00
fab-manager/app/views/open_api/v1/users/_user.json.jbuilder

25 lines
559 B
Ruby

# frozen_string_literal: true
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'
end
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
json.group do
if user.user.group_id?
json.extract! user.user.group, :id, :name, :slug
else
json.nil!
end
end
end