Skip to content

Commit a32e5cd

Browse files
authored
feat(userReports): remove done_storage_limits_check from API response DEV-1268 (#6461)
### 📣 Summary Remove `extra_details.data.done_storage_limits_check` from `/api/v2/user-reports/` response. This field is useless for the report.
1 parent 88b676f commit a32e5cd

File tree

7 files changed

+6
-14
lines changed

7 files changed

+6
-14
lines changed

jsapp/js/api/models/userReportsListResponseExtraDetailsData.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ export type UserReportsListResponseExtraDetailsData = {
1919
organization_type?: string
2020
organization_website?: string
2121
newsletter_subscription?: boolean
22-
done_storage_limits_check?: boolean
2322
}

jsapp/js/api/react-query/server-logs-superusers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,6 @@ Supports exact matching and range operators (e.g., gte, lte)
955955
- sso_is_active
956956
- accepted_tos
957957
- extra_details__data__newsletter_subscription
958-
- extra_details__data__done_storage_limits_check
959958
- service_usage__balances__*metric*__exceeded (metric: submission, asr_seconds, mt_characters, storage_bytes)
960959
- account_restricted
961960

kobo/apps/user_reports/migrations/0002_create_user_reports_mv.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@
146146
ELSE NULL
147147
END AS organization,
148148
jsonb_build_object(
149-
'data', ued.data::jsonb,
149+
'data',
150+
CASE
151+
WHEN ued.data IS NULL THEN NULL
152+
ELSE (ued.data::jsonb - 'done_storage_limits_check')
153+
END,
150154
'date_removed',
151155
CASE
152156
WHEN ued.date_removed IS NOT NULL

kpi/docs/api/v2/user_reports/list.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ Supports exact matching and range operators (e.g., gte, lte)
7272
- sso_is_active
7373
- accepted_tos
7474
- extra_details__data__newsletter_subscription
75-
- extra_details__data__done_storage_limits_check
7675
- service_usage__balances__*metric*__exceeded (metric: submission, asr_seconds, mt_characters, storage_bytes)
7776
- account_restricted
7877

kpi/schema_extensions/v2/user_reports/extensions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ def map_serializer_field(self, auto_schema, direction):
2828
'organization_type': GENERIC_STRING_SCHEMA,
2929
'organization_website': GENERIC_STRING_SCHEMA,
3030
'newsletter_subscription': build_basic_type(OpenApiTypes.BOOL),
31-
'done_storage_limits_check': build_basic_type(
32-
OpenApiTypes.BOOL
33-
),
3431
}
3532
),
3633
'date_removed': build_basic_type(OpenApiTypes.DATETIME),

