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

export type AggregateOrderItem = {
  _count: OrderItemCountAggregateOutputType | null
  _avg: OrderItemAvgAggregateOutputType | null
  _sum: OrderItemSumAggregateOutputType | null
  _min: OrderItemMinAggregateOutputType | null
  _max: OrderItemMaxAggregateOutputType | null
}

export type OrderItemAvgAggregateOutputType = {
  unitPriceCents: number | null
  quantity: number | null
}

export type OrderItemSumAggregateOutputType = {
  unitPriceCents: number | null
  quantity: number | null
}

export type OrderItemMinAggregateOutputType = {
  id: string | null
  orderId: string | null
  productId: string | null
  name: string | null
  unitPriceCents: number | null
  quantity: number | null
}

export type OrderItemMaxAggregateOutputType = {
  id: string | null
  orderId: string | null
  productId: string | null
  name: string | null
  unitPriceCents: number | null
  quantity: number | null
}

export type OrderItemCountAggregateOutputType = {
  id: number
  orderId: number
  productId: number
  name: number
  unitPriceCents: number
  quantity: number
  _all: number
}


export type OrderItemAvgAggregateInputType = {
  unitPriceCents?: true
  quantity?: true
}

export type OrderItemSumAggregateInputType = {
  unitPriceCents?: true
  quantity?: true
}

export type OrderItemMinAggregateInputType = {
  id?: true
  orderId?: true
  productId?: true
  name?: true
  unitPriceCents?: true
  quantity?: true
}

export type OrderItemMaxAggregateInputType = {
  id?: true
  orderId?: true
  productId?: true
  name?: true
  unitPriceCents?: true
  quantity?: true
}

export type OrderItemCountAggregateInputType = {
  id?: true
  orderId?: true
  productId?: true
  name?: true
  unitPriceCents?: true
  quantity?: true
  _all?: true
}

export type OrderItemAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which OrderItem to aggregate.
   */
  where?: Prisma.OrderItemWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of OrderItems to fetch.
   */
  orderBy?: Prisma.OrderItemOrderByWithRelationInput | Prisma.OrderItemOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the start position
   */
  cursor?: Prisma.OrderItemWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` OrderItems 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` OrderItems.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Count returned OrderItems
  **/
  _count?: true | OrderItemCountAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to average
  **/
  _avg?: OrderItemAvgAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to sum
  **/
  _sum?: OrderItemSumAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the minimum value
  **/
  _min?: OrderItemMinAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the maximum value
  **/
  _max?: OrderItemMaxAggregateInputType
}

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




export type OrderItemGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.OrderItemWhereInput
  orderBy?: Prisma.OrderItemOrderByWithAggregationInput | Prisma.OrderItemOrderByWithAggregationInput[]
  by: Prisma.OrderItemScalarFieldEnum[] | Prisma.OrderItemScalarFieldEnum
  having?: Prisma.OrderItemScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: OrderItemCountAggregateInputType | true
  _avg?: OrderItemAvgAggregateInputType
  _sum?: OrderItemSumAggregateInputType
  _min?: OrderItemMinAggregateInputType
  _max?: OrderItemMaxAggregateInputType
}

export type OrderItemGroupByOutputType = {
  id: string
  orderId: string
  productId: string | null
  name: string
  unitPriceCents: number
  quantity: number
  _count: OrderItemCountAggregateOutputType | null
  _avg: OrderItemAvgAggregateOutputType | null
  _sum: OrderItemSumAggregateOutputType | null
  _min: OrderItemMinAggregateOutputType | null
  _max: OrderItemMaxAggregateOutputType | null
}

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



