All files / libs/kernel/testing/server/bed/src/test-utils/fixtures/creditSafe rules.ts

100% Statements 24/24
100% Branches 0/0
100% Functions 0/0
100% Lines 24/24

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 12 13 14 15 16 17 18 19 20 21 22 23 24 251x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import { type Rule } from '@amalia/core/models';
import { RuleType } from '@amalia/payout-definition/plans/types';
 
import { filters } from './filters';
 
export const rules = {
  commissionOnPayment: {
    id: '8befaf94-aaaf-4c03-9871-4475d93fca92',
    machineName: 'commissionOnPayment',
    name: 'Commission On Payment',
    filterId: filters.paymentClosedInPeriod.id,
    formula:
      'payment.amount * forPeriod(startOfMonth(payment.opportunity.closed), endOfMonth(payment.opportunity.closed), IF(statement.totalClosed >= user.quota, payment.opportunity.above100, payment.opportunity.under100))',
    description: null,
    type: RuleType.PAYOUT,
    planId: null,
    splitVariables: null,
    releaseConditionVariableId: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    configuration: null,
    commissionVariableId: null,
  },
} as const satisfies Record<string, Rule>;