Skip to content

Commit 76b468b

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
style(oracle-hcm): align declarations with GitHub formatting diagnostics
1 parent 3b67466 commit 76b468b

65 files changed

Lines changed: 843 additions & 315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/sim/blocks/blocks/oracle_fusion_hcm.ts‎

Lines changed: 204 additions & 78 deletions
Large diffs are not rendered by default.

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

Lines changed: 111 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -829,17 +829,56 @@ describe('Oracle Fusion HCM payroll, compensation, talent, and time', () => {
829829
'payrollRelationships/rel/child/payrollAssignments/asg/child/assignedPayrolls'
830830
mocks.requestOracleFusionJson
831831
.mockResolvedValueOnce(discovery('payrollRelationships', 'PayrollRelationshipId', '1', 'rel'))
832-
.mockResolvedValueOnce(discovery('payrollRelationships/rel/child/payrollAssignments', 'RelationshipGroupId', '2', 'asg'))
832+
.mockResolvedValueOnce(
833+
discovery(
834+
'payrollRelationships/rel/child/payrollAssignments',
835+
'RelationshipGroupId',
836+
'2',
837+
'asg'
838+
)
839+
)
833840
.mockResolvedValueOnce(discovery(collectionPath, 'AssignedPayrollId', '3', 'pay'))
834-
.mockResolvedValueOnce({ AssignedPayrollId: '3', TimeCardRequired: 'Y', links: self(`${collectionPath}/pay`) })
835-
await operations.executeOracleFusionHcmUpdateAssignedPayroll({ ...auth, payrollRelationshipId: '1', payrollAssignmentId: '2', assignedPayrollId: '3', effectiveDate: '2026-01-01', rangeMode: 'UPDATE', timeCardRequired: 'Y' })
836-
expect(lastRequest()).toMatchObject({ method: 'PATCH', body: { TimeCardRequired: 'Y' }, operationHeaders: { effectiveOf: 'RangeMode=UPDATE;RangeStartDate=2026-01-01' } })
841+
.mockResolvedValueOnce({
842+
AssignedPayrollId: '3',
843+
TimeCardRequired: 'Y',
844+
links: self(`${collectionPath}/pay`),
845+
})
846+
await operations.executeOracleFusionHcmUpdateAssignedPayroll({
847+
...auth,
848+
payrollRelationshipId: '1',
849+
payrollAssignmentId: '2',
850+
assignedPayrollId: '3',
851+
effectiveDate: '2026-01-01',
852+
rangeMode: 'UPDATE',
853+
timeCardRequired: 'Y',
854+
})
855+
expect(lastRequest()).toMatchObject({
856+
method: 'PATCH',
857+
body: { TimeCardRequired: 'Y' },
858+
operationHeaders: { effectiveOf: 'RangeMode=UPDATE;RangeStartDate=2026-01-01' },
859+
})
837860
expect(lastRequest().body).not.toHaveProperty('PayrollId')
838861
})
839862

