package com.intland.codebeamer.functionaltest.helper;

public class FilterValues {
	
	public enum FieldType {
		Choice, Member, Reference, Date, Text, Number, Duration
	}
	
	public enum CustomDateRange {
		Today, Today_and_yesterday, YesterDay, Tomorrow, 
		Last_7_Days, Last_30_Days, Last_60_Days, Last_90_Days, Last_120_Days,
		Next_7_Days, Next_30_Days, Next_60_Days, Next_90_Days, Next_120_Days,
		This_week, Current_and_previous_week, Current_and_next_week, Last_week, Next_week,
		This_month, Current_and_last_month, Current_and_next_month, Last_month, Next_month,
		This_quarter, Current_and_previous_quarter, Current_and_next_quarter, Last_quarter, Next_quarter,
		This_year, Current_and_previous_year, Current_and_previous_2_years, 
		Current_and_next_year, Last_year, Last_2_years, Next_year 
	}
	
	public enum NumericOperator {
		greater_than, greater_than_or_equals_to, equals, less_than_or_equals_to, less_than
	}
	
	public enum TimeType {
		hour, minute, second
	}
	
	public enum OrderType {
		Ascending, Descending
	}
	
	public abstract class FilterValue {

	}

	public class TextFilterValue extends FilterValue {
		String filterValue;

		public TextFilterValue(String filterValue) {
			super();
			this.filterValue = filterValue;
		}

		public String getFilterValue() {
			return filterValue;
		}
	}
	
	public class DateFilterValue extends FilterValue {

		CustomDateRange customDateRange;
		String fromDate = "";//init empty
		String toDate = "";//init empty
		
		public DateFilterValue(CustomDateRange customDateRange) {
			super();
			this.customDateRange = customDateRange;
		}
		
		public DateFilterValue(String fromDate, String toDate) {
			super();
			this.fromDate = fromDate;
			this.toDate = toDate;
		}

		public CustomDateRange getCustomDateRange() {
			return customDateRange;
		}

		public String getFromDate() {
			return fromDate;
		}

		public String getToDate() {
			return toDate;
		}
		
	}

	public class DurationFilterValue extends FilterValue {
		NumericOperator operatorType;
		String number;
		TimeType timeType;
		
		public DurationFilterValue(NumericOperator operatorType, String number, TimeType timeType) {
			super();
			this.operatorType = operatorType;
			this.number = number;
			this.timeType = timeType;
		}

		public NumericOperator getOperatorType() {
			return operatorType;
		}

		public String getNumber() {
			return number;
		}

		public TimeType getTimeType() {
			return timeType;
		}
		
	}
	
	public class ChoiceFilterValue extends FilterValue {
		String[] selectedValues;

		public ChoiceFilterValue(String[] selectedValues) {
			super();
			this.selectedValues = selectedValues;
		}

		public String[] getSelectedValues() {
			return selectedValues;
		}
		
	}
	
	public class MemberFilterValue extends FilterValue {
		String[] selectedValues;

		public MemberFilterValue(String[] selectedValues) {
			super();
			this.selectedValues = selectedValues;
		}

		public String[] getSelectedValues() {
			return selectedValues;
		}
		
	}
	
	public class NumberFilterValue extends FilterValue {
		NumericOperator operatorType;
		String number;
		
		public NumberFilterValue(NumericOperator operatorType, String number) {
			super();
			this.operatorType = operatorType;
			this.number = number;
		}

		public NumericOperator getOperatorType() {
			return operatorType;
		}

		public String getNumber() {
			return number;
		}

	}
}
