Skip to content

Commit 3ce898c

Browse files
authored
fix(docs): Use a shared type for service usage balances values DEV-954 (#6233)
### 📣 Summary Use an unified type for the service usage balance data across organization service usage responses and service usage responses. ### 👀 Preview steps 1. Access to the kpi bash shell 2. Run the script `./scripts/generate_api.sh` 3. Review that Orval generated the file `jsapp/js/api/models/serviceUsageBalanceData.ts` and it is imported in `jsapp/js/api/models/organizationServiceUsageResponseBalances.ts` and ` jsapp/js/api/models/serviceUsageResponseBalances.ts`
1 parent 17b390e commit 3ce898c

15 files changed

+105
-325
lines changed
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import type { OrganizationServiceUsageResponseBalancesAsrSeconds } from './organizationServiceUsageResponseBalancesAsrSeconds'
2-
import type { OrganizationServiceUsageResponseBalancesMtCharacters } from './organizationServiceUsageResponseBalancesMtCharacters'
3-
import type { OrganizationServiceUsageResponseBalancesStorageBytes } from './organizationServiceUsageResponseBalancesStorageBytes'
41
/**
52
* Generated by orval v7.10.0 🍺
63
* Do not edit manually.
74
* KoboToolbox API
85
* Powerful and intuitive data collection tools to make an impact
96
* OpenAPI spec version: 2.0.0 (api_v2)
107
*/
11-
import type { OrganizationServiceUsageResponseBalancesSubmission } from './organizationServiceUsageResponseBalancesSubmission'
8+
import type { ServiceUsageBalanceData } from './serviceUsageBalanceData'
129

1310
export type OrganizationServiceUsageResponseBalances = {
14-
submission?: OrganizationServiceUsageResponseBalancesSubmission
15-
storage_bytes?: OrganizationServiceUsageResponseBalancesStorageBytes
16-
asr_seconds?: OrganizationServiceUsageResponseBalancesAsrSeconds
17-
mt_characters?: OrganizationServiceUsageResponseBalancesMtCharacters
11+
submission?: ServiceUsageBalanceData
12+
storage_bytes?: ServiceUsageBalanceData
13+
asr_seconds?: ServiceUsageBalanceData
14+
mt_characters?: ServiceUsageBalanceData
1815
}

jsapp/js/api/models/organizationServiceUsageResponseBalancesAsrSeconds.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsapp/js/api/models/organizationServiceUsageResponseBalancesMtCharacters.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsapp/js/api/models/organizationServiceUsageResponseBalancesStorageBytes.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsapp/js/api/models/organizationServiceUsageResponseBalancesSubmission.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsapp/js/api/models/serviceUsageResponseBalancesAsrSeconds.ts renamed to jsapp/js/api/models/serviceUsageBalanceData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* OpenAPI spec version: 2.0.0 (api_v2)
77
*/
88

9-
export type ServiceUsageResponseBalancesAsrSeconds = {
9+
export interface ServiceUsageBalanceData {
1010
effective_limit?: number
1111
balance_value?: number
1212
balance_percent?: number
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import type { ServiceUsageResponseBalancesAsrSeconds } from './serviceUsageResponseBalancesAsrSeconds'
2-
import type { ServiceUsageResponseBalancesMtCharacters } from './serviceUsageResponseBalancesMtCharacters'
3-
import type { ServiceUsageResponseBalancesStorageBytes } from './serviceUsageResponseBalancesStorageBytes'
41
/**
52
* Generated by orval v7.10.0 🍺
63
* Do not edit manually.
74
* KoboToolbox API
85
* Powerful and intuitive data collection tools to make an impact
96
* OpenAPI spec version: 2.0.0 (api_v2)
107
*/
11-
import type { ServiceUsageResponseBalancesSubmission } from './serviceUsageResponseBalancesSubmission'
8+
import type { ServiceUsageBalanceData } from './serviceUsageBalanceData'
129

1310
export type ServiceUsageResponseBalances = {
14-
submission?: ServiceUsageResponseBalancesSubmission
15-
storage_bytes?: ServiceUsageResponseBalancesStorageBytes
16-
asr_seconds?: ServiceUsageResponseBalancesAsrSeconds
17-
mt_characters?: ServiceUsageResponseBalancesMtCharacters
11+
submission?: ServiceUsageBalanceData
12+
storage_bytes?: ServiceUsageBalanceData
13+
asr_seconds?: ServiceUsageBalanceData
14+
mt_characters?: ServiceUsageBalanceData
1815
}

jsapp/js/api/models/serviceUsageResponseBalancesMtCharacters.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsapp/js/api/models/serviceUsageResponseBalancesStorageBytes.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsapp/js/api/models/serviceUsageResponseBalancesSubmission.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)