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

FYLE-2891u2w-suggest #171

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
164 changes: 164 additions & 0 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6865,6 +6865,102 @@ components:
description: >
Determines whether this organization has been verified by a
verifier.
suggest_out:
type: object
additionalProperties: false
properties:
id:
allOf:
- $ref: '#/components/schemas/id_string'
example: stmpwownwrng
bank_name:
type: string
description: |
Specifies the bank name of the statement.
example: American Express
is_debit_positive:
type: boolean
description: >
Specifies the representation of the the amount in the statement, if
true then the amount represented by

positive sign are debits, and if false then the amount represented
by negative sign are debits.
example: true
transaction_date_column:
type: string
description: >
Specifies the header name of the transaction date column in the
statement.
example: spent date
vendor_column:
type: string
description: |
Specifies the header name of the vendor column in the statement.
example: merchant
transaction_id_column:
type: string
description: >
Specifies the header name of the transaction id / unique id column
in the statement.
nullable: true
example: reference number
amount_column:
type: string
description: |
Specifies the header name of the amount column in the statement.
example: amount
name:
type: string
description: |
Specifies the mapping name.
example: amex_mapping
card_number_column:
type: string
description: >
Specifies the header name of the card number column in the
statement.
example: account number
foreign_amount_column:
type: string
description: >
Specifies the header name of the foreign amount column in the
statement.
nullable: true
example: foreign amount
foreign_currency_column:
type: string
description: >
Specifies the header name of the foreign currency column in the
statement.
nullable: true
example: foreign currency
description_column:
type: string
description: >
Specifies the header name of the description column in the
statement.
nullable: true
example: description
is_auto_created:
type: boolean
description: |
Helps to identify if a statement mapping got auto created or not
example: true
required:
- id
- bank_name
- is_debit_positive
- transaction_date_column
- transaction_id_column
- amount_column
- name
- card_number_column
- vendor_column
- foreign_amount_column
- foreign_currency_column
- description_column
- is_auto_created
parameters:
created_at:
in: query
Expand Down Expand Up @@ -7109,6 +7205,10 @@ tags:
- name: Organisations
description: |
These APIs gives you access to manage organisations.
- name: Statement mappings
description: >
These APIs gives you access to add a mapping for the statement uploaded by
the user.
paths:
/admin/projects:
get:
Expand Down Expand Up @@ -10544,3 +10644,67 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/401'
/admin/statement_mappings/suggest:
post:
tags:
- Statement mappings
summary: Statement mapping suggestion
description: >
This API supports very rich filtering on all response fields and
pagination via query parameters. To understand how to use these
parameters, please see the [Guide to Data
APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering)
operationId: statement_mappings_suggest
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
statement_id:
type: string
description: |
The id of the uploaded statement.
required:
- statement_id
required:
- data
additionalProperties: false
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
count:
$ref: '#/components/schemas/count'
offset:
$ref: '#/components/schemas/offset'
data:
type: object
items:
$ref: '#/components/schemas/suggest_out'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/400'
'401':
description: Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/403'
5 changes: 5 additions & 0 deletions src/admin/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ tags:
- name: Organisations
description: >
These APIs gives you access to manage organisations.
- name: Statement mappings
description: >
These APIs gives you access to add a mapping for the statement uploaded by the user.
# - name: Suggestions
# description: |
# This API gives you access to Expense/Card Transactions Suggestions.
Expand Down Expand Up @@ -239,3 +242,5 @@ paths:
$ref: paths/admin@budget_usages.yaml
/admin/orgs:
$ref: paths/admin@orgs.yaml
/admin/statement_mappings/suggest:
$ref: paths/admin@statement_mappings@suggest.yaml
60 changes: 60 additions & 0 deletions src/admin/paths/admin@statement_mappings@suggest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
post:
tags:
- Statement mappings
summary: Statement mapping suggestion
description: |
This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering)
operationId: statement_mappings_suggest
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
statement_id:
type: string
description: |
The id of the uploaded statement.
required:
- statement_id
required:
- data
additionalProperties: False
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
count:
$ref: '../../components/schemas/count.yaml'
offset:
$ref: '../../components/schemas/offset.yaml'
data:
type: object
items:
$ref: '../../components/schemas/statement_mappings.yaml#/suggest_out'
modernwarfareuplink marked this conversation as resolved.
Show resolved Hide resolved
'400':
description: Bad request
content:
application/json:
schema:
$ref: '../../components/schemas/400.yaml'
'401':
description: Unauthorized request
content:
application/json:
schema:
$ref: '../../components/schemas/401.yaml'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '../../components/schemas/403.yaml'
87 changes: 87 additions & 0 deletions src/components/schemas/statement_mappings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
suggest_out:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statement_mappings_suggest_out

type: object
additionalProperties: False
properties:
id:
modernwarfareuplink marked this conversation as resolved.
Show resolved Hide resolved
allOf:
- $ref: './fields.yaml#/id_string'
modernwarfareuplink marked this conversation as resolved.
Show resolved Hide resolved
example: stmpwownwrng
bank_name:
type: string
description: |
Specifies the bank name of the statement.
example: American Express
is_debit_positive:
type: boolean
description: |
Specifies the representation of the the amount in the statement, if true then the amount represented by
positive sign are debits, and if false then the amount represented by negative sign are debits.
example: true
transaction_date_column:
type: string
description: |
Specifies the header name of the transaction date column in the statement.
example: spent date
vendor_column:
type: string
description: |
Specifies the header name of the vendor column in the statement.
example: merchant
transaction_id_column:
type: string
description: |
Specifies the header name of the transaction id / unique id column in the statement.
nullable: true
example: reference number
amount_column:
type: string
description: |
Specifies the header name of the amount column in the statement.
example: amount
name:
type: string
description: |
Specifies the mapping name.
example: amex_mapping
card_number_column:
type: string
description: |
Specifies the header name of the card number column in the statement.
example: account number
foreign_amount_column:
type: string
description: |
Specifies the header name of the foreign amount column in the statement.
nullable: true
example: foreign amount
foreign_currency_column:
type: string
description: |
Specifies the header name of the foreign currency column in the statement.
nullable: true
example: foreign currency
description_column:
type: string
description: |
Specifies the header name of the description column in the statement.
nullable: true
example: description
is_auto_created:
type: boolean
description: |
Helps to identify if a statement mapping got auto created or not
example: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false

required:
- id
- bank_name
- is_debit_positive
- transaction_date_column
- transaction_id_column
- amount_column
- name
- card_number_column
- vendor_column
- foreign_amount_column
- foreign_currency_column
- description_column
- is_auto_created