export type OrderItemWhereInput = {
  AND?: Prisma.OrderItemWhereInput | Prisma.OrderItemWhereInput[]
  OR?: Prisma.OrderItemWhereInput[]
  NOT?: Prisma.OrderItemWhereInput | Prisma.OrderItemWhereInput[]
  id?: Prisma.StringFilter<"OrderItem"> | string
  orderId?: Prisma.StringFilter<"OrderItem"> | string
  productId?: Prisma.StringNullableFilter<"OrderItem"> | string | null
  name?: Prisma.StringFilter<"OrderItem"> | string
  unitPriceCents?: Prisma.IntFilter<"OrderItem"> | number
  quantity?: Prisma.IntFilter<"OrderItem"> | number
  order?: Prisma.XOR<Prisma.OrderScalarRelationFilter, Prisma.OrderWhereInput>
  product?: Prisma.XOR<Prisma.ProductNullableScalarRelationFilter, Prisma.ProductWhereInput> | null
}

export type OrderItemOrderByWithRelationInput = {
  id?: Prisma.SortOrder
  orderId?: Prisma.SortOrder
  productId?: Prisma.SortOrderInput | Prisma.SortOrder
  name?: Prisma.SortOrder
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
  order?: Prisma.OrderOrderByWithRelationInput
  product?: Prisma.ProductOrderByWithRelationInput
}

export type OrderItemWhereUniqueInput = Prisma.AtLeast<{
  id?: string
  AND?: Prisma.OrderItemWhereInput | Prisma.OrderItemWhereInput[]
  OR?: Prisma.OrderItemWhereInput[]
  NOT?: Prisma.OrderItemWhereInput | Prisma.OrderItemWhereInput[]
  orderId?: Prisma.StringFilter<"OrderItem"> | string
  productId?: Prisma.StringNullableFilter<"OrderItem"> | string | null
  name?: Prisma.StringFilter<"OrderItem"> | string
  unitPriceCents?: Prisma.IntFilter<"OrderItem"> | number
  quantity?: Prisma.IntFilter<"OrderItem"> | number
  order?: Prisma.XOR<Prisma.OrderScalarRelationFilter, Prisma.OrderWhereInput>
  product?: Prisma.XOR<Prisma.ProductNullableScalarRelationFilter, Prisma.ProductWhereInput> | null
}, "id">

export type OrderItemOrderByWithAggregationInput = {
  id?: Prisma.SortOrder
  orderId?: Prisma.SortOrder
  productId?: Prisma.SortOrderInput | Prisma.SortOrder
  name?: Prisma.SortOrder
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
  _count?: Prisma.OrderItemCountOrderByAggregateInput
  _avg?: Prisma.OrderItemAvgOrderByAggregateInput
  _max?: Prisma.OrderItemMaxOrderByAggregateInput
  _min?: Prisma.OrderItemMinOrderByAggregateInput
  _sum?: Prisma.OrderItemSumOrderByAggregateInput
}

export type OrderItemScalarWhereWithAggregatesInput = {
  AND?: Prisma.OrderItemScalarWhereWithAggregatesInput | Prisma.OrderItemScalarWhereWithAggregatesInput[]
  OR?: Prisma.OrderItemScalarWhereWithAggregatesInput[]
  NOT?: Prisma.OrderItemScalarWhereWithAggregatesInput | Prisma.OrderItemScalarWhereWithAggregatesInput[]
  id?: Prisma.StringWithAggregatesFilter<"OrderItem"> | string
  orderId?: Prisma.StringWithAggregatesFilter<"OrderItem"> | string
  productId?: Prisma.StringNullableWithAggregatesFilter<"OrderItem"> | string | null
  name?: Prisma.StringWithAggregatesFilter<"OrderItem"> | string
  unitPriceCents?: Prisma.IntWithAggregatesFilter<"OrderItem"> | number
  quantity?: Prisma.IntWithAggregatesFilter<"OrderItem"> | number
}

export type OrderItemCreateInput = {
  id?: string
  name: string
  unitPriceCents: number
  quantity: number
  order: Prisma.OrderCreateNestedOneWithoutItemsInput
  product?: Prisma.ProductCreateNestedOneWithoutOrderItemsInput
}

