/* !!! This is code generated by Prisma. Do not edit directly. !!! */ /* eslint-disable */ // biome-ignore-all lint: generated file // @ts-nocheck /* * This file exports the `Lead` model and its related types. * * 🟢 You can import this file directly. */ import type * as runtime from "@prisma/client/runtime/client" import type * as $Enums from "../enums.ts" import type * as Prisma from "../internal/prismaNamespace.ts" /** * Model Lead * */ export type LeadModel = runtime.Types.Result.DefaultSelection export type AggregateLead = { _count: LeadCountAggregateOutputType | null _avg: LeadAvgAggregateOutputType | null _sum: LeadSumAggregateOutputType | null _min: LeadMinAggregateOutputType | null _max: LeadMaxAggregateOutputType | null } export type LeadAvgAggregateOutputType = { score: number | null } export type LeadSumAggregateOutputType = { score: number | null } export type LeadMinAggregateOutputType = { id: string | null email: string | null firstName: string | null lastName: string | null phone: string | null company: string | null source: string | null status: $Enums.LeadStatus | null utmSource: string | null utmMedium: string | null utmCampaign: string | null utmTerm: string | null utmContent: string | null gclid: string | null fbclid: string | null referrer: string | null landingPage: string | null firstSeenAt: Date | null lastTouchAt: Date | null score: number | null convertedToTenantId: string | null convertedAt: Date | null lastIpHash: string | null userAgent: string | null createdAt: Date | null updatedAt: Date | null } export type LeadMaxAggregateOutputType = { id: string | null email: string | null firstName: string | null lastName: string | null phone: string | null company: string | null source: string | null status: $Enums.LeadStatus | null utmSource: string | null utmMedium: string | null utmCampaign: string | null utmTerm: string | null utmContent: string | null gclid: string | null fbclid: string | null referrer: string | null landingPage: string | null firstSeenAt: Date | null lastTouchAt: Date | null score: number | null convertedToTenantId: string | null convertedAt: Date | null lastIpHash: string | null userAgent: string | null createdAt: Date | null updatedAt: Date | null } export type LeadCountAggregateOutputType = { id: number email: number firstName: number lastName: number phone: number company: number source: number status: number utmSource: number utmMedium: number utmCampaign: number utmTerm: number utmContent: number gclid: number fbclid: number referrer: number landingPage: number firstSeenAt: number lastTouchAt: number score: number notes: number convertedToTenantId: number convertedAt: number lastIpHash: number userAgent: number createdAt: number updatedAt: number _all: number } export type LeadAvgAggregateInputType = { score?: true } export type LeadSumAggregateInputType = { score?: true } export type LeadMinAggregateInputType = { id?: true email?: true firstName?: true lastName?: true phone?: true company?: true source?: true status?: true utmSource?: true utmMedium?: true utmCampaign?: true utmTerm?: true utmContent?: true gclid?: true fbclid?: true referrer?: true landingPage?: true firstSeenAt?: true lastTouchAt?: true score?: true convertedToTenantId?: true convertedAt?: true lastIpHash?: true userAgent?: true createdAt?: true updatedAt?: true } export type LeadMaxAggregateInputType = { id?: true email?: true firstName?: true lastName?: true phone?: true company?: true source?: true status?: true utmSource?: true utmMedium?: true utmCampaign?: true utmTerm?: true utmContent?: true gclid?: true fbclid?: true referrer?: true landingPage?: true firstSeenAt?: true lastTouchAt?: true score?: true convertedToTenantId?: true convertedAt?: true lastIpHash?: true userAgent?: true createdAt?: true updatedAt?: true } export type LeadCountAggregateInputType = { id?: true email?: true firstName?: true lastName?: true phone?: true company?: true source?: true status?: true utmSource?: true utmMedium?: true utmCampaign?: true utmTerm?: true utmContent?: true gclid?: true fbclid?: true referrer?: true landingPage?: true firstSeenAt?: true lastTouchAt?: true score?: true notes?: true convertedToTenantId?: true convertedAt?: true lastIpHash?: true userAgent?: true createdAt?: true updatedAt?: true _all?: true } export type LeadAggregateArgs = { /** * Filter which Lead to aggregate. */ where?: Prisma.LeadWhereInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} * * Determine the order of Leads to fetch. */ orderBy?: Prisma.LeadOrderByWithRelationInput | Prisma.LeadOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * * Sets the start position */ cursor?: Prisma.LeadWhereUniqueInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} * * Take `±n` Leads 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` Leads. */ skip?: number /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * * Count returned Leads **/ _count?: true | LeadCountAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * * Select which fields to average **/ _avg?: LeadAvgAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * * Select which fields to sum **/ _sum?: LeadSumAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * * Select which fields to find the minimum value **/ _min?: LeadMinAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * * Select which fields to find the maximum value **/ _max?: LeadMaxAggregateInputType } export type GetLeadAggregateType = { [P in keyof T & keyof AggregateLead]: P extends '_count' | 'count' ? T[P] extends true ? number : Prisma.GetScalarType : Prisma.GetScalarType } export type LeadGroupByArgs = { where?: Prisma.LeadWhereInput orderBy?: Prisma.LeadOrderByWithAggregationInput | Prisma.LeadOrderByWithAggregationInput[] by: Prisma.LeadScalarFieldEnum[] | Prisma.LeadScalarFieldEnum having?: Prisma.LeadScalarWhereWithAggregatesInput take?: number skip?: number _count?: LeadCountAggregateInputType | true _avg?: LeadAvgAggregateInputType _sum?: LeadSumAggregateInputType _min?: LeadMinAggregateInputType _max?: LeadMaxAggregateInputType } export type LeadGroupByOutputType = { id: string email: string firstName: string | null lastName: string | null phone: string | null company: string | null source: string | null status: $Enums.LeadStatus utmSource: string | null utmMedium: string | null utmCampaign: string | null utmTerm: string | null utmContent: string | null gclid: string | null fbclid: string | null referrer: string | null landingPage: string | null firstSeenAt: Date lastTouchAt: Date score: number notes: runtime.JsonValue | null convertedToTenantId: string | null convertedAt: Date | null lastIpHash: string | null userAgent: string | null createdAt: Date updatedAt: Date _count: LeadCountAggregateOutputType | null _avg: LeadAvgAggregateOutputType | null _sum: LeadSumAggregateOutputType | null _min: LeadMinAggregateOutputType | null _max: LeadMaxAggregateOutputType | null } export type GetLeadGroupByPayload = Prisma.PrismaPromise< Array< Prisma.PickEnumerable & { [P in ((keyof T) & (keyof LeadGroupByOutputType))]: P extends '_count' ? T[P] extends boolean ? number : Prisma.GetScalarType : Prisma.GetScalarType } > > export type LeadWhereInput = { AND?: Prisma.LeadWhereInput | Prisma.LeadWhereInput[] OR?: Prisma.LeadWhereInput[] NOT?: Prisma.LeadWhereInput | Prisma.LeadWhereInput[] id?: Prisma.StringFilter<"Lead"> | string email?: Prisma.StringFilter<"Lead"> | string firstName?: Prisma.StringNullableFilter<"Lead"> | string | null lastName?: Prisma.StringNullableFilter<"Lead"> | string | null phone?: Prisma.StringNullableFilter<"Lead"> | string | null company?: Prisma.StringNullableFilter<"Lead"> | string | null source?: Prisma.StringNullableFilter<"Lead"> | string | null status?: Prisma.EnumLeadStatusFilter<"Lead"> | $Enums.LeadStatus utmSource?: Prisma.StringNullableFilter<"Lead"> | string | null utmMedium?: Prisma.StringNullableFilter<"Lead"> | string | null utmCampaign?: Prisma.StringNullableFilter<"Lead"> | string | null utmTerm?: Prisma.StringNullableFilter<"Lead"> | string | null utmContent?: Prisma.StringNullableFilter<"Lead"> | string | null gclid?: Prisma.StringNullableFilter<"Lead"> | string | null fbclid?: Prisma.StringNullableFilter<"Lead"> | string | null referrer?: Prisma.StringNullableFilter<"Lead"> | string | null landingPage?: Prisma.StringNullableFilter<"Lead"> | string | null firstSeenAt?: Prisma.DateTimeFilter<"Lead"> | Date | string lastTouchAt?: Prisma.DateTimeFilter<"Lead"> | Date | string score?: Prisma.IntFilter<"Lead"> | number notes?: Prisma.JsonNullableFilter<"Lead"> convertedToTenantId?: Prisma.StringNullableFilter<"Lead"> | string | null convertedAt?: Prisma.DateTimeNullableFilter<"Lead"> | Date | string | null lastIpHash?: Prisma.StringNullableFilter<"Lead"> | string | null userAgent?: Prisma.StringNullableFilter<"Lead"> | string | null createdAt?: Prisma.DateTimeFilter<"Lead"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Lead"> | Date | string events?: Prisma.LeadEventListRelationFilter } export type LeadOrderByWithRelationInput = { id?: Prisma.SortOrder email?: Prisma.SortOrder firstName?: Prisma.SortOrderInput | Prisma.SortOrder lastName?: Prisma.SortOrderInput | Prisma.SortOrder phone?: Prisma.SortOrderInput | Prisma.SortOrder company?: Prisma.SortOrderInput | Prisma.SortOrder source?: Prisma.SortOrderInput | Prisma.SortOrder status?: Prisma.SortOrder utmSource?: Prisma.SortOrderInput | Prisma.SortOrder utmMedium?: Prisma.SortOrderInput | Prisma.SortOrder utmCampaign?: Prisma.SortOrderInput | Prisma.SortOrder utmTerm?: Prisma.SortOrderInput | Prisma.SortOrder utmContent?: Prisma.SortOrderInput | Prisma.SortOrder gclid?: Prisma.SortOrderInput | Prisma.SortOrder fbclid?: Prisma.SortOrderInput | Prisma.SortOrder referrer?: Prisma.SortOrderInput | Prisma.SortOrder landingPage?: Prisma.SortOrderInput | Prisma.SortOrder firstSeenAt?: Prisma.SortOrder lastTouchAt?: Prisma.SortOrder score?: Prisma.SortOrder notes?: Prisma.SortOrderInput | Prisma.SortOrder convertedToTenantId?: Prisma.SortOrderInput | Prisma.SortOrder convertedAt?: Prisma.SortOrderInput | Prisma.SortOrder lastIpHash?: Prisma.SortOrderInput | Prisma.SortOrder userAgent?: Prisma.SortOrderInput | Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder events?: Prisma.LeadEventOrderByRelationAggregateInput } export type LeadWhereUniqueInput = Prisma.AtLeast<{ id?: string email?: string AND?: Prisma.LeadWhereInput | Prisma.LeadWhereInput[] OR?: Prisma.LeadWhereInput[] NOT?: Prisma.LeadWhereInput | Prisma.LeadWhereInput[] firstName?: Prisma.StringNullableFilter<"Lead"> | string | null lastName?: Prisma.StringNullableFilter<"Lead"> | string | null phone?: Prisma.StringNullableFilter<"Lead"> | string | null company?: Prisma.StringNullableFilter<"Lead"> | string | null source?: Prisma.StringNullableFilter<"Lead"> | string | null status?: Prisma.EnumLeadStatusFilter<"Lead"> | $Enums.LeadStatus utmSource?: Prisma.StringNullableFilter<"Lead"> | string | null utmMedium?: Prisma.StringNullableFilter<"Lead"> | string | null utmCampaign?: Prisma.StringNullableFilter<"Lead"> | string | null utmTerm?: Prisma.StringNullableFilter<"Lead"> | string | null utmContent?: Prisma.StringNullableFilter<"Lead"> | string | null gclid?: Prisma.StringNullableFilter<"Lead"> | string | null fbclid?: Prisma.StringNullableFilter<"Lead"> | string | null referrer?: Prisma.StringNullableFilter<"Lead"> | string | null landingPage?: Prisma.StringNullableFilter<"Lead"> | string | null firstSeenAt?: Prisma.DateTimeFilter<"Lead"> | Date | string lastTouchAt?: Prisma.DateTimeFilter<"Lead"> | Date | string score?: Prisma.IntFilter<"Lead"> | number notes?: Prisma.JsonNullableFilter<"Lead"> convertedToTenantId?: Prisma.StringNullableFilter<"Lead"> | string | null convertedAt?: Prisma.DateTimeNullableFilter<"Lead"> | Date | string | null lastIpHash?: Prisma.StringNullableFilter<"Lead"> | string | null userAgent?: Prisma.StringNullableFilter<"Lead"> | string | null createdAt?: Prisma.DateTimeFilter<"Lead"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Lead"> | Date | string events?: Prisma.LeadEventListRelationFilter }, "id" | "email"> export type LeadOrderByWithAggregationInput = { id?: Prisma.SortOrder email?: Prisma.SortOrder firstName?: Prisma.SortOrderInput | Prisma.SortOrder lastName?: Prisma.SortOrderInput | Prisma.SortOrder phone?: Prisma.SortOrderInput | Prisma.SortOrder company?: Prisma.SortOrderInput | Prisma.SortOrder source?: Prisma.SortOrderInput | Prisma.SortOrder status?: Prisma.SortOrder utmSource?: Prisma.SortOrderInput | Prisma.SortOrder utmMedium?: Prisma.SortOrderInput | Prisma.SortOrder utmCampaign?: Prisma.SortOrderInput | Prisma.SortOrder utmTerm?: Prisma.SortOrderInput | Prisma.SortOrder utmContent?: Prisma.SortOrderInput | Prisma.SortOrder gclid?: Prisma.SortOrderInput | Prisma.SortOrder fbclid?: Prisma.SortOrderInput | Prisma.SortOrder referrer?: Prisma.SortOrderInput | Prisma.SortOrder landingPage?: Prisma.SortOrderInput | Prisma.SortOrder firstSeenAt?: Prisma.SortOrder lastTouchAt?: Prisma.SortOrder score?: Prisma.SortOrder notes?: Prisma.SortOrderInput | Prisma.SortOrder convertedToTenantId?: Prisma.SortOrderInput | Prisma.SortOrder convertedAt?: Prisma.SortOrderInput | Prisma.SortOrder lastIpHash?: Prisma.SortOrderInput | Prisma.SortOrder userAgent?: Prisma.SortOrderInput | Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder _count?: Prisma.LeadCountOrderByAggregateInput _avg?: Prisma.LeadAvgOrderByAggregateInput _max?: Prisma.LeadMaxOrderByAggregateInput _min?: Prisma.LeadMinOrderByAggregateInput _sum?: Prisma.LeadSumOrderByAggregateInput } export type LeadScalarWhereWithAggregatesInput = { AND?: Prisma.LeadScalarWhereWithAggregatesInput | Prisma.LeadScalarWhereWithAggregatesInput[] OR?: Prisma.LeadScalarWhereWithAggregatesInput[] NOT?: Prisma.LeadScalarWhereWithAggregatesInput | Prisma.LeadScalarWhereWithAggregatesInput[] id?: Prisma.StringWithAggregatesFilter<"Lead"> | string email?: Prisma.StringWithAggregatesFilter<"Lead"> | string firstName?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null lastName?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null phone?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null company?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null source?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null status?: Prisma.EnumLeadStatusWithAggregatesFilter<"Lead"> | $Enums.LeadStatus utmSource?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null utmMedium?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null utmCampaign?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null utmTerm?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null utmContent?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null gclid?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null fbclid?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null referrer?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null landingPage?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null firstSeenAt?: Prisma.DateTimeWithAggregatesFilter<"Lead"> | Date | string lastTouchAt?: Prisma.DateTimeWithAggregatesFilter<"Lead"> | Date | string score?: Prisma.IntWithAggregatesFilter<"Lead"> | number notes?: Prisma.JsonNullableWithAggregatesFilter<"Lead"> convertedToTenantId?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null convertedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Lead"> | Date | string | null lastIpHash?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null userAgent?: Prisma.StringNullableWithAggregatesFilter<"Lead"> | string | null createdAt?: Prisma.DateTimeWithAggregatesFilter<"Lead"> | Date | string updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Lead"> | Date | string } export type LeadCreateInput = { id?: string email: string firstName?: string | null lastName?: string | null phone?: string | null company?: string | null source?: string | null status?: $Enums.LeadStatus utmSource?: string | null utmMedium?: string | null utmCampaign?: string | null utmTerm?: string | null utmContent?: string | null gclid?: string | null fbclid?: string | null referrer?: string | null landingPage?: string | null firstSeenAt?: Date | string lastTouchAt?: Date | string score?: number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: string | null convertedAt?: Date | string | null lastIpHash?: string | null userAgent?: string | null createdAt?: Date | string updatedAt?: Date | string events?: Prisma.LeadEventCreateNestedManyWithoutLeadInput } export type LeadUncheckedCreateInput = { id?: string email: string firstName?: string | null lastName?: string | null phone?: string | null company?: string | null source?: string | null status?: $Enums.LeadStatus utmSource?: string | null utmMedium?: string | null utmCampaign?: string | null utmTerm?: string | null utmContent?: string | null gclid?: string | null fbclid?: string | null referrer?: string | null landingPage?: string | null firstSeenAt?: Date | string lastTouchAt?: Date | string score?: number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: string | null convertedAt?: Date | string | null lastIpHash?: string | null userAgent?: string | null createdAt?: Date | string updatedAt?: Date | string events?: Prisma.LeadEventUncheckedCreateNestedManyWithoutLeadInput } export type LeadUpdateInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null lastName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null company?: Prisma.NullableStringFieldUpdateOperationsInput | string | null source?: Prisma.NullableStringFieldUpdateOperationsInput | string | null status?: Prisma.EnumLeadStatusFieldUpdateOperationsInput | $Enums.LeadStatus utmSource?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmMedium?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmCampaign?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmTerm?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmContent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null gclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null fbclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null referrer?: Prisma.NullableStringFieldUpdateOperationsInput | string | null landingPage?: Prisma.NullableStringFieldUpdateOperationsInput | string | null firstSeenAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string lastTouchAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string score?: Prisma.IntFieldUpdateOperationsInput | number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null convertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null lastIpHash?: Prisma.NullableStringFieldUpdateOperationsInput | string | null userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string events?: Prisma.LeadEventUpdateManyWithoutLeadNestedInput } export type LeadUncheckedUpdateInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null lastName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null company?: Prisma.NullableStringFieldUpdateOperationsInput | string | null source?: Prisma.NullableStringFieldUpdateOperationsInput | string | null status?: Prisma.EnumLeadStatusFieldUpdateOperationsInput | $Enums.LeadStatus utmSource?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmMedium?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmCampaign?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmTerm?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmContent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null gclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null fbclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null referrer?: Prisma.NullableStringFieldUpdateOperationsInput | string | null landingPage?: Prisma.NullableStringFieldUpdateOperationsInput | string | null firstSeenAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string lastTouchAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string score?: Prisma.IntFieldUpdateOperationsInput | number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null convertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null lastIpHash?: Prisma.NullableStringFieldUpdateOperationsInput | string | null userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string events?: Prisma.LeadEventUncheckedUpdateManyWithoutLeadNestedInput } export type LeadCreateManyInput = { id?: string email: string firstName?: string | null lastName?: string | null phone?: string | null company?: string | null source?: string | null status?: $Enums.LeadStatus utmSource?: string | null utmMedium?: string | null utmCampaign?: string | null utmTerm?: string | null utmContent?: string | null gclid?: string | null fbclid?: string | null referrer?: string | null landingPage?: string | null firstSeenAt?: Date | string lastTouchAt?: Date | string score?: number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: string | null convertedAt?: Date | string | null lastIpHash?: string | null userAgent?: string | null createdAt?: Date | string updatedAt?: Date | string } export type LeadUpdateManyMutationInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null lastName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null company?: Prisma.NullableStringFieldUpdateOperationsInput | string | null source?: Prisma.NullableStringFieldUpdateOperationsInput | string | null status?: Prisma.EnumLeadStatusFieldUpdateOperationsInput | $Enums.LeadStatus utmSource?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmMedium?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmCampaign?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmTerm?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmContent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null gclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null fbclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null referrer?: Prisma.NullableStringFieldUpdateOperationsInput | string | null landingPage?: Prisma.NullableStringFieldUpdateOperationsInput | string | null firstSeenAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string lastTouchAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string score?: Prisma.IntFieldUpdateOperationsInput | number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null convertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null lastIpHash?: Prisma.NullableStringFieldUpdateOperationsInput | string | null userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type LeadUncheckedUpdateManyInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null lastName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null company?: Prisma.NullableStringFieldUpdateOperationsInput | string | null source?: Prisma.NullableStringFieldUpdateOperationsInput | string | null status?: Prisma.EnumLeadStatusFieldUpdateOperationsInput | $Enums.LeadStatus utmSource?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmMedium?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmCampaign?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmTerm?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmContent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null gclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null fbclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null referrer?: Prisma.NullableStringFieldUpdateOperationsInput | string | null landingPage?: Prisma.NullableStringFieldUpdateOperationsInput | string | null firstSeenAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string lastTouchAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string score?: Prisma.IntFieldUpdateOperationsInput | number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null convertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null lastIpHash?: Prisma.NullableStringFieldUpdateOperationsInput | string | null userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type LeadCountOrderByAggregateInput = { id?: Prisma.SortOrder email?: Prisma.SortOrder firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder phone?: Prisma.SortOrder company?: Prisma.SortOrder source?: Prisma.SortOrder status?: Prisma.SortOrder utmSource?: Prisma.SortOrder utmMedium?: Prisma.SortOrder utmCampaign?: Prisma.SortOrder utmTerm?: Prisma.SortOrder utmContent?: Prisma.SortOrder gclid?: Prisma.SortOrder fbclid?: Prisma.SortOrder referrer?: Prisma.SortOrder landingPage?: Prisma.SortOrder firstSeenAt?: Prisma.SortOrder lastTouchAt?: Prisma.SortOrder score?: Prisma.SortOrder notes?: Prisma.SortOrder convertedToTenantId?: Prisma.SortOrder convertedAt?: Prisma.SortOrder lastIpHash?: Prisma.SortOrder userAgent?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder } export type LeadAvgOrderByAggregateInput = { score?: Prisma.SortOrder } export type LeadMaxOrderByAggregateInput = { id?: Prisma.SortOrder email?: Prisma.SortOrder firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder phone?: Prisma.SortOrder company?: Prisma.SortOrder source?: Prisma.SortOrder status?: Prisma.SortOrder utmSource?: Prisma.SortOrder utmMedium?: Prisma.SortOrder utmCampaign?: Prisma.SortOrder utmTerm?: Prisma.SortOrder utmContent?: Prisma.SortOrder gclid?: Prisma.SortOrder fbclid?: Prisma.SortOrder referrer?: Prisma.SortOrder landingPage?: Prisma.SortOrder firstSeenAt?: Prisma.SortOrder lastTouchAt?: Prisma.SortOrder score?: Prisma.SortOrder convertedToTenantId?: Prisma.SortOrder convertedAt?: Prisma.SortOrder lastIpHash?: Prisma.SortOrder userAgent?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder } export type LeadMinOrderByAggregateInput = { id?: Prisma.SortOrder email?: Prisma.SortOrder firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder phone?: Prisma.SortOrder company?: Prisma.SortOrder source?: Prisma.SortOrder status?: Prisma.SortOrder utmSource?: Prisma.SortOrder utmMedium?: Prisma.SortOrder utmCampaign?: Prisma.SortOrder utmTerm?: Prisma.SortOrder utmContent?: Prisma.SortOrder gclid?: Prisma.SortOrder fbclid?: Prisma.SortOrder referrer?: Prisma.SortOrder landingPage?: Prisma.SortOrder firstSeenAt?: Prisma.SortOrder lastTouchAt?: Prisma.SortOrder score?: Prisma.SortOrder convertedToTenantId?: Prisma.SortOrder convertedAt?: Prisma.SortOrder lastIpHash?: Prisma.SortOrder userAgent?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder } export type LeadSumOrderByAggregateInput = { score?: Prisma.SortOrder } export type LeadScalarRelationFilter = { is?: Prisma.LeadWhereInput isNot?: Prisma.LeadWhereInput } export type EnumLeadStatusFieldUpdateOperationsInput = { set?: $Enums.LeadStatus } export type LeadCreateNestedOneWithoutEventsInput = { create?: Prisma.XOR connectOrCreate?: Prisma.LeadCreateOrConnectWithoutEventsInput connect?: Prisma.LeadWhereUniqueInput } export type LeadUpdateOneRequiredWithoutEventsNestedInput = { create?: Prisma.XOR connectOrCreate?: Prisma.LeadCreateOrConnectWithoutEventsInput upsert?: Prisma.LeadUpsertWithoutEventsInput connect?: Prisma.LeadWhereUniqueInput update?: Prisma.XOR, Prisma.LeadUncheckedUpdateWithoutEventsInput> } export type LeadCreateWithoutEventsInput = { id?: string email: string firstName?: string | null lastName?: string | null phone?: string | null company?: string | null source?: string | null status?: $Enums.LeadStatus utmSource?: string | null utmMedium?: string | null utmCampaign?: string | null utmTerm?: string | null utmContent?: string | null gclid?: string | null fbclid?: string | null referrer?: string | null landingPage?: string | null firstSeenAt?: Date | string lastTouchAt?: Date | string score?: number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: string | null convertedAt?: Date | string | null lastIpHash?: string | null userAgent?: string | null createdAt?: Date | string updatedAt?: Date | string } export type LeadUncheckedCreateWithoutEventsInput = { id?: string email: string firstName?: string | null lastName?: string | null phone?: string | null company?: string | null source?: string | null status?: $Enums.LeadStatus utmSource?: string | null utmMedium?: string | null utmCampaign?: string | null utmTerm?: string | null utmContent?: string | null gclid?: string | null fbclid?: string | null referrer?: string | null landingPage?: string | null firstSeenAt?: Date | string lastTouchAt?: Date | string score?: number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: string | null convertedAt?: Date | string | null lastIpHash?: string | null userAgent?: string | null createdAt?: Date | string updatedAt?: Date | string } export type LeadCreateOrConnectWithoutEventsInput = { where: Prisma.LeadWhereUniqueInput create: Prisma.XOR } export type LeadUpsertWithoutEventsInput = { update: Prisma.XOR create: Prisma.XOR where?: Prisma.LeadWhereInput } export type LeadUpdateToOneWithWhereWithoutEventsInput = { where?: Prisma.LeadWhereInput data: Prisma.XOR } export type LeadUpdateWithoutEventsInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null lastName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null company?: Prisma.NullableStringFieldUpdateOperationsInput | string | null source?: Prisma.NullableStringFieldUpdateOperationsInput | string | null status?: Prisma.EnumLeadStatusFieldUpdateOperationsInput | $Enums.LeadStatus utmSource?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmMedium?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmCampaign?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmTerm?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmContent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null gclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null fbclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null referrer?: Prisma.NullableStringFieldUpdateOperationsInput | string | null landingPage?: Prisma.NullableStringFieldUpdateOperationsInput | string | null firstSeenAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string lastTouchAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string score?: Prisma.IntFieldUpdateOperationsInput | number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null convertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null lastIpHash?: Prisma.NullableStringFieldUpdateOperationsInput | string | null userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type LeadUncheckedUpdateWithoutEventsInput = { id?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null lastName?: Prisma.NullableStringFieldUpdateOperationsInput | string | null phone?: Prisma.NullableStringFieldUpdateOperationsInput | string | null company?: Prisma.NullableStringFieldUpdateOperationsInput | string | null source?: Prisma.NullableStringFieldUpdateOperationsInput | string | null status?: Prisma.EnumLeadStatusFieldUpdateOperationsInput | $Enums.LeadStatus utmSource?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmMedium?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmCampaign?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmTerm?: Prisma.NullableStringFieldUpdateOperationsInput | string | null utmContent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null gclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null fbclid?: Prisma.NullableStringFieldUpdateOperationsInput | string | null referrer?: Prisma.NullableStringFieldUpdateOperationsInput | string | null landingPage?: Prisma.NullableStringFieldUpdateOperationsInput | string | null firstSeenAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string lastTouchAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string score?: Prisma.IntFieldUpdateOperationsInput | number notes?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue convertedToTenantId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null convertedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null lastIpHash?: Prisma.NullableStringFieldUpdateOperationsInput | string | null userAgent?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } /** * Count Type LeadCountOutputType */ export type LeadCountOutputType = { events: number } export type LeadCountOutputTypeSelect = { events?: boolean | LeadCountOutputTypeCountEventsArgs } /** * LeadCountOutputType without action */ export type LeadCountOutputTypeDefaultArgs = { /** * Select specific fields to fetch from the LeadCountOutputType */ select?: Prisma.LeadCountOutputTypeSelect | null } /** * LeadCountOutputType without action */ export type LeadCountOutputTypeCountEventsArgs = { where?: Prisma.LeadEventWhereInput } export type LeadSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean email?: boolean firstName?: boolean lastName?: boolean phone?: boolean company?: boolean source?: boolean status?: boolean utmSource?: boolean utmMedium?: boolean utmCampaign?: boolean utmTerm?: boolean utmContent?: boolean gclid?: boolean fbclid?: boolean referrer?: boolean landingPage?: boolean firstSeenAt?: boolean lastTouchAt?: boolean score?: boolean notes?: boolean convertedToTenantId?: boolean convertedAt?: boolean lastIpHash?: boolean userAgent?: boolean createdAt?: boolean updatedAt?: boolean events?: boolean | Prisma.Lead$eventsArgs _count?: boolean | Prisma.LeadCountOutputTypeDefaultArgs }, ExtArgs["result"]["lead"]> export type LeadSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ id?: boolean email?: boolean firstName?: boolean lastName?: boolean phone?: boolean company?: boolean source?: boolean status?: boolean utmSource?: boolean utmMedium?: boolean utmCampaign?: boolean utmTerm?: boolean utmContent?: boolean gclid?: boolean fbclid?: boolean referrer?: boolean landingPage?: boolean firstSeenAt?: boolean lastTouchAt?: boolean score?: boolean notes?: boolean convertedToTenantId?: boolean convertedAt?: boolean lastIpHash?: boolean userAgent?: boolean createdAt?: boolean updatedAt?: boolean }, ExtArgs["result"]["lead"]> export type LeadSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ id?: boolean email?: boolean firstName?: boolean lastName?: boolean phone?: boolean company?: boolean source?: boolean status?: boolean utmSource?: boolean utmMedium?: boolean utmCampaign?: boolean utmTerm?: boolean utmContent?: boolean gclid?: boolean fbclid?: boolean referrer?: boolean landingPage?: boolean firstSeenAt?: boolean lastTouchAt?: boolean score?: boolean notes?: boolean convertedToTenantId?: boolean convertedAt?: boolean lastIpHash?: boolean userAgent?: boolean createdAt?: boolean updatedAt?: boolean }, ExtArgs["result"]["lead"]> export type LeadSelectScalar = { id?: boolean email?: boolean firstName?: boolean lastName?: boolean phone?: boolean company?: boolean source?: boolean status?: boolean utmSource?: boolean utmMedium?: boolean utmCampaign?: boolean utmTerm?: boolean utmContent?: boolean gclid?: boolean fbclid?: boolean referrer?: boolean landingPage?: boolean firstSeenAt?: boolean lastTouchAt?: boolean score?: boolean notes?: boolean convertedToTenantId?: boolean convertedAt?: boolean lastIpHash?: boolean userAgent?: boolean createdAt?: boolean updatedAt?: boolean } export type LeadOmit = runtime.Types.Extensions.GetOmit<"id" | "email" | "firstName" | "lastName" | "phone" | "company" | "source" | "status" | "utmSource" | "utmMedium" | "utmCampaign" | "utmTerm" | "utmContent" | "gclid" | "fbclid" | "referrer" | "landingPage" | "firstSeenAt" | "lastTouchAt" | "score" | "notes" | "convertedToTenantId" | "convertedAt" | "lastIpHash" | "userAgent" | "createdAt" | "updatedAt", ExtArgs["result"]["lead"]> export type LeadInclude = { events?: boolean | Prisma.Lead$eventsArgs _count?: boolean | Prisma.LeadCountOutputTypeDefaultArgs } export type LeadIncludeCreateManyAndReturn = {} export type LeadIncludeUpdateManyAndReturn = {} export type $LeadPayload = { name: "Lead" objects: { events: Prisma.$LeadEventPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string email: string firstName: string | null lastName: string | null phone: string | null company: string | null /** * Free-text label identifying the originating surface (e.g. "landing-pro", * "blog-cta", "webinar-form"). Distinct from utmSource which captures the * paid-acquisition channel. */ source: string | null status: $Enums.LeadStatus utmSource: string | null utmMedium: string | null utmCampaign: string | null utmTerm: string | null utmContent: string | null gclid: string | null fbclid: string | null referrer: string | null landingPage: string | null firstSeenAt: Date lastTouchAt: Date /** * Lead-scoring numeric — manual override + future automated bumps. */ score: number /** * Free-form admin notes payload (markdown body + last-edited metadata). */ notes: runtime.JsonValue | null /** * Tenant created from this lead (status=customer). NULL until conversion. */ convertedToTenantId: string | null convertedAt: Date | null /** * SHA-256 hash of last-touch IP. Raw IP is never persisted. */ lastIpHash: string | null userAgent: string | null createdAt: Date updatedAt: Date }, ExtArgs["result"]["lead"]> composites: {} } export type LeadGetPayload = runtime.Types.Result.GetResult export type LeadCountArgs = Omit & { select?: LeadCountAggregateInputType | true } export interface LeadDelegate { [K: symbol]: { types: Prisma.TypeMap['model']['Lead'], meta: { name: 'Lead' } } /** * Find zero or one Lead that matches the filter. * @param {LeadFindUniqueArgs} args - Arguments to find a Lead * @example * // Get one Lead * const lead = await prisma.lead.findUnique({ * where: { * // ... provide filter here * } * }) */ findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> /** * Find one Lead that matches the filter or throw an error with `error.code='P2025'` * if no matches were found. * @param {LeadFindUniqueOrThrowArgs} args - Arguments to find a Lead * @example * // Get one Lead * const lead = await prisma.lead.findUniqueOrThrow({ * where: { * // ... provide filter here * } * }) */ findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> /** * Find the first Lead 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 {LeadFindFirstArgs} args - Arguments to find a Lead * @example * // Get one Lead * const lead = await prisma.lead.findFirst({ * where: { * // ... provide filter here * } * }) */ findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> /** * Find the first Lead 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 {LeadFindFirstOrThrowArgs} args - Arguments to find a Lead * @example * // Get one Lead * const lead = await prisma.lead.findFirstOrThrow({ * where: { * // ... provide filter here * } * }) */ findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> /** * Find zero or more Leads 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 {LeadFindManyArgs} args - Arguments to filter and select certain fields only. * @example * // Get all Leads * const leads = await prisma.lead.findMany() * * // Get first 10 Leads * const leads = await prisma.lead.findMany({ take: 10 }) * * // Only select the `id` * const leadWithIdOnly = await prisma.lead.findMany({ select: { id: true } }) * */ findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> /** * Create a Lead. * @param {LeadCreateArgs} args - Arguments to create a Lead. * @example * // Create one Lead * const Lead = await prisma.lead.create({ * data: { * // ... data to create a Lead * } * }) * */ create(args: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> /** * Create many Leads. * @param {LeadCreateManyArgs} args - Arguments to create many Leads. * @example * // Create many Leads * const lead = await prisma.lead.createMany({ * data: [ * // ... provide data here * ] * }) * */ createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise /** * Create many Leads and returns the data saved in the database. * @param {LeadCreateManyAndReturnArgs} args - Arguments to create many Leads. * @example * // Create many Leads * const lead = await prisma.lead.createManyAndReturn({ * data: [ * // ... provide data here * ] * }) * * // Create many Leads and only return the `id` * const leadWithIdOnly = await prisma.lead.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(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> /** * Delete a Lead. * @param {LeadDeleteArgs} args - Arguments to delete one Lead. * @example * // Delete one Lead * const Lead = await prisma.lead.delete({ * where: { * // ... filter to delete one Lead * } * }) * */ delete(args: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> /** * Update one Lead. * @param {LeadUpdateArgs} args - Arguments to update one Lead. * @example * // Update one Lead * const lead = await prisma.lead.update({ * where: { * // ... provide filter here * }, * data: { * // ... provide data here * } * }) * */ update(args: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> /** * Delete zero or more Leads. * @param {LeadDeleteManyArgs} args - Arguments to filter Leads to delete. * @example * // Delete a few Leads * const { count } = await prisma.lead.deleteMany({ * where: { * // ... provide filter here * } * }) * */ deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise /** * Update zero or more Leads. * Note, that providing `undefined` is treated as the value not being there. * Read more here: https://pris.ly/d/null-undefined * @param {LeadUpdateManyArgs} args - Arguments to update one or more rows. * @example * // Update many Leads * const lead = await prisma.lead.updateMany({ * where: { * // ... provide filter here * }, * data: { * // ... provide data here * } * }) * */ updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise /** * Update zero or more Leads and returns the data updated in the database. * @param {LeadUpdateManyAndReturnArgs} args - Arguments to update many Leads. * @example * // Update many Leads * const lead = await prisma.lead.updateManyAndReturn({ * where: { * // ... provide filter here * }, * data: [ * // ... provide data here * ] * }) * * // Update zero or more Leads and only return the `id` * const leadWithIdOnly = await prisma.lead.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(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> /** * Create or update one Lead. * @param {LeadUpsertArgs} args - Arguments to update or create a Lead. * @example * // Update or create a Lead * const lead = await prisma.lead.upsert({ * create: { * // ... data to create a Lead * }, * update: { * // ... in case it already exists, update * }, * where: { * // ... the filter for the Lead we want to update * } * }) */ upsert(args: Prisma.SelectSubset>): Prisma.Prisma__LeadClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> /** * Count the number of Leads. * Note, that providing `undefined` is treated as the value not being there. * Read more here: https://pris.ly/d/null-undefined * @param {LeadCountArgs} args - Arguments to filter Leads to count. * @example * // Count the number of Leads * const count = await prisma.lead.count({ * where: { * // ... the filter for the Leads we want to count * } * }) **/ count( args?: Prisma.Subset, ): Prisma.PrismaPromise< T extends runtime.Types.Utils.Record<'select', any> ? T['select'] extends true ? number : Prisma.GetScalarType : number > /** * Allows you to perform aggregations operations on a Lead. * Note, that providing `undefined` is treated as the value not being there. * Read more here: https://pris.ly/d/null-undefined * @param {LeadAggregateArgs} 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(args: Prisma.Subset): Prisma.PrismaPromise> /** * Group by Lead. * Note, that providing `undefined` is treated as the value not being there. * Read more here: https://pris.ly/d/null-undefined * @param {LeadGroupByArgs} 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 LeadGroupByArgs, HasSelectOrTake extends Prisma.Or< Prisma.Extends<'skip', Prisma.Keys>, Prisma.Extends<'take', Prisma.Keys> >, OrderByArg extends Prisma.True extends HasSelectOrTake ? { orderBy: LeadGroupByArgs['orderBy'] } : { orderBy?: LeadGroupByArgs['orderBy'] }, OrderFields extends Prisma.ExcludeUnderscoreKeys>>, ByFields extends Prisma.MaybeTupleToUnion, ByValid extends Prisma.Has, HavingFields extends Prisma.GetHavingFields, HavingValid extends Prisma.Has, 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 ? 'orderBy' extends Prisma.Keys ? 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 ? 'orderBy' extends Prisma.Keys ? 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 & InputErrors): {} extends InputErrors ? GetLeadGroupByPayload : Prisma.PrismaPromise /** * Fields of the Lead model */ readonly fields: LeadFieldRefs; } /** * The delegate class that acts as a "Promise-like" for Lead. * 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__LeadClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" events = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise /** * 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(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise /** * 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 } /** * Fields of the Lead model */ export interface LeadFieldRefs { readonly id: Prisma.FieldRef<"Lead", 'String'> readonly email: Prisma.FieldRef<"Lead", 'String'> readonly firstName: Prisma.FieldRef<"Lead", 'String'> readonly lastName: Prisma.FieldRef<"Lead", 'String'> readonly phone: Prisma.FieldRef<"Lead", 'String'> readonly company: Prisma.FieldRef<"Lead", 'String'> readonly source: Prisma.FieldRef<"Lead", 'String'> readonly status: Prisma.FieldRef<"Lead", 'LeadStatus'> readonly utmSource: Prisma.FieldRef<"Lead", 'String'> readonly utmMedium: Prisma.FieldRef<"Lead", 'String'> readonly utmCampaign: Prisma.FieldRef<"Lead", 'String'> readonly utmTerm: Prisma.FieldRef<"Lead", 'String'> readonly utmContent: Prisma.FieldRef<"Lead", 'String'> readonly gclid: Prisma.FieldRef<"Lead", 'String'> readonly fbclid: Prisma.FieldRef<"Lead", 'String'> readonly referrer: Prisma.FieldRef<"Lead", 'String'> readonly landingPage: Prisma.FieldRef<"Lead", 'String'> readonly firstSeenAt: Prisma.FieldRef<"Lead", 'DateTime'> readonly lastTouchAt: Prisma.FieldRef<"Lead", 'DateTime'> readonly score: Prisma.FieldRef<"Lead", 'Int'> readonly notes: Prisma.FieldRef<"Lead", 'Json'> readonly convertedToTenantId: Prisma.FieldRef<"Lead", 'String'> readonly convertedAt: Prisma.FieldRef<"Lead", 'DateTime'> readonly lastIpHash: Prisma.FieldRef<"Lead", 'String'> readonly userAgent: Prisma.FieldRef<"Lead", 'String'> readonly createdAt: Prisma.FieldRef<"Lead", 'DateTime'> readonly updatedAt: Prisma.FieldRef<"Lead", 'DateTime'> } // Custom InputTypes /** * Lead findUnique */ export type LeadFindUniqueArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * Filter, which Lead to fetch. */ where: Prisma.LeadWhereUniqueInput } /** * Lead findUniqueOrThrow */ export type LeadFindUniqueOrThrowArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * Filter, which Lead to fetch. */ where: Prisma.LeadWhereUniqueInput } /** * Lead findFirst */ export type LeadFindFirstArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * Filter, which Lead to fetch. */ where?: Prisma.LeadWhereInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} * * Determine the order of Leads to fetch. */ orderBy?: Prisma.LeadOrderByWithRelationInput | Prisma.LeadOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * * Sets the position for searching for Leads. */ cursor?: Prisma.LeadWhereUniqueInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} * * Take `±n` Leads 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` Leads. */ skip?: number /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} * * Filter by unique combinations of Leads. */ distinct?: Prisma.LeadScalarFieldEnum | Prisma.LeadScalarFieldEnum[] } /** * Lead findFirstOrThrow */ export type LeadFindFirstOrThrowArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * Filter, which Lead to fetch. */ where?: Prisma.LeadWhereInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} * * Determine the order of Leads to fetch. */ orderBy?: Prisma.LeadOrderByWithRelationInput | Prisma.LeadOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * * Sets the position for searching for Leads. */ cursor?: Prisma.LeadWhereUniqueInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} * * Take `±n` Leads 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` Leads. */ skip?: number /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} * * Filter by unique combinations of Leads. */ distinct?: Prisma.LeadScalarFieldEnum | Prisma.LeadScalarFieldEnum[] } /** * Lead findMany */ export type LeadFindManyArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * Filter, which Leads to fetch. */ where?: Prisma.LeadWhereInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} * * Determine the order of Leads to fetch. */ orderBy?: Prisma.LeadOrderByWithRelationInput | Prisma.LeadOrderByWithRelationInput[] /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} * * Sets the position for listing Leads. */ cursor?: Prisma.LeadWhereUniqueInput /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} * * Take `±n` Leads 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` Leads. */ skip?: number /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} * * Filter by unique combinations of Leads. */ distinct?: Prisma.LeadScalarFieldEnum | Prisma.LeadScalarFieldEnum[] } /** * Lead create */ export type LeadCreateArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * The data needed to create a Lead. */ data: Prisma.XOR } /** * Lead createMany */ export type LeadCreateManyArgs = { /** * The data used to create many Leads. */ data: Prisma.LeadCreateManyInput | Prisma.LeadCreateManyInput[] skipDuplicates?: boolean } /** * Lead createManyAndReturn */ export type LeadCreateManyAndReturnArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelectCreateManyAndReturn | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * The data used to create many Leads. */ data: Prisma.LeadCreateManyInput | Prisma.LeadCreateManyInput[] skipDuplicates?: boolean } /** * Lead update */ export type LeadUpdateArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * The data needed to update a Lead. */ data: Prisma.XOR /** * Choose, which Lead to update. */ where: Prisma.LeadWhereUniqueInput } /** * Lead updateMany */ export type LeadUpdateManyArgs = { /** * The data used to update Leads. */ data: Prisma.XOR /** * Filter which Leads to update */ where?: Prisma.LeadWhereInput /** * Limit how many Leads to update. */ limit?: number } /** * Lead updateManyAndReturn */ export type LeadUpdateManyAndReturnArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelectUpdateManyAndReturn | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * The data used to update Leads. */ data: Prisma.XOR /** * Filter which Leads to update */ where?: Prisma.LeadWhereInput /** * Limit how many Leads to update. */ limit?: number } /** * Lead upsert */ export type LeadUpsertArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * The filter to search for the Lead to update in case it exists. */ where: Prisma.LeadWhereUniqueInput /** * In case the Lead found by the `where` argument doesn't exist, create a new Lead with this data. */ create: Prisma.XOR /** * In case the Lead was found with the provided `where` argument, update it with this data. */ update: Prisma.XOR } /** * Lead delete */ export type LeadDeleteArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null /** * Filter which Lead to delete. */ where: Prisma.LeadWhereUniqueInput } /** * Lead deleteMany */ export type LeadDeleteManyArgs = { /** * Filter which Leads to delete */ where?: Prisma.LeadWhereInput /** * Limit how many Leads to delete. */ limit?: number } /** * Lead.events */ export type Lead$eventsArgs = { /** * Select specific fields to fetch from the LeadEvent */ select?: Prisma.LeadEventSelect | null /** * Omit specific fields from the LeadEvent */ omit?: Prisma.LeadEventOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadEventInclude | null where?: Prisma.LeadEventWhereInput orderBy?: Prisma.LeadEventOrderByWithRelationInput | Prisma.LeadEventOrderByWithRelationInput[] cursor?: Prisma.LeadEventWhereUniqueInput take?: number skip?: number distinct?: Prisma.LeadEventScalarFieldEnum | Prisma.LeadEventScalarFieldEnum[] } /** * Lead without action */ export type LeadDefaultArgs = { /** * Select specific fields to fetch from the Lead */ select?: Prisma.LeadSelect | null /** * Omit specific fields from the Lead */ omit?: Prisma.LeadOmit | null /** * Choose, which related nodes to fetch as well */ include?: Prisma.LeadInclude | null }