Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Document user_modified transaction field in OpenAPI specs

Juan José Mata54b55897455f
diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml
index 27d653cea7..e7184ccaeb 100644
--- a/docs/api/openapi.yaml
+++ b/docs/api/openapi.yaml
@@ -1524,6 +1524,8 @@ components:
source:
type: string
nullable: true
+ user_modified:
+ type: boolean
classification:
type: string
account:
@@ -7595,6 +7597,10 @@ paths:
type: string
description: Optional source namespace for external_id. Requires
external_id and defaults to api when external_id is provided
+ user_modified:
+ type: boolean
+ description: Whether provider syncs should preserve user-supplied
+ transaction changes
tag_ids:
type: array
items:
diff --git a/spec/requests/api/v1/transactions_spec.rb b/spec/requests/api/v1/transactions_spec.rb
index 2a346906c9..8228088d0d 100644
--- a/spec/requests/api/v1/transactions_spec.rb
+++ b/spec/requests/api/v1/transactions_spec.rb
@@ -176,6 +176,7 @@ RSpec.describe 'API V1 Transactions', type: :request do
nature: { type: :string, enum: %w[income expense inflow outflow], description: 'Transaction nature (determines sign)' },
external_id: { type: :string, description: 'Optional external idempotency key scoped to account and source' },
source: { type: :string, description: 'Optional source namespace for external_id. Requires external_id and defaults to api when external_id is provided' },
+ user_modified: { type: :boolean, description: 'Whether provider syncs should preserve user-supplied transaction changes' },
tag_ids: { type: :array, items: { type: :string, format: :uuid }, description: 'Array of tag IDs' }
},
required: %w[account_id date amount name]
diff --git a/spec/swagger_helper.rb b/spec/swagger_helper.rb
index e0a121562c..6049360693 100644
--- a/spec/swagger_helper.rb
+++ b/spec/swagger_helper.rb
@@ -830,6 +830,7 @@ RSpec.configure do |config|
notes: { type: :string, nullable: true },
external_id: { type: :string, nullable: true },
source: { type: :string, nullable: true },
+ user_modified: { type: :boolean },
classification: { type: :string },
account: { '$ref' => '#/components/schemas/Account' },
category: { '$ref' => '#/components/schemas/Category', nullable: true },