export type OrderItemUncheckedCreateInput = {
  id?: string
  orderId: string
  productId?: string | null
  name: string
  unitPriceCents: number
  quantity: number
}

export type OrderItemUpdateInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
  order?: Prisma.OrderUpdateOneRequiredWithoutItemsNestedInput
  product?: Prisma.ProductUpdateOneWithoutOrderItemsNestedInput
}

export type OrderItemUncheckedUpdateInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  orderId?: Prisma.StringFieldUpdateOperationsInput | string
  productId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}

export type OrderItemCreateManyInput = {
  id?: string
  orderId: string
  productId?: string | null
  name: string
  unitPriceCents: number
  quantity: number
}

export type OrderItemUpdateManyMutationInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}

export type OrderItemUncheckedUpdateManyInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  orderId?: Prisma.StringFieldUpdateOperationsInput | string
  productId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}

export type OrderItemListRelationFilter = {
  every?: Prisma.OrderItemWhereInput
  some?: Prisma.OrderItemWhereInput
  none?: Prisma.OrderItemWhereInput
}

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

export type OrderItemCountOrderByAggregateInput = {
  id?: Prisma.SortOrder
  orderId?: Prisma.SortOrder
  productId?: Prisma.SortOrder
  name?: Prisma.SortOrder
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
}

export type OrderItemAvgOrderByAggregateInput = {
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
}

export type OrderItemMaxOrderByAggregateInput = {
  id?: Prisma.SortOrder
  orderId?: Prisma.SortOrder
  productId?: Prisma.SortOrder
  name?: Prisma.SortOrder
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
}

export type OrderItemMinOrderByAggregateInput = {
  id?: Prisma.SortOrder
  orderId?: Prisma.SortOrder
  productId?: Prisma.SortOrder
  name?: Prisma.SortOrder
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
}

export type OrderItemSumOrderByAggregateInput = {
  unitPriceCents?: Prisma.SortOrder
  quantity?: Prisma.SortOrder
}

export type OrderItemCreateNestedManyWithoutProductInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutProductInput, Prisma.OrderItemUncheckedCreateWithoutProductInput> | Prisma.OrderItemCreateWithoutProductInput[] | Prisma.OrderItemUncheckedCreateWithoutProductInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutProductInput | Prisma.OrderItemCreateOrConnectWithoutProductInput[]
  createMany?: Prisma.OrderItemCreateManyProductInputEnvelope
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
}

export type OrderItemUncheckedCreateNestedManyWithoutProductInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutProductInput, Prisma.OrderItemUncheckedCreateWithoutProductInput> | Prisma.OrderItemCreateWithoutProductInput[] | Prisma.OrderItemUncheckedCreateWithoutProductInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutProductInput | Prisma.OrderItemCreateOrConnectWithoutProductInput[]
  createMany?: Prisma.OrderItemCreateManyProductInputEnvelope
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
}

export type OrderItemUpdateManyWithoutProductNestedInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutProductInput, Prisma.OrderItemUncheckedCreateWithoutProductInput> | Prisma.OrderItemCreateWithoutProductInput[] | Prisma.OrderItemUncheckedCreateWithoutProductInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutProductInput | Prisma.OrderItemCreateOrConnectWithoutProductInput[]
  upsert?: Prisma.OrderItemUpsertWithWhereUniqueWithoutProductInput | Prisma.OrderItemUpsertWithWhereUniqueWithoutProductInput[]
  createMany?: Prisma.OrderItemCreateManyProductInputEnvelope
  set?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  disconnect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  delete?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  update?: Prisma.OrderItemUpdateWithWhereUniqueWithoutProductInput | Prisma.OrderItemUpdateWithWhereUniqueWithoutProductInput[]
  updateMany?: Prisma.OrderItemUpdateManyWithWhereWithoutProductInput | Prisma.OrderItemUpdateManyWithWhereWithoutProductInput[]
  deleteMany?: Prisma.OrderItemScalarWhereInput | Prisma.OrderItemScalarWhereInput[]
}

