
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck 
/*
 * This file exports the `Purchase` 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 Purchase
 * 
 */
export type PurchaseModel = runtime.Types.Result.DefaultSelection<Prisma.$PurchasePayload>

export type AggregatePurchase = {
  _count: PurchaseCountAggregateOutputType | null
  _avg: PurchaseAvgAggregateOutputType | null
  _sum: PurchaseSumAggregateOutputType | null
  _min: PurchaseMinAggregateOutputType | null
  _max: PurchaseMaxAggregateOutputType | null
}

export type PurchaseAvgAggregateOutputType = {
  price: runtime.Decimal | null
}

export type PurchaseSumAggregateOutputType = {
  price: runtime.Decimal | null
}

export type PurchaseMinAggregateOutputType = {
  id: string | null
  userId: string | null
  courseId: string | null
  price: runtime.Decimal | null
  status: string | null
  paymentType: string | null
  snapToken: string | null
  createdAt: Date | null
  updatedAt: Date | null
}

export type PurchaseMaxAggregateOutputType = {
  id: string | null
  userId: string | null
  courseId: string | null
  price: runtime.Decimal | null
  status: string | null
  paymentType: string | null
  snapToken: string | null
  createdAt: Date | null
  updatedAt: Date | null
}

export type PurchaseCountAggregateOutputType = {
  id: number
  userId: number
  courseId: number
  price: number
  status: number
  paymentType: number
  snapToken: number
  createdAt: number
  updatedAt: number
  _all: number
}


export type PurchaseAvgAggregateInputType = {
  price?: true
}

export type PurchaseSumAggregateInputType = {
  price?: true
}

export type PurchaseMinAggregateInputType = {
  id?: true
  userId?: true
  courseId?: true
  price?: true
  status?: true
  paymentType?: true
  snapToken?: true
  createdAt?: true
  updatedAt?: true
}

export type PurchaseMaxAggregateInputType = {
  id?: true
  userId?: true
  courseId?: true
  price?: true
  status?: true
  paymentType?: true
  snapToken?: true
  createdAt?: true
  updatedAt?: true
}

export type PurchaseCountAggregateInputType = {
  id?: true
  userId?: true
  courseId?: true
  price?: true
  status?: true
  paymentType?: true
  snapToken?: true
  createdAt?: true
  updatedAt?: true
  _all?: true
}