840863
it('creates nested element values with exact integers and unmodified decimal text', async () => {
841-
mocks.requestOracleFusionJson.mockResolvedValueOnce({ ElementEntryId: '1', links: self('elementEntries/entry') })
842-
await operations.executeOracleFusionHcmCreateElementEntry({ ...auth, personId: '9223372036854775807', assignmentId: '9223372036854775806', elementTypeId: '9223372036854775805', elementName: 'Bonus', creatorType: 'F', entryType: 'E', effectiveStartDate: '2026-01-01', effectiveEndDate: '4712-12-31', entryValues: [{ inputValueId: '9223372036854775804', screenEntryValue: '123456789012345.6700' }] })
864+
mocks.requestOracleFusionJson.mockResolvedValueOnce({
865+
ElementEntryId: '1',
866+
links: self('elementEntries/entry'),
867+
})
868+
await operations.executeOracleFusionHcmCreateElementEntry({
869+
...auth,
870+
personId: '9223372036854775807',
871+
assignmentId: '9223372036854775806',
872+
elementTypeId: '9223372036854775805',
873+
elementName: 'Bonus',
874+
creatorType: 'F',
875+
entryType: 'E',
876+
effectiveStartDate: '2026-01-01',
877+
effectiveEndDate: '4712-12-31',
878+
entryValues: [
879+
{ inputValueId: '9223372036854775804', screenEntryValue: '123456789012345.6700' },
880+
],
881+
})
843882
const body = serializeOracleFusionJsonBody(lastRequest().body)
844883
expect(body).toContain('"PersonId":9223372036854775807')
845884
expect(body).toContain('"AssignmentId":9223372036854775806')
@@ -851,22 +890,77 @@ describe('Oracle Fusion HCM payroll, compensation, talent, and time', () => {
851890
it('resolves element values under their entry and preserves explicit null correction', async () => {
852891
mocks.requestOracleFusionJson
853892
.mockResolvedValueOnce(discovery('elementEntries', 'ElementEntryId', '1', 'entry'))
854-
.mockResolvedValueOnce(discovery('elementEntries/entry/child/elementEntryValues', 'ElementEntryValueId', '2', 'value'))
855-
.mockResolvedValueOnce({ ElementEntryValueId: '2', ScreenEntryValue: null, links: self('elementEntries/entry/child/elementEntryValues/value') })
856-
const result = await operations.executeOracleFusionHcmUpdateElementEntryValue({ ...auth, elementEntryId: '1', elementEntryValueId: '2', effectiveDate: '2026-01-01', rangeMode: 'CORRECTION', screenEntryValue: null })
857-
expect(lastRequest()).toMatchObject({ address: { relativePath: 'elementEntries/entry/child/elementEntryValues/value' }, method: 'PATCH', body: { ScreenEntryValue: null }, operationHeaders: { effectiveOf: 'RangeMode=CORRECTION;RangeStartDate=2026-01-01' } })
893+
.mockResolvedValueOnce(
894+
discovery(
895+
'elementEntries/entry/child/elementEntryValues',
896+
'ElementEntryValueId',
897+
'2',
898+
'value'
899+
)
900+
)
901+
.mockResolvedValueOnce({
902+
ElementEntryValueId: '2',
903+
ScreenEntryValue: null,
904+
links: self('elementEntries/entry/child/elementEntryValues/value'),
905+
})
906+
const result = await operations.executeOracleFusionHcmUpdateElementEntryValue({
907+
...auth,
908+
elementEntryId: '1',
909+
elementEntryValueId: '2',
910+
effectiveDate: '2026-01-01',
911+
rangeMode: 'CORRECTION',
912+
screenEntryValue: null,
913+
})
914+
expect(lastRequest()).toMatchObject({
915+
address: { relativePath: 'elementEntries/entry/child/elementEntryValues/value' },
916+
method: 'PATCH',
917+
body: { ScreenEntryValue: null },
918+
operationHeaders: { effectiveOf: 'RangeMode=CORRECTION;RangeStartDate=2026-01-01' },
919+
})
858920
expect(result.output.elementEntryValue.screenEntryValue).toBeNull()
859921
})
860922

861923
it('reads independently paginated payroll results and contextual balance string slots', async () => {
862-
mocks.requestOracleFusionJson.mockResolvedValueOnce(collection([{ RunResultId: '1', ResultValue: '123456789012345.6700', InputValueId: '2' }], { offset: 10, limit: 5 }))
863-
const runs = await operations.executeOracleFusionHcmListPayrollRunResults({ ...auth, objectActionId: '9007199254740993', limit: 5, offset: 10 })
864-
expect(lastRequest().address.relativePath).toBe('personProcessResults/9007199254740993/child/RunResult')
924+
mocks.requestOracleFusionJson.mockResolvedValueOnce(
925+
collection([{ RunResultId: '1', ResultValue: '123456789012345.6700', InputValueId: '2' }], {
926+
offset: 10,
927+
limit: 5,
928+
})
929+
)
930+
const runs = await operations.executeOracleFusionHcmListPayrollRunResults({
931+
...auth,
932+
objectActionId: '9007199254740993',
933+
limit: 5,
934+
offset: 10,
935+
})
936+
expect(lastRequest().address.relativePath).toBe(
937+
'personProcessResults/9007199254740993/child/RunResult'
938+
)
865939
expect(runs.output.payrollRunResults[0].resultValue).toBe('123456789012345.6700')
866-
mocks.requestOracleFusionJson.mockResolvedValueOnce(collection([{ BalanceName: 'Gross', DimensionName: 'Period to Date', Value1: '100.0000', Value10: '0', DefbalId1: '9007199254740993' }]))
867-
const balances = await operations.executeOracleFusionHcmListPayrollBalances({ ...auth, objectActionId: '9007199254740993' })
868-
expect(lastRequest().address.relativePath).toBe('personProcessResults/9007199254740993/child/BalanceView')
869-
expect(balances.output.payrollBalances[0]).toMatchObject({ dimensionName: 'Period to Date', value1: '100.0000', value10: '0', defbalId1: '9007199254740993' })
940+
mocks.requestOracleFusionJson.mockResolvedValueOnce(
941+
collection([
942+
{
943+
BalanceName: 'Gross',
944+
DimensionName: 'Period to Date',
945+
Value1: '100.0000',
946+
Value10: '0',
947+
DefbalId1: '9007199254740993',
948+
},
949+
])
950+
)
951+
const balances = await operations.executeOracleFusionHcmListPayrollBalances({
952+
...auth,
953+
objectActionId: '9007199254740993',
954+
})
955+
expect(lastRequest().address.relativePath).toBe(
956+
'personProcessResults/9007199254740993/child/BalanceView'
957+
)
958+
expect(balances.output.payrollBalances[0]).toMatchObject({
959+
dimensionName: 'Period to Date',
960+
value1: '100.0000',
961+
value10: '0',
962+
defbalId1: '9007199254740993',
963+
})
870964
})
871965

872966
it('reads salary history directly by assignment without a worker lookup', async () => {

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

Lines changed: 87 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ import type {
9393
OracleFusionHcmGetTimeRecordRequestBody,
9494
OracleFusionHcmGetWorkerAssignmentBody,
9595
OracleFusionHcmGetWorkerBody,
96-
OracleFusionHcmListAbsenceTypesBody,
9796
OracleFusionHcmListAbsencesBody,
97+
OracleFusionHcmListAbsenceTypesBody,
9898
OracleFusionHcmListAssignedPayrollsBody,
9999
OracleFusionHcmListBusinessUnitsBody,
100100
OracleFusionHcmListDepartmentsBody,
@@ -118,8 +118,8 @@ import type {
118118
OracleFusionHcmListPayrollTimePeriodsBody,
119119
OracleFusionHcmListPerformanceDocumentParticipantsBody,
120120
OracleFusionHcmListPerformanceDocumentRolesBody,
121-
OracleFusionHcmListPerformanceDocumentTasksBody,
122121
OracleFusionHcmListPerformanceDocumentsBody,
122+
OracleFusionHcmListPerformanceDocumentTasksBody,
123123
OracleFusionHcmListPerformanceGoalsBody,
124124
OracleFusionHcmListPersonProcessResultsBody,
125125
OracleFusionHcmListPersonTypesBody,
@@ -133,8 +133,8 @@ import type {
133133
OracleFusionHcmListTalentProfilesBody,
134134
OracleFusionHcmListTimeAttributeCriteriaBindsBody,
135135
OracleFusionHcmListTimeAttributeDataSourcesBody,
136-
OracleFusionHcmListTimeAttributeValuesBody,
137136
OracleFusionHcmListTimeAttributesBody,
137+
OracleFusionHcmListTimeAttributeValuesBody,
138138
OracleFusionHcmListTimeCardsBody,
139139
OracleFusionHcmListTimeRecordEventMessagesBody,
140140
OracleFusionHcmListTimeRecordRequestEventsBody,
@@ -956,19 +956,40 @@ async function assignedPayrollPath(
956956
)
957957
}
958958

959-
async function elementEntryPath(input: Credentials & { elementEntryId: string; effectiveDate?: string }, signal?: AbortSignal) {
960-
return resolveResourcePath(input, 'elementEntries', 'ElementEntryId', input.elementEntryId, signal)
959+
async function elementEntryPath(
960+
input: Credentials & { elementEntryId: string; effectiveDate?: string },
961+
signal?: AbortSignal
962+
) {
963+
return resolveResourcePath(
964+
input,
965+
'elementEntries',
966+
'ElementEntryId',
967+
input.elementEntryId,
968+
signal
969+
)
961970
}
962971

963-
async function performanceDocumentPath(input: Credentials & { evaluationId: string }, signal?: AbortSignal) {
964-
return resolveResourcePath(input, 'performanceEvaluations', 'EvaluationId', input.evaluationId, signal)
972+
async function performanceDocumentPath(
973+
input: Credentials & { evaluationId: string },
974+
signal?: AbortSignal
975+
) {
976+
return resolveResourcePath(
977+
input,
978+
'performanceEvaluations',
979+
'EvaluationId',
980+
input.evaluationId,
981+
signal
982+
)
965983
}
966984

967985
async function talentProfilePath(input: Credentials & { profileId: string }, signal?: AbortSignal) {
968986
return resolveResourcePath(input, 'talentPersonProfiles', 'ProfileId', input.profileId, signal)
969987
}
970988

971-
async function timeAttributePath(input: Credentials & { timeAttributeId: string }, signal?: AbortSignal) {
989+
async function timeAttributePath(
990+
input: Credentials & { timeAttributeId: string },
991+
signal?: AbortSignal
992+
) {
972993
return resolveResourcePath(input, 'timeAttributes', 'tmAtrbFldId', input.timeAttributeId, signal)
973994
}
974995

@@ -981,10 +1002,21 @@ async function readResource<T>(
9811002
project: (value: unknown) => T,
9821003
signal?: AbortSignal
9831004
): Promise<T> {
984-
const raw = await request(input, path, { fields, links: 'self', effectiveDate: input.effectiveDate }, signal)
1005+
const raw = await request(
1006+
input,
1007+
path,
1008+
{ fields, links: 'self', effectiveDate: input.effectiveDate },
1009+
signal
1010+
)
9851011
validateSelfLink(raw, input, path)
986-
if (!isRecordLike(raw) || normalizeOracleFusionDecimalIdentifier(raw[idField], { maxDigits: 19 }) !== id) {
987-
throw new OracleFusionProviderError('Oracle Fusion HCM returned a different resource than requested', 502)
1012+
if (
1013+
!isRecordLike(raw) ||
1014+
normalizeOracleFusionDecimalIdentifier(raw[idField], { maxDigits: 19 }) !== id
1015+
) {
1016+
throw new OracleFusionProviderError(
1017+
'Oracle Fusion HCM returned a different resource than requested',
1018+
502
1019+
)
9881020
}
9891021
return project(raw)
9901022
}
@@ -1016,16 +1048,25 @@ export async function executeOracleFusionHcmListPayrollRelationships(
10161048
signal?: AbortSignal
10171049
) {
10181050
const path = 'payrollRelationships'
1019-
const result = await list(input, path, PAYROLL_RELATIONSHIP_FIELDS, projectPayrollRelationship, (query) => {
1020-
const clauses: string[] = []
1021-
addSearch(query, input.search, ['PersonNumber','PayrollRelationshipNumber'])
1022-
if (query.q) clauses.push(`(${query.q})`)
1023-
if (input.personNumber) clauses.push(`PersonNumber='${quoteOracle(input.personNumber)}'`)
1024-
addEffectiveDate(query, input.effectiveDate)
1025-
if (clauses.length > 0) query.q = clauses.join(' AND ')
1026-
},
1027-
signal)
1028-
return { success: true as const, output: { payrollRelationships: result.items, ...withoutItems(result) } }
1051+
const result = await list(
1052+
input,
1053+
path,
1054+
PAYROLL_RELATIONSHIP_FIELDS,
1055+
projectPayrollRelationship,
1056+
(query) => {
1057+
const clauses: string[] = []
1058+
addSearch(query, input.search, ['PersonNumber', 'PayrollRelationshipNumber'])
1059+
if (query.q) clauses.push(`(${query.q})`)
1060+
if (input.personNumber) clauses.push(`PersonNumber='${quoteOracle(input.personNumber)}'`)
1061+
addEffectiveDate(query, input.effectiveDate)
1062+
if (clauses.length > 0) query.q = clauses.join(' AND ')
1063+
},
1064+
signal
1065+
)
1066+
return {
1067+
success: true as const,
1068+
output: { payrollRelationships: result.items, ...withoutItems(result) },
1069+
}
10291070
}
10301071

10311072
/** Oracle contract: https://docs.oracle.com/en/cloud/saas/human-resources/farws/op-payrollrelationships-get.html */
@@ -1034,7 +1075,15 @@ export async function executeOracleFusionHcmGetPayrollRelationship(
10341075
signal?: AbortSignal
10351076
) {
10361077
const path = await payrollRelationshipPath(input, signal)
1037-
const result = await readResource(input, path, PAYROLL_RELATIONSHIP_FIELDS, 'PayrollRelationshipId', input.payrollRelationshipId, projectPayrollRelationship, signal)
1078+
const result = await readResource(
1079+
input,
1080+
path,
1081+
PAYROLL_RELATIONSHIP_FIELDS,
1082+
'PayrollRelationshipId',
1083+
input.payrollRelationshipId,
1084+
projectPayrollRelationship,
1085+
signal
1086+
)
10381087
return { success: true as const, output: { payrollRelationship: result } }
10391088
}
10401089

@@ -1044,13 +1093,22 @@ export async function executeOracleFusionHcmListPayrollAssignments(
10441093
signal?: AbortSignal
10451094
) {
10461095
const path = `${await payrollRelationshipPath(input, signal)}/child/payrollAssignments`
1047-
const result = await list(input, path, PAYROLL_ASSIGNMENT_FIELDS, projectPayrollAssignment, (query) => {
1048-
const clauses: string[] = []
1049-
addEffectiveDate(query, input.effectiveDate)
1050-
if (clauses.length > 0) query.q = clauses.join(' AND ')
1051-
},
1052-
signal)
1053-
return { success: true as const, output: { payrollAssignments: result.items, ...withoutItems(result) } }
1096+
const result = await list(
1097+
input,
1098+
path,
1099+
PAYROLL_ASSIGNMENT_FIELDS,
1100+
projectPayrollAssignment,
1101+
(query) => {
1102+
const clauses: string[] = []
1103+
addEffectiveDate(query, input.effectiveDate)
1104+
if (clauses.length > 0) query.q = clauses.join(' AND ')
1105+
},
1106+
signal
1107+
)
1108+
return {
1109+
success: true as const,
1110+
output: { payrollAssignments: result.items, ...withoutItems(result) },
1111+
}
10541112
}
10551113

10561114
/** Oracle contract: https://docs.oracle.com/en/cloud/saas/human-resources/farws/op-payrollrelationships-payrollrelationshipsuniqid-child-payrollassignments-get.html */

0 commit comments

Comments
 (0)