export type OrderItemUncheckedUpdateManyWithoutProductNestedInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutProductInput, Prisma.OrderItemUncheckedCreateWithoutProductInput> | Prisma.OrderItemCreateWithoutProductInput[] | Prisma.OrderItemUncheckedCreateWithoutProductInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutProductInput | Prisma.OrderItemCreateOrConnectWithoutProductInput[]
  upsert?: Prisma.OrderItemUpsertWithWhereUniqueWithoutProductInput | Prisma.OrderItemUpsertWithWhereUniqueWithoutProductInput[]
  createMany?: Prisma.OrderItemCreateManyProductInputEnvelope
  set?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  disconnect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  delete?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  update?: Prisma.OrderItemUpdateWithWhereUniqueWithoutProductInput | Prisma.OrderItemUpdateWithWhereUniqueWithoutProductInput[]
  updateMany?: Prisma.OrderItemUpdateManyWithWhereWithoutProductInput | Prisma.OrderItemUpdateManyWithWhereWithoutProductInput[]
  deleteMany?: Prisma.OrderItemScalarWhereInput | Prisma.OrderItemScalarWhereInput[]
}

export type OrderItemCreateNestedManyWithoutOrderInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutOrderInput, Prisma.OrderItemUncheckedCreateWithoutOrderInput> | Prisma.OrderItemCreateWithoutOrderInput[] | Prisma.OrderItemUncheckedCreateWithoutOrderInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutOrderInput | Prisma.OrderItemCreateOrConnectWithoutOrderInput[]
  createMany?: Prisma.OrderItemCreateManyOrderInputEnvelope
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
}

export type OrderItemUncheckedCreateNestedManyWithoutOrderInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutOrderInput, Prisma.OrderItemUncheckedCreateWithoutOrderInput> | Prisma.OrderItemCreateWithoutOrderInput[] | Prisma.OrderItemUncheckedCreateWithoutOrderInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutOrderInput | Prisma.OrderItemCreateOrConnectWithoutOrderInput[]
  createMany?: Prisma.OrderItemCreateManyOrderInputEnvelope
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
}

export type OrderItemUpdateManyWithoutOrderNestedInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutOrderInput, Prisma.OrderItemUncheckedCreateWithoutOrderInput> | Prisma.OrderItemCreateWithoutOrderInput[] | Prisma.OrderItemUncheckedCreateWithoutOrderInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutOrderInput | Prisma.OrderItemCreateOrConnectWithoutOrderInput[]
  upsert?: Prisma.OrderItemUpsertWithWhereUniqueWithoutOrderInput | Prisma.OrderItemUpsertWithWhereUniqueWithoutOrderInput[]
  createMany?: Prisma.OrderItemCreateManyOrderInputEnvelope
  set?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  disconnect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  delete?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  update?: Prisma.OrderItemUpdateWithWhereUniqueWithoutOrderInput | Prisma.OrderItemUpdateWithWhereUniqueWithoutOrderInput[]
  updateMany?: Prisma.OrderItemUpdateManyWithWhereWithoutOrderInput | Prisma.OrderItemUpdateManyWithWhereWithoutOrderInput[]
  deleteMany?: Prisma.OrderItemScalarWhereInput | Prisma.OrderItemScalarWhereInput[]
}

