mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Add allow_charges attribute to customers endpoint
This commit is contained in:
@@ -12,7 +12,8 @@ class CustomerSchema < JsonApiSchema
|
||||
first_name: { type: :string, nullable: true, example: "Alice" },
|
||||
last_name: { type: :string, nullable: true, example: "Springs" },
|
||||
code: { type: :string, nullable: true, example: "BUYER1" },
|
||||
email: { type: :string, example: "alice@example.com" }
|
||||
email: { type: :string, example: "alice@example.com" },
|
||||
allow_charges: { type: :boolean, example: false },
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
module Api
|
||||
module V1
|
||||
class CustomerSerializer < BaseSerializer
|
||||
attributes :id, :enterprise_id, :first_name, :last_name, :code, :email
|
||||
attributes :id, :enterprise_id, :first_name, :last_name, :code, :email,
|
||||
:allow_charges
|
||||
|
||||
belongs_to :enterprise, links: {
|
||||
related: ->(object) {
|
||||
|
||||
@@ -60,6 +60,9 @@ components:
|
||||
email:
|
||||
type: string
|
||||
example: alice@example.com
|
||||
allow_charges:
|
||||
type: boolean
|
||||
example: false
|
||||
required:
|
||||
- id
|
||||
- enterprise_id
|
||||
@@ -67,6 +70,7 @@ components:
|
||||
- last_name
|
||||
- code
|
||||
- email
|
||||
- allow_charges
|
||||
relationships:
|
||||
type: object
|
||||
properties:
|
||||
@@ -130,6 +134,9 @@ components:
|
||||
email:
|
||||
type: string
|
||||
example: alice@example.com
|
||||
allow_charges:
|
||||
type: boolean
|
||||
example: false
|
||||
required:
|
||||
- id
|
||||
- enterprise_id
|
||||
@@ -137,6 +144,7 @@ components:
|
||||
- last_name
|
||||
- code
|
||||
- email
|
||||
- allow_charges
|
||||
relationships:
|
||||
type: object
|
||||
properties:
|
||||
@@ -271,6 +279,9 @@ paths:
|
||||
email:
|
||||
type: string
|
||||
example: alice@example.com
|
||||
allow_charges:
|
||||
type: boolean
|
||||
example: false
|
||||
required:
|
||||
- enterprise_id
|
||||
- email
|
||||
@@ -354,6 +365,9 @@ paths:
|
||||
email:
|
||||
type: string
|
||||
example: alice@example.com
|
||||
allow_charges:
|
||||
type: boolean
|
||||
example: false
|
||||
required:
|
||||
- enterprise_id
|
||||
- email
|
||||
|
||||
Reference in New Issue
Block a user