Skip to content

Commit 0228944

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(oracle-epm-tax-reporting): align block and registration contracts
1 parent 2216c44 commit 0228944

10 files changed

Lines changed: 105 additions & 16 deletions

File tree

apps/docs/content/docs/integrations/oracle_epm_tax_reporting.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ Import an uploaded collection CSV for a year, period, and configured frequency d
526526
| `year` | string | Yes | Collection year member, for example FY26; tenant-specific. |
527527
| `period` | string | Yes | Collection period member, for example Jan; tenant-specific. |
528528
| `frequencyDimensions` | json | No | JSON object of additional collection-interval frequency dimension names and member strings. Preserve case. For template deployment supply all configured dimensions \(up to four\), including Year/Period when applicable. |
529-
| `jobName` | string | No | Exact deployed rule, ruleset, or saved job definition name. Names are case-sensitive. |
529+
| `jobName` | string | No | Optional name for this supplemental job submission, not a deployed Planning job definition. |
530530
| `waitForCompletion` | boolean | No | Wait at most 120 seconds, subject to the execution deadline. Default false. Timeout or local cancellation does not cancel the Oracle job; check its status before resubmitting. |
531531

532532
#### Output
@@ -557,7 +557,7 @@ Deploy Supplemental Data templates for a collection interval. Empty templates de
557557
| `templates` | array | Yes | Template name array. An explicit empty array deploys ALL templates for the interval; use named templates to limit scope. |
558558
| `frequencyDimensions` | json | No | JSON object of additional collection-interval frequency dimension names and member strings. Preserve case. For template deployment supply all configured dimensions \(up to four\), including Year/Period when applicable. |
559559
| `resetWorkflows` | boolean | No | Reset existing form workflows during deployment \(default false\). |
560-
| `jobName` | string | No | Exact deployed rule, ruleset, or saved job definition name. Names are case-sensitive. |
560+
| `jobName` | string | No | Optional name for this supplemental job submission, not a deployed Planning job definition. |
561561
| `waitForCompletion` | boolean | No | Wait at most 120 seconds, subject to the execution deadline. Default false. Timeout or local cancellation does not cancel the Oracle job; check its status before resubmitting. |
562562

563563
#### Output

apps/sim/blocks/blocks/oracle_epm_tax_reporting.ts

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NetSuiteIcon } from '@/components/icons'
22
import type { BlockConfig, BlockMeta } from '@/blocks/types'
33
import { AuthMode, IntegrationType } from '@/blocks/types'
44
import { normalizeFileInput, parseOptionalNumberInput } from '@/blocks/utils'
5-
import type { TaxReportingResponse } from '@/tools/oracle_epm_tax_reporting/types'
5+
import type { TaxReportingBlockResponse } from '@/tools/oracle_epm_tax_reporting/types'
66
import { parseTaxBooleanInput, parseTaxJsonInput } from '@/tools/oracle_epm_tax_reporting/utils'
77

