Files

1811 lines
62 KiB
TypeScript

/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
/*
* This file exports the `Habit` 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.ts"
import type * as Prisma from "../internal/prismaNamespace.ts"
/**
* Model Habit
*
*/
export type HabitModel = runtime.Types.Result.DefaultSelection<Prisma.$HabitPayload>
export type AggregateHabit = {
_count: HabitCountAggregateOutputType | null
_avg: HabitAvgAggregateOutputType | null
_sum: HabitSumAggregateOutputType | null
_min: HabitMinAggregateOutputType | null
_max: HabitMaxAggregateOutputType | null
}
export type HabitAvgAggregateOutputType = {
id: number | null
userId: number | null
target: number | null
sortOrder: number | null
}
export type HabitSumAggregateOutputType = {
id: number | null
userId: number | null
target: number | null
sortOrder: number | null
}
export type HabitMinAggregateOutputType = {
id: number | null
userId: number | null
name: string | null
period: string | null
target: number | null
color: string | null
icon: string | null
note: string | null
archived: boolean | null
sortOrder: number | null
createdAt: Date | null
updatedAt: Date | null
}
export type HabitMaxAggregateOutputType = {
id: number | null
userId: number | null
name: string | null
period: string | null
target: number | null
color: string | null
icon: string | null
note: string | null
archived: boolean | null
sortOrder: number | null
createdAt: Date | null
updatedAt: Date | null
}
export type HabitCountAggregateOutputType = {
id: number
userId: number
name: number
period: number
target: number
color: number
icon: number
note: number
archived: number
sortOrder: number
createdAt: number
updatedAt: number
_all: number
}
export type HabitAvgAggregateInputType = {
id?: true
userId?: true
target?: true
sortOrder?: true
}
export type HabitSumAggregateInputType = {
id?: true
userId?: true
target?: true
sortOrder?: true
}
export type HabitMinAggregateInputType = {
id?: true
userId?: true
name?: true
period?: true
target?: true
color?: true
icon?: true
note?: true
archived?: true
sortOrder?: true
createdAt?: true
updatedAt?: true
}
export type HabitMaxAggregateInputType = {
id?: true
userId?: true
name?: true
period?: true
target?: true
color?: true
icon?: true
note?: true
archived?: true
sortOrder?: true
createdAt?: true
updatedAt?: true
}
export type HabitCountAggregateInputType = {
id?: true
userId?: true
name?: true
period?: true
target?: true
color?: true
icon?: true
note?: true
archived?: true
sortOrder?: true
createdAt?: true
updatedAt?: true
_all?: true
}
export type HabitAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Filter which Habit to aggregate.
*/
where?: Prisma.HabitWhereInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of Habits to fetch.
*/
orderBy?: Prisma.HabitOrderByWithRelationInput | Prisma.HabitOrderByWithRelationInput[]
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the start position
*/
cursor?: Prisma.HabitWhereUniqueInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` Habits 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` Habits.
*/
skip?: number
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Count returned Habits
**/
_count?: true | HabitCountAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
**/
_avg?: HabitAvgAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
**/
_sum?: HabitSumAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the minimum value
**/
_min?: HabitMinAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to find the maximum value
**/
_max?: HabitMaxAggregateInputType
}
export type GetHabitAggregateType<T extends HabitAggregateArgs> = {
[P in keyof T & keyof AggregateHabit]: P extends '_count' | 'count'
? T[P] extends true
? number
: Prisma.GetScalarType<T[P], AggregateHabit[P]>
: Prisma.GetScalarType<T[P], AggregateHabit[P]>
}
export type HabitGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.HabitWhereInput
orderBy?: Prisma.HabitOrderByWithAggregationInput | Prisma.HabitOrderByWithAggregationInput[]
by: Prisma.HabitScalarFieldEnum[] | Prisma.HabitScalarFieldEnum
having?: Prisma.HabitScalarWhereWithAggregatesInput
take?: number
skip?: number
_count?: HabitCountAggregateInputType | true
_avg?: HabitAvgAggregateInputType
_sum?: HabitSumAggregateInputType
_min?: HabitMinAggregateInputType
_max?: HabitMaxAggregateInputType
}
export type HabitGroupByOutputType = {
id: number
userId: number
name: string
period: string
target: number
color: string
icon: string
note: string
archived: boolean
sortOrder: number
createdAt: Date
updatedAt: Date
_count: HabitCountAggregateOutputType | null
_avg: HabitAvgAggregateOutputType | null
_sum: HabitSumAggregateOutputType | null
_min: HabitMinAggregateOutputType | null
_max: HabitMaxAggregateOutputType | null
}
export type GetHabitGroupByPayload<T extends HabitGroupByArgs> = Prisma.PrismaPromise<
Array<
Prisma.PickEnumerable<HabitGroupByOutputType, T['by']> &
{
[P in ((keyof T) & (keyof HabitGroupByOutputType))]: P extends '_count'
? T[P] extends boolean
? number
: Prisma.GetScalarType<T[P], HabitGroupByOutputType[P]>
: Prisma.GetScalarType<T[P], HabitGroupByOutputType[P]>
}
>
>
export type HabitWhereInput = {
AND?: Prisma.HabitWhereInput | Prisma.HabitWhereInput[]
OR?: Prisma.HabitWhereInput[]
NOT?: Prisma.HabitWhereInput | Prisma.HabitWhereInput[]
id?: Prisma.IntFilter<"Habit"> | number
userId?: Prisma.IntFilter<"Habit"> | number
name?: Prisma.StringFilter<"Habit"> | string
period?: Prisma.StringFilter<"Habit"> | string
target?: Prisma.IntFilter<"Habit"> | number
color?: Prisma.StringFilter<"Habit"> | string
icon?: Prisma.StringFilter<"Habit"> | string
note?: Prisma.StringFilter<"Habit"> | string
archived?: Prisma.BoolFilter<"Habit"> | boolean
sortOrder?: Prisma.IntFilter<"Habit"> | number
createdAt?: Prisma.DateTimeFilter<"Habit"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Habit"> | Date | string
user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
records?: Prisma.CheckInListRelationFilter
}
export type HabitOrderByWithRelationInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
name?: Prisma.SortOrder
period?: Prisma.SortOrder
target?: Prisma.SortOrder
color?: Prisma.SortOrder
icon?: Prisma.SortOrder
note?: Prisma.SortOrder
archived?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
user?: Prisma.UserOrderByWithRelationInput
records?: Prisma.CheckInOrderByRelationAggregateInput
}
export type HabitWhereUniqueInput = Prisma.AtLeast<{
id?: number
AND?: Prisma.HabitWhereInput | Prisma.HabitWhereInput[]
OR?: Prisma.HabitWhereInput[]
NOT?: Prisma.HabitWhereInput | Prisma.HabitWhereInput[]
userId?: Prisma.IntFilter<"Habit"> | number
name?: Prisma.StringFilter<"Habit"> | string
period?: Prisma.StringFilter<"Habit"> | string
target?: Prisma.IntFilter<"Habit"> | number
color?: Prisma.StringFilter<"Habit"> | string
icon?: Prisma.StringFilter<"Habit"> | string
note?: Prisma.StringFilter<"Habit"> | string
archived?: Prisma.BoolFilter<"Habit"> | boolean
sortOrder?: Prisma.IntFilter<"Habit"> | number
createdAt?: Prisma.DateTimeFilter<"Habit"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Habit"> | Date | string
user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
records?: Prisma.CheckInListRelationFilter
}, "id">
export type HabitOrderByWithAggregationInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
name?: Prisma.SortOrder
period?: Prisma.SortOrder
target?: Prisma.SortOrder
color?: Prisma.SortOrder
icon?: Prisma.SortOrder
note?: Prisma.SortOrder
archived?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
_count?: Prisma.HabitCountOrderByAggregateInput
_avg?: Prisma.HabitAvgOrderByAggregateInput
_max?: Prisma.HabitMaxOrderByAggregateInput
_min?: Prisma.HabitMinOrderByAggregateInput
_sum?: Prisma.HabitSumOrderByAggregateInput
}
export type HabitScalarWhereWithAggregatesInput = {
AND?: Prisma.HabitScalarWhereWithAggregatesInput | Prisma.HabitScalarWhereWithAggregatesInput[]
OR?: Prisma.HabitScalarWhereWithAggregatesInput[]
NOT?: Prisma.HabitScalarWhereWithAggregatesInput | Prisma.HabitScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"Habit"> | number
userId?: Prisma.IntWithAggregatesFilter<"Habit"> | number
name?: Prisma.StringWithAggregatesFilter<"Habit"> | string
period?: Prisma.StringWithAggregatesFilter<"Habit"> | string
target?: Prisma.IntWithAggregatesFilter<"Habit"> | number
color?: Prisma.StringWithAggregatesFilter<"Habit"> | string
icon?: Prisma.StringWithAggregatesFilter<"Habit"> | string
note?: Prisma.StringWithAggregatesFilter<"Habit"> | string
archived?: Prisma.BoolWithAggregatesFilter<"Habit"> | boolean
sortOrder?: Prisma.IntWithAggregatesFilter<"Habit"> | number
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Habit"> | Date | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Habit"> | Date | string
}
export type HabitCreateInput = {
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
user: Prisma.UserCreateNestedOneWithoutHabitsInput
records?: Prisma.CheckInCreateNestedManyWithoutHabitInput
}
export type HabitUncheckedCreateInput = {
id?: number
userId: number
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
records?: Prisma.CheckInUncheckedCreateNestedManyWithoutHabitInput
}
export type HabitUpdateInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
user?: Prisma.UserUpdateOneRequiredWithoutHabitsNestedInput
records?: Prisma.CheckInUpdateManyWithoutHabitNestedInput
}
export type HabitUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
userId?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
records?: Prisma.CheckInUncheckedUpdateManyWithoutHabitNestedInput
}
export type HabitCreateManyInput = {
id?: number
userId: number
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
}
export type HabitUpdateManyMutationInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type HabitUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
userId?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type HabitListRelationFilter = {
every?: Prisma.HabitWhereInput
some?: Prisma.HabitWhereInput
none?: Prisma.HabitWhereInput
}
export type HabitOrderByRelationAggregateInput = {
_count?: Prisma.SortOrder
}
export type HabitCountOrderByAggregateInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
name?: Prisma.SortOrder
period?: Prisma.SortOrder
target?: Prisma.SortOrder
color?: Prisma.SortOrder
icon?: Prisma.SortOrder
note?: Prisma.SortOrder
archived?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
}
export type HabitAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
target?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
}
export type HabitMaxOrderByAggregateInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
name?: Prisma.SortOrder
period?: Prisma.SortOrder
target?: Prisma.SortOrder
color?: Prisma.SortOrder
icon?: Prisma.SortOrder
note?: Prisma.SortOrder
archived?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
}
export type HabitMinOrderByAggregateInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
name?: Prisma.SortOrder
period?: Prisma.SortOrder
target?: Prisma.SortOrder
color?: Prisma.SortOrder
icon?: Prisma.SortOrder
note?: Prisma.SortOrder
archived?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
}
export type HabitSumOrderByAggregateInput = {
id?: Prisma.SortOrder
userId?: Prisma.SortOrder
target?: Prisma.SortOrder
sortOrder?: Prisma.SortOrder
}
export type HabitScalarRelationFilter = {
is?: Prisma.HabitWhereInput
isNot?: Prisma.HabitWhereInput
}
export type HabitCreateNestedManyWithoutUserInput = {
create?: Prisma.XOR<Prisma.HabitCreateWithoutUserInput, Prisma.HabitUncheckedCreateWithoutUserInput> | Prisma.HabitCreateWithoutUserInput[] | Prisma.HabitUncheckedCreateWithoutUserInput[]
connectOrCreate?: Prisma.HabitCreateOrConnectWithoutUserInput | Prisma.HabitCreateOrConnectWithoutUserInput[]
createMany?: Prisma.HabitCreateManyUserInputEnvelope
connect?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
}
export type HabitUncheckedCreateNestedManyWithoutUserInput = {
create?: Prisma.XOR<Prisma.HabitCreateWithoutUserInput, Prisma.HabitUncheckedCreateWithoutUserInput> | Prisma.HabitCreateWithoutUserInput[] | Prisma.HabitUncheckedCreateWithoutUserInput[]
connectOrCreate?: Prisma.HabitCreateOrConnectWithoutUserInput | Prisma.HabitCreateOrConnectWithoutUserInput[]
createMany?: Prisma.HabitCreateManyUserInputEnvelope
connect?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
}
export type HabitUpdateManyWithoutUserNestedInput = {
create?: Prisma.XOR<Prisma.HabitCreateWithoutUserInput, Prisma.HabitUncheckedCreateWithoutUserInput> | Prisma.HabitCreateWithoutUserInput[] | Prisma.HabitUncheckedCreateWithoutUserInput[]
connectOrCreate?: Prisma.HabitCreateOrConnectWithoutUserInput | Prisma.HabitCreateOrConnectWithoutUserInput[]
upsert?: Prisma.HabitUpsertWithWhereUniqueWithoutUserInput | Prisma.HabitUpsertWithWhereUniqueWithoutUserInput[]
createMany?: Prisma.HabitCreateManyUserInputEnvelope
set?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
disconnect?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
delete?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
connect?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
update?: Prisma.HabitUpdateWithWhereUniqueWithoutUserInput | Prisma.HabitUpdateWithWhereUniqueWithoutUserInput[]
updateMany?: Prisma.HabitUpdateManyWithWhereWithoutUserInput | Prisma.HabitUpdateManyWithWhereWithoutUserInput[]
deleteMany?: Prisma.HabitScalarWhereInput | Prisma.HabitScalarWhereInput[]
}
export type HabitUncheckedUpdateManyWithoutUserNestedInput = {
create?: Prisma.XOR<Prisma.HabitCreateWithoutUserInput, Prisma.HabitUncheckedCreateWithoutUserInput> | Prisma.HabitCreateWithoutUserInput[] | Prisma.HabitUncheckedCreateWithoutUserInput[]
connectOrCreate?: Prisma.HabitCreateOrConnectWithoutUserInput | Prisma.HabitCreateOrConnectWithoutUserInput[]
upsert?: Prisma.HabitUpsertWithWhereUniqueWithoutUserInput | Prisma.HabitUpsertWithWhereUniqueWithoutUserInput[]
createMany?: Prisma.HabitCreateManyUserInputEnvelope
set?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
disconnect?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
delete?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
connect?: Prisma.HabitWhereUniqueInput | Prisma.HabitWhereUniqueInput[]
update?: Prisma.HabitUpdateWithWhereUniqueWithoutUserInput | Prisma.HabitUpdateWithWhereUniqueWithoutUserInput[]
updateMany?: Prisma.HabitUpdateManyWithWhereWithoutUserInput | Prisma.HabitUpdateManyWithWhereWithoutUserInput[]
deleteMany?: Prisma.HabitScalarWhereInput | Prisma.HabitScalarWhereInput[]
}
export type HabitCreateNestedOneWithoutRecordsInput = {
create?: Prisma.XOR<Prisma.HabitCreateWithoutRecordsInput, Prisma.HabitUncheckedCreateWithoutRecordsInput>
connectOrCreate?: Prisma.HabitCreateOrConnectWithoutRecordsInput
connect?: Prisma.HabitWhereUniqueInput
}
export type HabitUpdateOneRequiredWithoutRecordsNestedInput = {
create?: Prisma.XOR<Prisma.HabitCreateWithoutRecordsInput, Prisma.HabitUncheckedCreateWithoutRecordsInput>
connectOrCreate?: Prisma.HabitCreateOrConnectWithoutRecordsInput
upsert?: Prisma.HabitUpsertWithoutRecordsInput
connect?: Prisma.HabitWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.HabitUpdateToOneWithWhereWithoutRecordsInput, Prisma.HabitUpdateWithoutRecordsInput>, Prisma.HabitUncheckedUpdateWithoutRecordsInput>
}
export type HabitCreateWithoutUserInput = {
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
records?: Prisma.CheckInCreateNestedManyWithoutHabitInput
}
export type HabitUncheckedCreateWithoutUserInput = {
id?: number
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
records?: Prisma.CheckInUncheckedCreateNestedManyWithoutHabitInput
}
export type HabitCreateOrConnectWithoutUserInput = {
where: Prisma.HabitWhereUniqueInput
create: Prisma.XOR<Prisma.HabitCreateWithoutUserInput, Prisma.HabitUncheckedCreateWithoutUserInput>
}
export type HabitCreateManyUserInputEnvelope = {
data: Prisma.HabitCreateManyUserInput | Prisma.HabitCreateManyUserInput[]
skipDuplicates?: boolean
}
export type HabitUpsertWithWhereUniqueWithoutUserInput = {
where: Prisma.HabitWhereUniqueInput
update: Prisma.XOR<Prisma.HabitUpdateWithoutUserInput, Prisma.HabitUncheckedUpdateWithoutUserInput>
create: Prisma.XOR<Prisma.HabitCreateWithoutUserInput, Prisma.HabitUncheckedCreateWithoutUserInput>
}
export type HabitUpdateWithWhereUniqueWithoutUserInput = {
where: Prisma.HabitWhereUniqueInput
data: Prisma.XOR<Prisma.HabitUpdateWithoutUserInput, Prisma.HabitUncheckedUpdateWithoutUserInput>
}
export type HabitUpdateManyWithWhereWithoutUserInput = {
where: Prisma.HabitScalarWhereInput
data: Prisma.XOR<Prisma.HabitUpdateManyMutationInput, Prisma.HabitUncheckedUpdateManyWithoutUserInput>
}
export type HabitScalarWhereInput = {
AND?: Prisma.HabitScalarWhereInput | Prisma.HabitScalarWhereInput[]
OR?: Prisma.HabitScalarWhereInput[]
NOT?: Prisma.HabitScalarWhereInput | Prisma.HabitScalarWhereInput[]
id?: Prisma.IntFilter<"Habit"> | number
userId?: Prisma.IntFilter<"Habit"> | number
name?: Prisma.StringFilter<"Habit"> | string
period?: Prisma.StringFilter<"Habit"> | string
target?: Prisma.IntFilter<"Habit"> | number
color?: Prisma.StringFilter<"Habit"> | string
icon?: Prisma.StringFilter<"Habit"> | string
note?: Prisma.StringFilter<"Habit"> | string
archived?: Prisma.BoolFilter<"Habit"> | boolean
sortOrder?: Prisma.IntFilter<"Habit"> | number
createdAt?: Prisma.DateTimeFilter<"Habit"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Habit"> | Date | string
}
export type HabitCreateWithoutRecordsInput = {
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
user: Prisma.UserCreateNestedOneWithoutHabitsInput
}
export type HabitUncheckedCreateWithoutRecordsInput = {
id?: number
userId: number
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
}
export type HabitCreateOrConnectWithoutRecordsInput = {
where: Prisma.HabitWhereUniqueInput
create: Prisma.XOR<Prisma.HabitCreateWithoutRecordsInput, Prisma.HabitUncheckedCreateWithoutRecordsInput>
}
export type HabitUpsertWithoutRecordsInput = {
update: Prisma.XOR<Prisma.HabitUpdateWithoutRecordsInput, Prisma.HabitUncheckedUpdateWithoutRecordsInput>
create: Prisma.XOR<Prisma.HabitCreateWithoutRecordsInput, Prisma.HabitUncheckedCreateWithoutRecordsInput>
where?: Prisma.HabitWhereInput
}
export type HabitUpdateToOneWithWhereWithoutRecordsInput = {
where?: Prisma.HabitWhereInput
data: Prisma.XOR<Prisma.HabitUpdateWithoutRecordsInput, Prisma.HabitUncheckedUpdateWithoutRecordsInput>
}
export type HabitUpdateWithoutRecordsInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
user?: Prisma.UserUpdateOneRequiredWithoutHabitsNestedInput
}
export type HabitUncheckedUpdateWithoutRecordsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
userId?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
export type HabitCreateManyUserInput = {
id?: number
name: string
period?: string
target?: number
color?: string
icon?: string
note?: string
archived?: boolean
sortOrder?: number
createdAt?: Date | string
updatedAt?: Date | string
}
export type HabitUpdateWithoutUserInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
records?: Prisma.CheckInUpdateManyWithoutHabitNestedInput
}
export type HabitUncheckedUpdateWithoutUserInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
records?: Prisma.CheckInUncheckedUpdateManyWithoutHabitNestedInput
}
export type HabitUncheckedUpdateManyWithoutUserInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
period?: Prisma.StringFieldUpdateOperationsInput | string
target?: Prisma.IntFieldUpdateOperationsInput | number
color?: Prisma.StringFieldUpdateOperationsInput | string
icon?: Prisma.StringFieldUpdateOperationsInput | string
note?: Prisma.StringFieldUpdateOperationsInput | string
archived?: Prisma.BoolFieldUpdateOperationsInput | boolean
sortOrder?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
/**
* Count Type HabitCountOutputType
*/
export type HabitCountOutputType = {
records: number
}
export type HabitCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
records?: boolean | HabitCountOutputTypeCountRecordsArgs
}
/**
* HabitCountOutputType without action
*/
export type HabitCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the HabitCountOutputType
*/
select?: Prisma.HabitCountOutputTypeSelect<ExtArgs> | null
}
/**
* HabitCountOutputType without action
*/
export type HabitCountOutputTypeCountRecordsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.CheckInWhereInput
}
export type HabitSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
userId?: boolean
name?: boolean
period?: boolean
target?: boolean
color?: boolean
icon?: boolean
note?: boolean
archived?: boolean
sortOrder?: boolean
createdAt?: boolean
updatedAt?: boolean
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
records?: boolean | Prisma.Habit$recordsArgs<ExtArgs>
_count?: boolean | Prisma.HabitCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["habit"]>
export type HabitSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
userId?: boolean
name?: boolean
period?: boolean
target?: boolean
color?: boolean
icon?: boolean
note?: boolean
archived?: boolean
sortOrder?: boolean
createdAt?: boolean
updatedAt?: boolean
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["habit"]>
export type HabitSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
userId?: boolean
name?: boolean
period?: boolean
target?: boolean
color?: boolean
icon?: boolean
note?: boolean
archived?: boolean
sortOrder?: boolean
createdAt?: boolean
updatedAt?: boolean
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["habit"]>
export type HabitSelectScalar = {
id?: boolean
userId?: boolean
name?: boolean
period?: boolean
target?: boolean
color?: boolean
icon?: boolean
note?: boolean
archived?: boolean
sortOrder?: boolean
createdAt?: boolean
updatedAt?: boolean
}
export type HabitOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userId" | "name" | "period" | "target" | "color" | "icon" | "note" | "archived" | "sortOrder" | "createdAt" | "updatedAt", ExtArgs["result"]["habit"]>
export type HabitInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
records?: boolean | Prisma.Habit$recordsArgs<ExtArgs>
_count?: boolean | Prisma.HabitCountOutputTypeDefaultArgs<ExtArgs>
}
export type HabitIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}
export type HabitIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}
export type $HabitPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
name: "Habit"
objects: {
user: Prisma.$UserPayload<ExtArgs>
records: Prisma.$CheckInPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
userId: number
name: string
period: string
target: number
color: string
icon: string
note: string
archived: boolean
sortOrder: number
createdAt: Date
updatedAt: Date
}, ExtArgs["result"]["habit"]>
composites: {}
}
export type HabitGetPayload<S extends boolean | null | undefined | HabitDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$HabitPayload, S>
export type HabitCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> =
Omit<HabitFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
select?: HabitCountAggregateInputType | true
}
export interface HabitDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Habit'], meta: { name: 'Habit' } }
/**
* Find zero or one Habit that matches the filter.
* @param {HabitFindUniqueArgs} args - Arguments to find a Habit
* @example
* // Get one Habit
* const habit = await prisma.habit.findUnique({
* where: {
* // ... provide filter here
* }
* })
*/
findUnique<T extends HabitFindUniqueArgs>(args: Prisma.SelectSubset<T, HabitFindUniqueArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
/**
* Find one Habit that matches the filter or throw an error with `error.code='P2025'`
* if no matches were found.
* @param {HabitFindUniqueOrThrowArgs} args - Arguments to find a Habit
* @example
* // Get one Habit
* const habit = await prisma.habit.findUniqueOrThrow({
* where: {
* // ... provide filter here
* }
* })
*/
findUniqueOrThrow<T extends HabitFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, HabitFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
/**
* Find the first Habit 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 {HabitFindFirstArgs} args - Arguments to find a Habit
* @example
* // Get one Habit
* const habit = await prisma.habit.findFirst({
* where: {
* // ... provide filter here
* }
* })
*/
findFirst<T extends HabitFindFirstArgs>(args?: Prisma.SelectSubset<T, HabitFindFirstArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
/**
* Find the first Habit 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 {HabitFindFirstOrThrowArgs} args - Arguments to find a Habit
* @example
* // Get one Habit
* const habit = await prisma.habit.findFirstOrThrow({
* where: {
* // ... provide filter here
* }
* })
*/
findFirstOrThrow<T extends HabitFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, HabitFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
/**
* Find zero or more Habits 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 {HabitFindManyArgs} args - Arguments to filter and select certain fields only.
* @example
* // Get all Habits
* const habits = await prisma.habit.findMany()
*
* // Get first 10 Habits
* const habits = await prisma.habit.findMany({ take: 10 })
*
* // Only select the `id`
* const habitWithIdOnly = await prisma.habit.findMany({ select: { id: true } })
*
*/
findMany<T extends HabitFindManyArgs>(args?: Prisma.SelectSubset<T, HabitFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
/**
* Create a Habit.
* @param {HabitCreateArgs} args - Arguments to create a Habit.
* @example
* // Create one Habit
* const Habit = await prisma.habit.create({
* data: {
* // ... data to create a Habit
* }
* })
*
*/
create<T extends HabitCreateArgs>(args: Prisma.SelectSubset<T, HabitCreateArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
/**
* Create many Habits.
* @param {HabitCreateManyArgs} args - Arguments to create many Habits.
* @example
* // Create many Habits
* const habit = await prisma.habit.createMany({
* data: [
* // ... provide data here
* ]
* })
*
*/
createMany<T extends HabitCreateManyArgs>(args?: Prisma.SelectSubset<T, HabitCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>
/**
* Create many Habits and returns the data saved in the database.
* @param {HabitCreateManyAndReturnArgs} args - Arguments to create many Habits.
* @example
* // Create many Habits
* const habit = await prisma.habit.createManyAndReturn({
* data: [
* // ... provide data here
* ]
* })
*
* // Create many Habits and only return the `id`
* const habitWithIdOnly = await prisma.habit.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 HabitCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, HabitCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>
/**
* Delete a Habit.
* @param {HabitDeleteArgs} args - Arguments to delete one Habit.
* @example
* // Delete one Habit
* const Habit = await prisma.habit.delete({
* where: {
* // ... filter to delete one Habit
* }
* })
*
*/
delete<T extends HabitDeleteArgs>(args: Prisma.SelectSubset<T, HabitDeleteArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
/**
* Update one Habit.
* @param {HabitUpdateArgs} args - Arguments to update one Habit.
* @example
* // Update one Habit
* const habit = await prisma.habit.update({
* where: {
* // ... provide filter here
* },
* data: {
* // ... provide data here
* }
* })
*
*/
update<T extends HabitUpdateArgs>(args: Prisma.SelectSubset<T, HabitUpdateArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
/**
* Delete zero or more Habits.
* @param {HabitDeleteManyArgs} args - Arguments to filter Habits to delete.
* @example
* // Delete a few Habits
* const { count } = await prisma.habit.deleteMany({
* where: {
* // ... provide filter here
* }
* })
*
*/
deleteMany<T extends HabitDeleteManyArgs>(args?: Prisma.SelectSubset<T, HabitDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>
/**
* Update zero or more Habits.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {HabitUpdateManyArgs} args - Arguments to update one or more rows.
* @example
* // Update many Habits
* const habit = await prisma.habit.updateMany({
* where: {
* // ... provide filter here
* },
* data: {
* // ... provide data here
* }
* })
*
*/
updateMany<T extends HabitUpdateManyArgs>(args: Prisma.SelectSubset<T, HabitUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>
/**
* Update zero or more Habits and returns the data updated in the database.
* @param {HabitUpdateManyAndReturnArgs} args - Arguments to update many Habits.
* @example
* // Update many Habits
* const habit = await prisma.habit.updateManyAndReturn({
* where: {
* // ... provide filter here
* },
* data: [
* // ... provide data here
* ]
* })
*
* // Update zero or more Habits and only return the `id`
* const habitWithIdOnly = await prisma.habit.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 HabitUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, HabitUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>
/**
* Create or update one Habit.
* @param {HabitUpsertArgs} args - Arguments to update or create a Habit.
* @example
* // Update or create a Habit
* const habit = await prisma.habit.upsert({
* create: {
* // ... data to create a Habit
* },
* update: {
* // ... in case it already exists, update
* },
* where: {
* // ... the filter for the Habit we want to update
* }
* })
*/
upsert<T extends HabitUpsertArgs>(args: Prisma.SelectSubset<T, HabitUpsertArgs<ExtArgs>>): Prisma.Prisma__HabitClient<runtime.Types.Result.GetResult<Prisma.$HabitPayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>
/**
* Count the number of Habits.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {HabitCountArgs} args - Arguments to filter Habits to count.
* @example
* // Count the number of Habits
* const count = await prisma.habit.count({
* where: {
* // ... the filter for the Habits we want to count
* }
* })
**/
count<T extends HabitCountArgs>(
args?: Prisma.Subset<T, HabitCountArgs>,
): Prisma.PrismaPromise<
T extends runtime.Types.Utils.Record<'select', any>
? T['select'] extends true
? number
: Prisma.GetScalarType<T['select'], HabitCountAggregateOutputType>
: number
>
/**
* Allows you to perform aggregations operations on a Habit.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {HabitAggregateArgs} 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 HabitAggregateArgs>(args: Prisma.Subset<T, HabitAggregateArgs>): Prisma.PrismaPromise<GetHabitAggregateType<T>>
/**
* Group by Habit.
* Note, that providing `undefined` is treated as the value not being there.
* Read more here: https://pris.ly/d/null-undefined
* @param {HabitGroupByArgs} 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 HabitGroupByArgs,
HasSelectOrTake extends Prisma.Or<
Prisma.Extends<'skip', Prisma.Keys<T>>,
Prisma.Extends<'take', Prisma.Keys<T>>
>,
OrderByArg extends Prisma.True extends HasSelectOrTake
? { orderBy: HabitGroupByArgs['orderBy'] }
: { orderBy?: HabitGroupByArgs['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, HabitGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetHabitGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
/**
* Fields of the Habit model
*/
readonly fields: HabitFieldRefs;
}
/**
* The delegate class that acts as a "Promise-like" for Habit.
* 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__HabitClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: "PrismaPromise"
user<T extends Prisma.UserDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.UserDefaultArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
records<T extends Prisma.Habit$recordsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Habit$recordsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$CheckInPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/**
* 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 Habit model
*/
export interface HabitFieldRefs {
readonly id: Prisma.FieldRef<"Habit", 'Int'>
readonly userId: Prisma.FieldRef<"Habit", 'Int'>
readonly name: Prisma.FieldRef<"Habit", 'String'>
readonly period: Prisma.FieldRef<"Habit", 'String'>
readonly target: Prisma.FieldRef<"Habit", 'Int'>
readonly color: Prisma.FieldRef<"Habit", 'String'>
readonly icon: Prisma.FieldRef<"Habit", 'String'>
readonly note: Prisma.FieldRef<"Habit", 'String'>
readonly archived: Prisma.FieldRef<"Habit", 'Boolean'>
readonly sortOrder: Prisma.FieldRef<"Habit", 'Int'>
readonly createdAt: Prisma.FieldRef<"Habit", 'DateTime'>
readonly updatedAt: Prisma.FieldRef<"Habit", 'DateTime'>
}
// Custom InputTypes
/**
* Habit findUnique
*/
export type HabitFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* Filter, which Habit to fetch.
*/
where: Prisma.HabitWhereUniqueInput
}
/**
* Habit findUniqueOrThrow
*/
export type HabitFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* Filter, which Habit to fetch.
*/
where: Prisma.HabitWhereUniqueInput
}
/**
* Habit findFirst
*/
export type HabitFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* Filter, which Habit to fetch.
*/
where?: Prisma.HabitWhereInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of Habits to fetch.
*/
orderBy?: Prisma.HabitOrderByWithRelationInput | Prisma.HabitOrderByWithRelationInput[]
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the position for searching for Habits.
*/
cursor?: Prisma.HabitWhereUniqueInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` Habits 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` Habits.
*/
skip?: number
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
*
* Filter by unique combinations of Habits.
*/
distinct?: Prisma.HabitScalarFieldEnum | Prisma.HabitScalarFieldEnum[]
}
/**
* Habit findFirstOrThrow
*/
export type HabitFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* Filter, which Habit to fetch.
*/
where?: Prisma.HabitWhereInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of Habits to fetch.
*/
orderBy?: Prisma.HabitOrderByWithRelationInput | Prisma.HabitOrderByWithRelationInput[]
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the position for searching for Habits.
*/
cursor?: Prisma.HabitWhereUniqueInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` Habits 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` Habits.
*/
skip?: number
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
*
* Filter by unique combinations of Habits.
*/
distinct?: Prisma.HabitScalarFieldEnum | Prisma.HabitScalarFieldEnum[]
}
/**
* Habit findMany
*/
export type HabitFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* Filter, which Habits to fetch.
*/
where?: Prisma.HabitWhereInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
*
* Determine the order of Habits to fetch.
*/
orderBy?: Prisma.HabitOrderByWithRelationInput | Prisma.HabitOrderByWithRelationInput[]
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
*
* Sets the position for listing Habits.
*/
cursor?: Prisma.HabitWhereUniqueInput
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
*
* Take `±n` Habits 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` Habits.
*/
skip?: number
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
*
* Filter by unique combinations of Habits.
*/
distinct?: Prisma.HabitScalarFieldEnum | Prisma.HabitScalarFieldEnum[]
}
/**
* Habit create
*/
export type HabitCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* The data needed to create a Habit.
*/
data: Prisma.XOR<Prisma.HabitCreateInput, Prisma.HabitUncheckedCreateInput>
}
/**
* Habit createMany
*/
export type HabitCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* The data used to create many Habits.
*/
data: Prisma.HabitCreateManyInput | Prisma.HabitCreateManyInput[]
skipDuplicates?: boolean
}
/**
* Habit createManyAndReturn
*/
export type HabitCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelectCreateManyAndReturn<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* The data used to create many Habits.
*/
data: Prisma.HabitCreateManyInput | Prisma.HabitCreateManyInput[]
skipDuplicates?: boolean
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitIncludeCreateManyAndReturn<ExtArgs> | null
}
/**
* Habit update
*/
export type HabitUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* The data needed to update a Habit.
*/
data: Prisma.XOR<Prisma.HabitUpdateInput, Prisma.HabitUncheckedUpdateInput>
/**
* Choose, which Habit to update.
*/
where: Prisma.HabitWhereUniqueInput
}
/**
* Habit updateMany
*/
export type HabitUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* The data used to update Habits.
*/
data: Prisma.XOR<Prisma.HabitUpdateManyMutationInput, Prisma.HabitUncheckedUpdateManyInput>
/**
* Filter which Habits to update
*/
where?: Prisma.HabitWhereInput
/**
* Limit how many Habits to update.
*/
limit?: number
}
/**
* Habit updateManyAndReturn
*/
export type HabitUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelectUpdateManyAndReturn<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* The data used to update Habits.
*/
data: Prisma.XOR<Prisma.HabitUpdateManyMutationInput, Prisma.HabitUncheckedUpdateManyInput>
/**
* Filter which Habits to update
*/
where?: Prisma.HabitWhereInput
/**
* Limit how many Habits to update.
*/
limit?: number
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitIncludeUpdateManyAndReturn<ExtArgs> | null
}
/**
* Habit upsert
*/
export type HabitUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* The filter to search for the Habit to update in case it exists.
*/
where: Prisma.HabitWhereUniqueInput
/**
* In case the Habit found by the `where` argument doesn't exist, create a new Habit with this data.
*/
create: Prisma.XOR<Prisma.HabitCreateInput, Prisma.HabitUncheckedCreateInput>
/**
* In case the Habit was found with the provided `where` argument, update it with this data.
*/
update: Prisma.XOR<Prisma.HabitUpdateInput, Prisma.HabitUncheckedUpdateInput>
}
/**
* Habit delete
*/
export type HabitDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
/**
* Filter which Habit to delete.
*/
where: Prisma.HabitWhereUniqueInput
}
/**
* Habit deleteMany
*/
export type HabitDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Filter which Habits to delete
*/
where?: Prisma.HabitWhereInput
/**
* Limit how many Habits to delete.
*/
limit?: number
}
/**
* Habit.records
*/
export type Habit$recordsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the CheckIn
*/
select?: Prisma.CheckInSelect<ExtArgs> | null
/**
* Omit specific fields from the CheckIn
*/
omit?: Prisma.CheckInOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.CheckInInclude<ExtArgs> | null
where?: Prisma.CheckInWhereInput
orderBy?: Prisma.CheckInOrderByWithRelationInput | Prisma.CheckInOrderByWithRelationInput[]
cursor?: Prisma.CheckInWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.CheckInScalarFieldEnum | Prisma.CheckInScalarFieldEnum[]
}
/**
* Habit without action
*/
export type HabitDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Habit
*/
select?: Prisma.HabitSelect<ExtArgs> | null
/**
* Omit specific fields from the Habit
*/
omit?: Prisma.HabitOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.HabitInclude<ExtArgs> | null
}