From 1b8c217b68e5adf79e60fc90986a053ffb7f976e Mon Sep 17 00:00:00 2001 From: Prakash Yogi <48615112+generalpy101@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:34:24 +0530 Subject: [PATCH] Added spec for dependent fields in expense rules (#546) --- reference/admin.yaml | 55 +++++++++++++++++++++++ reference/approver.yaml | 48 ++++++++++++++++++++ reference/spender.yaml | 48 ++++++++++++++++++++ src/components/schemas/expense_rules.yaml | 14 ++++++ src/components/schemas/fields.yaml | 40 +++++++++++++++++ 5 files changed, 205 insertions(+) diff --git a/reference/admin.yaml b/reference/admin.yaml index 2b3f34815..d1a248e4e 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -3333,6 +3333,47 @@ components: nullable: true example: true description: This field marks whether a given expense is billable or not. + dependent_expense_fields: + type: object + description: | + Dependent expense fields details + properties: + parent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the parent expense field. + example: 123 + dependent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the dependent expense field. + example: 123 + dependent_expense_field_value_id: + type: integer + description: | + This id provided by Fyle to identify dependent field value. + example: 123 + name: + type: string + description: | + This represents the name of the dependent expense field. + example: cf1 + value: + nullable: true + oneOf: + - type: string + example: string1 + - type: boolean + example: true + - type: integer + example: 123 + - $ref: '#/components/schemas/location' + - type: array + items: + type: string + example: + - v1 + - v2 expense_rule_data_in: type: object nullable: true @@ -3371,6 +3412,13 @@ components: Custom fields items: $ref: '#/components/schemas/custom_field' + dependent_fields: + type: array + nullable: true + description: | + Dependent expense fields + items: + $ref: '#/components/schemas/dependent_expense_fields' tax_group: type: object nullable: true @@ -12842,6 +12890,13 @@ components: Custom fields items: $ref: '#/components/schemas/custom_field' + dependent_fields: + type: array + nullable: true + description: | + Dependent expense fields + items: + $ref: '#/components/schemas/dependent_expense_fields' expense_rule_out: type: object additionalProperties: false diff --git a/reference/approver.yaml b/reference/approver.yaml index b20302c48..134d63b61 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -1574,6 +1574,47 @@ components: nullable: true example: true description: This field marks whether a given expense is billable or not. + dependent_expense_fields: + type: object + description: | + Dependent expense fields details + properties: + parent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the parent expense field. + example: 123 + dependent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the dependent expense field. + example: 123 + dependent_expense_field_value_id: + type: integer + description: | + This id provided by Fyle to identify dependent field value. + example: 123 + name: + type: string + description: | + This represents the name of the dependent expense field. + example: cf1 + value: + nullable: true + oneOf: + - type: string + example: string1 + - type: boolean + example: true + - type: integer + example: 123 + - $ref: '#/components/schemas/location' + - type: array + items: + type: string + example: + - v1 + - v2 expense_rule_data_in: type: object nullable: true @@ -1612,6 +1653,13 @@ components: Custom fields items: $ref: '#/components/schemas/custom_field' + dependent_fields: + type: array + nullable: true + description: | + Dependent expense fields + items: + $ref: '#/components/schemas/dependent_expense_fields' tax_group: type: object nullable: true diff --git a/reference/spender.yaml b/reference/spender.yaml index 3ae057006..7865e1967 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -1414,6 +1414,47 @@ components: nullable: true example: true description: This field marks whether a given expense is billable or not. + dependent_expense_fields: + type: object + description: | + Dependent expense fields details + properties: + parent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the parent expense field. + example: 123 + dependent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the dependent expense field. + example: 123 + dependent_expense_field_value_id: + type: integer + description: | + This id provided by Fyle to identify dependent field value. + example: 123 + name: + type: string + description: | + This represents the name of the dependent expense field. + example: cf1 + value: + nullable: true + oneOf: + - type: string + example: string1 + - type: boolean + example: true + - type: integer + example: 123 + - $ref: '#/components/schemas/location' + - type: array + items: + type: string + example: + - v1 + - v2 expense_rule_data_in: type: object nullable: true @@ -1452,6 +1493,13 @@ components: Custom fields items: $ref: '#/components/schemas/custom_field' + dependent_fields: + type: array + nullable: true + description: | + Dependent expense fields + items: + $ref: '#/components/schemas/dependent_expense_fields' tax_group: type: object nullable: true diff --git a/src/components/schemas/expense_rules.yaml b/src/components/schemas/expense_rules.yaml index f16ec6fab..c78316157 100644 --- a/src/components/schemas/expense_rules.yaml +++ b/src/components/schemas/expense_rules.yaml @@ -87,6 +87,13 @@ expense_rule_data_in: Custom fields items: $ref: './fields.yaml#/custom_field' + dependent_fields: + type: array + nullable: true + description: | + Dependent expense fields + items: + $ref: './fields.yaml#/dependent_expense_fields' expense_rule_data_out: type: object @@ -132,6 +139,13 @@ expense_rule_data_out: Custom fields items: $ref: './fields.yaml#/custom_field' + dependent_fields: + type: array + nullable: true + description: | + Dependent expense fields + items: + $ref: './fields.yaml#/dependent_expense_fields' expense_rule_in: diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index 453a47fc1..20c781ffa 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -703,6 +703,46 @@ custom_fields: items: $ref: '#/custom_field' +dependent_expense_fields: + type: object + description: | + Dependent expense fields details + properties: + parent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the parent expense field. + example: 123 + dependent_expense_field_id: + type: integer + description: | + This id provided by Fyle to identify the dependent expense field. + example: 123 + dependent_expense_field_value_id: + type: integer + description: | + This id provided by Fyle to identify dependent field value. + example: 123 + name: + type: string + description: | + This represents the name of the dependent expense field. + example: 'cf1' + value: + nullable: true + oneOf: + - type: string + example: string1 + - type: boolean + example: True + - type: integer + example: 123 + - $ref: '#/location' + - type: array + items: + type: string + example: [ 'v1', 'v2' ] + expense_custom_field: type: object description: |