88
const OPERATION_FIELDS: Record<string, readonly string[]> = {
@@ -86,6 +86,7 @@ const OPERATION_FIELDS: Record<string, readonly string[]> = {
8686
'period',
8787
'frequencyDimensions',
8888
'waitForCompletion',
89+
'jobName',
8990
],
9091
oracle_epm_tax_reporting_deploy_form_templates: [
9192
'application',
@@ -94,6 +95,7 @@ const OPERATION_FIELDS: Record<string, readonly string[]> = {
9495
'frequencyDimensions',
9596
'resetWorkflows',
9697
'waitForCompletion',
98+
'jobName',
9799
],
98100
oracle_epm_tax_reporting_import_supplemental_dimension_members: [
99101
'dimension',
@@ -146,7 +148,7 @@ const BOOLEAN_FIELDS = new Set([
146148
'downloadReport',
147149
])
148150

149-
export const OracleEpmTaxReportingBlock: BlockConfig<TaxReportingResponse> = {
151+
export const OracleEpmTaxReportingBlock: BlockConfig<TaxReportingBlockResponse> = {
150152
type: 'oracle_epm_tax_reporting',
151153
name: 'Oracle EPM Tax Reporting',
152154
description:
@@ -1144,6 +1146,20 @@ export const OracleEpmTaxReportingBlock: BlockConfig<TaxReportingResponse> = {
11441146
],
11451147
},
11461148
},
1149+
{
1150+
id: 'submissionName',
1151+
title: 'Submission Name',
1152+
type: 'short-input',
1153+
placeholder: 'Optional name for this supplemental job submission',
1154+
mode: 'advanced',
1155+
condition: {
1156+
field: 'operation',
1157+
value: [
1158+
'oracle_epm_tax_reporting_import_supplemental_collection_data',
1159+
'oracle_epm_tax_reporting_deploy_form_templates',
1160+
],
1161+
},
1162+
},
11471163
{
11481164
id: 'collection',
11491165
title: 'Collection',
@@ -1301,9 +1317,9 @@ export const OracleEpmTaxReportingBlock: BlockConfig<TaxReportingResponse> = {
13011317
title: 'Format',
13021318
type: 'dropdown',
13031319
value: () => '',
1304-
options: (values) => [
1320+
options: (params) => [
13051321
{ id: '', label: 'Oracle default (PDF report / CSV user details)' },
1306-
...(values?.operation === 'oracle_epm_tax_reporting_generate_user_details_report'
1322+
...(params?.values.operation === 'oracle_epm_tax_reporting_generate_user_details_report'
13071323
? ['CSV', 'XLS']
13081324
: ['HTML', 'PDF', 'XLSX', 'CSV']
13091325
).map((id) => ({ id, label: id })),
@@ -1322,8 +1338,8 @@ export const OracleEpmTaxReportingBlock: BlockConfig<TaxReportingResponse> = {
13221338
id: 'module',
13231339
title: 'Module',
13241340
type: 'dropdown',
1325-
options: (values) =>
1326-
(values?.operation === 'oracle_epm_tax_reporting_generate_report'
1341+
options: (params) =>
1342+
(params?.values.operation === 'oracle_epm_tax_reporting_generate_report'
13271343
? ['FCM', 'SDM']
13281344
: ['FCCS', 'SDM']
13291345
).map((id) => ({ id, label: id })),
@@ -1442,7 +1458,10 @@ export const OracleEpmTaxReportingBlock: BlockConfig<TaxReportingResponse> = {
14421458
if (!fields) return {}
14431459
const result: Record<string, unknown> = { oauthCredential: params.oauthCredential }
14441460
for (const key of fields) {
1445-
const value = params[key]
1461+
const supplemental =
1462+
params.operation === 'oracle_epm_tax_reporting_import_supplemental_collection_data' ||
1463+
params.operation === 'oracle_epm_tax_reporting_deploy_form_templates'
1464+
const value = key === 'jobName' && supplemental ? params.submissionName : params[key]
14461465
if (value === undefined || value === null || value === '') continue
14471466
if (JSON_FIELDS.has(key)) result[key] = parseTaxJsonInput(value, key)
14481467
else if (BOOLEAN_FIELDS.has(key)) result[key] = parseTaxBooleanInput(value)

apps/sim/lib/integrations/credential-display.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const EXPECTED_COVERAGE: Record<string, string[]> = {
6868
// NetSuite remains an API-key catalog integration, like Snowflake, while its
6969
// block uses the shared reusable-credential selector.
7070
'netsuite-service-account': [],
71+
'oracle-epm-service-account': [],
7172
'pipedrive-service-account': ['pipedrive'],
7273
'salesforce-service-account': ['salesforce'],
7374
'shopify-service-account': ['shopify'],

apps/sim/lib/oauth/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export type OAuthProvider =
9393
| 'zoho-desk'
9494

9595
export type OAuthService =
96+
| 'oracle_epm_tax_reporting'
9697
| 'google'
9798
| 'google-email'
9899
| 'google-drive'

apps/sim/lib/selectors/manifest.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('selector manifest', () => {
99
const count = (classification: (typeof classifications)[number]) =>
1010
classifications.filter((value) => value === classification).length
1111

12-
expect(Object.keys(selectorManifest)).toHaveLength(94)
13-
expect(count('provider-server')).toBe(82)
12+
expect(Object.keys(selectorManifest)).toHaveLength(96)
13+
expect(count('provider-server')).toBe(84)
1414
expect(count('internal-server')).toBe(11)
1515
expect(count('local')).toBe(1)
1616
expect(classifications).not.toContain('provider-legacy')
@@ -36,7 +36,7 @@ describe('selector manifest', () => {
3636
const rawConnectionKeys = providerKeys.filter(
3737
(key) => !serverSelectorRegistry[key as keyof typeof serverSelectorRegistry].credential
3838
)
39-
expect(providerKeys).toHaveLength(82)
39+
expect(providerKeys).toHaveLength(84)
4040
expect(rawConnectionKeys.sort()).toEqual([
4141
'cloudwatch.logGroups',
4242
'cloudwatch.logStreams',
@@ -98,7 +98,7 @@ describe('selector manifest', () => {
9898
(attachment) => attachment.destination !== 'fixed'
9999
)
100100

101-
expect(preparedDestinations).toHaveLength(13)
101+
expect(preparedDestinations).toHaveLength(15)
102102
for (const attachment of preparedDestinations) {
103103
expect(attachment.destination).toEqual(
104104
expect.objectContaining({

apps/sim/tools/generated/tool-metadata.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

apps/sim/tools/oracle_epm_tax_reporting/deploy_form_templates.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export const oracleEpmTaxReportingDeployFormTemplatesTool: InternalToolConfig<
2525
templates: taxFields.templates,
2626
frequencyDimensions: taxFields.frequencyDimensions,
2727
resetWorkflows: taxFields.resetWorkflows,
28-
jobName: { ...taxFields.jobName, required: false },
28+
jobName: {
29+
...taxFields.jobName,
30+
required: false,
31+
description:
32+
'Optional name for this supplemental job submission, not a deployed Planning job definition.',
33+
},
2934
waitForCompletion: taxFields.waitForCompletion,
3035
},
3136
operation: { input: createInternalToolOperationInput },

apps/sim/tools/oracle_epm_tax_reporting/import_supplemental_collection_data.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ export const oracleEpmTaxReportingImportSupplementalCollectionDataTool: Internal
2626
year: taxFields.year,
2727
period: taxFields.period,
2828
frequencyDimensions: taxFields.frequencyDimensions,
29-
jobName: { ...taxFields.jobName, required: false },
29+
jobName: {
30+
...taxFields.jobName,
31+
required: false,
32+
description:
33+
'Optional name for this supplemental job submission, not a deployed Planning job definition.',
34+
},
3035
waitForCompletion: taxFields.waitForCompletion,
3136
},
3237
operation: { input: createInternalToolOperationInput },

apps/sim/tools/oracle_epm_tax_reporting/oracle_epm_tax_reporting.test.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,47 @@ const block = OracleEpmTaxReportingBlock
1616
const tools = Object.values(toolExports)
1717

1818
describe('Tax Reporting integration contracts', () => {
19+
it.each(['import_supplemental_collection_data', 'deploy_form_templates'])(
20+
'maps only the supplemental submission label for %s',
21+
(operation) => {
22+
const params = {
23+
operation: `oracle_epm_tax_reporting_${operation}`,
24+
oauthCredential: 'credential',
25+
jobName: 'Stale saved rule',
26+
submissionName: '<trigger.label>',
27+
}
28+
expect(block.tools.config.params?.(params)).toEqual({
29+
oauthCredential: 'credential',
30+
jobName: '<trigger.label>',
31+
})
32+
expect(block.tools.config.params?.({ ...params, submissionName: '' })).toEqual({
33+
oauthCredential: 'credential',
34+
})
35+
expect(
36+
block.tools.config.params?.({ ...params, operation: 'oracle_epm_tax_reporting_run_rule' })
37+
).toEqual({ oauthCredential: 'credential', jobName: 'Stale saved rule' })
38+
}
39+
)
40+
41+
it('derives report enums from the current block values wrapper', () => {
42+
const format = block.subBlocks.find((item) => item.id === 'format')!
43+
const module = block.subBlocks.find((item) => item.id === 'module')!
44+
if (typeof format.options !== 'function' || typeof module.options !== 'function')
45+
throw new Error('Expected derived options')
46+
const values = { operation: 'oracle_epm_tax_reporting_generate_user_details_report' }
47+
expect(format.options({ values }).map((option) => option.id)).toEqual(['', 'CSV', 'XLS'])
48+
expect(
49+
module
50+
.options({ values: { operation: 'oracle_epm_tax_reporting_generate_report' } })
51+
.map((option) => option.id)
52+
).toEqual(['FCM', 'SDM'])
53+
expect(
54+
module
55+
.options({ values: { operation: 'oracle_epm_tax_reporting_get_report_status' } })
56+
.map((option) => option.id)
57+
).toEqual(['FCCS', 'SDM'])
58+
})
59+
1960
it('requires the active application and report module according to their route family', () => {
2061
const required = (id: string, values: Record<string, unknown>) => {
2162
const config = block.subBlocks.find((item) => item.id === id)!

apps/sim/tools/oracle_epm_tax_reporting/types.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,23 @@ export interface TaxFileResponse extends ToolResponse {
180180
output: { file: UserFile }
181181
}
182182

183+
export type TaxReportingBlockResponse =
184+
| TaxVersionResponse
185+
| TaxApplicationsResponse
186+
| TaxDefinitionsResponse
187+
| TaxMemberResponse
188+
| TaxJobStatusResponse
189+
| TaxSupplementalResponse
190+
| TaxReportResponse
191+
| TaxUploadResponse
192+
| TaxGridResponse
193+
| TaxImportSliceResponse
194+
| TaxClearSliceResponse
195+
| TaxDetailsResponse
196+
| TaxChildDetailsResponse
197+
| TaxFilesResponse
198+
| TaxFileResponse
199+
183200
export type TaxReportingConnection = Pick<
184201
TaxReportingParams,
185202
'oauthCredential' | 'accessToken' | 'instanceUrl'

0 commit comments

Comments
 (0)