Maikel
400d087789
Merge pull request #11133 from mkllnk/dfc-api-specs
...
OFN DFC API documenation in OpenAPI format generated with Rswag
2023-07-03 10:53:40 +10:00
Maikel Linke
8368a6ccc9
Announce the new DFC endpoint
...
We need to declare in each spec file for which endpoint the spec is
because it was just choosing the first declared one by default. The
first one was v1 and now it's dfc-v1.7.
2023-06-28 13:50:54 +10:00
Maikel Linke
75cce8bc19
Simplify customer code
...
The API endpoint merges the created_manually flag in the params already.
No need to write it separately.
2023-06-15 12:02:45 +10:00
Mohamed ABDELLANI
ebc3073604
use Customer#visible on the customers listing endpoints
...
Update app/models/customer.rb
Co-authored-by: Maikel <maikel@email.org.au >
Update spec/models/customer_spec.rb
Co-authored-by: Maikel <maikel@email.org.au >
Update spec/models/customer_spec.rb
Co-authored-by: Maikel <maikel@email.org.au >
authorize created_manually field to be set on APIv1
2023-06-15 12:02:45 +10:00
Mohamed ABDELLANI
da78e06a39
load customers of managed enterprises only
2023-04-11 12:10:07 +01:00
Mikael Norlén
e95d08cae8
Add balance to api v1 customers endpoint
...
- customers#show: Add balance (data_type: double) to customer attributes.
- customers#index: Add balance only if specified in extra_fields
query parameter: extra_fields[customer]=balance
2023-02-15 11:14:27 +01:00
Maikel Linke
6c0d4cffe5
Allow customer's address update with country code
...
The customer endpoint now serves 2-letter ISO codes for countries and
accepts these for updates. It also serves and accepts region codes
(abbreviations) like VIC for Victoria.
Updates treat these fields as case-insensitive and either code or name
have to be present.
This commit also updates the Swagger documentation.
2022-07-19 09:49:42 +10:00
J. David Lowe
da2e7b404f
add Mayhem for API as a github workflow
2022-04-28 13:30:34 -07:00
Maikel Linke
379eda7c41
Add feature toggle for API v1 use
...
Dev, test and staging need to activate the feature toggle now before
it's accessible.
2022-03-28 11:04:30 +11:00
Maikel Linke
3e00ab261e
Spec customer relationships on API
2022-03-28 11:04:30 +11:00
Maikel Linke
5063f377c3
Enable relationship inclusion for customers#show
...
This will allow us to include address records.
2022-03-28 11:04:30 +11:00
Maikel Linke
d789fb32e9
Make customer's address writable on API
2022-03-28 11:04:30 +11:00
Maikel Linke
51420934f3
Add billing and shipping address to customer
2022-03-28 10:58:18 +11:00
Maikel Linke
adc7e97e62
Add tag list to customer endpoint
2022-03-28 10:55:58 +11:00
Maikel Linke
e5e8953a09
Add ToS acceptance to customer endpoint
...
It's another read-only attribute.
Please note that JSON:API specifies a format of `date-time` which we
don't adhere to because it uses a `Z` in front of the timezone offset
which doesn't seem to be included in the default json serialisation.
So I didn't add the format and left it as simple `string`. Problem?
2022-03-28 10:55:58 +11:00
Maikel Linke
aa6e5ae799
Report useful error message in missing parameter
2022-03-28 10:55:57 +11:00
Maikel Linke
8d12c7a692
Permit more customer attributes for update
2022-03-28 10:55:57 +11:00
Maikel Linke
41746459fa
Restrict allow_charges attribute to read-only
...
We want people to use the UI to change this attribute.
2022-03-28 10:55:57 +11:00
Maikel Linke
4aa70c1ffd
Render pagination errors
2022-03-02 11:59:35 +11:00
Maikel Linke
b89715149c
Sanitise pagination input for new API
2022-03-02 11:59:35 +11:00
Maikel Linke
75fc35574e
Make json_response test helper deal with error response
...
It raised an error:
NoMethodError:
undefined method `map' for nil:NilClass
2022-03-02 11:59:35 +11:00
Maikel Linke
414bf5d074
Don't list guest customer records to guest users
2022-03-02 11:59:35 +11:00
Matt-Yorkley
2e59812bc1
Refactor to make more use of schema refs, and regenerate swagger file
2022-03-02 11:59:33 +11:00
Matt-Yorkley
d66d6d6bd6
Update use of links on relationships
2022-03-02 11:58:04 +11:00
Matt-Yorkley
8e61428cce
Add 401 Unauthorized response test
2022-03-02 11:58:04 +11:00
Matt-Yorkley
028d02ccca
Test serialized relationship data
2022-03-02 11:55:46 +11:00
Matt-Yorkley
46f9d3ef81
Test permissions combined with Ransack searches
2022-03-02 11:55:46 +11:00
Matt-Yorkley
76f14a03c6
Add specs and JSON schemas
...
Include test helpers
2022-03-02 11:55:46 +11:00