// ⚠️  GENERATED FILE - DO NOT EDIT
// This file is automatically generated by 'prisma contract emit'.
// To regenerate, run: prisma contract emit
import type {
  Bit,
  Char,
  CodecTypes as PgTypes,
  Interval,
  JsonValue,
  Numeric,
  Time,
  TimeString,
  Timestamp,
  TimestampString,
  Timestamptz,
  TimestamptzString,
  Timetz,
  VarBit,
  Varchar,
} from '@prisma/orm-postgres/target/codec-types';
import type { QueryOperationTypes as PgTargetQueryOps } from '@prisma/orm-postgres/target/operation-types';

import type {
  ContractWithTypeMaps,
  RelationKeys,
  TypeMaps as TypeMapsType,
} from '@prisma/orm-postgres/family-contract/types';
import type {
  Contract as ContractType,
  ExecutionHashBase,
  NamespaceId,
  ProfileHashBase,
  StorageHashBase,
} from '@prisma/orm-postgres/contract/types';

export type StorageHash =
  StorageHashBase<'292afcdd627e8a8dc76bda0fc864fd5c5d338be0d68f611dde95ed99503a9a2c'>;
export type ExecutionHash =
  ExecutionHashBase<'0e020946f49da1811d546d854f97e9246b5db7f87eb1c51140661eca3de32f0e'>;
export type ProfileHash =
  ProfileHashBase<'3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2'>;

