DigitalConsumer.ISS/playwright-tests/business-logic/rules/RuleEngineBuiltins.ts
chase-safelite 5d3ab0ef59
Added playwright tests into repo (#923)
* Initial import of playwright tests

* Pipeline changes for automated tests

* Modified pipeline for testing

* Attempt #2

* Attempt #3

* Added missing paren

* Removed debug stuff from pipeline

* Changes from playwright repo

* Changed pipeline for debugging

* Fix for ServiceLocationPage playwright locators

* Change pipeline to run with TEST APIs

* Moved more of Siraj's changes to this repo

* Changed where updating env occurs

* Changed location of env update again

* Escaped double quotes

* Added visible report in Azure

* Moved changes into main pipeline

* Made it so dotenv only runs config in local
2025-02-14 09:54:11 -05:00

70 lines
No EOL
2.9 KiB
TypeScript

//import { AircraftTypes, AssignmentTypes, EnhancementBundleOptions, EnhancementOptions, ModificationTypes, OpportunityTypes, ProductAttributes, ProgramTypes, TransactionSubTypes, TwentyFiveHrLeaseProducts } from "@business-logic/types/Enums";
import TestCase from "@business-logic/types/TestCase";
import { Rule } from "../types/RuleEngine";
import EnumUtils from "../../impl/utils/EnumUtils";
//import { validateEnhancementOptions, validateProductAttributes } from "./ApplicableModifications";
//import TransactionData from "@business-logic/types/TransactionData";
export enum BuiltInRules {
TransactionExists = 1000,
PricingExists = 1001,
TerminationIsMod = 1002,
TerminationHasReason = 1003,
AircraftRequirement = 1004,
ModificationTypeAssignment = 1005,
ModificationTypeTrade = 1006,
TwentyFiveHourLeaseSpecialty = 1007,
TransactionPremiumOrNonPremiumOnly = 1008,
OldTransactionPremiumOrNonPremiumOnly = 1009,
PremiumSelectionRequirement = 1010,
OldTransactionRequiresPremiumSelection = 1011,
TerminationAndRepurchaseAdjustmentAmount = 1012,
ProgramSpecificAttributes = 1013,
ProgramSpecificEnhancements = 1014,
InterimLeaseHasAircraftRate = 1015,
ShareBinderNoPremiumSelection = 1016,
TwentyFiveHourLeaseMustDefineTwentyFiveHourProduct = 1017,
PartialAssignmentHoursToBeAssigned = 1018,
MinicartLineItemsCannotBeEmpty = 1019,
WaiveInternationalFeesValue = 1020,
EarlyOutOptionTimeframeAndFeeStatus = 1021,
DelayedStartDateOffsetRequiresValue = 1020,
EnhancementsRequireAValue = 1021,
NonPremiumMMFIncentiveRequirements = 1022,
QSExecutiveRequirements = 1023
}
// Built-Ins shouldn't depend on other rules, custom rules however are supposed to depend on them
export const builtInRules: Rule<TestCase>[] =
[
//{
// id: BuiltInRules.TransactionExists,
// name: "Transaction Exists Rule",
// check: (testCase: TestCase) => {
// return testCase.transaction != null;
// }
// }, {
// id: BuiltInRules.PricingExists,
// name: "Pricing must exist on Transaction Rule",
// check: (testCase: TestCase) => {
// return testCase.transaction != null && testCase.transaction.pricing != null;
// }
// }, {
// id: BuiltInRules.TerminationIsMod,
// name: "OpportunityType Termination requires TransactionSubType Mod",
// check: (testCase: TestCase) => {
// // Check old transactions
// for (var transaction of testCase.oldTransactions) {
// if (transaction.opportunityType == OpportunityTypes.Termination)
// return transaction.subType == TransactionSubTypes.Mod;
// }
// // Check transaction
// if (testCase.transaction.opportunityType == OpportunityTypes.Termination)
// return testCase.transaction.subType == TransactionSubTypes.Mod;
// return true;
// },
// dependsOn: [BuiltInRules.TransactionExists]
// }, {
];