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-2hwr6bb #151

Closed
wants to merge 15 commits into from
178 changes: 178 additions & 0 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6463,6 +6463,127 @@ components:
description: >
Determines whether this organization has been verified by a
verifier.
statements_in:
Copy link
Contributor Author

@Kulsekar4 Kulsekar4 May 25, 2022

Choose a reason for hiding this comment

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

Summary :
Have added not null constraint for -> also have added in doc and script @modernwarfareuplink sir
file_name
file_size
no_of_debit
no_of_credit
no_of_transactions

type: object
properties:
file_id:
allOf:
- $ref: '#/components/schemas/id_string'
example: fidftadfdsdf
required:
- file_id
statements_out:
type: object
additionalProperties: false
properties:
id:
allOf:
- $ref: '#/components/schemas/id_string'
example: stmtwownwrng
org_id:
$ref: '#/components/schemas/org_id'
created_at:
$ref: '#/components/schemas/created_at'
updated_at:
$ref: '#/components/schemas/updated_at'
file_name:
type: string
description: |
Specifies the name of file uploaded by the user.
example: amex.csv
file_size:
type: string
description: |
Specifies the size of file uploaded by the user.
example: 21KB
no_of_debit:
type: integer
description: |
Number of debit transactions in the document uploaded by the user.
example: 3
no_of_credit:
type: integer
description: |
Number of credit transactions in the document uploaded by the user.
example: 3
no_of_transactions:
type: integer
description: |
Number of transactions in the document uploaded by the user.
example: 3
statement_columns:
type: array
items:
type: string
description: |
This specifies headers of the statement uploaded by the user.
example:
- account_number
- amount
statement_mapping_id:
type: string
description: |
Refers to the mapping used in statement.
example: stmpdfddfd
start_date:
$ref: '#/components/schemas/timestamptz_utc'
description: |
Start date of the statement period
end_date:
$ref: '#/components/schemas/timestamptz_utc'
description: |
End date of the statement period
has_statement_duplicate:
type: boolean
description: |
Determines whether the statement is duplicate or not.
duplicate_statement_ids:
type: array
items:
$ref: '#/components/schemas/id_string'
example:
- stmtge49ielgel
has_statement_line_items_duplicate:
type: boolean
description: >
Determines whether the transaction inside the statement is duplicate
or not.
duplicate_statement_line_items:
type: array
items:
type: object
properties:
ids:
type: array
items:
$ref: '#/components/schemas/id_string'
example:
- stlige49ielgel
description: Ids of the current statement line items which are duplicates
duplicate_line_item_statement_id:
type: string
description: |
Id of the existing duplicate statement
example:
- stmpge49ielgel
required:
- id
- org_id
- created_at
- updated_at
- file_name
- file_size
- no_of_debit
- no_of_credit
- no_of_transactions
- statement_mapping_id
- statement_columns
- start_date
- end_date
- has_statement_duplicate
- duplicate_statement_ids
- has_statement_line_items_duplicate
- duplicate_statement_line_items
parameters:
created_at:
in: query
Expand Down Expand Up @@ -6538,6 +6659,10 @@ tags:
description: >
This API gives you access to manage your organisation's Corporate Card
Transaction data.
- name: Statements
description: >
These APIs gives you access to add / view a bank statement for
reconciliation.
- name: Cost Centers
description: >
These APIs gives you access to manage your organisation's Cost Centers
Expand Down Expand Up @@ -9752,3 +9877,56 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/401'
/admin/statements/upload:
post:
tags:
- Statements
summary: Upload a statement
description: |
Upload a statement to Fyle for reconciliation.
operationId: statements_post
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/statements_in'
required:
- data
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/statements_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'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
5 changes: 5 additions & 0 deletions src/admin/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ tags:
- name: Corporate Card Transactions
description: |
This API gives you access to manage your organisation's Corporate Card Transaction data.
- name: Statements
description: >
These APIs gives you access to add / view a bank statement for reconciliation.
- name: Cost Centers
description: >
These APIs gives you access to manage your organisation's Cost Centers
Expand Down Expand Up @@ -234,3 +237,5 @@ paths:
$ref: paths/admin@budget_usages.yaml
/admin/orgs:
$ref: paths/admin@orgs.yaml
/admin/statements/upload:
$ref: paths/admin@statements@upload.yaml
52 changes: 52 additions & 0 deletions src/admin/paths/admin@statements@upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
post:
tags:
- Statements
summary: Upload a statement
description: |
Upload a statement to Fyle for reconciliation.