export type PurchaseAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which Purchase to aggregate.
   */
  where?: Prisma.PurchaseWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Purchases to fetch.
   */
  orderBy?: Prisma.PurchaseOrderByWithRelationInput | Prisma.PurchaseOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the start position
   */
  cursor?: Prisma.PurchaseWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Purchases 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` Purchases.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Count returned Purchases
  **/
  _count?: true | PurchaseCountAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to average
  **/
  _avg?: PurchaseAvgAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to sum
  **/
  _sum?: PurchaseSumAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the minimum value
  **/
  _min?: PurchaseMinAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the maximum value
  **/
  _max?: PurchaseMaxAggregateInputType
}

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




export type PurchaseGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.PurchaseWhereInput
  orderBy?: Prisma.PurchaseOrderByWithAggregationInput | Prisma.PurchaseOrderByWithAggregationInput[]
  by: Prisma.PurchaseScalarFieldEnum[] | Prisma.PurchaseScalarFieldEnum
  having?: Prisma.PurchaseScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: PurchaseCountAggregateInputType | true
  _avg?: PurchaseAvgAggregateInputType
  _sum?: PurchaseSumAggregateInputType
  _min?: PurchaseMinAggregateInputType
  _max?: PurchaseMaxAggregateInputType
}

export type PurchaseGroupByOutputType = {
  id: string
  userId: string
  courseId: string
  price: runtime.Decimal
  status: string
  paymentType: string | null
  snapToken: string | null
  createdAt: Date
  updatedAt: Date
  _count: PurchaseCountAggregateOutputType | null
  _avg: PurchaseAvgAggregateOutputType | null
  _sum: PurchaseSumAggregateOutputType | null
  _min: PurchaseMinAggregateOutputType | null
  _max: PurchaseMaxAggregateOutputType | null
}

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



export type PurchaseWhereInput = {
  AND?: Prisma.PurchaseWhereInput | Prisma.PurchaseWhereInput[]
  OR?: Prisma.PurchaseWhereInput[]
  NOT?: Prisma.PurchaseWhereInput | Prisma.PurchaseWhereInput[]
  id?: Prisma.StringFilter<"Purchase"> | string
  userId?: Prisma.StringFilter<"Purchase"> | string
  courseId?: Prisma.StringFilter<"Purchase"> | string
  price?: Prisma.DecimalFilter<"Purchase"> | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFilter<"Purchase"> | string
  paymentType?: Prisma.StringNullableFilter<"Purchase"> | string | null
  snapToken?: Prisma.StringNullableFilter<"Purchase"> | string | null
  createdAt?: Prisma.DateTimeFilter<"Purchase"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"Purchase"> | Date | string
  course?: Prisma.XOR<Prisma.CourseScalarRelationFilter, Prisma.CourseWhereInput>
  user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
}

export type PurchaseOrderByWithRelationInput = {
  id?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  courseId?: Prisma.SortOrder
  price?: Prisma.SortOrder
  status?: Prisma.SortOrder
  paymentType?: Prisma.SortOrderInput | Prisma.SortOrder
  snapToken?: Prisma.SortOrderInput | Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  course?: Prisma.CourseOrderByWithRelationInput
  user?: Prisma.UserOrderByWithRelationInput
  _relevance?: Prisma.PurchaseOrderByRelevanceInput
}

export type PurchaseWhereUniqueInput = Prisma.AtLeast<{
  id?: string
  AND?: Prisma.PurchaseWhereInput | Prisma.PurchaseWhereInput[]
  OR?: Prisma.PurchaseWhereInput[]
  NOT?: Prisma.PurchaseWhereInput | Prisma.PurchaseWhereInput[]
  userId?: Prisma.StringFilter<"Purchase"> | string
  courseId?: Prisma.StringFilter<"Purchase"> | string
  price?: Prisma.DecimalFilter<"Purchase"> | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFilter<"Purchase"> | string
  paymentType?: Prisma.StringNullableFilter<"Purchase"> | string | null
  snapToken?: Prisma.StringNullableFilter<"Purchase"> | string | null
  createdAt?: Prisma.DateTimeFilter<"Purchase"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"Purchase"> | Date | string
  course?: Prisma.XOR<Prisma.CourseScalarRelationFilter, Prisma.CourseWhereInput>
  user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
}, "id">

export type PurchaseOrderByWithAggregationInput = {
  id?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  courseId?: Prisma.SortOrder
  price?: Prisma.SortOrder
  status?: Prisma.SortOrder
  paymentType?: Prisma.SortOrderInput | Prisma.SortOrder
  snapToken?: Prisma.SortOrderInput | Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  _count?: Prisma.PurchaseCountOrderByAggregateInput
  _avg?: Prisma.PurchaseAvgOrderByAggregateInput
  _max?: Prisma.PurchaseMaxOrderByAggregateInput
  _min?: Prisma.PurchaseMinOrderByAggregateInput
  _sum?: Prisma.PurchaseSumOrderByAggregateInput
}

export type PurchaseScalarWhereWithAggregatesInput = {
  AND?: Prisma.PurchaseScalarWhereWithAggregatesInput | Prisma.PurchaseScalarWhereWithAggregatesInput[]
  OR?: Prisma.PurchaseScalarWhereWithAggregatesInput[]
  NOT?: Prisma.PurchaseScalarWhereWithAggregatesInput | Prisma.PurchaseScalarWhereWithAggregatesInput[]
  id?: Prisma.StringWithAggregatesFilter<"Purchase"> | string
  userId?: Prisma.StringWithAggregatesFilter<"Purchase"> | string
  courseId?: Prisma.StringWithAggregatesFilter<"Purchase"> | string
  price?: Prisma.DecimalWithAggregatesFilter<"Purchase"> | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringWithAggregatesFilter<"Purchase"> | string
  paymentType?: Prisma.StringNullableWithAggregatesFilter<"Purchase"> | string | null
  snapToken?: Prisma.StringNullableWithAggregatesFilter<"Purchase"> | string | null
  createdAt?: Prisma.DateTimeWithAggregatesFilter<"Purchase"> | Date | string
  updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Purchase"> | Date | string
}

export type PurchaseCreateInput = {
  id?: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
  course: Prisma.CourseCreateNestedOneWithoutPurchasesInput
  user: Prisma.UserCreateNestedOneWithoutPurchasesInput
}

export type PurchaseUncheckedCreateInput = {
  id?: string
  userId: string
  courseId: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PurchaseUpdateInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  course?: Prisma.CourseUpdateOneRequiredWithoutPurchasesNestedInput
  user?: Prisma.UserUpdateOneRequiredWithoutPurchasesNestedInput
}

export type PurchaseUncheckedUpdateInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  courseId?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PurchaseCreateManyInput = {
  id?: string
  userId: string
  courseId: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PurchaseUpdateManyMutationInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PurchaseUncheckedUpdateManyInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  courseId?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PurchaseListRelationFilter = {
  every?: Prisma.PurchaseWhereInput
  some?: Prisma.PurchaseWhereInput
  none?: Prisma.PurchaseWhereInput
}

export type PurchaseOrderByRelationAggregateInput = {
  _count?: Prisma.SortOrder
}

export type PurchaseOrderByRelevanceInput = {
  fields: Prisma.PurchaseOrderByRelevanceFieldEnum | Prisma.PurchaseOrderByRelevanceFieldEnum[]
  sort: Prisma.SortOrder
  search: string
}

export type PurchaseCountOrderByAggregateInput = {
  id?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  courseId?: Prisma.SortOrder
  price?: Prisma.SortOrder
  status?: Prisma.SortOrder
  paymentType?: Prisma.SortOrder
  snapToken?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type PurchaseAvgOrderByAggregateInput = {
  price?: Prisma.SortOrder
}

export type PurchaseMaxOrderByAggregateInput = {
  id?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  courseId?: Prisma.SortOrder
  price?: Prisma.SortOrder
  status?: Prisma.SortOrder
  paymentType?: Prisma.SortOrder
  snapToken?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type PurchaseMinOrderByAggregateInput = {
  id?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  courseId?: Prisma.SortOrder
  price?: Prisma.SortOrder
  status?: Prisma.SortOrder
  paymentType?: Prisma.SortOrder
  snapToken?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type PurchaseSumOrderByAggregateInput = {
  price?: Prisma.SortOrder
}

export type PurchaseCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutUserInput, Prisma.PurchaseUncheckedCreateWithoutUserInput> | Prisma.PurchaseCreateWithoutUserInput[] | Prisma.PurchaseUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutUserInput | Prisma.PurchaseCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.PurchaseCreateManyUserInputEnvelope
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
}

export type PurchaseUncheckedCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutUserInput, Prisma.PurchaseUncheckedCreateWithoutUserInput> | Prisma.PurchaseCreateWithoutUserInput[] | Prisma.PurchaseUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutUserInput | Prisma.PurchaseCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.PurchaseCreateManyUserInputEnvelope
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
}

export type PurchaseUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutUserInput, Prisma.PurchaseUncheckedCreateWithoutUserInput> | Prisma.PurchaseCreateWithoutUserInput[] | Prisma.PurchaseUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutUserInput | Prisma.PurchaseCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.PurchaseUpsertWithWhereUniqueWithoutUserInput | Prisma.PurchaseUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.PurchaseCreateManyUserInputEnvelope
  set?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  disconnect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  delete?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  update?: Prisma.PurchaseUpdateWithWhereUniqueWithoutUserInput | Prisma.PurchaseUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.PurchaseUpdateManyWithWhereWithoutUserInput | Prisma.PurchaseUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.PurchaseScalarWhereInput | Prisma.PurchaseScalarWhereInput[]
}

export type PurchaseUncheckedUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutUserInput, Prisma.PurchaseUncheckedCreateWithoutUserInput> | Prisma.PurchaseCreateWithoutUserInput[] | Prisma.PurchaseUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutUserInput | Prisma.PurchaseCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.PurchaseUpsertWithWhereUniqueWithoutUserInput | Prisma.PurchaseUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.PurchaseCreateManyUserInputEnvelope
  set?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  disconnect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  delete?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  update?: Prisma.PurchaseUpdateWithWhereUniqueWithoutUserInput | Prisma.PurchaseUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.PurchaseUpdateManyWithWhereWithoutUserInput | Prisma.PurchaseUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.PurchaseScalarWhereInput | Prisma.PurchaseScalarWhereInput[]
}

export type PurchaseCreateNestedManyWithoutCourseInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutCourseInput, Prisma.PurchaseUncheckedCreateWithoutCourseInput> | Prisma.PurchaseCreateWithoutCourseInput[] | Prisma.PurchaseUncheckedCreateWithoutCourseInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutCourseInput | Prisma.PurchaseCreateOrConnectWithoutCourseInput[]
  createMany?: Prisma.PurchaseCreateManyCourseInputEnvelope
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
}

export type PurchaseUncheckedCreateNestedManyWithoutCourseInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutCourseInput, Prisma.PurchaseUncheckedCreateWithoutCourseInput> | Prisma.PurchaseCreateWithoutCourseInput[] | Prisma.PurchaseUncheckedCreateWithoutCourseInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutCourseInput | Prisma.PurchaseCreateOrConnectWithoutCourseInput[]
  createMany?: Prisma.PurchaseCreateManyCourseInputEnvelope
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
}

export type PurchaseUpdateManyWithoutCourseNestedInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutCourseInput, Prisma.PurchaseUncheckedCreateWithoutCourseInput> | Prisma.PurchaseCreateWithoutCourseInput[] | Prisma.PurchaseUncheckedCreateWithoutCourseInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutCourseInput | Prisma.PurchaseCreateOrConnectWithoutCourseInput[]
  upsert?: Prisma.PurchaseUpsertWithWhereUniqueWithoutCourseInput | Prisma.PurchaseUpsertWithWhereUniqueWithoutCourseInput[]
  createMany?: Prisma.PurchaseCreateManyCourseInputEnvelope
  set?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  disconnect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  delete?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  update?: Prisma.PurchaseUpdateWithWhereUniqueWithoutCourseInput | Prisma.PurchaseUpdateWithWhereUniqueWithoutCourseInput[]
  updateMany?: Prisma.PurchaseUpdateManyWithWhereWithoutCourseInput | Prisma.PurchaseUpdateManyWithWhereWithoutCourseInput[]
  deleteMany?: Prisma.PurchaseScalarWhereInput | Prisma.PurchaseScalarWhereInput[]
}

export type PurchaseUncheckedUpdateManyWithoutCourseNestedInput = {
  create?: Prisma.XOR<Prisma.PurchaseCreateWithoutCourseInput, Prisma.PurchaseUncheckedCreateWithoutCourseInput> | Prisma.PurchaseCreateWithoutCourseInput[] | Prisma.PurchaseUncheckedCreateWithoutCourseInput[]
  connectOrCreate?: Prisma.PurchaseCreateOrConnectWithoutCourseInput | Prisma.PurchaseCreateOrConnectWithoutCourseInput[]
  upsert?: Prisma.PurchaseUpsertWithWhereUniqueWithoutCourseInput | Prisma.PurchaseUpsertWithWhereUniqueWithoutCourseInput[]
  createMany?: Prisma.PurchaseCreateManyCourseInputEnvelope
  set?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  disconnect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  delete?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  connect?: Prisma.PurchaseWhereUniqueInput | Prisma.PurchaseWhereUniqueInput[]
  update?: Prisma.PurchaseUpdateWithWhereUniqueWithoutCourseInput | Prisma.PurchaseUpdateWithWhereUniqueWithoutCourseInput[]
  updateMany?: Prisma.PurchaseUpdateManyWithWhereWithoutCourseInput | Prisma.PurchaseUpdateManyWithWhereWithoutCourseInput[]
  deleteMany?: Prisma.PurchaseScalarWhereInput | Prisma.PurchaseScalarWhereInput[]
}

export type PurchaseCreateWithoutUserInput = {
  id?: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
  course: Prisma.CourseCreateNestedOneWithoutPurchasesInput
}

export type PurchaseUncheckedCreateWithoutUserInput = {
  id?: string
  courseId: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PurchaseCreateOrConnectWithoutUserInput = {
  where: Prisma.PurchaseWhereUniqueInput
  create: Prisma.XOR<Prisma.PurchaseCreateWithoutUserInput, Prisma.PurchaseUncheckedCreateWithoutUserInput>
}

export type PurchaseCreateManyUserInputEnvelope = {
  data: Prisma.PurchaseCreateManyUserInput | Prisma.PurchaseCreateManyUserInput[]
  skipDuplicates?: boolean
}

export type PurchaseUpsertWithWhereUniqueWithoutUserInput = {
  where: Prisma.PurchaseWhereUniqueInput
  update: Prisma.XOR<Prisma.PurchaseUpdateWithoutUserInput, Prisma.PurchaseUncheckedUpdateWithoutUserInput>
  create: Prisma.XOR<Prisma.PurchaseCreateWithoutUserInput, Prisma.PurchaseUncheckedCreateWithoutUserInput>
}

export type PurchaseUpdateWithWhereUniqueWithoutUserInput = {
  where: Prisma.PurchaseWhereUniqueInput
  data: Prisma.XOR<Prisma.PurchaseUpdateWithoutUserInput, Prisma.PurchaseUncheckedUpdateWithoutUserInput>
}

export type PurchaseUpdateManyWithWhereWithoutUserInput = {
  where: Prisma.PurchaseScalarWhereInput
  data: Prisma.XOR<Prisma.PurchaseUpdateManyMutationInput, Prisma.PurchaseUncheckedUpdateManyWithoutUserInput>
}

export type PurchaseScalarWhereInput = {
  AND?: Prisma.PurchaseScalarWhereInput | Prisma.PurchaseScalarWhereInput[]
  OR?: Prisma.PurchaseScalarWhereInput[]
  NOT?: Prisma.PurchaseScalarWhereInput | Prisma.PurchaseScalarWhereInput[]
  id?: Prisma.StringFilter<"Purchase"> | string
  userId?: Prisma.StringFilter<"Purchase"> | string
  courseId?: Prisma.StringFilter<"Purchase"> | string
  price?: Prisma.DecimalFilter<"Purchase"> | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFilter<"Purchase"> | string
  paymentType?: Prisma.StringNullableFilter<"Purchase"> | string | null
  snapToken?: Prisma.StringNullableFilter<"Purchase"> | string | null
  createdAt?: Prisma.DateTimeFilter<"Purchase"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"Purchase"> | Date | string
}

export type PurchaseCreateWithoutCourseInput = {
  id?: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
  user: Prisma.UserCreateNestedOneWithoutPurchasesInput
}

export type PurchaseUncheckedCreateWithoutCourseInput = {
  id?: string
  userId: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PurchaseCreateOrConnectWithoutCourseInput = {
  where: Prisma.PurchaseWhereUniqueInput
  create: Prisma.XOR<Prisma.PurchaseCreateWithoutCourseInput, Prisma.PurchaseUncheckedCreateWithoutCourseInput>
}

export type PurchaseCreateManyCourseInputEnvelope = {
  data: Prisma.PurchaseCreateManyCourseInput | Prisma.PurchaseCreateManyCourseInput[]
  skipDuplicates?: boolean
}

export type PurchaseUpsertWithWhereUniqueWithoutCourseInput = {
  where: Prisma.PurchaseWhereUniqueInput
  update: Prisma.XOR<Prisma.PurchaseUpdateWithoutCourseInput, Prisma.PurchaseUncheckedUpdateWithoutCourseInput>
  create: Prisma.XOR<Prisma.PurchaseCreateWithoutCourseInput, Prisma.PurchaseUncheckedCreateWithoutCourseInput>
}

export type PurchaseUpdateWithWhereUniqueWithoutCourseInput = {
  where: Prisma.PurchaseWhereUniqueInput
  data: Prisma.XOR<Prisma.PurchaseUpdateWithoutCourseInput, Prisma.PurchaseUncheckedUpdateWithoutCourseInput>
}

export type PurchaseUpdateManyWithWhereWithoutCourseInput = {
  where: Prisma.PurchaseScalarWhereInput
  data: Prisma.XOR<Prisma.PurchaseUpdateManyMutationInput, Prisma.PurchaseUncheckedUpdateManyWithoutCourseInput>
}

export type PurchaseCreateManyUserInput = {
  id?: string
  courseId: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PurchaseUpdateWithoutUserInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  course?: Prisma.CourseUpdateOneRequiredWithoutPurchasesNestedInput
}

export type PurchaseUncheckedUpdateWithoutUserInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  courseId?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PurchaseUncheckedUpdateManyWithoutUserInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  courseId?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PurchaseCreateManyCourseInput = {
  id?: string
  userId: string
  price?: runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: string
  paymentType?: string | null
  snapToken?: string | null
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PurchaseUpdateWithoutCourseInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  user?: Prisma.UserUpdateOneRequiredWithoutPurchasesNestedInput
}

export type PurchaseUncheckedUpdateWithoutCourseInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PurchaseUncheckedUpdateManyWithoutCourseInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
  status?: Prisma.StringFieldUpdateOperationsInput | string
  paymentType?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  snapToken?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}



export type PurchaseSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  userId?: boolean
  courseId?: boolean
  price?: boolean
  status?: boolean
  paymentType?: boolean
  snapToken?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  course?: boolean | Prisma.CourseDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["purchase"]>



export type PurchaseSelectScalar = {
  id?: boolean
  userId?: boolean
  courseId?: boolean
  price?: boolean
  status?: boolean
  paymentType?: boolean
  snapToken?: boolean
  createdAt?: boolean
  updatedAt?: boolean
}

export type PurchaseOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userId" | "courseId" | "price" | "status" | "paymentType" | "snapToken" | "createdAt" | "updatedAt", ExtArgs["result"]["purchase"]>
export type PurchaseInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  course?: boolean | Prisma.CourseDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}

export type $PurchasePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "Purchase"
  objects: {
    course: Prisma.$CoursePayload<ExtArgs>
    user: Prisma.$UserPayload<ExtArgs>
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    id: string
    userId: string
    courseId: string
    price: runtime.Decimal
    status: string
    paymentType: string | null
    snapToken: string | null
    createdAt: Date
    updatedAt: Date
  }, ExtArgs["result"]["purchase"]>
  composites: {}
}

export type PurchaseGetPayload<S extends boolean | null | undefined | PurchaseDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$PurchasePayload, S>

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

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

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

  /**
   * Find the first Purchase 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 {PurchaseFindFirstArgs} args - Arguments to find a Purchase
   * @example
   * // Get one Purchase
   * const purchase = await prisma.purchase.findFirst({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirst<T extends PurchaseFindFirstArgs>(args?: Prisma.SelectSubset<T, PurchaseFindFirstArgs<ExtArgs>>): Prisma.Prisma__PurchaseClient<runtime.Types.Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first Purchase 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 {PurchaseFindFirstOrThrowArgs} args - Arguments to find a Purchase
   * @example
   * // Get one Purchase
   * const purchase = await prisma.purchase.findFirstOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirstOrThrow<T extends PurchaseFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, PurchaseFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__PurchaseClient<runtime.Types.Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find zero or more Purchases 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 {PurchaseFindManyArgs} args - Arguments to filter and select certain fields only.
   * @example
   * // Get all Purchases
   * const purchases = await prisma.purchase.findMany()
   * 
   * // Get first 10 Purchases
   * const purchases = await prisma.purchase.findMany({ take: 10 })
   * 
   * // Only select the `id`
   * const purchaseWithIdOnly = await prisma.purchase.findMany({ select: { id: true } })
   * 
   */
  findMany<T extends PurchaseFindManyArgs>(args?: Prisma.SelectSubset<T, PurchaseFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

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

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

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

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

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

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

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


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

  /**
   * Allows you to perform aggregations operations on a Purchase.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {PurchaseAggregateArgs} 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 PurchaseAggregateArgs>(args: Prisma.Subset<T, PurchaseAggregateArgs>): Prisma.PrismaPromise<GetPurchaseAggregateType<T>>

  /**
   * Group by Purchase.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {PurchaseGroupByArgs} 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 PurchaseGroupByArgs,
    HasSelectOrTake extends Prisma.Or<
      Prisma.Extends<'skip', Prisma.Keys<T>>,
      Prisma.Extends<'take', Prisma.Keys<T>>
    >,
    OrderByArg extends Prisma.True extends HasSelectOrTake
      ? { orderBy: PurchaseGroupByArgs['orderBy'] }
      : { orderBy?: PurchaseGroupByArgs['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, PurchaseGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPurchaseGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
/**
 * Fields of the Purchase model
 */
readonly fields: PurchaseFieldRefs;
}

/**
 * The delegate class that acts as a "Promise-like" for Purchase.
 * 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__PurchaseClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  course<T extends Prisma.CourseDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CourseDefaultArgs<ExtArgs>>): Prisma.Prisma__CourseClient<runtime.Types.Result.GetResult<Prisma.$CoursePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  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>
  /**
   * 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 Purchase model
 */
export interface PurchaseFieldRefs {
  readonly id: Prisma.FieldRef<"Purchase", 'String'>
  readonly userId: Prisma.FieldRef<"Purchase", 'String'>
  readonly courseId: Prisma.FieldRef<"Purchase", 'String'>
  readonly price: Prisma.FieldRef<"Purchase", 'Decimal'>
  readonly status: Prisma.FieldRef<"Purchase", 'String'>
  readonly paymentType: Prisma.FieldRef<"Purchase", 'String'>
  readonly snapToken: Prisma.FieldRef<"Purchase", 'String'>
  readonly createdAt: Prisma.FieldRef<"Purchase", 'DateTime'>
  readonly updatedAt: Prisma.FieldRef<"Purchase", 'DateTime'>
}
    

// Custom InputTypes
/**
 * Purchase findUnique
 */
export type PurchaseFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * Filter, which Purchase to fetch.
   */
  where: Prisma.PurchaseWhereUniqueInput
}

/**
 * Purchase findUniqueOrThrow
 */
export type PurchaseFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * Filter, which Purchase to fetch.
   */
  where: Prisma.PurchaseWhereUniqueInput
}

/**
 * Purchase findFirst
 */
export type PurchaseFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * Filter, which Purchase to fetch.
   */
  where?: Prisma.PurchaseWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Purchases to fetch.
   */
  orderBy?: Prisma.PurchaseOrderByWithRelationInput | Prisma.PurchaseOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for Purchases.
   */
  cursor?: Prisma.PurchaseWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Purchases 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` Purchases.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of Purchases.
   */
  distinct?: Prisma.PurchaseScalarFieldEnum | Prisma.PurchaseScalarFieldEnum[]
}

