//
// User.m
// GoToBus
//
// Created by iphone development on 6/5/13.
//
//

#import "User.h"
#import "SDK.h"
#import <BlocksKit/BlocksKit.h>

@implementation User

- (instancetype)init {
	if (self = [super init]) {
		self.contactInfos = [NSMutableArray array];
		self.creditCards = [NSMutableArray array];
	}
	return self;
}

#pragma mark - Property

- (BOOL)is_vendor {
	return self.role >= 3;
}

- (BOOL)is_support {
	return self.role >= 6;
}

- (BOOL)is_vendor_not_support {
	return self.role >= 3 && self.role < 6;
}

#pragma mark - Public

+ (UIColor *)colorForBlockStatus:(NSInteger)blockStatus {
	switch (blockStatus) {
		case 1:
			return [UIColor cloverColor];

		case 2:
			return [UIColor greenColor];

		case 3:
			return [UIColor tangerineColor];

		default:
			return [UIColor redColor];
	}
}

+ (NSString *)nameForBlockStatus:(NSInteger)blockStatus {
	switch (blockStatus) {
		case 1:
			return @"Safe";

		case 2:
			return @"Likely Safe";

		case 3:
			return @"Likely Unsafe";

		default:
			return @"Unsafe";
	}
}

@end
