From 4ee3241aa51d9ea05cf21d234cf7bceeff028c6d Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Thu, 28 Apr 2022 15:38:45 +0530 Subject: [PATCH 1/8] initial commit --- reference/admin.yaml | 138 ++++++++++++++++++ src/admin/openapi.yaml | 5 + src/admin/paths/admin@statement_mappings.yaml | 35 +++++ .../schemas/statement_mappings.yaml | 87 +++++++++++ 4 files changed, 265 insertions(+) create mode 100644 src/admin/paths/admin@statement_mappings.yaml create mode 100644 src/components/schemas/statement_mappings.yaml diff --git a/reference/admin.yaml b/reference/admin.yaml index 3901a792d..a4e2f5c1b 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6463,6 +6463,101 @@ components: description: > Determines whether this organization has been verified by a verifier. + statement_mappings_out: + type: object + additionalProperties: false + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: stmpwownwrng + org_id: + $ref: '#/components/schemas/org_id' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + statement_bank_name: + type: string + description: | + Specifies the bank name of the statement. + example: American Express + statement_is_debit_positive: + type: boolean + description: > + Specifies the representation of the the amount in the statement, if + true then the amount represented by + + negative sign are credits, and if false then the amount represented + by negative sign are debits. + example: true + mapping_transaction_date: + type: string + description: > + Specifies the header name of the transaction date column in the + statement. + example: spent date + mapping_vendor: + type: string + description: | + Specifies the header name of the vendor column in the statement. + example: merchant + mapping_transaction_id: + type: string + description: > + Specifies the header name of the transaction id / unique id column + in the statement. + example: reference number + mapping_amount: + 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 + mapping_card_number: + type: string + description: > + Specifies the header name of the card number column in the + statement. + example: account number + mapping_foreign_amount: + type: string + description: > + Specifies the header name of the foreign amount column in the + statement. + example: foreign amount + mapping_foreign_currency: + type: string + description: > + Specifies the header name of the foreign currency column in the + statement. + example: foreign currency + mapping_description: + type: string + description: > + Specifies the header name of the description column in the + statement. + example: description + required: + - id + - org_id + - created_at + - updated_at + - statement_bank_name + - statement_is_debit_positive + - mapping_transaction_date + - mapping_transaction_id + - mapping_amount + - name + - mapping_card_number + - mapping_vendor + - mapping_foreign_amount + - mapping_foreign_currency + - mapping_description parameters: created_at: in: query @@ -6588,6 +6683,10 @@ tags: - name: Organisations description: | These APIs gives you access to manage organisations. + - name: Statement mappings + description: > + These APIs gives you access to manage statement mappings which is used for + statement uploads. paths: /admin/projects: get: @@ -9752,3 +9851,42 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /admin/statement_mappings: + get: + tags: + - Statement mappings + summary: List of statement mappings + 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_list + parameters: + - $ref: '#/components/parameters/created_at' + - $ref: '#/components/parameters/updated_at' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/statement_mappings_out' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' diff --git a/src/admin/openapi.yaml b/src/admin/openapi.yaml index fded92847..6734a423c 100644 --- a/src/admin/openapi.yaml +++ b/src/admin/openapi.yaml @@ -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 manage statement mappings which is used for statement uploads. # - name: Suggestions # description: | # This API gives you access to Expense/Card Transactions Suggestions. @@ -234,3 +237,5 @@ paths: $ref: paths/admin@budget_usages.yaml /admin/orgs: $ref: paths/admin@orgs.yaml + /admin/statement_mappings: + $ref: paths/admin@statement_mappings.yaml \ No newline at end of file diff --git a/src/admin/paths/admin@statement_mappings.yaml b/src/admin/paths/admin@statement_mappings.yaml new file mode 100644 index 000000000..3462e7aa6 --- /dev/null +++ b/src/admin/paths/admin@statement_mappings.yaml @@ -0,0 +1,35 @@ +get: + tags: + - Statement mappings + summary: List of statement mappings + 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_list + parameters: + - $ref: '../../components/parameters/created_at.yaml' + - $ref: '../../components/parameters/updated_at.yaml' + - $ref: '../../components/parameters/order.yaml' + - $ref: '../../components/parameters/offset.yaml' + - $ref: '../../components/parameters/limit.yaml' + 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: array + items: + $ref: '../../components/schemas/statement_mappings.yaml#/statement_mappings_out' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' \ No newline at end of file diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml new file mode 100644 index 000000000..b60b85503 --- /dev/null +++ b/src/components/schemas/statement_mappings.yaml @@ -0,0 +1,87 @@ +statement_mappings_out: + type: object + additionalProperties: False + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: stmpwownwrng + org_id: + $ref: './fields.yaml#/org_id' + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' + statement_bank_name: + type: string + description: | + Specifies the bank name of the statement. + example: American Express + statement_is_debit_positive: + type: boolean + description: | + Specifies the representation of the the amount in the statement, if true then the amount represented by + negative sign are credits, and if false then the amount represented by negative sign are debits. + example: true + mapping_transaction_date: + type: string + description: | + Specifies the header name of the transaction date column in the statement. + example: spent date + mapping_vendor: + type: string + description: | + Specifies the header name of the vendor column in the statement. + example: merchant + mapping_transaction_id: + type: string + description: | + Specifies the header name of the transaction id / unique id column in the statement. + example: reference number + mapping_amount: + 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 + mapping_card_number: + type: string + description: | + Specifies the header name of the card number column in the statement. + example: account number + mapping_foreign_amount: + type: string + description: | + Specifies the header name of the foreign amount column in the statement. + example: foreign amount + mapping_foreign_currency: + type: string + description: | + Specifies the header name of the foreign currency column in the statement. + example: foreign currency + mapping_description: + type: string + description: | + Specifies the header name of the description column in the statement. + example: description + + required: + - id + - org_id + - created_at + - updated_at + - statement_bank_name + - statement_is_debit_positive + - mapping_transaction_date + - mapping_transaction_id + - mapping_amount + - name + - mapping_card_number + - mapping_vendor + - mapping_foreign_amount + - mapping_foreign_currency + - mapping_description \ No newline at end of file From 65566761911e960b157aa28550c712a6885781d5 Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Thu, 5 May 2022 19:16:44 +0530 Subject: [PATCH 2/8] minor change --- reference/admin.yaml | 4 ++++ src/components/schemas/statement_mappings.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reference/admin.yaml b/reference/admin.yaml index a4e2f5c1b..cac108c82 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6507,6 +6507,7 @@ components: description: > Specifies the header name of the transaction id / unique id column in the statement. + nullable: true example: reference number mapping_amount: type: string @@ -6529,18 +6530,21 @@ components: description: > Specifies the header name of the foreign amount column in the statement. + nullable: true example: foreign amount mapping_foreign_currency: type: string description: > Specifies the header name of the foreign currency column in the statement. + nullable: true example: foreign currency mapping_description: type: string description: > Specifies the header name of the description column in the statement. + nullable: true example: description required: - id diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index b60b85503..4ff34ddda 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -37,6 +37,7 @@ statement_mappings_out: type: string description: | Specifies the header name of the transaction id / unique id column in the statement. + nullable: true example: reference number mapping_amount: type: string @@ -57,16 +58,19 @@ statement_mappings_out: type: string description: | Specifies the header name of the foreign amount column in the statement. + nullable: true example: foreign amount mapping_foreign_currency: type: string description: | Specifies the header name of the foreign currency column in the statement. + nullable: true example: foreign currency mapping_description: type: string description: | Specifies the header name of the description column in the statement. + nullable: true example: description required: From 8d28905f977b9488d65e279a1d49536f629f4c07 Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Mon, 9 May 2022 18:19:00 +0530 Subject: [PATCH 3/8] minor change --- reference/admin.yaml | 7 +++++++ src/components/schemas/statement_mappings.yaml | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index fd7f503f6..54c82924e 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6622,6 +6622,12 @@ components: statement. nullable: true example: description + is_auto_created: + type: boolean + description: | + Specifies if the statement mapping got auto created or not. + nullable: false + example: description required: - id - org_id @@ -6638,6 +6644,7 @@ components: - mapping_foreign_amount - mapping_foreign_currency - mapping_description + - is_auto_created parameters: created_at: in: query diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index 4ff34ddda..e8354b712 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -72,7 +72,12 @@ statement_mappings_out: Specifies the header name of the description column in the statement. nullable: true example: description - + is_auto_created: + type: boolean + description: | + Specifies if the statement mapping got auto created or not. + nullable: false + example: description required: - id - org_id @@ -88,4 +93,5 @@ statement_mappings_out: - mapping_vendor - mapping_foreign_amount - mapping_foreign_currency - - mapping_description \ No newline at end of file + - mapping_description + - is_auto_created \ No newline at end of file From c45e5fb034fed3c7e9a3e9d259628c80d1caa2af Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Tue, 24 May 2022 22:41:22 +0530 Subject: [PATCH 4/8] resolved comment --- reference/admin.yaml | 36 +++++++++---------- .../schemas/statement_mappings.yaml | 36 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 54c82924e..8ec81dd32 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6553,7 +6553,7 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - statement_bank_name: + bank_name: type: string description: | Specifies the bank name of the statement. @@ -6567,25 +6567,25 @@ components: negative sign are credits, and if false then the amount represented by negative sign are debits. example: true - mapping_transaction_date: + transaction_date_column: type: string description: > Specifies the header name of the transaction date column in the statement. example: spent date - mapping_vendor: + vendor_column: type: string description: | Specifies the header name of the vendor column in the statement. example: merchant - mapping_transaction_id: + 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 - mapping_amount: + amount_column: type: string description: | Specifies the header name of the amount column in the statement. @@ -6595,27 +6595,27 @@ components: description: | Specifies the mapping name. example: amex_mapping - mapping_card_number: + card_number_column: type: string description: > Specifies the header name of the card number column in the statement. example: account number - mapping_foreign_amount: + foreign_amount_column: type: string description: > Specifies the header name of the foreign amount column in the statement. nullable: true example: foreign amount - mapping_foreign_currency: + foreign_currency_column: type: string description: > Specifies the header name of the foreign currency column in the statement. nullable: true example: foreign currency - mapping_description: + description_column: type: string description: > Specifies the header name of the description column in the @@ -6633,17 +6633,17 @@ components: - org_id - created_at - updated_at - - statement_bank_name + - bank_name - statement_is_debit_positive - - mapping_transaction_date - - mapping_transaction_id - - mapping_amount + - transaction_date_column + - transaction_id_column + - amount_column - name - - mapping_card_number - - mapping_vendor - - mapping_foreign_amount - - mapping_foreign_currency - - mapping_description + - card_number_column + - vendor_column + - foreign_amount_column + - foreign_currency_column + - description_column - is_auto_created parameters: created_at: diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index e8354b712..13f8bebfe 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -12,7 +12,7 @@ statement_mappings_out: $ref: './fields.yaml#/created_at' updated_at: $ref: './fields.yaml#/updated_at' - statement_bank_name: + bank_name: type: string description: | Specifies the bank name of the statement. @@ -23,23 +23,23 @@ statement_mappings_out: Specifies the representation of the the amount in the statement, if true then the amount represented by negative sign are credits, and if false then the amount represented by negative sign are debits. example: true - mapping_transaction_date: + transaction_date_column: type: string description: | Specifies the header name of the transaction date column in the statement. example: spent date - mapping_vendor: + vendor_column: type: string description: | Specifies the header name of the vendor column in the statement. example: merchant - mapping_transaction_id: + 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 - mapping_amount: + amount_column: type: string description: | Specifies the header name of the amount column in the statement. @@ -49,24 +49,24 @@ statement_mappings_out: description: | Specifies the mapping name. example: amex_mapping - mapping_card_number: + card_number_column: type: string description: | Specifies the header name of the card number column in the statement. example: account number - mapping_foreign_amount: + foreign_amount_column: type: string description: | Specifies the header name of the foreign amount column in the statement. nullable: true example: foreign amount - mapping_foreign_currency: + foreign_currency_column: type: string description: | Specifies the header name of the foreign currency column in the statement. nullable: true example: foreign currency - mapping_description: + description_column: type: string description: | Specifies the header name of the description column in the statement. @@ -83,15 +83,15 @@ statement_mappings_out: - org_id - created_at - updated_at - - statement_bank_name + - bank_name - statement_is_debit_positive - - mapping_transaction_date - - mapping_transaction_id - - mapping_amount + - transaction_date_column + - transaction_id_column + - amount_column - name - - mapping_card_number - - mapping_vendor - - mapping_foreign_amount - - mapping_foreign_currency - - mapping_description + - card_number_column + - vendor_column + - foreign_amount_column + - foreign_currency_column + - description_column - is_auto_created \ No newline at end of file From cb3aa16b0db35002360c7ec32fcdb64852421a81 Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Tue, 24 May 2022 23:12:32 +0530 Subject: [PATCH 5/8] resolved minor issue --- reference/admin.yaml | 4 ++-- src/components/schemas/statement_mappings.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 8ec81dd32..bbe8a108d 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6558,7 +6558,7 @@ components: description: | Specifies the bank name of the statement. example: American Express - statement_is_debit_positive: + is_debit_positive: type: boolean description: > Specifies the representation of the the amount in the statement, if @@ -6634,7 +6634,7 @@ components: - created_at - updated_at - bank_name - - statement_is_debit_positive + - is_debit_positive - transaction_date_column - transaction_id_column - amount_column diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index 13f8bebfe..c6a10334f 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -17,7 +17,7 @@ statement_mappings_out: description: | Specifies the bank name of the statement. example: American Express - statement_is_debit_positive: + is_debit_positive: type: boolean description: | Specifies the representation of the the amount in the statement, if true then the amount represented by @@ -84,7 +84,7 @@ statement_mappings_out: - created_at - updated_at - bank_name - - statement_is_debit_positive + - is_debit_positive - transaction_date_column - transaction_id_column - amount_column From 476ed640c05d848b1749a2b46a4282e4bdfcf709 Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Tue, 7 Jun 2022 22:19:36 +0530 Subject: [PATCH 6/8] resolved self comment --- reference/admin.yaml | 1 - src/components/schemas/statement_mappings.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index bbe8a108d..9b11a38c4 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6627,7 +6627,6 @@ components: description: | Specifies if the statement mapping got auto created or not. nullable: false - example: description required: - id - org_id diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index c6a10334f..58eb68c4b 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -77,7 +77,6 @@ statement_mappings_out: description: | Specifies if the statement mapping got auto created or not. nullable: false - example: description required: - id - org_id From 4b58237dc158dc6346541507f66f5101e1faa4b4 Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Sun, 12 Jun 2022 17:25:38 +0530 Subject: [PATCH 7/8] resolved comment --- reference/admin.yaml | 6 ------ src/components/schemas/statement_mappings.yaml | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 9b11a38c4..5064d1572 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6622,11 +6622,6 @@ components: statement. nullable: true example: description - is_auto_created: - type: boolean - description: | - Specifies if the statement mapping got auto created or not. - nullable: false required: - id - org_id @@ -6643,7 +6638,6 @@ components: - foreign_amount_column - foreign_currency_column - description_column - - is_auto_created parameters: created_at: in: query diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index 58eb68c4b..58fab1429 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -72,11 +72,6 @@ statement_mappings_out: Specifies the header name of the description column in the statement. nullable: true example: description - is_auto_created: - type: boolean - description: | - Specifies if the statement mapping got auto created or not. - nullable: false required: - id - org_id @@ -92,5 +87,4 @@ statement_mappings_out: - vendor_column - foreign_amount_column - foreign_currency_column - - description_column - - is_auto_created \ No newline at end of file + - description_column \ No newline at end of file From 2ee63fe63b280a5287a82d5a71a00ebcc6ba687a Mon Sep 17 00:00:00 2001 From: Kulasekar Date: Tue, 14 Jun 2022 12:11:02 +0530 Subject: [PATCH 8/8] resolved comment --- reference/admin.yaml | 14 +++++++++++++- src/admin/paths/admin@statement_mappings.yaml | 6 ++++++ src/components/schemas/statement_mappings.yaml | 10 ++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index fc09ffb0a..f6362511e 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -6890,7 +6890,7 @@ components: Specifies the representation of the the amount in the statement, if true then the amount represented by - negative sign are credits, and if false then the amount represented + positive sign are debits, and if false then the amount represented by negative sign are debits. example: true transaction_date_column: @@ -6948,6 +6948,11 @@ components: 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 - org_id @@ -6964,6 +6969,7 @@ components: - foreign_amount_column - foreign_currency_column - description_column + - is_auto_created parameters: created_at: in: query @@ -10680,6 +10686,12 @@ paths: type: array items: $ref: '#/components/schemas/statement_mappings_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' '401': description: Unauthorized request content: diff --git a/src/admin/paths/admin@statement_mappings.yaml b/src/admin/paths/admin@statement_mappings.yaml index 3462e7aa6..8fa4605fa 100644 --- a/src/admin/paths/admin@statement_mappings.yaml +++ b/src/admin/paths/admin@statement_mappings.yaml @@ -27,6 +27,12 @@ get: type: array items: $ref: '../../components/schemas/statement_mappings.yaml#/statement_mappings_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml '401': description: Unauthorized request content: diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index 58fab1429..1d8d967ce 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -21,7 +21,7 @@ statement_mappings_out: type: boolean description: | Specifies the representation of the the amount in the statement, if true then the amount represented by - negative sign are credits, and if false then the amount represented by negative sign are debits. + positive sign are debits, and if false then the amount represented by negative sign are debits. example: true transaction_date_column: type: string @@ -72,6 +72,11 @@ statement_mappings_out: 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 - org_id @@ -87,4 +92,5 @@ statement_mappings_out: - vendor_column - foreign_amount_column - foreign_currency_column - - description_column \ No newline at end of file + - description_column + - is_auto_created \ No newline at end of file