validateDiscounts: Validate input file with discounts

Description Usage Arguments Value

Description

Function verifies the content of a file which should contain a list of discounts applicable when buying two different products. It verifies if the file contains 3 reqauired columns ('Item1', 'Item2' and 'Discount') and if the 'Discount' column has numeric values.

Usage

1
validateDiscounts(products, file = "discounts")

Arguments

file

path to the file with discount list for buying a pair of products.

Value

Function returns a list with two elements. Frst element is a logical variable with the result of validation. If the validation fails the second element on the list is the message describing what was wrong. If the validation was successfull then the second element will be a data.frame with discounts read from file.


komisarczyks/CheckoutComponent documentation built on May 20, 2019, 12:55 p.m.