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

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

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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 751x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 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';
import { plans } from './plans';
import { variables } from './variables';
 
export const rules = {
  finalBonus: {
    id: '21638182-eaea-4eaf-b8a5-1d72327d0e89',
    planId: plans.bonus.id,
    machineName: 'finalBonus',
    name: 'Final Bonus',
    formula: 'statement.bonusBelow50',
    filterId: null,
    description: null,
    type: RuleType.PAYOUT,
    commissionVariableId: null,
    splitVariables: null,
    releaseConditionVariableId: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    configuration: null,
  },
  fixedBonus: {
    id: '21638182-eaea-4eaf-b8a5-1d72327d0e90',
    machineName: 'fixedBonus',
    name: 'Fixed Bonus - Test condition',
    filterId: filters.closedInPeriod.id,
    formula: 'opportunity.totalAmount * 0.05',
    description: null,
    type: RuleType.PAYOUT,
    commissionVariableId: null,
    planId: null,
    splitVariables: null,
    releaseConditionVariableId: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    configuration: null,
  },
  testRelationFilter: {
    id: '36c05107-f074-4a63-8e99-1878e3a1a773',
    machineName: 'testRelationFilter',
    name: 'Test relation filter - $row',
    filterId: filters.closedInPeriod.id,
    formula: 'opportunity.licenseBonus',
    description: null,
    type: RuleType.PAYOUT,
    commissionVariableId: null,
    planId: null,
    splitVariables: null,
    releaseConditionVariableId: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    configuration: null,
  },
  holdAndRelease: {
    id: '36c05107-f074-4a63-1234-1878e3a1a773',
    machineName: 'holdAndRelease',
    name: 'Hold And Release',
    type: RuleType.HOLD_AND_RELEASE,
    filterId: filters.closedInPeriod.id,
    formula: '',
    commissionVariableId: variables.totalAmountConvertedInUserCurrency.id,
    // Releases on october 2019.
    releaseConditionVariableId: variables.testReleaseCondition.id,
    description: null,
    planId: null,
    splitVariables: null,
    createdAt: new Date(),
    updatedAt: new Date(),
    configuration: null,
  },
} as const satisfies Record<string, Rule>;