export type OrderItemUncheckedUpdateManyWithoutOrderNestedInput = {
  create?: Prisma.XOR<Prisma.OrderItemCreateWithoutOrderInput, Prisma.OrderItemUncheckedCreateWithoutOrderInput> | Prisma.OrderItemCreateWithoutOrderInput[] | Prisma.OrderItemUncheckedCreateWithoutOrderInput[]
  connectOrCreate?: Prisma.OrderItemCreateOrConnectWithoutOrderInput | Prisma.OrderItemCreateOrConnectWithoutOrderInput[]
  upsert?: Prisma.OrderItemUpsertWithWhereUniqueWithoutOrderInput | Prisma.OrderItemUpsertWithWhereUniqueWithoutOrderInput[]
  createMany?: Prisma.OrderItemCreateManyOrderInputEnvelope
  set?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  disconnect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  delete?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  connect?: Prisma.OrderItemWhereUniqueInput | Prisma.OrderItemWhereUniqueInput[]
  update?: Prisma.OrderItemUpdateWithWhereUniqueWithoutOrderInput | Prisma.OrderItemUpdateWithWhereUniqueWithoutOrderInput[]
  updateMany?: Prisma.OrderItemUpdateManyWithWhereWithoutOrderInput | Prisma.OrderItemUpdateManyWithWhereWithoutOrderInput[]
  deleteMany?: Prisma.OrderItemScalarWhereInput | Prisma.OrderItemScalarWhereInput[]
}

export type OrderItemCreateWithoutProductInput = {
  id?: string
  name: string
  unitPriceCents: number
  quantity: number
  order: Prisma.OrderCreateNestedOneWithoutItemsInput
}

export type OrderItemUncheckedCreateWithoutProductInput = {
  id?: string
  orderId: string
  name: string
  unitPriceCents: number
  quantity: number
}

export type OrderItemCreateOrConnectWithoutProductInput = {
  where: Prisma.OrderItemWhereUniqueInput
  create: Prisma.XOR<Prisma.OrderItemCreateWithoutProductInput, Prisma.OrderItemUncheckedCreateWithoutProductInput>
}

export type OrderItemCreateManyProductInputEnvelope = {
  data: Prisma.OrderItemCreateManyProductInput | Prisma.OrderItemCreateManyProductInput[]
  skipDuplicates?: boolean
}

export type OrderItemUpsertWithWhereUniqueWithoutProductInput = {
  where: Prisma.OrderItemWhereUniqueInput
  update: Prisma.XOR<Prisma.OrderItemUpdateWithoutProductInput, Prisma.OrderItemUncheckedUpdateWithoutProductInput>
  create: Prisma.XOR<Prisma.OrderItemCreateWithoutProductInput, Prisma.OrderItemUncheckedCreateWithoutProductInput>
}

export type OrderItemUpdateWithWhereUniqueWithoutProductInput = {
  where: Prisma.OrderItemWhereUniqueInput
  data: Prisma.XOR<Prisma.OrderItemUpdateWithoutProductInput, Prisma.OrderItemUncheckedUpdateWithoutProductInput>
}

export type OrderItemUpdateManyWithWhereWithoutProductInput = {
  where: Prisma.OrderItemScalarWhereInput
  data: Prisma.XOR<Prisma.OrderItemUpdateManyMutationInput, Prisma.OrderItemUncheckedUpdateManyWithoutProductInput>
}

export type OrderItemScalarWhereInput = {
  AND?: Prisma.OrderItemScalarWhereInput | Prisma.OrderItemScalarWhereInput[]
  OR?: Prisma.OrderItemScalarWhereInput[]
  NOT?: Prisma.OrderItemScalarWhereInput | Prisma.OrderItemScalarWhereInput[]
  id?: Prisma.StringFilter<"OrderItem"> | string
  orderId?: Prisma.StringFilter<"OrderItem"> | string
  productId?: Prisma.StringNullableFilter<"OrderItem"> | string | null
  name?: Prisma.StringFilter<"OrderItem"> | string
  unitPriceCents?: Prisma.IntFilter<"OrderItem"> | number
  quantity?: Prisma.IntFilter<"OrderItem"> | number
}

export type OrderItemCreateWithoutOrderInput = {
  id?: string
  name: string
  unitPriceCents: number
  quantity: number
  product?: Prisma.ProductCreateNestedOneWithoutOrderItemsInput
}

export type OrderItemUncheckedCreateWithoutOrderInput = {
  id?: string
  productId?: string | null
  name: string
  unitPriceCents: number
  quantity: number
}

