All files / libs/kernel/auth/shared/src/abilities/plans subjects.ts

100% Statements 11/11
100% Branches 0/0
0% Functions 0/2
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 121x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import { subject } from '@casl/ability';
 
import { type Plan } from '@amalia/payout-definition/plans/types';
 
import { SubjectsEnum } from '../../types';
 
export type ViewPlanSubject = Pick<Plan, 'id' | 'isHidden'>;
export const viewPlanSubject = (payload: ViewPlanSubject) => subject(SubjectsEnum.Plan, { ...payload });
 
export type ViewPlanTokenSubject = { planId: Plan['id'] | null };
export const viewPlanTokenSubject = (payload: ViewPlanTokenSubject) => subject(SubjectsEnum.Plan, { ...payload });