Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(credit_notes): Add list of credit note reasons #532

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CreditNote < ApplicationRecord
monetize :remaining_amount_cents

STATUS = %i[available consumed].freeze
REASON = %i[overpaid].freeze
REASON = %i[duplicated_charge product_unsatisfactory order_change order_cancellation fraudulent_charge other].freeze

enum status: STATUS
enum reason: REASON
Expand Down
7 changes: 6 additions & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,12 @@ type CreditNoteItem {
}

enum CreditNoteReasonEnum {
overpaid
duplicated_charge
fraudulent_charge
order_cancellation
order_change
other
product_unsatisfactory
}

enum CreditNoteTypeEnum {
Expand Down
32 changes: 31 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5991,7 +5991,37 @@
"inputFields": null,
"enumValues": [
{
"name": "overpaid",
"name": "duplicated_charge",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "product_unsatisfactory",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "order_change",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "order_cancellation",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "fraudulent_charge",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "other",
"description": null,
"isDeprecated": false,
"deprecationReason": null
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/credit_notes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
invoice

status { 'available' }
reason { 'overpaid' }
reason { 'duplicated_charge' }
amount_cents { 100 }
amount_currency { 'EUR' }

Expand Down