feat(api): accept Sure NDJSON imports (#1601)

* feat(api): accept Sure NDJSON imports

* fix(api): preserve uploaded Sure imports on publish errors

* fix(api): reset preserved Sure imports after enqueue failure

* fix(api): tighten Sure import upload handling

* test(api): align import API key fixtures

* docs(api): document import publish failure IDs
This commit is contained in:
ghost
2026-05-01 14:56:18 -06:00
committed by GitHub
parent c429f20a77
commit da42423475
5 changed files with 669 additions and 35 deletions

View File

@@ -64,6 +64,19 @@ RSpec.configure do |config|
}
}
},
ErrorResponseWithImportId: {
type: :object,
required: %w[error import_id],
properties: {
error: { type: :string },
message: { type: :string, nullable: true },
import_id: {
type: :string,
format: :uuid,
description: 'Import ID preserved for retry or inspection after upload succeeds but publish fails'
}
}
},
MfaRequiredResponse: {
type: :object,
required: %w[error mfa_required],
@@ -524,7 +537,7 @@ RSpec.configure do |config|
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] },
type: { type: :string, enum: %w[TransactionImport TradeImport AccountImport MintImport CategoryImport RuleImport SureImport] },
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' },
@@ -538,7 +551,7 @@ RSpec.configure do |config|
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] },
type: { type: :string, enum: %w[TransactionImport TradeImport AccountImport MintImport CategoryImport RuleImport SureImport] },
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' },