/**
 * Purchase findFirstOrThrow
 */
export type PurchaseFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * Filter, which Purchase to fetch.
   */
  where?: Prisma.PurchaseWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Purchases to fetch.
   */
  orderBy?: Prisma.PurchaseOrderByWithRelationInput | Prisma.PurchaseOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for Purchases.
   */
  cursor?: Prisma.PurchaseWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Purchases 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` Purchases.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of Purchases.
   */
  distinct?: Prisma.PurchaseScalarFieldEnum | Prisma.PurchaseScalarFieldEnum[]
}

/**
 * Purchase findMany
 */
export type PurchaseFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * Filter, which Purchases to fetch.
   */
  where?: Prisma.PurchaseWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of Purchases to fetch.
   */
  orderBy?: Prisma.PurchaseOrderByWithRelationInput | Prisma.PurchaseOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for listing Purchases.
   */
  cursor?: Prisma.PurchaseWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` Purchases 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` Purchases.
   */
  skip?: number
  distinct?: Prisma.PurchaseScalarFieldEnum | Prisma.PurchaseScalarFieldEnum[]
}

/**
 * Purchase create
 */
export type PurchaseCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * The data needed to create a Purchase.
   */
  data: Prisma.XOR<Prisma.PurchaseCreateInput, Prisma.PurchaseUncheckedCreateInput>
}

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

/**
 * Purchase update
 */
export type PurchaseUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * The data needed to update a Purchase.
   */
  data: Prisma.XOR<Prisma.PurchaseUpdateInput, Prisma.PurchaseUncheckedUpdateInput>
  /**
   * Choose, which Purchase to update.
   */
  where: Prisma.PurchaseWhereUniqueInput
}

/**
 * Purchase updateMany
 */
export type PurchaseUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update Purchases.
   */
  data: Prisma.XOR<Prisma.PurchaseUpdateManyMutationInput, Prisma.PurchaseUncheckedUpdateManyInput>
  /**
   * Filter which Purchases to update
   */
  where?: Prisma.PurchaseWhereInput
  /**
   * Limit how many Purchases to update.
   */
  limit?: number
}

/**
 * Purchase upsert
 */
export type PurchaseUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * The filter to search for the Purchase to update in case it exists.
   */
  where: Prisma.PurchaseWhereUniqueInput
  /**
   * In case the Purchase found by the `where` argument doesn't exist, create a new Purchase with this data.
   */
  create: Prisma.XOR<Prisma.PurchaseCreateInput, Prisma.PurchaseUncheckedCreateInput>
  /**
   * In case the Purchase was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.PurchaseUpdateInput, Prisma.PurchaseUncheckedUpdateInput>
}

/**
 * Purchase delete
 */
export type PurchaseDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Purchase
   */
  select?: Prisma.PurchaseSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Purchase
   */
  omit?: Prisma.PurchaseOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PurchaseInclude<ExtArgs> | null
  /**
   * Filter which Purchase to delete.
   */
  where: Prisma.PurchaseWhereUniqueInput
}

/**
 * Purchase deleteMany
 */
export type PurchaseDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which Purchases to delete
   */
  where?: Prisma.PurchaseWhereInput
  /**
   * Limit how many Purchases to delete.
   */
  limit?: number
}

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