mirror of
https://github.com/we-promise/sure.git
synced 2026-05-08 05:04:59 +00:00
feat(api): expose import row diagnostics (#1644)
* feat(api): expose import row diagnostics * fix(api): stabilize import row diagnostics * fix(api): harden import row diagnostics * fix(api): number Mint import diagnostics rows * fix(api): enforce unique import row diagnostics * fix(api): address import row diagnostics review
This commit is contained in:
@@ -1318,6 +1318,165 @@ components:
|
||||
properties:
|
||||
data:
|
||||
"$ref": "#/components/schemas/ImportDetail"
|
||||
ImportRowMapping:
|
||||
type: object
|
||||
required:
|
||||
- key
|
||||
- type
|
||||
- value
|
||||
- create_when_empty
|
||||
- creatable
|
||||
- mappable
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
nullable: true
|
||||
type:
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
nullable: true
|
||||
create_when_empty:
|
||||
type: boolean
|
||||
creatable:
|
||||
type: boolean
|
||||
mappable:
|
||||
type: object
|
||||
nullable: true
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
type:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
nullable: true
|
||||
ImportRowDiagnostic:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- row_number
|
||||
- valid
|
||||
- errors
|
||||
- fields
|
||||
- mappings
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
row_number:
|
||||
type: integer
|
||||
minimum: 1
|
||||
valid:
|
||||
type: boolean
|
||||
errors:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
fields:
|
||||
type: object
|
||||
properties:
|
||||
account:
|
||||
type: string
|
||||
nullable: true
|
||||
date:
|
||||
type: string
|
||||
nullable: true
|
||||
qty:
|
||||
type: string
|
||||
nullable: true
|
||||
ticker:
|
||||
type: string
|
||||
nullable: true
|
||||
exchange_operating_mic:
|
||||
type: string
|
||||
nullable: true
|
||||
price:
|
||||
type: string
|
||||
nullable: true
|
||||
amount:
|
||||
type: string
|
||||
nullable: true
|
||||
currency:
|
||||
type: string
|
||||
nullable: true
|
||||
name:
|
||||
type: string
|
||||
nullable: true
|
||||
category:
|
||||
type: string
|
||||
nullable: true
|
||||
tags:
|
||||
type: string
|
||||
nullable: true
|
||||
entity_type:
|
||||
type: string
|
||||
nullable: true
|
||||
notes:
|
||||
type: string
|
||||
nullable: true
|
||||
active:
|
||||
type: boolean
|
||||
nullable: true
|
||||
effective_date:
|
||||
type: string
|
||||
nullable: true
|
||||
conditions:
|
||||
type: string
|
||||
nullable: true
|
||||
actions:
|
||||
type: string
|
||||
nullable: true
|
||||
mappings:
|
||||
type: object
|
||||
properties:
|
||||
account:
|
||||
"$ref": "#/components/schemas/ImportRowMapping"
|
||||
category:
|
||||
"$ref": "#/components/schemas/ImportRowMapping"
|
||||
account_type:
|
||||
"$ref": "#/components/schemas/ImportRowMapping"
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
"$ref": "#/components/schemas/ImportRowMapping"
|
||||
ImportRowDiagnosticCollection:
|
||||
type: object
|
||||
required:
|
||||
- data
|
||||
- meta
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
"$ref": "#/components/schemas/ImportRowDiagnostic"
|
||||
meta:
|
||||
type: object
|
||||
required:
|
||||
- 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
|
||||
Trade:
|
||||
type: object
|
||||
required:
|
||||
@@ -3266,6 +3425,66 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
"/api/v1/imports/{id}/rows":
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
description: Import ID
|
||||
schema:
|
||||
type: string
|
||||
get:
|
||||
summary: List import row diagnostics
|
||||
description: List sanitized import rows with validation errors and mapping resolution
|
||||
state.
|
||||
tags:
|
||||
- Imports
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
description: 'Page number (default: 1)'
|
||||
schema:
|
||||
type: integer
|
||||
- name: per_page
|
||||
in: query
|
||||
required: false
|
||||
description: 'Items per page (default: 25, max: 100)'
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: import rows listed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ImportRowDiagnosticCollection"
|
||||
'401':
|
||||
description: unauthorized
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
'403':
|
||||
description: insufficient scope
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
'404':
|
||||
description: import not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
'500':
|
||||
description: internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
"/api/v1/merchants":
|
||||
get:
|
||||
summary: List merchants
|
||||
|
||||
Reference in New Issue
Block a user