//
//  GTOPatrolPlan.m
//  total
//
//  Created by freecui on 15/9/11.
//  Copyright (c) 2015年 free. All rights reserved.
//

#import "GTOPatrolPlan.h"
#import "GTOQuestion.h"
#import "GTOInspector.h"
@implementation GTOPatrolPlan

+ (NSDictionary *)specialKeysAndReplaceKeys {
    return @{@"PatrolPlanUuid":[[self class]PrimaryKey]};
}

+ (NSString *)PrimaryKey {
    return @"uuid";
}

- (UIColor *)stateColor {
    switch (self.state) {
      case kPatrolPlanStatusCreated: {
        _stateColor = GTO_RED_COLOR;
        break;
      }
      case kPatrolPlanStatusCommited: {
        _stateColor = [UIColor redColor];
        break;
      }
      case kPatrolPlanStatusProcessing: {
        _stateColor = GTO_BLUE_TINT_COLOR;
        break;
      }
      case kPatrolPlanStatusFinished: {
        _stateColor = [UIColor blackColor];
        break;
      }
      case kPatrolPlanStatusCanceld: {
        _stateColor = GTO_GRAY_TINT_COLOR;
        break;
      }
  }
  return _stateColor;
}
#pragma mark - setter

//- (void)setQuestions:(NSArray *)questions {
//    if ([_questions isEqualToArray:questions]) {
//        return;
//    }
//    _questions = questions;
//    for(NSDictionary *dict in questions){
//        GTOQuestion *question = [GTOQuestion DBObject];
//       // question.planUuid = self.uuid;
//        [question praseFromJsonDict:dict];
//        
//        [self.arrSubModels addObject:question];
//    }
//}
//- (void)setInspectors:(NSArray *)inspectors {
//    if ([_inspectors isEqualToArray:inspectors]) {
//        return;
//    }
//    _inspectors = inspectors;
//    for (NSDictionary *dict in inspectors) {
//        GTOInspector *inspector = [GTOInspector DBObject];
//        [inspector praseFromJsonDict:dict];
//        
//        [self.arrSubModels addObject:inspector];
//    }
//}
@end