export type OrderItemCreateOrConnectWithoutOrderInput = {
  where: Prisma.OrderItemWhereUniqueInput
  create: Prisma.XOR<Prisma.OrderItemCreateWithoutOrderInput, Prisma.OrderItemUncheckedCreateWithoutOrderInput>
}

export type OrderItemCreateManyOrderInputEnvelope = {
  data: Prisma.OrderItemCreateManyOrderInput | Prisma.OrderItemCreateManyOrderInput[]
  skipDuplicates?: boolean
}

export type OrderItemUpsertWithWhereUniqueWithoutOrderInput = {
  where: Prisma.OrderItemWhereUniqueInput
  update: Prisma.XOR<Prisma.OrderItemUpdateWithoutOrderInput, Prisma.OrderItemUncheckedUpdateWithoutOrderInput>
  create: Prisma.XOR<Prisma.OrderItemCreateWithoutOrderInput, Prisma.OrderItemUncheckedCreateWithoutOrderInput>
}

export type OrderItemUpdateWithWhereUniqueWithoutOrderInput = {
  where: Prisma.OrderItemWhereUniqueInput
  data: Prisma.XOR<Prisma.OrderItemUpdateWithoutOrderInput, Prisma.OrderItemUncheckedUpdateWithoutOrderInput>
}

export type OrderItemUpdateManyWithWhereWithoutOrderInput = {
  where: Prisma.OrderItemScalarWhereInput
  data: Prisma.XOR<Prisma.OrderItemUpdateManyMutationInput, Prisma.OrderItemUncheckedUpdateManyWithoutOrderInput>
}

export type OrderItemCreateManyProductInput = {
  id?: string
  orderId: string
  name: string
  unitPriceCents: number
  quantity: number
}

export type OrderItemUpdateWithoutProductInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
  order?: Prisma.OrderUpdateOneRequiredWithoutItemsNestedInput
}

export type OrderItemUncheckedUpdateWithoutProductInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  orderId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}

export type OrderItemUncheckedUpdateManyWithoutProductInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  orderId?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}

export type OrderItemCreateManyOrderInput = {
  id?: string
  productId?: string | null
  name: string
  unitPriceCents: number
  quantity: number
}

export type OrderItemUpdateWithoutOrderInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
  product?: Prisma.ProductUpdateOneWithoutOrderItemsNestedInput
}

export type OrderItemUncheckedUpdateWithoutOrderInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  productId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}

export type OrderItemUncheckedUpdateManyWithoutOrderInput = {
  id?: Prisma.StringFieldUpdateOperationsInput | string
  productId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  name?: Prisma.StringFieldUpdateOperationsInput | string
  unitPriceCents?: Prisma.IntFieldUpdateOperationsInput | number
  quantity?: Prisma.IntFieldUpdateOperationsInput | number
}



export type OrderItemSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  orderId?: boolean
  productId?: boolean
  name?: boolean
  unitPriceCents?: boolean
  quantity?: boolean
  order?: boolean | Prisma.OrderDefaultArgs<ExtArgs>
  product?: boolean | Prisma.OrderItem$productArgs<ExtArgs>
}, ExtArgs["result"]["orderItem"]>

export type OrderItemSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  orderId?: boolean
  productId?: boolean
  name?: boolean
  unitPriceCents?: boolean
  quantity?: boolean
  order?: boolean | Prisma.OrderDefaultArgs<ExtArgs>
  product?: boolean | Prisma.OrderItem$productArgs<ExtArgs>
}, ExtArgs["result"]["orderItem"]>

export type OrderItemSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  id?: boolean
  orderId?: boolean
  productId?: boolean
  name?: boolean
  unitPriceCents?: boolean
  quantity?: boolean
  order?: boolean | Prisma.OrderDefaultArgs<ExtArgs>
  product?: boolean | Prisma.OrderItem$productArgs<ExtArgs>
}, ExtArgs["result"]["orderItem"]>

