//
// RoomBasedPrice.m
// IvyMedia
//
// Created by haibara on 9/26/14.
//
//

#import "RoomBasedPrice.h"
#import "SDK.h"
#import "Lang.h"
#import <BlocksKit/BlocksKit.h>

@implementation RoomBasedPrice

#pragma mark - Property

- (BOOL)enable_adult {
	return YES;
}

- (BOOL)enable_child_age {
	return self.child_age_from >= 0 && self.child_age_to > 0;
}

- (NSArray *)allowedTypes {
	return [[RoomBasedPrice defaultPossibleTypes] bk_select:^BOOL (id obj) {
		return [[self valueForKeyPath:[@"enable_" im_stringByAppendingString:[StringUtils uncapitalize:obj]]] boolValue];
	}];
}

#pragma mark - Public

+ (NSArray *)defaultPossibleTypes {
	return @[@"Adult", @"Child", @"Infant"];
}

@end
