
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck 
/*
 * This file exports the `Geofence` model and its related types.
 *
 * 🟢 You can import this file directly.
 */
import type * as runtime from "@prisma/client/runtime/client"
import type * as $Enums from "../enums"
import type * as Prisma from "../internal/prismaNamespace"

/**
 * Model Geofence
 * 
 */
export type GeofenceModel = runtime.Types.Result.DefaultSelection<Prisma.$GeofencePayload>

export type AggregateGeofence = {
  _count: GeofenceCountAggregateOutputType | null
  _avg: GeofenceAvgAggregateOutputType | null
  _sum: GeofenceSumAggregateOutputType | null
  _min: GeofenceMinAggregateOutputType | null
  _max: GeofenceMaxAggregateOutputType | null
}

export type GeofenceAvgAggregateOutputType = {
  refLat: number | null
  refLng: number | null
  radiusM: number | null
}

export type GeofenceSumAggregateOutputType = {
  refLat: number | null
  refLng: number | null
  radiusM: number | null
}

export type GeofenceMinAggregateOutputType = {
  id: string | null
  deviceId: string | null
  refLat: number | null
  refLng: number | null
  radiusM: number | null
  notifyNumber: string | null
  message: string | null
  enabled: boolean | null
  lastInside: boolean | null
  lastNotifiedAt: Date | null
  createdAt: Date | null
  updatedAt: Date | null
}

export type GeofenceMaxAggregateOutputType = {
  id: string | null
  deviceId: string | null
  refLat: number | null
  refLng: number | null
  radiusM: number | null
  notifyNumber: string | null
  message: string | null
  enabled: boolean | null
  lastInside: boolean | null
  lastNotifiedAt: Date | null
  createdAt: Date | null
  updatedAt: Date | null
}

export type GeofenceCountAggregateOutputType = {
  id: number
  deviceId: number
  refLat: number
  refLng: number
  radiusM: number
  notifyNumber: number
  message: number
  enabled: number
  lastInside: number
  lastNotifiedAt: number
  createdAt: number
  updatedAt: number
  _all: number
}


export type GeofenceAvgAggregateInputType = {
  refLat?: true
  refLng?: true
  radiusM?: true
}

export type GeofenceSumAggregateInputType = {
  refLat?: true
  refLng?: true
  radiusM?: true
}

export type GeofenceMinAggregateInputType = {
  id?: true
  deviceId?: true
  refLat?: true
  refLng?: true
  radiusM?: true
  notifyNumber?: true
  message?: true
  enabled?: true
  lastInside?: true
  lastNotifiedAt?: true
  createdAt?: true
  updatedAt?: true
}

export type GeofenceMaxAggregateInputType = {
  id?: true
  deviceId?: true
  refLat?: true
  refLng?: true
  radiusM?: true
  notifyNumber?: true
  message?: true
  enabled?: true
  lastInside?: true
  lastNotifiedAt?: true
  createdAt?: true
  updatedAt?: true
}

export type GeofenceCountAggregateInputType = {
  id?: true
  deviceId?: true
  refLat?: true
  refLng?: true
  radiusM?: true
  notifyNumber?: true
  message?: true
  enabled?: true
  lastInside?: true
  lastNotifiedAt?: true
  createdAt?: true
  updatedAt?: true
  _all?: true
}

