"use strict";

module.exports = (sequelize, DataTypes) => {
  const RealEstate = sequelize.define("RealEstate", {
    id: {
      type: DataTypes.BIGINT,
      autoIncrement: true,
      allowNull: false,
      primaryKey: true
    },
    url: {
      type: DataTypes.TEXT,
      allowNull: false
    },
    originAgencyName: {
      type: DataTypes.TEXT,
      allowNull: false,
      unique: true
    },
    agencyObjectId: {
      type: DataTypes.TEXT,
      allowNull: false,
      unique: true
    },
    realEstateType: {
      type: DataTypes.TEXT,
      allowNull: false
    },
    adType: {
      type: DataTypes.TEXT,
      allowNull: false
    },
    price: DataTypes.REAL,
    area: DataTypes.REAL,
    gardenSize: DataTypes.REAL,
    streetNumber: DataTypes.INTEGER,
    streetName: DataTypes.TEXT,
    locality: DataTypes.TEXT,
    municipality: DataTypes.TEXT,
    city: DataTypes.TEXT,
    region: DataTypes.TEXT,
    entity: DataTypes.TEXT,
    country: DataTypes.TEXT,
    locationLat: DataTypes.REAL,
    locationLong: DataTypes.REAL,
    title: DataTypes.TEXT,
    shortDescription: DataTypes.TEXT,
    longDescription: DataTypes.TEXT,
    adStatus: DataTypes.INTEGER,
    publishedDate: DataTypes.DATE,
    renewedDate: DataTypes.DATE,
    numberOfRooms: DataTypes.INTEGER,
    numberOfFloors: DataTypes.INTEGER,
    floor: DataTypes.INTEGER,
    accessRoadType: DataTypes.TEXT,
    heatingType: DataTypes.TEXT,
    furnishingType: DataTypes.TEXT,
    balcony: DataTypes.BOOLEAN,
    newBuilding: DataTypes.BOOLEAN,
    elevator: DataTypes.BOOLEAN,
    water: DataTypes.BOOLEAN,
    electricity: DataTypes.BOOLEAN,
    drainageSystem: DataTypes.BOOLEAN,
    registeredInZkBooks: DataTypes.BOOLEAN,
    recentlyAdapted: DataTypes.BOOLEAN,
    parking: DataTypes.BOOLEAN,
    garage: DataTypes.BOOLEAN,
    gas: DataTypes.BOOLEAN,
    antiTheftDoor: DataTypes.BOOLEAN,
    airCondition: DataTypes.BOOLEAN,
    phoneConnection: DataTypes.BOOLEAN,
    cableTV: DataTypes.BOOLEAN,
    internet: DataTypes.BOOLEAN,
    basementAttic: DataTypes.BOOLEAN,
    storeRoom: DataTypes.BOOLEAN,
    videoSurveillance: DataTypes.BOOLEAN,
    alarm: DataTypes.BOOLEAN,
    suitableForStudents: DataTypes.BOOLEAN,
    includingBills: DataTypes.BOOLEAN,
    animalsAllowed: DataTypes.BOOLEAN,
    pool: DataTypes.BOOLEAN,
    exchange: DataTypes.BOOLEAN,
    urbanPlanPermit: DataTypes.BOOLEAN,
    buildingPermit: DataTypes.BOOLEAN,
    utilityConnection: DataTypes.BOOLEAN,
    distanceToRiver: DataTypes.INTEGER,
    numberOfViewsAgency: DataTypes.INTEGER,
    numberOfViewsKivi: DataTypes.INTEGER
  });

  return RealEstate;
};