Choose a reason for hiding this comment

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

upload a corporate card statement(csv or excel)

operationId: statements_post
Copy link

Choose a reason for hiding this comment

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

try to understand what and where this is used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, this is a unique string used to identify an operation.
Addl info: Some code generators use this value to name the corresponding methods in code.

requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../components/schemas/statements.yaml#/statements_in'
required:
- data
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../components/schemas/statements.yaml#/statements_out'
'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'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '../../components/schemas/404.yaml'
124 changes: 124 additions & 0 deletions src/components/schemas/statements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
statements_in:
type: object
properties:
file_id:
allOf:
- $ref: './fields.yaml#/id_string'
example: fidftadfdsdf
required:
- file_id

statements_out:
type: object
additionalProperties: False
properties:
id:
allOf:
- $ref: './fields.yaml#/id_string'
example: stmtwownwrng
org_id:
$ref: './fields.yaml#/org_id'
created_at:
$ref: './fields.yaml#/created_at'
updated_at:
$ref: './fields.yaml#/updated_at'
file_name:
type: string
description: |
Specifies the name of file uploaded by the user.
example: amex.csv
file_size:
type: string
description: |
Specifies the size of file uploaded by the user.
example: 21KB
Copy link
Contributor

Choose a reason for hiding this comment

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

Will have to mention what is the default size, is it bytes (or) MB (or) KB.

Also, it is a number so it cannot be 21KB, it just has to be 21.

Is this expected or do we need to take this as text @Kulsekar4 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Number is only expected here sir, will remove the KB

no_of_debit:
type: integer
description: |
Number of debit transactions in the document uploaded by the user.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use statement everywhere instead of using document pls ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay sir

example: 3
no_of_credit:
type: integer
description: |
Number of credit transactions in the document uploaded by the user.
example: 3
no_of_transactions:
type: integer
description: |
Number of transactions in the document uploaded by the user.
example: 3
Copy link
Contributor

Choose a reason for hiding this comment

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

example: 6

Because above examples of credit and debit are 3 each

statement_columns:
type: array
items:
type: string
description: >
This specifies headers of the statement uploaded by the user.
example:
- account_number
- amount
statement_mapping_id:
type: string
description: |
Refers to the mapping used in statement.
example: stmpdfddfd
start_date:
$ref: './fields.yaml#/timestamptz_utc'
description: |
Start date of the statement period
end_date:
$ref: './fields.yaml#/timestamptz_utc'
description: |
End date of the statement period
has_statement_duplicate:

Choose a reason for hiding this comment

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

rename to is_statement_duplicate

Choose a reason for hiding this comment

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

has_duplicate_statements

type: boolean
description: |
Determines whether the statement is duplicate or not.
Copy link

Choose a reason for hiding this comment

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

Determines whether the statement is completely duplicate or not.

duplicate_statement_ids:
type: array
items:
$ref: './fields.yaml#/id_string'
example:
- stmtge49ielgel
modernwarfareuplink marked this conversation as resolved.
Show resolved Hide resolved
has_statement_line_items_duplicate:

Choose a reason for hiding this comment

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

rename to has_duplicate_statement_line_items

type: boolean
description: |
Determines whether the transaction inside the statement is duplicate or not.
Copy link

Choose a reason for hiding this comment

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

instead of Determines can use
indicates whether there are any line items in this statement are duplicates.

duplicate_statement_line_items:
type: array
items:
type: object
properties:
ids:
type: array
items:
$ref: './fields.yaml#/id_string'
example:
- stlige49ielgel
description:
Ids of the current statement line items which are duplicates
duplicate_line_item_statement_id:
type: string
description: |
Id of the existing duplicate statement
example:
- stmpge49ielgel


required:
modernwarfareuplink marked this conversation as resolved.
Show resolved Hide resolved
- id
- org_id
- created_at
- updated_at
- file_name
- file_size
- no_of_debit
- no_of_credit
- no_of_transactions
- statement_mapping_id
- statement_columns
- start_date
- end_date
- has_statement_duplicate
- duplicate_statement_ids
- has_statement_line_items_duplicate
- duplicate_statement_line_items