static/openapi/schema_v2.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11647,7 +11647,7 @@
1164711647
"/api/v2/user-reports/": {
1164811648
"get": {
1164911649
"operationId": "api_v2_user_reports_list",
11650-
"description": "# List user reports\n\n⚠️ _Only available to superusers_\n\n## Filterable fields by string:\n\nSupports partial filtering\n- username\n- first_name\n- last_name\n- email\n- user_uid\n- organization__name\n- organization__role (e.g., admin, member, owner)\n- organization__website\n- extra_details__data__organization_type\n- `extra_details__data__<field>` (other string fields, e.g., name, sector, country...)\n\n## Filterable fields by int:\n\nSupports exact matching and range operators (e.g., gte, lte)\n\n**Total NLP Usage**\n- service_usage__total_nlp_usage__asr_seconds_all_time\n- service_usage__total_nlp_usage__mt_characters_all_time\n- service_usage__total_nlp_usage__asr_seconds_current_period\n- service_usage__total_nlp_usage__mt_characters_current_period\n\n**Total Storage/Submissions**\n- service_usage__total_storage_bytes\n- service_usage__total_submission_count__all_time\n- service_usage__total_submission_count__current_period\n\n**Service Usage Balances**\n\nPrefix: `service_usage__balances__<metric>__<value>`\n\nMetric:\n- submission\n- asr_seconds\n- mt_characters\n- storage_bytes\n\nValue:\n- balance_value\n- balance_percent\n- effective_limit\n\nEx: `service_usage__balances__submission__balance_value`\n\n**Asset Count**\n- asset_count\n- deployed_asset_count\n\n## Filterable fields by date:\nSupports exact matching and range operators (e.g., gte, lte)\n\n- date_joined\n- last_login\n- extra_details__date_removal_requested\n- extra_details__date_removed\n- extra_details_password_date_changed\n\n## Filterable fields by boolean:\n\n- is_superuser\n- is_staff\n- is_active\n- validated_email\n- extra_details__validated_password\n- mfa_is_active\n- sso_is_active\n- accepted_tos\n- extra_details__data__newsletter_subscription\n- extra_details__data__done_storage_limits_check\n- service_usage__balances__*metric*__exceeded (metric: submission, asr_seconds, mt_characters, storage_bytes)\n- account_restricted\n\n## Filterable fields by list:\n\nSubscription filtering:\n\nHas subscriptions\n\n`?q=subscriptions__0__id__isnull:False`\n\nNo subscriptions\n\n`?q=subscriptions__0__id__isnull:True`\n\nSubscription id\n\n`?q=subscriptions[]__id:sub_1QwPItAR39rDI89stzLJ040p`\n\nActive subscriptions\n\n`?q=subscriptions[]__status:active`\n",
11650+
"description": "# List user reports\n\n⚠️ _Only available to superusers_\n\n## Filterable fields by string:\n\nSupports partial filtering\n- username\n- first_name\n- last_name\n- email\n- user_uid\n- organization__name\n- organization__role (e.g., admin, member, owner)\n- organization__website\n- extra_details__data__organization_type\n- `extra_details__data__<field>` (other string fields, e.g., name, sector, country...)\n\n## Filterable fields by int:\n\nSupports exact matching and range operators (e.g., gte, lte)\n\n**Total NLP Usage**\n- service_usage__total_nlp_usage__asr_seconds_all_time\n- service_usage__total_nlp_usage__mt_characters_all_time\n- service_usage__total_nlp_usage__asr_seconds_current_period\n- service_usage__total_nlp_usage__mt_characters_current_period\n\n**Total Storage/Submissions**\n- service_usage__total_storage_bytes\n- service_usage__total_submission_count__all_time\n- service_usage__total_submission_count__current_period\n\n**Service Usage Balances**\n\nPrefix: `service_usage__balances__<metric>__<value>`\n\nMetric:\n- submission\n- asr_seconds\n- mt_characters\n- storage_bytes\n\nValue:\n- balance_value\n- balance_percent\n- effective_limit\n\nEx: `service_usage__balances__submission__balance_value`\n\n**Asset Count**\n- asset_count\n- deployed_asset_count\n\n## Filterable fields by date:\nSupports exact matching and range operators (e.g., gte, lte)\n\n- date_joined\n- last_login\n- extra_details__date_removal_requested\n- extra_details__date_removed\n- extra_details_password_date_changed\n\n## Filterable fields by boolean:\n\n- is_superuser\n- is_staff\n- is_active\n- validated_email\n- extra_details__validated_password\n- mfa_is_active\n- sso_is_active\n- accepted_tos\n- extra_details__data__newsletter_subscription\n- service_usage__balances__*metric*__exceeded (metric: submission, asr_seconds, mt_characters, storage_bytes)\n- account_restricted\n\n## Filterable fields by list:\n\nSubscription filtering:\n\nHas subscriptions\n\n`?q=subscriptions__0__id__isnull:False`\n\nNo subscriptions\n\n`?q=subscriptions__0__id__isnull:True`\n\nSubscription id\n\n`?q=subscriptions[]__id:sub_1QwPItAR39rDI89stzLJ040p`\n\nActive subscriptions\n\n`?q=subscriptions[]__status:active`\n",
1165111651
"parameters": [
1165211652
{
1165311653
"name": "limit",
@@ -20345,9 +20345,6 @@
2034520345
},
2034620346
"newsletter_subscription": {
2034720347
"type": "boolean"
20348-
},
20349-
"done_storage_limits_check": {
20350-
"type": "boolean"
2035120348
}
2035220349
}
2035320350
},

static/openapi/schema_v2.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8499,7 +8499,6 @@ paths:
84998499
- sso_is_active
85008500
- accepted_tos
85018501
- extra_details__data__newsletter_subscription
8502-
- extra_details__data__done_storage_limits_check
85038502
- service_usage__balances__*metric*__exceeded (metric: submission, asr_seconds, mt_characters, storage_bytes)
85048503
- account_restricted
85058504
@@ -14787,8 +14786,6 @@ components:
1478714786
type: string
1478814787
newsletter_subscription:
1478914788
type: boolean
14790-
done_storage_limits_check:
14791-
type: boolean
1479214789
date_removed:
1479314790
type: string
1479414791
format: date-time

0 commit comments

Comments
 (0)