export type OrderItemSelectScalar = {
  id?: boolean
  orderId?: boolean
  productId?: boolean
  name?: boolean
  unitPriceCents?: boolean
  quantity?: boolean
}

export type OrderItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "orderId" | "productId" | "name" | "unitPriceCents" | "quantity", ExtArgs["result"]["orderItem"]>
export type OrderItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  order?: boolean | Prisma.OrderDefaultArgs<ExtArgs>
  product?: boolean | Prisma.OrderItem$productArgs<ExtArgs>
}
export type OrderItemIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  order?: boolean | Prisma.OrderDefaultArgs<ExtArgs>
  product?: boolean | Prisma.OrderItem$productArgs<ExtArgs>
}
export type OrderItemIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  order?: boolean | Prisma.OrderDefaultArgs<ExtArgs>
  product?: boolean | Prisma.OrderItem$productArgs<ExtArgs>
}

export type $OrderItemPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "OrderItem"
  objects: {
    order: Prisma.$OrderPayload<ExtArgs>
    product: Prisma.$ProductPayload<ExtArgs> | null
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    id: string
    orderId: string
    productId: string | null
    name: string
    unitPriceCents: number
    quantity: number
  }, ExtArgs["result"]["orderItem"]>
  composites: {}
}

export type OrderItemGetPayload<S extends boolean | null | undefined | OrderItemDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$OrderItemPayload, S>

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

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

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

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

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

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

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

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

  /**
   * Create many OrderItems and returns the data saved in the database.
   * @param {OrderItemCreateManyAndReturnArgs} args - Arguments to create many OrderItems.
   * @example
   * // Create many OrderItems
   * const orderItem = await prisma.orderItem.createManyAndReturn({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Create many OrderItems and only return the `id`
   * const orderItemWithIdOnly = await prisma.orderItem.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 OrderItemCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, OrderItemCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrderItemPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

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

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

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

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

  /**
   * Update zero or more OrderItems and returns the data updated in the database.
   * @param {OrderItemUpdateManyAndReturnArgs} args - Arguments to update many OrderItems.
   * @example
   * // Update many OrderItems
   * const orderItem = await prisma.orderItem.updateManyAndReturn({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Update zero or more OrderItems and only return the `id`
   * const orderItemWithIdOnly = await prisma.orderItem.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 OrderItemUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, OrderItemUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrderItemPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

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

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

/**
 * The delegate class that acts as a "Promise-like" for OrderItem.
 * 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__OrderItemClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  order<T extends Prisma.OrderDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.OrderDefaultArgs<ExtArgs>>): Prisma.Prisma__OrderClient<runtime.Types.Result.GetResult<Prisma.$OrderPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  product<T extends Prisma.OrderItem$productArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.OrderItem$productArgs<ExtArgs>>): Prisma.Prisma__ProductClient<runtime.Types.Result.GetResult<Prisma.$ProductPayload<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 OrderItem model
 */
export interface OrderItemFieldRefs {
  readonly id: Prisma.FieldRef<"OrderItem", 'String'>
  readonly orderId: Prisma.FieldRef<"OrderItem", 'String'>
  readonly productId: Prisma.FieldRef<"OrderItem", 'String'>
  readonly name: Prisma.FieldRef<"OrderItem", 'String'>
  readonly unitPriceCents: Prisma.FieldRef<"OrderItem", 'Int'>
  readonly quantity: Prisma.FieldRef<"OrderItem", 'Int'>
}
    

// Custom InputTypes
/**
 * OrderItem findUnique
 */
export type OrderItemFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * Filter, which OrderItem to fetch.
   */
  where: Prisma.OrderItemWhereUniqueInput
}

/**
 * OrderItem findUniqueOrThrow
 */
export type OrderItemFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * Filter, which OrderItem to fetch.
   */
  where: Prisma.OrderItemWhereUniqueInput
}

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

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

/**
 * OrderItem findMany
 */
