import { model, Schema } from 'mongoose'

const userSchema = new Schema(
  {
    providerId: {
      type: String,
      required: true,
    },
    provider: {
      type: String,
      required: true,
    },
    name: {
      type: String,
      required: true,
    },
    email: {
      type: String,
      required: true,
    },
    visitCount: {
      type: Number,
      default: 0,
    },
    photo: String,
    lastLocation: Object,
  },
  { timestamps: true },
)

const UserModel = model('User', userSchema)
export default UserModel
