1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(api) users: invoicing_profile_id

This commit is contained in:
Sylvain 2023-03-08 09:43:12 +01:00
parent 8ef114ed43
commit f4d0df04c0
4 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@
- Improved upgrade script
- OpenAPI reservation endpoint can be filtered by date
- OpenAPI users endpoint now returns the ID of the InvoicingProfile
- Fix a bug: empty advanced accounting code is not defaulted to the general setting
- Fix a bug: invalid style in accounting codes settings
- Fix a bug: wrong namespace for task cart_operator

View File

@ -26,6 +26,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc
"id": 1746,
"email": "xxxxxxx@xxxx.com",
"created_at": "2016-05-04T17:21:48.403+02:00",
"invoicing_profile_id": 7824,
"external_id": "J5821-4"
"full_name": "xxxx xxxx",
"first_name": "xxxx",
@ -43,6 +44,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc
"id": 1745,
"email": "xxxxxxx@gmail.com",
"created_at": "2016-05-03T15:21:13.125+02:00",
"invoicing_profile_id": 7823,
"external_id": "J5846-4"
"full_name": "xxxxx xxxxx",
"first_name": "xxxxx",
@ -60,6 +62,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc
"id": 1744,
"email": "xxxxxxx@gmail.com",
"created_at": "2016-05-03T13:51:03.223+02:00",
"invoicing_profile_id": 7822,
"external_id": "J5900-1"
"full_name": "xxxxxxx xxxx",
"first_name": "xxxxxxx",
@ -77,6 +80,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc
"id": 1743,
"email": "xxxxxxxx@setecastronomy.eu",
"created_at": "2016-05-03T12:24:38.724+02:00",
"invoicing_profile_id": 7821,
"external_id": "P4172-4"
"full_name": "xxx xxxxxxx",
"first_name": "xxx",
@ -100,6 +104,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc
"id": 1746,
"email": "xxxxxxxxxxxx",
"created_at": "2016-05-04T17:21:48.403+02:00",
"invoicing_profile_id": 7820,
"external_id": "J5500-4"
"full_name": "xxxx xxxxxx",
"first_name": "xxxx",
@ -117,6 +122,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc
"id": 1745,
"email": "xxxxxxxxx@gmail.com",
"created_at": "2016-05-03T15:21:13.125+02:00",
"invoicing_profile_id": 7819,
"external_id": null,
"full_name": "xxxxx xxxxxx",
"first_name": "xxxx",

View File

@ -5,6 +5,7 @@ json.extract! user.profile, :full_name, :first_name, :last_name if user.associat
json.gender user.statistic_profile.gender ? 'man' : 'woman'
if user.association(:invoicing_profile).loaded?
json.invoicing_profile_id user.invoicing_profile.id
json.external_id user.invoicing_profile.external_id
json.organization !user.invoicing_profile.organization.nil?
json.address user.invoicing_profile.invoicing_address

View File

@ -19,10 +19,14 @@ class OpenApi::UsersTest < ActionDispatch::IntegrationTest
assert_not_nil(users[:users].detect { |u| u[:external_id] == 'J5821-4' })
assert(users[:users].all? { |u| %w[man woman].include?(u[:gender]) })
assert(users[:users].all? { |u| u[:organization] != User.find(u[:id]).invoicing_profile.organization.nil? })
assert(users[:users].all? { |u| u[:invoicing_profile_id].present? })
assert(users[:users].all? { |u| u[:full_name].present? })
assert(users[:users].all? { |u| u[:first_name].present? })
assert(users[:users].all? { |u| u[:last_name].present? })
assert(users[:users].any? { |u| u[:address].present? })
assert(users[:users].all? { |u| u[:group][:id] == User.find(u[:id]).group_id })
assert(users[:users].all? { |u| u[:group][:name].present? })
assert(users[:users].all? { |u| u[:group][:slug].present? })
end
test 'list all users with pagination' do