export type OrderItemFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * Filter, which OrderItems to fetch.
   */
  where?: Prisma.OrderItemWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of OrderItems to fetch.
   */
  orderBy?: Prisma.OrderItemOrderByWithRelationInput | Prisma.OrderItemOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for listing OrderItems.
   */
  cursor?: Prisma.OrderItemWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` OrderItems 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` OrderItems.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of OrderItems.
   */
  distinct?: Prisma.OrderItemScalarFieldEnum | Prisma.OrderItemScalarFieldEnum[]
}

/**
 * OrderItem create
 */
export type OrderItemCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * The data needed to create a OrderItem.
   */
  data: Prisma.XOR<Prisma.OrderItemCreateInput, Prisma.OrderItemUncheckedCreateInput>
}

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

/**
 * OrderItem createManyAndReturn
 */
export type OrderItemCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelectCreateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * The data used to create many OrderItems.
   */
  data: Prisma.OrderItemCreateManyInput | Prisma.OrderItemCreateManyInput[]
  skipDuplicates?: boolean
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemIncludeCreateManyAndReturn<ExtArgs> | null
}

/**
 * OrderItem update
 */
export type OrderItemUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * The data needed to update a OrderItem.
   */
  data: Prisma.XOR<Prisma.OrderItemUpdateInput, Prisma.OrderItemUncheckedUpdateInput>
  /**
   * Choose, which OrderItem to update.
   */
  where: Prisma.OrderItemWhereUniqueInput
}

/**
 * OrderItem updateMany
 */
export type OrderItemUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update OrderItems.
   */
  data: Prisma.XOR<Prisma.OrderItemUpdateManyMutationInput, Prisma.OrderItemUncheckedUpdateManyInput>
  /**
   * Filter which OrderItems to update
   */
  where?: Prisma.OrderItemWhereInput
  /**
   * Limit how many OrderItems to update.
   */
  limit?: number
}

/**
 * OrderItem updateManyAndReturn
 */
export type OrderItemUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelectUpdateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * The data used to update OrderItems.
   */
  data: Prisma.XOR<Prisma.OrderItemUpdateManyMutationInput, Prisma.OrderItemUncheckedUpdateManyInput>
  /**
   * Filter which OrderItems to update
   */
  where?: Prisma.OrderItemWhereInput
  /**
   * Limit how many OrderItems to update.
   */
  limit?: number
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemIncludeUpdateManyAndReturn<ExtArgs> | null
}

/**
 * OrderItem upsert
 */
export type OrderItemUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * The filter to search for the OrderItem to update in case it exists.
   */
  where: Prisma.OrderItemWhereUniqueInput
  /**
   * In case the OrderItem found by the `where` argument doesn't exist, create a new OrderItem with this data.
   */
  create: Prisma.XOR<Prisma.OrderItemCreateInput, Prisma.OrderItemUncheckedCreateInput>
  /**
   * In case the OrderItem was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.OrderItemUpdateInput, Prisma.OrderItemUncheckedUpdateInput>
}

/**
 * OrderItem delete
 */
export type OrderItemDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the OrderItem
   */
  select?: Prisma.OrderItemSelect<ExtArgs> | null
  /**
   * Omit specific fields from the OrderItem
   */
  omit?: Prisma.OrderItemOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.OrderItemInclude<ExtArgs> | null
  /**
   * Filter which OrderItem to delete.
   */
  where: Prisma.OrderItemWhereUniqueInput
}

/**
 * OrderItem deleteMany
 */
export type OrderItemDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which OrderItems to delete
   */
  where?: Prisma.OrderItemWhereInput
  /**
   * Limit how many OrderItems to delete.
   */
  limit?: number
}

/**
 * OrderItem.product
 */
export type OrderItem$productArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Product
   */
  select?: Prisma.ProductSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Product
   */
  omit?: Prisma.ProductOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ProductInclude<ExtArgs> | null
  where?: Prisma.ProductWhereInput
}

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