Skip to content

Commit

Permalink
create DEFAULT_ONE_TRUST_COMBINED_ASSESSMENT
Browse files Browse the repository at this point in the history
  • Loading branch information
abrantesarthur committed Jan 12, 2025
1 parent ee8b072 commit d6052b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/oneTrust/codecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1079,12 +1079,14 @@ export type OneTrustEnrichedAssessmentResponseCodec = t.TypeOf<
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { status, ...OneTrustAssessmentCodecWithoutStatus } =
OneTrustAssessmentCodec.props;
export const CombinedAssessmentCodec = t.intersection([
export const OneTrustCombinedAssessmentCodec = t.intersection([
t.type(OneTrustAssessmentCodecWithoutStatus),
OneTrustEnrichedAssessmentResponseCodec,
]);

/** Type override */
export type CombinedAssessmentCodec = t.TypeOf<typeof CombinedAssessmentCodec>;
export type OneTrustCombinedAssessmentCodec = t.TypeOf<
typeof OneTrustCombinedAssessmentCodec
>;

/* eslint-enable max-lines */
6 changes: 6 additions & 0 deletions src/oneTrust/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createDefaultCodec } from '../helpers';
import { OneTrustCombinedAssessmentCodec } from './codecs';

export const DEFAULT_ONE_TRUST_COMBINED_ASSESSMENT = createDefaultCodec(
OneTrustCombinedAssessmentCodec,
);
4 changes: 2 additions & 2 deletions src/oneTrust/flattenOneTrustAssessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
extractProperties,
} from '../helpers';
import {
CombinedAssessmentCodec,
OneTrustCombinedAssessmentCodec,
OneTrustAssessmentNestedQuestionCodec,
OneTrustAssessmentQuestionOptionCodec,
OneTrustAssessmentQuestionResponseCodec,
Expand Down Expand Up @@ -237,7 +237,7 @@ const flattenOneTrustSections = (
};

export const flattenOneTrustAssessment = (
combinedAssessment: CombinedAssessmentCodec,
combinedAssessment: OneTrustCombinedAssessmentCodec,
): any => {
/**
* TODO: experiment creating a default assessment with
Expand Down

0 comments on commit d6052b1

Please sign in to comment.