Commit Graph

24 Commits

Author SHA1 Message Date
Maikel Linke
811740c361 Correct OFN session cookie name
And improve the documentation in general.
2023-07-03 13:25:55 +10:00
Maikel Linke
de51a7833d Add script to swaggerize DFC API in its engine
Rswag doesn't look for specs in engines by default. We haven't added any
Rswag specs in the dfc_provider engine yet but that will come.

The generated API schema has some superfluous whitespace removed due to
a fix in the rswag gems.
2023-06-28 13:50:54 +10:00
Mikael Norlén
f15a4cc943 Add autogenerated whitespaces to swagger.yml
These whitespaces were generated by
bundle exec rails rswag.

Might be related to a new version of rswag or
developers' trim trailing whitespace settings.
2023-02-15 11:14:28 +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
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
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
3baed683b1 Add allow_charges attribute to customers endpoint 2022-03-28 10:55:57 +11:00
Matt-Yorkley
bd9bed7323 Update schemas for relationships 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
3dbf00f302 Add pagination with Pagy using structure from JSON:API specification
https://jsonapi.org/examples/#pagination

Update schema for collections rendered with pagination data
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
a222b507fb Update and document authentication methods 2022-03-02 11:58:04 +11:00
Matt-Yorkley
56bc554f29 Regenerate swagger docs with rails rswag 2022-03-02 11:57:57 +11:00
Matt-Yorkley
39f4feed4a Generate docs with rails rswag 2022-03-02 11:55:46 +11:00
Maikel Linke
8f5cb7bd91 Update swagger files, separate v0 and v1, delete old file
The new v1 doesn't contain any API endpoints yet. We will add them later
when they are ready.
2022-02-08 11:44:36 +11:00
Maikel Linke
bcd9ea2b87 Update generated swagger file
rake rswag PATTERN="spec/requests/api/*_spec.rb"

This file is just a demo so far. The more complete description of the
API is: /swagger.yaml
2021-02-24 15:45:47 +11:00
Steve Roberts
9541dbf495 Fix order api spec and add incomplete generated swagger.yml 2020-06-24 15:15:18 +10:00
Steve Roberts
e619ae621c Add rswag and coverage for orders endpoint
Add coverage for core orders endpoint queries (WIP)
2020-06-24 13:21:49 +10:00