export type GeofenceAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which Geofence to aggregate.
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Geofences to fetch.
   */
  orderBy?: Prisma.GeofenceOrderByWithRelationInput | Prisma.GeofenceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the start position
   */
  cursor?: Prisma.GeofenceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Geofences from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` Geofences.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Count returned Geofences
  **/
  _count?: true | GeofenceCountAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to average
  **/
  _avg?: GeofenceAvgAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to sum
  **/
  _sum?: GeofenceSumAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the minimum value
  **/
  _min?: GeofenceMinAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the maximum value
  **/
  _max?: GeofenceMaxAggregateInputType
}

export type GetGeofenceAggregateType<T extends GeofenceAggregateArgs> = {
      [P in keyof T & keyof AggregateGeofence]: P extends '_count' | 'count'
    ? T[P] extends true
      ? number
      : Prisma.GetScalarType<T[P], AggregateGeofence[P]>
    : Prisma.GetScalarType<T[P], AggregateGeofence[P]>
}




export type GeofenceGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.GeofenceWhereInput
  orderBy?: Prisma.GeofenceOrderByWithAggregationInput | Prisma.GeofenceOrderByWithAggregationInput[]
  by: Prisma.GeofenceScalarFieldEnum[] | Prisma.GeofenceScalarFieldEnum
  having?: Prisma.GeofenceScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: GeofenceCountAggregateInputType | true
  _avg?: GeofenceAvgAggregateInputType
  _sum?: GeofenceSumAggregateInputType
  _min?: GeofenceMinAggregateInputType
  _max?: GeofenceMaxAggregateInputType
}

export type GeofenceGroupByOutputType = {
  id: string
  deviceId: string
  refLat: number
  refLng: number
  radiusM: number
  notifyNumber: string
  message: string | null
  enabled: boolean
  lastInside: boolean | null
  lastNotifiedAt: Date | null
  createdAt: Date
  updatedAt: Date
  _count: GeofenceCountAggregateOutputType | null
  _avg: GeofenceAvgAggregateOutputType | null
  _sum: GeofenceSumAggregateOutputType | null
  _min: GeofenceMinAggregateOutputType | null
  _max: GeofenceMaxAggregateOutputType | null
}

export type GetGeofenceGroupByPayload<T extends GeofenceGroupByArgs> = Prisma.PrismaPromise<
  Array<
    Prisma.PickEnumerable<GeofenceGroupByOutputType, T['by']> &
      {
        [P in ((keyof T) & (keyof GeofenceGroupByOutputType))]: P extends '_count'
          ? T[P] extends boolean
            ? number
            : Prisma.GetScalarType<T[P], GeofenceGroupByOutputType[P]>
          : Prisma.GetScalarType<T[P], GeofenceGroupByOutputType[P]>
      }
    >
  >



export type GeofenceWhereInput = {
  AND?: Prisma.GeofenceWhereInput | Prisma.GeofenceWhereInput[]
  OR?: Prisma.GeofenceWhereInput[]
  NOT?: Prisma.GeofenceWhereInput | Prisma.GeofenceWhereInput[]
  id?: Prisma.StringFilter<"Geofence"> | string
  deviceId?: Prisma.StringFilter<"Geofence"> | string
  refLat?: Prisma.FloatFilter<"Geofence"> | number
  refLng?: Prisma.FloatFilter<"Geofence"> | number
  radiusM?: Prisma.IntFilter<"Geofence"> | number
  notifyNumber?: Prisma.StringFilter<"Geofence"> | string
  message?: Prisma.StringNullableFilter<"Geofence"> | string | null
  enabled?: Prisma.BoolFilter<"Geofence"> | boolean
  lastInside?: Prisma.BoolNullableFilter<"Geofence"> | boolean | null
  lastNotifiedAt?: Prisma.DateTimeNullableFilter<"Geofence"> | Date | string | null
  createdAt?: Prisma.DateTimeFilter<"Geofence"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"Geofence"> | Date | string
  device?: Prisma.XOR<Prisma.DeviceScalarRelationFilter, Prisma.DeviceWhereInput>
}

export type GeofenceOrderByWithRelationInput = {
  id?: Prisma.SortOrder
  deviceId?: Prisma.SortOrder
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
  notifyNumber?: Prisma.SortOrder
  message?: Prisma.SortOrderInput | Prisma.SortOrder
  enabled?: Prisma.SortOrder
  lastInside?: Prisma.SortOrderInput | Prisma.SortOrder
  lastNotifiedAt?: Prisma.SortOrderInput | Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  device?: Prisma.DeviceOrderByWithRelationInput
}

export type GeofenceWhereUniqueInput = Prisma.AtLeast<{
  id?: string
  deviceId?: string
  AND?: Prisma.GeofenceWhereInput | Prisma.GeofenceWhereInput[]
  OR?: Prisma.GeofenceWhereInput[]
  NOT?: Prisma.GeofenceWhereInput | Prisma.GeofenceWhereInput[]
  refLat?: Prisma.FloatFilter<"Geofence"> | number
  refLng?: Prisma.FloatFilter<"Geofence"> | number
  radiusM?: Prisma.IntFilter<"Geofence"> | number
  notifyNumber?: Prisma.StringFilter<"Geofence"> | string
  message?: Prisma.StringNullableFilter<"Geofence"> | string | null
  enabled?: Prisma.BoolFilter<"Geofence"> | boolean
  lastInside?: Prisma.BoolNullableFilter<"Geofence"> | boolean | null
  lastNotifiedAt?: Prisma.DateTimeNullableFilter<"Geofence"> | Date | string | null
  createdAt?: Prisma.DateTimeFilter<"Geofence"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"Geofence"> | Date | string
  device?: Prisma.XOR<Prisma.DeviceScalarRelationFilter, Prisma.DeviceWhereInput>
}, "id" | "deviceId">

export type GeofenceOrderByWithAggregationInput = {
  id?: Prisma.SortOrder
  deviceId?: Prisma.SortOrder
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
  notifyNumber?: Prisma.SortOrder
  message?: Prisma.SortOrderInput | Prisma.SortOrder
  enabled?: Prisma.SortOrder
  lastInside?: Prisma.SortOrderInput | Prisma.SortOrder
  lastNotifiedAt?: Prisma.SortOrderInput | Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  _count?: Prisma.GeofenceCountOrderByAggregateInput
  _avg?: Prisma.GeofenceAvgOrderByAggregateInput
  _max?: Prisma.GeofenceMaxOrderByAggregateInput
  _min?: Prisma.GeofenceMinOrderByAggregateInput
  _sum?: Prisma.GeofenceSumOrderByAggregateInput
}

export type GeofenceScalarWhereWithAggregatesInput = {
  AND?: Prisma.GeofenceScalarWhereWithAggregatesInput | Prisma.GeofenceScalarWhereWithAggregatesInput[]
  OR?: Prisma.GeofenceScalarWhereWithAggregatesInput[]
  NOT?: Prisma.GeofenceScalarWhereWithAggregatesInput | Prisma.GeofenceScalarWhereWithAggregatesInput[]
  id?: Prisma.StringWithAggregatesFilter<"Geofence"> | string
  deviceId?: Prisma.StringWithAggregatesFilter<"Geofence"> | string
  refLat?: Prisma.FloatWithAggregatesFilter<"Geofence"> | number
  refLng?: Prisma.FloatWithAggregatesFilter<"Geofence"> | number
  radiusM?: Prisma.IntWithAggregatesFilter<"Geofence"> | number
  notifyNumber?: Prisma.StringWithAggregatesFilter<"Geofence"> | string
  message?: Prisma.StringNullableWithAggregatesFilter<"Geofence"> | string | null
  enabled?: Prisma.BoolWithAggregatesFilter<"Geofence"> | boolean
  lastInside?: Prisma.BoolNullableWithAggregatesFilter<"Geofence"> | boolean | null
  lastNotifiedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Geofence"> | Date | string | null
  createdAt?: Prisma.DateTimeWithAggregatesFilter<"Geofence"> | Date | string
  updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Geofence"> | Date | string
}

export type GeofenceCreateInput = {
  id?: string
  refLat: number
  refLng: number
  radiusM?: number
  notifyNumber: string
  message?: string | null
  enabled?: boolean
  lastInside?: boolean | null
  lastNotifiedAt?: Date | string | null
  createdAt?: Date | string
  updatedAt?: Date | string
  device: Prisma.DeviceCreateNestedOneWithoutGeofenceInput
}

export type GeofenceUncheckedCreateInput = {
  id?: string
  deviceId: string
  refLat: number
  refLng: number
  radiusM?: number
  notifyNumber: string
  message?: string | null
  enabled?: boolean
  lastInside?: boolean | null
  lastNotifiedAt?: Date | string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type GeofenceUpdateInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  refLat?: Prisma.FloatFieldUpdateOperationsInput | number
  refLng?: Prisma.FloatFieldUpdateOperationsInput | number
  radiusM?: Prisma.IntFieldUpdateOperationsInput | number
  notifyNumber?: Prisma.StringFieldUpdateOperationsInput | string
  message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
  lastInside?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
  lastNotifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  device?: Prisma.DeviceUpdateOneRequiredWithoutGeofenceNestedInput
}

export type GeofenceUncheckedUpdateInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  deviceId?: Prisma.StringFieldUpdateOperationsInput | string
  refLat?: Prisma.FloatFieldUpdateOperationsInput | number
  refLng?: Prisma.FloatFieldUpdateOperationsInput | number
  radiusM?: Prisma.IntFieldUpdateOperationsInput | number
  notifyNumber?: Prisma.StringFieldUpdateOperationsInput | string
  message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
  lastInside?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
  lastNotifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type GeofenceCreateManyInput = {
  id?: string
  deviceId: string
  refLat: number
  refLng: number
  radiusM?: number
  notifyNumber: string
  message?: string | null
  enabled?: boolean
  lastInside?: boolean | null
  lastNotifiedAt?: Date | string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type GeofenceUpdateManyMutationInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  refLat?: Prisma.FloatFieldUpdateOperationsInput | number
  refLng?: Prisma.FloatFieldUpdateOperationsInput | number
  radiusM?: Prisma.IntFieldUpdateOperationsInput | number
  notifyNumber?: Prisma.StringFieldUpdateOperationsInput | string
  message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
  lastInside?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
  lastNotifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type GeofenceUncheckedUpdateManyInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  deviceId?: Prisma.StringFieldUpdateOperationsInput | string
  refLat?: Prisma.FloatFieldUpdateOperationsInput | number
  refLng?: Prisma.FloatFieldUpdateOperationsInput | number
  radiusM?: Prisma.IntFieldUpdateOperationsInput | number
  notifyNumber?: Prisma.StringFieldUpdateOperationsInput | string
  message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
  lastInside?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
  lastNotifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type GeofenceNullableScalarRelationFilter = {
  is?: Prisma.GeofenceWhereInput | null
  isNot?: Prisma.GeofenceWhereInput | null
}

export type GeofenceCountOrderByAggregateInput = {
  id?: Prisma.SortOrder
  deviceId?: Prisma.SortOrder
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
  notifyNumber?: Prisma.SortOrder
  message?: Prisma.SortOrder
  enabled?: Prisma.SortOrder
  lastInside?: Prisma.SortOrder
  lastNotifiedAt?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type GeofenceAvgOrderByAggregateInput = {
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
}

export type GeofenceMaxOrderByAggregateInput = {
  id?: Prisma.SortOrder
  deviceId?: Prisma.SortOrder
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
  notifyNumber?: Prisma.SortOrder
  message?: Prisma.SortOrder
  enabled?: Prisma.SortOrder
  lastInside?: Prisma.SortOrder
  lastNotifiedAt?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type GeofenceMinOrderByAggregateInput = {
  id?: Prisma.SortOrder
  deviceId?: Prisma.SortOrder
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
  notifyNumber?: Prisma.SortOrder
  message?: Prisma.SortOrder
  enabled?: Prisma.SortOrder
  lastInside?: Prisma.SortOrder
  lastNotifiedAt?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type GeofenceSumOrderByAggregateInput = {
  refLat?: Prisma.SortOrder
  refLng?: Prisma.SortOrder
  radiusM?: Prisma.SortOrder
}

export type GeofenceCreateNestedOneWithoutDeviceInput = {
  create?: Prisma.XOR<Prisma.GeofenceCreateWithoutDeviceInput, Prisma.GeofenceUncheckedCreateWithoutDeviceInput>
  connectOrCreate?: Prisma.GeofenceCreateOrConnectWithoutDeviceInput
  connect?: Prisma.GeofenceWhereUniqueInput
}

export type GeofenceUncheckedCreateNestedOneWithoutDeviceInput = {
  create?: Prisma.XOR<Prisma.GeofenceCreateWithoutDeviceInput, Prisma.GeofenceUncheckedCreateWithoutDeviceInput>
  connectOrCreate?: Prisma.GeofenceCreateOrConnectWithoutDeviceInput
  connect?: Prisma.GeofenceWhereUniqueInput
}

export type GeofenceUpdateOneWithoutDeviceNestedInput = {
  create?: Prisma.XOR<Prisma.GeofenceCreateWithoutDeviceInput, Prisma.GeofenceUncheckedCreateWithoutDeviceInput>
  connectOrCreate?: Prisma.GeofenceCreateOrConnectWithoutDeviceInput
  upsert?: Prisma.GeofenceUpsertWithoutDeviceInput
  disconnect?: Prisma.GeofenceWhereInput | boolean
  delete?: Prisma.GeofenceWhereInput | boolean
  connect?: Prisma.GeofenceWhereUniqueInput
  update?: Prisma.XOR<Prisma.XOR<Prisma.GeofenceUpdateToOneWithWhereWithoutDeviceInput, Prisma.GeofenceUpdateWithoutDeviceInput>, Prisma.GeofenceUncheckedUpdateWithoutDeviceInput>
}

export type GeofenceUncheckedUpdateOneWithoutDeviceNestedInput = {
  create?: Prisma.XOR<Prisma.GeofenceCreateWithoutDeviceInput, Prisma.GeofenceUncheckedCreateWithoutDeviceInput>
  connectOrCreate?: Prisma.GeofenceCreateOrConnectWithoutDeviceInput
  upsert?: Prisma.GeofenceUpsertWithoutDeviceInput
  disconnect?: Prisma.GeofenceWhereInput | boolean
  delete?: Prisma.GeofenceWhereInput | boolean
  connect?: Prisma.GeofenceWhereUniqueInput
  update?: Prisma.XOR<Prisma.XOR<Prisma.GeofenceUpdateToOneWithWhereWithoutDeviceInput, Prisma.GeofenceUpdateWithoutDeviceInput>, Prisma.GeofenceUncheckedUpdateWithoutDeviceInput>
}

export type FloatFieldUpdateOperationsInput = {
  set?: number
  increment?: number
  decrement?: number
  multiply?: number
  divide?: number
}

export type GeofenceCreateWithoutDeviceInput = {
  id?: string
  refLat: number
  refLng: number
  radiusM?: number
  notifyNumber: string
  message?: string | null
  enabled?: boolean
  lastInside?: boolean | null
  lastNotifiedAt?: Date | string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type GeofenceUncheckedCreateWithoutDeviceInput = {
  id?: string
  refLat: number
  refLng: number
  radiusM?: number
  notifyNumber: string
  message?: string | null
  enabled?: boolean
  lastInside?: boolean | null
  lastNotifiedAt?: Date | string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type GeofenceCreateOrConnectWithoutDeviceInput = {
  where: Prisma.GeofenceWhereUniqueInput
  create: Prisma.XOR<Prisma.GeofenceCreateWithoutDeviceInput, Prisma.GeofenceUncheckedCreateWithoutDeviceInput>
}

export type GeofenceUpsertWithoutDeviceInput = {
  update: Prisma.XOR<Prisma.GeofenceUpdateWithoutDeviceInput, Prisma.GeofenceUncheckedUpdateWithoutDeviceInput>
  create: Prisma.XOR<Prisma.GeofenceCreateWithoutDeviceInput, Prisma.GeofenceUncheckedCreateWithoutDeviceInput>
  where?: Prisma.GeofenceWhereInput
}

export type GeofenceUpdateToOneWithWhereWithoutDeviceInput = {
  where?: Prisma.GeofenceWhereInput
  data: Prisma.XOR<Prisma.GeofenceUpdateWithoutDeviceInput, Prisma.GeofenceUncheckedUpdateWithoutDeviceInput>
}

export type GeofenceUpdateWithoutDeviceInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  refLat?: Prisma.FloatFieldUpdateOperationsInput | number
  refLng?: Prisma.FloatFieldUpdateOperationsInput | number
  radiusM?: Prisma.IntFieldUpdateOperationsInput | number
  notifyNumber?: Prisma.StringFieldUpdateOperationsInput | string
  message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
  lastInside?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
  lastNotifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type GeofenceUncheckedUpdateWithoutDeviceInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  refLat?: Prisma.FloatFieldUpdateOperationsInput | number
  refLng?: Prisma.FloatFieldUpdateOperationsInput | number
  radiusM?: Prisma.IntFieldUpdateOperationsInput | number
  notifyNumber?: Prisma.StringFieldUpdateOperationsInput | string
  message?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
  lastInside?: Prisma.NullableBoolFieldUpdateOperationsInput | boolean | null
  lastNotifiedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}



export type GeofenceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  deviceId?: boolean
  refLat?: boolean
  refLng?: boolean
  radiusM?: boolean
  notifyNumber?: boolean
  message?: boolean
  enabled?: boolean
  lastInside?: boolean
  lastNotifiedAt?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  device?: boolean | Prisma.DeviceDefaultArgs<ExtArgs>
}, ExtArgs["result"]["geofence"]>

export type GeofenceSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  deviceId?: boolean
  refLat?: boolean
  refLng?: boolean
  radiusM?: boolean
  notifyNumber?: boolean
  message?: boolean
  enabled?: boolean
  lastInside?: boolean
  lastNotifiedAt?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  device?: boolean | Prisma.DeviceDefaultArgs<ExtArgs>
}, ExtArgs["result"]["geofence"]>

export type GeofenceSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  deviceId?: boolean
  refLat?: boolean
  refLng?: boolean
  radiusM?: boolean
  notifyNumber?: boolean
  message?: boolean
  enabled?: boolean
  lastInside?: boolean
  lastNotifiedAt?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  device?: boolean | Prisma.DeviceDefaultArgs<ExtArgs>
}, ExtArgs["result"]["geofence"]>

export type GeofenceSelectScalar = {
  id?: boolean
  deviceId?: boolean
  refLat?: boolean
  refLng?: boolean
  radiusM?: boolean
  notifyNumber?: boolean
  message?: boolean
  enabled?: boolean
  lastInside?: boolean
  lastNotifiedAt?: boolean
  createdAt?: boolean
  updatedAt?: boolean
}

export type GeofenceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "deviceId" | "refLat" | "refLng" | "radiusM" | "notifyNumber" | "message" | "enabled" | "lastInside" | "lastNotifiedAt" | "createdAt" | "updatedAt", ExtArgs["result"]["geofence"]>
export type GeofenceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  device?: boolean | Prisma.DeviceDefaultArgs<ExtArgs>
}
export type GeofenceIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  device?: boolean | Prisma.DeviceDefaultArgs<ExtArgs>
}
export type GeofenceIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  device?: boolean | Prisma.DeviceDefaultArgs<ExtArgs>
}

export type $GeofencePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "Geofence"
  objects: {
    device: Prisma.$DevicePayload<ExtArgs>
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    id: string
    deviceId: string
    refLat: number
    refLng: number
    radiusM: number
    notifyNumber: string
    message: string | null
    enabled: boolean
    lastInside: boolean | null
    lastNotifiedAt: Date | null
    createdAt: Date
    updatedAt: Date
  }, ExtArgs["result"]["geofence"]>
  composites: {}
}

export type GeofenceGetPayload<S extends boolean | null | undefined | GeofenceDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$GeofencePayload, S>

export type GeofenceCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> =
  Omit<GeofenceFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
    select?: GeofenceCountAggregateInputType | true
  }

export interface GeofenceDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
  [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Geofence'], meta: { name: 'Geofence' } }
  /**
   * Find zero or one Geofence that matches the filter.
   * @param {GeofenceFindUniqueArgs} args - Arguments to find a Geofence
   * @example
   * // Get one Geofence
   * const geofence = await prisma.geofence.findUnique({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findUnique<T extends GeofenceFindUniqueArgs>(args: Prisma.SelectSubset<T, GeofenceFindUniqueArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find one Geofence that matches the filter or throw an error with `error.code='P2025'`
   * if no matches were found.
   * @param {GeofenceFindUniqueOrThrowArgs} args - Arguments to find a Geofence
   * @example
   * // Get one Geofence
   * const geofence = await prisma.geofence.findUniqueOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findUniqueOrThrow<T extends GeofenceFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, GeofenceFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first Geofence that matches the filter.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceFindFirstArgs} args - Arguments to find a Geofence
   * @example
   * // Get one Geofence
   * const geofence = await prisma.geofence.findFirst({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirst<T extends GeofenceFindFirstArgs>(args?: Prisma.SelectSubset<T, GeofenceFindFirstArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first Geofence that matches the filter or
   * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceFindFirstOrThrowArgs} args - Arguments to find a Geofence
   * @example
   * // Get one Geofence
   * const geofence = await prisma.geofence.findFirstOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirstOrThrow<T extends GeofenceFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, GeofenceFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find zero or more Geofences that matches the filter.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceFindManyArgs} args - Arguments to filter and select certain fields only.
   * @example
   * // Get all Geofences
   * const geofences = await prisma.geofence.findMany()
   * 
   * // Get first 10 Geofences
   * const geofences = await prisma.geofence.findMany({ take: 10 })
   * 
   * // Only select the `id`
   * const geofenceWithIdOnly = await prisma.geofence.findMany({ select: { id: true } })
   * 
   */
  findMany<T extends GeofenceFindManyArgs>(args?: Prisma.SelectSubset<T, GeofenceFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

  /**
   * Create a Geofence.
   * @param {GeofenceCreateArgs} args - Arguments to create a Geofence.
   * @example
   * // Create one Geofence
   * const Geofence = await prisma.geofence.create({
   *   data: {
   *     // ... data to create a Geofence
   *   }
   * })
   * 
   */
  create<T extends GeofenceCreateArgs>(args: Prisma.SelectSubset<T, GeofenceCreateArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Create many Geofences.
   * @param {GeofenceCreateManyArgs} args - Arguments to create many Geofences.
   * @example
   * // Create many Geofences
   * const geofence = await prisma.geofence.createMany({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   *     
   */
  createMany<T extends GeofenceCreateManyArgs>(args?: Prisma.SelectSubset<T, GeofenceCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Create many Geofences and returns the data saved in the database.
   * @param {GeofenceCreateManyAndReturnArgs} args - Arguments to create many Geofences.
   * @example
   * // Create many Geofences
   * const geofence = await prisma.geofence.createManyAndReturn({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Create many Geofences and only return the `id`
   * const geofenceWithIdOnly = await prisma.geofence.createManyAndReturn({
   *   select: { id: true },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * 
   */
  createManyAndReturn<T extends GeofenceCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, GeofenceCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

  /**
   * Delete a Geofence.
   * @param {GeofenceDeleteArgs} args - Arguments to delete one Geofence.
   * @example
   * // Delete one Geofence
   * const Geofence = await prisma.geofence.delete({
   *   where: {
   *     // ... filter to delete one Geofence
   *   }
   * })
   * 
   */
  delete<T extends GeofenceDeleteArgs>(args: Prisma.SelectSubset<T, GeofenceDeleteArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Update one Geofence.
   * @param {GeofenceUpdateArgs} args - Arguments to update one Geofence.
   * @example
   * // Update one Geofence
   * const geofence = await prisma.geofence.update({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: {
   *     // ... provide data here
   *   }
   * })
   * 
   */
  update<T extends GeofenceUpdateArgs>(args: Prisma.SelectSubset<T, GeofenceUpdateArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Delete zero or more Geofences.
   * @param {GeofenceDeleteManyArgs} args - Arguments to filter Geofences to delete.
   * @example
   * // Delete a few Geofences
   * const { count } = await prisma.geofence.deleteMany({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   * 
   */
  deleteMany<T extends GeofenceDeleteManyArgs>(args?: Prisma.SelectSubset<T, GeofenceDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Update zero or more Geofences.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceUpdateManyArgs} args - Arguments to update one or more rows.
   * @example
   * // Update many Geofences
   * const geofence = await prisma.geofence.updateMany({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: {
   *     // ... provide data here
   *   }
   * })
   * 
   */
  updateMany<T extends GeofenceUpdateManyArgs>(args: Prisma.SelectSubset<T, GeofenceUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Update zero or more Geofences and returns the data updated in the database.
   * @param {GeofenceUpdateManyAndReturnArgs} args - Arguments to update many Geofences.
   * @example
   * // Update many Geofences
   * const geofence = await prisma.geofence.updateManyAndReturn({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Update zero or more Geofences and only return the `id`
   * const geofenceWithIdOnly = await prisma.geofence.updateManyAndReturn({
   *   select: { id: true },
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * 
   */
  updateManyAndReturn<T extends GeofenceUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, GeofenceUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

  /**
   * Create or update one Geofence.
   * @param {GeofenceUpsertArgs} args - Arguments to update or create a Geofence.
   * @example
   * // Update or create a Geofence
   * const geofence = await prisma.geofence.upsert({
   *   create: {
   *     // ... data to create a Geofence
   *   },
   *   update: {
   *     // ... in case it already exists, update
   *   },
   *   where: {
   *     // ... the filter for the Geofence we want to update
   *   }
   * })
   */
  upsert<T extends GeofenceUpsertArgs>(args: Prisma.SelectSubset<T, GeofenceUpsertArgs<ExtArgs>>): Prisma.Prisma__GeofenceClient<runtime.Types.Result.GetResult<Prisma.$GeofencePayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>


  /**
   * Count the number of Geofences.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceCountArgs} args - Arguments to filter Geofences to count.
   * @example
   * // Count the number of Geofences
   * const count = await prisma.geofence.count({
   *   where: {
   *     // ... the filter for the Geofences we want to count
   *   }
   * })
  **/
  count<T extends GeofenceCountArgs>(
    args?: Prisma.Subset<T, GeofenceCountArgs>,
  ): Prisma.PrismaPromise<
    T extends runtime.Types.Utils.Record<'select', any>
      ? T['select'] extends true
        ? number
        : Prisma.GetScalarType<T['select'], GeofenceCountAggregateOutputType>
      : number
  >

  /**
   * Allows you to perform aggregations operations on a Geofence.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
   * @example
   * // Ordered by age ascending
   * // Where email contains prisma.io
   * // Limited to the 10 users
   * const aggregations = await prisma.user.aggregate({
   *   _avg: {
   *     age: true,
   *   },
   *   where: {
   *     email: {
   *       contains: "prisma.io",
   *     },
   *   },
   *   orderBy: {
   *     age: "asc",
   *   },
   *   take: 10,
   * })
  **/
  aggregate<T extends GeofenceAggregateArgs>(args: Prisma.Subset<T, GeofenceAggregateArgs>): Prisma.PrismaPromise<GetGeofenceAggregateType<T>>

  /**
   * Group by Geofence.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {GeofenceGroupByArgs} args - Group by arguments.
   * @example
   * // Group by city, order by createdAt, get count
   * const result = await prisma.user.groupBy({
   *   by: ['city', 'createdAt'],
   *   orderBy: {
   *     createdAt: true
   *   },
   *   _count: {
   *     _all: true
   *   },
   * })
   * 
  **/
  groupBy<
    T extends GeofenceGroupByArgs,
    HasSelectOrTake extends Prisma.Or<
      Prisma.Extends<'skip', Prisma.Keys<T>>,
      Prisma.Extends<'take', Prisma.Keys<T>>
    >,
    OrderByArg extends Prisma.True extends HasSelectOrTake
      ? { orderBy: GeofenceGroupByArgs['orderBy'] }
      : { orderBy?: GeofenceGroupByArgs['orderBy'] },
    OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>,
    ByFields extends Prisma.MaybeTupleToUnion<T['by']>,
    ByValid extends Prisma.Has<ByFields, OrderFields>,
    HavingFields extends Prisma.GetHavingFields<T['having']>,
    HavingValid extends Prisma.Has<ByFields, HavingFields>,
    ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False,
    InputErrors extends ByEmpty extends Prisma.True
    ? `Error: "by" must not be empty.`
    : HavingValid extends Prisma.False
    ? {
        [P in HavingFields]: P extends ByFields
          ? never
          : P extends string
          ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
          : [
              Error,
              'Field ',
              P,
              ` in "having" needs to be provided in "by"`,
            ]
      }[HavingFields]
    : 'take' extends Prisma.Keys<T>
    ? 'orderBy' extends Prisma.Keys<T>
      ? ByValid extends Prisma.True
        ? {}
        : {
            [P in OrderFields]: P extends ByFields
              ? never
              : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
          }[OrderFields]
      : 'Error: If you provide "take", you also need to provide "orderBy"'
    : 'skip' extends Prisma.Keys<T>
    ? 'orderBy' extends Prisma.Keys<T>
      ? ByValid extends Prisma.True
        ? {}
        : {
            [P in OrderFields]: P extends ByFields
              ? never
              : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
          }[OrderFields]
      : 'Error: If you provide "skip", you also need to provide "orderBy"'
    : ByValid extends Prisma.True
    ? {}
    : {
        [P in OrderFields]: P extends ByFields
          ? never
          : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
      }[OrderFields]
  >(args: Prisma.SubsetIntersection<T, GeofenceGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetGeofenceGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
/**
 * Fields of the Geofence model
 */
readonly fields: GeofenceFieldRefs;
}

/**
 * The delegate class that acts as a "Promise-like" for Geofence.
 * Why is this prefixed with `Prisma__`?
 * Because we want to prevent naming conflicts as mentioned in
 * https://github.com/prisma/prisma-client-js/issues/707
 */
export interface Prisma__GeofenceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  device<T extends Prisma.DeviceDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.DeviceDefaultArgs<ExtArgs>>): Prisma.Prisma__DeviceClient<runtime.Types.Result.GetResult<Prisma.$DevicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  /**
   * Attaches callbacks for the resolution and/or rejection of the Promise.
   * @param onfulfilled The callback to execute when the Promise is resolved.
   * @param onrejected The callback to execute when the Promise is rejected.
   * @returns A Promise for the completion of which ever callback is executed.
   */
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): runtime.Types.Utils.JsPromise<TResult1 | TResult2>
  /**
   * Attaches a callback for only the rejection of the Promise.
   * @param onrejected The callback to execute when the Promise is rejected.
   * @returns A Promise for the completion of the callback.
   */
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>
  /**
   * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
   * resolved value cannot be modified from the callback.
   * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
   * @returns A Promise for the completion of the callback.
   */
  finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>
}




/**
 * Fields of the Geofence model
 */
export interface GeofenceFieldRefs {
  readonly id: Prisma.FieldRef<"Geofence", 'String'>
  readonly deviceId: Prisma.FieldRef<"Geofence", 'String'>
  readonly refLat: Prisma.FieldRef<"Geofence", 'Float'>
  readonly refLng: Prisma.FieldRef<"Geofence", 'Float'>
  readonly radiusM: Prisma.FieldRef<"Geofence", 'Int'>
  readonly notifyNumber: Prisma.FieldRef<"Geofence", 'String'>
  readonly message: Prisma.FieldRef<"Geofence", 'String'>
  readonly enabled: Prisma.FieldRef<"Geofence", 'Boolean'>
  readonly lastInside: Prisma.FieldRef<"Geofence", 'Boolean'>
  readonly lastNotifiedAt: Prisma.FieldRef<"Geofence", 'DateTime'>
  readonly createdAt: Prisma.FieldRef<"Geofence", 'DateTime'>
  readonly updatedAt: Prisma.FieldRef<"Geofence", 'DateTime'>
}
    

// Custom InputTypes
/**
 * Geofence findUnique
 */
export type GeofenceFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * Filter, which Geofence to fetch.
   */
  where: Prisma.GeofenceWhereUniqueInput
}

/**
 * Geofence findUniqueOrThrow
 */
export type GeofenceFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * Filter, which Geofence to fetch.
   */
  where: Prisma.GeofenceWhereUniqueInput
}

/**
 * Geofence findFirst
 */
export type GeofenceFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * Filter, which Geofence to fetch.
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Geofences to fetch.
   */
  orderBy?: Prisma.GeofenceOrderByWithRelationInput | Prisma.GeofenceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for Geofences.
   */
  cursor?: Prisma.GeofenceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Geofences from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` Geofences.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of Geofences.
   */
  distinct?: Prisma.GeofenceScalarFieldEnum | Prisma.GeofenceScalarFieldEnum[]
}

