This commit is contained in:
soky srm
2026-01-19 19:29:34 +01:00
committed by GitHub
parent 8f04955e72
commit 877abcf4ce
3 changed files with 725 additions and 1 deletions

View File

@@ -283,6 +283,86 @@ RSpec.configure do |config|
properties: {
message: { type: :string }
}
},
ImportConfiguration: {
type: :object,
properties: {
date_col_label: { type: :string, nullable: true },
amount_col_label: { type: :string, nullable: true },
name_col_label: { type: :string, nullable: true },
category_col_label: { type: :string, nullable: true },
tags_col_label: { type: :string, nullable: true },
notes_col_label: { type: :string, nullable: true },
account_col_label: { type: :string, nullable: true },
date_format: { type: :string, nullable: true },
number_format: { type: :string, nullable: true },
signage_convention: { type: :string, nullable: true }
}
},
ImportStats: {
type: :object,
properties: {
rows_count: { type: :integer, minimum: 0 },
valid_rows_count: { type: :integer, minimum: 0, nullable: true }
}
},
ImportSummary: {
type: :object,
required: %w[id type status created_at updated_at],
properties: {
id: { type: :string, format: :uuid },
type: { type: :string, enum: %w[TransactionImport TradeImport AccountImport MintImport CategoryImport RuleImport] },
status: { type: :string, enum: %w[pending complete importing reverting revert_failed failed] },
created_at: { type: :string, format: :'date-time' },
updated_at: { type: :string, format: :'date-time' },
account_id: { type: :string, format: :uuid, nullable: true },
rows_count: { type: :integer, minimum: 0 },
error: { type: :string, nullable: true }
}
},
ImportDetail: {
type: :object,
required: %w[id type status created_at updated_at],
properties: {
id: { type: :string, format: :uuid },
type: { type: :string, enum: %w[TransactionImport TradeImport AccountImport MintImport CategoryImport RuleImport] },
status: { type: :string, enum: %w[pending complete importing reverting revert_failed failed] },
created_at: { type: :string, format: :'date-time' },
updated_at: { type: :string, format: :'date-time' },
account_id: { type: :string, format: :uuid, nullable: true },
error: { type: :string, nullable: true },
configuration: { '$ref' => '#/components/schemas/ImportConfiguration' },
stats: { '$ref' => '#/components/schemas/ImportStats' }
}
},
ImportCollection: {
type: :object,
required: %w[data meta],
properties: {
data: {
type: :array,
items: { '$ref' => '#/components/schemas/ImportSummary' }
},
meta: {
type: :object,
required: %w[current_page total_pages total_count per_page],
properties: {
current_page: { type: :integer, minimum: 1 },
next_page: { type: :integer, nullable: true },
prev_page: { type: :integer, nullable: true },
total_pages: { type: :integer, minimum: 0 },
total_count: { type: :integer, minimum: 0 },
per_page: { type: :integer, minimum: 1 }
}
}
}
},
ImportResponse: {
type: :object,
required: %w[data],
properties: {
data: { '$ref' => '#/components/schemas/ImportDetail' }
}
}
}
}