export type CodecTypes = PgTypes;
export type LaneCodecTypes = CodecTypes;
export type QueryOperationTypes = PgTargetQueryOps<CodecTypes>;
export type AggregateTypes = {
  readonly avg: {
    readonly byCodec: {
      readonly 'pg/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/float4@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/int@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/int2@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/int4@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/int8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/int8number@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/time-string@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/time-temporal@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/unboundedint@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'sql/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'sql/int@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
    };
  };
  readonly avgDecimal: {
    readonly byCodec: {
      readonly 'pg/int@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/int2@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/int4@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/int8@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/int8number@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/unboundedint@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'sql/int@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
    };
  };
  readonly count: {
    readonly byCodec: {};
    readonly withoutInput: { readonly output: 'pg/int8number@1'; readonly nullable: false };
    readonly anyInput: { readonly output: 'pg/int8number@1'; readonly nullable: false };
  };
  readonly countBigInt: {
    readonly byCodec: {};
    readonly withoutInput: { readonly output: 'pg/int8@1'; readonly nullable: false };
    readonly anyInput: { readonly output: 'pg/int8@1'; readonly nullable: false };
  };
  readonly max: {
    readonly byCodec: {
      readonly 'pg/char@1': { readonly output: 'pg/char@1'; readonly nullable: true };
      readonly 'pg/date-string@1': { readonly output: 'pg/date-string@1'; readonly nullable: true };
      readonly 'pg/date-temporal@1': {
        readonly output: 'pg/date-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/enum@1': { readonly output: 'pg/enum@1'; readonly nullable: true };
      readonly 'pg/float@1': { readonly output: 'pg/float@1'; readonly nullable: true };
      readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
      readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/inet@1': { readonly output: 'pg/inet@1'; readonly nullable: true };
      readonly 'pg/int@1': { readonly output: 'pg/int@1'; readonly nullable: true };
      readonly 'pg/int2@1': { readonly output: 'pg/int2@1'; readonly nullable: true };
      readonly 'pg/int4@1': { readonly output: 'pg/int4@1'; readonly nullable: true };
      readonly 'pg/int8@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
      readonly 'pg/int8number@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/text-array@1': { readonly output: 'pg/text-array@1'; readonly nullable: true };
      readonly 'pg/text@1': { readonly output: 'pg/text@1'; readonly nullable: true };
      readonly 'pg/time-string@1': { readonly output: 'pg/time-string@1'; readonly nullable: true };
      readonly 'pg/time-temporal@1': {
        readonly output: 'pg/time-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamp-string@1': {
        readonly output: 'pg/timestamp-string@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamp-temporal@1': {
        readonly output: 'pg/timestamp-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamptz-date@1': {
        readonly output: 'pg/timestamptz-date@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamptz-string@1': {
        readonly output: 'pg/timestamptz-string@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamptz-temporal@1': {
        readonly output: 'pg/timestamptz-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/timetz@1': { readonly output: 'pg/timetz@1'; readonly nullable: true };
      readonly 'pg/unboundedint@1': {
        readonly output: 'pg/unboundedint@1';
        readonly nullable: true;
      };
      readonly 'pg/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
      readonly 'sql/char@1': { readonly output: 'sql/char@1'; readonly nullable: true };
      readonly 'sql/float@1': { readonly output: 'sql/float@1'; readonly nullable: true };
      readonly 'sql/int@1': { readonly output: 'sql/int@1'; readonly nullable: true };
      readonly 'sql/text@1': { readonly output: 'sql/text@1'; readonly nullable: true };
      readonly 'sql/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
    };
  };
  readonly min: {
    readonly byCodec: {
      readonly 'pg/char@1': { readonly output: 'pg/char@1'; readonly nullable: true };
      readonly 'pg/date-string@1': { readonly output: 'pg/date-string@1'; readonly nullable: true };
      readonly 'pg/date-temporal@1': {
        readonly output: 'pg/date-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/enum@1': { readonly output: 'pg/enum@1'; readonly nullable: true };
      readonly 'pg/float@1': { readonly output: 'pg/float@1'; readonly nullable: true };
      readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
      readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/inet@1': { readonly output: 'pg/inet@1'; readonly nullable: true };
      readonly 'pg/int@1': { readonly output: 'pg/int@1'; readonly nullable: true };
      readonly 'pg/int2@1': { readonly output: 'pg/int2@1'; readonly nullable: true };
      readonly 'pg/int4@1': { readonly output: 'pg/int4@1'; readonly nullable: true };
      readonly 'pg/int8@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
      readonly 'pg/int8number@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/text-array@1': { readonly output: 'pg/text-array@1'; readonly nullable: true };
      readonly 'pg/text@1': { readonly output: 'pg/text@1'; readonly nullable: true };
      readonly 'pg/time-string@1': { readonly output: 'pg/time-string@1'; readonly nullable: true };
      readonly 'pg/time-temporal@1': {
        readonly output: 'pg/time-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamp-string@1': {
        readonly output: 'pg/timestamp-string@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamp-temporal@1': {
        readonly output: 'pg/timestamp-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamptz-date@1': {
        readonly output: 'pg/timestamptz-date@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamptz-string@1': {
        readonly output: 'pg/timestamptz-string@1';
        readonly nullable: true;
      };
      readonly 'pg/timestamptz-temporal@1': {
        readonly output: 'pg/timestamptz-temporal@1';
        readonly nullable: true;
      };
      readonly 'pg/timetz@1': { readonly output: 'pg/timetz@1'; readonly nullable: true };
      readonly 'pg/unboundedint@1': {
        readonly output: 'pg/unboundedint@1';
        readonly nullable: true;
      };
      readonly 'pg/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
      readonly 'sql/char@1': { readonly output: 'sql/char@1'; readonly nullable: true };
      readonly 'sql/float@1': { readonly output: 'sql/float@1'; readonly nullable: true };
      readonly 'sql/int@1': { readonly output: 'sql/int@1'; readonly nullable: true };
      readonly 'sql/text@1': { readonly output: 'sql/text@1'; readonly nullable: true };
      readonly 'sql/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
    };
  };
  readonly sum: {
    readonly byCodec: {
      readonly 'pg/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
      readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'pg/int@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/int2@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/int4@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/int8@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/int8number@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
      readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
      readonly 'pg/time-string@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/time-temporal@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
      readonly 'pg/unboundedint@1': {
        readonly output: 'pg/unboundedint@1';
        readonly nullable: true;
      };
      readonly 'sql/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
      readonly 'sql/int@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
    };
  };
  readonly sumBigInt: {
    readonly byCodec: {
      readonly 'pg/int@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
      readonly 'pg/int2@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
      readonly 'pg/int4@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
      readonly 'pg/int8@1': { readonly output: 'pg/unboundedint@1'; readonly nullable: true };
      readonly 'pg/int8number@1': { readonly output: 'pg/unboundedint@1'; readonly nullable: true };
      readonly 'pg/unboundedint@1': {
        readonly output: 'pg/unboundedint@1';
        readonly nullable: true;
      };
      readonly 'sql/int@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
    };
  };
};
type DefaultLiteralValue<CodecId extends string, Encoded> = CodecId extends keyof CodecTypes
  ? Encoded extends CodecTypes[CodecId]['json']
    ? Encoded
    : CodecTypes[CodecId]['json']
  : Encoded;

export type FieldOutputTypes = {
  readonly public: {
    readonly Activity: {
      readonly completedAt: CodecTypes['pg/timestamptz-temporal@1']['output'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly description: CodecTypes['pg/text@1']['output'] | null;
      readonly dueAt: CodecTypes['pg/timestamptz-temporal@1']['output'] | null;
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly leadId: CodecTypes['pg/text@1']['output'];
      readonly title: CodecTypes['pg/text@1']['output'];
      readonly type: 'NOTE' | 'CALL' | 'EMAIL' | 'MEETING' | 'TASK';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly userId: CodecTypes['pg/text@1']['output'];
    };
    readonly Company: {
      readonly address: CodecTypes['pg/text@1']['output'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly domain: CodecTypes['pg/text@1']['output'] | null;
      readonly email: CodecTypes['pg/text@1']['output'] | null;
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly industry: CodecTypes['pg/text@1']['output'] | null;
      readonly name: CodecTypes['pg/text@1']['output'];
      readonly phone: CodecTypes['pg/text@1']['output'] | null;
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly website: CodecTypes['pg/text@1']['output'] | null;
    };
    readonly Lead: {
      readonly assignedToId: CodecTypes['pg/text@1']['output'];
      readonly companyId: CodecTypes['pg/text@1']['output'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly createdById: CodecTypes['pg/text@1']['output'];
      readonly email: CodecTypes['pg/text@1']['output'] | null;
      readonly firstName: CodecTypes['pg/text@1']['output'];
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly jobTitle: CodecTypes['pg/text@1']['output'] | null;
      readonly lastName: CodecTypes['pg/text@1']['output'] | null;
      readonly notes: CodecTypes['pg/text@1']['output'] | null;
      readonly phone: CodecTypes['pg/text@1']['output'] | null;
      readonly source:
        'WEBSITE' | 'REFERRAL' | 'COLD_CALL' | 'COLD_EMAIL' | 'SOCIAL_MEDIA' | 'OTHER';
      readonly status: 'NEW' | 'CONTACTED' | 'QUALIFIED' | 'PROPOSAL' | 'WON' | 'LOST';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    };
    readonly User: {
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly email: CodecTypes['pg/text@1']['output'];
      readonly firstName: CodecTypes['pg/text@1']['output'];
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly isActive: CodecTypes['pg/bool@1']['output'];
      readonly lastName: CodecTypes['pg/text@1']['output'];
      readonly passwordHash: CodecTypes['pg/text@1']['output'];
      readonly role: 'ADMIN' | 'SALES_USER';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    };
  };
};
export type FieldInputTypes = {
  readonly public: {
    readonly Activity: {
      readonly completedAt: CodecTypes['pg/timestamptz-temporal@1']['input'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly description: CodecTypes['pg/text@1']['input'] | null;
      readonly dueAt: CodecTypes['pg/timestamptz-temporal@1']['input'] | null;
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly leadId: CodecTypes['pg/text@1']['input'];
      readonly title: CodecTypes['pg/text@1']['input'];
      readonly type: 'NOTE' | 'CALL' | 'EMAIL' | 'MEETING' | 'TASK';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly userId: CodecTypes['pg/text@1']['input'];
    };
    readonly Company: {
      readonly address: CodecTypes['pg/text@1']['input'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly domain: CodecTypes['pg/text@1']['input'] | null;
      readonly email: CodecTypes['pg/text@1']['input'] | null;
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly industry: CodecTypes['pg/text@1']['input'] | null;
      readonly name: CodecTypes['pg/text@1']['input'];
      readonly phone: CodecTypes['pg/text@1']['input'] | null;
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly website: CodecTypes['pg/text@1']['input'] | null;
    };
    readonly Lead: {
      readonly assignedToId: CodecTypes['pg/text@1']['input'];
      readonly companyId: CodecTypes['pg/text@1']['input'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly createdById: CodecTypes['pg/text@1']['input'];
      readonly email: CodecTypes['pg/text@1']['input'] | null;
      readonly firstName: CodecTypes['pg/text@1']['input'];
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly jobTitle: CodecTypes['pg/text@1']['input'] | null;
      readonly lastName: CodecTypes['pg/text@1']['input'] | null;
      readonly notes: CodecTypes['pg/text@1']['input'] | null;
      readonly phone: CodecTypes['pg/text@1']['input'] | null;
      readonly source:
        'WEBSITE' | 'REFERRAL' | 'COLD_CALL' | 'COLD_EMAIL' | 'SOCIAL_MEDIA' | 'OTHER';
      readonly status: 'NEW' | 'CONTACTED' | 'QUALIFIED' | 'PROPOSAL' | 'WON' | 'LOST';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
    };
    readonly User: {
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly email: CodecTypes['pg/text@1']['input'];
      readonly firstName: CodecTypes['pg/text@1']['input'];
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly isActive: CodecTypes['pg/bool@1']['input'];
      readonly lastName: CodecTypes['pg/text@1']['input'];
      readonly passwordHash: CodecTypes['pg/text@1']['input'];
      readonly role: 'ADMIN' | 'SALES_USER';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
    };
  };
};
export type StorageColumnTypes = {
  readonly public: {
    readonly Activity: {
      readonly completedAt: CodecTypes['pg/timestamptz-temporal@1']['output'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly description: CodecTypes['pg/text@1']['output'] | null;
      readonly dueAt: CodecTypes['pg/timestamptz-temporal@1']['output'] | null;
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly leadId: CodecTypes['pg/text@1']['output'];
      readonly title: CodecTypes['pg/text@1']['output'];
      readonly type: 'NOTE' | 'CALL' | 'EMAIL' | 'MEETING' | 'TASK';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly userId: CodecTypes['pg/text@1']['output'];
    };
    readonly Company: {
      readonly address: CodecTypes['pg/text@1']['output'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly domain: CodecTypes['pg/text@1']['output'] | null;
      readonly email: CodecTypes['pg/text@1']['output'] | null;
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly industry: CodecTypes['pg/text@1']['output'] | null;
      readonly name: CodecTypes['pg/text@1']['output'];
      readonly phone: CodecTypes['pg/text@1']['output'] | null;
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly website: CodecTypes['pg/text@1']['output'] | null;
    };
    readonly Lead: {
      readonly assignedToId: CodecTypes['pg/text@1']['output'];
      readonly companyId: CodecTypes['pg/text@1']['output'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly createdById: CodecTypes['pg/text@1']['output'];
      readonly email: CodecTypes['pg/text@1']['output'] | null;
      readonly firstName: CodecTypes['pg/text@1']['output'];
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly jobTitle: CodecTypes['pg/text@1']['output'] | null;
      readonly lastName: CodecTypes['pg/text@1']['output'] | null;
      readonly notes: CodecTypes['pg/text@1']['output'] | null;
      readonly phone: CodecTypes['pg/text@1']['output'] | null;
      readonly source:
        'WEBSITE' | 'REFERRAL' | 'COLD_CALL' | 'COLD_EMAIL' | 'SOCIAL_MEDIA' | 'OTHER';
      readonly status: 'NEW' | 'CONTACTED' | 'QUALIFIED' | 'PROPOSAL' | 'WON' | 'LOST';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    };
    readonly User: {
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
      readonly email: CodecTypes['pg/text@1']['output'];
      readonly firstName: CodecTypes['pg/text@1']['output'];
      readonly id: CodecTypes['pg/text@1']['output'];
      readonly isActive: CodecTypes['pg/bool@1']['output'];
      readonly lastName: CodecTypes['pg/text@1']['output'];
      readonly passwordHash: CodecTypes['pg/text@1']['output'];
      readonly role: 'ADMIN' | 'SALES_USER';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    };
  };
};
export type StorageColumnInputTypes = {
  readonly public: {
    readonly Activity: {
      readonly completedAt: CodecTypes['pg/timestamptz-temporal@1']['input'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly description: CodecTypes['pg/text@1']['input'] | null;
      readonly dueAt: CodecTypes['pg/timestamptz-temporal@1']['input'] | null;
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly leadId: CodecTypes['pg/text@1']['input'];
      readonly title: CodecTypes['pg/text@1']['input'];
      readonly type: 'NOTE' | 'CALL' | 'EMAIL' | 'MEETING' | 'TASK';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly userId: CodecTypes['pg/text@1']['input'];
    };
    readonly Company: {
      readonly address: CodecTypes['pg/text@1']['input'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly domain: CodecTypes['pg/text@1']['input'] | null;
      readonly email: CodecTypes['pg/text@1']['input'] | null;
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly industry: CodecTypes['pg/text@1']['input'] | null;
      readonly name: CodecTypes['pg/text@1']['input'];
      readonly phone: CodecTypes['pg/text@1']['input'] | null;
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly website: CodecTypes['pg/text@1']['input'] | null;
    };
    readonly Lead: {
      readonly assignedToId: CodecTypes['pg/text@1']['input'];
      readonly companyId: CodecTypes['pg/text@1']['input'] | null;
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly createdById: CodecTypes['pg/text@1']['input'];
      readonly email: CodecTypes['pg/text@1']['input'] | null;
      readonly firstName: CodecTypes['pg/text@1']['input'];
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly jobTitle: CodecTypes['pg/text@1']['input'] | null;
      readonly lastName: CodecTypes['pg/text@1']['input'] | null;
      readonly notes: CodecTypes['pg/text@1']['input'] | null;
      readonly phone: CodecTypes['pg/text@1']['input'] | null;
      readonly source:
        'WEBSITE' | 'REFERRAL' | 'COLD_CALL' | 'COLD_EMAIL' | 'SOCIAL_MEDIA' | 'OTHER';
      readonly status: 'NEW' | 'CONTACTED' | 'QUALIFIED' | 'PROPOSAL' | 'WON' | 'LOST';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
    };
    readonly User: {
      readonly createdAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
      readonly email: CodecTypes['pg/text@1']['input'];
      readonly firstName: CodecTypes['pg/text@1']['input'];
      readonly id: CodecTypes['pg/text@1']['input'];
      readonly isActive: CodecTypes['pg/bool@1']['input'];
      readonly lastName: CodecTypes['pg/text@1']['input'];
      readonly passwordHash: CodecTypes['pg/text@1']['input'];
      readonly role: 'ADMIN' | 'SALES_USER';
      readonly updatedAt: CodecTypes['pg/timestamptz-temporal@1']['input'];
    };
  };
};

export namespace Models {
  export type public_Activity = {
    completedAt: CodecTypes['pg/timestamptz-temporal@1']['output'] | null;
    createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    description: CodecTypes['pg/text@1']['output'] | null;
    dueAt: CodecTypes['pg/timestamptz-temporal@1']['output'] | null;
    id: CodecTypes['pg/text@1']['output'];
    leadId: CodecTypes['pg/text@1']['output'];
    title: CodecTypes['pg/text@1']['output'];
    type: 'NOTE' | 'CALL' | 'EMAIL' | 'MEETING' | 'TASK';
    updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    userId: CodecTypes['pg/text@1']['output'];
    lead: public_Lead;
    user: public_User;
    readonly [RelationKeys]?: 'lead' | 'user';
  };
  export type public_Company = {
    address: CodecTypes['pg/text@1']['output'] | null;
    createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    domain: CodecTypes['pg/text@1']['output'] | null;
    email: CodecTypes['pg/text@1']['output'] | null;
    id: CodecTypes['pg/text@1']['output'];
    industry: CodecTypes['pg/text@1']['output'] | null;
    name: CodecTypes['pg/text@1']['output'];
    phone: CodecTypes['pg/text@1']['output'] | null;
    updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    website: CodecTypes['pg/text@1']['output'] | null;
    leads: public_Lead[];
    readonly [RelationKeys]?: 'leads';
  };
  export type public_Lead = {
    assignedToId: CodecTypes['pg/text@1']['output'];
    companyId: CodecTypes['pg/text@1']['output'] | null;
    createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    createdById: CodecTypes['pg/text@1']['output'];
    email: CodecTypes['pg/text@1']['output'] | null;
    firstName: CodecTypes['pg/text@1']['output'];
    id: CodecTypes['pg/text@1']['output'];
    jobTitle: CodecTypes['pg/text@1']['output'] | null;
    lastName: CodecTypes['pg/text@1']['output'] | null;
    notes: CodecTypes['pg/text@1']['output'] | null;
    phone: CodecTypes['pg/text@1']['output'] | null;
    source: 'WEBSITE' | 'REFERRAL' | 'COLD_CALL' | 'COLD_EMAIL' | 'SOCIAL_MEDIA' | 'OTHER';
    status: 'NEW' | 'CONTACTED' | 'QUALIFIED' | 'PROPOSAL' | 'WON' | 'LOST';
    updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    activities: public_Activity[];
    assignedTo: public_User;
    company: public_Company | null;
    createdBy: public_User;
    readonly [RelationKeys]?: 'activities' | 'assignedTo' | 'company' | 'createdBy';
  };
  export type public_User = {
    createdAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    email: CodecTypes['pg/text@1']['output'];
    firstName: CodecTypes['pg/text@1']['output'];
    id: CodecTypes['pg/text@1']['output'];
    isActive: CodecTypes['pg/bool@1']['output'];
    lastName: CodecTypes['pg/text@1']['output'];
    passwordHash: CodecTypes['pg/text@1']['output'];
    role: 'ADMIN' | 'SALES_USER';
    updatedAt: CodecTypes['pg/timestamptz-temporal@1']['output'];
    activities: public_Activity[];
    assignedLeads: public_Lead[];
    createdLeads: public_Lead[];
    readonly [RelationKeys]?: 'activities' | 'assignedLeads' | 'createdLeads';
  };
}

export declare const models: {
  public: {
    Activity: Models.public_Activity;
    Company: Models.public_Company;
    Lead: Models.public_Lead;
    User: Models.public_User;
  };
};

export type TypeMaps = TypeMapsType<
  CodecTypes,
  QueryOperationTypes,
  FieldOutputTypes,
  FieldInputTypes,
  StorageColumnTypes,
  StorageColumnInputTypes,
  AggregateTypes
>;

type ContractBase = Omit<
  ContractType<{
    readonly namespaces: {
      readonly public: {
        readonly id: 'public';
        readonly kind: 'postgres-schema';
        readonly entries: {
          readonly table: {
            readonly Activity: {
              columns: {
                readonly completedAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: true;
                };
                readonly createdAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                  readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
                };
                readonly description: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly dueAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: true;
                };
                readonly id: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly leadId: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly title: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly type: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly updatedAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                };
                readonly userId: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
              };
              primaryKey: { readonly columns: readonly ['id'] };
              uniques: readonly [];
              indexes: readonly [
                {
                  readonly name: 'Activity_leadId_idx_9113844c';
                  readonly prefix: 'Activity_leadId_idx';
                  readonly columns: readonly ['leadId'];
                  readonly unique: false;
                },
                {
                  readonly name: 'Activity_type_idx_b6b604ea';
                  readonly prefix: 'Activity_type_idx';
                  readonly columns: readonly ['type'];
                  readonly unique: false;
                },
                {
                  readonly name: 'Activity_userId_idx_a489d58a';
                  readonly prefix: 'Activity_userId_idx';
                  readonly columns: readonly ['userId'];
                  readonly unique: false;
                },
              ];
              foreignKeys: readonly [
                {
                  readonly source: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Activity';
                    readonly columns: readonly ['leadId'];
                  };
                  readonly target: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Lead';
                    readonly columns: readonly ['id'];
                  };
                },
                {
                  readonly source: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Activity';
                    readonly columns: readonly ['userId'];
                  };
                  readonly target: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'User';
                    readonly columns: readonly ['id'];
                  };
                },
              ];
            };
            readonly Company: {
              columns: {
                readonly address: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly createdAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                  readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
                };
                readonly domain: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly email: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly id: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly industry: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly name: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly phone: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly updatedAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                };
                readonly website: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
              };
              primaryKey: { readonly columns: readonly ['id'] };
              uniques: readonly [{ readonly columns: readonly ['domain'] }];
              indexes: readonly [
                {
                  readonly name: 'Company_name_idx_ce87e6ba';
                  readonly prefix: 'Company_name_idx';
                  readonly columns: readonly ['name'];
                  readonly unique: false;
                },
              ];
              foreignKeys: readonly [];
            };
            readonly Lead: {
              columns: {
                readonly assignedToId: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly companyId: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly createdAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                  readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
                };
                readonly createdById: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly email: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly firstName: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly id: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly jobTitle: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly lastName: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly notes: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly phone: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: true;
                };
                readonly source: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                  readonly default: {
                    readonly kind: 'literal';
                    readonly value: DefaultLiteralValue<'pg/text@1', 'OTHER'>;
                  };
                };
                readonly status: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                  readonly default: {
                    readonly kind: 'literal';
                    readonly value: DefaultLiteralValue<'pg/text@1', 'NEW'>;
                  };
                };
                readonly updatedAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                };
              };
              primaryKey: { readonly columns: readonly ['id'] };
              uniques: readonly [];
              indexes: readonly [
                {
                  readonly name: 'Lead_assignedToId_idx_45a131c2';
                  readonly prefix: 'Lead_assignedToId_idx';
                  readonly columns: readonly ['assignedToId'];
                  readonly unique: false;
                },
                {
                  readonly name: 'Lead_companyId_idx_33acc5ed';
                  readonly prefix: 'Lead_companyId_idx';
                  readonly columns: readonly ['companyId'];
                  readonly unique: false;
                },
                {
                  readonly name: 'Lead_createdById_idx_8bf640ed';
                  readonly prefix: 'Lead_createdById_idx';
                  readonly columns: readonly ['createdById'];
                  readonly unique: false;
                },
                {
                  readonly name: 'Lead_status_idx_e98638ab';
                  readonly prefix: 'Lead_status_idx';
                  readonly columns: readonly ['status'];
                  readonly unique: false;
                },
              ];
              foreignKeys: readonly [
                {
                  readonly source: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Lead';
                    readonly columns: readonly ['createdById'];
                  };
                  readonly target: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'User';
                    readonly columns: readonly ['id'];
                  };
                },
                {
                  readonly source: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Lead';
                    readonly columns: readonly ['assignedToId'];
                  };
                  readonly target: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'User';
                    readonly columns: readonly ['id'];
                  };
                },
                {
                  readonly source: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Lead';
                    readonly columns: readonly ['companyId'];
                  };
                  readonly target: {
                    readonly namespaceId: 'public' & NamespaceId;
                    readonly tableName: 'Company';
                    readonly columns: readonly ['id'];
                  };
                },
              ];
            };
            readonly User: {
              columns: {
                readonly createdAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                  readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
                };
                readonly email: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly firstName: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly id: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly isActive: {
                  readonly nativeType: 'bool';
                  readonly codecId: 'pg/bool@1';
                  readonly nullable: false;
                  readonly default: {
                    readonly kind: 'literal';
                    readonly value: DefaultLiteralValue<'pg/bool@1', true>;
                  };
                };
                readonly lastName: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly passwordHash: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                };
                readonly role: {
                  readonly nativeType: 'text';
                  readonly codecId: 'pg/text@1';
                  readonly nullable: false;
                  readonly default: {
                    readonly kind: 'literal';
                    readonly value: DefaultLiteralValue<'pg/text@1', 'SALES_USER'>;
                  };
                };
                readonly updatedAt: {
                  readonly nativeType: 'timestamptz';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                  readonly nullable: false;
                };
              };
              primaryKey: { readonly columns: readonly ['id'] };
              uniques: readonly [{ readonly columns: readonly ['email'] }];
              indexes: readonly [];
              foreignKeys: readonly [];
            };
          };
          readonly valueSet: {
            readonly ActivityType: {
              readonly kind: 'valueSet';
              readonly values: readonly ['NOTE', 'CALL', 'EMAIL', 'MEETING', 'TASK'];
            };
            readonly LeadSource: {
              readonly kind: 'valueSet';
              readonly values: readonly [
                'WEBSITE',
                'REFERRAL',
                'COLD_CALL',
                'COLD_EMAIL',
                'SOCIAL_MEDIA',
                'OTHER',
              ];
            };
            readonly LeadStatus: {
              readonly kind: 'valueSet';
              readonly values: readonly [
                'NEW',
                'CONTACTED',
                'QUALIFIED',
                'PROPOSAL',
                'WON',
                'LOST',
              ];
            };
            readonly UserRole: {
              readonly kind: 'valueSet';
              readonly values: readonly ['ADMIN', 'SALES_USER'];
            };
          };
        };
      };
    };
    readonly storageHash: StorageHash;
  }>,
  'roots' | 'domain'
> & {
  readonly target: 'postgres';
  readonly targetFamily: 'sql';
  readonly roots: {
    readonly Activity: { readonly namespace: 'public' & NamespaceId; readonly model: 'Activity' };
    readonly Company: { readonly namespace: 'public' & NamespaceId; readonly model: 'Company' };
    readonly Lead: { readonly namespace: 'public' & NamespaceId; readonly model: 'Lead' };
    readonly User: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
  };
  readonly domain: {
    readonly namespaces: {
      readonly public: {
        readonly models: {
          readonly Activity: {
            readonly fields: {
              readonly completedAt: {
                readonly nullable: true;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly createdAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly description: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly dueAt: {
                readonly nullable: true;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly id: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly leadId: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly title: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly type: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly updatedAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly userId: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
            };
            readonly relations: {
              readonly lead: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'Lead' };
                readonly cardinality: 'N:1';
                readonly nullable: false;
                readonly on: {
                  readonly localFields: readonly ['leadId'];
                  readonly targetFields: readonly ['id'];
                };
              };
              readonly user: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
                readonly cardinality: 'N:1';
                readonly nullable: false;
                readonly on: {
                  readonly localFields: readonly ['userId'];
                  readonly targetFields: readonly ['id'];
                };
              };
            };
            readonly storage: {
              readonly table: 'Activity';
              readonly namespaceId: 'public';
              readonly fields: {
                readonly completedAt: { readonly column: 'completedAt' };
                readonly createdAt: { readonly column: 'createdAt' };
                readonly description: { readonly column: 'description' };
                readonly dueAt: { readonly column: 'dueAt' };
                readonly id: { readonly column: 'id' };
                readonly leadId: { readonly column: 'leadId' };
                readonly title: { readonly column: 'title' };
                readonly type: { readonly column: 'type' };
                readonly updatedAt: { readonly column: 'updatedAt' };
                readonly userId: { readonly column: 'userId' };
              };
            };
          };
          readonly Company: {
            readonly fields: {
              readonly address: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly createdAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly domain: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly email: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly id: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly industry: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly name: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly phone: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly updatedAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly website: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
            };
            readonly relations: {
              readonly leads: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'Lead' };
                readonly cardinality: '1:N';
                readonly on: {
                  readonly localFields: readonly ['id'];
                  readonly targetFields: readonly ['companyId'];
                };
              };
            };
            readonly storage: {
              readonly table: 'Company';
              readonly namespaceId: 'public';
              readonly fields: {
                readonly address: { readonly column: 'address' };
                readonly createdAt: { readonly column: 'createdAt' };
                readonly domain: { readonly column: 'domain' };
                readonly email: { readonly column: 'email' };
                readonly id: { readonly column: 'id' };
                readonly industry: { readonly column: 'industry' };
                readonly name: { readonly column: 'name' };
                readonly phone: { readonly column: 'phone' };
                readonly updatedAt: { readonly column: 'updatedAt' };
                readonly website: { readonly column: 'website' };
              };
            };
          };
          readonly Lead: {
            readonly fields: {
              readonly assignedToId: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly companyId: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly createdAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly createdById: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly email: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly firstName: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly id: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly jobTitle: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly lastName: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly notes: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly phone: {
                readonly nullable: true;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly source: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly status: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly updatedAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
            };
            readonly relations: {
              readonly activities: {
                readonly to: {
                  readonly namespace: 'public' & NamespaceId;
                  readonly model: 'Activity';
                };
                readonly cardinality: '1:N';
                readonly on: {
                  readonly localFields: readonly ['id'];
                  readonly targetFields: readonly ['leadId'];
                };
              };
              readonly assignedTo: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
                readonly cardinality: 'N:1';
                readonly nullable: false;
                readonly on: {
                  readonly localFields: readonly ['assignedToId'];
                  readonly targetFields: readonly ['id'];
                };
              };
              readonly company: {
                readonly to: {
                  readonly namespace: 'public' & NamespaceId;
                  readonly model: 'Company';
                };
                readonly cardinality: 'N:1';
                readonly nullable: true;
                readonly on: {
                  readonly localFields: readonly ['companyId'];
                  readonly targetFields: readonly ['id'];
                };
              };
              readonly createdBy: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
                readonly cardinality: 'N:1';
                readonly nullable: false;
                readonly on: {
                  readonly localFields: readonly ['createdById'];
                  readonly targetFields: readonly ['id'];
                };
              };
            };
            readonly storage: {
              readonly table: 'Lead';
              readonly namespaceId: 'public';
              readonly fields: {
                readonly assignedToId: { readonly column: 'assignedToId' };
                readonly companyId: { readonly column: 'companyId' };
                readonly createdAt: { readonly column: 'createdAt' };
                readonly createdById: { readonly column: 'createdById' };
                readonly email: { readonly column: 'email' };
                readonly firstName: { readonly column: 'firstName' };
                readonly id: { readonly column: 'id' };
                readonly jobTitle: { readonly column: 'jobTitle' };
                readonly lastName: { readonly column: 'lastName' };
                readonly notes: { readonly column: 'notes' };
                readonly phone: { readonly column: 'phone' };
                readonly source: { readonly column: 'source' };
                readonly status: { readonly column: 'status' };
                readonly updatedAt: { readonly column: 'updatedAt' };
              };
            };
          };
          readonly User: {
            readonly fields: {
              readonly createdAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
              readonly email: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly firstName: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly id: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly isActive: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/bool@1' };
              };
              readonly lastName: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly passwordHash: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly role: {
                readonly nullable: false;
                readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
              };
              readonly updatedAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: 'scalar';
                  readonly codecId: 'pg/timestamptz-temporal@1';
                };
              };
            };
            readonly relations: {
              readonly activities: {
                readonly to: {
                  readonly namespace: 'public' & NamespaceId;
                  readonly model: 'Activity';
                };
                readonly cardinality: '1:N';
                readonly on: {
                  readonly localFields: readonly ['id'];
                  readonly targetFields: readonly ['userId'];
                };
              };
              readonly assignedLeads: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'Lead' };
                readonly cardinality: '1:N';
                readonly on: {
                  readonly localFields: readonly ['id'];
                  readonly targetFields: readonly ['assignedToId'];
                };
              };
              readonly createdLeads: {
                readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'Lead' };
                readonly cardinality: '1:N';
                readonly on: {
                  readonly localFields: readonly ['id'];
                  readonly targetFields: readonly ['createdById'];
                };
              };
            };
            readonly storage: {
              readonly table: 'User';
              readonly namespaceId: 'public';
              readonly fields: {
                readonly createdAt: { readonly column: 'createdAt' };
                readonly email: { readonly column: 'email' };
                readonly firstName: { readonly column: 'firstName' };
                readonly id: { readonly column: 'id' };
                readonly isActive: { readonly column: 'isActive' };
                readonly lastName: { readonly column: 'lastName' };
                readonly passwordHash: { readonly column: 'passwordHash' };
                readonly role: { readonly column: 'role' };
                readonly updatedAt: { readonly column: 'updatedAt' };
              };
            };
          };
        };
        readonly enum: {
          readonly ActivityType: {
            readonly codecId: 'pg/text@1';
            readonly members: readonly [
              { readonly name: 'NOTE'; readonly value: 'NOTE' },
              { readonly name: 'CALL'; readonly value: 'CALL' },
              { readonly name: 'EMAIL'; readonly value: 'EMAIL' },
              { readonly name: 'MEETING'; readonly value: 'MEETING' },
              { readonly name: 'TASK'; readonly value: 'TASK' },
            ];
          };
          readonly LeadSource: {
            readonly codecId: 'pg/text@1';
            readonly members: readonly [
              { readonly name: 'WEBSITE'; readonly value: 'WEBSITE' },
              { readonly name: 'REFERRAL'; readonly value: 'REFERRAL' },
              { readonly name: 'COLD_CALL'; readonly value: 'COLD_CALL' },
              { readonly name: 'COLD_EMAIL'; readonly value: 'COLD_EMAIL' },
              { readonly name: 'SOCIAL_MEDIA'; readonly value: 'SOCIAL_MEDIA' },
              { readonly name: 'OTHER'; readonly value: 'OTHER' },
            ];
          };
          readonly LeadStatus: {
            readonly codecId: 'pg/text@1';
            readonly members: readonly [
              { readonly name: 'NEW'; readonly value: 'NEW' },
              { readonly name: 'CONTACTED'; readonly value: 'CONTACTED' },
              { readonly name: 'QUALIFIED'; readonly value: 'QUALIFIED' },
              { readonly name: 'PROPOSAL'; readonly value: 'PROPOSAL' },
              { readonly name: 'WON'; readonly value: 'WON' },
              { readonly name: 'LOST'; readonly value: 'LOST' },
            ];
          };
          readonly UserRole: {
            readonly codecId: 'pg/text@1';
            readonly members: readonly [
              { readonly name: 'ADMIN'; readonly value: 'ADMIN' },
              { readonly name: 'SALES_USER'; readonly value: 'SALES_USER' },
            ];
          };
        };
      };
    };
  };
  readonly capabilities: {
    readonly postgres: {
      readonly distinctOn: true;
      readonly jsonAgg: true;
      readonly lateral: true;
      readonly limit: true;
      readonly orderBy: true;
      readonly returning: true;
    };
    readonly sql: {
      readonly checkConstraint: true;
      readonly defaultInInsert: true;
      readonly enums: true;
      readonly insertOnConflictSkip: true;
      readonly insertOnConflictWithoutTarget: true;
      readonly lateral: true;
      readonly returning: true;
      readonly scalarList: true;
    };
  };
  readonly extensions: {};
  readonly execution: {
    readonly executionHash: ExecutionHash;
    readonly mutations: {
      readonly defaults: readonly [
        {
          readonly onCreate: { readonly id: 'uuidv4'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'id';
            readonly namespace: 'public';
            readonly table: 'Activity';
          };
        },
        {
          readonly onCreate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly onUpdate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'updatedAt';
            readonly namespace: 'public';
            readonly table: 'Activity';
          };
        },
        {
          readonly onCreate: { readonly id: 'uuidv4'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'id';
            readonly namespace: 'public';
            readonly table: 'Company';
          };
        },
        {
          readonly onCreate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly onUpdate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'updatedAt';
            readonly namespace: 'public';
            readonly table: 'Company';
          };
        },
        {
          readonly onCreate: { readonly id: 'uuidv4'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'id';
            readonly namespace: 'public';
            readonly table: 'Lead';
          };
        },
        {
          readonly onCreate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly onUpdate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'updatedAt';
            readonly namespace: 'public';
            readonly table: 'Lead';
          };
        },
        {
          readonly onCreate: { readonly id: 'uuidv4'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'id';
            readonly namespace: 'public';
            readonly table: 'User';
          };
        },
        {
          readonly onCreate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly onUpdate: { readonly id: 'instantNow'; readonly kind: 'generator' };
          readonly ref: {
            readonly column: 'updatedAt';
            readonly namespace: 'public';
            readonly table: 'User';
          };
        },
      ];
    };
  };
  readonly meta: {};

  readonly profileHash: ProfileHash;
};

export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;

export type Namespaces = Contract['storage']['namespaces'];