/**
 * Geofence findFirstOrThrow
 */
export type GeofenceFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * Filter, which Geofence to fetch.
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Geofences to fetch.
   */
  orderBy?: Prisma.GeofenceOrderByWithRelationInput | Prisma.GeofenceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for Geofences.
   */
  cursor?: Prisma.GeofenceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Geofences from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` Geofences.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of Geofences.
   */
  distinct?: Prisma.GeofenceScalarFieldEnum | Prisma.GeofenceScalarFieldEnum[]
}

/**
 * Geofence findMany
 */
export type GeofenceFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * Filter, which Geofences to fetch.
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Geofences to fetch.
   */
  orderBy?: Prisma.GeofenceOrderByWithRelationInput | Prisma.GeofenceOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for listing Geofences.
   */
  cursor?: Prisma.GeofenceWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Geofences from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` Geofences.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of Geofences.
   */
  distinct?: Prisma.GeofenceScalarFieldEnum | Prisma.GeofenceScalarFieldEnum[]
}

/**
 * Geofence create
 */
export type GeofenceCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * The data needed to create a Geofence.
   */
  data: Prisma.XOR<Prisma.GeofenceCreateInput, Prisma.GeofenceUncheckedCreateInput>
}

/**
 * Geofence createMany
 */
export type GeofenceCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to create many Geofences.
   */
  data: Prisma.GeofenceCreateManyInput | Prisma.GeofenceCreateManyInput[]
  skipDuplicates?: boolean
}

