Skip to content

Commit

Permalink
feat: Added restricted_spender_user_ids field in GET /<admin/approver…
Browse files Browse the repository at this point in the history
…>/categories endpoint
  • Loading branch information
satyamyesj committed Aug 30, 2023
1 parent b8b4876 commit d991da1
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/admin/paths/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ get:
data:
type: array
items:
$ref: ../../components/schemas/category.yaml#/category_out
$ref: ../../components/schemas/category.yaml#/admin_approver_category_out
'400':
description: Bad request
content:
Expand Down
2 changes: 1 addition & 1 deletion src/approver/paths/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ get:
data:
type: array
items:
$ref: ../../components/schemas/category.yaml#/category_out
$ref: ../../components/schemas/category.yaml#/admin_approver_category_out
'400':
description: Bad request
content:
Expand Down
67 changes: 67 additions & 0 deletions src/components/schemas/category.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@ category_in:
example: [2222, 1221]
description: |
List of project ids for which this category can be used. If project_ids is null, then this category can be used for any project
restricted_spender_user_ids:
type: array
nullable: True
items:
type: string
nullable: False
maxLength: 15
description: |
This id is provided by Fyle to identify an object.
example: 'uswoirwlwwg'
example: [ 'uswoirwlwwg', 'uswlgwkgw42' ]
description: |
- List of IDs of users who can access this category. Default value is `[]`.
- `null` value indicates that all users in the org can access this category.
- `[]` value indicates that no users in the org can access this category.
system_category_out:
type: object
Expand All @@ -130,3 +145,55 @@ system_category_out:
maxLength: 255
example: Engine
description: Represents the name of the system category.

admin_approver_category_out:
type: object
additionalProperties: False
properties:
id:
$ref: './fields.yaml#/id_integer'
org_id:
$ref: ./fields.yaml#/org_id
created_at:
$ref: ./fields.yaml#/created_at
updated_at:
$ref: ./fields.yaml#/updated_at
name:
type: string
maxLength: 255
example: Engine
description: Represents the name of the category.
sub_category:
nullable: true
type: string
maxLength: 255
example: Turbo charged
description: Represents the name of the sub_category.
is_enabled:
$ref: ./fields.yaml#/is_enabled
display_name:
type: string
maxLength: 255
example: Engine / Turbo charged
description: >
This is a combination of name and sub_category separated by a / and
spaces.
In case if no sub_category is present it is same as name of the category.
system_category:
nullable: True
type: string
maxLength: 255
example: Others
description: Represents the name of the system_category.
code:
$ref: ./fields.yaml#/code
restricted_project_ids:
type: array
nullable: True
items:
$ref: './fields.yaml#/id_integer'
example: [2222, 1221]
description: |
List of project ids for which this category can be used. If project_ids is null, then this category can be used for any project.
restricted_spender_user_ids:
$ref: './fields.yaml#/restricted_spender_user_ids'

0 comments on commit d991da1

Please sign in to comment.