package kz.cafe.db.model;

import java.util.*;
import kz.cafe.constants.*;
import kz.cafe.constants.InterfaceConstants.*;
import kz.cafe.db.model.anotations.*;
import com.google.code.morphia.annotations.*;

@Entity(value="Cafe", noClassnameStored=true, concern = "SAFE")
@Indexes({@Index(unique = false, value = "name_.RU"),
          @Index(unique = false, value = "name_.EN"),
          @Index(unique = false, value = "name_.KZ"),
          @Index(unique = false, value = "address_.RU"),
          @Index(unique = false, value = "address_.EN"),
          @Index(unique = false, value = "address_.KZ")})
public class MCafe extends MAbstractDescriptor{
   private static final long serialVersionUID = 2474321033067760008L;


   @AnnotationNotExported
   public static final String F_RATE = "rate";

   
   @AnnotationRelated(foreign = MCafeType.class)
   @Indexed()
   public Integer type;

   

   @AnnotationIncusiveList(foreign = MCafeType.class)
   public Set<Integer> types = new HashSet<Integer>();
   
   
   
   @AnnotationRelated(foreign = MCity.class)
   @Indexed()
   public Integer city;
   
   
   
   public Integer rate = 0;
   
   public Integer price = 0;
   
   
   @AnnotationTime
   public int timeOpen = 600;
   @AnnotationTime
   public int timeClose = 1380;
   

   
   @AnnotationTime
   public int timeOpenWeekend = 600;
   @AnnotationTime
   public int timeCloseWeekend = 1380;
   
   
   @AnnotationTime
   public int timeOpenMo  = timeOpen;
   @AnnotationTime
   public int timeCloseMo = timeClose;
   @AnnotationTime
   public int timeOpenTu  = timeOpen;
   @AnnotationTime
   public int timeCloseTu = timeClose;
   @AnnotationTime
   public int timeOpenWe  = timeOpen;
   @AnnotationTime
   public int timeCloseWe = timeClose;
   @AnnotationTime
   public int timeOpenTh  = timeOpen;
   @AnnotationTime
   public int timeCloseTh = timeClose;
   @AnnotationTime
   public int timeOpenFr  = timeOpen;
   @AnnotationTime
   public int timeCloseFr = timeClose;
   @AnnotationTime
   public int timeOpenSa  = timeOpenWeekend;
   @AnnotationTime
   public int timeCloseSa = timeCloseWeekend;
   @AnnotationTime
   public int timeOpenSu  = timeOpenWeekend;
   @AnnotationTime
   public int timeCloseSu = timeCloseWeekend;
   
   
   
   
   @Indexed()
   public String phone = "";

   
   
   @AnnotationMultiLangString   
   @AnnotationNoExportIndex
   public Map<InterfaceConstants.LANGS, String> address = new HashMap<LANGS, String>();
   
   @AnnotationMultiLangString
   @AnnotationNotExported
   public Map<InterfaceConstants.LANGS, String> address_ = new HashMap<LANGS, String>();
   
   
   
   @AnnotationNotExported
   public double longitude;
   @AnnotationNotExported
   public double latitude;
   
   
   @AnnotationIncusiveList(foreign = MServiceType.class)
   public Set<Integer> service = new HashSet<Integer>();
   
   
   @AnnotationIncusiveList(foreign = MFaceControl.class)
   public Set<Integer> faceControl = new HashSet<Integer>();
   

   @AnnotationIncusiveList(foreign = MCuisine.class)
   public Set<Integer> cuisines = new HashSet<Integer>();
   
   

   public String coordinates = "";
   
   
   public boolean hasDelivery;
   public boolean hasReservation;
   
   
   public Integer bill_average_min;
   public Integer bill_average_max;
   
   public Integer tableTotal;
   public Integer tableFree;

   
   @AnnotationTime
   public Integer timeOrdersFrom = null;
   @AnnotationTime
   public Integer timeOrdersTo   = null;
   @AnnotationTime
   public Integer timeReservationFrom = null;
   @AnnotationTime
   public Integer timeReservationTo   = null;
   
   
   
   public MCafe(){
      super();
   }



   @Override
   public String toString(){
      return "MCafe [CID=" + ID + ", mapName=" + name + "]";
   }
}
