//
// BusSearchObject.h
// MyProject
//
// Created by Ziv on 15/6/23.
//
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "WebService.h"

@interface Operator : NSObject
@property(nonatomic, assign) NSInteger id;
@property(nonatomic, strong) NSString *name;
@property(nonatomic, assign) BOOL isChecked;
@property(nonatomic, assign) BOOL isShow;
@end

@interface Feature : NSObject
@property(nonatomic, assign) NSString *id;
@property(nonatomic, strong) NSString *name;
@property(nonatomic, assign) BOOL isChecked;
@property(nonatomic, assign) BOOL isShow;
@end

@interface FilterData : NSObject
@property(nonatomic, strong) NSArray *departureTime;
@property(nonatomic, strong) NSMutableArray <Feature *>*feature;
@property(nonatomic, strong) NSArray *durationRange;
@property(nonatomic, strong) NSArray *durationDefaultRange;
@property(nonatomic, strong) NSArray *priceRange;
@property(nonatomic, strong) NSArray *arrivalTime;
@property(nonatomic, strong) NSArray *priceDefaultRange;
@property(nonatomic, strong) NSMutableArray <Operator *> *operator;
@end

@interface BusSearchLocationTuple : NSObject
@property (nonatomic, strong)NSString *stationCityName;
@property (nonatomic, strong) NSArray *stationList;
@end

@interface FlexiReschedulePolicy : NSObject
@property (nonatomic, assign) CGFloat flexiPrice;
@property (nonatomic, assign) CGFloat beforeTimes;
@property (nonatomic, assign) CGFloat afterTimes;
@property (nonatomic, assign) CGFloat afterHours;
@property (nonatomic, assign) CGFloat baseTimes;
@property (nonatomic, assign) CGFloat baseHours;
@end

@interface BusSearchRemark : NSObject
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, strong) NSString *policy;
@end

@interface BusSearchData : NSObject

@property (nonatomic, assign) NSInteger pid;
@property (nonatomic, assign) NSInteger stopScheduleId;
@property (nonatomic, strong) NSString *scheduleId;
@property (nonatomic, strong) NSString *productName;
@property (nonatomic, strong) NSString *displayTime;
@property (nonatomic, strong) NSString *displayArrivalTime;
@property (nonatomic, strong) NSString *apiSchema;
@property (nonatomic, assign) BOOL purchasedSeparately;
@property (nonatomic, assign) NSInteger vendorId;
@property (nonatomic, strong) NSString *operator;
@property (nonatomic, assign) CGFloat vendorStarRating;
@property (nonatomic, assign) NSInteger vendorThreeStarRatingCount;
@property (nonatomic, strong) NSString *currencySymbol;
@property (nonatomic, assign) NSInteger wifiSupport;
@property (nonatomic, assign) NSInteger nTickets;
@property (nonatomic, strong) NSString *roundtripDiscount;
@property (nonatomic, strong) NSString *additionalAmenities;
@property (nonatomic, strong) NSString *dateOption;
@property (nonatomic, assign) BOOL dynamic;
@property (nonatomic, assign) BOOL ai;
@property (nonatomic, strong) NSArray<GetProductOptionsResponsePeopleType *> *peopleType;
@property (nonatomic, strong) FlexiReschedulePolicy *flexiReschedulePolicy;
@property (nonatomic, strong) NSArray *departs;
@property (nonatomic, strong) NSArray *arrivals;

@property (nonatomic, strong) NSString *specialRemark;

@property (nonatomic, assign, readonly) BOOL isDynamicPrice;
@property (nonatomic, assign, readonly) BOOL hasFlexiTicket;
@property (nonatomic, assign, readonly) CGFloat displayPrice;

+ (UIImage *)imageForRoundtripDiscountWithSize:(CGFloat)size tintColor:(UIFont *)tintColor;
+ (UIImage *)imageForNTicketsWithSize:(CGFloat)size tintColor:(UIFont *)tintColor;
+ (UIImage *)imageForFlexiTicketWithSize:(CGFloat)size tintColor:(UIFont *)tintColor;
+ (UIImage *)imageForAdditionalAmenityWithId:(NSInteger)amenity size:(CGFloat)size tintColor:(UIFont *)tintColor;
+ (NSString *)titleForAdditionalAmenityWithId:(NSInteger)amenity;

- (NSString *)locationByCityName:(NSString *)cityName isArrival:(BOOL)isArrival;
- (NSString *)displayTimeByCityName:(NSString *)cityName isArrival:(BOOL)isArrival;
- (NSString *)lastDepartureTimeByCityName:(NSString *)cityName;
- (NSInteger)nextArrivalDayByCityName:(NSString *)cityName;
- (BOOL)isNearbyByCityName:(NSString *)cityName isArrival:(BOOL)isArrival;
- (NSString *)locationByOption:(NSString *)option isArrival:(BOOL)isArrival;
- (UIImage *)concatenateFeatureImageToSize:(CGSize)size tintColor:(UIColor *)tintColor borderWidth:(CGFloat)borderWidth;
-(NSInteger)timeFromString:(NSString *)string isArrival:(BOOL)isArrival;

@end
