Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/app-builder/src/components/Cases/RequiredActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export const RequiredActions = ({
caseId,
}: {
caseId: string;
decision: Pick<DetailedCaseDecision, 'id' | 'outcome' | 'reviewStatus' | 'sanctionChecks'>;
decision: Pick<DetailedCaseDecision, 'id' | 'outcome' | 'reviewStatus' | 'screenings'>;
}) => {
const { t } = useTranslation(casesI18n);
const reviewDecisionModalStore = useDialogStore();

const hasPendingScreening = decision.sanctionChecks.some((s) => s.status === 'in_review');
const hasPendingScreening = decision.screenings.some((s) => s.status === 'in_review');
const isPendingDecision =
decision.reviewStatus === 'pending' && decision.outcome === 'block_and_review';
const isThereSanctionChecks = decision.sanctionChecks.length > 0;
const isThereSanctionChecks = decision.screenings.length > 0;

return isPendingDecision || isThereSanctionChecks ? (
<div className="bg-grey-98 group-hover:bg-grey-95 flex flex-col gap-2.5 rounded-sm p-4 transition-colors">
Expand All @@ -43,10 +43,10 @@ export const RequiredActions = ({
</span>
</div>
<div className="flex flex-col">
{decision.sanctionChecks.map((s, i) => {
{decision.screenings.map((s, i) => {
return (
<div key={s.id} className="flex items-center pl-6 text-xs font-medium">
<Divider isLast={i === decision.sanctionChecks.length - 1} />
<Divider isLast={i === decision.screenings.length - 1} />
<span
className={cn('inline-flex items-center gap-2 text-xs font-medium', {
'text-red-43': s.status === 'error',
Expand Down Expand Up @@ -96,7 +96,7 @@ export const RequiredActions = ({
<ReviewDecisionModal
decisionId={decision.id}
store={reviewDecisionModalStore}
sanctionCheck={decision.sanctionChecks[0]}
sanctionCheck={decision.screenings[0]}
/>
</div>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder/src/models/cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ export type DetailedCaseDecision = {
};
score: number;
rules: RuleExecution[];
sanctionChecks: {
screenings: {
id: string;
status: SanctionCheckStatus;
partial: boolean;
Expand Down Expand Up @@ -679,6 +679,6 @@ export function adaptDetailedCaseDecision(dto: DetailedCaseDecisionDto): Detaile
},
score: dto.score,
rules: dto.rules.map((r) => adaptRuleExecutionDto(r, false)),
sanctionChecks: dto.sanction_checks ?? [],
screenings: dto.screenings ?? [],
};
}
2 changes: 1 addition & 1 deletion packages/marble-api/openapis/marblecore-api/cases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ components:
type: array
items:
$ref: 'decisions.yml#/components/schemas/RuleExecutionDto'
sanction_checks:
screenings:
type: array
items:
type: object
Expand Down
2 changes: 1 addition & 1 deletion packages/marble-api/src/generated/marblecore-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export type RuleExecutionDto = {
};
export type DetailedCaseDecisionDto = CaseDecisionDto & {
rules: RuleExecutionDto[];
sanction_checks?: {
screenings?: {
id: string;
status: "in_review" | "confirmed_hit";
name: string;
Expand Down