/**
 * Geofence createManyAndReturn
 */
export type GeofenceCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelectCreateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * The data used to create many Geofences.
   */
  data: Prisma.GeofenceCreateManyInput | Prisma.GeofenceCreateManyInput[]
  skipDuplicates?: boolean
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceIncludeCreateManyAndReturn<ExtArgs> | null
}

/**
 * Geofence update
 */
export type GeofenceUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * The data needed to update a Geofence.
   */
  data: Prisma.XOR<Prisma.GeofenceUpdateInput, Prisma.GeofenceUncheckedUpdateInput>
  /**
   * Choose, which Geofence to update.
   */
  where: Prisma.GeofenceWhereUniqueInput
}

/**
 * Geofence updateMany
 */
export type GeofenceUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update Geofences.
   */
  data: Prisma.XOR<Prisma.GeofenceUpdateManyMutationInput, Prisma.GeofenceUncheckedUpdateManyInput>
  /**
   * Filter which Geofences to update
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * Limit how many Geofences to update.
   */
  limit?: number
}

/**
 * Geofence updateManyAndReturn
 */
export type GeofenceUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelectUpdateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * The data used to update Geofences.
   */
  data: Prisma.XOR<Prisma.GeofenceUpdateManyMutationInput, Prisma.GeofenceUncheckedUpdateManyInput>
  /**
   * Filter which Geofences to update
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * Limit how many Geofences to update.
   */
  limit?: number
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceIncludeUpdateManyAndReturn<ExtArgs> | null
}

/**
 * Geofence upsert
 */
export type GeofenceUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * The filter to search for the Geofence to update in case it exists.
   */
  where: Prisma.GeofenceWhereUniqueInput
  /**
   * In case the Geofence found by the `where` argument doesn't exist, create a new Geofence with this data.
   */
  create: Prisma.XOR<Prisma.GeofenceCreateInput, Prisma.GeofenceUncheckedCreateInput>
  /**
   * In case the Geofence was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.GeofenceUpdateInput, Prisma.GeofenceUncheckedUpdateInput>
}

/**
 * Geofence delete
 */
export type GeofenceDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
  /**
   * Filter which Geofence to delete.
   */
  where: Prisma.GeofenceWhereUniqueInput
}

/**
 * Geofence deleteMany
 */
export type GeofenceDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which Geofences to delete
   */
  where?: Prisma.GeofenceWhereInput
  /**
   * Limit how many Geofences to delete.
   */
  limit?: number
}

/**
 * Geofence without action
 */
export type GeofenceDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Geofence
   */
  select?: Prisma.GeofenceSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Geofence
   */
  omit?: Prisma.GeofenceOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.GeofenceInclude<ExtArgs> | null
}
