Add allow_charges attribute to customers endpoint

This commit is contained in:
Maikel Linke
2022-03-02 11:54:31 +11:00
parent 913a4560d1
commit 3baed683b1
3 changed files with 18 additions and 2 deletions

View File

@@ -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

View File

@@ -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) {

View File

@@ -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