Skip to content

Commit dab5b4e

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
style(oracle-hcm): align remaining schemas and operation formatting
1 parent 161cd7a commit dab5b4e

8 files changed

Lines changed: 610 additions & 225 deletions

File tree

apps/sim/blocks/blocks/oracle_fusion_hcm.ts

Lines changed: 84 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -919,32 +919,61 @@ export const OracleFusionHcmBlock: BlockConfig = {
919919
id: 'overridingPeriodId',
920920
title: 'Overriding Period Id',
921921
type: 'short-input',
922-
condition: { field: 'operation', value: ['create_assigned_payroll', 'update_assigned_payroll'] },
922+
condition: {
923+
field: 'operation',
924+
value: ['create_assigned_payroll', 'update_assigned_payroll'],
925+
},
923926
required: { field: 'operation', value: [] },
924927
description: 'Overriding period ID, as a positive decimal string',
925928
},
926929
{
927930
id: 'timeCardRequired',
928931
title: 'Time Card Required',
929932
type: 'short-input',
930-
condition: { field: 'operation', value: ['create_assigned_payroll', 'update_assigned_payroll'] },
933+
condition: {
934+
field: 'operation',
935+
value: ['create_assigned_payroll', 'update_assigned_payroll'],
936+
},
931937
required: { field: 'operation', value: [] },
932938
description: 'Oracle time-card requirement code, such as Y or N',
933939
},
934940
{
935941
id: 'rangeMode',
936942
title: 'Range Mode',
937943
type: 'dropdown',
938-
options: [{ id: 'CORRECTION', label: 'CORRECTION' }, { id: 'UPDATE', label: 'UPDATE' }],
939-
condition: { field: 'operation', value: ['update_assigned_payroll', 'update_element_entry_value'] },
940-
required: { field: 'operation', value: ['update_assigned_payroll', 'update_element_entry_value'] },
944+
options: [
945+
{ id: 'CORRECTION', label: 'CORRECTION' },
946+
{ id: 'UPDATE', label: 'UPDATE' },
947+
],
948+
condition: {
949+
field: 'operation',
950+
value: ['update_assigned_payroll', 'update_element_entry_value'],
951+
},
952+
required: {
953+
field: 'operation',
954+
value: ['update_assigned_payroll', 'update_element_entry_value'],
955+
},
941956
description: 'CORRECTION changes the historical row; UPDATE starts an effective-dated change',
942957
},
943958
{
944959
id: 'legislativeDataGroupId',
945960
title: 'Legislative Data Group Id',
946961
type: 'short-input',
947-
condition: { field: 'operation', value: ['list_payroll_definitions', 'list_payroll_element_definitions', 'list_salary_bases', 'create_assigned_payroll', 'list_payroll_time_periods', 'list_person_process_results', 'list_payroll_input_values', 'list_element_entries', 'create_element_entry', 'create_salary'] },
962+
condition: {
963+
field: 'operation',
964+
value: [
965+
'list_payroll_definitions',
966+
'list_payroll_element_definitions',
967+
'list_salary_bases',
968+
'create_assigned_payroll',
969+
'list_payroll_time_periods',
970+
'list_person_process_results',
971+
'list_payroll_input_values',
972+
'list_element_entries',
973+
'create_element_entry',
974+
'create_salary',
975+
],
976+
},
948977
required: { field: 'operation', value: [] },
949978
description: 'Legislative data group ID, as a positive decimal string',
950979
},
@@ -960,8 +989,14 @@ export const OracleFusionHcmBlock: BlockConfig = {
960989
any: ['oauthCredential', 'personId', 'legislativeDataGroupId', 'effectiveDate'],
961990
},
962991
mode: 'basic',
963-
condition: { field: 'operation', value: ['list_payroll_input_values', 'list_element_entries', 'create_element_entry'] },
964-
required: { field: 'operation', value: ['list_payroll_input_values', 'create_element_entry'] },
992+
condition: {
993+
field: 'operation',
994+
value: ['list_payroll_input_values', 'list_element_entries', 'create_element_entry'],
995+
},
996+
required: {
997+
field: 'operation',
998+
value: ['list_payroll_input_values', 'create_element_entry'],
999+
},
9651000
placeholder: 'Select element type id',
9661001
description: 'Element type ID, as a positive decimal string',
9671002
},
@@ -971,15 +1006,29 @@ export const OracleFusionHcmBlock: BlockConfig = {
9711006
type: 'short-input',
9721007
canonicalParamId: 'elementTypeId',
9731008
mode: 'advanced',
974-
condition: { field: 'operation', value: ['list_payroll_input_values', 'list_element_entries', 'create_element_entry'] },
975-
required: { field: 'operation', value: ['list_payroll_input_values', 'create_element_entry'] },
1009+
condition: {
1010+
field: 'operation',
1011+
value: ['list_payroll_input_values', 'list_element_entries', 'create_element_entry'],
1012+
},
1013+
required: {
1014+
field: 'operation',
1015+
value: ['list_payroll_input_values', 'create_element_entry'],
1016+
},
9761017
placeholder: 'Enter element type id',
9771018
},
9781019
{
9791020
id: 'assignmentNumber',
9801021
title: 'Assignment Number',
9811022
type: 'short-input',
982-
condition: { field: 'operation', value: ['list_element_entries', 'create_time_entry', 'update_time_entry', 'delete_time_entry'] },
1023+
condition: {
1024+
field: 'operation',
1025+
value: [
1026+
'list_element_entries',
1027+
'create_time_entry',
1028+
'update_time_entry',
1029+
'delete_time_entry',
1030+
],
1031+
},
9831032
required: { field: 'operation', value: [] },
9841033
description: 'HR assignment number',
9851034
},
@@ -995,8 +1044,14 @@ export const OracleFusionHcmBlock: BlockConfig = {
9951044
any: ['oauthCredential', 'personNumber', 'effectiveDate'],
9961045
},
9971046
mode: 'basic',
998-
condition: { field: 'operation', value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'] },
999-
required: { field: 'operation', value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'] },
1047+
condition: {
1048+
field: 'operation',
1049+
value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'],
1050+
},
1051+
required: {
1052+
field: 'operation',
1053+
value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'],
1054+
},
10001055
placeholder: 'Select element entry id',
10011056
description: 'Element entry ID, as a positive decimal string',
10021057
},
@@ -1006,8 +1061,14 @@ export const OracleFusionHcmBlock: BlockConfig = {
10061061
type: 'short-input',
10071062
canonicalParamId: 'elementEntryId',
10081063
mode: 'advanced',
1009-
condition: { field: 'operation', value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'] },
1010-
required: { field: 'operation', value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'] },
1064+
condition: {
1065+
field: 'operation',
1066+
value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'],
1067+
},
1068+
required: {
1069+
field: 'operation',
1070+
value: ['get_element_entry', 'list_element_entry_values', 'update_element_entry_value'],
1071+
},
10111072
placeholder: 'Enter element entry id',
10121073
},
10131074
{
@@ -1066,8 +1127,14 @@ export const OracleFusionHcmBlock: BlockConfig = {
10661127
id: 'objectActionId',
10671128
title: 'Object Action Id',
10681129
type: 'short-input',
1069-
condition: { field: 'operation', value: ['get_person_process_result', 'list_payroll_run_results', 'list_payroll_balances'] },
1070-
required: { field: 'operation', value: ['get_person_process_result', 'list_payroll_run_results', 'list_payroll_balances'] },
1130+
condition: {
1131+
field: 'operation',
1132+
value: ['get_person_process_result', 'list_payroll_run_results', 'list_payroll_balances'],
1133+
},
1134+
required: {
1135+
field: 'operation',
1136+
value: ['get_person_process_result', 'list_payroll_run_results', 'list_payroll_balances'],
1137+
},
10711138
description: 'Object action ID, as a positive decimal string',
10721139
},
10731140
{

apps/sim/lib/internal/oracle-fusion-hcm/operations.test.ts

Lines changed: 87 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -964,37 +964,96 @@ describe('Oracle Fusion HCM payroll, compensation, talent, and time', () => {
964964
})
965965

966966
it('reads salary history directly by assignment without a worker lookup', async () => {
967-
mocks.requestOracleFusionJson.mockResolvedValueOnce(collection([{ SalaryId: '1', AssignmentId: '9007199254740993', DateFrom: '2001-01-01', SalaryAmount: 1200 }]))
968-
await operations.executeOracleFusionHcmListSalaries({ ...auth, assignmentId: '9007199254740993' })
967+
mocks.requestOracleFusionJson.mockResolvedValueOnce(
968+
collection([
969+
{
970+
SalaryId: '1',
971+
AssignmentId: '9007199254740993',
972+
DateFrom: '2001-01-01',
973+
SalaryAmount: 1200,
974+
},
975+
])
976+
)
977+
await operations.executeOracleFusionHcmListSalaries({
978+
...auth,
979+
assignmentId: '9007199254740993',
980+
})
969981
expect(mocks.requestOracleFusionJson).toHaveBeenCalledOnce()
970-
expect(lastRequest()).toMatchObject({ address: { relativePath: 'salaries' }, query: { q: 'AssignmentId=9007199254740993' } })
982+
expect(lastRequest()).toMatchObject({
983+
address: { relativePath: 'salaries' },
984+
query: { q: 'AssignmentId=9007199254740993' },
985+
})
971986
})
972987

973988
it('creates a user-entered salary without submitting an approval action', async () => {
974989
mocks.requestOracleFusionJson
975-
.mockResolvedValueOnce(collection([{ SalaryBasisId: '2', SalaryBasisType: 'U' }], { limit: 2 }))
990+
.mockResolvedValueOnce(
991+
collection([{ SalaryBasisId: '2', SalaryBasisType: 'U' }], { limit: 2 })
992+
)
976993
.mockResolvedValueOnce({ SalaryId: '3', SalaryAmount: 1200, links: self('salaries/3') })
977-
await operations.executeOracleFusionHcmCreateSalary({ ...auth, assignmentId: '9223372036854775807', salaryBasisId: '2', salaryAmount: 1200, dateFrom: '2026-01-01', dateTo: '4712-12-31' })
978-
expect(mocks.requestOracleFusionJson.mock.calls[0][1].query.finder).toBe('findBySalaryBasisId;SalaryBasisId=2,EffectiveDate=2026-01-01')
994+
await operations.executeOracleFusionHcmCreateSalary({
995+
...auth,
996+
assignmentId: '9223372036854775807',
997+
salaryBasisId: '2',
998+
salaryAmount: 1200,
999+
dateFrom: '2026-01-01',
1000+
dateTo: '4712-12-31',
1001+
})
1002+
expect(mocks.requestOracleFusionJson.mock.calls[0][1].query.finder).toBe(
1003+
'findBySalaryBasisId;SalaryBasisId=2,EffectiveDate=2026-01-01'
1004+
)
9791005
expect(lastRequest()).toMatchObject({ address: { relativePath: 'salaries' }, method: 'POST' })
980-
expect(serializeOracleFusionJsonBody(lastRequest().body)).toContain('"AssignmentId":9223372036854775807')
981-
expect(lastRequest().body).toMatchObject({ MultipleComponents: 'N', DateFrom: '2026-01-01', DateTo: '4712-12-31', SalaryAmount: 1200 })
1006+
expect(serializeOracleFusionJsonBody(lastRequest().body)).toContain(
1007+
'"AssignmentId":9223372036854775807'
1008+
)
1009+
expect(lastRequest().body).toMatchObject({
1010+
MultipleComponents: 'N',
1011+
DateFrom: '2026-01-01',
1012+
DateTo: '4712-12-31',
1013+
SalaryAmount: 1200,
1014+
})
9821015
expect(lastRequest().body).not.toHaveProperty('SalaryTransactionStatus')
9831016
})
9841017

9851018
it('rejects component-calculated salary bases before writing', async () => {
986-
mocks.requestOracleFusionJson.mockResolvedValueOnce(collection([{ SalaryBasisId: '2', SalaryBasisType: 'C' }], { limit: 2 }))
987-
await expect(operations.executeOracleFusionHcmCreateSalary({ ...auth, assignmentId: '1', salaryBasisId: '2', salaryAmount: 1200, dateFrom: '2026-01-01', dateTo: '4712-12-31' })).rejects.toThrow('user-entered')
1019+
mocks.requestOracleFusionJson.mockResolvedValueOnce(
1020+
collection([{ SalaryBasisId: '2', SalaryBasisType: 'C' }], { limit: 2 })
1021+
)
1022+
await expect(
1023+
operations.executeOracleFusionHcmCreateSalary({
1024+
...auth,
1025+
assignmentId: '1',
1026+
salaryBasisId: '2',
1027+
salaryAmount: 1200,
1028+
dateFrom: '2026-01-01',
1029+
dateTo: '4712-12-31',
1030+
})
1031+
).rejects.toThrow('user-entered')
9881032
expect(mocks.requestOracleFusionJson).toHaveBeenCalledOnce()
9891033
})
9901034

9911035
it('corrects only the existing salary amount after checking its historical basis', async () => {
9921036
mocks.requestOracleFusionJson
993-
.mockResolvedValueOnce({ SalaryId: '3', SalaryBasisId: '2', DateFrom: '2020-01-01', links: self('salaries/3') })
994-
.mockResolvedValueOnce(collection([{ SalaryBasisId: '2', SalaryBasisType: 'U' }], { limit: 2 }))
1037+
.mockResolvedValueOnce({
1038+
SalaryId: '3',
1039+
SalaryBasisId: '2',
1040+
DateFrom: '2020-01-01',
1041+
links: self('salaries/3'),
1042+
})
1043+
.mockResolvedValueOnce(
1044+
collection([{ SalaryBasisId: '2', SalaryBasisType: 'U' }], { limit: 2 })
1045+
)
9951046
.mockResolvedValueOnce({ SalaryId: '3', SalaryAmount: 1300, links: self('salaries/3') })
996-
await operations.executeOracleFusionHcmCorrectSalary({ ...auth, salaryId: '3', salaryAmount: 1300 })
997-
expect(lastRequest()).toMatchObject({ address: { relativePath: 'salaries/3' }, method: 'PATCH', body: { SalaryAmount: 1300 } })
1047+
await operations.executeOracleFusionHcmCorrectSalary({
1048+
...auth,
1049+
salaryId: '3',
1050+
salaryAmount: 1300,
1051+
})
1052+
expect(lastRequest()).toMatchObject({
1053+
address: { relativePath: 'salaries/3' },
1054+
method: 'PATCH',
1055+
body: { SalaryAmount: 1300 },
1056+
})
9981057
expect(Object.keys(lastRequest().body)).toEqual(['SalaryAmount'])
9991058
})
10001059

@@ -1004,9 +1063,20 @@ describe('Oracle Fusion HCM payroll, compensation, talent, and time', () => {
10041063
['simple', 'salarySimpleComponents', 'SimpleSalaryCompntId', 'simpleComponents'],
10051064
['rate', 'salaryPayRateComponents', 'SalaryPayComponentId', 'rateComponents'],
10061065
] as const) {
1007-
mocks.requestOracleFusionJson.mockResolvedValueOnce(collection([{ [field]: '1' }], { limit: 5, offset: 10 }))
1008-
const result = await operations.executeOracleFusionHcmListSalaryComponents({ ...auth, salaryId: '3', componentKind, limit: 5, offset: 10 })
1009-
expect(lastRequest()).toMatchObject({ address: { relativePath: `salaries/3/child/${child}` }, query: { limit: 5, offset: 10 } })
1066+
mocks.requestOracleFusionJson.mockResolvedValueOnce(
1067+
collection([{ [field]: '1' }], { limit: 5, offset: 10 })
1068+
)
1069+
const result = await operations.executeOracleFusionHcmListSalaryComponents({
1070+
...auth,
1071+
salaryId: '3',
1072+
componentKind,
1073+
limit: 5,
1074+
offset: 10,
1075+
})
1076+
expect(lastRequest()).toMatchObject({
1077+
address: { relativePath: `salaries/3/child/${child}` },
1078+
query: { limit: 5, offset: 10 },
1079+
})
10101080
expect(result.output[output]).toHaveLength(1)
10111081
}
10121082
expect(mocks.requestOracleFusionJson).toHaveBeenCalledTimes(3)

0 commit comments

Comments
 (0)