
/**
 * Client
**/

import * as runtime from '@prisma/client/runtime/client.js';
import $Types = runtime.Types // general types
import $Public = runtime.Types.Public
import $Utils = runtime.Types.Utils
import $Extensions = runtime.Types.Extensions
import $Result = runtime.Types.Result

export type PrismaPromise<T> = $Public.PrismaPromise<T>


/**
 * Model Healthcheck
 * 
 */
export type Healthcheck = $Result.DefaultSelection<Prisma.$HealthcheckPayload>
/**
 * Model Setting
 * App-wide key-value settings (company name, currency, defaults).
 */
export type Setting = $Result.DefaultSelection<Prisma.$SettingPayload>
/**
 * Model User
 * 
 */
export type User = $Result.DefaultSelection<Prisma.$UserPayload>
/**
 * Model Branch
 * Business branch / store location (e.g. Accra Central, Kumasi Hub).
 */
export type Branch = $Result.DefaultSelection<Prisma.$BranchPayload>
/**
 * Model UserBranch
 * 
 */
export type UserBranch = $Result.DefaultSelection<Prisma.$UserBranchPayload>
/**
 * Model Role
 * 
 */
export type Role = $Result.DefaultSelection<Prisma.$RolePayload>
/**
 * Model Permission
 * 
 */
export type Permission = $Result.DefaultSelection<Prisma.$PermissionPayload>
/**
 * Model UserRole
 * 
 */
export type UserRole = $Result.DefaultSelection<Prisma.$UserRolePayload>
/**
 * Model RolePermission
 * 
 */
export type RolePermission = $Result.DefaultSelection<Prisma.$RolePermissionPayload>
/**
 * Model Category
 * 
 */
export type Category = $Result.DefaultSelection<Prisma.$CategoryPayload>
/**
 * Model Variation
 * Product variation attribute (e.g. Size, Color) with a list of option values.
 */
export type Variation = $Result.DefaultSelection<Prisma.$VariationPayload>
/**
 * Model Brand
 * Product brand / manufacturer label (e.g. Nike, Samsung).
 */
export type Brand = $Result.DefaultSelection<Prisma.$BrandPayload>
/**
 * Model Unit
 * Unit of measure (e.g. Piece, Kilogram) with optional short symbol (pc, kg).
 */
export type Unit = $Result.DefaultSelection<Prisma.$UnitPayload>
/**
 * Model Warehouse
 * Stock location / store warehouse (e.g. Main, North hub).
 */
export type Warehouse = $Result.DefaultSelection<Prisma.$WarehousePayload>
/**
 * Model WarehouseStock
 * Per-warehouse stock level for a product.
 */
export type WarehouseStock = $Result.DefaultSelection<Prisma.$WarehouseStockPayload>
/**
 * Model Supplier
 * Supplier / vendor record for purchasing and payables.
 */
export type Supplier = $Result.DefaultSelection<Prisma.$SupplierPayload>
/**
 * Model Purchase
 * Purchase order / goods received note header.
 */
export type Purchase = $Result.DefaultSelection<Prisma.$PurchasePayload>
/**
 * Model PurchaseLine
 * 
 */
export type PurchaseLine = $Result.DefaultSelection<Prisma.$PurchaseLinePayload>
/**
 * Model PurchaseReturn
 * Supplier purchase return header.
 */
export type PurchaseReturn = $Result.DefaultSelection<Prisma.$PurchaseReturnPayload>
/**
 * Model PurchaseReturnLine
 * 
 */
export type PurchaseReturnLine = $Result.DefaultSelection<Prisma.$PurchaseReturnLinePayload>
/**
 * Model Customer
 * Customer / client record for sales and receivables.
 */
export type Customer = $Result.DefaultSelection<Prisma.$CustomerPayload>
/**
 * Model PaymentMethod
 * Payment method used at checkout (e.g. Cash, Card, Mobile Money).
 */
export type PaymentMethod = $Result.DefaultSelection<Prisma.$PaymentMethodPayload>
/**
 * Model Sale
 * POS sale / receipt header.
 */
export type Sale = $Result.DefaultSelection<Prisma.$SalePayload>
/**
 * Model SaleLine
 * 
 */
export type SaleLine = $Result.DefaultSelection<Prisma.$SaleLinePayload>
/**
 * Model SalesReturn
 * Customer sales return header.
 */
export type SalesReturn = $Result.DefaultSelection<Prisma.$SalesReturnPayload>
/**
 * Model SalesReturnLine
 * 
 */
export type SalesReturnLine = $Result.DefaultSelection<Prisma.$SalesReturnLinePayload>
/**
 * Model Tax
 * Tax configuration (e.g. VAT 15%, NHIL 2.5%).
 */
export type Tax = $Result.DefaultSelection<Prisma.$TaxPayload>
/**
 * Model ExpenseCategory
 * Expense category for organizing expenses (e.g. Rent, Transport).
 */
export type ExpenseCategory = $Result.DefaultSelection<Prisma.$ExpenseCategoryPayload>
/**
 * Model Expense
 * Expense record (single entry) linked to a category.
 */
export type Expense = $Result.DefaultSelection<Prisma.$ExpensePayload>
/**
 * Model Product
 * Product catalog item (SKU) with sales & purchase metadata.
 */
export type Product = $Result.DefaultSelection<Prisma.$ProductPayload>
/**
 * Model InventoryTransfer
 * Stock transfer between warehouses.
 */
export type InventoryTransfer = $Result.DefaultSelection<Prisma.$InventoryTransferPayload>
/**
 * Model InventoryTransferLine
 * 
 */
export type InventoryTransferLine = $Result.DefaultSelection<Prisma.$InventoryTransferLinePayload>
/**
 * Model Invoice
 * Customer invoice header.
 */
export type Invoice = $Result.DefaultSelection<Prisma.$InvoicePayload>
/**
 * Model InvoiceLine
 * Customer invoice line items.
 */
export type InvoiceLine = $Result.DefaultSelection<Prisma.$InvoiceLinePayload>
/**
 * Model InventoryAdjustment
 * Inventory stock adjustment header.
 */
export type InventoryAdjustment = $Result.DefaultSelection<Prisma.$InventoryAdjustmentPayload>
/**
 * Model InventoryAdjustmentLine
 * Inventory adjustment line items.
 */
export type InventoryAdjustmentLine = $Result.DefaultSelection<Prisma.$InventoryAdjustmentLinePayload>
/**
 * Model EmailTemplate
 * Email message template for transactional emails.
 */
export type EmailTemplate = $Result.DefaultSelection<Prisma.$EmailTemplatePayload>
/**
 * Model SmsTemplate
 * SMS message template.
 */
export type SmsTemplate = $Result.DefaultSelection<Prisma.$SmsTemplatePayload>
/**
 * Model Notification
 * In-app notification for a user.
 */
export type Notification = $Result.DefaultSelection<Prisma.$NotificationPayload>
/**
 * Model ActivityLog
 * Audit log entry for create/update/delete actions.
 */
export type ActivityLog = $Result.DefaultSelection<Prisma.$ActivityLogPayload>

/**
 * ##  Prisma Client ʲˢ
 *
 * Type-safe database client for TypeScript & Node.js
 * @example
 * ```
 * const prisma = new PrismaClient({
 *   adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
 * })
 * // Fetch zero or more Healthchecks
 * const healthchecks = await prisma.healthcheck.findMany()
 * ```
 *
 *
 * Read more in our [docs](https://pris.ly/d/client).
 */
export class PrismaClient<
  ClientOptions extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
  const U = 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never,
  ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs
> {
  [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }

    /**
   * ##  Prisma Client ʲˢ
   *
   * Type-safe database client for TypeScript & Node.js
   * @example
   * ```
   * const prisma = new PrismaClient({
   *   adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
   * })
   * // Fetch zero or more Healthchecks
   * const healthchecks = await prisma.healthcheck.findMany()
   * ```
   *
   *
   * Read more in our [docs](https://pris.ly/d/client).
   */

  constructor(optionsArg ?: Prisma.Subset<ClientOptions, Prisma.PrismaClientOptions>);
  $on<V extends U>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;

  /**
   * Connect with the database
   */
  $connect(): $Utils.JsPromise<void>;

  /**
   * Disconnect from the database
   */
  $disconnect(): $Utils.JsPromise<void>;

/**
   * Executes a prepared raw query and returns the number of affected rows.
   * @example
   * ```
   * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
   * ```
   *
   * Read more in our [docs](https://pris.ly/d/raw-queries).
   */
  $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;

  /**
   * Executes a raw query and returns the number of affected rows.
   * Susceptible to SQL injections, see documentation.
   * @example
   * ```
   * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
   * ```
   *
   * Read more in our [docs](https://pris.ly/d/raw-queries).
   */
  $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;

  /**
   * Performs a prepared raw query and returns the `SELECT` data.
   * @example
   * ```
   * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
   * ```
   *
   * Read more in our [docs](https://pris.ly/d/raw-queries).
   */
  $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;

  /**
   * Performs a raw query and returns the `SELECT` data.
   * Susceptible to SQL injections, see documentation.
   * @example
   * ```
   * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
   * ```
   *
   * Read more in our [docs](https://pris.ly/d/raw-queries).
   */
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;


  /**
   * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
   * @example
   * ```
   * const [george, bob, alice] = await prisma.$transaction([
   *   prisma.user.create({ data: { name: 'George' } }),
   *   prisma.user.create({ data: { name: 'Bob' } }),
   *   prisma.user.create({ data: { name: 'Alice' } }),
   * ])
   * ```
   * 
   * Read more in our [docs](https://www.prisma.io/docs/orm/prisma-client/queries/transactions).
   */
  $transaction<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>

  $transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => $Utils.JsPromise<R>, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise<R>

  $extends: $Extensions.ExtendsHook<"extends", Prisma.TypeMapCb<ClientOptions>, ExtArgs, $Utils.Call<Prisma.TypeMapCb<ClientOptions>, {
    extArgs: ExtArgs
  }>>

      /**
   * `prisma.healthcheck`: Exposes CRUD operations for the **Healthcheck** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Healthchecks
    * const healthchecks = await prisma.healthcheck.findMany()
    * ```
    */
  get healthcheck(): Prisma.HealthcheckDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.setting`: Exposes CRUD operations for the **Setting** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Settings
    * const settings = await prisma.setting.findMany()
    * ```
    */
  get setting(): Prisma.SettingDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.user`: Exposes CRUD operations for the **User** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Users
    * const users = await prisma.user.findMany()
    * ```
    */
  get user(): Prisma.UserDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.branch`: Exposes CRUD operations for the **Branch** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Branches
    * const branches = await prisma.branch.findMany()
    * ```
    */
  get branch(): Prisma.BranchDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.userBranch`: Exposes CRUD operations for the **UserBranch** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more UserBranches
    * const userBranches = await prisma.userBranch.findMany()
    * ```
    */
  get userBranch(): Prisma.UserBranchDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.role`: Exposes CRUD operations for the **Role** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Roles
    * const roles = await prisma.role.findMany()
    * ```
    */
  get role(): Prisma.RoleDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.permission`: Exposes CRUD operations for the **Permission** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Permissions
    * const permissions = await prisma.permission.findMany()
    * ```
    */
  get permission(): Prisma.PermissionDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.userRole`: Exposes CRUD operations for the **UserRole** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more UserRoles
    * const userRoles = await prisma.userRole.findMany()
    * ```
    */
  get userRole(): Prisma.UserRoleDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.rolePermission`: Exposes CRUD operations for the **RolePermission** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more RolePermissions
    * const rolePermissions = await prisma.rolePermission.findMany()
    * ```
    */
  get rolePermission(): Prisma.RolePermissionDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.category`: Exposes CRUD operations for the **Category** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Categories
    * const categories = await prisma.category.findMany()
    * ```
    */
  get category(): Prisma.CategoryDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.variation`: Exposes CRUD operations for the **Variation** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Variations
    * const variations = await prisma.variation.findMany()
    * ```
    */
  get variation(): Prisma.VariationDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.brand`: Exposes CRUD operations for the **Brand** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Brands
    * const brands = await prisma.brand.findMany()
    * ```
    */
  get brand(): Prisma.BrandDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.unit`: Exposes CRUD operations for the **Unit** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Units
    * const units = await prisma.unit.findMany()
    * ```
    */
  get unit(): Prisma.UnitDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.warehouse`: Exposes CRUD operations for the **Warehouse** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Warehouses
    * const warehouses = await prisma.warehouse.findMany()
    * ```
    */
  get warehouse(): Prisma.WarehouseDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.warehouseStock`: Exposes CRUD operations for the **WarehouseStock** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more WarehouseStocks
    * const warehouseStocks = await prisma.warehouseStock.findMany()
    * ```
    */
  get warehouseStock(): Prisma.WarehouseStockDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.supplier`: Exposes CRUD operations for the **Supplier** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Suppliers
    * const suppliers = await prisma.supplier.findMany()
    * ```
    */
  get supplier(): Prisma.SupplierDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.purchase`: Exposes CRUD operations for the **Purchase** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Purchases
    * const purchases = await prisma.purchase.findMany()
    * ```
    */
  get purchase(): Prisma.PurchaseDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.purchaseLine`: Exposes CRUD operations for the **PurchaseLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more PurchaseLines
    * const purchaseLines = await prisma.purchaseLine.findMany()
    * ```
    */
  get purchaseLine(): Prisma.PurchaseLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.purchaseReturn`: Exposes CRUD operations for the **PurchaseReturn** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more PurchaseReturns
    * const purchaseReturns = await prisma.purchaseReturn.findMany()
    * ```
    */
  get purchaseReturn(): Prisma.PurchaseReturnDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.purchaseReturnLine`: Exposes CRUD operations for the **PurchaseReturnLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more PurchaseReturnLines
    * const purchaseReturnLines = await prisma.purchaseReturnLine.findMany()
    * ```
    */
  get purchaseReturnLine(): Prisma.PurchaseReturnLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.customer`: Exposes CRUD operations for the **Customer** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Customers
    * const customers = await prisma.customer.findMany()
    * ```
    */
  get customer(): Prisma.CustomerDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.paymentMethod`: Exposes CRUD operations for the **PaymentMethod** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more PaymentMethods
    * const paymentMethods = await prisma.paymentMethod.findMany()
    * ```
    */
  get paymentMethod(): Prisma.PaymentMethodDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.sale`: Exposes CRUD operations for the **Sale** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Sales
    * const sales = await prisma.sale.findMany()
    * ```
    */
  get sale(): Prisma.SaleDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.saleLine`: Exposes CRUD operations for the **SaleLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more SaleLines
    * const saleLines = await prisma.saleLine.findMany()
    * ```
    */
  get saleLine(): Prisma.SaleLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.salesReturn`: Exposes CRUD operations for the **SalesReturn** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more SalesReturns
    * const salesReturns = await prisma.salesReturn.findMany()
    * ```
    */
  get salesReturn(): Prisma.SalesReturnDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.salesReturnLine`: Exposes CRUD operations for the **SalesReturnLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more SalesReturnLines
    * const salesReturnLines = await prisma.salesReturnLine.findMany()
    * ```
    */
  get salesReturnLine(): Prisma.SalesReturnLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.tax`: Exposes CRUD operations for the **Tax** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Taxes
    * const taxes = await prisma.tax.findMany()
    * ```
    */
  get tax(): Prisma.TaxDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.expenseCategory`: Exposes CRUD operations for the **ExpenseCategory** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more ExpenseCategories
    * const expenseCategories = await prisma.expenseCategory.findMany()
    * ```
    */
  get expenseCategory(): Prisma.ExpenseCategoryDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.expense`: Exposes CRUD operations for the **Expense** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Expenses
    * const expenses = await prisma.expense.findMany()
    * ```
    */
  get expense(): Prisma.ExpenseDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.product`: Exposes CRUD operations for the **Product** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Products
    * const products = await prisma.product.findMany()
    * ```
    */
  get product(): Prisma.ProductDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.inventoryTransfer`: Exposes CRUD operations for the **InventoryTransfer** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more InventoryTransfers
    * const inventoryTransfers = await prisma.inventoryTransfer.findMany()
    * ```
    */
  get inventoryTransfer(): Prisma.InventoryTransferDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.inventoryTransferLine`: Exposes CRUD operations for the **InventoryTransferLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more InventoryTransferLines
    * const inventoryTransferLines = await prisma.inventoryTransferLine.findMany()
    * ```
    */
  get inventoryTransferLine(): Prisma.InventoryTransferLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.invoice`: Exposes CRUD operations for the **Invoice** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Invoices
    * const invoices = await prisma.invoice.findMany()
    * ```
    */
  get invoice(): Prisma.InvoiceDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.invoiceLine`: Exposes CRUD operations for the **InvoiceLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more InvoiceLines
    * const invoiceLines = await prisma.invoiceLine.findMany()
    * ```
    */
  get invoiceLine(): Prisma.InvoiceLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.inventoryAdjustment`: Exposes CRUD operations for the **InventoryAdjustment** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more InventoryAdjustments
    * const inventoryAdjustments = await prisma.inventoryAdjustment.findMany()
    * ```
    */
  get inventoryAdjustment(): Prisma.InventoryAdjustmentDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.inventoryAdjustmentLine`: Exposes CRUD operations for the **InventoryAdjustmentLine** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more InventoryAdjustmentLines
    * const inventoryAdjustmentLines = await prisma.inventoryAdjustmentLine.findMany()
    * ```
    */
  get inventoryAdjustmentLine(): Prisma.InventoryAdjustmentLineDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.emailTemplate`: Exposes CRUD operations for the **EmailTemplate** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more EmailTemplates
    * const emailTemplates = await prisma.emailTemplate.findMany()
    * ```
    */
  get emailTemplate(): Prisma.EmailTemplateDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.smsTemplate`: Exposes CRUD operations for the **SmsTemplate** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more SmsTemplates
    * const smsTemplates = await prisma.smsTemplate.findMany()
    * ```
    */
  get smsTemplate(): Prisma.SmsTemplateDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.notification`: Exposes CRUD operations for the **Notification** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more Notifications
    * const notifications = await prisma.notification.findMany()
    * ```
    */
  get notification(): Prisma.NotificationDelegate<ExtArgs, ClientOptions>;

  /**
   * `prisma.activityLog`: Exposes CRUD operations for the **ActivityLog** model.
    * Example usage:
    * ```ts
    * // Fetch zero or more ActivityLogs
    * const activityLogs = await prisma.activityLog.findMany()
    * ```
    */
  get activityLog(): Prisma.ActivityLogDelegate<ExtArgs, ClientOptions>;
}

export namespace Prisma {
  export import DMMF = runtime.DMMF

  export type PrismaPromise<T> = $Public.PrismaPromise<T>

  /**
   * Validator
   */
  export import validator = runtime.Public.validator

  /**
   * Prisma Errors
   */
  export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError
  export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError
  export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
  export import PrismaClientInitializationError = runtime.PrismaClientInitializationError
  export import PrismaClientValidationError = runtime.PrismaClientValidationError

  /**
   * Re-export of sql-template-tag
   */
  export import sql = runtime.sqltag
  export import empty = runtime.empty
  export import join = runtime.join
  export import raw = runtime.raw
  export import Sql = runtime.Sql



  /**
   * Decimal.js
   */
  export import Decimal = runtime.Decimal

  export type DecimalJsLike = runtime.DecimalJsLike

  /**
  * Extensions
  */
  export import Extension = $Extensions.UserArgs
  export import getExtensionContext = runtime.Extensions.getExtensionContext
  export import Args = $Public.Args
  export import Payload = $Public.Payload
  export import Result = $Public.Result
  export import Exact = $Public.Exact

  /**
   * Prisma Client JS version: 7.7.0
   * Query Engine version: 75cbdc1eb7150937890ad5465d861175c6624711
   */
  export type PrismaVersion = {
    client: string
    engine: string
  }

  export const prismaVersion: PrismaVersion

  /**
   * Utility Types
   */


  export import Bytes = runtime.Bytes
  export import JsonObject = runtime.JsonObject
  export import JsonArray = runtime.JsonArray
  export import JsonValue = runtime.JsonValue
  export import InputJsonObject = runtime.InputJsonObject
  export import InputJsonArray = runtime.InputJsonArray
  export import InputJsonValue = runtime.InputJsonValue

  /**
   * Types of the values used to represent different kinds of `null` values when working with JSON fields.
   *
   * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
   */
  namespace NullTypes {
    /**
    * Type of `Prisma.DbNull`.
    *
    * You cannot use other instances of this class. Please use the `Prisma.DbNull` value.
    *
    * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
    */
    class DbNull {
      private DbNull: never
      private constructor()
    }

    /**
    * Type of `Prisma.JsonNull`.
    *
    * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value.
    *
    * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
    */
    class JsonNull {
      private JsonNull: never
      private constructor()
    }

    /**
    * Type of `Prisma.AnyNull`.
    *
    * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value.
    *
    * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
    */
    class AnyNull {
      private AnyNull: never
      private constructor()
    }
  }

  /**
   * Helper for filtering JSON entries that have `null` on the database (empty on the db)
   *
   * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
   */
  export const DbNull: NullTypes.DbNull

  /**
   * Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
   *
   * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
   */
  export const JsonNull: NullTypes.JsonNull

  /**
   * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
   *
   * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
   */
  export const AnyNull: NullTypes.AnyNull

  type SelectAndInclude = {
    select: any
    include: any
  }

  type SelectAndOmit = {
    select: any
    omit: any
  }

  /**
   * Get the type of the value, that the Promise holds.
   */
  export type PromiseType<T extends PromiseLike<any>> = T extends PromiseLike<infer U> ? U : T;

  /**
   * Get the return type of a function which returns a Promise.
   */
  export type PromiseReturnType<T extends (...args: any) => $Utils.JsPromise<any>> = PromiseType<ReturnType<T>>

  /**
   * From T, pick a set of properties whose keys are in the union K
   */
  type Prisma__Pick<T, K extends keyof T> = {
      [P in K]: T[P];
  };


  export type Enumerable<T> = T | Array<T>;

  export type RequiredKeys<T> = {
    [K in keyof T]-?: {} extends Prisma__Pick<T, K> ? never : K
  }[keyof T]

  export type TruthyKeys<T> = keyof {
    [K in keyof T as T[K] extends false | undefined | null ? never : K]: K
  }

  export type TrueKeys<T> = TruthyKeys<Prisma__Pick<T, RequiredKeys<T>>>

  /**
   * Subset
   * @desc From `T` pick properties that exist in `U`. Simple version of Intersection
   */
  export type Subset<T, U> = {
    [key in keyof T]: key extends keyof U ? T[key] : never;
  };

  /**
   * SelectSubset
   * @desc From `T` pick properties that exist in `U`. Simple version of Intersection.
   * Additionally, it validates, if both select and include are present. If the case, it errors.
   */
  export type SelectSubset<T, U> = {
    [key in keyof T]: key extends keyof U ? T[key] : never
  } &
    (T extends SelectAndInclude
      ? 'Please either choose `select` or `include`.'
      : T extends SelectAndOmit
        ? 'Please either choose `select` or `omit`.'
        : {})

  /**
   * Subset + Intersection
   * @desc From `T` pick properties that exist in `U` and intersect `K`
   */
  export type SubsetIntersection<T, U, K> = {
    [key in keyof T]: key extends keyof U ? T[key] : never
  } &
    K

  type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };

  /**
   * XOR is needed to have a real mutually exclusive union type
   * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
   */
  type XOR<T, U> =
    T extends object ?
    U extends object ?
      (Without<T, U> & U) | (Without<U, T> & T)
    : U : T


  /**
   * Is T a Record?
   */
  type IsObject<T extends any> = T extends Array<any>
  ? False
  : T extends Date
  ? False
  : T extends Uint8Array
  ? False
  : T extends BigInt
  ? False
  : T extends object
  ? True
  : False


  /**
   * If it's T[], return T
   */
  export type UnEnumerate<T extends unknown> = T extends Array<infer U> ? U : T

  /**
   * From ts-toolbelt
   */

  type __Either<O extends object, K extends Key> = Omit<O, K> &
    {
      // Merge all but K
      [P in K]: Prisma__Pick<O, P & keyof O> // With K possibilities
    }[K]

  type EitherStrict<O extends object, K extends Key> = Strict<__Either<O, K>>

  type EitherLoose<O extends object, K extends Key> = ComputeRaw<__Either<O, K>>

  type _Either<
    O extends object,
    K extends Key,
    strict extends Boolean
  > = {
    1: EitherStrict<O, K>
    0: EitherLoose<O, K>
  }[strict]

  type Either<
    O extends object,
    K extends Key,
    strict extends Boolean = 1
  > = O extends unknown ? _Either<O, K, strict> : never

  export type Union = any

  type PatchUndefined<O extends object, O1 extends object> = {
    [K in keyof O]: O[K] extends undefined ? At<O1, K> : O[K]
  } & {}

  /** Helper Types for "Merge" **/
  export type IntersectOf<U extends Union> = (
    U extends unknown ? (k: U) => void : never
  ) extends (k: infer I) => void
    ? I
    : never

  export type Overwrite<O extends object, O1 extends object> = {
      [K in keyof O]: K extends keyof O1 ? O1[K] : O[K];
  } & {};

  type _Merge<U extends object> = IntersectOf<Overwrite<U, {
      [K in keyof U]-?: At<U, K>;
  }>>;

  type Key = string | number | symbol;
  type AtBasic<O extends object, K extends Key> = K extends keyof O ? O[K] : never;
  type AtStrict<O extends object, K extends Key> = O[K & keyof O];
  type AtLoose<O extends object, K extends Key> = O extends unknown ? AtStrict<O, K> : never;
  export type At<O extends object, K extends Key, strict extends Boolean = 1> = {
      1: AtStrict<O, K>;
      0: AtLoose<O, K>;
  }[strict];

  export type ComputeRaw<A extends any> = A extends Function ? A : {
    [K in keyof A]: A[K];
  } & {};

  export type OptionalFlat<O> = {
    [K in keyof O]?: O[K];
  } & {};

  type _Record<K extends keyof any, T> = {
    [P in K]: T;
  };

  // cause typescript not to expand types and preserve names
  type NoExpand<T> = T extends unknown ? T : never;

  // this type assumes the passed object is entirely optional
  type AtLeast<O extends object, K extends string> = NoExpand<
    O extends unknown
    ? | (K extends keyof O ? { [P in K]: O[P] } & O : O)
      | {[P in keyof O as P extends K ? P : never]-?: O[P]} & O
    : never>;

  type _Strict<U, _U = U> = U extends unknown ? U & OptionalFlat<_Record<Exclude<Keys<_U>, keyof U>, never>> : never;

  export type Strict<U extends object> = ComputeRaw<_Strict<U>>;
  /** End Helper Types for "Merge" **/

  export type Merge<U extends object> = ComputeRaw<_Merge<Strict<U>>>;

  /**
  A [[Boolean]]
  */
  export type Boolean = True | False

  // /**
  // 1
  // */
  export type True = 1

  /**
  0
  */
  export type False = 0

  export type Not<B extends Boolean> = {
    0: 1
    1: 0
  }[B]

  export type Extends<A1 extends any, A2 extends any> = [A1] extends [never]
    ? 0 // anything `never` is false
    : A1 extends A2
    ? 1
    : 0

  export type Has<U extends Union, U1 extends Union> = Not<
    Extends<Exclude<U1, U>, U1>
  >

  export type Or<B1 extends Boolean, B2 extends Boolean> = {
    0: {
      0: 0
      1: 1
    }
    1: {
      0: 1
      1: 1
    }
  }[B1][B2]

  export type Keys<U extends Union> = U extends unknown ? keyof U : never

  type Cast<A, B> = A extends B ? A : B;

  export const type: unique symbol;



  /**
   * Used by group by
   */

  export type GetScalarType<T, O> = O extends object ? {
    [P in keyof T]: P extends keyof O
      ? O[P]
      : never
  } : never

  type FieldPaths<
    T,
    U = Omit<T, '_avg' | '_sum' | '_count' | '_min' | '_max'>
  > = IsObject<T> extends True ? U : T

  type GetHavingFields<T> = {
    [K in keyof T]: Or<
      Or<Extends<'OR', K>, Extends<'AND', K>>,
      Extends<'NOT', K>
    > extends True
      ? // infer is only needed to not hit TS limit
        // based on the brilliant idea of Pierre-Antoine Mills
        // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437
        T[K] extends infer TK
        ? GetHavingFields<UnEnumerate<TK> extends object ? Merge<UnEnumerate<TK>> : never>
        : never
      : {} extends FieldPaths<T[K]>
      ? never
      : K
  }[keyof T]

  /**
   * Convert tuple to union
   */
  type _TupleToUnion<T> = T extends (infer E)[] ? E : never
  type TupleToUnion<K extends readonly any[]> = _TupleToUnion<K>
  type MaybeTupleToUnion<T> = T extends any[] ? TupleToUnion<T> : T

  /**
   * Like `Pick`, but additionally can also accept an array of keys
   */
  type PickEnumerable<T, K extends Enumerable<keyof T> | keyof T> = Prisma__Pick<T, MaybeTupleToUnion<K>>

  /**
   * Exclude all keys with underscores
   */
  type ExcludeUnderscoreKeys<T extends string> = T extends `_${string}` ? never : T


  export type FieldRef<Model, FieldType> = runtime.FieldRef<Model, FieldType>

  type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRef<Model, FieldType>


  export const ModelName: {
    Healthcheck: 'Healthcheck',
    Setting: 'Setting',
    User: 'User',
    Branch: 'Branch',
    UserBranch: 'UserBranch',
    Role: 'Role',
    Permission: 'Permission',
    UserRole: 'UserRole',
    RolePermission: 'RolePermission',
    Category: 'Category',
    Variation: 'Variation',
    Brand: 'Brand',
    Unit: 'Unit',
    Warehouse: 'Warehouse',
    WarehouseStock: 'WarehouseStock',
    Supplier: 'Supplier',
    Purchase: 'Purchase',
    PurchaseLine: 'PurchaseLine',
    PurchaseReturn: 'PurchaseReturn',
    PurchaseReturnLine: 'PurchaseReturnLine',
    Customer: 'Customer',
    PaymentMethod: 'PaymentMethod',
    Sale: 'Sale',
    SaleLine: 'SaleLine',
    SalesReturn: 'SalesReturn',
    SalesReturnLine: 'SalesReturnLine',
    Tax: 'Tax',
    ExpenseCategory: 'ExpenseCategory',
    Expense: 'Expense',
    Product: 'Product',
    InventoryTransfer: 'InventoryTransfer',
    InventoryTransferLine: 'InventoryTransferLine',
    Invoice: 'Invoice',
    InvoiceLine: 'InvoiceLine',
    InventoryAdjustment: 'InventoryAdjustment',
    InventoryAdjustmentLine: 'InventoryAdjustmentLine',
    EmailTemplate: 'EmailTemplate',
    SmsTemplate: 'SmsTemplate',
    Notification: 'Notification',
    ActivityLog: 'ActivityLog'
  };

  export type ModelName = (typeof ModelName)[keyof typeof ModelName]



  interface TypeMapCb<ClientOptions = {}> extends $Utils.Fn<{extArgs: $Extensions.InternalArgs }, $Utils.Record<string, any>> {
    returns: Prisma.TypeMap<this['params']['extArgs'], ClientOptions extends { omit: infer OmitOptions } ? OmitOptions : {}>
  }

  export type TypeMap<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> = {
    globalOmitOptions: {
      omit: GlobalOmitOptions
    }
    meta: {
      modelProps: "healthcheck" | "setting" | "user" | "branch" | "userBranch" | "role" | "permission" | "userRole" | "rolePermission" | "category" | "variation" | "brand" | "unit" | "warehouse" | "warehouseStock" | "supplier" | "purchase" | "purchaseLine" | "purchaseReturn" | "purchaseReturnLine" | "customer" | "paymentMethod" | "sale" | "saleLine" | "salesReturn" | "salesReturnLine" | "tax" | "expenseCategory" | "expense" | "product" | "inventoryTransfer" | "inventoryTransferLine" | "invoice" | "invoiceLine" | "inventoryAdjustment" | "inventoryAdjustmentLine" | "emailTemplate" | "smsTemplate" | "notification" | "activityLog"
      txIsolationLevel: Prisma.TransactionIsolationLevel
    }
    model: {
      Healthcheck: {
        payload: Prisma.$HealthcheckPayload<ExtArgs>
        fields: Prisma.HealthcheckFieldRefs
        operations: {
          findUnique: {
            args: Prisma.HealthcheckFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.HealthcheckFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>
          }
          findFirst: {
            args: Prisma.HealthcheckFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.HealthcheckFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>
          }
          findMany: {
            args: Prisma.HealthcheckFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>[]
          }
          create: {
            args: Prisma.HealthcheckCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>
          }
          createMany: {
            args: Prisma.HealthcheckCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.HealthcheckCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>[]
          }
          delete: {
            args: Prisma.HealthcheckDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>
          }
          update: {
            args: Prisma.HealthcheckUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>
          }
          deleteMany: {
            args: Prisma.HealthcheckDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.HealthcheckUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.HealthcheckUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>[]
          }
          upsert: {
            args: Prisma.HealthcheckUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$HealthcheckPayload>
          }
          aggregate: {
            args: Prisma.HealthcheckAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateHealthcheck>
          }
          groupBy: {
            args: Prisma.HealthcheckGroupByArgs<ExtArgs>
            result: $Utils.Optional<HealthcheckGroupByOutputType>[]
          }
          count: {
            args: Prisma.HealthcheckCountArgs<ExtArgs>
            result: $Utils.Optional<HealthcheckCountAggregateOutputType> | number
          }
        }
      }
      Setting: {
        payload: Prisma.$SettingPayload<ExtArgs>
        fields: Prisma.SettingFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SettingFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SettingFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>
          }
          findFirst: {
            args: Prisma.SettingFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SettingFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>
          }
          findMany: {
            args: Prisma.SettingFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>[]
          }
          create: {
            args: Prisma.SettingCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>
          }
          createMany: {
            args: Prisma.SettingCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SettingCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>[]
          }
          delete: {
            args: Prisma.SettingDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>
          }
          update: {
            args: Prisma.SettingUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>
          }
          deleteMany: {
            args: Prisma.SettingDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SettingUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SettingUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>[]
          }
          upsert: {
            args: Prisma.SettingUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SettingPayload>
          }
          aggregate: {
            args: Prisma.SettingAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSetting>
          }
          groupBy: {
            args: Prisma.SettingGroupByArgs<ExtArgs>
            result: $Utils.Optional<SettingGroupByOutputType>[]
          }
          count: {
            args: Prisma.SettingCountArgs<ExtArgs>
            result: $Utils.Optional<SettingCountAggregateOutputType> | number
          }
        }
      }
      User: {
        payload: Prisma.$UserPayload<ExtArgs>
        fields: Prisma.UserFieldRefs
        operations: {
          findUnique: {
            args: Prisma.UserFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.UserFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>
          }
          findFirst: {
            args: Prisma.UserFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.UserFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>
          }
          findMany: {
            args: Prisma.UserFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>[]
          }
          create: {
            args: Prisma.UserCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>
          }
          createMany: {
            args: Prisma.UserCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.UserCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>[]
          }
          delete: {
            args: Prisma.UserDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>
          }
          update: {
            args: Prisma.UserUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>
          }
          deleteMany: {
            args: Prisma.UserDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.UserUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.UserUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>[]
          }
          upsert: {
            args: Prisma.UserUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserPayload>
          }
          aggregate: {
            args: Prisma.UserAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateUser>
          }
          groupBy: {
            args: Prisma.UserGroupByArgs<ExtArgs>
            result: $Utils.Optional<UserGroupByOutputType>[]
          }
          count: {
            args: Prisma.UserCountArgs<ExtArgs>
            result: $Utils.Optional<UserCountAggregateOutputType> | number
          }
        }
      }
      Branch: {
        payload: Prisma.$BranchPayload<ExtArgs>
        fields: Prisma.BranchFieldRefs
        operations: {
          findUnique: {
            args: Prisma.BranchFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.BranchFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>
          }
          findFirst: {
            args: Prisma.BranchFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.BranchFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>
          }
          findMany: {
            args: Prisma.BranchFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>[]
          }
          create: {
            args: Prisma.BranchCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>
          }
          createMany: {
            args: Prisma.BranchCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.BranchCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>[]
          }
          delete: {
            args: Prisma.BranchDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>
          }
          update: {
            args: Prisma.BranchUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>
          }
          deleteMany: {
            args: Prisma.BranchDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.BranchUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.BranchUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>[]
          }
          upsert: {
            args: Prisma.BranchUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BranchPayload>
          }
          aggregate: {
            args: Prisma.BranchAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateBranch>
          }
          groupBy: {
            args: Prisma.BranchGroupByArgs<ExtArgs>
            result: $Utils.Optional<BranchGroupByOutputType>[]
          }
          count: {
            args: Prisma.BranchCountArgs<ExtArgs>
            result: $Utils.Optional<BranchCountAggregateOutputType> | number
          }
        }
      }
      UserBranch: {
        payload: Prisma.$UserBranchPayload<ExtArgs>
        fields: Prisma.UserBranchFieldRefs
        operations: {
          findUnique: {
            args: Prisma.UserBranchFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.UserBranchFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>
          }
          findFirst: {
            args: Prisma.UserBranchFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.UserBranchFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>
          }
          findMany: {
            args: Prisma.UserBranchFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>[]
          }
          create: {
            args: Prisma.UserBranchCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>
          }
          createMany: {
            args: Prisma.UserBranchCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.UserBranchCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>[]
          }
          delete: {
            args: Prisma.UserBranchDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>
          }
          update: {
            args: Prisma.UserBranchUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>
          }
          deleteMany: {
            args: Prisma.UserBranchDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.UserBranchUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.UserBranchUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>[]
          }
          upsert: {
            args: Prisma.UserBranchUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserBranchPayload>
          }
          aggregate: {
            args: Prisma.UserBranchAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateUserBranch>
          }
          groupBy: {
            args: Prisma.UserBranchGroupByArgs<ExtArgs>
            result: $Utils.Optional<UserBranchGroupByOutputType>[]
          }
          count: {
            args: Prisma.UserBranchCountArgs<ExtArgs>
            result: $Utils.Optional<UserBranchCountAggregateOutputType> | number
          }
        }
      }
      Role: {
        payload: Prisma.$RolePayload<ExtArgs>
        fields: Prisma.RoleFieldRefs
        operations: {
          findUnique: {
            args: Prisma.RoleFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.RoleFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>
          }
          findFirst: {
            args: Prisma.RoleFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.RoleFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>
          }
          findMany: {
            args: Prisma.RoleFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>[]
          }
          create: {
            args: Prisma.RoleCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>
          }
          createMany: {
            args: Prisma.RoleCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.RoleCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>[]
          }
          delete: {
            args: Prisma.RoleDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>
          }
          update: {
            args: Prisma.RoleUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>
          }
          deleteMany: {
            args: Prisma.RoleDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.RoleUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.RoleUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>[]
          }
          upsert: {
            args: Prisma.RoleUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePayload>
          }
          aggregate: {
            args: Prisma.RoleAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateRole>
          }
          groupBy: {
            args: Prisma.RoleGroupByArgs<ExtArgs>
            result: $Utils.Optional<RoleGroupByOutputType>[]
          }
          count: {
            args: Prisma.RoleCountArgs<ExtArgs>
            result: $Utils.Optional<RoleCountAggregateOutputType> | number
          }
        }
      }
      Permission: {
        payload: Prisma.$PermissionPayload<ExtArgs>
        fields: Prisma.PermissionFieldRefs
        operations: {
          findUnique: {
            args: Prisma.PermissionFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.PermissionFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>
          }
          findFirst: {
            args: Prisma.PermissionFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.PermissionFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>
          }
          findMany: {
            args: Prisma.PermissionFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>[]
          }
          create: {
            args: Prisma.PermissionCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>
          }
          createMany: {
            args: Prisma.PermissionCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.PermissionCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>[]
          }
          delete: {
            args: Prisma.PermissionDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>
          }
          update: {
            args: Prisma.PermissionUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>
          }
          deleteMany: {
            args: Prisma.PermissionDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.PermissionUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.PermissionUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>[]
          }
          upsert: {
            args: Prisma.PermissionUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PermissionPayload>
          }
          aggregate: {
            args: Prisma.PermissionAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregatePermission>
          }
          groupBy: {
            args: Prisma.PermissionGroupByArgs<ExtArgs>
            result: $Utils.Optional<PermissionGroupByOutputType>[]
          }
          count: {
            args: Prisma.PermissionCountArgs<ExtArgs>
            result: $Utils.Optional<PermissionCountAggregateOutputType> | number
          }
        }
      }
      UserRole: {
        payload: Prisma.$UserRolePayload<ExtArgs>
        fields: Prisma.UserRoleFieldRefs
        operations: {
          findUnique: {
            args: Prisma.UserRoleFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.UserRoleFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>
          }
          findFirst: {
            args: Prisma.UserRoleFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.UserRoleFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>
          }
          findMany: {
            args: Prisma.UserRoleFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>[]
          }
          create: {
            args: Prisma.UserRoleCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>
          }
          createMany: {
            args: Prisma.UserRoleCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.UserRoleCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>[]
          }
          delete: {
            args: Prisma.UserRoleDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>
          }
          update: {
            args: Prisma.UserRoleUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>
          }
          deleteMany: {
            args: Prisma.UserRoleDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.UserRoleUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.UserRoleUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>[]
          }
          upsert: {
            args: Prisma.UserRoleUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UserRolePayload>
          }
          aggregate: {
            args: Prisma.UserRoleAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateUserRole>
          }
          groupBy: {
            args: Prisma.UserRoleGroupByArgs<ExtArgs>
            result: $Utils.Optional<UserRoleGroupByOutputType>[]
          }
          count: {
            args: Prisma.UserRoleCountArgs<ExtArgs>
            result: $Utils.Optional<UserRoleCountAggregateOutputType> | number
          }
        }
      }
      RolePermission: {
        payload: Prisma.$RolePermissionPayload<ExtArgs>
        fields: Prisma.RolePermissionFieldRefs
        operations: {
          findUnique: {
            args: Prisma.RolePermissionFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.RolePermissionFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>
          }
          findFirst: {
            args: Prisma.RolePermissionFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.RolePermissionFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>
          }
          findMany: {
            args: Prisma.RolePermissionFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>[]
          }
          create: {
            args: Prisma.RolePermissionCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>
          }
          createMany: {
            args: Prisma.RolePermissionCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.RolePermissionCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>[]
          }
          delete: {
            args: Prisma.RolePermissionDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>
          }
          update: {
            args: Prisma.RolePermissionUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>
          }
          deleteMany: {
            args: Prisma.RolePermissionDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.RolePermissionUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.RolePermissionUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>[]
          }
          upsert: {
            args: Prisma.RolePermissionUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$RolePermissionPayload>
          }
          aggregate: {
            args: Prisma.RolePermissionAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateRolePermission>
          }
          groupBy: {
            args: Prisma.RolePermissionGroupByArgs<ExtArgs>
            result: $Utils.Optional<RolePermissionGroupByOutputType>[]
          }
          count: {
            args: Prisma.RolePermissionCountArgs<ExtArgs>
            result: $Utils.Optional<RolePermissionCountAggregateOutputType> | number
          }
        }
      }
      Category: {
        payload: Prisma.$CategoryPayload<ExtArgs>
        fields: Prisma.CategoryFieldRefs
        operations: {
          findUnique: {
            args: Prisma.CategoryFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.CategoryFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>
          }
          findFirst: {
            args: Prisma.CategoryFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.CategoryFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>
          }
          findMany: {
            args: Prisma.CategoryFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>[]
          }
          create: {
            args: Prisma.CategoryCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>
          }
          createMany: {
            args: Prisma.CategoryCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.CategoryCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>[]
          }
          delete: {
            args: Prisma.CategoryDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>
          }
          update: {
            args: Prisma.CategoryUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>
          }
          deleteMany: {
            args: Prisma.CategoryDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.CategoryUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.CategoryUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>[]
          }
          upsert: {
            args: Prisma.CategoryUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CategoryPayload>
          }
          aggregate: {
            args: Prisma.CategoryAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateCategory>
          }
          groupBy: {
            args: Prisma.CategoryGroupByArgs<ExtArgs>
            result: $Utils.Optional<CategoryGroupByOutputType>[]
          }
          count: {
            args: Prisma.CategoryCountArgs<ExtArgs>
            result: $Utils.Optional<CategoryCountAggregateOutputType> | number
          }
        }
      }
      Variation: {
        payload: Prisma.$VariationPayload<ExtArgs>
        fields: Prisma.VariationFieldRefs
        operations: {
          findUnique: {
            args: Prisma.VariationFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.VariationFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>
          }
          findFirst: {
            args: Prisma.VariationFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.VariationFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>
          }
          findMany: {
            args: Prisma.VariationFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>[]
          }
          create: {
            args: Prisma.VariationCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>
          }
          createMany: {
            args: Prisma.VariationCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.VariationCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>[]
          }
          delete: {
            args: Prisma.VariationDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>
          }
          update: {
            args: Prisma.VariationUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>
          }
          deleteMany: {
            args: Prisma.VariationDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.VariationUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.VariationUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>[]
          }
          upsert: {
            args: Prisma.VariationUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$VariationPayload>
          }
          aggregate: {
            args: Prisma.VariationAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateVariation>
          }
          groupBy: {
            args: Prisma.VariationGroupByArgs<ExtArgs>
            result: $Utils.Optional<VariationGroupByOutputType>[]
          }
          count: {
            args: Prisma.VariationCountArgs<ExtArgs>
            result: $Utils.Optional<VariationCountAggregateOutputType> | number
          }
        }
      }
      Brand: {
        payload: Prisma.$BrandPayload<ExtArgs>
        fields: Prisma.BrandFieldRefs
        operations: {
          findUnique: {
            args: Prisma.BrandFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.BrandFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>
          }
          findFirst: {
            args: Prisma.BrandFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.BrandFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>
          }
          findMany: {
            args: Prisma.BrandFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>[]
          }
          create: {
            args: Prisma.BrandCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>
          }
          createMany: {
            args: Prisma.BrandCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.BrandCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>[]
          }
          delete: {
            args: Prisma.BrandDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>
          }
          update: {
            args: Prisma.BrandUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>
          }
          deleteMany: {
            args: Prisma.BrandDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.BrandUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.BrandUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>[]
          }
          upsert: {
            args: Prisma.BrandUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$BrandPayload>
          }
          aggregate: {
            args: Prisma.BrandAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateBrand>
          }
          groupBy: {
            args: Prisma.BrandGroupByArgs<ExtArgs>
            result: $Utils.Optional<BrandGroupByOutputType>[]
          }
          count: {
            args: Prisma.BrandCountArgs<ExtArgs>
            result: $Utils.Optional<BrandCountAggregateOutputType> | number
          }
        }
      }
      Unit: {
        payload: Prisma.$UnitPayload<ExtArgs>
        fields: Prisma.UnitFieldRefs
        operations: {
          findUnique: {
            args: Prisma.UnitFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.UnitFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>
          }
          findFirst: {
            args: Prisma.UnitFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.UnitFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>
          }
          findMany: {
            args: Prisma.UnitFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>[]
          }
          create: {
            args: Prisma.UnitCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>
          }
          createMany: {
            args: Prisma.UnitCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.UnitCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>[]
          }
          delete: {
            args: Prisma.UnitDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>
          }
          update: {
            args: Prisma.UnitUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>
          }
          deleteMany: {
            args: Prisma.UnitDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.UnitUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.UnitUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>[]
          }
          upsert: {
            args: Prisma.UnitUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$UnitPayload>
          }
          aggregate: {
            args: Prisma.UnitAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateUnit>
          }
          groupBy: {
            args: Prisma.UnitGroupByArgs<ExtArgs>
            result: $Utils.Optional<UnitGroupByOutputType>[]
          }
          count: {
            args: Prisma.UnitCountArgs<ExtArgs>
            result: $Utils.Optional<UnitCountAggregateOutputType> | number
          }
        }
      }
      Warehouse: {
        payload: Prisma.$WarehousePayload<ExtArgs>
        fields: Prisma.WarehouseFieldRefs
        operations: {
          findUnique: {
            args: Prisma.WarehouseFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.WarehouseFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>
          }
          findFirst: {
            args: Prisma.WarehouseFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.WarehouseFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>
          }
          findMany: {
            args: Prisma.WarehouseFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>[]
          }
          create: {
            args: Prisma.WarehouseCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>
          }
          createMany: {
            args: Prisma.WarehouseCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.WarehouseCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>[]
          }
          delete: {
            args: Prisma.WarehouseDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>
          }
          update: {
            args: Prisma.WarehouseUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>
          }
          deleteMany: {
            args: Prisma.WarehouseDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.WarehouseUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.WarehouseUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>[]
          }
          upsert: {
            args: Prisma.WarehouseUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehousePayload>
          }
          aggregate: {
            args: Prisma.WarehouseAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateWarehouse>
          }
          groupBy: {
            args: Prisma.WarehouseGroupByArgs<ExtArgs>
            result: $Utils.Optional<WarehouseGroupByOutputType>[]
          }
          count: {
            args: Prisma.WarehouseCountArgs<ExtArgs>
            result: $Utils.Optional<WarehouseCountAggregateOutputType> | number
          }
        }
      }
      WarehouseStock: {
        payload: Prisma.$WarehouseStockPayload<ExtArgs>
        fields: Prisma.WarehouseStockFieldRefs
        operations: {
          findUnique: {
            args: Prisma.WarehouseStockFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.WarehouseStockFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>
          }
          findFirst: {
            args: Prisma.WarehouseStockFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.WarehouseStockFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>
          }
          findMany: {
            args: Prisma.WarehouseStockFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>[]
          }
          create: {
            args: Prisma.WarehouseStockCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>
          }
          createMany: {
            args: Prisma.WarehouseStockCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.WarehouseStockCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>[]
          }
          delete: {
            args: Prisma.WarehouseStockDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>
          }
          update: {
            args: Prisma.WarehouseStockUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>
          }
          deleteMany: {
            args: Prisma.WarehouseStockDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.WarehouseStockUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.WarehouseStockUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>[]
          }
          upsert: {
            args: Prisma.WarehouseStockUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$WarehouseStockPayload>
          }
          aggregate: {
            args: Prisma.WarehouseStockAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateWarehouseStock>
          }
          groupBy: {
            args: Prisma.WarehouseStockGroupByArgs<ExtArgs>
            result: $Utils.Optional<WarehouseStockGroupByOutputType>[]
          }
          count: {
            args: Prisma.WarehouseStockCountArgs<ExtArgs>
            result: $Utils.Optional<WarehouseStockCountAggregateOutputType> | number
          }
        }
      }
      Supplier: {
        payload: Prisma.$SupplierPayload<ExtArgs>
        fields: Prisma.SupplierFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SupplierFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SupplierFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>
          }
          findFirst: {
            args: Prisma.SupplierFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SupplierFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>
          }
          findMany: {
            args: Prisma.SupplierFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>[]
          }
          create: {
            args: Prisma.SupplierCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>
          }
          createMany: {
            args: Prisma.SupplierCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SupplierCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>[]
          }
          delete: {
            args: Prisma.SupplierDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>
          }
          update: {
            args: Prisma.SupplierUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>
          }
          deleteMany: {
            args: Prisma.SupplierDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SupplierUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SupplierUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>[]
          }
          upsert: {
            args: Prisma.SupplierUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SupplierPayload>
          }
          aggregate: {
            args: Prisma.SupplierAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSupplier>
          }
          groupBy: {
            args: Prisma.SupplierGroupByArgs<ExtArgs>
            result: $Utils.Optional<SupplierGroupByOutputType>[]
          }
          count: {
            args: Prisma.SupplierCountArgs<ExtArgs>
            result: $Utils.Optional<SupplierCountAggregateOutputType> | number
          }
        }
      }
      Purchase: {
        payload: Prisma.$PurchasePayload<ExtArgs>
        fields: Prisma.PurchaseFieldRefs
        operations: {
          findUnique: {
            args: Prisma.PurchaseFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.PurchaseFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>
          }
          findFirst: {
            args: Prisma.PurchaseFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.PurchaseFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>
          }
          findMany: {
            args: Prisma.PurchaseFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>[]
          }
          create: {
            args: Prisma.PurchaseCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>
          }
          createMany: {
            args: Prisma.PurchaseCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.PurchaseCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>[]
          }
          delete: {
            args: Prisma.PurchaseDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>
          }
          update: {
            args: Prisma.PurchaseUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>
          }
          deleteMany: {
            args: Prisma.PurchaseDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.PurchaseUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.PurchaseUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>[]
          }
          upsert: {
            args: Prisma.PurchaseUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchasePayload>
          }
          aggregate: {
            args: Prisma.PurchaseAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregatePurchase>
          }
          groupBy: {
            args: Prisma.PurchaseGroupByArgs<ExtArgs>
            result: $Utils.Optional<PurchaseGroupByOutputType>[]
          }
          count: {
            args: Prisma.PurchaseCountArgs<ExtArgs>
            result: $Utils.Optional<PurchaseCountAggregateOutputType> | number
          }
        }
      }
      PurchaseLine: {
        payload: Prisma.$PurchaseLinePayload<ExtArgs>
        fields: Prisma.PurchaseLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.PurchaseLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.PurchaseLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>
          }
          findFirst: {
            args: Prisma.PurchaseLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.PurchaseLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>
          }
          findMany: {
            args: Prisma.PurchaseLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>[]
          }
          create: {
            args: Prisma.PurchaseLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>
          }
          createMany: {
            args: Prisma.PurchaseLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.PurchaseLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>[]
          }
          delete: {
            args: Prisma.PurchaseLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>
          }
          update: {
            args: Prisma.PurchaseLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>
          }
          deleteMany: {
            args: Prisma.PurchaseLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.PurchaseLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.PurchaseLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>[]
          }
          upsert: {
            args: Prisma.PurchaseLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseLinePayload>
          }
          aggregate: {
            args: Prisma.PurchaseLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregatePurchaseLine>
          }
          groupBy: {
            args: Prisma.PurchaseLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<PurchaseLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.PurchaseLineCountArgs<ExtArgs>
            result: $Utils.Optional<PurchaseLineCountAggregateOutputType> | number
          }
        }
      }
      PurchaseReturn: {
        payload: Prisma.$PurchaseReturnPayload<ExtArgs>
        fields: Prisma.PurchaseReturnFieldRefs
        operations: {
          findUnique: {
            args: Prisma.PurchaseReturnFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.PurchaseReturnFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>
          }
          findFirst: {
            args: Prisma.PurchaseReturnFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.PurchaseReturnFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>
          }
          findMany: {
            args: Prisma.PurchaseReturnFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>[]
          }
          create: {
            args: Prisma.PurchaseReturnCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>
          }
          createMany: {
            args: Prisma.PurchaseReturnCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.PurchaseReturnCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>[]
          }
          delete: {
            args: Prisma.PurchaseReturnDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>
          }
          update: {
            args: Prisma.PurchaseReturnUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>
          }
          deleteMany: {
            args: Prisma.PurchaseReturnDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.PurchaseReturnUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.PurchaseReturnUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>[]
          }
          upsert: {
            args: Prisma.PurchaseReturnUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnPayload>
          }
          aggregate: {
            args: Prisma.PurchaseReturnAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregatePurchaseReturn>
          }
          groupBy: {
            args: Prisma.PurchaseReturnGroupByArgs<ExtArgs>
            result: $Utils.Optional<PurchaseReturnGroupByOutputType>[]
          }
          count: {
            args: Prisma.PurchaseReturnCountArgs<ExtArgs>
            result: $Utils.Optional<PurchaseReturnCountAggregateOutputType> | number
          }
        }
      }
      PurchaseReturnLine: {
        payload: Prisma.$PurchaseReturnLinePayload<ExtArgs>
        fields: Prisma.PurchaseReturnLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.PurchaseReturnLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.PurchaseReturnLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>
          }
          findFirst: {
            args: Prisma.PurchaseReturnLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.PurchaseReturnLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>
          }
          findMany: {
            args: Prisma.PurchaseReturnLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>[]
          }
          create: {
            args: Prisma.PurchaseReturnLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>
          }
          createMany: {
            args: Prisma.PurchaseReturnLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.PurchaseReturnLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>[]
          }
          delete: {
            args: Prisma.PurchaseReturnLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>
          }
          update: {
            args: Prisma.PurchaseReturnLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>
          }
          deleteMany: {
            args: Prisma.PurchaseReturnLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.PurchaseReturnLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.PurchaseReturnLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>[]
          }
          upsert: {
            args: Prisma.PurchaseReturnLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PurchaseReturnLinePayload>
          }
          aggregate: {
            args: Prisma.PurchaseReturnLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregatePurchaseReturnLine>
          }
          groupBy: {
            args: Prisma.PurchaseReturnLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<PurchaseReturnLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.PurchaseReturnLineCountArgs<ExtArgs>
            result: $Utils.Optional<PurchaseReturnLineCountAggregateOutputType> | number
          }
        }
      }
      Customer: {
        payload: Prisma.$CustomerPayload<ExtArgs>
        fields: Prisma.CustomerFieldRefs
        operations: {
          findUnique: {
            args: Prisma.CustomerFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.CustomerFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>
          }
          findFirst: {
            args: Prisma.CustomerFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.CustomerFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>
          }
          findMany: {
            args: Prisma.CustomerFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>[]
          }
          create: {
            args: Prisma.CustomerCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>
          }
          createMany: {
            args: Prisma.CustomerCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.CustomerCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>[]
          }
          delete: {
            args: Prisma.CustomerDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>
          }
          update: {
            args: Prisma.CustomerUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>
          }
          deleteMany: {
            args: Prisma.CustomerDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.CustomerUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.CustomerUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>[]
          }
          upsert: {
            args: Prisma.CustomerUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$CustomerPayload>
          }
          aggregate: {
            args: Prisma.CustomerAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateCustomer>
          }
          groupBy: {
            args: Prisma.CustomerGroupByArgs<ExtArgs>
            result: $Utils.Optional<CustomerGroupByOutputType>[]
          }
          count: {
            args: Prisma.CustomerCountArgs<ExtArgs>
            result: $Utils.Optional<CustomerCountAggregateOutputType> | number
          }
        }
      }
      PaymentMethod: {
        payload: Prisma.$PaymentMethodPayload<ExtArgs>
        fields: Prisma.PaymentMethodFieldRefs
        operations: {
          findUnique: {
            args: Prisma.PaymentMethodFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.PaymentMethodFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>
          }
          findFirst: {
            args: Prisma.PaymentMethodFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.PaymentMethodFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>
          }
          findMany: {
            args: Prisma.PaymentMethodFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>[]
          }
          create: {
            args: Prisma.PaymentMethodCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>
          }
          createMany: {
            args: Prisma.PaymentMethodCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.PaymentMethodCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>[]
          }
          delete: {
            args: Prisma.PaymentMethodDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>
          }
          update: {
            args: Prisma.PaymentMethodUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>
          }
          deleteMany: {
            args: Prisma.PaymentMethodDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.PaymentMethodUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.PaymentMethodUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>[]
          }
          upsert: {
            args: Prisma.PaymentMethodUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$PaymentMethodPayload>
          }
          aggregate: {
            args: Prisma.PaymentMethodAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregatePaymentMethod>
          }
          groupBy: {
            args: Prisma.PaymentMethodGroupByArgs<ExtArgs>
            result: $Utils.Optional<PaymentMethodGroupByOutputType>[]
          }
          count: {
            args: Prisma.PaymentMethodCountArgs<ExtArgs>
            result: $Utils.Optional<PaymentMethodCountAggregateOutputType> | number
          }
        }
      }
      Sale: {
        payload: Prisma.$SalePayload<ExtArgs>
        fields: Prisma.SaleFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SaleFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SaleFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>
          }
          findFirst: {
            args: Prisma.SaleFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SaleFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>
          }
          findMany: {
            args: Prisma.SaleFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>[]
          }
          create: {
            args: Prisma.SaleCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>
          }
          createMany: {
            args: Prisma.SaleCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SaleCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>[]
          }
          delete: {
            args: Prisma.SaleDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>
          }
          update: {
            args: Prisma.SaleUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>
          }
          deleteMany: {
            args: Prisma.SaleDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SaleUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SaleUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>[]
          }
          upsert: {
            args: Prisma.SaleUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalePayload>
          }
          aggregate: {
            args: Prisma.SaleAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSale>
          }
          groupBy: {
            args: Prisma.SaleGroupByArgs<ExtArgs>
            result: $Utils.Optional<SaleGroupByOutputType>[]
          }
          count: {
            args: Prisma.SaleCountArgs<ExtArgs>
            result: $Utils.Optional<SaleCountAggregateOutputType> | number
          }
        }
      }
      SaleLine: {
        payload: Prisma.$SaleLinePayload<ExtArgs>
        fields: Prisma.SaleLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SaleLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SaleLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>
          }
          findFirst: {
            args: Prisma.SaleLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SaleLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>
          }
          findMany: {
            args: Prisma.SaleLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>[]
          }
          create: {
            args: Prisma.SaleLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>
          }
          createMany: {
            args: Prisma.SaleLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SaleLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>[]
          }
          delete: {
            args: Prisma.SaleLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>
          }
          update: {
            args: Prisma.SaleLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>
          }
          deleteMany: {
            args: Prisma.SaleLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SaleLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SaleLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>[]
          }
          upsert: {
            args: Prisma.SaleLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SaleLinePayload>
          }
          aggregate: {
            args: Prisma.SaleLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSaleLine>
          }
          groupBy: {
            args: Prisma.SaleLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<SaleLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.SaleLineCountArgs<ExtArgs>
            result: $Utils.Optional<SaleLineCountAggregateOutputType> | number
          }
        }
      }
      SalesReturn: {
        payload: Prisma.$SalesReturnPayload<ExtArgs>
        fields: Prisma.SalesReturnFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SalesReturnFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SalesReturnFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>
          }
          findFirst: {
            args: Prisma.SalesReturnFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SalesReturnFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>
          }
          findMany: {
            args: Prisma.SalesReturnFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>[]
          }
          create: {
            args: Prisma.SalesReturnCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>
          }
          createMany: {
            args: Prisma.SalesReturnCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SalesReturnCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>[]
          }
          delete: {
            args: Prisma.SalesReturnDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>
          }
          update: {
            args: Prisma.SalesReturnUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>
          }
          deleteMany: {
            args: Prisma.SalesReturnDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SalesReturnUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SalesReturnUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>[]
          }
          upsert: {
            args: Prisma.SalesReturnUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnPayload>
          }
          aggregate: {
            args: Prisma.SalesReturnAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSalesReturn>
          }
          groupBy: {
            args: Prisma.SalesReturnGroupByArgs<ExtArgs>
            result: $Utils.Optional<SalesReturnGroupByOutputType>[]
          }
          count: {
            args: Prisma.SalesReturnCountArgs<ExtArgs>
            result: $Utils.Optional<SalesReturnCountAggregateOutputType> | number
          }
        }
      }
      SalesReturnLine: {
        payload: Prisma.$SalesReturnLinePayload<ExtArgs>
        fields: Prisma.SalesReturnLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SalesReturnLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SalesReturnLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>
          }
          findFirst: {
            args: Prisma.SalesReturnLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SalesReturnLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>
          }
          findMany: {
            args: Prisma.SalesReturnLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>[]
          }
          create: {
            args: Prisma.SalesReturnLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>
          }
          createMany: {
            args: Prisma.SalesReturnLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SalesReturnLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>[]
          }
          delete: {
            args: Prisma.SalesReturnLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>
          }
          update: {
            args: Prisma.SalesReturnLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>
          }
          deleteMany: {
            args: Prisma.SalesReturnLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SalesReturnLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SalesReturnLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>[]
          }
          upsert: {
            args: Prisma.SalesReturnLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SalesReturnLinePayload>
          }
          aggregate: {
            args: Prisma.SalesReturnLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSalesReturnLine>
          }
          groupBy: {
            args: Prisma.SalesReturnLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<SalesReturnLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.SalesReturnLineCountArgs<ExtArgs>
            result: $Utils.Optional<SalesReturnLineCountAggregateOutputType> | number
          }
        }
      }
      Tax: {
        payload: Prisma.$TaxPayload<ExtArgs>
        fields: Prisma.TaxFieldRefs
        operations: {
          findUnique: {
            args: Prisma.TaxFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.TaxFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>
          }
          findFirst: {
            args: Prisma.TaxFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.TaxFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>
          }
          findMany: {
            args: Prisma.TaxFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>[]
          }
          create: {
            args: Prisma.TaxCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>
          }
          createMany: {
            args: Prisma.TaxCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.TaxCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>[]
          }
          delete: {
            args: Prisma.TaxDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>
          }
          update: {
            args: Prisma.TaxUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>
          }
          deleteMany: {
            args: Prisma.TaxDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.TaxUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.TaxUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>[]
          }
          upsert: {
            args: Prisma.TaxUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$TaxPayload>
          }
          aggregate: {
            args: Prisma.TaxAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateTax>
          }
          groupBy: {
            args: Prisma.TaxGroupByArgs<ExtArgs>
            result: $Utils.Optional<TaxGroupByOutputType>[]
          }
          count: {
            args: Prisma.TaxCountArgs<ExtArgs>
            result: $Utils.Optional<TaxCountAggregateOutputType> | number
          }
        }
      }
      ExpenseCategory: {
        payload: Prisma.$ExpenseCategoryPayload<ExtArgs>
        fields: Prisma.ExpenseCategoryFieldRefs
        operations: {
          findUnique: {
            args: Prisma.ExpenseCategoryFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.ExpenseCategoryFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>
          }
          findFirst: {
            args: Prisma.ExpenseCategoryFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.ExpenseCategoryFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>
          }
          findMany: {
            args: Prisma.ExpenseCategoryFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>[]
          }
          create: {
            args: Prisma.ExpenseCategoryCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>
          }
          createMany: {
            args: Prisma.ExpenseCategoryCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.ExpenseCategoryCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>[]
          }
          delete: {
            args: Prisma.ExpenseCategoryDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>
          }
          update: {
            args: Prisma.ExpenseCategoryUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>
          }
          deleteMany: {
            args: Prisma.ExpenseCategoryDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.ExpenseCategoryUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.ExpenseCategoryUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>[]
          }
          upsert: {
            args: Prisma.ExpenseCategoryUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpenseCategoryPayload>
          }
          aggregate: {
            args: Prisma.ExpenseCategoryAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateExpenseCategory>
          }
          groupBy: {
            args: Prisma.ExpenseCategoryGroupByArgs<ExtArgs>
            result: $Utils.Optional<ExpenseCategoryGroupByOutputType>[]
          }
          count: {
            args: Prisma.ExpenseCategoryCountArgs<ExtArgs>
            result: $Utils.Optional<ExpenseCategoryCountAggregateOutputType> | number
          }
        }
      }
      Expense: {
        payload: Prisma.$ExpensePayload<ExtArgs>
        fields: Prisma.ExpenseFieldRefs
        operations: {
          findUnique: {
            args: Prisma.ExpenseFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.ExpenseFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>
          }
          findFirst: {
            args: Prisma.ExpenseFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.ExpenseFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>
          }
          findMany: {
            args: Prisma.ExpenseFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>[]
          }
          create: {
            args: Prisma.ExpenseCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>
          }
          createMany: {
            args: Prisma.ExpenseCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.ExpenseCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>[]
          }
          delete: {
            args: Prisma.ExpenseDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>
          }
          update: {
            args: Prisma.ExpenseUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>
          }
          deleteMany: {
            args: Prisma.ExpenseDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.ExpenseUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.ExpenseUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>[]
          }
          upsert: {
            args: Prisma.ExpenseUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ExpensePayload>
          }
          aggregate: {
            args: Prisma.ExpenseAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateExpense>
          }
          groupBy: {
            args: Prisma.ExpenseGroupByArgs<ExtArgs>
            result: $Utils.Optional<ExpenseGroupByOutputType>[]
          }
          count: {
            args: Prisma.ExpenseCountArgs<ExtArgs>
            result: $Utils.Optional<ExpenseCountAggregateOutputType> | number
          }
        }
      }
      Product: {
        payload: Prisma.$ProductPayload<ExtArgs>
        fields: Prisma.ProductFieldRefs
        operations: {
          findUnique: {
            args: Prisma.ProductFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.ProductFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>
          }
          findFirst: {
            args: Prisma.ProductFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.ProductFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>
          }
          findMany: {
            args: Prisma.ProductFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>[]
          }
          create: {
            args: Prisma.ProductCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>
          }
          createMany: {
            args: Prisma.ProductCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.ProductCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>[]
          }
          delete: {
            args: Prisma.ProductDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>
          }
          update: {
            args: Prisma.ProductUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>
          }
          deleteMany: {
            args: Prisma.ProductDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.ProductUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.ProductUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>[]
          }
          upsert: {
            args: Prisma.ProductUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ProductPayload>
          }
          aggregate: {
            args: Prisma.ProductAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateProduct>
          }
          groupBy: {
            args: Prisma.ProductGroupByArgs<ExtArgs>
            result: $Utils.Optional<ProductGroupByOutputType>[]
          }
          count: {
            args: Prisma.ProductCountArgs<ExtArgs>
            result: $Utils.Optional<ProductCountAggregateOutputType> | number
          }
        }
      }
      InventoryTransfer: {
        payload: Prisma.$InventoryTransferPayload<ExtArgs>
        fields: Prisma.InventoryTransferFieldRefs
        operations: {
          findUnique: {
            args: Prisma.InventoryTransferFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.InventoryTransferFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>
          }
          findFirst: {
            args: Prisma.InventoryTransferFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.InventoryTransferFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>
          }
          findMany: {
            args: Prisma.InventoryTransferFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>[]
          }
          create: {
            args: Prisma.InventoryTransferCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>
          }
          createMany: {
            args: Prisma.InventoryTransferCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.InventoryTransferCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>[]
          }
          delete: {
            args: Prisma.InventoryTransferDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>
          }
          update: {
            args: Prisma.InventoryTransferUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>
          }
          deleteMany: {
            args: Prisma.InventoryTransferDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.InventoryTransferUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.InventoryTransferUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>[]
          }
          upsert: {
            args: Prisma.InventoryTransferUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferPayload>
          }
          aggregate: {
            args: Prisma.InventoryTransferAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateInventoryTransfer>
          }
          groupBy: {
            args: Prisma.InventoryTransferGroupByArgs<ExtArgs>
            result: $Utils.Optional<InventoryTransferGroupByOutputType>[]
          }
          count: {
            args: Prisma.InventoryTransferCountArgs<ExtArgs>
            result: $Utils.Optional<InventoryTransferCountAggregateOutputType> | number
          }
        }
      }
      InventoryTransferLine: {
        payload: Prisma.$InventoryTransferLinePayload<ExtArgs>
        fields: Prisma.InventoryTransferLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.InventoryTransferLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.InventoryTransferLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>
          }
          findFirst: {
            args: Prisma.InventoryTransferLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.InventoryTransferLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>
          }
          findMany: {
            args: Prisma.InventoryTransferLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>[]
          }
          create: {
            args: Prisma.InventoryTransferLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>
          }
          createMany: {
            args: Prisma.InventoryTransferLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.InventoryTransferLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>[]
          }
          delete: {
            args: Prisma.InventoryTransferLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>
          }
          update: {
            args: Prisma.InventoryTransferLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>
          }
          deleteMany: {
            args: Prisma.InventoryTransferLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.InventoryTransferLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.InventoryTransferLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>[]
          }
          upsert: {
            args: Prisma.InventoryTransferLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryTransferLinePayload>
          }
          aggregate: {
            args: Prisma.InventoryTransferLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateInventoryTransferLine>
          }
          groupBy: {
            args: Prisma.InventoryTransferLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<InventoryTransferLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.InventoryTransferLineCountArgs<ExtArgs>
            result: $Utils.Optional<InventoryTransferLineCountAggregateOutputType> | number
          }
        }
      }
      Invoice: {
        payload: Prisma.$InvoicePayload<ExtArgs>
        fields: Prisma.InvoiceFieldRefs
        operations: {
          findUnique: {
            args: Prisma.InvoiceFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.InvoiceFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>
          }
          findFirst: {
            args: Prisma.InvoiceFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.InvoiceFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>
          }
          findMany: {
            args: Prisma.InvoiceFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>[]
          }
          create: {
            args: Prisma.InvoiceCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>
          }
          createMany: {
            args: Prisma.InvoiceCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.InvoiceCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>[]
          }
          delete: {
            args: Prisma.InvoiceDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>
          }
          update: {
            args: Prisma.InvoiceUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>
          }
          deleteMany: {
            args: Prisma.InvoiceDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.InvoiceUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.InvoiceUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>[]
          }
          upsert: {
            args: Prisma.InvoiceUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoicePayload>
          }
          aggregate: {
            args: Prisma.InvoiceAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateInvoice>
          }
          groupBy: {
            args: Prisma.InvoiceGroupByArgs<ExtArgs>
            result: $Utils.Optional<InvoiceGroupByOutputType>[]
          }
          count: {
            args: Prisma.InvoiceCountArgs<ExtArgs>
            result: $Utils.Optional<InvoiceCountAggregateOutputType> | number
          }
        }
      }
      InvoiceLine: {
        payload: Prisma.$InvoiceLinePayload<ExtArgs>
        fields: Prisma.InvoiceLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.InvoiceLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.InvoiceLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>
          }
          findFirst: {
            args: Prisma.InvoiceLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.InvoiceLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>
          }
          findMany: {
            args: Prisma.InvoiceLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>[]
          }
          create: {
            args: Prisma.InvoiceLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>
          }
          createMany: {
            args: Prisma.InvoiceLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.InvoiceLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>[]
          }
          delete: {
            args: Prisma.InvoiceLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>
          }
          update: {
            args: Prisma.InvoiceLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>
          }
          deleteMany: {
            args: Prisma.InvoiceLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.InvoiceLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.InvoiceLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>[]
          }
          upsert: {
            args: Prisma.InvoiceLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InvoiceLinePayload>
          }
          aggregate: {
            args: Prisma.InvoiceLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateInvoiceLine>
          }
          groupBy: {
            args: Prisma.InvoiceLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<InvoiceLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.InvoiceLineCountArgs<ExtArgs>
            result: $Utils.Optional<InvoiceLineCountAggregateOutputType> | number
          }
        }
      }
      InventoryAdjustment: {
        payload: Prisma.$InventoryAdjustmentPayload<ExtArgs>
        fields: Prisma.InventoryAdjustmentFieldRefs
        operations: {
          findUnique: {
            args: Prisma.InventoryAdjustmentFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.InventoryAdjustmentFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>
          }
          findFirst: {
            args: Prisma.InventoryAdjustmentFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.InventoryAdjustmentFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>
          }
          findMany: {
            args: Prisma.InventoryAdjustmentFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>[]
          }
          create: {
            args: Prisma.InventoryAdjustmentCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>
          }
          createMany: {
            args: Prisma.InventoryAdjustmentCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.InventoryAdjustmentCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>[]
          }
          delete: {
            args: Prisma.InventoryAdjustmentDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>
          }
          update: {
            args: Prisma.InventoryAdjustmentUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>
          }
          deleteMany: {
            args: Prisma.InventoryAdjustmentDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.InventoryAdjustmentUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.InventoryAdjustmentUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>[]
          }
          upsert: {
            args: Prisma.InventoryAdjustmentUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentPayload>
          }
          aggregate: {
            args: Prisma.InventoryAdjustmentAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateInventoryAdjustment>
          }
          groupBy: {
            args: Prisma.InventoryAdjustmentGroupByArgs<ExtArgs>
            result: $Utils.Optional<InventoryAdjustmentGroupByOutputType>[]
          }
          count: {
            args: Prisma.InventoryAdjustmentCountArgs<ExtArgs>
            result: $Utils.Optional<InventoryAdjustmentCountAggregateOutputType> | number
          }
        }
      }
      InventoryAdjustmentLine: {
        payload: Prisma.$InventoryAdjustmentLinePayload<ExtArgs>
        fields: Prisma.InventoryAdjustmentLineFieldRefs
        operations: {
          findUnique: {
            args: Prisma.InventoryAdjustmentLineFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.InventoryAdjustmentLineFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>
          }
          findFirst: {
            args: Prisma.InventoryAdjustmentLineFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.InventoryAdjustmentLineFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>
          }
          findMany: {
            args: Prisma.InventoryAdjustmentLineFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>[]
          }
          create: {
            args: Prisma.InventoryAdjustmentLineCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>
          }
          createMany: {
            args: Prisma.InventoryAdjustmentLineCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.InventoryAdjustmentLineCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>[]
          }
          delete: {
            args: Prisma.InventoryAdjustmentLineDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>
          }
          update: {
            args: Prisma.InventoryAdjustmentLineUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>
          }
          deleteMany: {
            args: Prisma.InventoryAdjustmentLineDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.InventoryAdjustmentLineUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.InventoryAdjustmentLineUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>[]
          }
          upsert: {
            args: Prisma.InventoryAdjustmentLineUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$InventoryAdjustmentLinePayload>
          }
          aggregate: {
            args: Prisma.InventoryAdjustmentLineAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateInventoryAdjustmentLine>
          }
          groupBy: {
            args: Prisma.InventoryAdjustmentLineGroupByArgs<ExtArgs>
            result: $Utils.Optional<InventoryAdjustmentLineGroupByOutputType>[]
          }
          count: {
            args: Prisma.InventoryAdjustmentLineCountArgs<ExtArgs>
            result: $Utils.Optional<InventoryAdjustmentLineCountAggregateOutputType> | number
          }
        }
      }
      EmailTemplate: {
        payload: Prisma.$EmailTemplatePayload<ExtArgs>
        fields: Prisma.EmailTemplateFieldRefs
        operations: {
          findUnique: {
            args: Prisma.EmailTemplateFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.EmailTemplateFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>
          }
          findFirst: {
            args: Prisma.EmailTemplateFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.EmailTemplateFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>
          }
          findMany: {
            args: Prisma.EmailTemplateFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>[]
          }
          create: {
            args: Prisma.EmailTemplateCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>
          }
          createMany: {
            args: Prisma.EmailTemplateCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.EmailTemplateCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>[]
          }
          delete: {
            args: Prisma.EmailTemplateDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>
          }
          update: {
            args: Prisma.EmailTemplateUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>
          }
          deleteMany: {
            args: Prisma.EmailTemplateDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.EmailTemplateUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.EmailTemplateUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>[]
          }
          upsert: {
            args: Prisma.EmailTemplateUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$EmailTemplatePayload>
          }
          aggregate: {
            args: Prisma.EmailTemplateAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateEmailTemplate>
          }
          groupBy: {
            args: Prisma.EmailTemplateGroupByArgs<ExtArgs>
            result: $Utils.Optional<EmailTemplateGroupByOutputType>[]
          }
          count: {
            args: Prisma.EmailTemplateCountArgs<ExtArgs>
            result: $Utils.Optional<EmailTemplateCountAggregateOutputType> | number
          }
        }
      }
      SmsTemplate: {
        payload: Prisma.$SmsTemplatePayload<ExtArgs>
        fields: Prisma.SmsTemplateFieldRefs
        operations: {
          findUnique: {
            args: Prisma.SmsTemplateFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.SmsTemplateFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>
          }
          findFirst: {
            args: Prisma.SmsTemplateFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.SmsTemplateFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>
          }
          findMany: {
            args: Prisma.SmsTemplateFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>[]
          }
          create: {
            args: Prisma.SmsTemplateCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>
          }
          createMany: {
            args: Prisma.SmsTemplateCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.SmsTemplateCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>[]
          }
          delete: {
            args: Prisma.SmsTemplateDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>
          }
          update: {
            args: Prisma.SmsTemplateUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>
          }
          deleteMany: {
            args: Prisma.SmsTemplateDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.SmsTemplateUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.SmsTemplateUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>[]
          }
          upsert: {
            args: Prisma.SmsTemplateUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$SmsTemplatePayload>
          }
          aggregate: {
            args: Prisma.SmsTemplateAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateSmsTemplate>
          }
          groupBy: {
            args: Prisma.SmsTemplateGroupByArgs<ExtArgs>
            result: $Utils.Optional<SmsTemplateGroupByOutputType>[]
          }
          count: {
            args: Prisma.SmsTemplateCountArgs<ExtArgs>
            result: $Utils.Optional<SmsTemplateCountAggregateOutputType> | number
          }
        }
      }
      Notification: {
        payload: Prisma.$NotificationPayload<ExtArgs>
        fields: Prisma.NotificationFieldRefs
        operations: {
          findUnique: {
            args: Prisma.NotificationFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.NotificationFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>
          }
          findFirst: {
            args: Prisma.NotificationFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.NotificationFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>
          }
          findMany: {
            args: Prisma.NotificationFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>[]
          }
          create: {
            args: Prisma.NotificationCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>
          }
          createMany: {
            args: Prisma.NotificationCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.NotificationCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>[]
          }
          delete: {
            args: Prisma.NotificationDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>
          }
          update: {
            args: Prisma.NotificationUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>
          }
          deleteMany: {
            args: Prisma.NotificationDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.NotificationUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.NotificationUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>[]
          }
          upsert: {
            args: Prisma.NotificationUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$NotificationPayload>
          }
          aggregate: {
            args: Prisma.NotificationAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateNotification>
          }
          groupBy: {
            args: Prisma.NotificationGroupByArgs<ExtArgs>
            result: $Utils.Optional<NotificationGroupByOutputType>[]
          }
          count: {
            args: Prisma.NotificationCountArgs<ExtArgs>
            result: $Utils.Optional<NotificationCountAggregateOutputType> | number
          }
        }
      }
      ActivityLog: {
        payload: Prisma.$ActivityLogPayload<ExtArgs>
        fields: Prisma.ActivityLogFieldRefs
        operations: {
          findUnique: {
            args: Prisma.ActivityLogFindUniqueArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload> | null
          }
          findUniqueOrThrow: {
            args: Prisma.ActivityLogFindUniqueOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>
          }
          findFirst: {
            args: Prisma.ActivityLogFindFirstArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload> | null
          }
          findFirstOrThrow: {
            args: Prisma.ActivityLogFindFirstOrThrowArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>
          }
          findMany: {
            args: Prisma.ActivityLogFindManyArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>[]
          }
          create: {
            args: Prisma.ActivityLogCreateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>
          }
          createMany: {
            args: Prisma.ActivityLogCreateManyArgs<ExtArgs>
            result: BatchPayload
          }
          createManyAndReturn: {
            args: Prisma.ActivityLogCreateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>[]
          }
          delete: {
            args: Prisma.ActivityLogDeleteArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>
          }
          update: {
            args: Prisma.ActivityLogUpdateArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>
          }
          deleteMany: {
            args: Prisma.ActivityLogDeleteManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateMany: {
            args: Prisma.ActivityLogUpdateManyArgs<ExtArgs>
            result: BatchPayload
          }
          updateManyAndReturn: {
            args: Prisma.ActivityLogUpdateManyAndReturnArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>[]
          }
          upsert: {
            args: Prisma.ActivityLogUpsertArgs<ExtArgs>
            result: $Utils.PayloadToResult<Prisma.$ActivityLogPayload>
          }
          aggregate: {
            args: Prisma.ActivityLogAggregateArgs<ExtArgs>
            result: $Utils.Optional<AggregateActivityLog>
          }
          groupBy: {
            args: Prisma.ActivityLogGroupByArgs<ExtArgs>
            result: $Utils.Optional<ActivityLogGroupByOutputType>[]
          }
          count: {
            args: Prisma.ActivityLogCountArgs<ExtArgs>
            result: $Utils.Optional<ActivityLogCountAggregateOutputType> | number
          }
        }
      }
    }
  } & {
    other: {
      payload: any
      operations: {
        $executeRaw: {
          args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]],
          result: any
        }
        $executeRawUnsafe: {
          args: [query: string, ...values: any[]],
          result: any
        }
        $queryRaw: {
          args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]],
          result: any
        }
        $queryRawUnsafe: {
          args: [query: string, ...values: any[]],
          result: any
        }
      }
    }
  }
  export const defineExtension: $Extensions.ExtendsHook<"define", Prisma.TypeMapCb, $Extensions.DefaultArgs>
  export type DefaultPrismaClient = PrismaClient
  export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
  export interface PrismaClientOptions {
    /**
     * @default "colorless"
     */
    errorFormat?: ErrorFormat
    /**
     * @example
     * ```
     * // Shorthand for `emit: 'stdout'`
     * log: ['query', 'info', 'warn', 'error']
     * 
     * // Emit as events only
     * log: [
     *   { emit: 'event', level: 'query' },
     *   { emit: 'event', level: 'info' },
     *   { emit: 'event', level: 'warn' }
     *   { emit: 'event', level: 'error' }
     * ]
     * 
     * / Emit as events and log to stdout
     * og: [
     *  { emit: 'stdout', level: 'query' },
     *  { emit: 'stdout', level: 'info' },
     *  { emit: 'stdout', level: 'warn' }
     *  { emit: 'stdout', level: 'error' }
     * 
     * ```
     * Read more in our [docs](https://pris.ly/d/logging).
     */
    log?: (LogLevel | LogDefinition)[]
    /**
     * The default values for transactionOptions
     * maxWait ?= 2000
     * timeout ?= 5000
     */
    transactionOptions?: {
      maxWait?: number
      timeout?: number
      isolationLevel?: Prisma.TransactionIsolationLevel
    }
    /**
     * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`
     */
    adapter?: runtime.SqlDriverAdapterFactory
    /**
     * Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database.
     */
    accelerateUrl?: string
    /**
     * Global configuration for omitting model fields by default.
     * 
     * @example
     * ```
     * const prisma = new PrismaClient({
     *   omit: {
     *     user: {
     *       password: true
     *     }
     *   }
     * })
     * ```
     */
    omit?: Prisma.GlobalOmitConfig
    /**
     * SQL commenter plugins that add metadata to SQL queries as comments.
     * Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
     * 
     * @example
     * ```
     * const prisma = new PrismaClient({
     *   adapter,
     *   comments: [
     *     traceContext(),
     *     queryInsights(),
     *   ],
     * })
     * ```
     */
    comments?: runtime.SqlCommenterPlugin[]
  }
  export type GlobalOmitConfig = {
    healthcheck?: HealthcheckOmit
    setting?: SettingOmit
    user?: UserOmit
    branch?: BranchOmit
    userBranch?: UserBranchOmit
    role?: RoleOmit
    permission?: PermissionOmit
    userRole?: UserRoleOmit
    rolePermission?: RolePermissionOmit
    category?: CategoryOmit
    variation?: VariationOmit
    brand?: BrandOmit
    unit?: UnitOmit
    warehouse?: WarehouseOmit
    warehouseStock?: WarehouseStockOmit
    supplier?: SupplierOmit
    purchase?: PurchaseOmit
    purchaseLine?: PurchaseLineOmit
    purchaseReturn?: PurchaseReturnOmit
    purchaseReturnLine?: PurchaseReturnLineOmit
    customer?: CustomerOmit
    paymentMethod?: PaymentMethodOmit
    sale?: SaleOmit
    saleLine?: SaleLineOmit
    salesReturn?: SalesReturnOmit
    salesReturnLine?: SalesReturnLineOmit
    tax?: TaxOmit
    expenseCategory?: ExpenseCategoryOmit
    expense?: ExpenseOmit
    product?: ProductOmit
    inventoryTransfer?: InventoryTransferOmit
    inventoryTransferLine?: InventoryTransferLineOmit
    invoice?: InvoiceOmit
    invoiceLine?: InvoiceLineOmit
    inventoryAdjustment?: InventoryAdjustmentOmit
    inventoryAdjustmentLine?: InventoryAdjustmentLineOmit
    emailTemplate?: EmailTemplateOmit
    smsTemplate?: SmsTemplateOmit
    notification?: NotificationOmit
    activityLog?: ActivityLogOmit
  }

  /* Types for Logging */
  export type LogLevel = 'info' | 'query' | 'warn' | 'error'
  export type LogDefinition = {
    level: LogLevel
    emit: 'stdout' | 'event'
  }

  export type CheckIsLogLevel<T> = T extends LogLevel ? T : never;

  export type GetLogType<T> = CheckIsLogLevel<
    T extends LogDefinition ? T['level'] : T
  >;

  export type GetEvents<T extends any[]> = T extends Array<LogLevel | LogDefinition>
    ? GetLogType<T[number]>
    : never;

  export type QueryEvent = {
    timestamp: Date
    query: string
    params: string
    duration: number
    target: string
  }

  export type LogEvent = {
    timestamp: Date
    message: string
    target: string
  }
  /* End Types for Logging */


  export type PrismaAction =
    | 'findUnique'
    | 'findUniqueOrThrow'
    | 'findMany'
    | 'findFirst'
    | 'findFirstOrThrow'
    | 'create'
    | 'createMany'
    | 'createManyAndReturn'
    | 'update'
    | 'updateMany'
    | 'updateManyAndReturn'
    | 'upsert'
    | 'delete'
    | 'deleteMany'
    | 'executeRaw'
    | 'queryRaw'
    | 'aggregate'
    | 'count'
    | 'runCommandRaw'
    | 'findRaw'
    | 'groupBy'

  // tested in getLogLevel.test.ts
  export function getLogLevel(log: Array<LogLevel | LogDefinition>): LogLevel | undefined;

  /**
   * `PrismaClient` proxy available in interactive transactions.
   */
  export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClientDenyList>

  export type Datasource = {
    url?: string
  }

  /**
   * Count Types
   */


  /**
   * Count Type UserCountOutputType
   */

  export type UserCountOutputType = {
    roles: number
    branches: number
    notifications: number
    activityLogs: number
  }

  export type UserCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    roles?: boolean | UserCountOutputTypeCountRolesArgs
    branches?: boolean | UserCountOutputTypeCountBranchesArgs
    notifications?: boolean | UserCountOutputTypeCountNotificationsArgs
    activityLogs?: boolean | UserCountOutputTypeCountActivityLogsArgs
  }

  // Custom InputTypes
  /**
   * UserCountOutputType without action
   */
  export type UserCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserCountOutputType
     */
    select?: UserCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * UserCountOutputType without action
   */
  export type UserCountOutputTypeCountRolesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserRoleWhereInput
  }

  /**
   * UserCountOutputType without action
   */
  export type UserCountOutputTypeCountBranchesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserBranchWhereInput
  }

  /**
   * UserCountOutputType without action
   */
  export type UserCountOutputTypeCountNotificationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: NotificationWhereInput
  }

  /**
   * UserCountOutputType without action
   */
  export type UserCountOutputTypeCountActivityLogsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ActivityLogWhereInput
  }


  /**
   * Count Type BranchCountOutputType
   */

  export type BranchCountOutputType = {
    users: number
    activeUsers: number
    suppliers: number
    customers: number
    products: number
    sales: number
    salesReturns: number
    purchases: number
    purchaseReturns: number
    invoices: number
    expenseCategories: number
    expenses: number
    adjustments: number
    transfers: number
    categories: number
    brands: number
    units: number
    variations: number
    taxes: number
    warehouses: number
    paymentMethods: number
  }

  export type BranchCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    users?: boolean | BranchCountOutputTypeCountUsersArgs
    activeUsers?: boolean | BranchCountOutputTypeCountActiveUsersArgs
    suppliers?: boolean | BranchCountOutputTypeCountSuppliersArgs
    customers?: boolean | BranchCountOutputTypeCountCustomersArgs
    products?: boolean | BranchCountOutputTypeCountProductsArgs
    sales?: boolean | BranchCountOutputTypeCountSalesArgs
    salesReturns?: boolean | BranchCountOutputTypeCountSalesReturnsArgs
    purchases?: boolean | BranchCountOutputTypeCountPurchasesArgs
    purchaseReturns?: boolean | BranchCountOutputTypeCountPurchaseReturnsArgs
    invoices?: boolean | BranchCountOutputTypeCountInvoicesArgs
    expenseCategories?: boolean | BranchCountOutputTypeCountExpenseCategoriesArgs
    expenses?: boolean | BranchCountOutputTypeCountExpensesArgs
    adjustments?: boolean | BranchCountOutputTypeCountAdjustmentsArgs
    transfers?: boolean | BranchCountOutputTypeCountTransfersArgs
    categories?: boolean | BranchCountOutputTypeCountCategoriesArgs
    brands?: boolean | BranchCountOutputTypeCountBrandsArgs
    units?: boolean | BranchCountOutputTypeCountUnitsArgs
    variations?: boolean | BranchCountOutputTypeCountVariationsArgs
    taxes?: boolean | BranchCountOutputTypeCountTaxesArgs
    warehouses?: boolean | BranchCountOutputTypeCountWarehousesArgs
    paymentMethods?: boolean | BranchCountOutputTypeCountPaymentMethodsArgs
  }

  // Custom InputTypes
  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the BranchCountOutputType
     */
    select?: BranchCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountUsersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserBranchWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountActiveUsersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountSuppliersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SupplierWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountCustomersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: CustomerWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountProductsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountSalesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountSalesReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountPurchasesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountPurchaseReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountInvoicesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountExpenseCategoriesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseCategoryWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountExpensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountAdjustmentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryAdjustmentWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountTransfersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountCategoriesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: CategoryWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountBrandsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: BrandWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountUnitsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UnitWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountVariationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: VariationWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountTaxesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: TaxWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountWarehousesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: WarehouseWhereInput
  }

  /**
   * BranchCountOutputType without action
   */
  export type BranchCountOutputTypeCountPaymentMethodsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PaymentMethodWhereInput
  }


  /**
   * Count Type RoleCountOutputType
   */

  export type RoleCountOutputType = {
    users: number
    permissions: number
  }

  export type RoleCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    users?: boolean | RoleCountOutputTypeCountUsersArgs
    permissions?: boolean | RoleCountOutputTypeCountPermissionsArgs
  }

  // Custom InputTypes
  /**
   * RoleCountOutputType without action
   */
  export type RoleCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RoleCountOutputType
     */
    select?: RoleCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * RoleCountOutputType without action
   */
  export type RoleCountOutputTypeCountUsersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserRoleWhereInput
  }

  /**
   * RoleCountOutputType without action
   */
  export type RoleCountOutputTypeCountPermissionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: RolePermissionWhereInput
  }


  /**
   * Count Type PermissionCountOutputType
   */

  export type PermissionCountOutputType = {
    roles: number
  }

  export type PermissionCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    roles?: boolean | PermissionCountOutputTypeCountRolesArgs
  }

  // Custom InputTypes
  /**
   * PermissionCountOutputType without action
   */
  export type PermissionCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PermissionCountOutputType
     */
    select?: PermissionCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * PermissionCountOutputType without action
   */
  export type PermissionCountOutputTypeCountRolesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: RolePermissionWhereInput
  }


  /**
   * Count Type CategoryCountOutputType
   */

  export type CategoryCountOutputType = {
    children: number
    products: number
  }

  export type CategoryCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    children?: boolean | CategoryCountOutputTypeCountChildrenArgs
    products?: boolean | CategoryCountOutputTypeCountProductsArgs
  }

  // Custom InputTypes
  /**
   * CategoryCountOutputType without action
   */
  export type CategoryCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the CategoryCountOutputType
     */
    select?: CategoryCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * CategoryCountOutputType without action
   */
  export type CategoryCountOutputTypeCountChildrenArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: CategoryWhereInput
  }

  /**
   * CategoryCountOutputType without action
   */
  export type CategoryCountOutputTypeCountProductsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }


  /**
   * Count Type BrandCountOutputType
   */

  export type BrandCountOutputType = {
    products: number
  }

  export type BrandCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    products?: boolean | BrandCountOutputTypeCountProductsArgs
  }

  // Custom InputTypes
  /**
   * BrandCountOutputType without action
   */
  export type BrandCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the BrandCountOutputType
     */
    select?: BrandCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * BrandCountOutputType without action
   */
  export type BrandCountOutputTypeCountProductsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }


  /**
   * Count Type UnitCountOutputType
   */

  export type UnitCountOutputType = {
    products: number
  }

  export type UnitCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    products?: boolean | UnitCountOutputTypeCountProductsArgs
  }

  // Custom InputTypes
  /**
   * UnitCountOutputType without action
   */
  export type UnitCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UnitCountOutputType
     */
    select?: UnitCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * UnitCountOutputType without action
   */
  export type UnitCountOutputTypeCountProductsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }


  /**
   * Count Type WarehouseCountOutputType
   */

  export type WarehouseCountOutputType = {
    products: number
    adjustments: number
    purchases: number
    purchaseReturns: number
    sales: number
    salesReturns: number
    expenses: number
    transfersFrom: number
    transfersTo: number
    stocks: number
  }

  export type WarehouseCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    products?: boolean | WarehouseCountOutputTypeCountProductsArgs
    adjustments?: boolean | WarehouseCountOutputTypeCountAdjustmentsArgs
    purchases?: boolean | WarehouseCountOutputTypeCountPurchasesArgs
    purchaseReturns?: boolean | WarehouseCountOutputTypeCountPurchaseReturnsArgs
    sales?: boolean | WarehouseCountOutputTypeCountSalesArgs
    salesReturns?: boolean | WarehouseCountOutputTypeCountSalesReturnsArgs
    expenses?: boolean | WarehouseCountOutputTypeCountExpensesArgs
    transfersFrom?: boolean | WarehouseCountOutputTypeCountTransfersFromArgs
    transfersTo?: boolean | WarehouseCountOutputTypeCountTransfersToArgs
    stocks?: boolean | WarehouseCountOutputTypeCountStocksArgs
  }

  // Custom InputTypes
  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseCountOutputType
     */
    select?: WarehouseCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountProductsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountAdjustmentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryAdjustmentWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountPurchasesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountPurchaseReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountSalesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountSalesReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountExpensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountTransfersFromArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountTransfersToArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferWhereInput
  }

  /**
   * WarehouseCountOutputType without action
   */
  export type WarehouseCountOutputTypeCountStocksArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: WarehouseStockWhereInput
  }


  /**
   * Count Type SupplierCountOutputType
   */

  export type SupplierCountOutputType = {
    purchases: number
    purchaseReturns: number
  }

  export type SupplierCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchases?: boolean | SupplierCountOutputTypeCountPurchasesArgs
    purchaseReturns?: boolean | SupplierCountOutputTypeCountPurchaseReturnsArgs
  }

  // Custom InputTypes
  /**
   * SupplierCountOutputType without action
   */
  export type SupplierCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SupplierCountOutputType
     */
    select?: SupplierCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * SupplierCountOutputType without action
   */
  export type SupplierCountOutputTypeCountPurchasesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseWhereInput
  }

  /**
   * SupplierCountOutputType without action
   */
  export type SupplierCountOutputTypeCountPurchaseReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnWhereInput
  }


  /**
   * Count Type PurchaseCountOutputType
   */

  export type PurchaseCountOutputType = {
    lines: number
    returns: number
  }

  export type PurchaseCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | PurchaseCountOutputTypeCountLinesArgs
    returns?: boolean | PurchaseCountOutputTypeCountReturnsArgs
  }

  // Custom InputTypes
  /**
   * PurchaseCountOutputType without action
   */
  export type PurchaseCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseCountOutputType
     */
    select?: PurchaseCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * PurchaseCountOutputType without action
   */
  export type PurchaseCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseLineWhereInput
  }

  /**
   * PurchaseCountOutputType without action
   */
  export type PurchaseCountOutputTypeCountReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnWhereInput
  }


  /**
   * Count Type PurchaseReturnCountOutputType
   */

  export type PurchaseReturnCountOutputType = {
    lines: number
  }

  export type PurchaseReturnCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | PurchaseReturnCountOutputTypeCountLinesArgs
  }

  // Custom InputTypes
  /**
   * PurchaseReturnCountOutputType without action
   */
  export type PurchaseReturnCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnCountOutputType
     */
    select?: PurchaseReturnCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * PurchaseReturnCountOutputType without action
   */
  export type PurchaseReturnCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnLineWhereInput
  }


  /**
   * Count Type CustomerCountOutputType
   */

  export type CustomerCountOutputType = {
    invoices: number
    sales: number
    salesReturns: number
  }

  export type CustomerCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    invoices?: boolean | CustomerCountOutputTypeCountInvoicesArgs
    sales?: boolean | CustomerCountOutputTypeCountSalesArgs
    salesReturns?: boolean | CustomerCountOutputTypeCountSalesReturnsArgs
  }

  // Custom InputTypes
  /**
   * CustomerCountOutputType without action
   */
  export type CustomerCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the CustomerCountOutputType
     */
    select?: CustomerCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * CustomerCountOutputType without action
   */
  export type CustomerCountOutputTypeCountInvoicesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceWhereInput
  }

  /**
   * CustomerCountOutputType without action
   */
  export type CustomerCountOutputTypeCountSalesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleWhereInput
  }

  /**
   * CustomerCountOutputType without action
   */
  export type CustomerCountOutputTypeCountSalesReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnWhereInput
  }


  /**
   * Count Type PaymentMethodCountOutputType
   */

  export type PaymentMethodCountOutputType = {
    sales: number
    expenses: number
  }

  export type PaymentMethodCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sales?: boolean | PaymentMethodCountOutputTypeCountSalesArgs
    expenses?: boolean | PaymentMethodCountOutputTypeCountExpensesArgs
  }

  // Custom InputTypes
  /**
   * PaymentMethodCountOutputType without action
   */
  export type PaymentMethodCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethodCountOutputType
     */
    select?: PaymentMethodCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * PaymentMethodCountOutputType without action
   */
  export type PaymentMethodCountOutputTypeCountSalesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleWhereInput
  }

  /**
   * PaymentMethodCountOutputType without action
   */
  export type PaymentMethodCountOutputTypeCountExpensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseWhereInput
  }


  /**
   * Count Type SaleCountOutputType
   */

  export type SaleCountOutputType = {
    lines: number
    returns: number
    invoices: number
  }

  export type SaleCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | SaleCountOutputTypeCountLinesArgs
    returns?: boolean | SaleCountOutputTypeCountReturnsArgs
    invoices?: boolean | SaleCountOutputTypeCountInvoicesArgs
  }

  // Custom InputTypes
  /**
   * SaleCountOutputType without action
   */
  export type SaleCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleCountOutputType
     */
    select?: SaleCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * SaleCountOutputType without action
   */
  export type SaleCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleLineWhereInput
  }

  /**
   * SaleCountOutputType without action
   */
  export type SaleCountOutputTypeCountReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnWhereInput
  }

  /**
   * SaleCountOutputType without action
   */
  export type SaleCountOutputTypeCountInvoicesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceWhereInput
  }


  /**
   * Count Type SalesReturnCountOutputType
   */

  export type SalesReturnCountOutputType = {
    lines: number
  }

  export type SalesReturnCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | SalesReturnCountOutputTypeCountLinesArgs
  }

  // Custom InputTypes
  /**
   * SalesReturnCountOutputType without action
   */
  export type SalesReturnCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnCountOutputType
     */
    select?: SalesReturnCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * SalesReturnCountOutputType without action
   */
  export type SalesReturnCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnLineWhereInput
  }


  /**
   * Count Type TaxCountOutputType
   */

  export type TaxCountOutputType = {
    productsSales: number
    productsPurchase: number
  }

  export type TaxCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    productsSales?: boolean | TaxCountOutputTypeCountProductsSalesArgs
    productsPurchase?: boolean | TaxCountOutputTypeCountProductsPurchaseArgs
  }

  // Custom InputTypes
  /**
   * TaxCountOutputType without action
   */
  export type TaxCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the TaxCountOutputType
     */
    select?: TaxCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * TaxCountOutputType without action
   */
  export type TaxCountOutputTypeCountProductsSalesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }

  /**
   * TaxCountOutputType without action
   */
  export type TaxCountOutputTypeCountProductsPurchaseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
  }


  /**
   * Count Type ExpenseCategoryCountOutputType
   */

  export type ExpenseCategoryCountOutputType = {
    expenses: number
  }

  export type ExpenseCategoryCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    expenses?: boolean | ExpenseCategoryCountOutputTypeCountExpensesArgs
  }

  // Custom InputTypes
  /**
   * ExpenseCategoryCountOutputType without action
   */
  export type ExpenseCategoryCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategoryCountOutputType
     */
    select?: ExpenseCategoryCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * ExpenseCategoryCountOutputType without action
   */
  export type ExpenseCategoryCountOutputTypeCountExpensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseWhereInput
  }


  /**
   * Count Type ProductCountOutputType
   */

  export type ProductCountOutputType = {
    adjustmentLines: number
    invoiceLines: number
    purchaseLines: number
    purchaseReturnLines: number
    saleLines: number
    salesReturnLines: number
    transferLines: number
    warehouseStocks: number
  }

  export type ProductCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    adjustmentLines?: boolean | ProductCountOutputTypeCountAdjustmentLinesArgs
    invoiceLines?: boolean | ProductCountOutputTypeCountInvoiceLinesArgs
    purchaseLines?: boolean | ProductCountOutputTypeCountPurchaseLinesArgs
    purchaseReturnLines?: boolean | ProductCountOutputTypeCountPurchaseReturnLinesArgs
    saleLines?: boolean | ProductCountOutputTypeCountSaleLinesArgs
    salesReturnLines?: boolean | ProductCountOutputTypeCountSalesReturnLinesArgs
    transferLines?: boolean | ProductCountOutputTypeCountTransferLinesArgs
    warehouseStocks?: boolean | ProductCountOutputTypeCountWarehouseStocksArgs
  }

  // Custom InputTypes
  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ProductCountOutputType
     */
    select?: ProductCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountAdjustmentLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryAdjustmentLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountInvoiceLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountPurchaseLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountPurchaseReturnLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountSaleLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountSalesReturnLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountTransferLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferLineWhereInput
  }

  /**
   * ProductCountOutputType without action
   */
  export type ProductCountOutputTypeCountWarehouseStocksArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: WarehouseStockWhereInput
  }


  /**
   * Count Type InventoryTransferCountOutputType
   */

  export type InventoryTransferCountOutputType = {
    lines: number
  }

  export type InventoryTransferCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | InventoryTransferCountOutputTypeCountLinesArgs
  }

  // Custom InputTypes
  /**
   * InventoryTransferCountOutputType without action
   */
  export type InventoryTransferCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferCountOutputType
     */
    select?: InventoryTransferCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * InventoryTransferCountOutputType without action
   */
  export type InventoryTransferCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferLineWhereInput
  }


  /**
   * Count Type InvoiceCountOutputType
   */

  export type InvoiceCountOutputType = {
    lines: number
  }

  export type InvoiceCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | InvoiceCountOutputTypeCountLinesArgs
  }

  // Custom InputTypes
  /**
   * InvoiceCountOutputType without action
   */
  export type InvoiceCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceCountOutputType
     */
    select?: InvoiceCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * InvoiceCountOutputType without action
   */
  export type InvoiceCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceLineWhereInput
  }


  /**
   * Count Type InventoryAdjustmentCountOutputType
   */

  export type InventoryAdjustmentCountOutputType = {
    lines: number
  }

  export type InventoryAdjustmentCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    lines?: boolean | InventoryAdjustmentCountOutputTypeCountLinesArgs
  }

  // Custom InputTypes
  /**
   * InventoryAdjustmentCountOutputType without action
   */
  export type InventoryAdjustmentCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentCountOutputType
     */
    select?: InventoryAdjustmentCountOutputTypeSelect<ExtArgs> | null
  }

  /**
   * InventoryAdjustmentCountOutputType without action
   */
  export type InventoryAdjustmentCountOutputTypeCountLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryAdjustmentLineWhereInput
  }


  /**
   * Models
   */

  /**
   * Model Healthcheck
   */

  export type AggregateHealthcheck = {
    _count: HealthcheckCountAggregateOutputType | null
    _avg: HealthcheckAvgAggregateOutputType | null
    _sum: HealthcheckSumAggregateOutputType | null
    _min: HealthcheckMinAggregateOutputType | null
    _max: HealthcheckMaxAggregateOutputType | null
  }

  export type HealthcheckAvgAggregateOutputType = {
    id: number | null
  }

  export type HealthcheckSumAggregateOutputType = {
    id: number | null
  }

  export type HealthcheckMinAggregateOutputType = {
    id: number | null
    createdAt: Date | null
  }

  export type HealthcheckMaxAggregateOutputType = {
    id: number | null
    createdAt: Date | null
  }

  export type HealthcheckCountAggregateOutputType = {
    id: number
    createdAt: number
    _all: number
  }


  export type HealthcheckAvgAggregateInputType = {
    id?: true
  }

  export type HealthcheckSumAggregateInputType = {
    id?: true
  }

  export type HealthcheckMinAggregateInputType = {
    id?: true
    createdAt?: true
  }

  export type HealthcheckMaxAggregateInputType = {
    id?: true
    createdAt?: true
  }

  export type HealthcheckCountAggregateInputType = {
    id?: true
    createdAt?: true
    _all?: true
  }

  export type HealthcheckAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Healthcheck to aggregate.
     */
    where?: HealthcheckWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Healthchecks to fetch.
     */
    orderBy?: HealthcheckOrderByWithRelationInput | HealthcheckOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: HealthcheckWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Healthchecks 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` Healthchecks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Healthchecks
    **/
    _count?: true | HealthcheckCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: HealthcheckAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: HealthcheckSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: HealthcheckMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: HealthcheckMaxAggregateInputType
  }

  export type GetHealthcheckAggregateType<T extends HealthcheckAggregateArgs> = {
        [P in keyof T & keyof AggregateHealthcheck]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateHealthcheck[P]>
      : GetScalarType<T[P], AggregateHealthcheck[P]>
  }




  export type HealthcheckGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: HealthcheckWhereInput
    orderBy?: HealthcheckOrderByWithAggregationInput | HealthcheckOrderByWithAggregationInput[]
    by: HealthcheckScalarFieldEnum[] | HealthcheckScalarFieldEnum
    having?: HealthcheckScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: HealthcheckCountAggregateInputType | true
    _avg?: HealthcheckAvgAggregateInputType
    _sum?: HealthcheckSumAggregateInputType
    _min?: HealthcheckMinAggregateInputType
    _max?: HealthcheckMaxAggregateInputType
  }

  export type HealthcheckGroupByOutputType = {
    id: number
    createdAt: Date
    _count: HealthcheckCountAggregateOutputType | null
    _avg: HealthcheckAvgAggregateOutputType | null
    _sum: HealthcheckSumAggregateOutputType | null
    _min: HealthcheckMinAggregateOutputType | null
    _max: HealthcheckMaxAggregateOutputType | null
  }

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


  export type HealthcheckSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    createdAt?: boolean
  }, ExtArgs["result"]["healthcheck"]>

  export type HealthcheckSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    createdAt?: boolean
  }, ExtArgs["result"]["healthcheck"]>

  export type HealthcheckSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    createdAt?: boolean
  }, ExtArgs["result"]["healthcheck"]>

  export type HealthcheckSelectScalar = {
    id?: boolean
    createdAt?: boolean
  }

  export type HealthcheckOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "createdAt", ExtArgs["result"]["healthcheck"]>

  export type $HealthcheckPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Healthcheck"
    objects: {}
    scalars: $Extensions.GetPayloadResult<{
      id: number
      createdAt: Date
    }, ExtArgs["result"]["healthcheck"]>
    composites: {}
  }

  type HealthcheckGetPayload<S extends boolean | null | undefined | HealthcheckDefaultArgs> = $Result.GetResult<Prisma.$HealthcheckPayload, S>

  type HealthcheckCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<HealthcheckFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: HealthcheckCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Healthcheck.
     * @param {HealthcheckCreateArgs} args - Arguments to create a Healthcheck.
     * @example
     * // Create one Healthcheck
     * const Healthcheck = await prisma.healthcheck.create({
     *   data: {
     *     // ... data to create a Healthcheck
     *   }
     * })
     * 
     */
    create<T extends HealthcheckCreateArgs>(args: SelectSubset<T, HealthcheckCreateArgs<ExtArgs>>): Prisma__HealthcheckClient<$Result.GetResult<Prisma.$HealthcheckPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Healthchecks and returns the data saved in the database.
     * @param {HealthcheckCreateManyAndReturnArgs} args - Arguments to create many Healthchecks.
     * @example
     * // Create many Healthchecks
     * const healthcheck = await prisma.healthcheck.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Healthchecks and only return the `id`
     * const healthcheckWithIdOnly = await prisma.healthcheck.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends HealthcheckCreateManyAndReturnArgs>(args?: SelectSubset<T, HealthcheckCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$HealthcheckPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Healthcheck.
     * @param {HealthcheckDeleteArgs} args - Arguments to delete one Healthcheck.
     * @example
     * // Delete one Healthcheck
     * const Healthcheck = await prisma.healthcheck.delete({
     *   where: {
     *     // ... filter to delete one Healthcheck
     *   }
     * })
     * 
     */
    delete<T extends HealthcheckDeleteArgs>(args: SelectSubset<T, HealthcheckDeleteArgs<ExtArgs>>): Prisma__HealthcheckClient<$Result.GetResult<Prisma.$HealthcheckPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Healthcheck.
     * @param {HealthcheckUpdateArgs} args - Arguments to update one Healthcheck.
     * @example
     * // Update one Healthcheck
     * const healthcheck = await prisma.healthcheck.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends HealthcheckUpdateArgs>(args: SelectSubset<T, HealthcheckUpdateArgs<ExtArgs>>): Prisma__HealthcheckClient<$Result.GetResult<Prisma.$HealthcheckPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Healthchecks and returns the data updated in the database.
     * @param {HealthcheckUpdateManyAndReturnArgs} args - Arguments to update many Healthchecks.
     * @example
     * // Update many Healthchecks
     * const healthcheck = await prisma.healthcheck.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Healthchecks and only return the `id`
     * const healthcheckWithIdOnly = await prisma.healthcheck.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends HealthcheckUpdateManyAndReturnArgs>(args: SelectSubset<T, HealthcheckUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$HealthcheckPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Healthcheck.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {HealthcheckAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends HealthcheckAggregateArgs>(args: Subset<T, HealthcheckAggregateArgs>): Prisma.PrismaPromise<GetHealthcheckAggregateType<T>>

    /**
     * Group by Healthcheck.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {HealthcheckGroupByArgs} 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 HealthcheckGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: HealthcheckGroupByArgs['orderBy'] }
        : { orderBy?: HealthcheckGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, HealthcheckGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetHealthcheckGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Healthcheck model
   */
  readonly fields: HealthcheckFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Healthcheck.
   * 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__HealthcheckClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Healthcheck model
   */
  interface HealthcheckFieldRefs {
    readonly id: FieldRef<"Healthcheck", 'Int'>
    readonly createdAt: FieldRef<"Healthcheck", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Healthcheck findUnique
   */
  export type HealthcheckFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * Filter, which Healthcheck to fetch.
     */
    where: HealthcheckWhereUniqueInput
  }

  /**
   * Healthcheck findUniqueOrThrow
   */
  export type HealthcheckFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * Filter, which Healthcheck to fetch.
     */
    where: HealthcheckWhereUniqueInput
  }

  /**
   * Healthcheck findFirst
   */
  export type HealthcheckFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * Filter, which Healthcheck to fetch.
     */
    where?: HealthcheckWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Healthchecks to fetch.
     */
    orderBy?: HealthcheckOrderByWithRelationInput | HealthcheckOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Healthchecks.
     */
    cursor?: HealthcheckWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Healthchecks 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` Healthchecks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Healthchecks.
     */
    distinct?: HealthcheckScalarFieldEnum | HealthcheckScalarFieldEnum[]
  }

  /**
   * Healthcheck findFirstOrThrow
   */
  export type HealthcheckFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * Filter, which Healthcheck to fetch.
     */
    where?: HealthcheckWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Healthchecks to fetch.
     */
    orderBy?: HealthcheckOrderByWithRelationInput | HealthcheckOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Healthchecks.
     */
    cursor?: HealthcheckWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Healthchecks 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` Healthchecks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Healthchecks.
     */
    distinct?: HealthcheckScalarFieldEnum | HealthcheckScalarFieldEnum[]
  }

  /**
   * Healthcheck findMany
   */
  export type HealthcheckFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * Filter, which Healthchecks to fetch.
     */
    where?: HealthcheckWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Healthchecks to fetch.
     */
    orderBy?: HealthcheckOrderByWithRelationInput | HealthcheckOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Healthchecks.
     */
    cursor?: HealthcheckWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Healthchecks 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` Healthchecks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Healthchecks.
     */
    distinct?: HealthcheckScalarFieldEnum | HealthcheckScalarFieldEnum[]
  }

  /**
   * Healthcheck create
   */
  export type HealthcheckCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * The data needed to create a Healthcheck.
     */
    data?: XOR<HealthcheckCreateInput, HealthcheckUncheckedCreateInput>
  }

  /**
   * Healthcheck createMany
   */
  export type HealthcheckCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Healthchecks.
     */
    data: HealthcheckCreateManyInput | HealthcheckCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Healthcheck createManyAndReturn
   */
  export type HealthcheckCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * The data used to create many Healthchecks.
     */
    data: HealthcheckCreateManyInput | HealthcheckCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Healthcheck update
   */
  export type HealthcheckUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * The data needed to update a Healthcheck.
     */
    data: XOR<HealthcheckUpdateInput, HealthcheckUncheckedUpdateInput>
    /**
     * Choose, which Healthcheck to update.
     */
    where: HealthcheckWhereUniqueInput
  }

  /**
   * Healthcheck updateMany
   */
  export type HealthcheckUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Healthchecks.
     */
    data: XOR<HealthcheckUpdateManyMutationInput, HealthcheckUncheckedUpdateManyInput>
    /**
     * Filter which Healthchecks to update
     */
    where?: HealthcheckWhereInput
    /**
     * Limit how many Healthchecks to update.
     */
    limit?: number
  }

  /**
   * Healthcheck updateManyAndReturn
   */
  export type HealthcheckUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * The data used to update Healthchecks.
     */
    data: XOR<HealthcheckUpdateManyMutationInput, HealthcheckUncheckedUpdateManyInput>
    /**
     * Filter which Healthchecks to update
     */
    where?: HealthcheckWhereInput
    /**
     * Limit how many Healthchecks to update.
     */
    limit?: number
  }

  /**
   * Healthcheck upsert
   */
  export type HealthcheckUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * The filter to search for the Healthcheck to update in case it exists.
     */
    where: HealthcheckWhereUniqueInput
    /**
     * In case the Healthcheck found by the `where` argument doesn't exist, create a new Healthcheck with this data.
     */
    create: XOR<HealthcheckCreateInput, HealthcheckUncheckedCreateInput>
    /**
     * In case the Healthcheck was found with the provided `where` argument, update it with this data.
     */
    update: XOR<HealthcheckUpdateInput, HealthcheckUncheckedUpdateInput>
  }

  /**
   * Healthcheck delete
   */
  export type HealthcheckDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
    /**
     * Filter which Healthcheck to delete.
     */
    where: HealthcheckWhereUniqueInput
  }

  /**
   * Healthcheck deleteMany
   */
  export type HealthcheckDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Healthchecks to delete
     */
    where?: HealthcheckWhereInput
    /**
     * Limit how many Healthchecks to delete.
     */
    limit?: number
  }

  /**
   * Healthcheck without action
   */
  export type HealthcheckDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Healthcheck
     */
    select?: HealthcheckSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Healthcheck
     */
    omit?: HealthcheckOmit<ExtArgs> | null
  }


  /**
   * Model Setting
   */

  export type AggregateSetting = {
    _count: SettingCountAggregateOutputType | null
    _min: SettingMinAggregateOutputType | null
    _max: SettingMaxAggregateOutputType | null
  }

  export type SettingMinAggregateOutputType = {
    key: string | null
    value: string | null
    updatedAt: Date | null
  }

  export type SettingMaxAggregateOutputType = {
    key: string | null
    value: string | null
    updatedAt: Date | null
  }

  export type SettingCountAggregateOutputType = {
    key: number
    value: number
    updatedAt: number
    _all: number
  }


  export type SettingMinAggregateInputType = {
    key?: true
    value?: true
    updatedAt?: true
  }

  export type SettingMaxAggregateInputType = {
    key?: true
    value?: true
    updatedAt?: true
  }

  export type SettingCountAggregateInputType = {
    key?: true
    value?: true
    updatedAt?: true
    _all?: true
  }

  export type SettingAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Setting to aggregate.
     */
    where?: SettingWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Settings to fetch.
     */
    orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SettingWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Settings 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` Settings.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Settings
    **/
    _count?: true | SettingCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SettingMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SettingMaxAggregateInputType
  }

  export type GetSettingAggregateType<T extends SettingAggregateArgs> = {
        [P in keyof T & keyof AggregateSetting]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSetting[P]>
      : GetScalarType<T[P], AggregateSetting[P]>
  }




  export type SettingGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SettingWhereInput
    orderBy?: SettingOrderByWithAggregationInput | SettingOrderByWithAggregationInput[]
    by: SettingScalarFieldEnum[] | SettingScalarFieldEnum
    having?: SettingScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SettingCountAggregateInputType | true
    _min?: SettingMinAggregateInputType
    _max?: SettingMaxAggregateInputType
  }

  export type SettingGroupByOutputType = {
    key: string
    value: string
    updatedAt: Date
    _count: SettingCountAggregateOutputType | null
    _min: SettingMinAggregateOutputType | null
    _max: SettingMaxAggregateOutputType | null
  }

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


  export type SettingSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    key?: boolean
    value?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["setting"]>

  export type SettingSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    key?: boolean
    value?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["setting"]>

  export type SettingSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    key?: boolean
    value?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["setting"]>

  export type SettingSelectScalar = {
    key?: boolean
    value?: boolean
    updatedAt?: boolean
  }

  export type SettingOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"key" | "value" | "updatedAt", ExtArgs["result"]["setting"]>

  export type $SettingPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Setting"
    objects: {}
    scalars: $Extensions.GetPayloadResult<{
      key: string
      value: string
      updatedAt: Date
    }, ExtArgs["result"]["setting"]>
    composites: {}
  }

  type SettingGetPayload<S extends boolean | null | undefined | SettingDefaultArgs> = $Result.GetResult<Prisma.$SettingPayload, S>

  type SettingCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SettingFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SettingCountAggregateInputType | true
    }

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

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

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

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

    /**
     * Find zero or more Settings 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 {SettingFindManyArgs} args - Arguments to filter and select certain fields only.
     * @example
     * // Get all Settings
     * const settings = await prisma.setting.findMany()
     * 
     * // Get first 10 Settings
     * const settings = await prisma.setting.findMany({ take: 10 })
     * 
     * // Only select the `key`
     * const settingWithKeyOnly = await prisma.setting.findMany({ select: { key: true } })
     * 
     */
    findMany<T extends SettingFindManyArgs>(args?: SelectSubset<T, SettingFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

    /**
     * Create a Setting.
     * @param {SettingCreateArgs} args - Arguments to create a Setting.
     * @example
     * // Create one Setting
     * const Setting = await prisma.setting.create({
     *   data: {
     *     // ... data to create a Setting
     *   }
     * })
     * 
     */
    create<T extends SettingCreateArgs>(args: SelectSubset<T, SettingCreateArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Settings and returns the data saved in the database.
     * @param {SettingCreateManyAndReturnArgs} args - Arguments to create many Settings.
     * @example
     * // Create many Settings
     * const setting = await prisma.setting.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Settings and only return the `key`
     * const settingWithKeyOnly = await prisma.setting.createManyAndReturn({
     *   select: { key: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SettingCreateManyAndReturnArgs>(args?: SelectSubset<T, SettingCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Setting.
     * @param {SettingDeleteArgs} args - Arguments to delete one Setting.
     * @example
     * // Delete one Setting
     * const Setting = await prisma.setting.delete({
     *   where: {
     *     // ... filter to delete one Setting
     *   }
     * })
     * 
     */
    delete<T extends SettingDeleteArgs>(args: SelectSubset<T, SettingDeleteArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Setting.
     * @param {SettingUpdateArgs} args - Arguments to update one Setting.
     * @example
     * // Update one Setting
     * const setting = await prisma.setting.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SettingUpdateArgs>(args: SelectSubset<T, SettingUpdateArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Settings and returns the data updated in the database.
     * @param {SettingUpdateManyAndReturnArgs} args - Arguments to update many Settings.
     * @example
     * // Update many Settings
     * const setting = await prisma.setting.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Settings and only return the `key`
     * const settingWithKeyOnly = await prisma.setting.updateManyAndReturn({
     *   select: { key: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SettingUpdateManyAndReturnArgs>(args: SelectSubset<T, SettingUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Setting.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SettingAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SettingAggregateArgs>(args: Subset<T, SettingAggregateArgs>): Prisma.PrismaPromise<GetSettingAggregateType<T>>

    /**
     * Group by Setting.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SettingGroupByArgs} 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 SettingGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SettingGroupByArgs['orderBy'] }
        : { orderBy?: SettingGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SettingGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSettingGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Setting model
   */
  readonly fields: SettingFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Setting.
   * 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__SettingClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Setting model
   */
  interface SettingFieldRefs {
    readonly key: FieldRef<"Setting", 'String'>
    readonly value: FieldRef<"Setting", 'String'>
    readonly updatedAt: FieldRef<"Setting", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Setting findUnique
   */
  export type SettingFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * Filter, which Setting to fetch.
     */
    where: SettingWhereUniqueInput
  }

  /**
   * Setting findUniqueOrThrow
   */
  export type SettingFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * Filter, which Setting to fetch.
     */
    where: SettingWhereUniqueInput
  }

  /**
   * Setting findFirst
   */
  export type SettingFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * Filter, which Setting to fetch.
     */
    where?: SettingWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Settings to fetch.
     */
    orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Settings.
     */
    cursor?: SettingWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Settings 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` Settings.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Settings.
     */
    distinct?: SettingScalarFieldEnum | SettingScalarFieldEnum[]
  }

  /**
   * Setting findFirstOrThrow
   */
  export type SettingFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * Filter, which Setting to fetch.
     */
    where?: SettingWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Settings to fetch.
     */
    orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Settings.
     */
    cursor?: SettingWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Settings 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` Settings.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Settings.
     */
    distinct?: SettingScalarFieldEnum | SettingScalarFieldEnum[]
  }

  /**
   * Setting findMany
   */
  export type SettingFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * Filter, which Settings to fetch.
     */
    where?: SettingWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Settings to fetch.
     */
    orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Settings.
     */
    cursor?: SettingWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Settings 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` Settings.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Settings.
     */
    distinct?: SettingScalarFieldEnum | SettingScalarFieldEnum[]
  }

  /**
   * Setting create
   */
  export type SettingCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * The data needed to create a Setting.
     */
    data: XOR<SettingCreateInput, SettingUncheckedCreateInput>
  }

  /**
   * Setting createMany
   */
  export type SettingCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Settings.
     */
    data: SettingCreateManyInput | SettingCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Setting createManyAndReturn
   */
  export type SettingCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * The data used to create many Settings.
     */
    data: SettingCreateManyInput | SettingCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Setting update
   */
  export type SettingUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * The data needed to update a Setting.
     */
    data: XOR<SettingUpdateInput, SettingUncheckedUpdateInput>
    /**
     * Choose, which Setting to update.
     */
    where: SettingWhereUniqueInput
  }

  /**
   * Setting updateMany
   */
  export type SettingUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Settings.
     */
    data: XOR<SettingUpdateManyMutationInput, SettingUncheckedUpdateManyInput>
    /**
     * Filter which Settings to update
     */
    where?: SettingWhereInput
    /**
     * Limit how many Settings to update.
     */
    limit?: number
  }

  /**
   * Setting updateManyAndReturn
   */
  export type SettingUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * The data used to update Settings.
     */
    data: XOR<SettingUpdateManyMutationInput, SettingUncheckedUpdateManyInput>
    /**
     * Filter which Settings to update
     */
    where?: SettingWhereInput
    /**
     * Limit how many Settings to update.
     */
    limit?: number
  }

  /**
   * Setting upsert
   */
  export type SettingUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * The filter to search for the Setting to update in case it exists.
     */
    where: SettingWhereUniqueInput
    /**
     * In case the Setting found by the `where` argument doesn't exist, create a new Setting with this data.
     */
    create: XOR<SettingCreateInput, SettingUncheckedCreateInput>
    /**
     * In case the Setting was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SettingUpdateInput, SettingUncheckedUpdateInput>
  }

  /**
   * Setting delete
   */
  export type SettingDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
    /**
     * Filter which Setting to delete.
     */
    where: SettingWhereUniqueInput
  }

  /**
   * Setting deleteMany
   */
  export type SettingDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Settings to delete
     */
    where?: SettingWhereInput
    /**
     * Limit how many Settings to delete.
     */
    limit?: number
  }

  /**
   * Setting without action
   */
  export type SettingDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Setting
     */
    select?: SettingSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Setting
     */
    omit?: SettingOmit<ExtArgs> | null
  }


  /**
   * Model User
   */

  export type AggregateUser = {
    _count: UserCountAggregateOutputType | null
    _min: UserMinAggregateOutputType | null
    _max: UserMaxAggregateOutputType | null
  }

  export type UserMinAggregateOutputType = {
    id: string | null
    email: string | null
    username: string | null
    fullName: string | null
    passwordHash: string | null
    isVerified: boolean | null
    isApproved: boolean | null
    verificationToken: string | null
    verificationTokenExpiry: Date | null
    passwordResetToken: string | null
    passwordResetTokenExpiry: Date | null
    activeBranchId: string | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type UserMaxAggregateOutputType = {
    id: string | null
    email: string | null
    username: string | null
    fullName: string | null
    passwordHash: string | null
    isVerified: boolean | null
    isApproved: boolean | null
    verificationToken: string | null
    verificationTokenExpiry: Date | null
    passwordResetToken: string | null
    passwordResetTokenExpiry: Date | null
    activeBranchId: string | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type UserCountAggregateOutputType = {
    id: number
    email: number
    username: number
    fullName: number
    passwordHash: number
    isVerified: number
    isApproved: number
    verificationToken: number
    verificationTokenExpiry: number
    passwordResetToken: number
    passwordResetTokenExpiry: number
    activeBranchId: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type UserMinAggregateInputType = {
    id?: true
    email?: true
    username?: true
    fullName?: true
    passwordHash?: true
    isVerified?: true
    isApproved?: true
    verificationToken?: true
    verificationTokenExpiry?: true
    passwordResetToken?: true
    passwordResetTokenExpiry?: true
    activeBranchId?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type UserMaxAggregateInputType = {
    id?: true
    email?: true
    username?: true
    fullName?: true
    passwordHash?: true
    isVerified?: true
    isApproved?: true
    verificationToken?: true
    verificationTokenExpiry?: true
    passwordResetToken?: true
    passwordResetTokenExpiry?: true
    activeBranchId?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type UserCountAggregateInputType = {
    id?: true
    email?: true
    username?: true
    fullName?: true
    passwordHash?: true
    isVerified?: true
    isApproved?: true
    verificationToken?: true
    verificationTokenExpiry?: true
    passwordResetToken?: true
    passwordResetTokenExpiry?: true
    activeBranchId?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

  export type UserAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which User to aggregate.
     */
    where?: UserWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Users to fetch.
     */
    orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: UserWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Users 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` Users.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Users
    **/
    _count?: true | UserCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: UserMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: UserMaxAggregateInputType
  }

  export type GetUserAggregateType<T extends UserAggregateArgs> = {
        [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateUser[P]>
      : GetScalarType<T[P], AggregateUser[P]>
  }




  export type UserGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserWhereInput
    orderBy?: UserOrderByWithAggregationInput | UserOrderByWithAggregationInput[]
    by: UserScalarFieldEnum[] | UserScalarFieldEnum
    having?: UserScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: UserCountAggregateInputType | true
    _min?: UserMinAggregateInputType
    _max?: UserMaxAggregateInputType
  }

  export type UserGroupByOutputType = {
    id: string
    email: string
    username: string | null
    fullName: string
    passwordHash: string
    isVerified: boolean
    isApproved: boolean
    verificationToken: string | null
    verificationTokenExpiry: Date | null
    passwordResetToken: string | null
    passwordResetTokenExpiry: Date | null
    activeBranchId: string | null
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: UserCountAggregateOutputType | null
    _min: UserMinAggregateOutputType | null
    _max: UserMaxAggregateOutputType | null
  }

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


  export type UserSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    email?: boolean
    username?: boolean
    fullName?: boolean
    passwordHash?: boolean
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: boolean
    verificationTokenExpiry?: boolean
    passwordResetToken?: boolean
    passwordResetTokenExpiry?: boolean
    activeBranchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    roles?: boolean | User$rolesArgs<ExtArgs>
    activeBranch?: boolean | User$activeBranchArgs<ExtArgs>
    branches?: boolean | User$branchesArgs<ExtArgs>
    notifications?: boolean | User$notificationsArgs<ExtArgs>
    activityLogs?: boolean | User$activityLogsArgs<ExtArgs>
    _count?: boolean | UserCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["user"]>

  export type UserSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    email?: boolean
    username?: boolean
    fullName?: boolean
    passwordHash?: boolean
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: boolean
    verificationTokenExpiry?: boolean
    passwordResetToken?: boolean
    passwordResetTokenExpiry?: boolean
    activeBranchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    activeBranch?: boolean | User$activeBranchArgs<ExtArgs>
  }, ExtArgs["result"]["user"]>

  export type UserSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    email?: boolean
    username?: boolean
    fullName?: boolean
    passwordHash?: boolean
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: boolean
    verificationTokenExpiry?: boolean
    passwordResetToken?: boolean
    passwordResetTokenExpiry?: boolean
    activeBranchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    activeBranch?: boolean | User$activeBranchArgs<ExtArgs>
  }, ExtArgs["result"]["user"]>

  export type UserSelectScalar = {
    id?: boolean
    email?: boolean
    username?: boolean
    fullName?: boolean
    passwordHash?: boolean
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: boolean
    verificationTokenExpiry?: boolean
    passwordResetToken?: boolean
    passwordResetTokenExpiry?: boolean
    activeBranchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type UserOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "email" | "username" | "fullName" | "passwordHash" | "isVerified" | "isApproved" | "verificationToken" | "verificationTokenExpiry" | "passwordResetToken" | "passwordResetTokenExpiry" | "activeBranchId" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["user"]>
  export type UserInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    roles?: boolean | User$rolesArgs<ExtArgs>
    activeBranch?: boolean | User$activeBranchArgs<ExtArgs>
    branches?: boolean | User$branchesArgs<ExtArgs>
    notifications?: boolean | User$notificationsArgs<ExtArgs>
    activityLogs?: boolean | User$activityLogsArgs<ExtArgs>
    _count?: boolean | UserCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type UserIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    activeBranch?: boolean | User$activeBranchArgs<ExtArgs>
  }
  export type UserIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    activeBranch?: boolean | User$activeBranchArgs<ExtArgs>
  }

  export type $UserPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "User"
    objects: {
      roles: Prisma.$UserRolePayload<ExtArgs>[]
      activeBranch: Prisma.$BranchPayload<ExtArgs> | null
      branches: Prisma.$UserBranchPayload<ExtArgs>[]
      notifications: Prisma.$NotificationPayload<ExtArgs>[]
      activityLogs: Prisma.$ActivityLogPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      email: string
      username: string | null
      fullName: string
      passwordHash: string
      isVerified: boolean
      isApproved: boolean
      verificationToken: string | null
      verificationTokenExpiry: Date | null
      passwordResetToken: string | null
      passwordResetTokenExpiry: Date | null
      activeBranchId: string | null
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["user"]>
    composites: {}
  }

  type UserGetPayload<S extends boolean | null | undefined | UserDefaultArgs> = $Result.GetResult<Prisma.$UserPayload, S>

  type UserCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<UserFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: UserCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a User.
     * @param {UserCreateArgs} args - Arguments to create a User.
     * @example
     * // Create one User
     * const User = await prisma.user.create({
     *   data: {
     *     // ... data to create a User
     *   }
     * })
     * 
     */
    create<T extends UserCreateArgs>(args: SelectSubset<T, UserCreateArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Users and returns the data saved in the database.
     * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users.
     * @example
     * // Create many Users
     * const user = await prisma.user.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Users and only return the `id`
     * const userWithIdOnly = await prisma.user.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends UserCreateManyAndReturnArgs>(args?: SelectSubset<T, UserCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a User.
     * @param {UserDeleteArgs} args - Arguments to delete one User.
     * @example
     * // Delete one User
     * const User = await prisma.user.delete({
     *   where: {
     *     // ... filter to delete one User
     *   }
     * })
     * 
     */
    delete<T extends UserDeleteArgs>(args: SelectSubset<T, UserDeleteArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one User.
     * @param {UserUpdateArgs} args - Arguments to update one User.
     * @example
     * // Update one User
     * const user = await prisma.user.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends UserUpdateArgs>(args: SelectSubset<T, UserUpdateArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Users and returns the data updated in the database.
     * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users.
     * @example
     * // Update many Users
     * const user = await prisma.user.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Users and only return the `id`
     * const userWithIdOnly = await prisma.user.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends UserUpdateManyAndReturnArgs>(args: SelectSubset<T, UserUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a User.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UserAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends UserAggregateArgs>(args: Subset<T, UserAggregateArgs>): Prisma.PrismaPromise<GetUserAggregateType<T>>

    /**
     * Group by User.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UserGroupByArgs} 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 UserGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: UserGroupByArgs['orderBy'] }
        : { orderBy?: UserGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, UserGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the User model
   */
  readonly fields: UserFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for User.
   * 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__UserClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    roles<T extends User$rolesArgs<ExtArgs> = {}>(args?: Subset<T, User$rolesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    activeBranch<T extends User$activeBranchArgs<ExtArgs> = {}>(args?: Subset<T, User$activeBranchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branches<T extends User$branchesArgs<ExtArgs> = {}>(args?: Subset<T, User$branchesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    notifications<T extends User$notificationsArgs<ExtArgs> = {}>(args?: Subset<T, User$notificationsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    activityLogs<T extends User$activityLogsArgs<ExtArgs> = {}>(args?: Subset<T, User$activityLogsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ActivityLogPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the User model
   */
  interface UserFieldRefs {
    readonly id: FieldRef<"User", 'String'>
    readonly email: FieldRef<"User", 'String'>
    readonly username: FieldRef<"User", 'String'>
    readonly fullName: FieldRef<"User", 'String'>
    readonly passwordHash: FieldRef<"User", 'String'>
    readonly isVerified: FieldRef<"User", 'Boolean'>
    readonly isApproved: FieldRef<"User", 'Boolean'>
    readonly verificationToken: FieldRef<"User", 'String'>
    readonly verificationTokenExpiry: FieldRef<"User", 'DateTime'>
    readonly passwordResetToken: FieldRef<"User", 'String'>
    readonly passwordResetTokenExpiry: FieldRef<"User", 'DateTime'>
    readonly activeBranchId: FieldRef<"User", 'String'>
    readonly createdAt: FieldRef<"User", 'DateTime'>
    readonly updatedAt: FieldRef<"User", 'DateTime'>
    readonly deletedAt: FieldRef<"User", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * User findUnique
   */
  export type UserFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * Filter, which User to fetch.
     */
    where: UserWhereUniqueInput
  }

  /**
   * User findUniqueOrThrow
   */
  export type UserFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * Filter, which User to fetch.
     */
    where: UserWhereUniqueInput
  }

  /**
   * User findFirst
   */
  export type UserFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * Filter, which User to fetch.
     */
    where?: UserWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Users to fetch.
     */
    orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Users.
     */
    cursor?: UserWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Users 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` Users.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Users.
     */
    distinct?: UserScalarFieldEnum | UserScalarFieldEnum[]
  }

  /**
   * User findFirstOrThrow
   */
  export type UserFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * Filter, which User to fetch.
     */
    where?: UserWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Users to fetch.
     */
    orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Users.
     */
    cursor?: UserWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Users 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` Users.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Users.
     */
    distinct?: UserScalarFieldEnum | UserScalarFieldEnum[]
  }

  /**
   * User findMany
   */
  export type UserFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * Filter, which Users to fetch.
     */
    where?: UserWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Users to fetch.
     */
    orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Users.
     */
    cursor?: UserWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Users 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` Users.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Users.
     */
    distinct?: UserScalarFieldEnum | UserScalarFieldEnum[]
  }

  /**
   * User create
   */
  export type UserCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * The data needed to create a User.
     */
    data: XOR<UserCreateInput, UserUncheckedCreateInput>
  }

  /**
   * User createMany
   */
  export type UserCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Users.
     */
    data: UserCreateManyInput | UserCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * User createManyAndReturn
   */
  export type UserCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * The data used to create many Users.
     */
    data: UserCreateManyInput | UserCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * User update
   */
  export type UserUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * The data needed to update a User.
     */
    data: XOR<UserUpdateInput, UserUncheckedUpdateInput>
    /**
     * Choose, which User to update.
     */
    where: UserWhereUniqueInput
  }

  /**
   * User updateMany
   */
  export type UserUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Users.
     */
    data: XOR<UserUpdateManyMutationInput, UserUncheckedUpdateManyInput>
    /**
     * Filter which Users to update
     */
    where?: UserWhereInput
    /**
     * Limit how many Users to update.
     */
    limit?: number
  }

  /**
   * User updateManyAndReturn
   */
  export type UserUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * The data used to update Users.
     */
    data: XOR<UserUpdateManyMutationInput, UserUncheckedUpdateManyInput>
    /**
     * Filter which Users to update
     */
    where?: UserWhereInput
    /**
     * Limit how many Users to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * User upsert
   */
  export type UserUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * The filter to search for the User to update in case it exists.
     */
    where: UserWhereUniqueInput
    /**
     * In case the User found by the `where` argument doesn't exist, create a new User with this data.
     */
    create: XOR<UserCreateInput, UserUncheckedCreateInput>
    /**
     * In case the User was found with the provided `where` argument, update it with this data.
     */
    update: XOR<UserUpdateInput, UserUncheckedUpdateInput>
  }

  /**
   * User delete
   */
  export type UserDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    /**
     * Filter which User to delete.
     */
    where: UserWhereUniqueInput
  }

  /**
   * User deleteMany
   */
  export type UserDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Users to delete
     */
    where?: UserWhereInput
    /**
     * Limit how many Users to delete.
     */
    limit?: number
  }

  /**
   * User.roles
   */
  export type User$rolesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    where?: UserRoleWhereInput
    orderBy?: UserRoleOrderByWithRelationInput | UserRoleOrderByWithRelationInput[]
    cursor?: UserRoleWhereUniqueInput
    take?: number
    skip?: number
    distinct?: UserRoleScalarFieldEnum | UserRoleScalarFieldEnum[]
  }

  /**
   * User.activeBranch
   */
  export type User$activeBranchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * User.branches
   */
  export type User$branchesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    where?: UserBranchWhereInput
    orderBy?: UserBranchOrderByWithRelationInput | UserBranchOrderByWithRelationInput[]
    cursor?: UserBranchWhereUniqueInput
    take?: number
    skip?: number
    distinct?: UserBranchScalarFieldEnum | UserBranchScalarFieldEnum[]
  }

  /**
   * User.notifications
   */
  export type User$notificationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    where?: NotificationWhereInput
    orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[]
    cursor?: NotificationWhereUniqueInput
    take?: number
    skip?: number
    distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[]
  }

  /**
   * User.activityLogs
   */
  export type User$activityLogsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    where?: ActivityLogWhereInput
    orderBy?: ActivityLogOrderByWithRelationInput | ActivityLogOrderByWithRelationInput[]
    cursor?: ActivityLogWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ActivityLogScalarFieldEnum | ActivityLogScalarFieldEnum[]
  }

  /**
   * User without action
   */
  export type UserDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
  }


  /**
   * Model Branch
   */

  export type AggregateBranch = {
    _count: BranchCountAggregateOutputType | null
    _avg: BranchAvgAggregateOutputType | null
    _sum: BranchSumAggregateOutputType | null
    _min: BranchMinAggregateOutputType | null
    _max: BranchMaxAggregateOutputType | null
  }

  export type BranchAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type BranchSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type BranchMinAggregateOutputType = {
    id: string | null
    name: string | null
    code: string | null
    address: string | null
    city: string | null
    country: string | null
    phone: string | null
    email: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type BranchMaxAggregateOutputType = {
    id: string | null
    name: string | null
    code: string | null
    address: string | null
    city: string | null
    country: string | null
    phone: string | null
    email: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type BranchCountAggregateOutputType = {
    id: number
    name: number
    code: number
    address: number
    city: number
    country: number
    phone: number
    phones: number
    email: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type BranchAvgAggregateInputType = {
    sortOrder?: true
  }

  export type BranchSumAggregateInputType = {
    sortOrder?: true
  }

  export type BranchMinAggregateInputType = {
    id?: true
    name?: true
    code?: true
    address?: true
    city?: true
    country?: true
    phone?: true
    email?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type BranchMaxAggregateInputType = {
    id?: true
    name?: true
    code?: true
    address?: true
    city?: true
    country?: true
    phone?: true
    email?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type BranchCountAggregateInputType = {
    id?: true
    name?: true
    code?: true
    address?: true
    city?: true
    country?: true
    phone?: true
    phones?: true
    email?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type BranchAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Branch to aggregate.
     */
    where?: BranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Branches to fetch.
     */
    orderBy?: BranchOrderByWithRelationInput | BranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: BranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Branches 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` Branches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Branches
    **/
    _count?: true | BranchCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: BranchAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: BranchSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: BranchMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: BranchMaxAggregateInputType
  }

  export type GetBranchAggregateType<T extends BranchAggregateArgs> = {
        [P in keyof T & keyof AggregateBranch]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateBranch[P]>
      : GetScalarType<T[P], AggregateBranch[P]>
  }




  export type BranchGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: BranchWhereInput
    orderBy?: BranchOrderByWithAggregationInput | BranchOrderByWithAggregationInput[]
    by: BranchScalarFieldEnum[] | BranchScalarFieldEnum
    having?: BranchScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: BranchCountAggregateInputType | true
    _avg?: BranchAvgAggregateInputType
    _sum?: BranchSumAggregateInputType
    _min?: BranchMinAggregateInputType
    _max?: BranchMaxAggregateInputType
  }

  export type BranchGroupByOutputType = {
    id: string
    name: string
    code: string | null
    address: string | null
    city: string | null
    country: string | null
    phone: string | null
    phones: JsonValue | null
    email: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: BranchCountAggregateOutputType | null
    _avg: BranchAvgAggregateOutputType | null
    _sum: BranchSumAggregateOutputType | null
    _min: BranchMinAggregateOutputType | null
    _max: BranchMaxAggregateOutputType | null
  }

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


  export type BranchSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    code?: boolean
    address?: boolean
    city?: boolean
    country?: boolean
    phone?: boolean
    phones?: boolean
    email?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    users?: boolean | Branch$usersArgs<ExtArgs>
    activeUsers?: boolean | Branch$activeUsersArgs<ExtArgs>
    suppliers?: boolean | Branch$suppliersArgs<ExtArgs>
    customers?: boolean | Branch$customersArgs<ExtArgs>
    products?: boolean | Branch$productsArgs<ExtArgs>
    sales?: boolean | Branch$salesArgs<ExtArgs>
    salesReturns?: boolean | Branch$salesReturnsArgs<ExtArgs>
    purchases?: boolean | Branch$purchasesArgs<ExtArgs>
    purchaseReturns?: boolean | Branch$purchaseReturnsArgs<ExtArgs>
    invoices?: boolean | Branch$invoicesArgs<ExtArgs>
    expenseCategories?: boolean | Branch$expenseCategoriesArgs<ExtArgs>
    expenses?: boolean | Branch$expensesArgs<ExtArgs>
    adjustments?: boolean | Branch$adjustmentsArgs<ExtArgs>
    transfers?: boolean | Branch$transfersArgs<ExtArgs>
    categories?: boolean | Branch$categoriesArgs<ExtArgs>
    brands?: boolean | Branch$brandsArgs<ExtArgs>
    units?: boolean | Branch$unitsArgs<ExtArgs>
    variations?: boolean | Branch$variationsArgs<ExtArgs>
    taxes?: boolean | Branch$taxesArgs<ExtArgs>
    warehouses?: boolean | Branch$warehousesArgs<ExtArgs>
    paymentMethods?: boolean | Branch$paymentMethodsArgs<ExtArgs>
    _count?: boolean | BranchCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["branch"]>

  export type BranchSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    code?: boolean
    address?: boolean
    city?: boolean
    country?: boolean
    phone?: boolean
    phones?: boolean
    email?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["branch"]>

  export type BranchSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    code?: boolean
    address?: boolean
    city?: boolean
    country?: boolean
    phone?: boolean
    phones?: boolean
    email?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["branch"]>

  export type BranchSelectScalar = {
    id?: boolean
    name?: boolean
    code?: boolean
    address?: boolean
    city?: boolean
    country?: boolean
    phone?: boolean
    phones?: boolean
    email?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type BranchOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "code" | "address" | "city" | "country" | "phone" | "phones" | "email" | "sortOrder" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["branch"]>
  export type BranchInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    users?: boolean | Branch$usersArgs<ExtArgs>
    activeUsers?: boolean | Branch$activeUsersArgs<ExtArgs>
    suppliers?: boolean | Branch$suppliersArgs<ExtArgs>
    customers?: boolean | Branch$customersArgs<ExtArgs>
    products?: boolean | Branch$productsArgs<ExtArgs>
    sales?: boolean | Branch$salesArgs<ExtArgs>
    salesReturns?: boolean | Branch$salesReturnsArgs<ExtArgs>
    purchases?: boolean | Branch$purchasesArgs<ExtArgs>
    purchaseReturns?: boolean | Branch$purchaseReturnsArgs<ExtArgs>
    invoices?: boolean | Branch$invoicesArgs<ExtArgs>
    expenseCategories?: boolean | Branch$expenseCategoriesArgs<ExtArgs>
    expenses?: boolean | Branch$expensesArgs<ExtArgs>
    adjustments?: boolean | Branch$adjustmentsArgs<ExtArgs>
    transfers?: boolean | Branch$transfersArgs<ExtArgs>
    categories?: boolean | Branch$categoriesArgs<ExtArgs>
    brands?: boolean | Branch$brandsArgs<ExtArgs>
    units?: boolean | Branch$unitsArgs<ExtArgs>
    variations?: boolean | Branch$variationsArgs<ExtArgs>
    taxes?: boolean | Branch$taxesArgs<ExtArgs>
    warehouses?: boolean | Branch$warehousesArgs<ExtArgs>
    paymentMethods?: boolean | Branch$paymentMethodsArgs<ExtArgs>
    _count?: boolean | BranchCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type BranchIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {}
  export type BranchIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {}

  export type $BranchPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Branch"
    objects: {
      users: Prisma.$UserBranchPayload<ExtArgs>[]
      activeUsers: Prisma.$UserPayload<ExtArgs>[]
      suppliers: Prisma.$SupplierPayload<ExtArgs>[]
      customers: Prisma.$CustomerPayload<ExtArgs>[]
      products: Prisma.$ProductPayload<ExtArgs>[]
      sales: Prisma.$SalePayload<ExtArgs>[]
      salesReturns: Prisma.$SalesReturnPayload<ExtArgs>[]
      purchases: Prisma.$PurchasePayload<ExtArgs>[]
      purchaseReturns: Prisma.$PurchaseReturnPayload<ExtArgs>[]
      invoices: Prisma.$InvoicePayload<ExtArgs>[]
      expenseCategories: Prisma.$ExpenseCategoryPayload<ExtArgs>[]
      expenses: Prisma.$ExpensePayload<ExtArgs>[]
      adjustments: Prisma.$InventoryAdjustmentPayload<ExtArgs>[]
      transfers: Prisma.$InventoryTransferPayload<ExtArgs>[]
      categories: Prisma.$CategoryPayload<ExtArgs>[]
      brands: Prisma.$BrandPayload<ExtArgs>[]
      units: Prisma.$UnitPayload<ExtArgs>[]
      variations: Prisma.$VariationPayload<ExtArgs>[]
      taxes: Prisma.$TaxPayload<ExtArgs>[]
      warehouses: Prisma.$WarehousePayload<ExtArgs>[]
      paymentMethods: Prisma.$PaymentMethodPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      code: string | null
      address: string | null
      city: string | null
      country: string | null
      phone: string | null
      /**
       * JSON array of additional phone / contact lines for receipts.
       */
      phones: Prisma.JsonValue | null
      email: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["branch"]>
    composites: {}
  }

  type BranchGetPayload<S extends boolean | null | undefined | BranchDefaultArgs> = $Result.GetResult<Prisma.$BranchPayload, S>

  type BranchCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<BranchFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: BranchCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Branch.
     * @param {BranchCreateArgs} args - Arguments to create a Branch.
     * @example
     * // Create one Branch
     * const Branch = await prisma.branch.create({
     *   data: {
     *     // ... data to create a Branch
     *   }
     * })
     * 
     */
    create<T extends BranchCreateArgs>(args: SelectSubset<T, BranchCreateArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Branches and returns the data saved in the database.
     * @param {BranchCreateManyAndReturnArgs} args - Arguments to create many Branches.
     * @example
     * // Create many Branches
     * const branch = await prisma.branch.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Branches and only return the `id`
     * const branchWithIdOnly = await prisma.branch.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends BranchCreateManyAndReturnArgs>(args?: SelectSubset<T, BranchCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Branch.
     * @param {BranchDeleteArgs} args - Arguments to delete one Branch.
     * @example
     * // Delete one Branch
     * const Branch = await prisma.branch.delete({
     *   where: {
     *     // ... filter to delete one Branch
     *   }
     * })
     * 
     */
    delete<T extends BranchDeleteArgs>(args: SelectSubset<T, BranchDeleteArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Branch.
     * @param {BranchUpdateArgs} args - Arguments to update one Branch.
     * @example
     * // Update one Branch
     * const branch = await prisma.branch.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends BranchUpdateArgs>(args: SelectSubset<T, BranchUpdateArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Branches and returns the data updated in the database.
     * @param {BranchUpdateManyAndReturnArgs} args - Arguments to update many Branches.
     * @example
     * // Update many Branches
     * const branch = await prisma.branch.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Branches and only return the `id`
     * const branchWithIdOnly = await prisma.branch.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends BranchUpdateManyAndReturnArgs>(args: SelectSubset<T, BranchUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Branch.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {BranchAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends BranchAggregateArgs>(args: Subset<T, BranchAggregateArgs>): Prisma.PrismaPromise<GetBranchAggregateType<T>>

    /**
     * Group by Branch.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {BranchGroupByArgs} 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 BranchGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: BranchGroupByArgs['orderBy'] }
        : { orderBy?: BranchGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, BranchGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetBranchGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Branch model
   */
  readonly fields: BranchFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Branch.
   * 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__BranchClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    users<T extends Branch$usersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$usersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    activeUsers<T extends Branch$activeUsersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$activeUsersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    suppliers<T extends Branch$suppliersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$suppliersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    customers<T extends Branch$customersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$customersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    products<T extends Branch$productsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    sales<T extends Branch$salesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$salesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    salesReturns<T extends Branch$salesReturnsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$salesReturnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchases<T extends Branch$purchasesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$purchasesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchaseReturns<T extends Branch$purchaseReturnsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$purchaseReturnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    invoices<T extends Branch$invoicesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    expenseCategories<T extends Branch$expenseCategoriesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$expenseCategoriesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    expenses<T extends Branch$expensesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$expensesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    adjustments<T extends Branch$adjustmentsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$adjustmentsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    transfers<T extends Branch$transfersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$transfersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    categories<T extends Branch$categoriesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$categoriesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    brands<T extends Branch$brandsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$brandsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    units<T extends Branch$unitsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$unitsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    variations<T extends Branch$variationsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$variationsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$VariationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    taxes<T extends Branch$taxesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$taxesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    warehouses<T extends Branch$warehousesArgs<ExtArgs> = {}>(args?: Subset<T, Branch$warehousesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    paymentMethods<T extends Branch$paymentMethodsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$paymentMethodsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Branch model
   */
  interface BranchFieldRefs {
    readonly id: FieldRef<"Branch", 'String'>
    readonly name: FieldRef<"Branch", 'String'>
    readonly code: FieldRef<"Branch", 'String'>
    readonly address: FieldRef<"Branch", 'String'>
    readonly city: FieldRef<"Branch", 'String'>
    readonly country: FieldRef<"Branch", 'String'>
    readonly phone: FieldRef<"Branch", 'String'>
    readonly phones: FieldRef<"Branch", 'Json'>
    readonly email: FieldRef<"Branch", 'String'>
    readonly sortOrder: FieldRef<"Branch", 'Int'>
    readonly isActive: FieldRef<"Branch", 'Boolean'>
    readonly createdAt: FieldRef<"Branch", 'DateTime'>
    readonly updatedAt: FieldRef<"Branch", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Branch findUnique
   */
  export type BranchFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * Filter, which Branch to fetch.
     */
    where: BranchWhereUniqueInput
  }

  /**
   * Branch findUniqueOrThrow
   */
  export type BranchFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * Filter, which Branch to fetch.
     */
    where: BranchWhereUniqueInput
  }

  /**
   * Branch findFirst
   */
  export type BranchFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * Filter, which Branch to fetch.
     */
    where?: BranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Branches to fetch.
     */
    orderBy?: BranchOrderByWithRelationInput | BranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Branches.
     */
    cursor?: BranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Branches 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` Branches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Branches.
     */
    distinct?: BranchScalarFieldEnum | BranchScalarFieldEnum[]
  }

  /**
   * Branch findFirstOrThrow
   */
  export type BranchFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * Filter, which Branch to fetch.
     */
    where?: BranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Branches to fetch.
     */
    orderBy?: BranchOrderByWithRelationInput | BranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Branches.
     */
    cursor?: BranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Branches 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` Branches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Branches.
     */
    distinct?: BranchScalarFieldEnum | BranchScalarFieldEnum[]
  }

  /**
   * Branch findMany
   */
  export type BranchFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * Filter, which Branches to fetch.
     */
    where?: BranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Branches to fetch.
     */
    orderBy?: BranchOrderByWithRelationInput | BranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Branches.
     */
    cursor?: BranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Branches 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` Branches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Branches.
     */
    distinct?: BranchScalarFieldEnum | BranchScalarFieldEnum[]
  }

  /**
   * Branch create
   */
  export type BranchCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * The data needed to create a Branch.
     */
    data: XOR<BranchCreateInput, BranchUncheckedCreateInput>
  }

  /**
   * Branch createMany
   */
  export type BranchCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Branches.
     */
    data: BranchCreateManyInput | BranchCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Branch createManyAndReturn
   */
  export type BranchCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * The data used to create many Branches.
     */
    data: BranchCreateManyInput | BranchCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Branch update
   */
  export type BranchUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * The data needed to update a Branch.
     */
    data: XOR<BranchUpdateInput, BranchUncheckedUpdateInput>
    /**
     * Choose, which Branch to update.
     */
    where: BranchWhereUniqueInput
  }

  /**
   * Branch updateMany
   */
  export type BranchUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Branches.
     */
    data: XOR<BranchUpdateManyMutationInput, BranchUncheckedUpdateManyInput>
    /**
     * Filter which Branches to update
     */
    where?: BranchWhereInput
    /**
     * Limit how many Branches to update.
     */
    limit?: number
  }

  /**
   * Branch updateManyAndReturn
   */
  export type BranchUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * The data used to update Branches.
     */
    data: XOR<BranchUpdateManyMutationInput, BranchUncheckedUpdateManyInput>
    /**
     * Filter which Branches to update
     */
    where?: BranchWhereInput
    /**
     * Limit how many Branches to update.
     */
    limit?: number
  }

  /**
   * Branch upsert
   */
  export type BranchUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * The filter to search for the Branch to update in case it exists.
     */
    where: BranchWhereUniqueInput
    /**
     * In case the Branch found by the `where` argument doesn't exist, create a new Branch with this data.
     */
    create: XOR<BranchCreateInput, BranchUncheckedCreateInput>
    /**
     * In case the Branch was found with the provided `where` argument, update it with this data.
     */
    update: XOR<BranchUpdateInput, BranchUncheckedUpdateInput>
  }

  /**
   * Branch delete
   */
  export type BranchDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    /**
     * Filter which Branch to delete.
     */
    where: BranchWhereUniqueInput
  }

  /**
   * Branch deleteMany
   */
  export type BranchDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Branches to delete
     */
    where?: BranchWhereInput
    /**
     * Limit how many Branches to delete.
     */
    limit?: number
  }

  /**
   * Branch.users
   */
  export type Branch$usersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    where?: UserBranchWhereInput
    orderBy?: UserBranchOrderByWithRelationInput | UserBranchOrderByWithRelationInput[]
    cursor?: UserBranchWhereUniqueInput
    take?: number
    skip?: number
    distinct?: UserBranchScalarFieldEnum | UserBranchScalarFieldEnum[]
  }

  /**
   * Branch.activeUsers
   */
  export type Branch$activeUsersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    where?: UserWhereInput
    orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[]
    cursor?: UserWhereUniqueInput
    take?: number
    skip?: number
    distinct?: UserScalarFieldEnum | UserScalarFieldEnum[]
  }

  /**
   * Branch.suppliers
   */
  export type Branch$suppliersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    where?: SupplierWhereInput
    orderBy?: SupplierOrderByWithRelationInput | SupplierOrderByWithRelationInput[]
    cursor?: SupplierWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SupplierScalarFieldEnum | SupplierScalarFieldEnum[]
  }

  /**
   * Branch.customers
   */
  export type Branch$customersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    where?: CustomerWhereInput
    orderBy?: CustomerOrderByWithRelationInput | CustomerOrderByWithRelationInput[]
    cursor?: CustomerWhereUniqueInput
    take?: number
    skip?: number
    distinct?: CustomerScalarFieldEnum | CustomerScalarFieldEnum[]
  }

  /**
   * Branch.products
   */
  export type Branch$productsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Branch.sales
   */
  export type Branch$salesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    where?: SaleWhereInput
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    cursor?: SaleWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * Branch.salesReturns
   */
  export type Branch$salesReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    where?: SalesReturnWhereInput
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    cursor?: SalesReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * Branch.purchases
   */
  export type Branch$purchasesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Purchase
     */
    select?: PurchaseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Purchase
     */
    omit?: PurchaseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseInclude<ExtArgs> | null
    where?: PurchaseWhereInput
    orderBy?: PurchaseOrderByWithRelationInput | PurchaseOrderByWithRelationInput[]
    cursor?: PurchaseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseScalarFieldEnum | PurchaseScalarFieldEnum[]
  }

  /**
   * Branch.purchaseReturns
   */
  export type Branch$purchaseReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    where?: PurchaseReturnWhereInput
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    cursor?: PurchaseReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

  /**
   * Branch.invoices
   */
  export type Branch$invoicesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    where?: InvoiceWhereInput
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    cursor?: InvoiceWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InvoiceScalarFieldEnum | InvoiceScalarFieldEnum[]
  }

  /**
   * Branch.expenseCategories
   */
  export type Branch$expenseCategoriesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    where?: ExpenseCategoryWhereInput
    orderBy?: ExpenseCategoryOrderByWithRelationInput | ExpenseCategoryOrderByWithRelationInput[]
    cursor?: ExpenseCategoryWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ExpenseCategoryScalarFieldEnum | ExpenseCategoryScalarFieldEnum[]
  }

  /**
   * Branch.expenses
   */
  export type Branch$expensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    where?: ExpenseWhereInput
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    cursor?: ExpenseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * Branch.adjustments
   */
  export type Branch$adjustmentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    where?: InventoryAdjustmentWhereInput
    orderBy?: InventoryAdjustmentOrderByWithRelationInput | InventoryAdjustmentOrderByWithRelationInput[]
    cursor?: InventoryAdjustmentWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryAdjustmentScalarFieldEnum | InventoryAdjustmentScalarFieldEnum[]
  }

  /**
   * Branch.transfers
   */
  export type Branch$transfersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    where?: InventoryTransferWhereInput
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    cursor?: InventoryTransferWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryTransferScalarFieldEnum | InventoryTransferScalarFieldEnum[]
  }

  /**
   * Branch.categories
   */
  export type Branch$categoriesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    where?: CategoryWhereInput
    orderBy?: CategoryOrderByWithRelationInput | CategoryOrderByWithRelationInput[]
    cursor?: CategoryWhereUniqueInput
    take?: number
    skip?: number
    distinct?: CategoryScalarFieldEnum | CategoryScalarFieldEnum[]
  }

  /**
   * Branch.brands
   */
  export type Branch$brandsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    where?: BrandWhereInput
    orderBy?: BrandOrderByWithRelationInput | BrandOrderByWithRelationInput[]
    cursor?: BrandWhereUniqueInput
    take?: number
    skip?: number
    distinct?: BrandScalarFieldEnum | BrandScalarFieldEnum[]
  }

  /**
   * Branch.units
   */
  export type Branch$unitsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    where?: UnitWhereInput
    orderBy?: UnitOrderByWithRelationInput | UnitOrderByWithRelationInput[]
    cursor?: UnitWhereUniqueInput
    take?: number
    skip?: number
    distinct?: UnitScalarFieldEnum | UnitScalarFieldEnum[]
  }

  /**
   * Branch.variations
   */
  export type Branch$variationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    where?: VariationWhereInput
    orderBy?: VariationOrderByWithRelationInput | VariationOrderByWithRelationInput[]
    cursor?: VariationWhereUniqueInput
    take?: number
    skip?: number
    distinct?: VariationScalarFieldEnum | VariationScalarFieldEnum[]
  }

  /**
   * Branch.taxes
   */
  export type Branch$taxesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    where?: TaxWhereInput
    orderBy?: TaxOrderByWithRelationInput | TaxOrderByWithRelationInput[]
    cursor?: TaxWhereUniqueInput
    take?: number
    skip?: number
    distinct?: TaxScalarFieldEnum | TaxScalarFieldEnum[]
  }

  /**
   * Branch.warehouses
   */
  export type Branch$warehousesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
    orderBy?: WarehouseOrderByWithRelationInput | WarehouseOrderByWithRelationInput[]
    cursor?: WarehouseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: WarehouseScalarFieldEnum | WarehouseScalarFieldEnum[]
  }

  /**
   * Branch.paymentMethods
   */
  export type Branch$paymentMethodsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    where?: PaymentMethodWhereInput
    orderBy?: PaymentMethodOrderByWithRelationInput | PaymentMethodOrderByWithRelationInput[]
    cursor?: PaymentMethodWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PaymentMethodScalarFieldEnum | PaymentMethodScalarFieldEnum[]
  }

  /**
   * Branch without action
   */
  export type BranchDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
  }


  /**
   * Model UserBranch
   */

  export type AggregateUserBranch = {
    _count: UserBranchCountAggregateOutputType | null
    _min: UserBranchMinAggregateOutputType | null
    _max: UserBranchMaxAggregateOutputType | null
  }

  export type UserBranchMinAggregateOutputType = {
    userId: string | null
    branchId: string | null
    assignedAt: Date | null
  }

  export type UserBranchMaxAggregateOutputType = {
    userId: string | null
    branchId: string | null
    assignedAt: Date | null
  }

  export type UserBranchCountAggregateOutputType = {
    userId: number
    branchId: number
    assignedAt: number
    _all: number
  }


  export type UserBranchMinAggregateInputType = {
    userId?: true
    branchId?: true
    assignedAt?: true
  }

  export type UserBranchMaxAggregateInputType = {
    userId?: true
    branchId?: true
    assignedAt?: true
  }

  export type UserBranchCountAggregateInputType = {
    userId?: true
    branchId?: true
    assignedAt?: true
    _all?: true
  }

  export type UserBranchAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which UserBranch to aggregate.
     */
    where?: UserBranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserBranches to fetch.
     */
    orderBy?: UserBranchOrderByWithRelationInput | UserBranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: UserBranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserBranches 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` UserBranches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned UserBranches
    **/
    _count?: true | UserBranchCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: UserBranchMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: UserBranchMaxAggregateInputType
  }

  export type GetUserBranchAggregateType<T extends UserBranchAggregateArgs> = {
        [P in keyof T & keyof AggregateUserBranch]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateUserBranch[P]>
      : GetScalarType<T[P], AggregateUserBranch[P]>
  }




  export type UserBranchGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserBranchWhereInput
    orderBy?: UserBranchOrderByWithAggregationInput | UserBranchOrderByWithAggregationInput[]
    by: UserBranchScalarFieldEnum[] | UserBranchScalarFieldEnum
    having?: UserBranchScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: UserBranchCountAggregateInputType | true
    _min?: UserBranchMinAggregateInputType
    _max?: UserBranchMaxAggregateInputType
  }

  export type UserBranchGroupByOutputType = {
    userId: string
    branchId: string
    assignedAt: Date
    _count: UserBranchCountAggregateOutputType | null
    _min: UserBranchMinAggregateOutputType | null
    _max: UserBranchMaxAggregateOutputType | null
  }

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


  export type UserBranchSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    userId?: boolean
    branchId?: boolean
    assignedAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
    branch?: boolean | BranchDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["userBranch"]>

  export type UserBranchSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    userId?: boolean
    branchId?: boolean
    assignedAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
    branch?: boolean | BranchDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["userBranch"]>

  export type UserBranchSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    userId?: boolean
    branchId?: boolean
    assignedAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
    branch?: boolean | BranchDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["userBranch"]>

  export type UserBranchSelectScalar = {
    userId?: boolean
    branchId?: boolean
    assignedAt?: boolean
  }

  export type UserBranchOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"userId" | "branchId" | "assignedAt", ExtArgs["result"]["userBranch"]>
  export type UserBranchInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
    branch?: boolean | BranchDefaultArgs<ExtArgs>
  }
  export type UserBranchIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
    branch?: boolean | BranchDefaultArgs<ExtArgs>
  }
  export type UserBranchIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
    branch?: boolean | BranchDefaultArgs<ExtArgs>
  }

  export type $UserBranchPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "UserBranch"
    objects: {
      user: Prisma.$UserPayload<ExtArgs>
      branch: Prisma.$BranchPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      userId: string
      branchId: string
      assignedAt: Date
    }, ExtArgs["result"]["userBranch"]>
    composites: {}
  }

  type UserBranchGetPayload<S extends boolean | null | undefined | UserBranchDefaultArgs> = $Result.GetResult<Prisma.$UserBranchPayload, S>

  type UserBranchCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<UserBranchFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: UserBranchCountAggregateInputType | true
    }

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

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

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

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

    /**
     * Find zero or more UserBranches 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 {UserBranchFindManyArgs} args - Arguments to filter and select certain fields only.
     * @example
     * // Get all UserBranches
     * const userBranches = await prisma.userBranch.findMany()
     * 
     * // Get first 10 UserBranches
     * const userBranches = await prisma.userBranch.findMany({ take: 10 })
     * 
     * // Only select the `userId`
     * const userBranchWithUserIdOnly = await prisma.userBranch.findMany({ select: { userId: true } })
     * 
     */
    findMany<T extends UserBranchFindManyArgs>(args?: SelectSubset<T, UserBranchFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

    /**
     * Create a UserBranch.
     * @param {UserBranchCreateArgs} args - Arguments to create a UserBranch.
     * @example
     * // Create one UserBranch
     * const UserBranch = await prisma.userBranch.create({
     *   data: {
     *     // ... data to create a UserBranch
     *   }
     * })
     * 
     */
    create<T extends UserBranchCreateArgs>(args: SelectSubset<T, UserBranchCreateArgs<ExtArgs>>): Prisma__UserBranchClient<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many UserBranches and returns the data saved in the database.
     * @param {UserBranchCreateManyAndReturnArgs} args - Arguments to create many UserBranches.
     * @example
     * // Create many UserBranches
     * const userBranch = await prisma.userBranch.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many UserBranches and only return the `userId`
     * const userBranchWithUserIdOnly = await prisma.userBranch.createManyAndReturn({
     *   select: { userId: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends UserBranchCreateManyAndReturnArgs>(args?: SelectSubset<T, UserBranchCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a UserBranch.
     * @param {UserBranchDeleteArgs} args - Arguments to delete one UserBranch.
     * @example
     * // Delete one UserBranch
     * const UserBranch = await prisma.userBranch.delete({
     *   where: {
     *     // ... filter to delete one UserBranch
     *   }
     * })
     * 
     */
    delete<T extends UserBranchDeleteArgs>(args: SelectSubset<T, UserBranchDeleteArgs<ExtArgs>>): Prisma__UserBranchClient<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one UserBranch.
     * @param {UserBranchUpdateArgs} args - Arguments to update one UserBranch.
     * @example
     * // Update one UserBranch
     * const userBranch = await prisma.userBranch.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends UserBranchUpdateArgs>(args: SelectSubset<T, UserBranchUpdateArgs<ExtArgs>>): Prisma__UserBranchClient<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more UserBranches and returns the data updated in the database.
     * @param {UserBranchUpdateManyAndReturnArgs} args - Arguments to update many UserBranches.
     * @example
     * // Update many UserBranches
     * const userBranch = await prisma.userBranch.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more UserBranches and only return the `userId`
     * const userBranchWithUserIdOnly = await prisma.userBranch.updateManyAndReturn({
     *   select: { userId: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends UserBranchUpdateManyAndReturnArgs>(args: SelectSubset<T, UserBranchUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserBranchPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a UserBranch.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UserBranchAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends UserBranchAggregateArgs>(args: Subset<T, UserBranchAggregateArgs>): Prisma.PrismaPromise<GetUserBranchAggregateType<T>>

    /**
     * Group by UserBranch.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UserBranchGroupByArgs} 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 UserBranchGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: UserBranchGroupByArgs['orderBy'] }
        : { orderBy?: UserBranchGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, UserBranchGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserBranchGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the UserBranch model
   */
  readonly fields: UserBranchFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for UserBranch.
   * 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__UserBranchClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    user<T extends UserDefaultArgs<ExtArgs> = {}>(args?: Subset<T, UserDefaultArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    branch<T extends BranchDefaultArgs<ExtArgs> = {}>(args?: Subset<T, BranchDefaultArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the UserBranch model
   */
  interface UserBranchFieldRefs {
    readonly userId: FieldRef<"UserBranch", 'String'>
    readonly branchId: FieldRef<"UserBranch", 'String'>
    readonly assignedAt: FieldRef<"UserBranch", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * UserBranch findUnique
   */
  export type UserBranchFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * Filter, which UserBranch to fetch.
     */
    where: UserBranchWhereUniqueInput
  }

  /**
   * UserBranch findUniqueOrThrow
   */
  export type UserBranchFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * Filter, which UserBranch to fetch.
     */
    where: UserBranchWhereUniqueInput
  }

  /**
   * UserBranch findFirst
   */
  export type UserBranchFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * Filter, which UserBranch to fetch.
     */
    where?: UserBranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserBranches to fetch.
     */
    orderBy?: UserBranchOrderByWithRelationInput | UserBranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for UserBranches.
     */
    cursor?: UserBranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserBranches 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` UserBranches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of UserBranches.
     */
    distinct?: UserBranchScalarFieldEnum | UserBranchScalarFieldEnum[]
  }

  /**
   * UserBranch findFirstOrThrow
   */
  export type UserBranchFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * Filter, which UserBranch to fetch.
     */
    where?: UserBranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserBranches to fetch.
     */
    orderBy?: UserBranchOrderByWithRelationInput | UserBranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for UserBranches.
     */
    cursor?: UserBranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserBranches 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` UserBranches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of UserBranches.
     */
    distinct?: UserBranchScalarFieldEnum | UserBranchScalarFieldEnum[]
  }

  /**
   * UserBranch findMany
   */
  export type UserBranchFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * Filter, which UserBranches to fetch.
     */
    where?: UserBranchWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserBranches to fetch.
     */
    orderBy?: UserBranchOrderByWithRelationInput | UserBranchOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing UserBranches.
     */
    cursor?: UserBranchWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserBranches 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` UserBranches.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of UserBranches.
     */
    distinct?: UserBranchScalarFieldEnum | UserBranchScalarFieldEnum[]
  }

  /**
   * UserBranch create
   */
  export type UserBranchCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * The data needed to create a UserBranch.
     */
    data: XOR<UserBranchCreateInput, UserBranchUncheckedCreateInput>
  }

  /**
   * UserBranch createMany
   */
  export type UserBranchCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many UserBranches.
     */
    data: UserBranchCreateManyInput | UserBranchCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * UserBranch createManyAndReturn
   */
  export type UserBranchCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * The data used to create many UserBranches.
     */
    data: UserBranchCreateManyInput | UserBranchCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * UserBranch update
   */
  export type UserBranchUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * The data needed to update a UserBranch.
     */
    data: XOR<UserBranchUpdateInput, UserBranchUncheckedUpdateInput>
    /**
     * Choose, which UserBranch to update.
     */
    where: UserBranchWhereUniqueInput
  }

  /**
   * UserBranch updateMany
   */
  export type UserBranchUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update UserBranches.
     */
    data: XOR<UserBranchUpdateManyMutationInput, UserBranchUncheckedUpdateManyInput>
    /**
     * Filter which UserBranches to update
     */
    where?: UserBranchWhereInput
    /**
     * Limit how many UserBranches to update.
     */
    limit?: number
  }

  /**
   * UserBranch updateManyAndReturn
   */
  export type UserBranchUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * The data used to update UserBranches.
     */
    data: XOR<UserBranchUpdateManyMutationInput, UserBranchUncheckedUpdateManyInput>
    /**
     * Filter which UserBranches to update
     */
    where?: UserBranchWhereInput
    /**
     * Limit how many UserBranches to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * UserBranch upsert
   */
  export type UserBranchUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * The filter to search for the UserBranch to update in case it exists.
     */
    where: UserBranchWhereUniqueInput
    /**
     * In case the UserBranch found by the `where` argument doesn't exist, create a new UserBranch with this data.
     */
    create: XOR<UserBranchCreateInput, UserBranchUncheckedCreateInput>
    /**
     * In case the UserBranch was found with the provided `where` argument, update it with this data.
     */
    update: XOR<UserBranchUpdateInput, UserBranchUncheckedUpdateInput>
  }

  /**
   * UserBranch delete
   */
  export type UserBranchDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
    /**
     * Filter which UserBranch to delete.
     */
    where: UserBranchWhereUniqueInput
  }

  /**
   * UserBranch deleteMany
   */
  export type UserBranchDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which UserBranches to delete
     */
    where?: UserBranchWhereInput
    /**
     * Limit how many UserBranches to delete.
     */
    limit?: number
  }

  /**
   * UserBranch without action
   */
  export type UserBranchDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserBranch
     */
    select?: UserBranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserBranch
     */
    omit?: UserBranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserBranchInclude<ExtArgs> | null
  }


  /**
   * Model Role
   */

  export type AggregateRole = {
    _count: RoleCountAggregateOutputType | null
    _min: RoleMinAggregateOutputType | null
    _max: RoleMaxAggregateOutputType | null
  }

  export type RoleMinAggregateOutputType = {
    id: string | null
    name: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type RoleMaxAggregateOutputType = {
    id: string | null
    name: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type RoleCountAggregateOutputType = {
    id: number
    name: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type RoleMinAggregateInputType = {
    id?: true
    name?: true
    createdAt?: true
    updatedAt?: true
  }

  export type RoleMaxAggregateInputType = {
    id?: true
    name?: true
    createdAt?: true
    updatedAt?: true
  }

  export type RoleCountAggregateInputType = {
    id?: true
    name?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type RoleAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Role to aggregate.
     */
    where?: RoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Roles to fetch.
     */
    orderBy?: RoleOrderByWithRelationInput | RoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: RoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Roles 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` Roles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Roles
    **/
    _count?: true | RoleCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: RoleMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: RoleMaxAggregateInputType
  }

  export type GetRoleAggregateType<T extends RoleAggregateArgs> = {
        [P in keyof T & keyof AggregateRole]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateRole[P]>
      : GetScalarType<T[P], AggregateRole[P]>
  }




  export type RoleGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: RoleWhereInput
    orderBy?: RoleOrderByWithAggregationInput | RoleOrderByWithAggregationInput[]
    by: RoleScalarFieldEnum[] | RoleScalarFieldEnum
    having?: RoleScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: RoleCountAggregateInputType | true
    _min?: RoleMinAggregateInputType
    _max?: RoleMaxAggregateInputType
  }

  export type RoleGroupByOutputType = {
    id: string
    name: string
    createdAt: Date
    updatedAt: Date
    _count: RoleCountAggregateOutputType | null
    _min: RoleMinAggregateOutputType | null
    _max: RoleMaxAggregateOutputType | null
  }

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


  export type RoleSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    users?: boolean | Role$usersArgs<ExtArgs>
    permissions?: boolean | Role$permissionsArgs<ExtArgs>
    _count?: boolean | RoleCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["role"]>

  export type RoleSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["role"]>

  export type RoleSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["role"]>

  export type RoleSelectScalar = {
    id?: boolean
    name?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type RoleOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "createdAt" | "updatedAt", ExtArgs["result"]["role"]>
  export type RoleInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    users?: boolean | Role$usersArgs<ExtArgs>
    permissions?: boolean | Role$permissionsArgs<ExtArgs>
    _count?: boolean | RoleCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type RoleIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {}
  export type RoleIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {}

  export type $RolePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Role"
    objects: {
      users: Prisma.$UserRolePayload<ExtArgs>[]
      permissions: Prisma.$RolePermissionPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["role"]>
    composites: {}
  }

  type RoleGetPayload<S extends boolean | null | undefined | RoleDefaultArgs> = $Result.GetResult<Prisma.$RolePayload, S>

  type RoleCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<RoleFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: RoleCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Role.
     * @param {RoleCreateArgs} args - Arguments to create a Role.
     * @example
     * // Create one Role
     * const Role = await prisma.role.create({
     *   data: {
     *     // ... data to create a Role
     *   }
     * })
     * 
     */
    create<T extends RoleCreateArgs>(args: SelectSubset<T, RoleCreateArgs<ExtArgs>>): Prisma__RoleClient<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Roles and returns the data saved in the database.
     * @param {RoleCreateManyAndReturnArgs} args - Arguments to create many Roles.
     * @example
     * // Create many Roles
     * const role = await prisma.role.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Roles and only return the `id`
     * const roleWithIdOnly = await prisma.role.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends RoleCreateManyAndReturnArgs>(args?: SelectSubset<T, RoleCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Role.
     * @param {RoleDeleteArgs} args - Arguments to delete one Role.
     * @example
     * // Delete one Role
     * const Role = await prisma.role.delete({
     *   where: {
     *     // ... filter to delete one Role
     *   }
     * })
     * 
     */
    delete<T extends RoleDeleteArgs>(args: SelectSubset<T, RoleDeleteArgs<ExtArgs>>): Prisma__RoleClient<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Role.
     * @param {RoleUpdateArgs} args - Arguments to update one Role.
     * @example
     * // Update one Role
     * const role = await prisma.role.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends RoleUpdateArgs>(args: SelectSubset<T, RoleUpdateArgs<ExtArgs>>): Prisma__RoleClient<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Roles and returns the data updated in the database.
     * @param {RoleUpdateManyAndReturnArgs} args - Arguments to update many Roles.
     * @example
     * // Update many Roles
     * const role = await prisma.role.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Roles and only return the `id`
     * const roleWithIdOnly = await prisma.role.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends RoleUpdateManyAndReturnArgs>(args: SelectSubset<T, RoleUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Role.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {RoleAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends RoleAggregateArgs>(args: Subset<T, RoleAggregateArgs>): Prisma.PrismaPromise<GetRoleAggregateType<T>>

    /**
     * Group by Role.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {RoleGroupByArgs} 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 RoleGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: RoleGroupByArgs['orderBy'] }
        : { orderBy?: RoleGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, RoleGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetRoleGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Role model
   */
  readonly fields: RoleFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Role.
   * 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__RoleClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    users<T extends Role$usersArgs<ExtArgs> = {}>(args?: Subset<T, Role$usersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    permissions<T extends Role$permissionsArgs<ExtArgs> = {}>(args?: Subset<T, Role$permissionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Role model
   */
  interface RoleFieldRefs {
    readonly id: FieldRef<"Role", 'String'>
    readonly name: FieldRef<"Role", 'String'>
    readonly createdAt: FieldRef<"Role", 'DateTime'>
    readonly updatedAt: FieldRef<"Role", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Role findUnique
   */
  export type RoleFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * Filter, which Role to fetch.
     */
    where: RoleWhereUniqueInput
  }

  /**
   * Role findUniqueOrThrow
   */
  export type RoleFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * Filter, which Role to fetch.
     */
    where: RoleWhereUniqueInput
  }

  /**
   * Role findFirst
   */
  export type RoleFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * Filter, which Role to fetch.
     */
    where?: RoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Roles to fetch.
     */
    orderBy?: RoleOrderByWithRelationInput | RoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Roles.
     */
    cursor?: RoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Roles 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` Roles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Roles.
     */
    distinct?: RoleScalarFieldEnum | RoleScalarFieldEnum[]
  }

  /**
   * Role findFirstOrThrow
   */
  export type RoleFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * Filter, which Role to fetch.
     */
    where?: RoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Roles to fetch.
     */
    orderBy?: RoleOrderByWithRelationInput | RoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Roles.
     */
    cursor?: RoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Roles 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` Roles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Roles.
     */
    distinct?: RoleScalarFieldEnum | RoleScalarFieldEnum[]
  }

  /**
   * Role findMany
   */
  export type RoleFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * Filter, which Roles to fetch.
     */
    where?: RoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Roles to fetch.
     */
    orderBy?: RoleOrderByWithRelationInput | RoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Roles.
     */
    cursor?: RoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Roles 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` Roles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Roles.
     */
    distinct?: RoleScalarFieldEnum | RoleScalarFieldEnum[]
  }

  /**
   * Role create
   */
  export type RoleCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * The data needed to create a Role.
     */
    data: XOR<RoleCreateInput, RoleUncheckedCreateInput>
  }

  /**
   * Role createMany
   */
  export type RoleCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Roles.
     */
    data: RoleCreateManyInput | RoleCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Role createManyAndReturn
   */
  export type RoleCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * The data used to create many Roles.
     */
    data: RoleCreateManyInput | RoleCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Role update
   */
  export type RoleUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * The data needed to update a Role.
     */
    data: XOR<RoleUpdateInput, RoleUncheckedUpdateInput>
    /**
     * Choose, which Role to update.
     */
    where: RoleWhereUniqueInput
  }

  /**
   * Role updateMany
   */
  export type RoleUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Roles.
     */
    data: XOR<RoleUpdateManyMutationInput, RoleUncheckedUpdateManyInput>
    /**
     * Filter which Roles to update
     */
    where?: RoleWhereInput
    /**
     * Limit how many Roles to update.
     */
    limit?: number
  }

  /**
   * Role updateManyAndReturn
   */
  export type RoleUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * The data used to update Roles.
     */
    data: XOR<RoleUpdateManyMutationInput, RoleUncheckedUpdateManyInput>
    /**
     * Filter which Roles to update
     */
    where?: RoleWhereInput
    /**
     * Limit how many Roles to update.
     */
    limit?: number
  }

  /**
   * Role upsert
   */
  export type RoleUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * The filter to search for the Role to update in case it exists.
     */
    where: RoleWhereUniqueInput
    /**
     * In case the Role found by the `where` argument doesn't exist, create a new Role with this data.
     */
    create: XOR<RoleCreateInput, RoleUncheckedCreateInput>
    /**
     * In case the Role was found with the provided `where` argument, update it with this data.
     */
    update: XOR<RoleUpdateInput, RoleUncheckedUpdateInput>
  }

  /**
   * Role delete
   */
  export type RoleDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
    /**
     * Filter which Role to delete.
     */
    where: RoleWhereUniqueInput
  }

  /**
   * Role deleteMany
   */
  export type RoleDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Roles to delete
     */
    where?: RoleWhereInput
    /**
     * Limit how many Roles to delete.
     */
    limit?: number
  }

  /**
   * Role.users
   */
  export type Role$usersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    where?: UserRoleWhereInput
    orderBy?: UserRoleOrderByWithRelationInput | UserRoleOrderByWithRelationInput[]
    cursor?: UserRoleWhereUniqueInput
    take?: number
    skip?: number
    distinct?: UserRoleScalarFieldEnum | UserRoleScalarFieldEnum[]
  }

  /**
   * Role.permissions
   */
  export type Role$permissionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    where?: RolePermissionWhereInput
    orderBy?: RolePermissionOrderByWithRelationInput | RolePermissionOrderByWithRelationInput[]
    cursor?: RolePermissionWhereUniqueInput
    take?: number
    skip?: number
    distinct?: RolePermissionScalarFieldEnum | RolePermissionScalarFieldEnum[]
  }

  /**
   * Role without action
   */
  export type RoleDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Role
     */
    select?: RoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Role
     */
    omit?: RoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RoleInclude<ExtArgs> | null
  }


  /**
   * Model Permission
   */

  export type AggregatePermission = {
    _count: PermissionCountAggregateOutputType | null
    _avg: PermissionAvgAggregateOutputType | null
    _sum: PermissionSumAggregateOutputType | null
    _min: PermissionMinAggregateOutputType | null
    _max: PermissionMaxAggregateOutputType | null
  }

  export type PermissionAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type PermissionSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type PermissionMinAggregateOutputType = {
    id: string | null
    name: string | null
    label: string | null
    description: string | null
    category: string | null
    sortOrder: number | null
    isSystem: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type PermissionMaxAggregateOutputType = {
    id: string | null
    name: string | null
    label: string | null
    description: string | null
    category: string | null
    sortOrder: number | null
    isSystem: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type PermissionCountAggregateOutputType = {
    id: number
    name: number
    label: number
    description: number
    category: number
    sortOrder: number
    isSystem: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type PermissionAvgAggregateInputType = {
    sortOrder?: true
  }

  export type PermissionSumAggregateInputType = {
    sortOrder?: true
  }

  export type PermissionMinAggregateInputType = {
    id?: true
    name?: true
    label?: true
    description?: true
    category?: true
    sortOrder?: true
    isSystem?: true
    createdAt?: true
    updatedAt?: true
  }

  export type PermissionMaxAggregateInputType = {
    id?: true
    name?: true
    label?: true
    description?: true
    category?: true
    sortOrder?: true
    isSystem?: true
    createdAt?: true
    updatedAt?: true
  }

  export type PermissionCountAggregateInputType = {
    id?: true
    name?: true
    label?: true
    description?: true
    category?: true
    sortOrder?: true
    isSystem?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type PermissionAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Permission to aggregate.
     */
    where?: PermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Permissions to fetch.
     */
    orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: PermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Permissions 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` Permissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Permissions
    **/
    _count?: true | PermissionCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: PermissionAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: PermissionSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: PermissionMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: PermissionMaxAggregateInputType
  }

  export type GetPermissionAggregateType<T extends PermissionAggregateArgs> = {
        [P in keyof T & keyof AggregatePermission]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregatePermission[P]>
      : GetScalarType<T[P], AggregatePermission[P]>
  }




  export type PermissionGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PermissionWhereInput
    orderBy?: PermissionOrderByWithAggregationInput | PermissionOrderByWithAggregationInput[]
    by: PermissionScalarFieldEnum[] | PermissionScalarFieldEnum
    having?: PermissionScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: PermissionCountAggregateInputType | true
    _avg?: PermissionAvgAggregateInputType
    _sum?: PermissionSumAggregateInputType
    _min?: PermissionMinAggregateInputType
    _max?: PermissionMaxAggregateInputType
  }

  export type PermissionGroupByOutputType = {
    id: string
    name: string
    label: string
    description: string
    category: string
    sortOrder: number
    isSystem: boolean
    createdAt: Date
    updatedAt: Date
    _count: PermissionCountAggregateOutputType | null
    _avg: PermissionAvgAggregateOutputType | null
    _sum: PermissionSumAggregateOutputType | null
    _min: PermissionMinAggregateOutputType | null
    _max: PermissionMaxAggregateOutputType | null
  }

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


  export type PermissionSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    label?: boolean
    description?: boolean
    category?: boolean
    sortOrder?: boolean
    isSystem?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    roles?: boolean | Permission$rolesArgs<ExtArgs>
    _count?: boolean | PermissionCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["permission"]>

  export type PermissionSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    label?: boolean
    description?: boolean
    category?: boolean
    sortOrder?: boolean
    isSystem?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["permission"]>

  export type PermissionSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    label?: boolean
    description?: boolean
    category?: boolean
    sortOrder?: boolean
    isSystem?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["permission"]>

  export type PermissionSelectScalar = {
    id?: boolean
    name?: boolean
    label?: boolean
    description?: boolean
    category?: boolean
    sortOrder?: boolean
    isSystem?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type PermissionOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "label" | "description" | "category" | "sortOrder" | "isSystem" | "createdAt" | "updatedAt", ExtArgs["result"]["permission"]>
  export type PermissionInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    roles?: boolean | Permission$rolesArgs<ExtArgs>
    _count?: boolean | PermissionCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type PermissionIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {}
  export type PermissionIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {}

  export type $PermissionPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Permission"
    objects: {
      roles: Prisma.$RolePermissionPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      label: string
      description: string
      category: string
      sortOrder: number
      isSystem: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["permission"]>
    composites: {}
  }

  type PermissionGetPayload<S extends boolean | null | undefined | PermissionDefaultArgs> = $Result.GetResult<Prisma.$PermissionPayload, S>

  type PermissionCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<PermissionFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: PermissionCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Permission.
     * @param {PermissionCreateArgs} args - Arguments to create a Permission.
     * @example
     * // Create one Permission
     * const Permission = await prisma.permission.create({
     *   data: {
     *     // ... data to create a Permission
     *   }
     * })
     * 
     */
    create<T extends PermissionCreateArgs>(args: SelectSubset<T, PermissionCreateArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Permissions and returns the data saved in the database.
     * @param {PermissionCreateManyAndReturnArgs} args - Arguments to create many Permissions.
     * @example
     * // Create many Permissions
     * const permission = await prisma.permission.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Permissions and only return the `id`
     * const permissionWithIdOnly = await prisma.permission.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends PermissionCreateManyAndReturnArgs>(args?: SelectSubset<T, PermissionCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Permission.
     * @param {PermissionDeleteArgs} args - Arguments to delete one Permission.
     * @example
     * // Delete one Permission
     * const Permission = await prisma.permission.delete({
     *   where: {
     *     // ... filter to delete one Permission
     *   }
     * })
     * 
     */
    delete<T extends PermissionDeleteArgs>(args: SelectSubset<T, PermissionDeleteArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Permission.
     * @param {PermissionUpdateArgs} args - Arguments to update one Permission.
     * @example
     * // Update one Permission
     * const permission = await prisma.permission.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends PermissionUpdateArgs>(args: SelectSubset<T, PermissionUpdateArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Permissions and returns the data updated in the database.
     * @param {PermissionUpdateManyAndReturnArgs} args - Arguments to update many Permissions.
     * @example
     * // Update many Permissions
     * const permission = await prisma.permission.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Permissions and only return the `id`
     * const permissionWithIdOnly = await prisma.permission.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends PermissionUpdateManyAndReturnArgs>(args: SelectSubset<T, PermissionUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Permission.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PermissionAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends PermissionAggregateArgs>(args: Subset<T, PermissionAggregateArgs>): Prisma.PrismaPromise<GetPermissionAggregateType<T>>

    /**
     * Group by Permission.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PermissionGroupByArgs} 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 PermissionGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: PermissionGroupByArgs['orderBy'] }
        : { orderBy?: PermissionGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, PermissionGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPermissionGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Permission model
   */
  readonly fields: PermissionFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Permission.
   * 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__PermissionClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    roles<T extends Permission$rolesArgs<ExtArgs> = {}>(args?: Subset<T, Permission$rolesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Permission model
   */
  interface PermissionFieldRefs {
    readonly id: FieldRef<"Permission", 'String'>
    readonly name: FieldRef<"Permission", 'String'>
    readonly label: FieldRef<"Permission", 'String'>
    readonly description: FieldRef<"Permission", 'String'>
    readonly category: FieldRef<"Permission", 'String'>
    readonly sortOrder: FieldRef<"Permission", 'Int'>
    readonly isSystem: FieldRef<"Permission", 'Boolean'>
    readonly createdAt: FieldRef<"Permission", 'DateTime'>
    readonly updatedAt: FieldRef<"Permission", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Permission findUnique
   */
  export type PermissionFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * Filter, which Permission to fetch.
     */
    where: PermissionWhereUniqueInput
  }

  /**
   * Permission findUniqueOrThrow
   */
  export type PermissionFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * Filter, which Permission to fetch.
     */
    where: PermissionWhereUniqueInput
  }

  /**
   * Permission findFirst
   */
  export type PermissionFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * Filter, which Permission to fetch.
     */
    where?: PermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Permissions to fetch.
     */
    orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Permissions.
     */
    cursor?: PermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Permissions 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` Permissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Permissions.
     */
    distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[]
  }

  /**
   * Permission findFirstOrThrow
   */
  export type PermissionFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * Filter, which Permission to fetch.
     */
    where?: PermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Permissions to fetch.
     */
    orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Permissions.
     */
    cursor?: PermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Permissions 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` Permissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Permissions.
     */
    distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[]
  }

  /**
   * Permission findMany
   */
  export type PermissionFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * Filter, which Permissions to fetch.
     */
    where?: PermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Permissions to fetch.
     */
    orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Permissions.
     */
    cursor?: PermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Permissions 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` Permissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Permissions.
     */
    distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[]
  }

  /**
   * Permission create
   */
  export type PermissionCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * The data needed to create a Permission.
     */
    data: XOR<PermissionCreateInput, PermissionUncheckedCreateInput>
  }

  /**
   * Permission createMany
   */
  export type PermissionCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Permissions.
     */
    data: PermissionCreateManyInput | PermissionCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Permission createManyAndReturn
   */
  export type PermissionCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * The data used to create many Permissions.
     */
    data: PermissionCreateManyInput | PermissionCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Permission update
   */
  export type PermissionUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * The data needed to update a Permission.
     */
    data: XOR<PermissionUpdateInput, PermissionUncheckedUpdateInput>
    /**
     * Choose, which Permission to update.
     */
    where: PermissionWhereUniqueInput
  }

  /**
   * Permission updateMany
   */
  export type PermissionUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Permissions.
     */
    data: XOR<PermissionUpdateManyMutationInput, PermissionUncheckedUpdateManyInput>
    /**
     * Filter which Permissions to update
     */
    where?: PermissionWhereInput
    /**
     * Limit how many Permissions to update.
     */
    limit?: number
  }

  /**
   * Permission updateManyAndReturn
   */
  export type PermissionUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * The data used to update Permissions.
     */
    data: XOR<PermissionUpdateManyMutationInput, PermissionUncheckedUpdateManyInput>
    /**
     * Filter which Permissions to update
     */
    where?: PermissionWhereInput
    /**
     * Limit how many Permissions to update.
     */
    limit?: number
  }

  /**
   * Permission upsert
   */
  export type PermissionUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * The filter to search for the Permission to update in case it exists.
     */
    where: PermissionWhereUniqueInput
    /**
     * In case the Permission found by the `where` argument doesn't exist, create a new Permission with this data.
     */
    create: XOR<PermissionCreateInput, PermissionUncheckedCreateInput>
    /**
     * In case the Permission was found with the provided `where` argument, update it with this data.
     */
    update: XOR<PermissionUpdateInput, PermissionUncheckedUpdateInput>
  }

  /**
   * Permission delete
   */
  export type PermissionDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
    /**
     * Filter which Permission to delete.
     */
    where: PermissionWhereUniqueInput
  }

  /**
   * Permission deleteMany
   */
  export type PermissionDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Permissions to delete
     */
    where?: PermissionWhereInput
    /**
     * Limit how many Permissions to delete.
     */
    limit?: number
  }

  /**
   * Permission.roles
   */
  export type Permission$rolesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    where?: RolePermissionWhereInput
    orderBy?: RolePermissionOrderByWithRelationInput | RolePermissionOrderByWithRelationInput[]
    cursor?: RolePermissionWhereUniqueInput
    take?: number
    skip?: number
    distinct?: RolePermissionScalarFieldEnum | RolePermissionScalarFieldEnum[]
  }

  /**
   * Permission without action
   */
  export type PermissionDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Permission
     */
    select?: PermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Permission
     */
    omit?: PermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PermissionInclude<ExtArgs> | null
  }


  /**
   * Model UserRole
   */

  export type AggregateUserRole = {
    _count: UserRoleCountAggregateOutputType | null
    _min: UserRoleMinAggregateOutputType | null
    _max: UserRoleMaxAggregateOutputType | null
  }

  export type UserRoleMinAggregateOutputType = {
    userId: string | null
    roleId: string | null
    assignedAt: Date | null
  }

  export type UserRoleMaxAggregateOutputType = {
    userId: string | null
    roleId: string | null
    assignedAt: Date | null
  }

  export type UserRoleCountAggregateOutputType = {
    userId: number
    roleId: number
    assignedAt: number
    _all: number
  }


  export type UserRoleMinAggregateInputType = {
    userId?: true
    roleId?: true
    assignedAt?: true
  }

  export type UserRoleMaxAggregateInputType = {
    userId?: true
    roleId?: true
    assignedAt?: true
  }

  export type UserRoleCountAggregateInputType = {
    userId?: true
    roleId?: true
    assignedAt?: true
    _all?: true
  }

  export type UserRoleAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which UserRole to aggregate.
     */
    where?: UserRoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserRoles to fetch.
     */
    orderBy?: UserRoleOrderByWithRelationInput | UserRoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: UserRoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserRoles 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` UserRoles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned UserRoles
    **/
    _count?: true | UserRoleCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: UserRoleMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: UserRoleMaxAggregateInputType
  }

  export type GetUserRoleAggregateType<T extends UserRoleAggregateArgs> = {
        [P in keyof T & keyof AggregateUserRole]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateUserRole[P]>
      : GetScalarType<T[P], AggregateUserRole[P]>
  }




  export type UserRoleGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UserRoleWhereInput
    orderBy?: UserRoleOrderByWithAggregationInput | UserRoleOrderByWithAggregationInput[]
    by: UserRoleScalarFieldEnum[] | UserRoleScalarFieldEnum
    having?: UserRoleScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: UserRoleCountAggregateInputType | true
    _min?: UserRoleMinAggregateInputType
    _max?: UserRoleMaxAggregateInputType
  }

  export type UserRoleGroupByOutputType = {
    userId: string
    roleId: string
    assignedAt: Date
    _count: UserRoleCountAggregateOutputType | null
    _min: UserRoleMinAggregateOutputType | null
    _max: UserRoleMaxAggregateOutputType | null
  }

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


  export type UserRoleSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    userId?: boolean
    roleId?: boolean
    assignedAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
    role?: boolean | RoleDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["userRole"]>

  export type UserRoleSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    userId?: boolean
    roleId?: boolean
    assignedAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
    role?: boolean | RoleDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["userRole"]>

  export type UserRoleSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    userId?: boolean
    roleId?: boolean
    assignedAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
    role?: boolean | RoleDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["userRole"]>

  export type UserRoleSelectScalar = {
    userId?: boolean
    roleId?: boolean
    assignedAt?: boolean
  }

  export type UserRoleOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"userId" | "roleId" | "assignedAt", ExtArgs["result"]["userRole"]>
  export type UserRoleInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
    role?: boolean | RoleDefaultArgs<ExtArgs>
  }
  export type UserRoleIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
    role?: boolean | RoleDefaultArgs<ExtArgs>
  }
  export type UserRoleIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
    role?: boolean | RoleDefaultArgs<ExtArgs>
  }

  export type $UserRolePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "UserRole"
    objects: {
      user: Prisma.$UserPayload<ExtArgs>
      role: Prisma.$RolePayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      userId: string
      roleId: string
      assignedAt: Date
    }, ExtArgs["result"]["userRole"]>
    composites: {}
  }

  type UserRoleGetPayload<S extends boolean | null | undefined | UserRoleDefaultArgs> = $Result.GetResult<Prisma.$UserRolePayload, S>

  type UserRoleCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<UserRoleFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: UserRoleCountAggregateInputType | true
    }

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

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

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

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

    /**
     * Find zero or more UserRoles 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 {UserRoleFindManyArgs} args - Arguments to filter and select certain fields only.
     * @example
     * // Get all UserRoles
     * const userRoles = await prisma.userRole.findMany()
     * 
     * // Get first 10 UserRoles
     * const userRoles = await prisma.userRole.findMany({ take: 10 })
     * 
     * // Only select the `userId`
     * const userRoleWithUserIdOnly = await prisma.userRole.findMany({ select: { userId: true } })
     * 
     */
    findMany<T extends UserRoleFindManyArgs>(args?: SelectSubset<T, UserRoleFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

    /**
     * Create a UserRole.
     * @param {UserRoleCreateArgs} args - Arguments to create a UserRole.
     * @example
     * // Create one UserRole
     * const UserRole = await prisma.userRole.create({
     *   data: {
     *     // ... data to create a UserRole
     *   }
     * })
     * 
     */
    create<T extends UserRoleCreateArgs>(args: SelectSubset<T, UserRoleCreateArgs<ExtArgs>>): Prisma__UserRoleClient<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many UserRoles and returns the data saved in the database.
     * @param {UserRoleCreateManyAndReturnArgs} args - Arguments to create many UserRoles.
     * @example
     * // Create many UserRoles
     * const userRole = await prisma.userRole.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many UserRoles and only return the `userId`
     * const userRoleWithUserIdOnly = await prisma.userRole.createManyAndReturn({
     *   select: { userId: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends UserRoleCreateManyAndReturnArgs>(args?: SelectSubset<T, UserRoleCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a UserRole.
     * @param {UserRoleDeleteArgs} args - Arguments to delete one UserRole.
     * @example
     * // Delete one UserRole
     * const UserRole = await prisma.userRole.delete({
     *   where: {
     *     // ... filter to delete one UserRole
     *   }
     * })
     * 
     */
    delete<T extends UserRoleDeleteArgs>(args: SelectSubset<T, UserRoleDeleteArgs<ExtArgs>>): Prisma__UserRoleClient<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one UserRole.
     * @param {UserRoleUpdateArgs} args - Arguments to update one UserRole.
     * @example
     * // Update one UserRole
     * const userRole = await prisma.userRole.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends UserRoleUpdateArgs>(args: SelectSubset<T, UserRoleUpdateArgs<ExtArgs>>): Prisma__UserRoleClient<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more UserRoles and returns the data updated in the database.
     * @param {UserRoleUpdateManyAndReturnArgs} args - Arguments to update many UserRoles.
     * @example
     * // Update many UserRoles
     * const userRole = await prisma.userRole.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more UserRoles and only return the `userId`
     * const userRoleWithUserIdOnly = await prisma.userRole.updateManyAndReturn({
     *   select: { userId: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends UserRoleUpdateManyAndReturnArgs>(args: SelectSubset<T, UserRoleUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserRolePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a UserRole.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UserRoleAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends UserRoleAggregateArgs>(args: Subset<T, UserRoleAggregateArgs>): Prisma.PrismaPromise<GetUserRoleAggregateType<T>>

    /**
     * Group by UserRole.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UserRoleGroupByArgs} 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 UserRoleGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: UserRoleGroupByArgs['orderBy'] }
        : { orderBy?: UserRoleGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, UserRoleGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserRoleGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the UserRole model
   */
  readonly fields: UserRoleFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for UserRole.
   * 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__UserRoleClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    user<T extends UserDefaultArgs<ExtArgs> = {}>(args?: Subset<T, UserDefaultArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    role<T extends RoleDefaultArgs<ExtArgs> = {}>(args?: Subset<T, RoleDefaultArgs<ExtArgs>>): Prisma__RoleClient<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the UserRole model
   */
  interface UserRoleFieldRefs {
    readonly userId: FieldRef<"UserRole", 'String'>
    readonly roleId: FieldRef<"UserRole", 'String'>
    readonly assignedAt: FieldRef<"UserRole", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * UserRole findUnique
   */
  export type UserRoleFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * Filter, which UserRole to fetch.
     */
    where: UserRoleWhereUniqueInput
  }

  /**
   * UserRole findUniqueOrThrow
   */
  export type UserRoleFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * Filter, which UserRole to fetch.
     */
    where: UserRoleWhereUniqueInput
  }

  /**
   * UserRole findFirst
   */
  export type UserRoleFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * Filter, which UserRole to fetch.
     */
    where?: UserRoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserRoles to fetch.
     */
    orderBy?: UserRoleOrderByWithRelationInput | UserRoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for UserRoles.
     */
    cursor?: UserRoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserRoles 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` UserRoles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of UserRoles.
     */
    distinct?: UserRoleScalarFieldEnum | UserRoleScalarFieldEnum[]
  }

  /**
   * UserRole findFirstOrThrow
   */
  export type UserRoleFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * Filter, which UserRole to fetch.
     */
    where?: UserRoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserRoles to fetch.
     */
    orderBy?: UserRoleOrderByWithRelationInput | UserRoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for UserRoles.
     */
    cursor?: UserRoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserRoles 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` UserRoles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of UserRoles.
     */
    distinct?: UserRoleScalarFieldEnum | UserRoleScalarFieldEnum[]
  }

  /**
   * UserRole findMany
   */
  export type UserRoleFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * Filter, which UserRoles to fetch.
     */
    where?: UserRoleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of UserRoles to fetch.
     */
    orderBy?: UserRoleOrderByWithRelationInput | UserRoleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing UserRoles.
     */
    cursor?: UserRoleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` UserRoles 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` UserRoles.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of UserRoles.
     */
    distinct?: UserRoleScalarFieldEnum | UserRoleScalarFieldEnum[]
  }

  /**
   * UserRole create
   */
  export type UserRoleCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * The data needed to create a UserRole.
     */
    data: XOR<UserRoleCreateInput, UserRoleUncheckedCreateInput>
  }

  /**
   * UserRole createMany
   */
  export type UserRoleCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many UserRoles.
     */
    data: UserRoleCreateManyInput | UserRoleCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * UserRole createManyAndReturn
   */
  export type UserRoleCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * The data used to create many UserRoles.
     */
    data: UserRoleCreateManyInput | UserRoleCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * UserRole update
   */
  export type UserRoleUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * The data needed to update a UserRole.
     */
    data: XOR<UserRoleUpdateInput, UserRoleUncheckedUpdateInput>
    /**
     * Choose, which UserRole to update.
     */
    where: UserRoleWhereUniqueInput
  }

  /**
   * UserRole updateMany
   */
  export type UserRoleUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update UserRoles.
     */
    data: XOR<UserRoleUpdateManyMutationInput, UserRoleUncheckedUpdateManyInput>
    /**
     * Filter which UserRoles to update
     */
    where?: UserRoleWhereInput
    /**
     * Limit how many UserRoles to update.
     */
    limit?: number
  }

  /**
   * UserRole updateManyAndReturn
   */
  export type UserRoleUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * The data used to update UserRoles.
     */
    data: XOR<UserRoleUpdateManyMutationInput, UserRoleUncheckedUpdateManyInput>
    /**
     * Filter which UserRoles to update
     */
    where?: UserRoleWhereInput
    /**
     * Limit how many UserRoles to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * UserRole upsert
   */
  export type UserRoleUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * The filter to search for the UserRole to update in case it exists.
     */
    where: UserRoleWhereUniqueInput
    /**
     * In case the UserRole found by the `where` argument doesn't exist, create a new UserRole with this data.
     */
    create: XOR<UserRoleCreateInput, UserRoleUncheckedCreateInput>
    /**
     * In case the UserRole was found with the provided `where` argument, update it with this data.
     */
    update: XOR<UserRoleUpdateInput, UserRoleUncheckedUpdateInput>
  }

  /**
   * UserRole delete
   */
  export type UserRoleDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
    /**
     * Filter which UserRole to delete.
     */
    where: UserRoleWhereUniqueInput
  }

  /**
   * UserRole deleteMany
   */
  export type UserRoleDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which UserRoles to delete
     */
    where?: UserRoleWhereInput
    /**
     * Limit how many UserRoles to delete.
     */
    limit?: number
  }

  /**
   * UserRole without action
   */
  export type UserRoleDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the UserRole
     */
    select?: UserRoleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the UserRole
     */
    omit?: UserRoleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserRoleInclude<ExtArgs> | null
  }


  /**
   * Model RolePermission
   */

  export type AggregateRolePermission = {
    _count: RolePermissionCountAggregateOutputType | null
    _min: RolePermissionMinAggregateOutputType | null
    _max: RolePermissionMaxAggregateOutputType | null
  }

  export type RolePermissionMinAggregateOutputType = {
    roleId: string | null
    permissionId: string | null
  }

  export type RolePermissionMaxAggregateOutputType = {
    roleId: string | null
    permissionId: string | null
  }

  export type RolePermissionCountAggregateOutputType = {
    roleId: number
    permissionId: number
    _all: number
  }


  export type RolePermissionMinAggregateInputType = {
    roleId?: true
    permissionId?: true
  }

  export type RolePermissionMaxAggregateInputType = {
    roleId?: true
    permissionId?: true
  }

  export type RolePermissionCountAggregateInputType = {
    roleId?: true
    permissionId?: true
    _all?: true
  }

  export type RolePermissionAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which RolePermission to aggregate.
     */
    where?: RolePermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of RolePermissions to fetch.
     */
    orderBy?: RolePermissionOrderByWithRelationInput | RolePermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: RolePermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` RolePermissions 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` RolePermissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned RolePermissions
    **/
    _count?: true | RolePermissionCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: RolePermissionMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: RolePermissionMaxAggregateInputType
  }

  export type GetRolePermissionAggregateType<T extends RolePermissionAggregateArgs> = {
        [P in keyof T & keyof AggregateRolePermission]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateRolePermission[P]>
      : GetScalarType<T[P], AggregateRolePermission[P]>
  }




  export type RolePermissionGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: RolePermissionWhereInput
    orderBy?: RolePermissionOrderByWithAggregationInput | RolePermissionOrderByWithAggregationInput[]
    by: RolePermissionScalarFieldEnum[] | RolePermissionScalarFieldEnum
    having?: RolePermissionScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: RolePermissionCountAggregateInputType | true
    _min?: RolePermissionMinAggregateInputType
    _max?: RolePermissionMaxAggregateInputType
  }

  export type RolePermissionGroupByOutputType = {
    roleId: string
    permissionId: string
    _count: RolePermissionCountAggregateOutputType | null
    _min: RolePermissionMinAggregateOutputType | null
    _max: RolePermissionMaxAggregateOutputType | null
  }

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


  export type RolePermissionSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    roleId?: boolean
    permissionId?: boolean
    role?: boolean | RoleDefaultArgs<ExtArgs>
    permission?: boolean | PermissionDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["rolePermission"]>

  export type RolePermissionSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    roleId?: boolean
    permissionId?: boolean
    role?: boolean | RoleDefaultArgs<ExtArgs>
    permission?: boolean | PermissionDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["rolePermission"]>

  export type RolePermissionSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    roleId?: boolean
    permissionId?: boolean
    role?: boolean | RoleDefaultArgs<ExtArgs>
    permission?: boolean | PermissionDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["rolePermission"]>

  export type RolePermissionSelectScalar = {
    roleId?: boolean
    permissionId?: boolean
  }

  export type RolePermissionOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"roleId" | "permissionId", ExtArgs["result"]["rolePermission"]>
  export type RolePermissionInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    role?: boolean | RoleDefaultArgs<ExtArgs>
    permission?: boolean | PermissionDefaultArgs<ExtArgs>
  }
  export type RolePermissionIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    role?: boolean | RoleDefaultArgs<ExtArgs>
    permission?: boolean | PermissionDefaultArgs<ExtArgs>
  }
  export type RolePermissionIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    role?: boolean | RoleDefaultArgs<ExtArgs>
    permission?: boolean | PermissionDefaultArgs<ExtArgs>
  }

  export type $RolePermissionPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "RolePermission"
    objects: {
      role: Prisma.$RolePayload<ExtArgs>
      permission: Prisma.$PermissionPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      roleId: string
      permissionId: string
    }, ExtArgs["result"]["rolePermission"]>
    composites: {}
  }

  type RolePermissionGetPayload<S extends boolean | null | undefined | RolePermissionDefaultArgs> = $Result.GetResult<Prisma.$RolePermissionPayload, S>

  type RolePermissionCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<RolePermissionFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: RolePermissionCountAggregateInputType | true
    }

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

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

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

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

    /**
     * Find zero or more RolePermissions 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 {RolePermissionFindManyArgs} args - Arguments to filter and select certain fields only.
     * @example
     * // Get all RolePermissions
     * const rolePermissions = await prisma.rolePermission.findMany()
     * 
     * // Get first 10 RolePermissions
     * const rolePermissions = await prisma.rolePermission.findMany({ take: 10 })
     * 
     * // Only select the `roleId`
     * const rolePermissionWithRoleIdOnly = await prisma.rolePermission.findMany({ select: { roleId: true } })
     * 
     */
    findMany<T extends RolePermissionFindManyArgs>(args?: SelectSubset<T, RolePermissionFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

    /**
     * Create a RolePermission.
     * @param {RolePermissionCreateArgs} args - Arguments to create a RolePermission.
     * @example
     * // Create one RolePermission
     * const RolePermission = await prisma.rolePermission.create({
     *   data: {
     *     // ... data to create a RolePermission
     *   }
     * })
     * 
     */
    create<T extends RolePermissionCreateArgs>(args: SelectSubset<T, RolePermissionCreateArgs<ExtArgs>>): Prisma__RolePermissionClient<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many RolePermissions and returns the data saved in the database.
     * @param {RolePermissionCreateManyAndReturnArgs} args - Arguments to create many RolePermissions.
     * @example
     * // Create many RolePermissions
     * const rolePermission = await prisma.rolePermission.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many RolePermissions and only return the `roleId`
     * const rolePermissionWithRoleIdOnly = await prisma.rolePermission.createManyAndReturn({
     *   select: { roleId: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends RolePermissionCreateManyAndReturnArgs>(args?: SelectSubset<T, RolePermissionCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a RolePermission.
     * @param {RolePermissionDeleteArgs} args - Arguments to delete one RolePermission.
     * @example
     * // Delete one RolePermission
     * const RolePermission = await prisma.rolePermission.delete({
     *   where: {
     *     // ... filter to delete one RolePermission
     *   }
     * })
     * 
     */
    delete<T extends RolePermissionDeleteArgs>(args: SelectSubset<T, RolePermissionDeleteArgs<ExtArgs>>): Prisma__RolePermissionClient<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one RolePermission.
     * @param {RolePermissionUpdateArgs} args - Arguments to update one RolePermission.
     * @example
     * // Update one RolePermission
     * const rolePermission = await prisma.rolePermission.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends RolePermissionUpdateArgs>(args: SelectSubset<T, RolePermissionUpdateArgs<ExtArgs>>): Prisma__RolePermissionClient<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more RolePermissions and returns the data updated in the database.
     * @param {RolePermissionUpdateManyAndReturnArgs} args - Arguments to update many RolePermissions.
     * @example
     * // Update many RolePermissions
     * const rolePermission = await prisma.rolePermission.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more RolePermissions and only return the `roleId`
     * const rolePermissionWithRoleIdOnly = await prisma.rolePermission.updateManyAndReturn({
     *   select: { roleId: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends RolePermissionUpdateManyAndReturnArgs>(args: SelectSubset<T, RolePermissionUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$RolePermissionPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a RolePermission.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {RolePermissionAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends RolePermissionAggregateArgs>(args: Subset<T, RolePermissionAggregateArgs>): Prisma.PrismaPromise<GetRolePermissionAggregateType<T>>

    /**
     * Group by RolePermission.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {RolePermissionGroupByArgs} 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 RolePermissionGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: RolePermissionGroupByArgs['orderBy'] }
        : { orderBy?: RolePermissionGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, RolePermissionGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetRolePermissionGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the RolePermission model
   */
  readonly fields: RolePermissionFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for RolePermission.
   * 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__RolePermissionClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    role<T extends RoleDefaultArgs<ExtArgs> = {}>(args?: Subset<T, RoleDefaultArgs<ExtArgs>>): Prisma__RoleClient<$Result.GetResult<Prisma.$RolePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    permission<T extends PermissionDefaultArgs<ExtArgs> = {}>(args?: Subset<T, PermissionDefaultArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the RolePermission model
   */
  interface RolePermissionFieldRefs {
    readonly roleId: FieldRef<"RolePermission", 'String'>
    readonly permissionId: FieldRef<"RolePermission", 'String'>
  }
    

  // Custom InputTypes
  /**
   * RolePermission findUnique
   */
  export type RolePermissionFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * Filter, which RolePermission to fetch.
     */
    where: RolePermissionWhereUniqueInput
  }

  /**
   * RolePermission findUniqueOrThrow
   */
  export type RolePermissionFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * Filter, which RolePermission to fetch.
     */
    where: RolePermissionWhereUniqueInput
  }

  /**
   * RolePermission findFirst
   */
  export type RolePermissionFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * Filter, which RolePermission to fetch.
     */
    where?: RolePermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of RolePermissions to fetch.
     */
    orderBy?: RolePermissionOrderByWithRelationInput | RolePermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for RolePermissions.
     */
    cursor?: RolePermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` RolePermissions 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` RolePermissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of RolePermissions.
     */
    distinct?: RolePermissionScalarFieldEnum | RolePermissionScalarFieldEnum[]
  }

  /**
   * RolePermission findFirstOrThrow
   */
  export type RolePermissionFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * Filter, which RolePermission to fetch.
     */
    where?: RolePermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of RolePermissions to fetch.
     */
    orderBy?: RolePermissionOrderByWithRelationInput | RolePermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for RolePermissions.
     */
    cursor?: RolePermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` RolePermissions 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` RolePermissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of RolePermissions.
     */
    distinct?: RolePermissionScalarFieldEnum | RolePermissionScalarFieldEnum[]
  }

  /**
   * RolePermission findMany
   */
  export type RolePermissionFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * Filter, which RolePermissions to fetch.
     */
    where?: RolePermissionWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of RolePermissions to fetch.
     */
    orderBy?: RolePermissionOrderByWithRelationInput | RolePermissionOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing RolePermissions.
     */
    cursor?: RolePermissionWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` RolePermissions 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` RolePermissions.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of RolePermissions.
     */
    distinct?: RolePermissionScalarFieldEnum | RolePermissionScalarFieldEnum[]
  }

  /**
   * RolePermission create
   */
  export type RolePermissionCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * The data needed to create a RolePermission.
     */
    data: XOR<RolePermissionCreateInput, RolePermissionUncheckedCreateInput>
  }

  /**
   * RolePermission createMany
   */
  export type RolePermissionCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many RolePermissions.
     */
    data: RolePermissionCreateManyInput | RolePermissionCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * RolePermission createManyAndReturn
   */
  export type RolePermissionCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * The data used to create many RolePermissions.
     */
    data: RolePermissionCreateManyInput | RolePermissionCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * RolePermission update
   */
  export type RolePermissionUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * The data needed to update a RolePermission.
     */
    data: XOR<RolePermissionUpdateInput, RolePermissionUncheckedUpdateInput>
    /**
     * Choose, which RolePermission to update.
     */
    where: RolePermissionWhereUniqueInput
  }

  /**
   * RolePermission updateMany
   */
  export type RolePermissionUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update RolePermissions.
     */
    data: XOR<RolePermissionUpdateManyMutationInput, RolePermissionUncheckedUpdateManyInput>
    /**
     * Filter which RolePermissions to update
     */
    where?: RolePermissionWhereInput
    /**
     * Limit how many RolePermissions to update.
     */
    limit?: number
  }

  /**
   * RolePermission updateManyAndReturn
   */
  export type RolePermissionUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * The data used to update RolePermissions.
     */
    data: XOR<RolePermissionUpdateManyMutationInput, RolePermissionUncheckedUpdateManyInput>
    /**
     * Filter which RolePermissions to update
     */
    where?: RolePermissionWhereInput
    /**
     * Limit how many RolePermissions to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * RolePermission upsert
   */
  export type RolePermissionUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * The filter to search for the RolePermission to update in case it exists.
     */
    where: RolePermissionWhereUniqueInput
    /**
     * In case the RolePermission found by the `where` argument doesn't exist, create a new RolePermission with this data.
     */
    create: XOR<RolePermissionCreateInput, RolePermissionUncheckedCreateInput>
    /**
     * In case the RolePermission was found with the provided `where` argument, update it with this data.
     */
    update: XOR<RolePermissionUpdateInput, RolePermissionUncheckedUpdateInput>
  }

  /**
   * RolePermission delete
   */
  export type RolePermissionDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
    /**
     * Filter which RolePermission to delete.
     */
    where: RolePermissionWhereUniqueInput
  }

  /**
   * RolePermission deleteMany
   */
  export type RolePermissionDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which RolePermissions to delete
     */
    where?: RolePermissionWhereInput
    /**
     * Limit how many RolePermissions to delete.
     */
    limit?: number
  }

  /**
   * RolePermission without action
   */
  export type RolePermissionDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the RolePermission
     */
    select?: RolePermissionSelect<ExtArgs> | null
    /**
     * Omit specific fields from the RolePermission
     */
    omit?: RolePermissionOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: RolePermissionInclude<ExtArgs> | null
  }


  /**
   * Model Category
   */

  export type AggregateCategory = {
    _count: CategoryCountAggregateOutputType | null
    _avg: CategoryAvgAggregateOutputType | null
    _sum: CategorySumAggregateOutputType | null
    _min: CategoryMinAggregateOutputType | null
    _max: CategoryMaxAggregateOutputType | null
  }

  export type CategoryAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type CategorySumAggregateOutputType = {
    sortOrder: number | null
  }

  export type CategoryMinAggregateOutputType = {
    id: string | null
    name: string | null
    code: string | null
    description: string | null
    color: string | null
    icon: string | null
    sortOrder: number | null
    isActive: boolean | null
    branchId: string | null
    parentId: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type CategoryMaxAggregateOutputType = {
    id: string | null
    name: string | null
    code: string | null
    description: string | null
    color: string | null
    icon: string | null
    sortOrder: number | null
    isActive: boolean | null
    branchId: string | null
    parentId: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type CategoryCountAggregateOutputType = {
    id: number
    name: number
    code: number
    description: number
    color: number
    icon: number
    sortOrder: number
    isActive: number
    tags: number
    branchId: number
    parentId: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type CategoryAvgAggregateInputType = {
    sortOrder?: true
  }

  export type CategorySumAggregateInputType = {
    sortOrder?: true
  }

  export type CategoryMinAggregateInputType = {
    id?: true
    name?: true
    code?: true
    description?: true
    color?: true
    icon?: true
    sortOrder?: true
    isActive?: true
    branchId?: true
    parentId?: true
    createdAt?: true
    updatedAt?: true
  }

  export type CategoryMaxAggregateInputType = {
    id?: true
    name?: true
    code?: true
    description?: true
    color?: true
    icon?: true
    sortOrder?: true
    isActive?: true
    branchId?: true
    parentId?: true
    createdAt?: true
    updatedAt?: true
  }

  export type CategoryCountAggregateInputType = {
    id?: true
    name?: true
    code?: true
    description?: true
    color?: true
    icon?: true
    sortOrder?: true
    isActive?: true
    tags?: true
    branchId?: true
    parentId?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type CategoryAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Category to aggregate.
     */
    where?: CategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Categories to fetch.
     */
    orderBy?: CategoryOrderByWithRelationInput | CategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: CategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Categories 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` Categories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Categories
    **/
    _count?: true | CategoryCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: CategoryAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: CategorySumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: CategoryMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: CategoryMaxAggregateInputType
  }

  export type GetCategoryAggregateType<T extends CategoryAggregateArgs> = {
        [P in keyof T & keyof AggregateCategory]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateCategory[P]>
      : GetScalarType<T[P], AggregateCategory[P]>
  }




  export type CategoryGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: CategoryWhereInput
    orderBy?: CategoryOrderByWithAggregationInput | CategoryOrderByWithAggregationInput[]
    by: CategoryScalarFieldEnum[] | CategoryScalarFieldEnum
    having?: CategoryScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: CategoryCountAggregateInputType | true
    _avg?: CategoryAvgAggregateInputType
    _sum?: CategorySumAggregateInputType
    _min?: CategoryMinAggregateInputType
    _max?: CategoryMaxAggregateInputType
  }

  export type CategoryGroupByOutputType = {
    id: string
    name: string
    code: string | null
    description: string | null
    color: string | null
    icon: string | null
    sortOrder: number
    isActive: boolean
    tags: JsonValue | null
    branchId: string | null
    parentId: string | null
    createdAt: Date
    updatedAt: Date
    _count: CategoryCountAggregateOutputType | null
    _avg: CategoryAvgAggregateOutputType | null
    _sum: CategorySumAggregateOutputType | null
    _min: CategoryMinAggregateOutputType | null
    _max: CategoryMaxAggregateOutputType | null
  }

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


  export type CategorySelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    code?: boolean
    description?: boolean
    color?: boolean
    icon?: boolean
    sortOrder?: boolean
    isActive?: boolean
    tags?: boolean
    branchId?: boolean
    parentId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Category$branchArgs<ExtArgs>
    parent?: boolean | Category$parentArgs<ExtArgs>
    children?: boolean | Category$childrenArgs<ExtArgs>
    products?: boolean | Category$productsArgs<ExtArgs>
    _count?: boolean | CategoryCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["category"]>

  export type CategorySelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    code?: boolean
    description?: boolean
    color?: boolean
    icon?: boolean
    sortOrder?: boolean
    isActive?: boolean
    tags?: boolean
    branchId?: boolean
    parentId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Category$branchArgs<ExtArgs>
    parent?: boolean | Category$parentArgs<ExtArgs>
  }, ExtArgs["result"]["category"]>

  export type CategorySelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    code?: boolean
    description?: boolean
    color?: boolean
    icon?: boolean
    sortOrder?: boolean
    isActive?: boolean
    tags?: boolean
    branchId?: boolean
    parentId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Category$branchArgs<ExtArgs>
    parent?: boolean | Category$parentArgs<ExtArgs>
  }, ExtArgs["result"]["category"]>

  export type CategorySelectScalar = {
    id?: boolean
    name?: boolean
    code?: boolean
    description?: boolean
    color?: boolean
    icon?: boolean
    sortOrder?: boolean
    isActive?: boolean
    tags?: boolean
    branchId?: boolean
    parentId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type CategoryOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "code" | "description" | "color" | "icon" | "sortOrder" | "isActive" | "tags" | "branchId" | "parentId" | "createdAt" | "updatedAt", ExtArgs["result"]["category"]>
  export type CategoryInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Category$branchArgs<ExtArgs>
    parent?: boolean | Category$parentArgs<ExtArgs>
    children?: boolean | Category$childrenArgs<ExtArgs>
    products?: boolean | Category$productsArgs<ExtArgs>
    _count?: boolean | CategoryCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type CategoryIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Category$branchArgs<ExtArgs>
    parent?: boolean | Category$parentArgs<ExtArgs>
  }
  export type CategoryIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Category$branchArgs<ExtArgs>
    parent?: boolean | Category$parentArgs<ExtArgs>
  }

  export type $CategoryPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Category"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      parent: Prisma.$CategoryPayload<ExtArgs> | null
      children: Prisma.$CategoryPayload<ExtArgs>[]
      products: Prisma.$ProductPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      code: string | null
      description: string | null
      color: string | null
      icon: string | null
      sortOrder: number
      isActive: boolean
      /**
       * Stored as JSON array of strings, e.g. ["bulk","featured"]
       */
      tags: Prisma.JsonValue | null
      branchId: string | null
      parentId: string | null
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["category"]>
    composites: {}
  }

  type CategoryGetPayload<S extends boolean | null | undefined | CategoryDefaultArgs> = $Result.GetResult<Prisma.$CategoryPayload, S>

  type CategoryCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<CategoryFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: CategoryCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Category.
     * @param {CategoryCreateArgs} args - Arguments to create a Category.
     * @example
     * // Create one Category
     * const Category = await prisma.category.create({
     *   data: {
     *     // ... data to create a Category
     *   }
     * })
     * 
     */
    create<T extends CategoryCreateArgs>(args: SelectSubset<T, CategoryCreateArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Categories and returns the data saved in the database.
     * @param {CategoryCreateManyAndReturnArgs} args - Arguments to create many Categories.
     * @example
     * // Create many Categories
     * const category = await prisma.category.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Categories and only return the `id`
     * const categoryWithIdOnly = await prisma.category.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends CategoryCreateManyAndReturnArgs>(args?: SelectSubset<T, CategoryCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Category.
     * @param {CategoryDeleteArgs} args - Arguments to delete one Category.
     * @example
     * // Delete one Category
     * const Category = await prisma.category.delete({
     *   where: {
     *     // ... filter to delete one Category
     *   }
     * })
     * 
     */
    delete<T extends CategoryDeleteArgs>(args: SelectSubset<T, CategoryDeleteArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Category.
     * @param {CategoryUpdateArgs} args - Arguments to update one Category.
     * @example
     * // Update one Category
     * const category = await prisma.category.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends CategoryUpdateArgs>(args: SelectSubset<T, CategoryUpdateArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Categories and returns the data updated in the database.
     * @param {CategoryUpdateManyAndReturnArgs} args - Arguments to update many Categories.
     * @example
     * // Update many Categories
     * const category = await prisma.category.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Categories and only return the `id`
     * const categoryWithIdOnly = await prisma.category.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends CategoryUpdateManyAndReturnArgs>(args: SelectSubset<T, CategoryUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Category.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {CategoryAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends CategoryAggregateArgs>(args: Subset<T, CategoryAggregateArgs>): Prisma.PrismaPromise<GetCategoryAggregateType<T>>

    /**
     * Group by Category.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {CategoryGroupByArgs} 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 CategoryGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: CategoryGroupByArgs['orderBy'] }
        : { orderBy?: CategoryGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, CategoryGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetCategoryGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Category model
   */
  readonly fields: CategoryFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Category.
   * 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__CategoryClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Category$branchArgs<ExtArgs> = {}>(args?: Subset<T, Category$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    parent<T extends Category$parentArgs<ExtArgs> = {}>(args?: Subset<T, Category$parentArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    children<T extends Category$childrenArgs<ExtArgs> = {}>(args?: Subset<T, Category$childrenArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    products<T extends Category$productsArgs<ExtArgs> = {}>(args?: Subset<T, Category$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Category model
   */
  interface CategoryFieldRefs {
    readonly id: FieldRef<"Category", 'String'>
    readonly name: FieldRef<"Category", 'String'>
    readonly code: FieldRef<"Category", 'String'>
    readonly description: FieldRef<"Category", 'String'>
    readonly color: FieldRef<"Category", 'String'>
    readonly icon: FieldRef<"Category", 'String'>
    readonly sortOrder: FieldRef<"Category", 'Int'>
    readonly isActive: FieldRef<"Category", 'Boolean'>
    readonly tags: FieldRef<"Category", 'Json'>
    readonly branchId: FieldRef<"Category", 'String'>
    readonly parentId: FieldRef<"Category", 'String'>
    readonly createdAt: FieldRef<"Category", 'DateTime'>
    readonly updatedAt: FieldRef<"Category", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Category findUnique
   */
  export type CategoryFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * Filter, which Category to fetch.
     */
    where: CategoryWhereUniqueInput
  }

  /**
   * Category findUniqueOrThrow
   */
  export type CategoryFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * Filter, which Category to fetch.
     */
    where: CategoryWhereUniqueInput
  }

  /**
   * Category findFirst
   */
  export type CategoryFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * Filter, which Category to fetch.
     */
    where?: CategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Categories to fetch.
     */
    orderBy?: CategoryOrderByWithRelationInput | CategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Categories.
     */
    cursor?: CategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Categories 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` Categories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Categories.
     */
    distinct?: CategoryScalarFieldEnum | CategoryScalarFieldEnum[]
  }

  /**
   * Category findFirstOrThrow
   */
  export type CategoryFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * Filter, which Category to fetch.
     */
    where?: CategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Categories to fetch.
     */
    orderBy?: CategoryOrderByWithRelationInput | CategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Categories.
     */
    cursor?: CategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Categories 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` Categories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Categories.
     */
    distinct?: CategoryScalarFieldEnum | CategoryScalarFieldEnum[]
  }

  /**
   * Category findMany
   */
  export type CategoryFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * Filter, which Categories to fetch.
     */
    where?: CategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Categories to fetch.
     */
    orderBy?: CategoryOrderByWithRelationInput | CategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Categories.
     */
    cursor?: CategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Categories 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` Categories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Categories.
     */
    distinct?: CategoryScalarFieldEnum | CategoryScalarFieldEnum[]
  }

  /**
   * Category create
   */
  export type CategoryCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * The data needed to create a Category.
     */
    data: XOR<CategoryCreateInput, CategoryUncheckedCreateInput>
  }

  /**
   * Category createMany
   */
  export type CategoryCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Categories.
     */
    data: CategoryCreateManyInput | CategoryCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Category createManyAndReturn
   */
  export type CategoryCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * The data used to create many Categories.
     */
    data: CategoryCreateManyInput | CategoryCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Category update
   */
  export type CategoryUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * The data needed to update a Category.
     */
    data: XOR<CategoryUpdateInput, CategoryUncheckedUpdateInput>
    /**
     * Choose, which Category to update.
     */
    where: CategoryWhereUniqueInput
  }

  /**
   * Category updateMany
   */
  export type CategoryUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Categories.
     */
    data: XOR<CategoryUpdateManyMutationInput, CategoryUncheckedUpdateManyInput>
    /**
     * Filter which Categories to update
     */
    where?: CategoryWhereInput
    /**
     * Limit how many Categories to update.
     */
    limit?: number
  }

  /**
   * Category updateManyAndReturn
   */
  export type CategoryUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * The data used to update Categories.
     */
    data: XOR<CategoryUpdateManyMutationInput, CategoryUncheckedUpdateManyInput>
    /**
     * Filter which Categories to update
     */
    where?: CategoryWhereInput
    /**
     * Limit how many Categories to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Category upsert
   */
  export type CategoryUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * The filter to search for the Category to update in case it exists.
     */
    where: CategoryWhereUniqueInput
    /**
     * In case the Category found by the `where` argument doesn't exist, create a new Category with this data.
     */
    create: XOR<CategoryCreateInput, CategoryUncheckedCreateInput>
    /**
     * In case the Category was found with the provided `where` argument, update it with this data.
     */
    update: XOR<CategoryUpdateInput, CategoryUncheckedUpdateInput>
  }

  /**
   * Category delete
   */
  export type CategoryDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    /**
     * Filter which Category to delete.
     */
    where: CategoryWhereUniqueInput
  }

  /**
   * Category deleteMany
   */
  export type CategoryDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Categories to delete
     */
    where?: CategoryWhereInput
    /**
     * Limit how many Categories to delete.
     */
    limit?: number
  }

  /**
   * Category.branch
   */
  export type Category$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Category.parent
   */
  export type Category$parentArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    where?: CategoryWhereInput
  }

  /**
   * Category.children
   */
  export type Category$childrenArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    where?: CategoryWhereInput
    orderBy?: CategoryOrderByWithRelationInput | CategoryOrderByWithRelationInput[]
    cursor?: CategoryWhereUniqueInput
    take?: number
    skip?: number
    distinct?: CategoryScalarFieldEnum | CategoryScalarFieldEnum[]
  }

  /**
   * Category.products
   */
  export type Category$productsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Category without action
   */
  export type CategoryDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
  }


  /**
   * Model Variation
   */

  export type AggregateVariation = {
    _count: VariationCountAggregateOutputType | null
    _avg: VariationAvgAggregateOutputType | null
    _sum: VariationSumAggregateOutputType | null
    _min: VariationMinAggregateOutputType | null
    _max: VariationMaxAggregateOutputType | null
  }

  export type VariationAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type VariationSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type VariationMinAggregateOutputType = {
    id: string | null
    name: string | null
    sortOrder: number | null
    isActive: boolean | null
    branchId: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type VariationMaxAggregateOutputType = {
    id: string | null
    name: string | null
    sortOrder: number | null
    isActive: boolean | null
    branchId: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type VariationCountAggregateOutputType = {
    id: number
    name: number
    options: number
    sortOrder: number
    isActive: number
    branchId: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type VariationAvgAggregateInputType = {
    sortOrder?: true
  }

  export type VariationSumAggregateInputType = {
    sortOrder?: true
  }

  export type VariationMinAggregateInputType = {
    id?: true
    name?: true
    sortOrder?: true
    isActive?: true
    branchId?: true
    createdAt?: true
    updatedAt?: true
  }

  export type VariationMaxAggregateInputType = {
    id?: true
    name?: true
    sortOrder?: true
    isActive?: true
    branchId?: true
    createdAt?: true
    updatedAt?: true
  }

  export type VariationCountAggregateInputType = {
    id?: true
    name?: true
    options?: true
    sortOrder?: true
    isActive?: true
    branchId?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type VariationAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Variation to aggregate.
     */
    where?: VariationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Variations to fetch.
     */
    orderBy?: VariationOrderByWithRelationInput | VariationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: VariationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Variations 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` Variations.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Variations
    **/
    _count?: true | VariationCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: VariationAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: VariationSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: VariationMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: VariationMaxAggregateInputType
  }

  export type GetVariationAggregateType<T extends VariationAggregateArgs> = {
        [P in keyof T & keyof AggregateVariation]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateVariation[P]>
      : GetScalarType<T[P], AggregateVariation[P]>
  }




  export type VariationGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: VariationWhereInput
    orderBy?: VariationOrderByWithAggregationInput | VariationOrderByWithAggregationInput[]
    by: VariationScalarFieldEnum[] | VariationScalarFieldEnum
    having?: VariationScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: VariationCountAggregateInputType | true
    _avg?: VariationAvgAggregateInputType
    _sum?: VariationSumAggregateInputType
    _min?: VariationMinAggregateInputType
    _max?: VariationMaxAggregateInputType
  }

  export type VariationGroupByOutputType = {
    id: string
    name: string
    options: JsonValue | null
    sortOrder: number
    isActive: boolean
    branchId: string | null
    createdAt: Date
    updatedAt: Date
    _count: VariationCountAggregateOutputType | null
    _avg: VariationAvgAggregateOutputType | null
    _sum: VariationSumAggregateOutputType | null
    _min: VariationMinAggregateOutputType | null
    _max: VariationMaxAggregateOutputType | null
  }

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


  export type VariationSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    options?: boolean
    sortOrder?: boolean
    isActive?: boolean
    branchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Variation$branchArgs<ExtArgs>
  }, ExtArgs["result"]["variation"]>

  export type VariationSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    options?: boolean
    sortOrder?: boolean
    isActive?: boolean
    branchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Variation$branchArgs<ExtArgs>
  }, ExtArgs["result"]["variation"]>

  export type VariationSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    options?: boolean
    sortOrder?: boolean
    isActive?: boolean
    branchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Variation$branchArgs<ExtArgs>
  }, ExtArgs["result"]["variation"]>

  export type VariationSelectScalar = {
    id?: boolean
    name?: boolean
    options?: boolean
    sortOrder?: boolean
    isActive?: boolean
    branchId?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type VariationOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "options" | "sortOrder" | "isActive" | "branchId" | "createdAt" | "updatedAt", ExtArgs["result"]["variation"]>
  export type VariationInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Variation$branchArgs<ExtArgs>
  }
  export type VariationIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Variation$branchArgs<ExtArgs>
  }
  export type VariationIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Variation$branchArgs<ExtArgs>
  }

  export type $VariationPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Variation"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      /**
       * JSON array of strings, e.g. ["S","M","L","XL"]
       */
      options: Prisma.JsonValue | null
      sortOrder: number
      isActive: boolean
      branchId: string | null
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["variation"]>
    composites: {}
  }

  type VariationGetPayload<S extends boolean | null | undefined | VariationDefaultArgs> = $Result.GetResult<Prisma.$VariationPayload, S>

  type VariationCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<VariationFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: VariationCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Variation.
     * @param {VariationCreateArgs} args - Arguments to create a Variation.
     * @example
     * // Create one Variation
     * const Variation = await prisma.variation.create({
     *   data: {
     *     // ... data to create a Variation
     *   }
     * })
     * 
     */
    create<T extends VariationCreateArgs>(args: SelectSubset<T, VariationCreateArgs<ExtArgs>>): Prisma__VariationClient<$Result.GetResult<Prisma.$VariationPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Variations and returns the data saved in the database.
     * @param {VariationCreateManyAndReturnArgs} args - Arguments to create many Variations.
     * @example
     * // Create many Variations
     * const variation = await prisma.variation.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Variations and only return the `id`
     * const variationWithIdOnly = await prisma.variation.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends VariationCreateManyAndReturnArgs>(args?: SelectSubset<T, VariationCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$VariationPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Variation.
     * @param {VariationDeleteArgs} args - Arguments to delete one Variation.
     * @example
     * // Delete one Variation
     * const Variation = await prisma.variation.delete({
     *   where: {
     *     // ... filter to delete one Variation
     *   }
     * })
     * 
     */
    delete<T extends VariationDeleteArgs>(args: SelectSubset<T, VariationDeleteArgs<ExtArgs>>): Prisma__VariationClient<$Result.GetResult<Prisma.$VariationPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Variation.
     * @param {VariationUpdateArgs} args - Arguments to update one Variation.
     * @example
     * // Update one Variation
     * const variation = await prisma.variation.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends VariationUpdateArgs>(args: SelectSubset<T, VariationUpdateArgs<ExtArgs>>): Prisma__VariationClient<$Result.GetResult<Prisma.$VariationPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Variations and returns the data updated in the database.
     * @param {VariationUpdateManyAndReturnArgs} args - Arguments to update many Variations.
     * @example
     * // Update many Variations
     * const variation = await prisma.variation.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Variations and only return the `id`
     * const variationWithIdOnly = await prisma.variation.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends VariationUpdateManyAndReturnArgs>(args: SelectSubset<T, VariationUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$VariationPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Variation.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {VariationAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends VariationAggregateArgs>(args: Subset<T, VariationAggregateArgs>): Prisma.PrismaPromise<GetVariationAggregateType<T>>

    /**
     * Group by Variation.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {VariationGroupByArgs} 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 VariationGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: VariationGroupByArgs['orderBy'] }
        : { orderBy?: VariationGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, VariationGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetVariationGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Variation model
   */
  readonly fields: VariationFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Variation.
   * 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__VariationClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Variation$branchArgs<ExtArgs> = {}>(args?: Subset<T, Variation$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Variation model
   */
  interface VariationFieldRefs {
    readonly id: FieldRef<"Variation", 'String'>
    readonly name: FieldRef<"Variation", 'String'>
    readonly options: FieldRef<"Variation", 'Json'>
    readonly sortOrder: FieldRef<"Variation", 'Int'>
    readonly isActive: FieldRef<"Variation", 'Boolean'>
    readonly branchId: FieldRef<"Variation", 'String'>
    readonly createdAt: FieldRef<"Variation", 'DateTime'>
    readonly updatedAt: FieldRef<"Variation", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Variation findUnique
   */
  export type VariationFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * Filter, which Variation to fetch.
     */
    where: VariationWhereUniqueInput
  }

  /**
   * Variation findUniqueOrThrow
   */
  export type VariationFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * Filter, which Variation to fetch.
     */
    where: VariationWhereUniqueInput
  }

  /**
   * Variation findFirst
   */
  export type VariationFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * Filter, which Variation to fetch.
     */
    where?: VariationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Variations to fetch.
     */
    orderBy?: VariationOrderByWithRelationInput | VariationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Variations.
     */
    cursor?: VariationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Variations 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` Variations.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Variations.
     */
    distinct?: VariationScalarFieldEnum | VariationScalarFieldEnum[]
  }

  /**
   * Variation findFirstOrThrow
   */
  export type VariationFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * Filter, which Variation to fetch.
     */
    where?: VariationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Variations to fetch.
     */
    orderBy?: VariationOrderByWithRelationInput | VariationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Variations.
     */
    cursor?: VariationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Variations 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` Variations.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Variations.
     */
    distinct?: VariationScalarFieldEnum | VariationScalarFieldEnum[]
  }

  /**
   * Variation findMany
   */
  export type VariationFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * Filter, which Variations to fetch.
     */
    where?: VariationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Variations to fetch.
     */
    orderBy?: VariationOrderByWithRelationInput | VariationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Variations.
     */
    cursor?: VariationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Variations 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` Variations.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Variations.
     */
    distinct?: VariationScalarFieldEnum | VariationScalarFieldEnum[]
  }

  /**
   * Variation create
   */
  export type VariationCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * The data needed to create a Variation.
     */
    data: XOR<VariationCreateInput, VariationUncheckedCreateInput>
  }

  /**
   * Variation createMany
   */
  export type VariationCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Variations.
     */
    data: VariationCreateManyInput | VariationCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Variation createManyAndReturn
   */
  export type VariationCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * The data used to create many Variations.
     */
    data: VariationCreateManyInput | VariationCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Variation update
   */
  export type VariationUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * The data needed to update a Variation.
     */
    data: XOR<VariationUpdateInput, VariationUncheckedUpdateInput>
    /**
     * Choose, which Variation to update.
     */
    where: VariationWhereUniqueInput
  }

  /**
   * Variation updateMany
   */
  export type VariationUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Variations.
     */
    data: XOR<VariationUpdateManyMutationInput, VariationUncheckedUpdateManyInput>
    /**
     * Filter which Variations to update
     */
    where?: VariationWhereInput
    /**
     * Limit how many Variations to update.
     */
    limit?: number
  }

  /**
   * Variation updateManyAndReturn
   */
  export type VariationUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * The data used to update Variations.
     */
    data: XOR<VariationUpdateManyMutationInput, VariationUncheckedUpdateManyInput>
    /**
     * Filter which Variations to update
     */
    where?: VariationWhereInput
    /**
     * Limit how many Variations to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Variation upsert
   */
  export type VariationUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * The filter to search for the Variation to update in case it exists.
     */
    where: VariationWhereUniqueInput
    /**
     * In case the Variation found by the `where` argument doesn't exist, create a new Variation with this data.
     */
    create: XOR<VariationCreateInput, VariationUncheckedCreateInput>
    /**
     * In case the Variation was found with the provided `where` argument, update it with this data.
     */
    update: XOR<VariationUpdateInput, VariationUncheckedUpdateInput>
  }

  /**
   * Variation delete
   */
  export type VariationDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
    /**
     * Filter which Variation to delete.
     */
    where: VariationWhereUniqueInput
  }

  /**
   * Variation deleteMany
   */
  export type VariationDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Variations to delete
     */
    where?: VariationWhereInput
    /**
     * Limit how many Variations to delete.
     */
    limit?: number
  }

  /**
   * Variation.branch
   */
  export type Variation$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Variation without action
   */
  export type VariationDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Variation
     */
    select?: VariationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Variation
     */
    omit?: VariationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: VariationInclude<ExtArgs> | null
  }


  /**
   * Model Brand
   */

  export type AggregateBrand = {
    _count: BrandCountAggregateOutputType | null
    _avg: BrandAvgAggregateOutputType | null
    _sum: BrandSumAggregateOutputType | null
    _min: BrandMinAggregateOutputType | null
    _max: BrandMaxAggregateOutputType | null
  }

  export type BrandAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type BrandSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type BrandMinAggregateOutputType = {
    id: string | null
    name: string | null
    logo: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type BrandMaxAggregateOutputType = {
    id: string | null
    name: string | null
    logo: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type BrandCountAggregateOutputType = {
    id: number
    name: number
    logo: number
    branchId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type BrandAvgAggregateInputType = {
    sortOrder?: true
  }

  export type BrandSumAggregateInputType = {
    sortOrder?: true
  }

  export type BrandMinAggregateInputType = {
    id?: true
    name?: true
    logo?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type BrandMaxAggregateInputType = {
    id?: true
    name?: true
    logo?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type BrandCountAggregateInputType = {
    id?: true
    name?: true
    logo?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type BrandAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Brand to aggregate.
     */
    where?: BrandWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Brands to fetch.
     */
    orderBy?: BrandOrderByWithRelationInput | BrandOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: BrandWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Brands 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` Brands.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Brands
    **/
    _count?: true | BrandCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: BrandAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: BrandSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: BrandMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: BrandMaxAggregateInputType
  }

  export type GetBrandAggregateType<T extends BrandAggregateArgs> = {
        [P in keyof T & keyof AggregateBrand]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateBrand[P]>
      : GetScalarType<T[P], AggregateBrand[P]>
  }




  export type BrandGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: BrandWhereInput
    orderBy?: BrandOrderByWithAggregationInput | BrandOrderByWithAggregationInput[]
    by: BrandScalarFieldEnum[] | BrandScalarFieldEnum
    having?: BrandScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: BrandCountAggregateInputType | true
    _avg?: BrandAvgAggregateInputType
    _sum?: BrandSumAggregateInputType
    _min?: BrandMinAggregateInputType
    _max?: BrandMaxAggregateInputType
  }

  export type BrandGroupByOutputType = {
    id: string
    name: string
    logo: string | null
    branchId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: BrandCountAggregateOutputType | null
    _avg: BrandAvgAggregateOutputType | null
    _sum: BrandSumAggregateOutputType | null
    _min: BrandMinAggregateOutputType | null
    _max: BrandMaxAggregateOutputType | null
  }

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


  export type BrandSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    logo?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Brand$branchArgs<ExtArgs>
    products?: boolean | Brand$productsArgs<ExtArgs>
    _count?: boolean | BrandCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["brand"]>

  export type BrandSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    logo?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Brand$branchArgs<ExtArgs>
  }, ExtArgs["result"]["brand"]>

  export type BrandSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    logo?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Brand$branchArgs<ExtArgs>
  }, ExtArgs["result"]["brand"]>

  export type BrandSelectScalar = {
    id?: boolean
    name?: boolean
    logo?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type BrandOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "logo" | "branchId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["brand"]>
  export type BrandInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Brand$branchArgs<ExtArgs>
    products?: boolean | Brand$productsArgs<ExtArgs>
    _count?: boolean | BrandCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type BrandIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Brand$branchArgs<ExtArgs>
  }
  export type BrandIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Brand$branchArgs<ExtArgs>
  }

  export type $BrandPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Brand"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      products: Prisma.$ProductPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      /**
       * Image URL or data URL (base64) for brand logo
       */
      logo: string | null
      branchId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["brand"]>
    composites: {}
  }

  type BrandGetPayload<S extends boolean | null | undefined | BrandDefaultArgs> = $Result.GetResult<Prisma.$BrandPayload, S>

  type BrandCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<BrandFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: BrandCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Brand.
     * @param {BrandCreateArgs} args - Arguments to create a Brand.
     * @example
     * // Create one Brand
     * const Brand = await prisma.brand.create({
     *   data: {
     *     // ... data to create a Brand
     *   }
     * })
     * 
     */
    create<T extends BrandCreateArgs>(args: SelectSubset<T, BrandCreateArgs<ExtArgs>>): Prisma__BrandClient<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Brands and returns the data saved in the database.
     * @param {BrandCreateManyAndReturnArgs} args - Arguments to create many Brands.
     * @example
     * // Create many Brands
     * const brand = await prisma.brand.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Brands and only return the `id`
     * const brandWithIdOnly = await prisma.brand.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends BrandCreateManyAndReturnArgs>(args?: SelectSubset<T, BrandCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Brand.
     * @param {BrandDeleteArgs} args - Arguments to delete one Brand.
     * @example
     * // Delete one Brand
     * const Brand = await prisma.brand.delete({
     *   where: {
     *     // ... filter to delete one Brand
     *   }
     * })
     * 
     */
    delete<T extends BrandDeleteArgs>(args: SelectSubset<T, BrandDeleteArgs<ExtArgs>>): Prisma__BrandClient<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Brand.
     * @param {BrandUpdateArgs} args - Arguments to update one Brand.
     * @example
     * // Update one Brand
     * const brand = await prisma.brand.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends BrandUpdateArgs>(args: SelectSubset<T, BrandUpdateArgs<ExtArgs>>): Prisma__BrandClient<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Brands and returns the data updated in the database.
     * @param {BrandUpdateManyAndReturnArgs} args - Arguments to update many Brands.
     * @example
     * // Update many Brands
     * const brand = await prisma.brand.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Brands and only return the `id`
     * const brandWithIdOnly = await prisma.brand.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends BrandUpdateManyAndReturnArgs>(args: SelectSubset<T, BrandUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Brand.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {BrandAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends BrandAggregateArgs>(args: Subset<T, BrandAggregateArgs>): Prisma.PrismaPromise<GetBrandAggregateType<T>>

    /**
     * Group by Brand.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {BrandGroupByArgs} 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 BrandGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: BrandGroupByArgs['orderBy'] }
        : { orderBy?: BrandGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, BrandGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetBrandGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Brand model
   */
  readonly fields: BrandFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Brand.
   * 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__BrandClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Brand$branchArgs<ExtArgs> = {}>(args?: Subset<T, Brand$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    products<T extends Brand$productsArgs<ExtArgs> = {}>(args?: Subset<T, Brand$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Brand model
   */
  interface BrandFieldRefs {
    readonly id: FieldRef<"Brand", 'String'>
    readonly name: FieldRef<"Brand", 'String'>
    readonly logo: FieldRef<"Brand", 'String'>
    readonly branchId: FieldRef<"Brand", 'String'>
    readonly sortOrder: FieldRef<"Brand", 'Int'>
    readonly isActive: FieldRef<"Brand", 'Boolean'>
    readonly createdAt: FieldRef<"Brand", 'DateTime'>
    readonly updatedAt: FieldRef<"Brand", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Brand findUnique
   */
  export type BrandFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * Filter, which Brand to fetch.
     */
    where: BrandWhereUniqueInput
  }

  /**
   * Brand findUniqueOrThrow
   */
  export type BrandFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * Filter, which Brand to fetch.
     */
    where: BrandWhereUniqueInput
  }

  /**
   * Brand findFirst
   */
  export type BrandFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * Filter, which Brand to fetch.
     */
    where?: BrandWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Brands to fetch.
     */
    orderBy?: BrandOrderByWithRelationInput | BrandOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Brands.
     */
    cursor?: BrandWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Brands 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` Brands.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Brands.
     */
    distinct?: BrandScalarFieldEnum | BrandScalarFieldEnum[]
  }

  /**
   * Brand findFirstOrThrow
   */
  export type BrandFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * Filter, which Brand to fetch.
     */
    where?: BrandWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Brands to fetch.
     */
    orderBy?: BrandOrderByWithRelationInput | BrandOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Brands.
     */
    cursor?: BrandWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Brands 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` Brands.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Brands.
     */
    distinct?: BrandScalarFieldEnum | BrandScalarFieldEnum[]
  }

  /**
   * Brand findMany
   */
  export type BrandFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * Filter, which Brands to fetch.
     */
    where?: BrandWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Brands to fetch.
     */
    orderBy?: BrandOrderByWithRelationInput | BrandOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Brands.
     */
    cursor?: BrandWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Brands 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` Brands.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Brands.
     */
    distinct?: BrandScalarFieldEnum | BrandScalarFieldEnum[]
  }

  /**
   * Brand create
   */
  export type BrandCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * The data needed to create a Brand.
     */
    data: XOR<BrandCreateInput, BrandUncheckedCreateInput>
  }

  /**
   * Brand createMany
   */
  export type BrandCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Brands.
     */
    data: BrandCreateManyInput | BrandCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Brand createManyAndReturn
   */
  export type BrandCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * The data used to create many Brands.
     */
    data: BrandCreateManyInput | BrandCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Brand update
   */
  export type BrandUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * The data needed to update a Brand.
     */
    data: XOR<BrandUpdateInput, BrandUncheckedUpdateInput>
    /**
     * Choose, which Brand to update.
     */
    where: BrandWhereUniqueInput
  }

  /**
   * Brand updateMany
   */
  export type BrandUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Brands.
     */
    data: XOR<BrandUpdateManyMutationInput, BrandUncheckedUpdateManyInput>
    /**
     * Filter which Brands to update
     */
    where?: BrandWhereInput
    /**
     * Limit how many Brands to update.
     */
    limit?: number
  }

  /**
   * Brand updateManyAndReturn
   */
  export type BrandUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * The data used to update Brands.
     */
    data: XOR<BrandUpdateManyMutationInput, BrandUncheckedUpdateManyInput>
    /**
     * Filter which Brands to update
     */
    where?: BrandWhereInput
    /**
     * Limit how many Brands to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Brand upsert
   */
  export type BrandUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * The filter to search for the Brand to update in case it exists.
     */
    where: BrandWhereUniqueInput
    /**
     * In case the Brand found by the `where` argument doesn't exist, create a new Brand with this data.
     */
    create: XOR<BrandCreateInput, BrandUncheckedCreateInput>
    /**
     * In case the Brand was found with the provided `where` argument, update it with this data.
     */
    update: XOR<BrandUpdateInput, BrandUncheckedUpdateInput>
  }

  /**
   * Brand delete
   */
  export type BrandDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    /**
     * Filter which Brand to delete.
     */
    where: BrandWhereUniqueInput
  }

  /**
   * Brand deleteMany
   */
  export type BrandDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Brands to delete
     */
    where?: BrandWhereInput
    /**
     * Limit how many Brands to delete.
     */
    limit?: number
  }

  /**
   * Brand.branch
   */
  export type Brand$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Brand.products
   */
  export type Brand$productsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Brand without action
   */
  export type BrandDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
  }


  /**
   * Model Unit
   */

  export type AggregateUnit = {
    _count: UnitCountAggregateOutputType | null
    _avg: UnitAvgAggregateOutputType | null
    _sum: UnitSumAggregateOutputType | null
    _min: UnitMinAggregateOutputType | null
    _max: UnitMaxAggregateOutputType | null
  }

  export type UnitAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type UnitSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type UnitMinAggregateOutputType = {
    id: string | null
    name: string | null
    symbol: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type UnitMaxAggregateOutputType = {
    id: string | null
    name: string | null
    symbol: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type UnitCountAggregateOutputType = {
    id: number
    name: number
    symbol: number
    branchId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type UnitAvgAggregateInputType = {
    sortOrder?: true
  }

  export type UnitSumAggregateInputType = {
    sortOrder?: true
  }

  export type UnitMinAggregateInputType = {
    id?: true
    name?: true
    symbol?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type UnitMaxAggregateInputType = {
    id?: true
    name?: true
    symbol?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type UnitCountAggregateInputType = {
    id?: true
    name?: true
    symbol?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type UnitAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Unit to aggregate.
     */
    where?: UnitWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Units to fetch.
     */
    orderBy?: UnitOrderByWithRelationInput | UnitOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: UnitWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Units 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` Units.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Units
    **/
    _count?: true | UnitCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: UnitAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: UnitSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: UnitMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: UnitMaxAggregateInputType
  }

  export type GetUnitAggregateType<T extends UnitAggregateArgs> = {
        [P in keyof T & keyof AggregateUnit]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateUnit[P]>
      : GetScalarType<T[P], AggregateUnit[P]>
  }




  export type UnitGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: UnitWhereInput
    orderBy?: UnitOrderByWithAggregationInput | UnitOrderByWithAggregationInput[]
    by: UnitScalarFieldEnum[] | UnitScalarFieldEnum
    having?: UnitScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: UnitCountAggregateInputType | true
    _avg?: UnitAvgAggregateInputType
    _sum?: UnitSumAggregateInputType
    _min?: UnitMinAggregateInputType
    _max?: UnitMaxAggregateInputType
  }

  export type UnitGroupByOutputType = {
    id: string
    name: string
    symbol: string | null
    branchId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: UnitCountAggregateOutputType | null
    _avg: UnitAvgAggregateOutputType | null
    _sum: UnitSumAggregateOutputType | null
    _min: UnitMinAggregateOutputType | null
    _max: UnitMaxAggregateOutputType | null
  }

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


  export type UnitSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    symbol?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Unit$branchArgs<ExtArgs>
    products?: boolean | Unit$productsArgs<ExtArgs>
    _count?: boolean | UnitCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["unit"]>

  export type UnitSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    symbol?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Unit$branchArgs<ExtArgs>
  }, ExtArgs["result"]["unit"]>

  export type UnitSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    symbol?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Unit$branchArgs<ExtArgs>
  }, ExtArgs["result"]["unit"]>

  export type UnitSelectScalar = {
    id?: boolean
    name?: boolean
    symbol?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type UnitOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "symbol" | "branchId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["unit"]>
  export type UnitInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Unit$branchArgs<ExtArgs>
    products?: boolean | Unit$productsArgs<ExtArgs>
    _count?: boolean | UnitCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type UnitIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Unit$branchArgs<ExtArgs>
  }
  export type UnitIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Unit$branchArgs<ExtArgs>
  }

  export type $UnitPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Unit"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      products: Prisma.$ProductPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      symbol: string | null
      branchId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["unit"]>
    composites: {}
  }

  type UnitGetPayload<S extends boolean | null | undefined | UnitDefaultArgs> = $Result.GetResult<Prisma.$UnitPayload, S>

  type UnitCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<UnitFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: UnitCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Unit.
     * @param {UnitCreateArgs} args - Arguments to create a Unit.
     * @example
     * // Create one Unit
     * const Unit = await prisma.unit.create({
     *   data: {
     *     // ... data to create a Unit
     *   }
     * })
     * 
     */
    create<T extends UnitCreateArgs>(args: SelectSubset<T, UnitCreateArgs<ExtArgs>>): Prisma__UnitClient<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Units and returns the data saved in the database.
     * @param {UnitCreateManyAndReturnArgs} args - Arguments to create many Units.
     * @example
     * // Create many Units
     * const unit = await prisma.unit.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Units and only return the `id`
     * const unitWithIdOnly = await prisma.unit.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends UnitCreateManyAndReturnArgs>(args?: SelectSubset<T, UnitCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Unit.
     * @param {UnitDeleteArgs} args - Arguments to delete one Unit.
     * @example
     * // Delete one Unit
     * const Unit = await prisma.unit.delete({
     *   where: {
     *     // ... filter to delete one Unit
     *   }
     * })
     * 
     */
    delete<T extends UnitDeleteArgs>(args: SelectSubset<T, UnitDeleteArgs<ExtArgs>>): Prisma__UnitClient<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Unit.
     * @param {UnitUpdateArgs} args - Arguments to update one Unit.
     * @example
     * // Update one Unit
     * const unit = await prisma.unit.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends UnitUpdateArgs>(args: SelectSubset<T, UnitUpdateArgs<ExtArgs>>): Prisma__UnitClient<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Units and returns the data updated in the database.
     * @param {UnitUpdateManyAndReturnArgs} args - Arguments to update many Units.
     * @example
     * // Update many Units
     * const unit = await prisma.unit.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Units and only return the `id`
     * const unitWithIdOnly = await prisma.unit.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends UnitUpdateManyAndReturnArgs>(args: SelectSubset<T, UnitUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Unit.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UnitAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends UnitAggregateArgs>(args: Subset<T, UnitAggregateArgs>): Prisma.PrismaPromise<GetUnitAggregateType<T>>

    /**
     * Group by Unit.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {UnitGroupByArgs} 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 UnitGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: UnitGroupByArgs['orderBy'] }
        : { orderBy?: UnitGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, UnitGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUnitGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Unit model
   */
  readonly fields: UnitFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Unit.
   * 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__UnitClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Unit$branchArgs<ExtArgs> = {}>(args?: Subset<T, Unit$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    products<T extends Unit$productsArgs<ExtArgs> = {}>(args?: Subset<T, Unit$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Unit model
   */
  interface UnitFieldRefs {
    readonly id: FieldRef<"Unit", 'String'>
    readonly name: FieldRef<"Unit", 'String'>
    readonly symbol: FieldRef<"Unit", 'String'>
    readonly branchId: FieldRef<"Unit", 'String'>
    readonly sortOrder: FieldRef<"Unit", 'Int'>
    readonly isActive: FieldRef<"Unit", 'Boolean'>
    readonly createdAt: FieldRef<"Unit", 'DateTime'>
    readonly updatedAt: FieldRef<"Unit", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Unit findUnique
   */
  export type UnitFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * Filter, which Unit to fetch.
     */
    where: UnitWhereUniqueInput
  }

  /**
   * Unit findUniqueOrThrow
   */
  export type UnitFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * Filter, which Unit to fetch.
     */
    where: UnitWhereUniqueInput
  }

  /**
   * Unit findFirst
   */
  export type UnitFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * Filter, which Unit to fetch.
     */
    where?: UnitWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Units to fetch.
     */
    orderBy?: UnitOrderByWithRelationInput | UnitOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Units.
     */
    cursor?: UnitWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Units 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` Units.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Units.
     */
    distinct?: UnitScalarFieldEnum | UnitScalarFieldEnum[]
  }

  /**
   * Unit findFirstOrThrow
   */
  export type UnitFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * Filter, which Unit to fetch.
     */
    where?: UnitWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Units to fetch.
     */
    orderBy?: UnitOrderByWithRelationInput | UnitOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Units.
     */
    cursor?: UnitWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Units 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` Units.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Units.
     */
    distinct?: UnitScalarFieldEnum | UnitScalarFieldEnum[]
  }

  /**
   * Unit findMany
   */
  export type UnitFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * Filter, which Units to fetch.
     */
    where?: UnitWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Units to fetch.
     */
    orderBy?: UnitOrderByWithRelationInput | UnitOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Units.
     */
    cursor?: UnitWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Units 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` Units.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Units.
     */
    distinct?: UnitScalarFieldEnum | UnitScalarFieldEnum[]
  }

  /**
   * Unit create
   */
  export type UnitCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * The data needed to create a Unit.
     */
    data: XOR<UnitCreateInput, UnitUncheckedCreateInput>
  }

  /**
   * Unit createMany
   */
  export type UnitCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Units.
     */
    data: UnitCreateManyInput | UnitCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Unit createManyAndReturn
   */
  export type UnitCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * The data used to create many Units.
     */
    data: UnitCreateManyInput | UnitCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Unit update
   */
  export type UnitUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * The data needed to update a Unit.
     */
    data: XOR<UnitUpdateInput, UnitUncheckedUpdateInput>
    /**
     * Choose, which Unit to update.
     */
    where: UnitWhereUniqueInput
  }

  /**
   * Unit updateMany
   */
  export type UnitUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Units.
     */
    data: XOR<UnitUpdateManyMutationInput, UnitUncheckedUpdateManyInput>
    /**
     * Filter which Units to update
     */
    where?: UnitWhereInput
    /**
     * Limit how many Units to update.
     */
    limit?: number
  }

  /**
   * Unit updateManyAndReturn
   */
  export type UnitUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * The data used to update Units.
     */
    data: XOR<UnitUpdateManyMutationInput, UnitUncheckedUpdateManyInput>
    /**
     * Filter which Units to update
     */
    where?: UnitWhereInput
    /**
     * Limit how many Units to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Unit upsert
   */
  export type UnitUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * The filter to search for the Unit to update in case it exists.
     */
    where: UnitWhereUniqueInput
    /**
     * In case the Unit found by the `where` argument doesn't exist, create a new Unit with this data.
     */
    create: XOR<UnitCreateInput, UnitUncheckedCreateInput>
    /**
     * In case the Unit was found with the provided `where` argument, update it with this data.
     */
    update: XOR<UnitUpdateInput, UnitUncheckedUpdateInput>
  }

  /**
   * Unit delete
   */
  export type UnitDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    /**
     * Filter which Unit to delete.
     */
    where: UnitWhereUniqueInput
  }

  /**
   * Unit deleteMany
   */
  export type UnitDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Units to delete
     */
    where?: UnitWhereInput
    /**
     * Limit how many Units to delete.
     */
    limit?: number
  }

  /**
   * Unit.branch
   */
  export type Unit$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Unit.products
   */
  export type Unit$productsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Unit without action
   */
  export type UnitDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
  }


  /**
   * Model Warehouse
   */

  export type AggregateWarehouse = {
    _count: WarehouseCountAggregateOutputType | null
    _avg: WarehouseAvgAggregateOutputType | null
    _sum: WarehouseSumAggregateOutputType | null
    _min: WarehouseMinAggregateOutputType | null
    _max: WarehouseMaxAggregateOutputType | null
  }

  export type WarehouseAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type WarehouseSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type WarehouseMinAggregateOutputType = {
    id: string | null
    name: string | null
    branchId: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type WarehouseMaxAggregateOutputType = {
    id: string | null
    name: string | null
    branchId: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type WarehouseCountAggregateOutputType = {
    id: number
    name: number
    branchId: number
    email: number
    phone: number
    country: number
    city: number
    zipCode: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type WarehouseAvgAggregateInputType = {
    sortOrder?: true
  }

  export type WarehouseSumAggregateInputType = {
    sortOrder?: true
  }

  export type WarehouseMinAggregateInputType = {
    id?: true
    name?: true
    branchId?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type WarehouseMaxAggregateInputType = {
    id?: true
    name?: true
    branchId?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type WarehouseCountAggregateInputType = {
    id?: true
    name?: true
    branchId?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type WarehouseAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Warehouse to aggregate.
     */
    where?: WarehouseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Warehouses to fetch.
     */
    orderBy?: WarehouseOrderByWithRelationInput | WarehouseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: WarehouseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Warehouses 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` Warehouses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Warehouses
    **/
    _count?: true | WarehouseCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: WarehouseAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: WarehouseSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: WarehouseMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: WarehouseMaxAggregateInputType
  }

  export type GetWarehouseAggregateType<T extends WarehouseAggregateArgs> = {
        [P in keyof T & keyof AggregateWarehouse]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateWarehouse[P]>
      : GetScalarType<T[P], AggregateWarehouse[P]>
  }




  export type WarehouseGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: WarehouseWhereInput
    orderBy?: WarehouseOrderByWithAggregationInput | WarehouseOrderByWithAggregationInput[]
    by: WarehouseScalarFieldEnum[] | WarehouseScalarFieldEnum
    having?: WarehouseScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: WarehouseCountAggregateInputType | true
    _avg?: WarehouseAvgAggregateInputType
    _sum?: WarehouseSumAggregateInputType
    _min?: WarehouseMinAggregateInputType
    _max?: WarehouseMaxAggregateInputType
  }

  export type WarehouseGroupByOutputType = {
    id: string
    name: string
    branchId: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: WarehouseCountAggregateOutputType | null
    _avg: WarehouseAvgAggregateOutputType | null
    _sum: WarehouseSumAggregateOutputType | null
    _min: WarehouseMinAggregateOutputType | null
    _max: WarehouseMaxAggregateOutputType | null
  }

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


  export type WarehouseSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    branchId?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Warehouse$branchArgs<ExtArgs>
    products?: boolean | Warehouse$productsArgs<ExtArgs>
    adjustments?: boolean | Warehouse$adjustmentsArgs<ExtArgs>
    purchases?: boolean | Warehouse$purchasesArgs<ExtArgs>
    purchaseReturns?: boolean | Warehouse$purchaseReturnsArgs<ExtArgs>
    sales?: boolean | Warehouse$salesArgs<ExtArgs>
    salesReturns?: boolean | Warehouse$salesReturnsArgs<ExtArgs>
    expenses?: boolean | Warehouse$expensesArgs<ExtArgs>
    transfersFrom?: boolean | Warehouse$transfersFromArgs<ExtArgs>
    transfersTo?: boolean | Warehouse$transfersToArgs<ExtArgs>
    stocks?: boolean | Warehouse$stocksArgs<ExtArgs>
    _count?: boolean | WarehouseCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["warehouse"]>

  export type WarehouseSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    branchId?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Warehouse$branchArgs<ExtArgs>
  }, ExtArgs["result"]["warehouse"]>

  export type WarehouseSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    branchId?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Warehouse$branchArgs<ExtArgs>
  }, ExtArgs["result"]["warehouse"]>

  export type WarehouseSelectScalar = {
    id?: boolean
    name?: boolean
    branchId?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type WarehouseOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "branchId" | "email" | "phone" | "country" | "city" | "zipCode" | "sortOrder" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["warehouse"]>
  export type WarehouseInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Warehouse$branchArgs<ExtArgs>
    products?: boolean | Warehouse$productsArgs<ExtArgs>
    adjustments?: boolean | Warehouse$adjustmentsArgs<ExtArgs>
    purchases?: boolean | Warehouse$purchasesArgs<ExtArgs>
    purchaseReturns?: boolean | Warehouse$purchaseReturnsArgs<ExtArgs>
    sales?: boolean | Warehouse$salesArgs<ExtArgs>
    salesReturns?: boolean | Warehouse$salesReturnsArgs<ExtArgs>
    expenses?: boolean | Warehouse$expensesArgs<ExtArgs>
    transfersFrom?: boolean | Warehouse$transfersFromArgs<ExtArgs>
    transfersTo?: boolean | Warehouse$transfersToArgs<ExtArgs>
    stocks?: boolean | Warehouse$stocksArgs<ExtArgs>
    _count?: boolean | WarehouseCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type WarehouseIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Warehouse$branchArgs<ExtArgs>
  }
  export type WarehouseIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Warehouse$branchArgs<ExtArgs>
  }

  export type $WarehousePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Warehouse"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      products: Prisma.$ProductPayload<ExtArgs>[]
      adjustments: Prisma.$InventoryAdjustmentPayload<ExtArgs>[]
      purchases: Prisma.$PurchasePayload<ExtArgs>[]
      purchaseReturns: Prisma.$PurchaseReturnPayload<ExtArgs>[]
      sales: Prisma.$SalePayload<ExtArgs>[]
      salesReturns: Prisma.$SalesReturnPayload<ExtArgs>[]
      expenses: Prisma.$ExpensePayload<ExtArgs>[]
      transfersFrom: Prisma.$InventoryTransferPayload<ExtArgs>[]
      transfersTo: Prisma.$InventoryTransferPayload<ExtArgs>[]
      stocks: Prisma.$WarehouseStockPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      branchId: string | null
      email: string | null
      /**
       * Phone / WhatsApp, etc.
       */
      phone: string | null
      country: string | null
      city: string | null
      zipCode: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["warehouse"]>
    composites: {}
  }

  type WarehouseGetPayload<S extends boolean | null | undefined | WarehouseDefaultArgs> = $Result.GetResult<Prisma.$WarehousePayload, S>

  type WarehouseCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<WarehouseFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: WarehouseCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Warehouse.
     * @param {WarehouseCreateArgs} args - Arguments to create a Warehouse.
     * @example
     * // Create one Warehouse
     * const Warehouse = await prisma.warehouse.create({
     *   data: {
     *     // ... data to create a Warehouse
     *   }
     * })
     * 
     */
    create<T extends WarehouseCreateArgs>(args: SelectSubset<T, WarehouseCreateArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Warehouses and returns the data saved in the database.
     * @param {WarehouseCreateManyAndReturnArgs} args - Arguments to create many Warehouses.
     * @example
     * // Create many Warehouses
     * const warehouse = await prisma.warehouse.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Warehouses and only return the `id`
     * const warehouseWithIdOnly = await prisma.warehouse.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends WarehouseCreateManyAndReturnArgs>(args?: SelectSubset<T, WarehouseCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Warehouse.
     * @param {WarehouseDeleteArgs} args - Arguments to delete one Warehouse.
     * @example
     * // Delete one Warehouse
     * const Warehouse = await prisma.warehouse.delete({
     *   where: {
     *     // ... filter to delete one Warehouse
     *   }
     * })
     * 
     */
    delete<T extends WarehouseDeleteArgs>(args: SelectSubset<T, WarehouseDeleteArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Warehouse.
     * @param {WarehouseUpdateArgs} args - Arguments to update one Warehouse.
     * @example
     * // Update one Warehouse
     * const warehouse = await prisma.warehouse.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends WarehouseUpdateArgs>(args: SelectSubset<T, WarehouseUpdateArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Warehouses and returns the data updated in the database.
     * @param {WarehouseUpdateManyAndReturnArgs} args - Arguments to update many Warehouses.
     * @example
     * // Update many Warehouses
     * const warehouse = await prisma.warehouse.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Warehouses and only return the `id`
     * const warehouseWithIdOnly = await prisma.warehouse.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends WarehouseUpdateManyAndReturnArgs>(args: SelectSubset<T, WarehouseUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Warehouse.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {WarehouseAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends WarehouseAggregateArgs>(args: Subset<T, WarehouseAggregateArgs>): Prisma.PrismaPromise<GetWarehouseAggregateType<T>>

    /**
     * Group by Warehouse.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {WarehouseGroupByArgs} 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 WarehouseGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: WarehouseGroupByArgs['orderBy'] }
        : { orderBy?: WarehouseGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, WarehouseGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetWarehouseGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Warehouse model
   */
  readonly fields: WarehouseFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Warehouse.
   * 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__WarehouseClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Warehouse$branchArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    products<T extends Warehouse$productsArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    adjustments<T extends Warehouse$adjustmentsArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$adjustmentsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchases<T extends Warehouse$purchasesArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$purchasesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchaseReturns<T extends Warehouse$purchaseReturnsArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$purchaseReturnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    sales<T extends Warehouse$salesArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$salesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    salesReturns<T extends Warehouse$salesReturnsArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$salesReturnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    expenses<T extends Warehouse$expensesArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$expensesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    transfersFrom<T extends Warehouse$transfersFromArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$transfersFromArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    transfersTo<T extends Warehouse$transfersToArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$transfersToArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    stocks<T extends Warehouse$stocksArgs<ExtArgs> = {}>(args?: Subset<T, Warehouse$stocksArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Warehouse model
   */
  interface WarehouseFieldRefs {
    readonly id: FieldRef<"Warehouse", 'String'>
    readonly name: FieldRef<"Warehouse", 'String'>
    readonly branchId: FieldRef<"Warehouse", 'String'>
    readonly email: FieldRef<"Warehouse", 'String'>
    readonly phone: FieldRef<"Warehouse", 'String'>
    readonly country: FieldRef<"Warehouse", 'String'>
    readonly city: FieldRef<"Warehouse", 'String'>
    readonly zipCode: FieldRef<"Warehouse", 'String'>
    readonly sortOrder: FieldRef<"Warehouse", 'Int'>
    readonly isActive: FieldRef<"Warehouse", 'Boolean'>
    readonly createdAt: FieldRef<"Warehouse", 'DateTime'>
    readonly updatedAt: FieldRef<"Warehouse", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Warehouse findUnique
   */
  export type WarehouseFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * Filter, which Warehouse to fetch.
     */
    where: WarehouseWhereUniqueInput
  }

  /**
   * Warehouse findUniqueOrThrow
   */
  export type WarehouseFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * Filter, which Warehouse to fetch.
     */
    where: WarehouseWhereUniqueInput
  }

  /**
   * Warehouse findFirst
   */
  export type WarehouseFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * Filter, which Warehouse to fetch.
     */
    where?: WarehouseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Warehouses to fetch.
     */
    orderBy?: WarehouseOrderByWithRelationInput | WarehouseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Warehouses.
     */
    cursor?: WarehouseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Warehouses 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` Warehouses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Warehouses.
     */
    distinct?: WarehouseScalarFieldEnum | WarehouseScalarFieldEnum[]
  }

  /**
   * Warehouse findFirstOrThrow
   */
  export type WarehouseFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * Filter, which Warehouse to fetch.
     */
    where?: WarehouseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Warehouses to fetch.
     */
    orderBy?: WarehouseOrderByWithRelationInput | WarehouseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Warehouses.
     */
    cursor?: WarehouseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Warehouses 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` Warehouses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Warehouses.
     */
    distinct?: WarehouseScalarFieldEnum | WarehouseScalarFieldEnum[]
  }

  /**
   * Warehouse findMany
   */
  export type WarehouseFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * Filter, which Warehouses to fetch.
     */
    where?: WarehouseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Warehouses to fetch.
     */
    orderBy?: WarehouseOrderByWithRelationInput | WarehouseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Warehouses.
     */
    cursor?: WarehouseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Warehouses 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` Warehouses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Warehouses.
     */
    distinct?: WarehouseScalarFieldEnum | WarehouseScalarFieldEnum[]
  }

  /**
   * Warehouse create
   */
  export type WarehouseCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * The data needed to create a Warehouse.
     */
    data: XOR<WarehouseCreateInput, WarehouseUncheckedCreateInput>
  }

  /**
   * Warehouse createMany
   */
  export type WarehouseCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Warehouses.
     */
    data: WarehouseCreateManyInput | WarehouseCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Warehouse createManyAndReturn
   */
  export type WarehouseCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * The data used to create many Warehouses.
     */
    data: WarehouseCreateManyInput | WarehouseCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Warehouse update
   */
  export type WarehouseUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * The data needed to update a Warehouse.
     */
    data: XOR<WarehouseUpdateInput, WarehouseUncheckedUpdateInput>
    /**
     * Choose, which Warehouse to update.
     */
    where: WarehouseWhereUniqueInput
  }

  /**
   * Warehouse updateMany
   */
  export type WarehouseUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Warehouses.
     */
    data: XOR<WarehouseUpdateManyMutationInput, WarehouseUncheckedUpdateManyInput>
    /**
     * Filter which Warehouses to update
     */
    where?: WarehouseWhereInput
    /**
     * Limit how many Warehouses to update.
     */
    limit?: number
  }

  /**
   * Warehouse updateManyAndReturn
   */
  export type WarehouseUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * The data used to update Warehouses.
     */
    data: XOR<WarehouseUpdateManyMutationInput, WarehouseUncheckedUpdateManyInput>
    /**
     * Filter which Warehouses to update
     */
    where?: WarehouseWhereInput
    /**
     * Limit how many Warehouses to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Warehouse upsert
   */
  export type WarehouseUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * The filter to search for the Warehouse to update in case it exists.
     */
    where: WarehouseWhereUniqueInput
    /**
     * In case the Warehouse found by the `where` argument doesn't exist, create a new Warehouse with this data.
     */
    create: XOR<WarehouseCreateInput, WarehouseUncheckedCreateInput>
    /**
     * In case the Warehouse was found with the provided `where` argument, update it with this data.
     */
    update: XOR<WarehouseUpdateInput, WarehouseUncheckedUpdateInput>
  }

  /**
   * Warehouse delete
   */
  export type WarehouseDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    /**
     * Filter which Warehouse to delete.
     */
    where: WarehouseWhereUniqueInput
  }

  /**
   * Warehouse deleteMany
   */
  export type WarehouseDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Warehouses to delete
     */
    where?: WarehouseWhereInput
    /**
     * Limit how many Warehouses to delete.
     */
    limit?: number
  }

  /**
   * Warehouse.branch
   */
  export type Warehouse$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Warehouse.products
   */
  export type Warehouse$productsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Warehouse.adjustments
   */
  export type Warehouse$adjustmentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    where?: InventoryAdjustmentWhereInput
    orderBy?: InventoryAdjustmentOrderByWithRelationInput | InventoryAdjustmentOrderByWithRelationInput[]
    cursor?: InventoryAdjustmentWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryAdjustmentScalarFieldEnum | InventoryAdjustmentScalarFieldEnum[]
  }

  /**
   * Warehouse.purchases
   */
  export type Warehouse$purchasesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Purchase
     */
    select?: PurchaseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Purchase
     */
    omit?: PurchaseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseInclude<ExtArgs> | null
    where?: PurchaseWhereInput
    orderBy?: PurchaseOrderByWithRelationInput | PurchaseOrderByWithRelationInput[]
    cursor?: PurchaseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseScalarFieldEnum | PurchaseScalarFieldEnum[]
  }

  /**
   * Warehouse.purchaseReturns
   */
  export type Warehouse$purchaseReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    where?: PurchaseReturnWhereInput
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    cursor?: PurchaseReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

  /**
   * Warehouse.sales
   */
  export type Warehouse$salesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    where?: SaleWhereInput
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    cursor?: SaleWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * Warehouse.salesReturns
   */
  export type Warehouse$salesReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    where?: SalesReturnWhereInput
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    cursor?: SalesReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * Warehouse.expenses
   */
  export type Warehouse$expensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    where?: ExpenseWhereInput
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    cursor?: ExpenseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * Warehouse.transfersFrom
   */
  export type Warehouse$transfersFromArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    where?: InventoryTransferWhereInput
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    cursor?: InventoryTransferWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryTransferScalarFieldEnum | InventoryTransferScalarFieldEnum[]
  }

  /**
   * Warehouse.transfersTo
   */
  export type Warehouse$transfersToArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    where?: InventoryTransferWhereInput
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    cursor?: InventoryTransferWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryTransferScalarFieldEnum | InventoryTransferScalarFieldEnum[]
  }

  /**
   * Warehouse.stocks
   */
  export type Warehouse$stocksArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    where?: WarehouseStockWhereInput
    orderBy?: WarehouseStockOrderByWithRelationInput | WarehouseStockOrderByWithRelationInput[]
    cursor?: WarehouseStockWhereUniqueInput
    take?: number
    skip?: number
    distinct?: WarehouseStockScalarFieldEnum | WarehouseStockScalarFieldEnum[]
  }

  /**
   * Warehouse without action
   */
  export type WarehouseDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
  }


  /**
   * Model WarehouseStock
   */

  export type AggregateWarehouseStock = {
    _count: WarehouseStockCountAggregateOutputType | null
    _avg: WarehouseStockAvgAggregateOutputType | null
    _sum: WarehouseStockSumAggregateOutputType | null
    _min: WarehouseStockMinAggregateOutputType | null
    _max: WarehouseStockMaxAggregateOutputType | null
  }

  export type WarehouseStockAvgAggregateOutputType = {
    quantity: number | null
  }

  export type WarehouseStockSumAggregateOutputType = {
    quantity: number | null
  }

  export type WarehouseStockMinAggregateOutputType = {
    id: string | null
    warehouseId: string | null
    productId: string | null
    quantity: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type WarehouseStockMaxAggregateOutputType = {
    id: string | null
    warehouseId: string | null
    productId: string | null
    quantity: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type WarehouseStockCountAggregateOutputType = {
    id: number
    warehouseId: number
    productId: number
    quantity: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type WarehouseStockAvgAggregateInputType = {
    quantity?: true
  }

  export type WarehouseStockSumAggregateInputType = {
    quantity?: true
  }

  export type WarehouseStockMinAggregateInputType = {
    id?: true
    warehouseId?: true
    productId?: true
    quantity?: true
    createdAt?: true
    updatedAt?: true
  }

  export type WarehouseStockMaxAggregateInputType = {
    id?: true
    warehouseId?: true
    productId?: true
    quantity?: true
    createdAt?: true
    updatedAt?: true
  }

  export type WarehouseStockCountAggregateInputType = {
    id?: true
    warehouseId?: true
    productId?: true
    quantity?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type WarehouseStockAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which WarehouseStock to aggregate.
     */
    where?: WarehouseStockWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of WarehouseStocks to fetch.
     */
    orderBy?: WarehouseStockOrderByWithRelationInput | WarehouseStockOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: WarehouseStockWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` WarehouseStocks 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` WarehouseStocks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned WarehouseStocks
    **/
    _count?: true | WarehouseStockCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: WarehouseStockAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: WarehouseStockSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: WarehouseStockMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: WarehouseStockMaxAggregateInputType
  }

  export type GetWarehouseStockAggregateType<T extends WarehouseStockAggregateArgs> = {
        [P in keyof T & keyof AggregateWarehouseStock]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateWarehouseStock[P]>
      : GetScalarType<T[P], AggregateWarehouseStock[P]>
  }




  export type WarehouseStockGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: WarehouseStockWhereInput
    orderBy?: WarehouseStockOrderByWithAggregationInput | WarehouseStockOrderByWithAggregationInput[]
    by: WarehouseStockScalarFieldEnum[] | WarehouseStockScalarFieldEnum
    having?: WarehouseStockScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: WarehouseStockCountAggregateInputType | true
    _avg?: WarehouseStockAvgAggregateInputType
    _sum?: WarehouseStockSumAggregateInputType
    _min?: WarehouseStockMinAggregateInputType
    _max?: WarehouseStockMaxAggregateInputType
  }

  export type WarehouseStockGroupByOutputType = {
    id: string
    warehouseId: string
    productId: string
    quantity: number
    createdAt: Date
    updatedAt: Date
    _count: WarehouseStockCountAggregateOutputType | null
    _avg: WarehouseStockAvgAggregateOutputType | null
    _sum: WarehouseStockSumAggregateOutputType | null
    _min: WarehouseStockMinAggregateOutputType | null
    _max: WarehouseStockMaxAggregateOutputType | null
  }

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


  export type WarehouseStockSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    warehouseId?: boolean
    productId?: boolean
    quantity?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["warehouseStock"]>

  export type WarehouseStockSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    warehouseId?: boolean
    productId?: boolean
    quantity?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["warehouseStock"]>

  export type WarehouseStockSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    warehouseId?: boolean
    productId?: boolean
    quantity?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["warehouseStock"]>

  export type WarehouseStockSelectScalar = {
    id?: boolean
    warehouseId?: boolean
    productId?: boolean
    quantity?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type WarehouseStockOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "warehouseId" | "productId" | "quantity" | "createdAt" | "updatedAt", ExtArgs["result"]["warehouseStock"]>
  export type WarehouseStockInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type WarehouseStockIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type WarehouseStockIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $WarehouseStockPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "WarehouseStock"
    objects: {
      warehouse: Prisma.$WarehousePayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      warehouseId: string
      productId: string
      quantity: number
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["warehouseStock"]>
    composites: {}
  }

  type WarehouseStockGetPayload<S extends boolean | null | undefined | WarehouseStockDefaultArgs> = $Result.GetResult<Prisma.$WarehouseStockPayload, S>

  type WarehouseStockCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<WarehouseStockFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: WarehouseStockCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a WarehouseStock.
     * @param {WarehouseStockCreateArgs} args - Arguments to create a WarehouseStock.
     * @example
     * // Create one WarehouseStock
     * const WarehouseStock = await prisma.warehouseStock.create({
     *   data: {
     *     // ... data to create a WarehouseStock
     *   }
     * })
     * 
     */
    create<T extends WarehouseStockCreateArgs>(args: SelectSubset<T, WarehouseStockCreateArgs<ExtArgs>>): Prisma__WarehouseStockClient<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many WarehouseStocks and returns the data saved in the database.
     * @param {WarehouseStockCreateManyAndReturnArgs} args - Arguments to create many WarehouseStocks.
     * @example
     * // Create many WarehouseStocks
     * const warehouseStock = await prisma.warehouseStock.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many WarehouseStocks and only return the `id`
     * const warehouseStockWithIdOnly = await prisma.warehouseStock.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends WarehouseStockCreateManyAndReturnArgs>(args?: SelectSubset<T, WarehouseStockCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a WarehouseStock.
     * @param {WarehouseStockDeleteArgs} args - Arguments to delete one WarehouseStock.
     * @example
     * // Delete one WarehouseStock
     * const WarehouseStock = await prisma.warehouseStock.delete({
     *   where: {
     *     // ... filter to delete one WarehouseStock
     *   }
     * })
     * 
     */
    delete<T extends WarehouseStockDeleteArgs>(args: SelectSubset<T, WarehouseStockDeleteArgs<ExtArgs>>): Prisma__WarehouseStockClient<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one WarehouseStock.
     * @param {WarehouseStockUpdateArgs} args - Arguments to update one WarehouseStock.
     * @example
     * // Update one WarehouseStock
     * const warehouseStock = await prisma.warehouseStock.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends WarehouseStockUpdateArgs>(args: SelectSubset<T, WarehouseStockUpdateArgs<ExtArgs>>): Prisma__WarehouseStockClient<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more WarehouseStocks and returns the data updated in the database.
     * @param {WarehouseStockUpdateManyAndReturnArgs} args - Arguments to update many WarehouseStocks.
     * @example
     * // Update many WarehouseStocks
     * const warehouseStock = await prisma.warehouseStock.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more WarehouseStocks and only return the `id`
     * const warehouseStockWithIdOnly = await prisma.warehouseStock.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends WarehouseStockUpdateManyAndReturnArgs>(args: SelectSubset<T, WarehouseStockUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a WarehouseStock.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {WarehouseStockAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends WarehouseStockAggregateArgs>(args: Subset<T, WarehouseStockAggregateArgs>): Prisma.PrismaPromise<GetWarehouseStockAggregateType<T>>

    /**
     * Group by WarehouseStock.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {WarehouseStockGroupByArgs} 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 WarehouseStockGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: WarehouseStockGroupByArgs['orderBy'] }
        : { orderBy?: WarehouseStockGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, WarehouseStockGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetWarehouseStockGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the WarehouseStock model
   */
  readonly fields: WarehouseStockFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for WarehouseStock.
   * 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__WarehouseStockClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    warehouse<T extends WarehouseDefaultArgs<ExtArgs> = {}>(args?: Subset<T, WarehouseDefaultArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the WarehouseStock model
   */
  interface WarehouseStockFieldRefs {
    readonly id: FieldRef<"WarehouseStock", 'String'>
    readonly warehouseId: FieldRef<"WarehouseStock", 'String'>
    readonly productId: FieldRef<"WarehouseStock", 'String'>
    readonly quantity: FieldRef<"WarehouseStock", 'Int'>
    readonly createdAt: FieldRef<"WarehouseStock", 'DateTime'>
    readonly updatedAt: FieldRef<"WarehouseStock", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * WarehouseStock findUnique
   */
  export type WarehouseStockFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * Filter, which WarehouseStock to fetch.
     */
    where: WarehouseStockWhereUniqueInput
  }

  /**
   * WarehouseStock findUniqueOrThrow
   */
  export type WarehouseStockFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * Filter, which WarehouseStock to fetch.
     */
    where: WarehouseStockWhereUniqueInput
  }

  /**
   * WarehouseStock findFirst
   */
  export type WarehouseStockFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * Filter, which WarehouseStock to fetch.
     */
    where?: WarehouseStockWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of WarehouseStocks to fetch.
     */
    orderBy?: WarehouseStockOrderByWithRelationInput | WarehouseStockOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for WarehouseStocks.
     */
    cursor?: WarehouseStockWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` WarehouseStocks 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` WarehouseStocks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of WarehouseStocks.
     */
    distinct?: WarehouseStockScalarFieldEnum | WarehouseStockScalarFieldEnum[]
  }

  /**
   * WarehouseStock findFirstOrThrow
   */
  export type WarehouseStockFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * Filter, which WarehouseStock to fetch.
     */
    where?: WarehouseStockWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of WarehouseStocks to fetch.
     */
    orderBy?: WarehouseStockOrderByWithRelationInput | WarehouseStockOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for WarehouseStocks.
     */
    cursor?: WarehouseStockWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` WarehouseStocks 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` WarehouseStocks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of WarehouseStocks.
     */
    distinct?: WarehouseStockScalarFieldEnum | WarehouseStockScalarFieldEnum[]
  }

  /**
   * WarehouseStock findMany
   */
  export type WarehouseStockFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * Filter, which WarehouseStocks to fetch.
     */
    where?: WarehouseStockWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of WarehouseStocks to fetch.
     */
    orderBy?: WarehouseStockOrderByWithRelationInput | WarehouseStockOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing WarehouseStocks.
     */
    cursor?: WarehouseStockWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` WarehouseStocks 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` WarehouseStocks.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of WarehouseStocks.
     */
    distinct?: WarehouseStockScalarFieldEnum | WarehouseStockScalarFieldEnum[]
  }

  /**
   * WarehouseStock create
   */
  export type WarehouseStockCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * The data needed to create a WarehouseStock.
     */
    data: XOR<WarehouseStockCreateInput, WarehouseStockUncheckedCreateInput>
  }

  /**
   * WarehouseStock createMany
   */
  export type WarehouseStockCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many WarehouseStocks.
     */
    data: WarehouseStockCreateManyInput | WarehouseStockCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * WarehouseStock createManyAndReturn
   */
  export type WarehouseStockCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * The data used to create many WarehouseStocks.
     */
    data: WarehouseStockCreateManyInput | WarehouseStockCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * WarehouseStock update
   */
  export type WarehouseStockUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * The data needed to update a WarehouseStock.
     */
    data: XOR<WarehouseStockUpdateInput, WarehouseStockUncheckedUpdateInput>
    /**
     * Choose, which WarehouseStock to update.
     */
    where: WarehouseStockWhereUniqueInput
  }

  /**
   * WarehouseStock updateMany
   */
  export type WarehouseStockUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update WarehouseStocks.
     */
    data: XOR<WarehouseStockUpdateManyMutationInput, WarehouseStockUncheckedUpdateManyInput>
    /**
     * Filter which WarehouseStocks to update
     */
    where?: WarehouseStockWhereInput
    /**
     * Limit how many WarehouseStocks to update.
     */
    limit?: number
  }

  /**
   * WarehouseStock updateManyAndReturn
   */
  export type WarehouseStockUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * The data used to update WarehouseStocks.
     */
    data: XOR<WarehouseStockUpdateManyMutationInput, WarehouseStockUncheckedUpdateManyInput>
    /**
     * Filter which WarehouseStocks to update
     */
    where?: WarehouseStockWhereInput
    /**
     * Limit how many WarehouseStocks to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * WarehouseStock upsert
   */
  export type WarehouseStockUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * The filter to search for the WarehouseStock to update in case it exists.
     */
    where: WarehouseStockWhereUniqueInput
    /**
     * In case the WarehouseStock found by the `where` argument doesn't exist, create a new WarehouseStock with this data.
     */
    create: XOR<WarehouseStockCreateInput, WarehouseStockUncheckedCreateInput>
    /**
     * In case the WarehouseStock was found with the provided `where` argument, update it with this data.
     */
    update: XOR<WarehouseStockUpdateInput, WarehouseStockUncheckedUpdateInput>
  }

  /**
   * WarehouseStock delete
   */
  export type WarehouseStockDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    /**
     * Filter which WarehouseStock to delete.
     */
    where: WarehouseStockWhereUniqueInput
  }

  /**
   * WarehouseStock deleteMany
   */
  export type WarehouseStockDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which WarehouseStocks to delete
     */
    where?: WarehouseStockWhereInput
    /**
     * Limit how many WarehouseStocks to delete.
     */
    limit?: number
  }

  /**
   * WarehouseStock without action
   */
  export type WarehouseStockDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
  }


  /**
   * Model Supplier
   */

  export type AggregateSupplier = {
    _count: SupplierCountAggregateOutputType | null
    _avg: SupplierAvgAggregateOutputType | null
    _sum: SupplierSumAggregateOutputType | null
    _min: SupplierMinAggregateOutputType | null
    _max: SupplierMaxAggregateOutputType | null
  }

  export type SupplierAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type SupplierSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type SupplierMinAggregateOutputType = {
    id: string | null
    name: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type SupplierMaxAggregateOutputType = {
    id: string | null
    name: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type SupplierCountAggregateOutputType = {
    id: number
    name: number
    email: number
    phone: number
    country: number
    city: number
    zipCode: number
    branchId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type SupplierAvgAggregateInputType = {
    sortOrder?: true
  }

  export type SupplierSumAggregateInputType = {
    sortOrder?: true
  }

  export type SupplierMinAggregateInputType = {
    id?: true
    name?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type SupplierMaxAggregateInputType = {
    id?: true
    name?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type SupplierCountAggregateInputType = {
    id?: true
    name?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

  export type SupplierAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Supplier to aggregate.
     */
    where?: SupplierWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Suppliers to fetch.
     */
    orderBy?: SupplierOrderByWithRelationInput | SupplierOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SupplierWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Suppliers 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` Suppliers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Suppliers
    **/
    _count?: true | SupplierCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: SupplierAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: SupplierSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SupplierMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SupplierMaxAggregateInputType
  }

  export type GetSupplierAggregateType<T extends SupplierAggregateArgs> = {
        [P in keyof T & keyof AggregateSupplier]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSupplier[P]>
      : GetScalarType<T[P], AggregateSupplier[P]>
  }




  export type SupplierGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SupplierWhereInput
    orderBy?: SupplierOrderByWithAggregationInput | SupplierOrderByWithAggregationInput[]
    by: SupplierScalarFieldEnum[] | SupplierScalarFieldEnum
    having?: SupplierScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SupplierCountAggregateInputType | true
    _avg?: SupplierAvgAggregateInputType
    _sum?: SupplierSumAggregateInputType
    _min?: SupplierMinAggregateInputType
    _max?: SupplierMaxAggregateInputType
  }

  export type SupplierGroupByOutputType = {
    id: string
    name: string
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    branchId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: SupplierCountAggregateOutputType | null
    _avg: SupplierAvgAggregateOutputType | null
    _sum: SupplierSumAggregateOutputType | null
    _min: SupplierMinAggregateOutputType | null
    _max: SupplierMaxAggregateOutputType | null
  }

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


  export type SupplierSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Supplier$branchArgs<ExtArgs>
    purchases?: boolean | Supplier$purchasesArgs<ExtArgs>
    purchaseReturns?: boolean | Supplier$purchaseReturnsArgs<ExtArgs>
    _count?: boolean | SupplierCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["supplier"]>

  export type SupplierSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Supplier$branchArgs<ExtArgs>
  }, ExtArgs["result"]["supplier"]>

  export type SupplierSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Supplier$branchArgs<ExtArgs>
  }, ExtArgs["result"]["supplier"]>

  export type SupplierSelectScalar = {
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type SupplierOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "email" | "phone" | "country" | "city" | "zipCode" | "branchId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["supplier"]>
  export type SupplierInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Supplier$branchArgs<ExtArgs>
    purchases?: boolean | Supplier$purchasesArgs<ExtArgs>
    purchaseReturns?: boolean | Supplier$purchaseReturnsArgs<ExtArgs>
    _count?: boolean | SupplierCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type SupplierIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Supplier$branchArgs<ExtArgs>
  }
  export type SupplierIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Supplier$branchArgs<ExtArgs>
  }

  export type $SupplierPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Supplier"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      purchases: Prisma.$PurchasePayload<ExtArgs>[]
      purchaseReturns: Prisma.$PurchaseReturnPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      email: string | null
      /**
       * Phone / WhatsApp, etc.
       */
      phone: string | null
      country: string | null
      city: string | null
      zipCode: string | null
      branchId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["supplier"]>
    composites: {}
  }

  type SupplierGetPayload<S extends boolean | null | undefined | SupplierDefaultArgs> = $Result.GetResult<Prisma.$SupplierPayload, S>

  type SupplierCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SupplierFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SupplierCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Supplier.
     * @param {SupplierCreateArgs} args - Arguments to create a Supplier.
     * @example
     * // Create one Supplier
     * const Supplier = await prisma.supplier.create({
     *   data: {
     *     // ... data to create a Supplier
     *   }
     * })
     * 
     */
    create<T extends SupplierCreateArgs>(args: SelectSubset<T, SupplierCreateArgs<ExtArgs>>): Prisma__SupplierClient<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Suppliers and returns the data saved in the database.
     * @param {SupplierCreateManyAndReturnArgs} args - Arguments to create many Suppliers.
     * @example
     * // Create many Suppliers
     * const supplier = await prisma.supplier.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Suppliers and only return the `id`
     * const supplierWithIdOnly = await prisma.supplier.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SupplierCreateManyAndReturnArgs>(args?: SelectSubset<T, SupplierCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Supplier.
     * @param {SupplierDeleteArgs} args - Arguments to delete one Supplier.
     * @example
     * // Delete one Supplier
     * const Supplier = await prisma.supplier.delete({
     *   where: {
     *     // ... filter to delete one Supplier
     *   }
     * })
     * 
     */
    delete<T extends SupplierDeleteArgs>(args: SelectSubset<T, SupplierDeleteArgs<ExtArgs>>): Prisma__SupplierClient<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Supplier.
     * @param {SupplierUpdateArgs} args - Arguments to update one Supplier.
     * @example
     * // Update one Supplier
     * const supplier = await prisma.supplier.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SupplierUpdateArgs>(args: SelectSubset<T, SupplierUpdateArgs<ExtArgs>>): Prisma__SupplierClient<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Suppliers and returns the data updated in the database.
     * @param {SupplierUpdateManyAndReturnArgs} args - Arguments to update many Suppliers.
     * @example
     * // Update many Suppliers
     * const supplier = await prisma.supplier.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Suppliers and only return the `id`
     * const supplierWithIdOnly = await prisma.supplier.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SupplierUpdateManyAndReturnArgs>(args: SelectSubset<T, SupplierUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Supplier.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SupplierAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SupplierAggregateArgs>(args: Subset<T, SupplierAggregateArgs>): Prisma.PrismaPromise<GetSupplierAggregateType<T>>

    /**
     * Group by Supplier.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SupplierGroupByArgs} 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 SupplierGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SupplierGroupByArgs['orderBy'] }
        : { orderBy?: SupplierGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SupplierGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSupplierGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Supplier model
   */
  readonly fields: SupplierFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Supplier.
   * 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__SupplierClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Supplier$branchArgs<ExtArgs> = {}>(args?: Subset<T, Supplier$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    purchases<T extends Supplier$purchasesArgs<ExtArgs> = {}>(args?: Subset<T, Supplier$purchasesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchaseReturns<T extends Supplier$purchaseReturnsArgs<ExtArgs> = {}>(args?: Subset<T, Supplier$purchaseReturnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Supplier model
   */
  interface SupplierFieldRefs {
    readonly id: FieldRef<"Supplier", 'String'>
    readonly name: FieldRef<"Supplier", 'String'>
    readonly email: FieldRef<"Supplier", 'String'>
    readonly phone: FieldRef<"Supplier", 'String'>
    readonly country: FieldRef<"Supplier", 'String'>
    readonly city: FieldRef<"Supplier", 'String'>
    readonly zipCode: FieldRef<"Supplier", 'String'>
    readonly branchId: FieldRef<"Supplier", 'String'>
    readonly sortOrder: FieldRef<"Supplier", 'Int'>
    readonly isActive: FieldRef<"Supplier", 'Boolean'>
    readonly createdAt: FieldRef<"Supplier", 'DateTime'>
    readonly updatedAt: FieldRef<"Supplier", 'DateTime'>
    readonly deletedAt: FieldRef<"Supplier", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Supplier findUnique
   */
  export type SupplierFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * Filter, which Supplier to fetch.
     */
    where: SupplierWhereUniqueInput
  }

  /**
   * Supplier findUniqueOrThrow
   */
  export type SupplierFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * Filter, which Supplier to fetch.
     */
    where: SupplierWhereUniqueInput
  }

  /**
   * Supplier findFirst
   */
  export type SupplierFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * Filter, which Supplier to fetch.
     */
    where?: SupplierWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Suppliers to fetch.
     */
    orderBy?: SupplierOrderByWithRelationInput | SupplierOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Suppliers.
     */
    cursor?: SupplierWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Suppliers 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` Suppliers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Suppliers.
     */
    distinct?: SupplierScalarFieldEnum | SupplierScalarFieldEnum[]
  }

  /**
   * Supplier findFirstOrThrow
   */
  export type SupplierFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * Filter, which Supplier to fetch.
     */
    where?: SupplierWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Suppliers to fetch.
     */
    orderBy?: SupplierOrderByWithRelationInput | SupplierOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Suppliers.
     */
    cursor?: SupplierWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Suppliers 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` Suppliers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Suppliers.
     */
    distinct?: SupplierScalarFieldEnum | SupplierScalarFieldEnum[]
  }

  /**
   * Supplier findMany
   */
  export type SupplierFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * Filter, which Suppliers to fetch.
     */
    where?: SupplierWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Suppliers to fetch.
     */
    orderBy?: SupplierOrderByWithRelationInput | SupplierOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Suppliers.
     */
    cursor?: SupplierWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Suppliers 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` Suppliers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Suppliers.
     */
    distinct?: SupplierScalarFieldEnum | SupplierScalarFieldEnum[]
  }

  /**
   * Supplier create
   */
  export type SupplierCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * The data needed to create a Supplier.
     */
    data: XOR<SupplierCreateInput, SupplierUncheckedCreateInput>
  }

  /**
   * Supplier createMany
   */
  export type SupplierCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Suppliers.
     */
    data: SupplierCreateManyInput | SupplierCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Supplier createManyAndReturn
   */
  export type SupplierCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * The data used to create many Suppliers.
     */
    data: SupplierCreateManyInput | SupplierCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Supplier update
   */
  export type SupplierUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * The data needed to update a Supplier.
     */
    data: XOR<SupplierUpdateInput, SupplierUncheckedUpdateInput>
    /**
     * Choose, which Supplier to update.
     */
    where: SupplierWhereUniqueInput
  }

  /**
   * Supplier updateMany
   */
  export type SupplierUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Suppliers.
     */
    data: XOR<SupplierUpdateManyMutationInput, SupplierUncheckedUpdateManyInput>
    /**
     * Filter which Suppliers to update
     */
    where?: SupplierWhereInput
    /**
     * Limit how many Suppliers to update.
     */
    limit?: number
  }

  /**
   * Supplier updateManyAndReturn
   */
  export type SupplierUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * The data used to update Suppliers.
     */
    data: XOR<SupplierUpdateManyMutationInput, SupplierUncheckedUpdateManyInput>
    /**
     * Filter which Suppliers to update
     */
    where?: SupplierWhereInput
    /**
     * Limit how many Suppliers to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Supplier upsert
   */
  export type SupplierUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * The filter to search for the Supplier to update in case it exists.
     */
    where: SupplierWhereUniqueInput
    /**
     * In case the Supplier found by the `where` argument doesn't exist, create a new Supplier with this data.
     */
    create: XOR<SupplierCreateInput, SupplierUncheckedCreateInput>
    /**
     * In case the Supplier was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SupplierUpdateInput, SupplierUncheckedUpdateInput>
  }

  /**
   * Supplier delete
   */
  export type SupplierDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    /**
     * Filter which Supplier to delete.
     */
    where: SupplierWhereUniqueInput
  }

  /**
   * Supplier deleteMany
   */
  export type SupplierDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Suppliers to delete
     */
    where?: SupplierWhereInput
    /**
     * Limit how many Suppliers to delete.
     */
    limit?: number
  }

  /**
   * Supplier.branch
   */
  export type Supplier$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Supplier.purchases
   */
  export type Supplier$purchasesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Purchase
     */
    select?: PurchaseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Purchase
     */
    omit?: PurchaseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseInclude<ExtArgs> | null
    where?: PurchaseWhereInput
    orderBy?: PurchaseOrderByWithRelationInput | PurchaseOrderByWithRelationInput[]
    cursor?: PurchaseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseScalarFieldEnum | PurchaseScalarFieldEnum[]
  }

  /**
   * Supplier.purchaseReturns
   */
  export type Supplier$purchaseReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    where?: PurchaseReturnWhereInput
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    cursor?: PurchaseReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

  /**
   * Supplier without action
   */
  export type SupplierDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
  }


  /**
   * Model Purchase
   */

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

  export type PurchaseAvgAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type PurchaseSumAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type PurchaseMinAggregateOutputType = {
    id: string | null
    number: string | null
    supplierId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string | null
    purchaseDate: Date | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type PurchaseMaxAggregateOutputType = {
    id: string | null
    number: string | null
    supplierId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string | null
    purchaseDate: Date | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type PurchaseCountAggregateOutputType = {
    id: number
    number: number
    supplierId: number
    warehouseId: number
    branchId: number
    status: number
    purchaseDate: number
    notes: number
    subtotal: number
    taxTotal: number
    total: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type PurchaseAvgAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type PurchaseSumAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type PurchaseMinAggregateInputType = {
    id?: true
    number?: true
    supplierId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    purchaseDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type PurchaseMaxAggregateInputType = {
    id?: true
    number?: true
    supplierId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    purchaseDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type PurchaseCountAggregateInputType = {
    id?: true
    number?: true
    supplierId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    purchaseDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

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

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




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

  export type PurchaseGroupByOutputType = {
    id: string
    number: string
    supplierId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string
    purchaseDate: Date
    notes: string | null
    subtotal: number
    taxTotal: number
    total: number
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: PurchaseCountAggregateOutputType | null
    _avg: PurchaseAvgAggregateOutputType | null
    _sum: PurchaseSumAggregateOutputType | null
    _min: PurchaseMinAggregateOutputType | null
    _max: PurchaseMaxAggregateOutputType | null
  }

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


  export type PurchaseSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    purchaseDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    supplier?: boolean | Purchase$supplierArgs<ExtArgs>
    warehouse?: boolean | Purchase$warehouseArgs<ExtArgs>
    branch?: boolean | Purchase$branchArgs<ExtArgs>
    lines?: boolean | Purchase$linesArgs<ExtArgs>
    returns?: boolean | Purchase$returnsArgs<ExtArgs>
    _count?: boolean | PurchaseCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchase"]>

  export type PurchaseSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    purchaseDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    supplier?: boolean | Purchase$supplierArgs<ExtArgs>
    warehouse?: boolean | Purchase$warehouseArgs<ExtArgs>
    branch?: boolean | Purchase$branchArgs<ExtArgs>
  }, ExtArgs["result"]["purchase"]>

  export type PurchaseSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    purchaseDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    supplier?: boolean | Purchase$supplierArgs<ExtArgs>
    warehouse?: boolean | Purchase$warehouseArgs<ExtArgs>
    branch?: boolean | Purchase$branchArgs<ExtArgs>
  }, ExtArgs["result"]["purchase"]>

  export type PurchaseSelectScalar = {
    id?: boolean
    number?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    purchaseDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type PurchaseOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "number" | "supplierId" | "warehouseId" | "branchId" | "status" | "purchaseDate" | "notes" | "subtotal" | "taxTotal" | "total" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["purchase"]>
  export type PurchaseInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    supplier?: boolean | Purchase$supplierArgs<ExtArgs>
    warehouse?: boolean | Purchase$warehouseArgs<ExtArgs>
    branch?: boolean | Purchase$branchArgs<ExtArgs>
    lines?: boolean | Purchase$linesArgs<ExtArgs>
    returns?: boolean | Purchase$returnsArgs<ExtArgs>
    _count?: boolean | PurchaseCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type PurchaseIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    supplier?: boolean | Purchase$supplierArgs<ExtArgs>
    warehouse?: boolean | Purchase$warehouseArgs<ExtArgs>
    branch?: boolean | Purchase$branchArgs<ExtArgs>
  }
  export type PurchaseIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    supplier?: boolean | Purchase$supplierArgs<ExtArgs>
    warehouse?: boolean | Purchase$warehouseArgs<ExtArgs>
    branch?: boolean | Purchase$branchArgs<ExtArgs>
  }

  export type $PurchasePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Purchase"
    objects: {
      supplier: Prisma.$SupplierPayload<ExtArgs> | null
      warehouse: Prisma.$WarehousePayload<ExtArgs> | null
      branch: Prisma.$BranchPayload<ExtArgs> | null
      lines: Prisma.$PurchaseLinePayload<ExtArgs>[]
      returns: Prisma.$PurchaseReturnPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      number: string
      supplierId: string | null
      warehouseId: string | null
      branchId: string | null
      status: string
      purchaseDate: Date
      notes: string | null
      subtotal: number
      taxTotal: number
      total: number
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["purchase"]>
    composites: {}
  }

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

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

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

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

    /**
     * Find the first Purchase that matches the filter.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseFindFirstArgs} args - Arguments to find a Purchase
     * @example
     * // Get one Purchase
     * const purchase = await prisma.purchase.findFirst({
     *   where: {
     *     // ... provide filter here
     *   }
     * })
     */
    findFirst<T extends PurchaseFindFirstArgs>(args?: SelectSubset<T, PurchaseFindFirstArgs<ExtArgs>>): Prisma__PurchaseClient<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

    /**
     * Find the first Purchase that matches the filter or
     * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseFindFirstOrThrowArgs} args - Arguments to find a Purchase
     * @example
     * // Get one Purchase
     * const purchase = await prisma.purchase.findFirstOrThrow({
     *   where: {
     *     // ... provide filter here
     *   }
     * })
     */
    findFirstOrThrow<T extends PurchaseFindFirstOrThrowArgs>(args?: SelectSubset<T, PurchaseFindFirstOrThrowArgs<ExtArgs>>): Prisma__PurchaseClient<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Find zero or more Purchases that matches the filter.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseFindManyArgs} args - Arguments to filter and select certain fields only.
     * @example
     * // Get all Purchases
     * const purchases = await prisma.purchase.findMany()
     * 
     * // Get first 10 Purchases
     * const purchases = await prisma.purchase.findMany({ take: 10 })
     * 
     * // Only select the `id`
     * const purchaseWithIdOnly = await prisma.purchase.findMany({ select: { id: true } })
     * 
     */
    findMany<T extends PurchaseFindManyArgs>(args?: SelectSubset<T, PurchaseFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

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

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

    /**
     * Create many Purchases and returns the data saved in the database.
     * @param {PurchaseCreateManyAndReturnArgs} args - Arguments to create many Purchases.
     * @example
     * // Create many Purchases
     * const purchase = await prisma.purchase.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Purchases and only return the `id`
     * const purchaseWithIdOnly = await prisma.purchase.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends PurchaseCreateManyAndReturnArgs>(args?: SelectSubset<T, PurchaseCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

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

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

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

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

    /**
     * Update zero or more Purchases and returns the data updated in the database.
     * @param {PurchaseUpdateManyAndReturnArgs} args - Arguments to update many Purchases.
     * @example
     * // Update many Purchases
     * const purchase = await prisma.purchase.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Purchases and only return the `id`
     * const purchaseWithIdOnly = await prisma.purchase.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends PurchaseUpdateManyAndReturnArgs>(args: SelectSubset<T, PurchaseUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Purchase.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends PurchaseAggregateArgs>(args: Subset<T, PurchaseAggregateArgs>): Prisma.PrismaPromise<GetPurchaseAggregateType<T>>

    /**
     * Group by Purchase.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseGroupByArgs} args - Group by arguments.
     * @example
     * // Group by city, order by createdAt, get count
     * const result = await prisma.user.groupBy({
     *   by: ['city', 'createdAt'],
     *   orderBy: {
     *     createdAt: true
     *   },
     *   _count: {
     *     _all: true
     *   },
     * })
     * 
    **/
    groupBy<
      T extends PurchaseGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: PurchaseGroupByArgs['orderBy'] }
        : { orderBy?: PurchaseGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, PurchaseGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPurchaseGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Purchase model
   */
  readonly fields: PurchaseFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Purchase.
   * Why is this prefixed with `Prisma__`?
   * Because we want to prevent naming conflicts as mentioned in
   * https://github.com/prisma/prisma-client-js/issues/707
   */
  export interface Prisma__PurchaseClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    supplier<T extends Purchase$supplierArgs<ExtArgs> = {}>(args?: Subset<T, Purchase$supplierArgs<ExtArgs>>): Prisma__SupplierClient<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    warehouse<T extends Purchase$warehouseArgs<ExtArgs> = {}>(args?: Subset<T, Purchase$warehouseArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branch<T extends Purchase$branchArgs<ExtArgs> = {}>(args?: Subset<T, Purchase$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends Purchase$linesArgs<ExtArgs> = {}>(args?: Subset<T, Purchase$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    returns<T extends Purchase$returnsArgs<ExtArgs> = {}>(args?: Subset<T, Purchase$returnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Purchase model
   */
  interface PurchaseFieldRefs {
    readonly id: FieldRef<"Purchase", 'String'>
    readonly number: FieldRef<"Purchase", 'String'>
    readonly supplierId: FieldRef<"Purchase", 'String'>
    readonly warehouseId: FieldRef<"Purchase", 'String'>
    readonly branchId: FieldRef<"Purchase", 'String'>
    readonly status: FieldRef<"Purchase", 'String'>
    readonly purchaseDate: FieldRef<"Purchase", 'DateTime'>
    readonly notes: FieldRef<"Purchase", 'String'>
    readonly subtotal: FieldRef<"Purchase", 'Float'>
    readonly taxTotal: FieldRef<"Purchase", 'Float'>
    readonly total: FieldRef<"Purchase", 'Float'>
    readonly createdAt: FieldRef<"Purchase", 'DateTime'>
    readonly updatedAt: FieldRef<"Purchase", 'DateTime'>
    readonly deletedAt: FieldRef<"Purchase", 'DateTime'>
  }
    

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

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

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

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

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

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

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

  /**
   * Purchase createManyAndReturn
   */
  export type PurchaseCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Purchase
     */
    select?: PurchaseSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Purchase
     */
    omit?: PurchaseOmit<ExtArgs> | null
    /**
     * The data used to create many Purchases.
     */
    data: PurchaseCreateManyInput | PurchaseCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseIncludeCreateManyAndReturn<ExtArgs> | null
  }

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

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

  /**
   * Purchase updateManyAndReturn
   */
  export type PurchaseUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Purchase
     */
    select?: PurchaseSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Purchase
     */
    omit?: PurchaseOmit<ExtArgs> | null
    /**
     * The data used to update Purchases.
     */
    data: XOR<PurchaseUpdateManyMutationInput, PurchaseUncheckedUpdateManyInput>
    /**
     * Filter which Purchases to update
     */
    where?: PurchaseWhereInput
    /**
     * Limit how many Purchases to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseIncludeUpdateManyAndReturn<ExtArgs> | null
  }

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

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

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

  /**
   * Purchase.supplier
   */
  export type Purchase$supplierArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    where?: SupplierWhereInput
  }

  /**
   * Purchase.warehouse
   */
  export type Purchase$warehouseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
  }

  /**
   * Purchase.branch
   */
  export type Purchase$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Purchase.lines
   */
  export type Purchase$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    where?: PurchaseLineWhereInput
    orderBy?: PurchaseLineOrderByWithRelationInput | PurchaseLineOrderByWithRelationInput[]
    cursor?: PurchaseLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseLineScalarFieldEnum | PurchaseLineScalarFieldEnum[]
  }

  /**
   * Purchase.returns
   */
  export type Purchase$returnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    where?: PurchaseReturnWhereInput
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    cursor?: PurchaseReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

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


  /**
   * Model PurchaseLine
   */

  export type AggregatePurchaseLine = {
    _count: PurchaseLineCountAggregateOutputType | null
    _avg: PurchaseLineAvgAggregateOutputType | null
    _sum: PurchaseLineSumAggregateOutputType | null
    _min: PurchaseLineMinAggregateOutputType | null
    _max: PurchaseLineMaxAggregateOutputType | null
  }

  export type PurchaseLineAvgAggregateOutputType = {
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseLineSumAggregateOutputType = {
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseLineMinAggregateOutputType = {
    id: string | null
    purchaseId: string | null
    productId: string | null
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseLineMaxAggregateOutputType = {
    id: string | null
    purchaseId: string | null
    productId: string | null
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseLineCountAggregateOutputType = {
    id: number
    purchaseId: number
    productId: number
    quantity: number
    unitCost: number
    taxRate: number
    lineTotal: number
    _all: number
  }


  export type PurchaseLineAvgAggregateInputType = {
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseLineSumAggregateInputType = {
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseLineMinAggregateInputType = {
    id?: true
    purchaseId?: true
    productId?: true
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseLineMaxAggregateInputType = {
    id?: true
    purchaseId?: true
    productId?: true
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseLineCountAggregateInputType = {
    id?: true
    purchaseId?: true
    productId?: true
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
    _all?: true
  }

  export type PurchaseLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PurchaseLine to aggregate.
     */
    where?: PurchaseLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseLines to fetch.
     */
    orderBy?: PurchaseLineOrderByWithRelationInput | PurchaseLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: PurchaseLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseLines 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` PurchaseLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned PurchaseLines
    **/
    _count?: true | PurchaseLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: PurchaseLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: PurchaseLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: PurchaseLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: PurchaseLineMaxAggregateInputType
  }

  export type GetPurchaseLineAggregateType<T extends PurchaseLineAggregateArgs> = {
        [P in keyof T & keyof AggregatePurchaseLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregatePurchaseLine[P]>
      : GetScalarType<T[P], AggregatePurchaseLine[P]>
  }




  export type PurchaseLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseLineWhereInput
    orderBy?: PurchaseLineOrderByWithAggregationInput | PurchaseLineOrderByWithAggregationInput[]
    by: PurchaseLineScalarFieldEnum[] | PurchaseLineScalarFieldEnum
    having?: PurchaseLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: PurchaseLineCountAggregateInputType | true
    _avg?: PurchaseLineAvgAggregateInputType
    _sum?: PurchaseLineSumAggregateInputType
    _min?: PurchaseLineMinAggregateInputType
    _max?: PurchaseLineMaxAggregateInputType
  }

  export type PurchaseLineGroupByOutputType = {
    id: string
    purchaseId: string
    productId: string
    quantity: number
    unitCost: number
    taxRate: number
    lineTotal: number
    _count: PurchaseLineCountAggregateOutputType | null
    _avg: PurchaseLineAvgAggregateOutputType | null
    _sum: PurchaseLineSumAggregateOutputType | null
    _min: PurchaseLineMinAggregateOutputType | null
    _max: PurchaseLineMaxAggregateOutputType | null
  }

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


  export type PurchaseLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    purchaseId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    purchase?: boolean | PurchaseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseLine"]>

  export type PurchaseLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    purchaseId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    purchase?: boolean | PurchaseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseLine"]>

  export type PurchaseLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    purchaseId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    purchase?: boolean | PurchaseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseLine"]>

  export type PurchaseLineSelectScalar = {
    id?: boolean
    purchaseId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
  }

  export type PurchaseLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "purchaseId" | "productId" | "quantity" | "unitCost" | "taxRate" | "lineTotal", ExtArgs["result"]["purchaseLine"]>
  export type PurchaseLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchase?: boolean | PurchaseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type PurchaseLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchase?: boolean | PurchaseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type PurchaseLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchase?: boolean | PurchaseDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $PurchaseLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "PurchaseLine"
    objects: {
      purchase: Prisma.$PurchasePayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      purchaseId: string
      productId: string
      quantity: number
      unitCost: number
      taxRate: number
      lineTotal: number
    }, ExtArgs["result"]["purchaseLine"]>
    composites: {}
  }

  type PurchaseLineGetPayload<S extends boolean | null | undefined | PurchaseLineDefaultArgs> = $Result.GetResult<Prisma.$PurchaseLinePayload, S>

  type PurchaseLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<PurchaseLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: PurchaseLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a PurchaseLine.
     * @param {PurchaseLineCreateArgs} args - Arguments to create a PurchaseLine.
     * @example
     * // Create one PurchaseLine
     * const PurchaseLine = await prisma.purchaseLine.create({
     *   data: {
     *     // ... data to create a PurchaseLine
     *   }
     * })
     * 
     */
    create<T extends PurchaseLineCreateArgs>(args: SelectSubset<T, PurchaseLineCreateArgs<ExtArgs>>): Prisma__PurchaseLineClient<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many PurchaseLines and returns the data saved in the database.
     * @param {PurchaseLineCreateManyAndReturnArgs} args - Arguments to create many PurchaseLines.
     * @example
     * // Create many PurchaseLines
     * const purchaseLine = await prisma.purchaseLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many PurchaseLines and only return the `id`
     * const purchaseLineWithIdOnly = await prisma.purchaseLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends PurchaseLineCreateManyAndReturnArgs>(args?: SelectSubset<T, PurchaseLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a PurchaseLine.
     * @param {PurchaseLineDeleteArgs} args - Arguments to delete one PurchaseLine.
     * @example
     * // Delete one PurchaseLine
     * const PurchaseLine = await prisma.purchaseLine.delete({
     *   where: {
     *     // ... filter to delete one PurchaseLine
     *   }
     * })
     * 
     */
    delete<T extends PurchaseLineDeleteArgs>(args: SelectSubset<T, PurchaseLineDeleteArgs<ExtArgs>>): Prisma__PurchaseLineClient<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one PurchaseLine.
     * @param {PurchaseLineUpdateArgs} args - Arguments to update one PurchaseLine.
     * @example
     * // Update one PurchaseLine
     * const purchaseLine = await prisma.purchaseLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends PurchaseLineUpdateArgs>(args: SelectSubset<T, PurchaseLineUpdateArgs<ExtArgs>>): Prisma__PurchaseLineClient<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more PurchaseLines and returns the data updated in the database.
     * @param {PurchaseLineUpdateManyAndReturnArgs} args - Arguments to update many PurchaseLines.
     * @example
     * // Update many PurchaseLines
     * const purchaseLine = await prisma.purchaseLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more PurchaseLines and only return the `id`
     * const purchaseLineWithIdOnly = await prisma.purchaseLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends PurchaseLineUpdateManyAndReturnArgs>(args: SelectSubset<T, PurchaseLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a PurchaseLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends PurchaseLineAggregateArgs>(args: Subset<T, PurchaseLineAggregateArgs>): Prisma.PrismaPromise<GetPurchaseLineAggregateType<T>>

    /**
     * Group by PurchaseLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseLineGroupByArgs} 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 PurchaseLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: PurchaseLineGroupByArgs['orderBy'] }
        : { orderBy?: PurchaseLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, PurchaseLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPurchaseLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the PurchaseLine model
   */
  readonly fields: PurchaseLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for PurchaseLine.
   * 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__PurchaseLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    purchase<T extends PurchaseDefaultArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseDefaultArgs<ExtArgs>>): Prisma__PurchaseClient<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the PurchaseLine model
   */
  interface PurchaseLineFieldRefs {
    readonly id: FieldRef<"PurchaseLine", 'String'>
    readonly purchaseId: FieldRef<"PurchaseLine", 'String'>
    readonly productId: FieldRef<"PurchaseLine", 'String'>
    readonly quantity: FieldRef<"PurchaseLine", 'Int'>
    readonly unitCost: FieldRef<"PurchaseLine", 'Float'>
    readonly taxRate: FieldRef<"PurchaseLine", 'Float'>
    readonly lineTotal: FieldRef<"PurchaseLine", 'Float'>
  }
    

  // Custom InputTypes
  /**
   * PurchaseLine findUnique
   */
  export type PurchaseLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseLine to fetch.
     */
    where: PurchaseLineWhereUniqueInput
  }

  /**
   * PurchaseLine findUniqueOrThrow
   */
  export type PurchaseLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseLine to fetch.
     */
    where: PurchaseLineWhereUniqueInput
  }

  /**
   * PurchaseLine findFirst
   */
  export type PurchaseLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseLine to fetch.
     */
    where?: PurchaseLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseLines to fetch.
     */
    orderBy?: PurchaseLineOrderByWithRelationInput | PurchaseLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PurchaseLines.
     */
    cursor?: PurchaseLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseLines 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` PurchaseLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseLines.
     */
    distinct?: PurchaseLineScalarFieldEnum | PurchaseLineScalarFieldEnum[]
  }

  /**
   * PurchaseLine findFirstOrThrow
   */
  export type PurchaseLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseLine to fetch.
     */
    where?: PurchaseLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseLines to fetch.
     */
    orderBy?: PurchaseLineOrderByWithRelationInput | PurchaseLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PurchaseLines.
     */
    cursor?: PurchaseLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseLines 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` PurchaseLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseLines.
     */
    distinct?: PurchaseLineScalarFieldEnum | PurchaseLineScalarFieldEnum[]
  }

  /**
   * PurchaseLine findMany
   */
  export type PurchaseLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseLines to fetch.
     */
    where?: PurchaseLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseLines to fetch.
     */
    orderBy?: PurchaseLineOrderByWithRelationInput | PurchaseLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing PurchaseLines.
     */
    cursor?: PurchaseLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseLines 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` PurchaseLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseLines.
     */
    distinct?: PurchaseLineScalarFieldEnum | PurchaseLineScalarFieldEnum[]
  }

  /**
   * PurchaseLine create
   */
  export type PurchaseLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * The data needed to create a PurchaseLine.
     */
    data: XOR<PurchaseLineCreateInput, PurchaseLineUncheckedCreateInput>
  }

  /**
   * PurchaseLine createMany
   */
  export type PurchaseLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many PurchaseLines.
     */
    data: PurchaseLineCreateManyInput | PurchaseLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * PurchaseLine createManyAndReturn
   */
  export type PurchaseLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * The data used to create many PurchaseLines.
     */
    data: PurchaseLineCreateManyInput | PurchaseLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * PurchaseLine update
   */
  export type PurchaseLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * The data needed to update a PurchaseLine.
     */
    data: XOR<PurchaseLineUpdateInput, PurchaseLineUncheckedUpdateInput>
    /**
     * Choose, which PurchaseLine to update.
     */
    where: PurchaseLineWhereUniqueInput
  }

  /**
   * PurchaseLine updateMany
   */
  export type PurchaseLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update PurchaseLines.
     */
    data: XOR<PurchaseLineUpdateManyMutationInput, PurchaseLineUncheckedUpdateManyInput>
    /**
     * Filter which PurchaseLines to update
     */
    where?: PurchaseLineWhereInput
    /**
     * Limit how many PurchaseLines to update.
     */
    limit?: number
  }

  /**
   * PurchaseLine updateManyAndReturn
   */
  export type PurchaseLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * The data used to update PurchaseLines.
     */
    data: XOR<PurchaseLineUpdateManyMutationInput, PurchaseLineUncheckedUpdateManyInput>
    /**
     * Filter which PurchaseLines to update
     */
    where?: PurchaseLineWhereInput
    /**
     * Limit how many PurchaseLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * PurchaseLine upsert
   */
  export type PurchaseLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * The filter to search for the PurchaseLine to update in case it exists.
     */
    where: PurchaseLineWhereUniqueInput
    /**
     * In case the PurchaseLine found by the `where` argument doesn't exist, create a new PurchaseLine with this data.
     */
    create: XOR<PurchaseLineCreateInput, PurchaseLineUncheckedCreateInput>
    /**
     * In case the PurchaseLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<PurchaseLineUpdateInput, PurchaseLineUncheckedUpdateInput>
  }

  /**
   * PurchaseLine delete
   */
  export type PurchaseLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    /**
     * Filter which PurchaseLine to delete.
     */
    where: PurchaseLineWhereUniqueInput
  }

  /**
   * PurchaseLine deleteMany
   */
  export type PurchaseLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PurchaseLines to delete
     */
    where?: PurchaseLineWhereInput
    /**
     * Limit how many PurchaseLines to delete.
     */
    limit?: number
  }

  /**
   * PurchaseLine without action
   */
  export type PurchaseLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
  }


  /**
   * Model PurchaseReturn
   */

  export type AggregatePurchaseReturn = {
    _count: PurchaseReturnCountAggregateOutputType | null
    _avg: PurchaseReturnAvgAggregateOutputType | null
    _sum: PurchaseReturnSumAggregateOutputType | null
    _min: PurchaseReturnMinAggregateOutputType | null
    _max: PurchaseReturnMaxAggregateOutputType | null
  }

  export type PurchaseReturnAvgAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type PurchaseReturnSumAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type PurchaseReturnMinAggregateOutputType = {
    id: string | null
    number: string | null
    purchaseId: string | null
    supplierId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string | null
    returnDate: Date | null
    reason: string | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type PurchaseReturnMaxAggregateOutputType = {
    id: string | null
    number: string | null
    purchaseId: string | null
    supplierId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string | null
    returnDate: Date | null
    reason: string | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type PurchaseReturnCountAggregateOutputType = {
    id: number
    number: number
    purchaseId: number
    supplierId: number
    warehouseId: number
    branchId: number
    status: number
    returnDate: number
    reason: number
    notes: number
    subtotal: number
    taxTotal: number
    total: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type PurchaseReturnAvgAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type PurchaseReturnSumAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type PurchaseReturnMinAggregateInputType = {
    id?: true
    number?: true
    purchaseId?: true
    supplierId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    returnDate?: true
    reason?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
  }

  export type PurchaseReturnMaxAggregateInputType = {
    id?: true
    number?: true
    purchaseId?: true
    supplierId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    returnDate?: true
    reason?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
  }

  export type PurchaseReturnCountAggregateInputType = {
    id?: true
    number?: true
    purchaseId?: true
    supplierId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    returnDate?: true
    reason?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type PurchaseReturnAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PurchaseReturn to aggregate.
     */
    where?: PurchaseReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturns to fetch.
     */
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: PurchaseReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturns 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` PurchaseReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned PurchaseReturns
    **/
    _count?: true | PurchaseReturnCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: PurchaseReturnAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: PurchaseReturnSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: PurchaseReturnMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: PurchaseReturnMaxAggregateInputType
  }

  export type GetPurchaseReturnAggregateType<T extends PurchaseReturnAggregateArgs> = {
        [P in keyof T & keyof AggregatePurchaseReturn]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregatePurchaseReturn[P]>
      : GetScalarType<T[P], AggregatePurchaseReturn[P]>
  }




  export type PurchaseReturnGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnWhereInput
    orderBy?: PurchaseReturnOrderByWithAggregationInput | PurchaseReturnOrderByWithAggregationInput[]
    by: PurchaseReturnScalarFieldEnum[] | PurchaseReturnScalarFieldEnum
    having?: PurchaseReturnScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: PurchaseReturnCountAggregateInputType | true
    _avg?: PurchaseReturnAvgAggregateInputType
    _sum?: PurchaseReturnSumAggregateInputType
    _min?: PurchaseReturnMinAggregateInputType
    _max?: PurchaseReturnMaxAggregateInputType
  }

  export type PurchaseReturnGroupByOutputType = {
    id: string
    number: string
    purchaseId: string | null
    supplierId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string
    returnDate: Date
    reason: string | null
    notes: string | null
    subtotal: number
    taxTotal: number
    total: number
    createdAt: Date
    updatedAt: Date
    _count: PurchaseReturnCountAggregateOutputType | null
    _avg: PurchaseReturnAvgAggregateOutputType | null
    _sum: PurchaseReturnSumAggregateOutputType | null
    _min: PurchaseReturnMinAggregateOutputType | null
    _max: PurchaseReturnMaxAggregateOutputType | null
  }

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


  export type PurchaseReturnSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    purchaseId?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    purchase?: boolean | PurchaseReturn$purchaseArgs<ExtArgs>
    supplier?: boolean | PurchaseReturn$supplierArgs<ExtArgs>
    warehouse?: boolean | PurchaseReturn$warehouseArgs<ExtArgs>
    branch?: boolean | PurchaseReturn$branchArgs<ExtArgs>
    lines?: boolean | PurchaseReturn$linesArgs<ExtArgs>
    _count?: boolean | PurchaseReturnCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseReturn"]>

  export type PurchaseReturnSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    purchaseId?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    purchase?: boolean | PurchaseReturn$purchaseArgs<ExtArgs>
    supplier?: boolean | PurchaseReturn$supplierArgs<ExtArgs>
    warehouse?: boolean | PurchaseReturn$warehouseArgs<ExtArgs>
    branch?: boolean | PurchaseReturn$branchArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseReturn"]>

  export type PurchaseReturnSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    purchaseId?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    purchase?: boolean | PurchaseReturn$purchaseArgs<ExtArgs>
    supplier?: boolean | PurchaseReturn$supplierArgs<ExtArgs>
    warehouse?: boolean | PurchaseReturn$warehouseArgs<ExtArgs>
    branch?: boolean | PurchaseReturn$branchArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseReturn"]>

  export type PurchaseReturnSelectScalar = {
    id?: boolean
    number?: boolean
    purchaseId?: boolean
    supplierId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type PurchaseReturnOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "number" | "purchaseId" | "supplierId" | "warehouseId" | "branchId" | "status" | "returnDate" | "reason" | "notes" | "subtotal" | "taxTotal" | "total" | "createdAt" | "updatedAt", ExtArgs["result"]["purchaseReturn"]>
  export type PurchaseReturnInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchase?: boolean | PurchaseReturn$purchaseArgs<ExtArgs>
    supplier?: boolean | PurchaseReturn$supplierArgs<ExtArgs>
    warehouse?: boolean | PurchaseReturn$warehouseArgs<ExtArgs>
    branch?: boolean | PurchaseReturn$branchArgs<ExtArgs>
    lines?: boolean | PurchaseReturn$linesArgs<ExtArgs>
    _count?: boolean | PurchaseReturnCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type PurchaseReturnIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchase?: boolean | PurchaseReturn$purchaseArgs<ExtArgs>
    supplier?: boolean | PurchaseReturn$supplierArgs<ExtArgs>
    warehouse?: boolean | PurchaseReturn$warehouseArgs<ExtArgs>
    branch?: boolean | PurchaseReturn$branchArgs<ExtArgs>
  }
  export type PurchaseReturnIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchase?: boolean | PurchaseReturn$purchaseArgs<ExtArgs>
    supplier?: boolean | PurchaseReturn$supplierArgs<ExtArgs>
    warehouse?: boolean | PurchaseReturn$warehouseArgs<ExtArgs>
    branch?: boolean | PurchaseReturn$branchArgs<ExtArgs>
  }

  export type $PurchaseReturnPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "PurchaseReturn"
    objects: {
      purchase: Prisma.$PurchasePayload<ExtArgs> | null
      supplier: Prisma.$SupplierPayload<ExtArgs> | null
      warehouse: Prisma.$WarehousePayload<ExtArgs> | null
      branch: Prisma.$BranchPayload<ExtArgs> | null
      lines: Prisma.$PurchaseReturnLinePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      number: string
      purchaseId: string | null
      supplierId: string | null
      warehouseId: string | null
      branchId: string | null
      status: string
      returnDate: Date
      reason: string | null
      notes: string | null
      subtotal: number
      taxTotal: number
      total: number
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["purchaseReturn"]>
    composites: {}
  }

  type PurchaseReturnGetPayload<S extends boolean | null | undefined | PurchaseReturnDefaultArgs> = $Result.GetResult<Prisma.$PurchaseReturnPayload, S>

  type PurchaseReturnCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<PurchaseReturnFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: PurchaseReturnCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a PurchaseReturn.
     * @param {PurchaseReturnCreateArgs} args - Arguments to create a PurchaseReturn.
     * @example
     * // Create one PurchaseReturn
     * const PurchaseReturn = await prisma.purchaseReturn.create({
     *   data: {
     *     // ... data to create a PurchaseReturn
     *   }
     * })
     * 
     */
    create<T extends PurchaseReturnCreateArgs>(args: SelectSubset<T, PurchaseReturnCreateArgs<ExtArgs>>): Prisma__PurchaseReturnClient<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many PurchaseReturns and returns the data saved in the database.
     * @param {PurchaseReturnCreateManyAndReturnArgs} args - Arguments to create many PurchaseReturns.
     * @example
     * // Create many PurchaseReturns
     * const purchaseReturn = await prisma.purchaseReturn.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many PurchaseReturns and only return the `id`
     * const purchaseReturnWithIdOnly = await prisma.purchaseReturn.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends PurchaseReturnCreateManyAndReturnArgs>(args?: SelectSubset<T, PurchaseReturnCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a PurchaseReturn.
     * @param {PurchaseReturnDeleteArgs} args - Arguments to delete one PurchaseReturn.
     * @example
     * // Delete one PurchaseReturn
     * const PurchaseReturn = await prisma.purchaseReturn.delete({
     *   where: {
     *     // ... filter to delete one PurchaseReturn
     *   }
     * })
     * 
     */
    delete<T extends PurchaseReturnDeleteArgs>(args: SelectSubset<T, PurchaseReturnDeleteArgs<ExtArgs>>): Prisma__PurchaseReturnClient<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one PurchaseReturn.
     * @param {PurchaseReturnUpdateArgs} args - Arguments to update one PurchaseReturn.
     * @example
     * // Update one PurchaseReturn
     * const purchaseReturn = await prisma.purchaseReturn.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends PurchaseReturnUpdateArgs>(args: SelectSubset<T, PurchaseReturnUpdateArgs<ExtArgs>>): Prisma__PurchaseReturnClient<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more PurchaseReturns and returns the data updated in the database.
     * @param {PurchaseReturnUpdateManyAndReturnArgs} args - Arguments to update many PurchaseReturns.
     * @example
     * // Update many PurchaseReturns
     * const purchaseReturn = await prisma.purchaseReturn.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more PurchaseReturns and only return the `id`
     * const purchaseReturnWithIdOnly = await prisma.purchaseReturn.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends PurchaseReturnUpdateManyAndReturnArgs>(args: SelectSubset<T, PurchaseReturnUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a PurchaseReturn.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseReturnAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends PurchaseReturnAggregateArgs>(args: Subset<T, PurchaseReturnAggregateArgs>): Prisma.PrismaPromise<GetPurchaseReturnAggregateType<T>>

    /**
     * Group by PurchaseReturn.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseReturnGroupByArgs} 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 PurchaseReturnGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: PurchaseReturnGroupByArgs['orderBy'] }
        : { orderBy?: PurchaseReturnGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, PurchaseReturnGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPurchaseReturnGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the PurchaseReturn model
   */
  readonly fields: PurchaseReturnFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for PurchaseReturn.
   * 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__PurchaseReturnClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    purchase<T extends PurchaseReturn$purchaseArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseReturn$purchaseArgs<ExtArgs>>): Prisma__PurchaseClient<$Result.GetResult<Prisma.$PurchasePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    supplier<T extends PurchaseReturn$supplierArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseReturn$supplierArgs<ExtArgs>>): Prisma__SupplierClient<$Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    warehouse<T extends PurchaseReturn$warehouseArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseReturn$warehouseArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branch<T extends PurchaseReturn$branchArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseReturn$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends PurchaseReturn$linesArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseReturn$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the PurchaseReturn model
   */
  interface PurchaseReturnFieldRefs {
    readonly id: FieldRef<"PurchaseReturn", 'String'>
    readonly number: FieldRef<"PurchaseReturn", 'String'>
    readonly purchaseId: FieldRef<"PurchaseReturn", 'String'>
    readonly supplierId: FieldRef<"PurchaseReturn", 'String'>
    readonly warehouseId: FieldRef<"PurchaseReturn", 'String'>
    readonly branchId: FieldRef<"PurchaseReturn", 'String'>
    readonly status: FieldRef<"PurchaseReturn", 'String'>
    readonly returnDate: FieldRef<"PurchaseReturn", 'DateTime'>
    readonly reason: FieldRef<"PurchaseReturn", 'String'>
    readonly notes: FieldRef<"PurchaseReturn", 'String'>
    readonly subtotal: FieldRef<"PurchaseReturn", 'Float'>
    readonly taxTotal: FieldRef<"PurchaseReturn", 'Float'>
    readonly total: FieldRef<"PurchaseReturn", 'Float'>
    readonly createdAt: FieldRef<"PurchaseReturn", 'DateTime'>
    readonly updatedAt: FieldRef<"PurchaseReturn", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * PurchaseReturn findUnique
   */
  export type PurchaseReturnFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturn to fetch.
     */
    where: PurchaseReturnWhereUniqueInput
  }

  /**
   * PurchaseReturn findUniqueOrThrow
   */
  export type PurchaseReturnFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturn to fetch.
     */
    where: PurchaseReturnWhereUniqueInput
  }

  /**
   * PurchaseReturn findFirst
   */
  export type PurchaseReturnFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturn to fetch.
     */
    where?: PurchaseReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturns to fetch.
     */
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PurchaseReturns.
     */
    cursor?: PurchaseReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturns 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` PurchaseReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseReturns.
     */
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

  /**
   * PurchaseReturn findFirstOrThrow
   */
  export type PurchaseReturnFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturn to fetch.
     */
    where?: PurchaseReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturns to fetch.
     */
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PurchaseReturns.
     */
    cursor?: PurchaseReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturns 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` PurchaseReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseReturns.
     */
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

  /**
   * PurchaseReturn findMany
   */
  export type PurchaseReturnFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturns to fetch.
     */
    where?: PurchaseReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturns to fetch.
     */
    orderBy?: PurchaseReturnOrderByWithRelationInput | PurchaseReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing PurchaseReturns.
     */
    cursor?: PurchaseReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturns 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` PurchaseReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseReturns.
     */
    distinct?: PurchaseReturnScalarFieldEnum | PurchaseReturnScalarFieldEnum[]
  }

  /**
   * PurchaseReturn create
   */
  export type PurchaseReturnCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * The data needed to create a PurchaseReturn.
     */
    data: XOR<PurchaseReturnCreateInput, PurchaseReturnUncheckedCreateInput>
  }

  /**
   * PurchaseReturn createMany
   */
  export type PurchaseReturnCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many PurchaseReturns.
     */
    data: PurchaseReturnCreateManyInput | PurchaseReturnCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * PurchaseReturn createManyAndReturn
   */
  export type PurchaseReturnCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * The data used to create many PurchaseReturns.
     */
    data: PurchaseReturnCreateManyInput | PurchaseReturnCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * PurchaseReturn update
   */
  export type PurchaseReturnUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * The data needed to update a PurchaseReturn.
     */
    data: XOR<PurchaseReturnUpdateInput, PurchaseReturnUncheckedUpdateInput>
    /**
     * Choose, which PurchaseReturn to update.
     */
    where: PurchaseReturnWhereUniqueInput
  }

  /**
   * PurchaseReturn updateMany
   */
  export type PurchaseReturnUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update PurchaseReturns.
     */
    data: XOR<PurchaseReturnUpdateManyMutationInput, PurchaseReturnUncheckedUpdateManyInput>
    /**
     * Filter which PurchaseReturns to update
     */
    where?: PurchaseReturnWhereInput
    /**
     * Limit how many PurchaseReturns to update.
     */
    limit?: number
  }

  /**
   * PurchaseReturn updateManyAndReturn
   */
  export type PurchaseReturnUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * The data used to update PurchaseReturns.
     */
    data: XOR<PurchaseReturnUpdateManyMutationInput, PurchaseReturnUncheckedUpdateManyInput>
    /**
     * Filter which PurchaseReturns to update
     */
    where?: PurchaseReturnWhereInput
    /**
     * Limit how many PurchaseReturns to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * PurchaseReturn upsert
   */
  export type PurchaseReturnUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * The filter to search for the PurchaseReturn to update in case it exists.
     */
    where: PurchaseReturnWhereUniqueInput
    /**
     * In case the PurchaseReturn found by the `where` argument doesn't exist, create a new PurchaseReturn with this data.
     */
    create: XOR<PurchaseReturnCreateInput, PurchaseReturnUncheckedCreateInput>
    /**
     * In case the PurchaseReturn was found with the provided `where` argument, update it with this data.
     */
    update: XOR<PurchaseReturnUpdateInput, PurchaseReturnUncheckedUpdateInput>
  }

  /**
   * PurchaseReturn delete
   */
  export type PurchaseReturnDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
    /**
     * Filter which PurchaseReturn to delete.
     */
    where: PurchaseReturnWhereUniqueInput
  }

  /**
   * PurchaseReturn deleteMany
   */
  export type PurchaseReturnDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PurchaseReturns to delete
     */
    where?: PurchaseReturnWhereInput
    /**
     * Limit how many PurchaseReturns to delete.
     */
    limit?: number
  }

  /**
   * PurchaseReturn.purchase
   */
  export type PurchaseReturn$purchaseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Purchase
     */
    select?: PurchaseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Purchase
     */
    omit?: PurchaseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseInclude<ExtArgs> | null
    where?: PurchaseWhereInput
  }

  /**
   * PurchaseReturn.supplier
   */
  export type PurchaseReturn$supplierArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Supplier
     */
    select?: SupplierSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Supplier
     */
    omit?: SupplierOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SupplierInclude<ExtArgs> | null
    where?: SupplierWhereInput
  }

  /**
   * PurchaseReturn.warehouse
   */
  export type PurchaseReturn$warehouseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
  }

  /**
   * PurchaseReturn.branch
   */
  export type PurchaseReturn$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * PurchaseReturn.lines
   */
  export type PurchaseReturn$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    where?: PurchaseReturnLineWhereInput
    orderBy?: PurchaseReturnLineOrderByWithRelationInput | PurchaseReturnLineOrderByWithRelationInput[]
    cursor?: PurchaseReturnLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseReturnLineScalarFieldEnum | PurchaseReturnLineScalarFieldEnum[]
  }

  /**
   * PurchaseReturn without action
   */
  export type PurchaseReturnDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturn
     */
    select?: PurchaseReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturn
     */
    omit?: PurchaseReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnInclude<ExtArgs> | null
  }


  /**
   * Model PurchaseReturnLine
   */

  export type AggregatePurchaseReturnLine = {
    _count: PurchaseReturnLineCountAggregateOutputType | null
    _avg: PurchaseReturnLineAvgAggregateOutputType | null
    _sum: PurchaseReturnLineSumAggregateOutputType | null
    _min: PurchaseReturnLineMinAggregateOutputType | null
    _max: PurchaseReturnLineMaxAggregateOutputType | null
  }

  export type PurchaseReturnLineAvgAggregateOutputType = {
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseReturnLineSumAggregateOutputType = {
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseReturnLineMinAggregateOutputType = {
    id: string | null
    purchaseReturnId: string | null
    productId: string | null
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseReturnLineMaxAggregateOutputType = {
    id: string | null
    purchaseReturnId: string | null
    productId: string | null
    quantity: number | null
    unitCost: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type PurchaseReturnLineCountAggregateOutputType = {
    id: number
    purchaseReturnId: number
    productId: number
    quantity: number
    unitCost: number
    taxRate: number
    lineTotal: number
    _all: number
  }


  export type PurchaseReturnLineAvgAggregateInputType = {
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseReturnLineSumAggregateInputType = {
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseReturnLineMinAggregateInputType = {
    id?: true
    purchaseReturnId?: true
    productId?: true
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseReturnLineMaxAggregateInputType = {
    id?: true
    purchaseReturnId?: true
    productId?: true
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
  }

  export type PurchaseReturnLineCountAggregateInputType = {
    id?: true
    purchaseReturnId?: true
    productId?: true
    quantity?: true
    unitCost?: true
    taxRate?: true
    lineTotal?: true
    _all?: true
  }

  export type PurchaseReturnLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PurchaseReturnLine to aggregate.
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturnLines to fetch.
     */
    orderBy?: PurchaseReturnLineOrderByWithRelationInput | PurchaseReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: PurchaseReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturnLines 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` PurchaseReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned PurchaseReturnLines
    **/
    _count?: true | PurchaseReturnLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: PurchaseReturnLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: PurchaseReturnLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: PurchaseReturnLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: PurchaseReturnLineMaxAggregateInputType
  }

  export type GetPurchaseReturnLineAggregateType<T extends PurchaseReturnLineAggregateArgs> = {
        [P in keyof T & keyof AggregatePurchaseReturnLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregatePurchaseReturnLine[P]>
      : GetScalarType<T[P], AggregatePurchaseReturnLine[P]>
  }




  export type PurchaseReturnLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PurchaseReturnLineWhereInput
    orderBy?: PurchaseReturnLineOrderByWithAggregationInput | PurchaseReturnLineOrderByWithAggregationInput[]
    by: PurchaseReturnLineScalarFieldEnum[] | PurchaseReturnLineScalarFieldEnum
    having?: PurchaseReturnLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: PurchaseReturnLineCountAggregateInputType | true
    _avg?: PurchaseReturnLineAvgAggregateInputType
    _sum?: PurchaseReturnLineSumAggregateInputType
    _min?: PurchaseReturnLineMinAggregateInputType
    _max?: PurchaseReturnLineMaxAggregateInputType
  }

  export type PurchaseReturnLineGroupByOutputType = {
    id: string
    purchaseReturnId: string
    productId: string
    quantity: number
    unitCost: number
    taxRate: number
    lineTotal: number
    _count: PurchaseReturnLineCountAggregateOutputType | null
    _avg: PurchaseReturnLineAvgAggregateOutputType | null
    _sum: PurchaseReturnLineSumAggregateOutputType | null
    _min: PurchaseReturnLineMinAggregateOutputType | null
    _max: PurchaseReturnLineMaxAggregateOutputType | null
  }

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


  export type PurchaseReturnLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    purchaseReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    purchaseReturn?: boolean | PurchaseReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseReturnLine"]>

  export type PurchaseReturnLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    purchaseReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    purchaseReturn?: boolean | PurchaseReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseReturnLine"]>

  export type PurchaseReturnLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    purchaseReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    purchaseReturn?: boolean | PurchaseReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["purchaseReturnLine"]>

  export type PurchaseReturnLineSelectScalar = {
    id?: boolean
    purchaseReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitCost?: boolean
    taxRate?: boolean
    lineTotal?: boolean
  }

  export type PurchaseReturnLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "purchaseReturnId" | "productId" | "quantity" | "unitCost" | "taxRate" | "lineTotal", ExtArgs["result"]["purchaseReturnLine"]>
  export type PurchaseReturnLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchaseReturn?: boolean | PurchaseReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type PurchaseReturnLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchaseReturn?: boolean | PurchaseReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type PurchaseReturnLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    purchaseReturn?: boolean | PurchaseReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $PurchaseReturnLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "PurchaseReturnLine"
    objects: {
      purchaseReturn: Prisma.$PurchaseReturnPayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      purchaseReturnId: string
      productId: string
      quantity: number
      unitCost: number
      taxRate: number
      lineTotal: number
    }, ExtArgs["result"]["purchaseReturnLine"]>
    composites: {}
  }

  type PurchaseReturnLineGetPayload<S extends boolean | null | undefined | PurchaseReturnLineDefaultArgs> = $Result.GetResult<Prisma.$PurchaseReturnLinePayload, S>

  type PurchaseReturnLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<PurchaseReturnLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: PurchaseReturnLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a PurchaseReturnLine.
     * @param {PurchaseReturnLineCreateArgs} args - Arguments to create a PurchaseReturnLine.
     * @example
     * // Create one PurchaseReturnLine
     * const PurchaseReturnLine = await prisma.purchaseReturnLine.create({
     *   data: {
     *     // ... data to create a PurchaseReturnLine
     *   }
     * })
     * 
     */
    create<T extends PurchaseReturnLineCreateArgs>(args: SelectSubset<T, PurchaseReturnLineCreateArgs<ExtArgs>>): Prisma__PurchaseReturnLineClient<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many PurchaseReturnLines and returns the data saved in the database.
     * @param {PurchaseReturnLineCreateManyAndReturnArgs} args - Arguments to create many PurchaseReturnLines.
     * @example
     * // Create many PurchaseReturnLines
     * const purchaseReturnLine = await prisma.purchaseReturnLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many PurchaseReturnLines and only return the `id`
     * const purchaseReturnLineWithIdOnly = await prisma.purchaseReturnLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends PurchaseReturnLineCreateManyAndReturnArgs>(args?: SelectSubset<T, PurchaseReturnLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a PurchaseReturnLine.
     * @param {PurchaseReturnLineDeleteArgs} args - Arguments to delete one PurchaseReturnLine.
     * @example
     * // Delete one PurchaseReturnLine
     * const PurchaseReturnLine = await prisma.purchaseReturnLine.delete({
     *   where: {
     *     // ... filter to delete one PurchaseReturnLine
     *   }
     * })
     * 
     */
    delete<T extends PurchaseReturnLineDeleteArgs>(args: SelectSubset<T, PurchaseReturnLineDeleteArgs<ExtArgs>>): Prisma__PurchaseReturnLineClient<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one PurchaseReturnLine.
     * @param {PurchaseReturnLineUpdateArgs} args - Arguments to update one PurchaseReturnLine.
     * @example
     * // Update one PurchaseReturnLine
     * const purchaseReturnLine = await prisma.purchaseReturnLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends PurchaseReturnLineUpdateArgs>(args: SelectSubset<T, PurchaseReturnLineUpdateArgs<ExtArgs>>): Prisma__PurchaseReturnLineClient<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more PurchaseReturnLines and returns the data updated in the database.
     * @param {PurchaseReturnLineUpdateManyAndReturnArgs} args - Arguments to update many PurchaseReturnLines.
     * @example
     * // Update many PurchaseReturnLines
     * const purchaseReturnLine = await prisma.purchaseReturnLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more PurchaseReturnLines and only return the `id`
     * const purchaseReturnLineWithIdOnly = await prisma.purchaseReturnLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends PurchaseReturnLineUpdateManyAndReturnArgs>(args: SelectSubset<T, PurchaseReturnLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a PurchaseReturnLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseReturnLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends PurchaseReturnLineAggregateArgs>(args: Subset<T, PurchaseReturnLineAggregateArgs>): Prisma.PrismaPromise<GetPurchaseReturnLineAggregateType<T>>

    /**
     * Group by PurchaseReturnLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PurchaseReturnLineGroupByArgs} 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 PurchaseReturnLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: PurchaseReturnLineGroupByArgs['orderBy'] }
        : { orderBy?: PurchaseReturnLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, PurchaseReturnLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPurchaseReturnLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the PurchaseReturnLine model
   */
  readonly fields: PurchaseReturnLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for PurchaseReturnLine.
   * 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__PurchaseReturnLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    purchaseReturn<T extends PurchaseReturnDefaultArgs<ExtArgs> = {}>(args?: Subset<T, PurchaseReturnDefaultArgs<ExtArgs>>): Prisma__PurchaseReturnClient<$Result.GetResult<Prisma.$PurchaseReturnPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the PurchaseReturnLine model
   */
  interface PurchaseReturnLineFieldRefs {
    readonly id: FieldRef<"PurchaseReturnLine", 'String'>
    readonly purchaseReturnId: FieldRef<"PurchaseReturnLine", 'String'>
    readonly productId: FieldRef<"PurchaseReturnLine", 'String'>
    readonly quantity: FieldRef<"PurchaseReturnLine", 'Int'>
    readonly unitCost: FieldRef<"PurchaseReturnLine", 'Float'>
    readonly taxRate: FieldRef<"PurchaseReturnLine", 'Float'>
    readonly lineTotal: FieldRef<"PurchaseReturnLine", 'Float'>
  }
    

  // Custom InputTypes
  /**
   * PurchaseReturnLine findUnique
   */
  export type PurchaseReturnLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturnLine to fetch.
     */
    where: PurchaseReturnLineWhereUniqueInput
  }

  /**
   * PurchaseReturnLine findUniqueOrThrow
   */
  export type PurchaseReturnLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturnLine to fetch.
     */
    where: PurchaseReturnLineWhereUniqueInput
  }

  /**
   * PurchaseReturnLine findFirst
   */
  export type PurchaseReturnLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturnLine to fetch.
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturnLines to fetch.
     */
    orderBy?: PurchaseReturnLineOrderByWithRelationInput | PurchaseReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PurchaseReturnLines.
     */
    cursor?: PurchaseReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturnLines 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` PurchaseReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseReturnLines.
     */
    distinct?: PurchaseReturnLineScalarFieldEnum | PurchaseReturnLineScalarFieldEnum[]
  }

  /**
   * PurchaseReturnLine findFirstOrThrow
   */
  export type PurchaseReturnLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturnLine to fetch.
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturnLines to fetch.
     */
    orderBy?: PurchaseReturnLineOrderByWithRelationInput | PurchaseReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PurchaseReturnLines.
     */
    cursor?: PurchaseReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturnLines 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` PurchaseReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseReturnLines.
     */
    distinct?: PurchaseReturnLineScalarFieldEnum | PurchaseReturnLineScalarFieldEnum[]
  }

  /**
   * PurchaseReturnLine findMany
   */
  export type PurchaseReturnLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which PurchaseReturnLines to fetch.
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PurchaseReturnLines to fetch.
     */
    orderBy?: PurchaseReturnLineOrderByWithRelationInput | PurchaseReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing PurchaseReturnLines.
     */
    cursor?: PurchaseReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PurchaseReturnLines 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` PurchaseReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PurchaseReturnLines.
     */
    distinct?: PurchaseReturnLineScalarFieldEnum | PurchaseReturnLineScalarFieldEnum[]
  }

  /**
   * PurchaseReturnLine create
   */
  export type PurchaseReturnLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * The data needed to create a PurchaseReturnLine.
     */
    data: XOR<PurchaseReturnLineCreateInput, PurchaseReturnLineUncheckedCreateInput>
  }

  /**
   * PurchaseReturnLine createMany
   */
  export type PurchaseReturnLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many PurchaseReturnLines.
     */
    data: PurchaseReturnLineCreateManyInput | PurchaseReturnLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * PurchaseReturnLine createManyAndReturn
   */
  export type PurchaseReturnLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * The data used to create many PurchaseReturnLines.
     */
    data: PurchaseReturnLineCreateManyInput | PurchaseReturnLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * PurchaseReturnLine update
   */
  export type PurchaseReturnLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * The data needed to update a PurchaseReturnLine.
     */
    data: XOR<PurchaseReturnLineUpdateInput, PurchaseReturnLineUncheckedUpdateInput>
    /**
     * Choose, which PurchaseReturnLine to update.
     */
    where: PurchaseReturnLineWhereUniqueInput
  }

  /**
   * PurchaseReturnLine updateMany
   */
  export type PurchaseReturnLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update PurchaseReturnLines.
     */
    data: XOR<PurchaseReturnLineUpdateManyMutationInput, PurchaseReturnLineUncheckedUpdateManyInput>
    /**
     * Filter which PurchaseReturnLines to update
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * Limit how many PurchaseReturnLines to update.
     */
    limit?: number
  }

  /**
   * PurchaseReturnLine updateManyAndReturn
   */
  export type PurchaseReturnLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * The data used to update PurchaseReturnLines.
     */
    data: XOR<PurchaseReturnLineUpdateManyMutationInput, PurchaseReturnLineUncheckedUpdateManyInput>
    /**
     * Filter which PurchaseReturnLines to update
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * Limit how many PurchaseReturnLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * PurchaseReturnLine upsert
   */
  export type PurchaseReturnLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * The filter to search for the PurchaseReturnLine to update in case it exists.
     */
    where: PurchaseReturnLineWhereUniqueInput
    /**
     * In case the PurchaseReturnLine found by the `where` argument doesn't exist, create a new PurchaseReturnLine with this data.
     */
    create: XOR<PurchaseReturnLineCreateInput, PurchaseReturnLineUncheckedCreateInput>
    /**
     * In case the PurchaseReturnLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<PurchaseReturnLineUpdateInput, PurchaseReturnLineUncheckedUpdateInput>
  }

  /**
   * PurchaseReturnLine delete
   */
  export type PurchaseReturnLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    /**
     * Filter which PurchaseReturnLine to delete.
     */
    where: PurchaseReturnLineWhereUniqueInput
  }

  /**
   * PurchaseReturnLine deleteMany
   */
  export type PurchaseReturnLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PurchaseReturnLines to delete
     */
    where?: PurchaseReturnLineWhereInput
    /**
     * Limit how many PurchaseReturnLines to delete.
     */
    limit?: number
  }

  /**
   * PurchaseReturnLine without action
   */
  export type PurchaseReturnLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
  }


  /**
   * Model Customer
   */

  export type AggregateCustomer = {
    _count: CustomerCountAggregateOutputType | null
    _avg: CustomerAvgAggregateOutputType | null
    _sum: CustomerSumAggregateOutputType | null
    _min: CustomerMinAggregateOutputType | null
    _max: CustomerMaxAggregateOutputType | null
  }

  export type CustomerAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type CustomerSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type CustomerMinAggregateOutputType = {
    id: string | null
    name: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type CustomerMaxAggregateOutputType = {
    id: string | null
    name: string | null
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type CustomerCountAggregateOutputType = {
    id: number
    name: number
    email: number
    phone: number
    country: number
    city: number
    zipCode: number
    branchId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type CustomerAvgAggregateInputType = {
    sortOrder?: true
  }

  export type CustomerSumAggregateInputType = {
    sortOrder?: true
  }

  export type CustomerMinAggregateInputType = {
    id?: true
    name?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type CustomerMaxAggregateInputType = {
    id?: true
    name?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type CustomerCountAggregateInputType = {
    id?: true
    name?: true
    email?: true
    phone?: true
    country?: true
    city?: true
    zipCode?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

  export type CustomerAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Customer to aggregate.
     */
    where?: CustomerWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Customers to fetch.
     */
    orderBy?: CustomerOrderByWithRelationInput | CustomerOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: CustomerWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Customers 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` Customers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Customers
    **/
    _count?: true | CustomerCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: CustomerAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: CustomerSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: CustomerMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: CustomerMaxAggregateInputType
  }

  export type GetCustomerAggregateType<T extends CustomerAggregateArgs> = {
        [P in keyof T & keyof AggregateCustomer]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateCustomer[P]>
      : GetScalarType<T[P], AggregateCustomer[P]>
  }




  export type CustomerGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: CustomerWhereInput
    orderBy?: CustomerOrderByWithAggregationInput | CustomerOrderByWithAggregationInput[]
    by: CustomerScalarFieldEnum[] | CustomerScalarFieldEnum
    having?: CustomerScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: CustomerCountAggregateInputType | true
    _avg?: CustomerAvgAggregateInputType
    _sum?: CustomerSumAggregateInputType
    _min?: CustomerMinAggregateInputType
    _max?: CustomerMaxAggregateInputType
  }

  export type CustomerGroupByOutputType = {
    id: string
    name: string
    email: string | null
    phone: string | null
    country: string | null
    city: string | null
    zipCode: string | null
    branchId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: CustomerCountAggregateOutputType | null
    _avg: CustomerAvgAggregateOutputType | null
    _sum: CustomerSumAggregateOutputType | null
    _min: CustomerMinAggregateOutputType | null
    _max: CustomerMaxAggregateOutputType | null
  }

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


  export type CustomerSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Customer$branchArgs<ExtArgs>
    invoices?: boolean | Customer$invoicesArgs<ExtArgs>
    sales?: boolean | Customer$salesArgs<ExtArgs>
    salesReturns?: boolean | Customer$salesReturnsArgs<ExtArgs>
    _count?: boolean | CustomerCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["customer"]>

  export type CustomerSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Customer$branchArgs<ExtArgs>
  }, ExtArgs["result"]["customer"]>

  export type CustomerSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Customer$branchArgs<ExtArgs>
  }, ExtArgs["result"]["customer"]>

  export type CustomerSelectScalar = {
    id?: boolean
    name?: boolean
    email?: boolean
    phone?: boolean
    country?: boolean
    city?: boolean
    zipCode?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type CustomerOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "email" | "phone" | "country" | "city" | "zipCode" | "branchId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["customer"]>
  export type CustomerInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Customer$branchArgs<ExtArgs>
    invoices?: boolean | Customer$invoicesArgs<ExtArgs>
    sales?: boolean | Customer$salesArgs<ExtArgs>
    salesReturns?: boolean | Customer$salesReturnsArgs<ExtArgs>
    _count?: boolean | CustomerCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type CustomerIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Customer$branchArgs<ExtArgs>
  }
  export type CustomerIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Customer$branchArgs<ExtArgs>
  }

  export type $CustomerPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Customer"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      invoices: Prisma.$InvoicePayload<ExtArgs>[]
      sales: Prisma.$SalePayload<ExtArgs>[]
      salesReturns: Prisma.$SalesReturnPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      email: string | null
      /**
       * Phone / WhatsApp, etc.
       */
      phone: string | null
      country: string | null
      city: string | null
      zipCode: string | null
      branchId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["customer"]>
    composites: {}
  }

  type CustomerGetPayload<S extends boolean | null | undefined | CustomerDefaultArgs> = $Result.GetResult<Prisma.$CustomerPayload, S>

  type CustomerCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<CustomerFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: CustomerCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Customer.
     * @param {CustomerCreateArgs} args - Arguments to create a Customer.
     * @example
     * // Create one Customer
     * const Customer = await prisma.customer.create({
     *   data: {
     *     // ... data to create a Customer
     *   }
     * })
     * 
     */
    create<T extends CustomerCreateArgs>(args: SelectSubset<T, CustomerCreateArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Customers and returns the data saved in the database.
     * @param {CustomerCreateManyAndReturnArgs} args - Arguments to create many Customers.
     * @example
     * // Create many Customers
     * const customer = await prisma.customer.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Customers and only return the `id`
     * const customerWithIdOnly = await prisma.customer.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends CustomerCreateManyAndReturnArgs>(args?: SelectSubset<T, CustomerCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Customer.
     * @param {CustomerDeleteArgs} args - Arguments to delete one Customer.
     * @example
     * // Delete one Customer
     * const Customer = await prisma.customer.delete({
     *   where: {
     *     // ... filter to delete one Customer
     *   }
     * })
     * 
     */
    delete<T extends CustomerDeleteArgs>(args: SelectSubset<T, CustomerDeleteArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Customer.
     * @param {CustomerUpdateArgs} args - Arguments to update one Customer.
     * @example
     * // Update one Customer
     * const customer = await prisma.customer.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends CustomerUpdateArgs>(args: SelectSubset<T, CustomerUpdateArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Customers and returns the data updated in the database.
     * @param {CustomerUpdateManyAndReturnArgs} args - Arguments to update many Customers.
     * @example
     * // Update many Customers
     * const customer = await prisma.customer.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Customers and only return the `id`
     * const customerWithIdOnly = await prisma.customer.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends CustomerUpdateManyAndReturnArgs>(args: SelectSubset<T, CustomerUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Customer.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {CustomerAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends CustomerAggregateArgs>(args: Subset<T, CustomerAggregateArgs>): Prisma.PrismaPromise<GetCustomerAggregateType<T>>

    /**
     * Group by Customer.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {CustomerGroupByArgs} 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 CustomerGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: CustomerGroupByArgs['orderBy'] }
        : { orderBy?: CustomerGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, CustomerGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetCustomerGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Customer model
   */
  readonly fields: CustomerFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Customer.
   * 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__CustomerClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Customer$branchArgs<ExtArgs> = {}>(args?: Subset<T, Customer$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    invoices<T extends Customer$invoicesArgs<ExtArgs> = {}>(args?: Subset<T, Customer$invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    sales<T extends Customer$salesArgs<ExtArgs> = {}>(args?: Subset<T, Customer$salesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    salesReturns<T extends Customer$salesReturnsArgs<ExtArgs> = {}>(args?: Subset<T, Customer$salesReturnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Customer model
   */
  interface CustomerFieldRefs {
    readonly id: FieldRef<"Customer", 'String'>
    readonly name: FieldRef<"Customer", 'String'>
    readonly email: FieldRef<"Customer", 'String'>
    readonly phone: FieldRef<"Customer", 'String'>
    readonly country: FieldRef<"Customer", 'String'>
    readonly city: FieldRef<"Customer", 'String'>
    readonly zipCode: FieldRef<"Customer", 'String'>
    readonly branchId: FieldRef<"Customer", 'String'>
    readonly sortOrder: FieldRef<"Customer", 'Int'>
    readonly isActive: FieldRef<"Customer", 'Boolean'>
    readonly createdAt: FieldRef<"Customer", 'DateTime'>
    readonly updatedAt: FieldRef<"Customer", 'DateTime'>
    readonly deletedAt: FieldRef<"Customer", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Customer findUnique
   */
  export type CustomerFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * Filter, which Customer to fetch.
     */
    where: CustomerWhereUniqueInput
  }

  /**
   * Customer findUniqueOrThrow
   */
  export type CustomerFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * Filter, which Customer to fetch.
     */
    where: CustomerWhereUniqueInput
  }

  /**
   * Customer findFirst
   */
  export type CustomerFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * Filter, which Customer to fetch.
     */
    where?: CustomerWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Customers to fetch.
     */
    orderBy?: CustomerOrderByWithRelationInput | CustomerOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Customers.
     */
    cursor?: CustomerWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Customers 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` Customers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Customers.
     */
    distinct?: CustomerScalarFieldEnum | CustomerScalarFieldEnum[]
  }

  /**
   * Customer findFirstOrThrow
   */
  export type CustomerFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * Filter, which Customer to fetch.
     */
    where?: CustomerWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Customers to fetch.
     */
    orderBy?: CustomerOrderByWithRelationInput | CustomerOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Customers.
     */
    cursor?: CustomerWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Customers 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` Customers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Customers.
     */
    distinct?: CustomerScalarFieldEnum | CustomerScalarFieldEnum[]
  }

  /**
   * Customer findMany
   */
  export type CustomerFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * Filter, which Customers to fetch.
     */
    where?: CustomerWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Customers to fetch.
     */
    orderBy?: CustomerOrderByWithRelationInput | CustomerOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Customers.
     */
    cursor?: CustomerWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Customers 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` Customers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Customers.
     */
    distinct?: CustomerScalarFieldEnum | CustomerScalarFieldEnum[]
  }

  /**
   * Customer create
   */
  export type CustomerCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * The data needed to create a Customer.
     */
    data: XOR<CustomerCreateInput, CustomerUncheckedCreateInput>
  }

  /**
   * Customer createMany
   */
  export type CustomerCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Customers.
     */
    data: CustomerCreateManyInput | CustomerCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Customer createManyAndReturn
   */
  export type CustomerCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * The data used to create many Customers.
     */
    data: CustomerCreateManyInput | CustomerCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Customer update
   */
  export type CustomerUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * The data needed to update a Customer.
     */
    data: XOR<CustomerUpdateInput, CustomerUncheckedUpdateInput>
    /**
     * Choose, which Customer to update.
     */
    where: CustomerWhereUniqueInput
  }

  /**
   * Customer updateMany
   */
  export type CustomerUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Customers.
     */
    data: XOR<CustomerUpdateManyMutationInput, CustomerUncheckedUpdateManyInput>
    /**
     * Filter which Customers to update
     */
    where?: CustomerWhereInput
    /**
     * Limit how many Customers to update.
     */
    limit?: number
  }

  /**
   * Customer updateManyAndReturn
   */
  export type CustomerUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * The data used to update Customers.
     */
    data: XOR<CustomerUpdateManyMutationInput, CustomerUncheckedUpdateManyInput>
    /**
     * Filter which Customers to update
     */
    where?: CustomerWhereInput
    /**
     * Limit how many Customers to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Customer upsert
   */
  export type CustomerUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * The filter to search for the Customer to update in case it exists.
     */
    where: CustomerWhereUniqueInput
    /**
     * In case the Customer found by the `where` argument doesn't exist, create a new Customer with this data.
     */
    create: XOR<CustomerCreateInput, CustomerUncheckedCreateInput>
    /**
     * In case the Customer was found with the provided `where` argument, update it with this data.
     */
    update: XOR<CustomerUpdateInput, CustomerUncheckedUpdateInput>
  }

  /**
   * Customer delete
   */
  export type CustomerDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    /**
     * Filter which Customer to delete.
     */
    where: CustomerWhereUniqueInput
  }

  /**
   * Customer deleteMany
   */
  export type CustomerDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Customers to delete
     */
    where?: CustomerWhereInput
    /**
     * Limit how many Customers to delete.
     */
    limit?: number
  }

  /**
   * Customer.branch
   */
  export type Customer$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Customer.invoices
   */
  export type Customer$invoicesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    where?: InvoiceWhereInput
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    cursor?: InvoiceWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InvoiceScalarFieldEnum | InvoiceScalarFieldEnum[]
  }

  /**
   * Customer.sales
   */
  export type Customer$salesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    where?: SaleWhereInput
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    cursor?: SaleWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * Customer.salesReturns
   */
  export type Customer$salesReturnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    where?: SalesReturnWhereInput
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    cursor?: SalesReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * Customer without action
   */
  export type CustomerDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
  }


  /**
   * Model PaymentMethod
   */

  export type AggregatePaymentMethod = {
    _count: PaymentMethodCountAggregateOutputType | null
    _avg: PaymentMethodAvgAggregateOutputType | null
    _sum: PaymentMethodSumAggregateOutputType | null
    _min: PaymentMethodMinAggregateOutputType | null
    _max: PaymentMethodMaxAggregateOutputType | null
  }

  export type PaymentMethodAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type PaymentMethodSumAggregateOutputType = {
    sortOrder: number | null
  }

  export type PaymentMethodMinAggregateOutputType = {
    id: string | null
    name: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type PaymentMethodMaxAggregateOutputType = {
    id: string | null
    name: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type PaymentMethodCountAggregateOutputType = {
    id: number
    name: number
    branchId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type PaymentMethodAvgAggregateInputType = {
    sortOrder?: true
  }

  export type PaymentMethodSumAggregateInputType = {
    sortOrder?: true
  }

  export type PaymentMethodMinAggregateInputType = {
    id?: true
    name?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type PaymentMethodMaxAggregateInputType = {
    id?: true
    name?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type PaymentMethodCountAggregateInputType = {
    id?: true
    name?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type PaymentMethodAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PaymentMethod to aggregate.
     */
    where?: PaymentMethodWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PaymentMethods to fetch.
     */
    orderBy?: PaymentMethodOrderByWithRelationInput | PaymentMethodOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: PaymentMethodWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PaymentMethods 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` PaymentMethods.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned PaymentMethods
    **/
    _count?: true | PaymentMethodCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: PaymentMethodAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: PaymentMethodSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: PaymentMethodMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: PaymentMethodMaxAggregateInputType
  }

  export type GetPaymentMethodAggregateType<T extends PaymentMethodAggregateArgs> = {
        [P in keyof T & keyof AggregatePaymentMethod]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregatePaymentMethod[P]>
      : GetScalarType<T[P], AggregatePaymentMethod[P]>
  }




  export type PaymentMethodGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: PaymentMethodWhereInput
    orderBy?: PaymentMethodOrderByWithAggregationInput | PaymentMethodOrderByWithAggregationInput[]
    by: PaymentMethodScalarFieldEnum[] | PaymentMethodScalarFieldEnum
    having?: PaymentMethodScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: PaymentMethodCountAggregateInputType | true
    _avg?: PaymentMethodAvgAggregateInputType
    _sum?: PaymentMethodSumAggregateInputType
    _min?: PaymentMethodMinAggregateInputType
    _max?: PaymentMethodMaxAggregateInputType
  }

  export type PaymentMethodGroupByOutputType = {
    id: string
    name: string
    branchId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: PaymentMethodCountAggregateOutputType | null
    _avg: PaymentMethodAvgAggregateOutputType | null
    _sum: PaymentMethodSumAggregateOutputType | null
    _min: PaymentMethodMinAggregateOutputType | null
    _max: PaymentMethodMaxAggregateOutputType | null
  }

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


  export type PaymentMethodSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | PaymentMethod$branchArgs<ExtArgs>
    sales?: boolean | PaymentMethod$salesArgs<ExtArgs>
    expenses?: boolean | PaymentMethod$expensesArgs<ExtArgs>
    _count?: boolean | PaymentMethodCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["paymentMethod"]>

  export type PaymentMethodSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | PaymentMethod$branchArgs<ExtArgs>
  }, ExtArgs["result"]["paymentMethod"]>

  export type PaymentMethodSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | PaymentMethod$branchArgs<ExtArgs>
  }, ExtArgs["result"]["paymentMethod"]>

  export type PaymentMethodSelectScalar = {
    id?: boolean
    name?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type PaymentMethodOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "branchId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["paymentMethod"]>
  export type PaymentMethodInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | PaymentMethod$branchArgs<ExtArgs>
    sales?: boolean | PaymentMethod$salesArgs<ExtArgs>
    expenses?: boolean | PaymentMethod$expensesArgs<ExtArgs>
    _count?: boolean | PaymentMethodCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type PaymentMethodIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | PaymentMethod$branchArgs<ExtArgs>
  }
  export type PaymentMethodIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | PaymentMethod$branchArgs<ExtArgs>
  }

  export type $PaymentMethodPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "PaymentMethod"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      sales: Prisma.$SalePayload<ExtArgs>[]
      expenses: Prisma.$ExpensePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      branchId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["paymentMethod"]>
    composites: {}
  }

  type PaymentMethodGetPayload<S extends boolean | null | undefined | PaymentMethodDefaultArgs> = $Result.GetResult<Prisma.$PaymentMethodPayload, S>

  type PaymentMethodCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<PaymentMethodFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: PaymentMethodCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a PaymentMethod.
     * @param {PaymentMethodCreateArgs} args - Arguments to create a PaymentMethod.
     * @example
     * // Create one PaymentMethod
     * const PaymentMethod = await prisma.paymentMethod.create({
     *   data: {
     *     // ... data to create a PaymentMethod
     *   }
     * })
     * 
     */
    create<T extends PaymentMethodCreateArgs>(args: SelectSubset<T, PaymentMethodCreateArgs<ExtArgs>>): Prisma__PaymentMethodClient<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many PaymentMethods and returns the data saved in the database.
     * @param {PaymentMethodCreateManyAndReturnArgs} args - Arguments to create many PaymentMethods.
     * @example
     * // Create many PaymentMethods
     * const paymentMethod = await prisma.paymentMethod.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many PaymentMethods and only return the `id`
     * const paymentMethodWithIdOnly = await prisma.paymentMethod.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends PaymentMethodCreateManyAndReturnArgs>(args?: SelectSubset<T, PaymentMethodCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a PaymentMethod.
     * @param {PaymentMethodDeleteArgs} args - Arguments to delete one PaymentMethod.
     * @example
     * // Delete one PaymentMethod
     * const PaymentMethod = await prisma.paymentMethod.delete({
     *   where: {
     *     // ... filter to delete one PaymentMethod
     *   }
     * })
     * 
     */
    delete<T extends PaymentMethodDeleteArgs>(args: SelectSubset<T, PaymentMethodDeleteArgs<ExtArgs>>): Prisma__PaymentMethodClient<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one PaymentMethod.
     * @param {PaymentMethodUpdateArgs} args - Arguments to update one PaymentMethod.
     * @example
     * // Update one PaymentMethod
     * const paymentMethod = await prisma.paymentMethod.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends PaymentMethodUpdateArgs>(args: SelectSubset<T, PaymentMethodUpdateArgs<ExtArgs>>): Prisma__PaymentMethodClient<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more PaymentMethods and returns the data updated in the database.
     * @param {PaymentMethodUpdateManyAndReturnArgs} args - Arguments to update many PaymentMethods.
     * @example
     * // Update many PaymentMethods
     * const paymentMethod = await prisma.paymentMethod.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more PaymentMethods and only return the `id`
     * const paymentMethodWithIdOnly = await prisma.paymentMethod.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends PaymentMethodUpdateManyAndReturnArgs>(args: SelectSubset<T, PaymentMethodUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a PaymentMethod.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PaymentMethodAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends PaymentMethodAggregateArgs>(args: Subset<T, PaymentMethodAggregateArgs>): Prisma.PrismaPromise<GetPaymentMethodAggregateType<T>>

    /**
     * Group by PaymentMethod.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {PaymentMethodGroupByArgs} 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 PaymentMethodGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: PaymentMethodGroupByArgs['orderBy'] }
        : { orderBy?: PaymentMethodGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, PaymentMethodGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPaymentMethodGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the PaymentMethod model
   */
  readonly fields: PaymentMethodFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for PaymentMethod.
   * 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__PaymentMethodClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends PaymentMethod$branchArgs<ExtArgs> = {}>(args?: Subset<T, PaymentMethod$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    sales<T extends PaymentMethod$salesArgs<ExtArgs> = {}>(args?: Subset<T, PaymentMethod$salesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    expenses<T extends PaymentMethod$expensesArgs<ExtArgs> = {}>(args?: Subset<T, PaymentMethod$expensesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the PaymentMethod model
   */
  interface PaymentMethodFieldRefs {
    readonly id: FieldRef<"PaymentMethod", 'String'>
    readonly name: FieldRef<"PaymentMethod", 'String'>
    readonly branchId: FieldRef<"PaymentMethod", 'String'>
    readonly sortOrder: FieldRef<"PaymentMethod", 'Int'>
    readonly isActive: FieldRef<"PaymentMethod", 'Boolean'>
    readonly createdAt: FieldRef<"PaymentMethod", 'DateTime'>
    readonly updatedAt: FieldRef<"PaymentMethod", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * PaymentMethod findUnique
   */
  export type PaymentMethodFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * Filter, which PaymentMethod to fetch.
     */
    where: PaymentMethodWhereUniqueInput
  }

  /**
   * PaymentMethod findUniqueOrThrow
   */
  export type PaymentMethodFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * Filter, which PaymentMethod to fetch.
     */
    where: PaymentMethodWhereUniqueInput
  }

  /**
   * PaymentMethod findFirst
   */
  export type PaymentMethodFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * Filter, which PaymentMethod to fetch.
     */
    where?: PaymentMethodWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PaymentMethods to fetch.
     */
    orderBy?: PaymentMethodOrderByWithRelationInput | PaymentMethodOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PaymentMethods.
     */
    cursor?: PaymentMethodWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PaymentMethods 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` PaymentMethods.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PaymentMethods.
     */
    distinct?: PaymentMethodScalarFieldEnum | PaymentMethodScalarFieldEnum[]
  }

  /**
   * PaymentMethod findFirstOrThrow
   */
  export type PaymentMethodFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * Filter, which PaymentMethod to fetch.
     */
    where?: PaymentMethodWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PaymentMethods to fetch.
     */
    orderBy?: PaymentMethodOrderByWithRelationInput | PaymentMethodOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for PaymentMethods.
     */
    cursor?: PaymentMethodWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PaymentMethods 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` PaymentMethods.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PaymentMethods.
     */
    distinct?: PaymentMethodScalarFieldEnum | PaymentMethodScalarFieldEnum[]
  }

  /**
   * PaymentMethod findMany
   */
  export type PaymentMethodFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * Filter, which PaymentMethods to fetch.
     */
    where?: PaymentMethodWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of PaymentMethods to fetch.
     */
    orderBy?: PaymentMethodOrderByWithRelationInput | PaymentMethodOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing PaymentMethods.
     */
    cursor?: PaymentMethodWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` PaymentMethods 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` PaymentMethods.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of PaymentMethods.
     */
    distinct?: PaymentMethodScalarFieldEnum | PaymentMethodScalarFieldEnum[]
  }

  /**
   * PaymentMethod create
   */
  export type PaymentMethodCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * The data needed to create a PaymentMethod.
     */
    data: XOR<PaymentMethodCreateInput, PaymentMethodUncheckedCreateInput>
  }

  /**
   * PaymentMethod createMany
   */
  export type PaymentMethodCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many PaymentMethods.
     */
    data: PaymentMethodCreateManyInput | PaymentMethodCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * PaymentMethod createManyAndReturn
   */
  export type PaymentMethodCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * The data used to create many PaymentMethods.
     */
    data: PaymentMethodCreateManyInput | PaymentMethodCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * PaymentMethod update
   */
  export type PaymentMethodUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * The data needed to update a PaymentMethod.
     */
    data: XOR<PaymentMethodUpdateInput, PaymentMethodUncheckedUpdateInput>
    /**
     * Choose, which PaymentMethod to update.
     */
    where: PaymentMethodWhereUniqueInput
  }

  /**
   * PaymentMethod updateMany
   */
  export type PaymentMethodUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update PaymentMethods.
     */
    data: XOR<PaymentMethodUpdateManyMutationInput, PaymentMethodUncheckedUpdateManyInput>
    /**
     * Filter which PaymentMethods to update
     */
    where?: PaymentMethodWhereInput
    /**
     * Limit how many PaymentMethods to update.
     */
    limit?: number
  }

  /**
   * PaymentMethod updateManyAndReturn
   */
  export type PaymentMethodUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * The data used to update PaymentMethods.
     */
    data: XOR<PaymentMethodUpdateManyMutationInput, PaymentMethodUncheckedUpdateManyInput>
    /**
     * Filter which PaymentMethods to update
     */
    where?: PaymentMethodWhereInput
    /**
     * Limit how many PaymentMethods to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * PaymentMethod upsert
   */
  export type PaymentMethodUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * The filter to search for the PaymentMethod to update in case it exists.
     */
    where: PaymentMethodWhereUniqueInput
    /**
     * In case the PaymentMethod found by the `where` argument doesn't exist, create a new PaymentMethod with this data.
     */
    create: XOR<PaymentMethodCreateInput, PaymentMethodUncheckedCreateInput>
    /**
     * In case the PaymentMethod was found with the provided `where` argument, update it with this data.
     */
    update: XOR<PaymentMethodUpdateInput, PaymentMethodUncheckedUpdateInput>
  }

  /**
   * PaymentMethod delete
   */
  export type PaymentMethodDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    /**
     * Filter which PaymentMethod to delete.
     */
    where: PaymentMethodWhereUniqueInput
  }

  /**
   * PaymentMethod deleteMany
   */
  export type PaymentMethodDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which PaymentMethods to delete
     */
    where?: PaymentMethodWhereInput
    /**
     * Limit how many PaymentMethods to delete.
     */
    limit?: number
  }

  /**
   * PaymentMethod.branch
   */
  export type PaymentMethod$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * PaymentMethod.sales
   */
  export type PaymentMethod$salesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    where?: SaleWhereInput
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    cursor?: SaleWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * PaymentMethod.expenses
   */
  export type PaymentMethod$expensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    where?: ExpenseWhereInput
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    cursor?: ExpenseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * PaymentMethod without action
   */
  export type PaymentMethodDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
  }


  /**
   * Model Sale
   */

  export type AggregateSale = {
    _count: SaleCountAggregateOutputType | null
    _avg: SaleAvgAggregateOutputType | null
    _sum: SaleSumAggregateOutputType | null
    _min: SaleMinAggregateOutputType | null
    _max: SaleMaxAggregateOutputType | null
  }

  export type SaleAvgAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    amountPaid: number | null
    changeGiven: number | null
  }

  export type SaleSumAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    amountPaid: number | null
    changeGiven: number | null
  }

  export type SaleMinAggregateOutputType = {
    id: string | null
    number: string | null
    customerId: string | null
    warehouseId: string | null
    branchId: string | null
    paymentMethodId: string | null
    status: string | null
    saleDate: Date | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    amountPaid: number | null
    changeGiven: number | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type SaleMaxAggregateOutputType = {
    id: string | null
    number: string | null
    customerId: string | null
    warehouseId: string | null
    branchId: string | null
    paymentMethodId: string | null
    status: string | null
    saleDate: Date | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    amountPaid: number | null
    changeGiven: number | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type SaleCountAggregateOutputType = {
    id: number
    number: number
    customerId: number
    warehouseId: number
    branchId: number
    paymentMethodId: number
    status: number
    saleDate: number
    notes: number
    subtotal: number
    taxTotal: number
    total: number
    amountPaid: number
    changeGiven: number
    taxBreakdown: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type SaleAvgAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
    amountPaid?: true
    changeGiven?: true
  }

  export type SaleSumAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
    amountPaid?: true
    changeGiven?: true
  }

  export type SaleMinAggregateInputType = {
    id?: true
    number?: true
    customerId?: true
    warehouseId?: true
    branchId?: true
    paymentMethodId?: true
    status?: true
    saleDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    amountPaid?: true
    changeGiven?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type SaleMaxAggregateInputType = {
    id?: true
    number?: true
    customerId?: true
    warehouseId?: true
    branchId?: true
    paymentMethodId?: true
    status?: true
    saleDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    amountPaid?: true
    changeGiven?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type SaleCountAggregateInputType = {
    id?: true
    number?: true
    customerId?: true
    warehouseId?: true
    branchId?: true
    paymentMethodId?: true
    status?: true
    saleDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    amountPaid?: true
    changeGiven?: true
    taxBreakdown?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

  export type SaleAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Sale to aggregate.
     */
    where?: SaleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Sales to fetch.
     */
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SaleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Sales 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` Sales.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Sales
    **/
    _count?: true | SaleCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: SaleAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: SaleSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SaleMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SaleMaxAggregateInputType
  }

  export type GetSaleAggregateType<T extends SaleAggregateArgs> = {
        [P in keyof T & keyof AggregateSale]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSale[P]>
      : GetScalarType<T[P], AggregateSale[P]>
  }




  export type SaleGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleWhereInput
    orderBy?: SaleOrderByWithAggregationInput | SaleOrderByWithAggregationInput[]
    by: SaleScalarFieldEnum[] | SaleScalarFieldEnum
    having?: SaleScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SaleCountAggregateInputType | true
    _avg?: SaleAvgAggregateInputType
    _sum?: SaleSumAggregateInputType
    _min?: SaleMinAggregateInputType
    _max?: SaleMaxAggregateInputType
  }

  export type SaleGroupByOutputType = {
    id: string
    number: string
    customerId: string | null
    warehouseId: string | null
    branchId: string | null
    paymentMethodId: string | null
    status: string
    saleDate: Date
    notes: string | null
    subtotal: number
    taxTotal: number
    total: number
    amountPaid: number | null
    changeGiven: number | null
    taxBreakdown: JsonValue | null
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: SaleCountAggregateOutputType | null
    _avg: SaleAvgAggregateOutputType | null
    _sum: SaleSumAggregateOutputType | null
    _min: SaleMinAggregateOutputType | null
    _max: SaleMaxAggregateOutputType | null
  }

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


  export type SaleSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    saleDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    amountPaid?: boolean
    changeGiven?: boolean
    taxBreakdown?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    customer?: boolean | Sale$customerArgs<ExtArgs>
    warehouse?: boolean | Sale$warehouseArgs<ExtArgs>
    branch?: boolean | Sale$branchArgs<ExtArgs>
    paymentMethod?: boolean | Sale$paymentMethodArgs<ExtArgs>
    lines?: boolean | Sale$linesArgs<ExtArgs>
    returns?: boolean | Sale$returnsArgs<ExtArgs>
    invoices?: boolean | Sale$invoicesArgs<ExtArgs>
    _count?: boolean | SaleCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["sale"]>

  export type SaleSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    saleDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    amountPaid?: boolean
    changeGiven?: boolean
    taxBreakdown?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    customer?: boolean | Sale$customerArgs<ExtArgs>
    warehouse?: boolean | Sale$warehouseArgs<ExtArgs>
    branch?: boolean | Sale$branchArgs<ExtArgs>
    paymentMethod?: boolean | Sale$paymentMethodArgs<ExtArgs>
  }, ExtArgs["result"]["sale"]>

  export type SaleSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    saleDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    amountPaid?: boolean
    changeGiven?: boolean
    taxBreakdown?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    customer?: boolean | Sale$customerArgs<ExtArgs>
    warehouse?: boolean | Sale$warehouseArgs<ExtArgs>
    branch?: boolean | Sale$branchArgs<ExtArgs>
    paymentMethod?: boolean | Sale$paymentMethodArgs<ExtArgs>
  }, ExtArgs["result"]["sale"]>

  export type SaleSelectScalar = {
    id?: boolean
    number?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    saleDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    amountPaid?: boolean
    changeGiven?: boolean
    taxBreakdown?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type SaleOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "number" | "customerId" | "warehouseId" | "branchId" | "paymentMethodId" | "status" | "saleDate" | "notes" | "subtotal" | "taxTotal" | "total" | "amountPaid" | "changeGiven" | "taxBreakdown" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["sale"]>
  export type SaleInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    customer?: boolean | Sale$customerArgs<ExtArgs>
    warehouse?: boolean | Sale$warehouseArgs<ExtArgs>
    branch?: boolean | Sale$branchArgs<ExtArgs>
    paymentMethod?: boolean | Sale$paymentMethodArgs<ExtArgs>
    lines?: boolean | Sale$linesArgs<ExtArgs>
    returns?: boolean | Sale$returnsArgs<ExtArgs>
    invoices?: boolean | Sale$invoicesArgs<ExtArgs>
    _count?: boolean | SaleCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type SaleIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    customer?: boolean | Sale$customerArgs<ExtArgs>
    warehouse?: boolean | Sale$warehouseArgs<ExtArgs>
    branch?: boolean | Sale$branchArgs<ExtArgs>
    paymentMethod?: boolean | Sale$paymentMethodArgs<ExtArgs>
  }
  export type SaleIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    customer?: boolean | Sale$customerArgs<ExtArgs>
    warehouse?: boolean | Sale$warehouseArgs<ExtArgs>
    branch?: boolean | Sale$branchArgs<ExtArgs>
    paymentMethod?: boolean | Sale$paymentMethodArgs<ExtArgs>
  }

  export type $SalePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Sale"
    objects: {
      customer: Prisma.$CustomerPayload<ExtArgs> | null
      warehouse: Prisma.$WarehousePayload<ExtArgs> | null
      branch: Prisma.$BranchPayload<ExtArgs> | null
      paymentMethod: Prisma.$PaymentMethodPayload<ExtArgs> | null
      lines: Prisma.$SaleLinePayload<ExtArgs>[]
      returns: Prisma.$SalesReturnPayload<ExtArgs>[]
      invoices: Prisma.$InvoicePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      number: string
      customerId: string | null
      warehouseId: string | null
      branchId: string | null
      paymentMethodId: string | null
      status: string
      saleDate: Date
      notes: string | null
      subtotal: number
      taxTotal: number
      total: number
      /**
       * Amount customer paid (cash/card tendered).
       */
      amountPaid: number | null
      /**
       * Change returned to customer when amountPaid > total.
       */
      changeGiven: number | null
      /**
       * JSON array: [{ taxId, name, rate, amount }]
       */
      taxBreakdown: Prisma.JsonValue | null
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["sale"]>
    composites: {}
  }

  type SaleGetPayload<S extends boolean | null | undefined | SaleDefaultArgs> = $Result.GetResult<Prisma.$SalePayload, S>

  type SaleCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SaleFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SaleCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Sale.
     * @param {SaleCreateArgs} args - Arguments to create a Sale.
     * @example
     * // Create one Sale
     * const Sale = await prisma.sale.create({
     *   data: {
     *     // ... data to create a Sale
     *   }
     * })
     * 
     */
    create<T extends SaleCreateArgs>(args: SelectSubset<T, SaleCreateArgs<ExtArgs>>): Prisma__SaleClient<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Sales and returns the data saved in the database.
     * @param {SaleCreateManyAndReturnArgs} args - Arguments to create many Sales.
     * @example
     * // Create many Sales
     * const sale = await prisma.sale.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Sales and only return the `id`
     * const saleWithIdOnly = await prisma.sale.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SaleCreateManyAndReturnArgs>(args?: SelectSubset<T, SaleCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Sale.
     * @param {SaleDeleteArgs} args - Arguments to delete one Sale.
     * @example
     * // Delete one Sale
     * const Sale = await prisma.sale.delete({
     *   where: {
     *     // ... filter to delete one Sale
     *   }
     * })
     * 
     */
    delete<T extends SaleDeleteArgs>(args: SelectSubset<T, SaleDeleteArgs<ExtArgs>>): Prisma__SaleClient<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Sale.
     * @param {SaleUpdateArgs} args - Arguments to update one Sale.
     * @example
     * // Update one Sale
     * const sale = await prisma.sale.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SaleUpdateArgs>(args: SelectSubset<T, SaleUpdateArgs<ExtArgs>>): Prisma__SaleClient<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Sales and returns the data updated in the database.
     * @param {SaleUpdateManyAndReturnArgs} args - Arguments to update many Sales.
     * @example
     * // Update many Sales
     * const sale = await prisma.sale.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Sales and only return the `id`
     * const saleWithIdOnly = await prisma.sale.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SaleUpdateManyAndReturnArgs>(args: SelectSubset<T, SaleUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Sale.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SaleAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SaleAggregateArgs>(args: Subset<T, SaleAggregateArgs>): Prisma.PrismaPromise<GetSaleAggregateType<T>>

    /**
     * Group by Sale.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SaleGroupByArgs} 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 SaleGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SaleGroupByArgs['orderBy'] }
        : { orderBy?: SaleGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SaleGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSaleGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Sale model
   */
  readonly fields: SaleFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Sale.
   * 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__SaleClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    customer<T extends Sale$customerArgs<ExtArgs> = {}>(args?: Subset<T, Sale$customerArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    warehouse<T extends Sale$warehouseArgs<ExtArgs> = {}>(args?: Subset<T, Sale$warehouseArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branch<T extends Sale$branchArgs<ExtArgs> = {}>(args?: Subset<T, Sale$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    paymentMethod<T extends Sale$paymentMethodArgs<ExtArgs> = {}>(args?: Subset<T, Sale$paymentMethodArgs<ExtArgs>>): Prisma__PaymentMethodClient<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends Sale$linesArgs<ExtArgs> = {}>(args?: Subset<T, Sale$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    returns<T extends Sale$returnsArgs<ExtArgs> = {}>(args?: Subset<T, Sale$returnsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    invoices<T extends Sale$invoicesArgs<ExtArgs> = {}>(args?: Subset<T, Sale$invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Sale model
   */
  interface SaleFieldRefs {
    readonly id: FieldRef<"Sale", 'String'>
    readonly number: FieldRef<"Sale", 'String'>
    readonly customerId: FieldRef<"Sale", 'String'>
    readonly warehouseId: FieldRef<"Sale", 'String'>
    readonly branchId: FieldRef<"Sale", 'String'>
    readonly paymentMethodId: FieldRef<"Sale", 'String'>
    readonly status: FieldRef<"Sale", 'String'>
    readonly saleDate: FieldRef<"Sale", 'DateTime'>
    readonly notes: FieldRef<"Sale", 'String'>
    readonly subtotal: FieldRef<"Sale", 'Float'>
    readonly taxTotal: FieldRef<"Sale", 'Float'>
    readonly total: FieldRef<"Sale", 'Float'>
    readonly amountPaid: FieldRef<"Sale", 'Float'>
    readonly changeGiven: FieldRef<"Sale", 'Float'>
    readonly taxBreakdown: FieldRef<"Sale", 'Json'>
    readonly createdAt: FieldRef<"Sale", 'DateTime'>
    readonly updatedAt: FieldRef<"Sale", 'DateTime'>
    readonly deletedAt: FieldRef<"Sale", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Sale findUnique
   */
  export type SaleFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * Filter, which Sale to fetch.
     */
    where: SaleWhereUniqueInput
  }

  /**
   * Sale findUniqueOrThrow
   */
  export type SaleFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * Filter, which Sale to fetch.
     */
    where: SaleWhereUniqueInput
  }

  /**
   * Sale findFirst
   */
  export type SaleFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * Filter, which Sale to fetch.
     */
    where?: SaleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Sales to fetch.
     */
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Sales.
     */
    cursor?: SaleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Sales 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` Sales.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Sales.
     */
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * Sale findFirstOrThrow
   */
  export type SaleFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * Filter, which Sale to fetch.
     */
    where?: SaleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Sales to fetch.
     */
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Sales.
     */
    cursor?: SaleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Sales 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` Sales.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Sales.
     */
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * Sale findMany
   */
  export type SaleFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * Filter, which Sales to fetch.
     */
    where?: SaleWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Sales to fetch.
     */
    orderBy?: SaleOrderByWithRelationInput | SaleOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Sales.
     */
    cursor?: SaleWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Sales 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` Sales.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Sales.
     */
    distinct?: SaleScalarFieldEnum | SaleScalarFieldEnum[]
  }

  /**
   * Sale create
   */
  export type SaleCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * The data needed to create a Sale.
     */
    data: XOR<SaleCreateInput, SaleUncheckedCreateInput>
  }

  /**
   * Sale createMany
   */
  export type SaleCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Sales.
     */
    data: SaleCreateManyInput | SaleCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Sale createManyAndReturn
   */
  export type SaleCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * The data used to create many Sales.
     */
    data: SaleCreateManyInput | SaleCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Sale update
   */
  export type SaleUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * The data needed to update a Sale.
     */
    data: XOR<SaleUpdateInput, SaleUncheckedUpdateInput>
    /**
     * Choose, which Sale to update.
     */
    where: SaleWhereUniqueInput
  }

  /**
   * Sale updateMany
   */
  export type SaleUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Sales.
     */
    data: XOR<SaleUpdateManyMutationInput, SaleUncheckedUpdateManyInput>
    /**
     * Filter which Sales to update
     */
    where?: SaleWhereInput
    /**
     * Limit how many Sales to update.
     */
    limit?: number
  }

  /**
   * Sale updateManyAndReturn
   */
  export type SaleUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * The data used to update Sales.
     */
    data: XOR<SaleUpdateManyMutationInput, SaleUncheckedUpdateManyInput>
    /**
     * Filter which Sales to update
     */
    where?: SaleWhereInput
    /**
     * Limit how many Sales to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Sale upsert
   */
  export type SaleUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * The filter to search for the Sale to update in case it exists.
     */
    where: SaleWhereUniqueInput
    /**
     * In case the Sale found by the `where` argument doesn't exist, create a new Sale with this data.
     */
    create: XOR<SaleCreateInput, SaleUncheckedCreateInput>
    /**
     * In case the Sale was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SaleUpdateInput, SaleUncheckedUpdateInput>
  }

  /**
   * Sale delete
   */
  export type SaleDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    /**
     * Filter which Sale to delete.
     */
    where: SaleWhereUniqueInput
  }

  /**
   * Sale deleteMany
   */
  export type SaleDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Sales to delete
     */
    where?: SaleWhereInput
    /**
     * Limit how many Sales to delete.
     */
    limit?: number
  }

  /**
   * Sale.customer
   */
  export type Sale$customerArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    where?: CustomerWhereInput
  }

  /**
   * Sale.warehouse
   */
  export type Sale$warehouseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
  }

  /**
   * Sale.branch
   */
  export type Sale$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Sale.paymentMethod
   */
  export type Sale$paymentMethodArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    where?: PaymentMethodWhereInput
  }

  /**
   * Sale.lines
   */
  export type Sale$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    where?: SaleLineWhereInput
    orderBy?: SaleLineOrderByWithRelationInput | SaleLineOrderByWithRelationInput[]
    cursor?: SaleLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SaleLineScalarFieldEnum | SaleLineScalarFieldEnum[]
  }

  /**
   * Sale.returns
   */
  export type Sale$returnsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    where?: SalesReturnWhereInput
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    cursor?: SalesReturnWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * Sale.invoices
   */
  export type Sale$invoicesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    where?: InvoiceWhereInput
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    cursor?: InvoiceWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InvoiceScalarFieldEnum | InvoiceScalarFieldEnum[]
  }

  /**
   * Sale without action
   */
  export type SaleDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
  }


  /**
   * Model SaleLine
   */

  export type AggregateSaleLine = {
    _count: SaleLineCountAggregateOutputType | null
    _avg: SaleLineAvgAggregateOutputType | null
    _sum: SaleLineSumAggregateOutputType | null
    _min: SaleLineMinAggregateOutputType | null
    _max: SaleLineMaxAggregateOutputType | null
  }

  export type SaleLineAvgAggregateOutputType = {
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SaleLineSumAggregateOutputType = {
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SaleLineMinAggregateOutputType = {
    id: string | null
    saleId: string | null
    productId: string | null
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SaleLineMaxAggregateOutputType = {
    id: string | null
    saleId: string | null
    productId: string | null
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SaleLineCountAggregateOutputType = {
    id: number
    saleId: number
    productId: number
    quantity: number
    unitPrice: number
    taxRate: number
    lineTotal: number
    _all: number
  }


  export type SaleLineAvgAggregateInputType = {
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SaleLineSumAggregateInputType = {
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SaleLineMinAggregateInputType = {
    id?: true
    saleId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SaleLineMaxAggregateInputType = {
    id?: true
    saleId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SaleLineCountAggregateInputType = {
    id?: true
    saleId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
    _all?: true
  }

  export type SaleLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SaleLine to aggregate.
     */
    where?: SaleLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SaleLines to fetch.
     */
    orderBy?: SaleLineOrderByWithRelationInput | SaleLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SaleLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SaleLines 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` SaleLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned SaleLines
    **/
    _count?: true | SaleLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: SaleLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: SaleLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SaleLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SaleLineMaxAggregateInputType
  }

  export type GetSaleLineAggregateType<T extends SaleLineAggregateArgs> = {
        [P in keyof T & keyof AggregateSaleLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSaleLine[P]>
      : GetScalarType<T[P], AggregateSaleLine[P]>
  }




  export type SaleLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SaleLineWhereInput
    orderBy?: SaleLineOrderByWithAggregationInput | SaleLineOrderByWithAggregationInput[]
    by: SaleLineScalarFieldEnum[] | SaleLineScalarFieldEnum
    having?: SaleLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SaleLineCountAggregateInputType | true
    _avg?: SaleLineAvgAggregateInputType
    _sum?: SaleLineSumAggregateInputType
    _min?: SaleLineMinAggregateInputType
    _max?: SaleLineMaxAggregateInputType
  }

  export type SaleLineGroupByOutputType = {
    id: string
    saleId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate: number
    lineTotal: number
    _count: SaleLineCountAggregateOutputType | null
    _avg: SaleLineAvgAggregateOutputType | null
    _sum: SaleLineSumAggregateOutputType | null
    _min: SaleLineMinAggregateOutputType | null
    _max: SaleLineMaxAggregateOutputType | null
  }

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


  export type SaleLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    saleId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    sale?: boolean | SaleDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["saleLine"]>

  export type SaleLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    saleId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    sale?: boolean | SaleDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["saleLine"]>

  export type SaleLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    saleId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    sale?: boolean | SaleDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["saleLine"]>

  export type SaleLineSelectScalar = {
    id?: boolean
    saleId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
  }

  export type SaleLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "saleId" | "productId" | "quantity" | "unitPrice" | "taxRate" | "lineTotal", ExtArgs["result"]["saleLine"]>
  export type SaleLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sale?: boolean | SaleDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type SaleLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sale?: boolean | SaleDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type SaleLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sale?: boolean | SaleDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $SaleLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "SaleLine"
    objects: {
      sale: Prisma.$SalePayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      saleId: string
      productId: string
      quantity: number
      unitPrice: number
      taxRate: number
      lineTotal: number
    }, ExtArgs["result"]["saleLine"]>
    composites: {}
  }

  type SaleLineGetPayload<S extends boolean | null | undefined | SaleLineDefaultArgs> = $Result.GetResult<Prisma.$SaleLinePayload, S>

  type SaleLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SaleLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SaleLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a SaleLine.
     * @param {SaleLineCreateArgs} args - Arguments to create a SaleLine.
     * @example
     * // Create one SaleLine
     * const SaleLine = await prisma.saleLine.create({
     *   data: {
     *     // ... data to create a SaleLine
     *   }
     * })
     * 
     */
    create<T extends SaleLineCreateArgs>(args: SelectSubset<T, SaleLineCreateArgs<ExtArgs>>): Prisma__SaleLineClient<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many SaleLines and returns the data saved in the database.
     * @param {SaleLineCreateManyAndReturnArgs} args - Arguments to create many SaleLines.
     * @example
     * // Create many SaleLines
     * const saleLine = await prisma.saleLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many SaleLines and only return the `id`
     * const saleLineWithIdOnly = await prisma.saleLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SaleLineCreateManyAndReturnArgs>(args?: SelectSubset<T, SaleLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a SaleLine.
     * @param {SaleLineDeleteArgs} args - Arguments to delete one SaleLine.
     * @example
     * // Delete one SaleLine
     * const SaleLine = await prisma.saleLine.delete({
     *   where: {
     *     // ... filter to delete one SaleLine
     *   }
     * })
     * 
     */
    delete<T extends SaleLineDeleteArgs>(args: SelectSubset<T, SaleLineDeleteArgs<ExtArgs>>): Prisma__SaleLineClient<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one SaleLine.
     * @param {SaleLineUpdateArgs} args - Arguments to update one SaleLine.
     * @example
     * // Update one SaleLine
     * const saleLine = await prisma.saleLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SaleLineUpdateArgs>(args: SelectSubset<T, SaleLineUpdateArgs<ExtArgs>>): Prisma__SaleLineClient<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more SaleLines and returns the data updated in the database.
     * @param {SaleLineUpdateManyAndReturnArgs} args - Arguments to update many SaleLines.
     * @example
     * // Update many SaleLines
     * const saleLine = await prisma.saleLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more SaleLines and only return the `id`
     * const saleLineWithIdOnly = await prisma.saleLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SaleLineUpdateManyAndReturnArgs>(args: SelectSubset<T, SaleLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a SaleLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SaleLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SaleLineAggregateArgs>(args: Subset<T, SaleLineAggregateArgs>): Prisma.PrismaPromise<GetSaleLineAggregateType<T>>

    /**
     * Group by SaleLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SaleLineGroupByArgs} 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 SaleLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SaleLineGroupByArgs['orderBy'] }
        : { orderBy?: SaleLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SaleLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSaleLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the SaleLine model
   */
  readonly fields: SaleLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for SaleLine.
   * 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__SaleLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    sale<T extends SaleDefaultArgs<ExtArgs> = {}>(args?: Subset<T, SaleDefaultArgs<ExtArgs>>): Prisma__SaleClient<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the SaleLine model
   */
  interface SaleLineFieldRefs {
    readonly id: FieldRef<"SaleLine", 'String'>
    readonly saleId: FieldRef<"SaleLine", 'String'>
    readonly productId: FieldRef<"SaleLine", 'String'>
    readonly quantity: FieldRef<"SaleLine", 'Int'>
    readonly unitPrice: FieldRef<"SaleLine", 'Float'>
    readonly taxRate: FieldRef<"SaleLine", 'Float'>
    readonly lineTotal: FieldRef<"SaleLine", 'Float'>
  }
    

  // Custom InputTypes
  /**
   * SaleLine findUnique
   */
  export type SaleLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * Filter, which SaleLine to fetch.
     */
    where: SaleLineWhereUniqueInput
  }

  /**
   * SaleLine findUniqueOrThrow
   */
  export type SaleLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * Filter, which SaleLine to fetch.
     */
    where: SaleLineWhereUniqueInput
  }

  /**
   * SaleLine findFirst
   */
  export type SaleLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * Filter, which SaleLine to fetch.
     */
    where?: SaleLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SaleLines to fetch.
     */
    orderBy?: SaleLineOrderByWithRelationInput | SaleLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SaleLines.
     */
    cursor?: SaleLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SaleLines 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` SaleLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SaleLines.
     */
    distinct?: SaleLineScalarFieldEnum | SaleLineScalarFieldEnum[]
  }

  /**
   * SaleLine findFirstOrThrow
   */
  export type SaleLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * Filter, which SaleLine to fetch.
     */
    where?: SaleLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SaleLines to fetch.
     */
    orderBy?: SaleLineOrderByWithRelationInput | SaleLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SaleLines.
     */
    cursor?: SaleLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SaleLines 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` SaleLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SaleLines.
     */
    distinct?: SaleLineScalarFieldEnum | SaleLineScalarFieldEnum[]
  }

  /**
   * SaleLine findMany
   */
  export type SaleLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * Filter, which SaleLines to fetch.
     */
    where?: SaleLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SaleLines to fetch.
     */
    orderBy?: SaleLineOrderByWithRelationInput | SaleLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing SaleLines.
     */
    cursor?: SaleLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SaleLines 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` SaleLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SaleLines.
     */
    distinct?: SaleLineScalarFieldEnum | SaleLineScalarFieldEnum[]
  }

  /**
   * SaleLine create
   */
  export type SaleLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * The data needed to create a SaleLine.
     */
    data: XOR<SaleLineCreateInput, SaleLineUncheckedCreateInput>
  }

  /**
   * SaleLine createMany
   */
  export type SaleLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many SaleLines.
     */
    data: SaleLineCreateManyInput | SaleLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * SaleLine createManyAndReturn
   */
  export type SaleLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * The data used to create many SaleLines.
     */
    data: SaleLineCreateManyInput | SaleLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * SaleLine update
   */
  export type SaleLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * The data needed to update a SaleLine.
     */
    data: XOR<SaleLineUpdateInput, SaleLineUncheckedUpdateInput>
    /**
     * Choose, which SaleLine to update.
     */
    where: SaleLineWhereUniqueInput
  }

  /**
   * SaleLine updateMany
   */
  export type SaleLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update SaleLines.
     */
    data: XOR<SaleLineUpdateManyMutationInput, SaleLineUncheckedUpdateManyInput>
    /**
     * Filter which SaleLines to update
     */
    where?: SaleLineWhereInput
    /**
     * Limit how many SaleLines to update.
     */
    limit?: number
  }

  /**
   * SaleLine updateManyAndReturn
   */
  export type SaleLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * The data used to update SaleLines.
     */
    data: XOR<SaleLineUpdateManyMutationInput, SaleLineUncheckedUpdateManyInput>
    /**
     * Filter which SaleLines to update
     */
    where?: SaleLineWhereInput
    /**
     * Limit how many SaleLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * SaleLine upsert
   */
  export type SaleLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * The filter to search for the SaleLine to update in case it exists.
     */
    where: SaleLineWhereUniqueInput
    /**
     * In case the SaleLine found by the `where` argument doesn't exist, create a new SaleLine with this data.
     */
    create: XOR<SaleLineCreateInput, SaleLineUncheckedCreateInput>
    /**
     * In case the SaleLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SaleLineUpdateInput, SaleLineUncheckedUpdateInput>
  }

  /**
   * SaleLine delete
   */
  export type SaleLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    /**
     * Filter which SaleLine to delete.
     */
    where: SaleLineWhereUniqueInput
  }

  /**
   * SaleLine deleteMany
   */
  export type SaleLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SaleLines to delete
     */
    where?: SaleLineWhereInput
    /**
     * Limit how many SaleLines to delete.
     */
    limit?: number
  }

  /**
   * SaleLine without action
   */
  export type SaleLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
  }


  /**
   * Model SalesReturn
   */

  export type AggregateSalesReturn = {
    _count: SalesReturnCountAggregateOutputType | null
    _avg: SalesReturnAvgAggregateOutputType | null
    _sum: SalesReturnSumAggregateOutputType | null
    _min: SalesReturnMinAggregateOutputType | null
    _max: SalesReturnMaxAggregateOutputType | null
  }

  export type SalesReturnAvgAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type SalesReturnSumAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type SalesReturnMinAggregateOutputType = {
    id: string | null
    number: string | null
    saleId: string | null
    customerId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string | null
    returnDate: Date | null
    reason: string | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type SalesReturnMaxAggregateOutputType = {
    id: string | null
    number: string | null
    saleId: string | null
    customerId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string | null
    returnDate: Date | null
    reason: string | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type SalesReturnCountAggregateOutputType = {
    id: number
    number: number
    saleId: number
    customerId: number
    warehouseId: number
    branchId: number
    status: number
    returnDate: number
    reason: number
    notes: number
    subtotal: number
    taxTotal: number
    total: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type SalesReturnAvgAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type SalesReturnSumAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type SalesReturnMinAggregateInputType = {
    id?: true
    number?: true
    saleId?: true
    customerId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    returnDate?: true
    reason?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
  }

  export type SalesReturnMaxAggregateInputType = {
    id?: true
    number?: true
    saleId?: true
    customerId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    returnDate?: true
    reason?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
  }

  export type SalesReturnCountAggregateInputType = {
    id?: true
    number?: true
    saleId?: true
    customerId?: true
    warehouseId?: true
    branchId?: true
    status?: true
    returnDate?: true
    reason?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type SalesReturnAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SalesReturn to aggregate.
     */
    where?: SalesReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturns to fetch.
     */
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SalesReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturns 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` SalesReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned SalesReturns
    **/
    _count?: true | SalesReturnCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: SalesReturnAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: SalesReturnSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SalesReturnMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SalesReturnMaxAggregateInputType
  }

  export type GetSalesReturnAggregateType<T extends SalesReturnAggregateArgs> = {
        [P in keyof T & keyof AggregateSalesReturn]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSalesReturn[P]>
      : GetScalarType<T[P], AggregateSalesReturn[P]>
  }




  export type SalesReturnGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnWhereInput
    orderBy?: SalesReturnOrderByWithAggregationInput | SalesReturnOrderByWithAggregationInput[]
    by: SalesReturnScalarFieldEnum[] | SalesReturnScalarFieldEnum
    having?: SalesReturnScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SalesReturnCountAggregateInputType | true
    _avg?: SalesReturnAvgAggregateInputType
    _sum?: SalesReturnSumAggregateInputType
    _min?: SalesReturnMinAggregateInputType
    _max?: SalesReturnMaxAggregateInputType
  }

  export type SalesReturnGroupByOutputType = {
    id: string
    number: string
    saleId: string | null
    customerId: string | null
    warehouseId: string | null
    branchId: string | null
    status: string
    returnDate: Date
    reason: string | null
    notes: string | null
    subtotal: number
    taxTotal: number
    total: number
    createdAt: Date
    updatedAt: Date
    _count: SalesReturnCountAggregateOutputType | null
    _avg: SalesReturnAvgAggregateOutputType | null
    _sum: SalesReturnSumAggregateOutputType | null
    _min: SalesReturnMinAggregateOutputType | null
    _max: SalesReturnMaxAggregateOutputType | null
  }

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


  export type SalesReturnSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    saleId?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    sale?: boolean | SalesReturn$saleArgs<ExtArgs>
    customer?: boolean | SalesReturn$customerArgs<ExtArgs>
    warehouse?: boolean | SalesReturn$warehouseArgs<ExtArgs>
    branch?: boolean | SalesReturn$branchArgs<ExtArgs>
    lines?: boolean | SalesReturn$linesArgs<ExtArgs>
    _count?: boolean | SalesReturnCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["salesReturn"]>

  export type SalesReturnSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    saleId?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    sale?: boolean | SalesReturn$saleArgs<ExtArgs>
    customer?: boolean | SalesReturn$customerArgs<ExtArgs>
    warehouse?: boolean | SalesReturn$warehouseArgs<ExtArgs>
    branch?: boolean | SalesReturn$branchArgs<ExtArgs>
  }, ExtArgs["result"]["salesReturn"]>

  export type SalesReturnSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    saleId?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    sale?: boolean | SalesReturn$saleArgs<ExtArgs>
    customer?: boolean | SalesReturn$customerArgs<ExtArgs>
    warehouse?: boolean | SalesReturn$warehouseArgs<ExtArgs>
    branch?: boolean | SalesReturn$branchArgs<ExtArgs>
  }, ExtArgs["result"]["salesReturn"]>

  export type SalesReturnSelectScalar = {
    id?: boolean
    number?: boolean
    saleId?: boolean
    customerId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    status?: boolean
    returnDate?: boolean
    reason?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type SalesReturnOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "number" | "saleId" | "customerId" | "warehouseId" | "branchId" | "status" | "returnDate" | "reason" | "notes" | "subtotal" | "taxTotal" | "total" | "createdAt" | "updatedAt", ExtArgs["result"]["salesReturn"]>
  export type SalesReturnInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sale?: boolean | SalesReturn$saleArgs<ExtArgs>
    customer?: boolean | SalesReturn$customerArgs<ExtArgs>
    warehouse?: boolean | SalesReturn$warehouseArgs<ExtArgs>
    branch?: boolean | SalesReturn$branchArgs<ExtArgs>
    lines?: boolean | SalesReturn$linesArgs<ExtArgs>
    _count?: boolean | SalesReturnCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type SalesReturnIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sale?: boolean | SalesReturn$saleArgs<ExtArgs>
    customer?: boolean | SalesReturn$customerArgs<ExtArgs>
    warehouse?: boolean | SalesReturn$warehouseArgs<ExtArgs>
    branch?: boolean | SalesReturn$branchArgs<ExtArgs>
  }
  export type SalesReturnIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    sale?: boolean | SalesReturn$saleArgs<ExtArgs>
    customer?: boolean | SalesReturn$customerArgs<ExtArgs>
    warehouse?: boolean | SalesReturn$warehouseArgs<ExtArgs>
    branch?: boolean | SalesReturn$branchArgs<ExtArgs>
  }

  export type $SalesReturnPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "SalesReturn"
    objects: {
      sale: Prisma.$SalePayload<ExtArgs> | null
      customer: Prisma.$CustomerPayload<ExtArgs> | null
      warehouse: Prisma.$WarehousePayload<ExtArgs> | null
      branch: Prisma.$BranchPayload<ExtArgs> | null
      lines: Prisma.$SalesReturnLinePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      number: string
      saleId: string | null
      customerId: string | null
      warehouseId: string | null
      branchId: string | null
      status: string
      returnDate: Date
      reason: string | null
      notes: string | null
      subtotal: number
      taxTotal: number
      total: number
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["salesReturn"]>
    composites: {}
  }

  type SalesReturnGetPayload<S extends boolean | null | undefined | SalesReturnDefaultArgs> = $Result.GetResult<Prisma.$SalesReturnPayload, S>

  type SalesReturnCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SalesReturnFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SalesReturnCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a SalesReturn.
     * @param {SalesReturnCreateArgs} args - Arguments to create a SalesReturn.
     * @example
     * // Create one SalesReturn
     * const SalesReturn = await prisma.salesReturn.create({
     *   data: {
     *     // ... data to create a SalesReturn
     *   }
     * })
     * 
     */
    create<T extends SalesReturnCreateArgs>(args: SelectSubset<T, SalesReturnCreateArgs<ExtArgs>>): Prisma__SalesReturnClient<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many SalesReturns and returns the data saved in the database.
     * @param {SalesReturnCreateManyAndReturnArgs} args - Arguments to create many SalesReturns.
     * @example
     * // Create many SalesReturns
     * const salesReturn = await prisma.salesReturn.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many SalesReturns and only return the `id`
     * const salesReturnWithIdOnly = await prisma.salesReturn.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SalesReturnCreateManyAndReturnArgs>(args?: SelectSubset<T, SalesReturnCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a SalesReturn.
     * @param {SalesReturnDeleteArgs} args - Arguments to delete one SalesReturn.
     * @example
     * // Delete one SalesReturn
     * const SalesReturn = await prisma.salesReturn.delete({
     *   where: {
     *     // ... filter to delete one SalesReturn
     *   }
     * })
     * 
     */
    delete<T extends SalesReturnDeleteArgs>(args: SelectSubset<T, SalesReturnDeleteArgs<ExtArgs>>): Prisma__SalesReturnClient<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one SalesReturn.
     * @param {SalesReturnUpdateArgs} args - Arguments to update one SalesReturn.
     * @example
     * // Update one SalesReturn
     * const salesReturn = await prisma.salesReturn.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SalesReturnUpdateArgs>(args: SelectSubset<T, SalesReturnUpdateArgs<ExtArgs>>): Prisma__SalesReturnClient<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more SalesReturns and returns the data updated in the database.
     * @param {SalesReturnUpdateManyAndReturnArgs} args - Arguments to update many SalesReturns.
     * @example
     * // Update many SalesReturns
     * const salesReturn = await prisma.salesReturn.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more SalesReturns and only return the `id`
     * const salesReturnWithIdOnly = await prisma.salesReturn.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SalesReturnUpdateManyAndReturnArgs>(args: SelectSubset<T, SalesReturnUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a SalesReturn.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SalesReturnAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SalesReturnAggregateArgs>(args: Subset<T, SalesReturnAggregateArgs>): Prisma.PrismaPromise<GetSalesReturnAggregateType<T>>

    /**
     * Group by SalesReturn.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SalesReturnGroupByArgs} 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 SalesReturnGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SalesReturnGroupByArgs['orderBy'] }
        : { orderBy?: SalesReturnGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SalesReturnGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSalesReturnGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the SalesReturn model
   */
  readonly fields: SalesReturnFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for SalesReturn.
   * 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__SalesReturnClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    sale<T extends SalesReturn$saleArgs<ExtArgs> = {}>(args?: Subset<T, SalesReturn$saleArgs<ExtArgs>>): Prisma__SaleClient<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    customer<T extends SalesReturn$customerArgs<ExtArgs> = {}>(args?: Subset<T, SalesReturn$customerArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    warehouse<T extends SalesReturn$warehouseArgs<ExtArgs> = {}>(args?: Subset<T, SalesReturn$warehouseArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branch<T extends SalesReturn$branchArgs<ExtArgs> = {}>(args?: Subset<T, SalesReturn$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends SalesReturn$linesArgs<ExtArgs> = {}>(args?: Subset<T, SalesReturn$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the SalesReturn model
   */
  interface SalesReturnFieldRefs {
    readonly id: FieldRef<"SalesReturn", 'String'>
    readonly number: FieldRef<"SalesReturn", 'String'>
    readonly saleId: FieldRef<"SalesReturn", 'String'>
    readonly customerId: FieldRef<"SalesReturn", 'String'>
    readonly warehouseId: FieldRef<"SalesReturn", 'String'>
    readonly branchId: FieldRef<"SalesReturn", 'String'>
    readonly status: FieldRef<"SalesReturn", 'String'>
    readonly returnDate: FieldRef<"SalesReturn", 'DateTime'>
    readonly reason: FieldRef<"SalesReturn", 'String'>
    readonly notes: FieldRef<"SalesReturn", 'String'>
    readonly subtotal: FieldRef<"SalesReturn", 'Float'>
    readonly taxTotal: FieldRef<"SalesReturn", 'Float'>
    readonly total: FieldRef<"SalesReturn", 'Float'>
    readonly createdAt: FieldRef<"SalesReturn", 'DateTime'>
    readonly updatedAt: FieldRef<"SalesReturn", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * SalesReturn findUnique
   */
  export type SalesReturnFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturn to fetch.
     */
    where: SalesReturnWhereUniqueInput
  }

  /**
   * SalesReturn findUniqueOrThrow
   */
  export type SalesReturnFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturn to fetch.
     */
    where: SalesReturnWhereUniqueInput
  }

  /**
   * SalesReturn findFirst
   */
  export type SalesReturnFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturn to fetch.
     */
    where?: SalesReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturns to fetch.
     */
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SalesReturns.
     */
    cursor?: SalesReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturns 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` SalesReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SalesReturns.
     */
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * SalesReturn findFirstOrThrow
   */
  export type SalesReturnFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturn to fetch.
     */
    where?: SalesReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturns to fetch.
     */
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SalesReturns.
     */
    cursor?: SalesReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturns 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` SalesReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SalesReturns.
     */
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * SalesReturn findMany
   */
  export type SalesReturnFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturns to fetch.
     */
    where?: SalesReturnWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturns to fetch.
     */
    orderBy?: SalesReturnOrderByWithRelationInput | SalesReturnOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing SalesReturns.
     */
    cursor?: SalesReturnWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturns 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` SalesReturns.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SalesReturns.
     */
    distinct?: SalesReturnScalarFieldEnum | SalesReturnScalarFieldEnum[]
  }

  /**
   * SalesReturn create
   */
  export type SalesReturnCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * The data needed to create a SalesReturn.
     */
    data: XOR<SalesReturnCreateInput, SalesReturnUncheckedCreateInput>
  }

  /**
   * SalesReturn createMany
   */
  export type SalesReturnCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many SalesReturns.
     */
    data: SalesReturnCreateManyInput | SalesReturnCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * SalesReturn createManyAndReturn
   */
  export type SalesReturnCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * The data used to create many SalesReturns.
     */
    data: SalesReturnCreateManyInput | SalesReturnCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * SalesReturn update
   */
  export type SalesReturnUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * The data needed to update a SalesReturn.
     */
    data: XOR<SalesReturnUpdateInput, SalesReturnUncheckedUpdateInput>
    /**
     * Choose, which SalesReturn to update.
     */
    where: SalesReturnWhereUniqueInput
  }

  /**
   * SalesReturn updateMany
   */
  export type SalesReturnUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update SalesReturns.
     */
    data: XOR<SalesReturnUpdateManyMutationInput, SalesReturnUncheckedUpdateManyInput>
    /**
     * Filter which SalesReturns to update
     */
    where?: SalesReturnWhereInput
    /**
     * Limit how many SalesReturns to update.
     */
    limit?: number
  }

  /**
   * SalesReturn updateManyAndReturn
   */
  export type SalesReturnUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * The data used to update SalesReturns.
     */
    data: XOR<SalesReturnUpdateManyMutationInput, SalesReturnUncheckedUpdateManyInput>
    /**
     * Filter which SalesReturns to update
     */
    where?: SalesReturnWhereInput
    /**
     * Limit how many SalesReturns to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * SalesReturn upsert
   */
  export type SalesReturnUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * The filter to search for the SalesReturn to update in case it exists.
     */
    where: SalesReturnWhereUniqueInput
    /**
     * In case the SalesReturn found by the `where` argument doesn't exist, create a new SalesReturn with this data.
     */
    create: XOR<SalesReturnCreateInput, SalesReturnUncheckedCreateInput>
    /**
     * In case the SalesReturn was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SalesReturnUpdateInput, SalesReturnUncheckedUpdateInput>
  }

  /**
   * SalesReturn delete
   */
  export type SalesReturnDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
    /**
     * Filter which SalesReturn to delete.
     */
    where: SalesReturnWhereUniqueInput
  }

  /**
   * SalesReturn deleteMany
   */
  export type SalesReturnDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SalesReturns to delete
     */
    where?: SalesReturnWhereInput
    /**
     * Limit how many SalesReturns to delete.
     */
    limit?: number
  }

  /**
   * SalesReturn.sale
   */
  export type SalesReturn$saleArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    where?: SaleWhereInput
  }

  /**
   * SalesReturn.customer
   */
  export type SalesReturn$customerArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    where?: CustomerWhereInput
  }

  /**
   * SalesReturn.warehouse
   */
  export type SalesReturn$warehouseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
  }

  /**
   * SalesReturn.branch
   */
  export type SalesReturn$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * SalesReturn.lines
   */
  export type SalesReturn$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    where?: SalesReturnLineWhereInput
    orderBy?: SalesReturnLineOrderByWithRelationInput | SalesReturnLineOrderByWithRelationInput[]
    cursor?: SalesReturnLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SalesReturnLineScalarFieldEnum | SalesReturnLineScalarFieldEnum[]
  }

  /**
   * SalesReturn without action
   */
  export type SalesReturnDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturn
     */
    select?: SalesReturnSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturn
     */
    omit?: SalesReturnOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnInclude<ExtArgs> | null
  }


  /**
   * Model SalesReturnLine
   */

  export type AggregateSalesReturnLine = {
    _count: SalesReturnLineCountAggregateOutputType | null
    _avg: SalesReturnLineAvgAggregateOutputType | null
    _sum: SalesReturnLineSumAggregateOutputType | null
    _min: SalesReturnLineMinAggregateOutputType | null
    _max: SalesReturnLineMaxAggregateOutputType | null
  }

  export type SalesReturnLineAvgAggregateOutputType = {
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SalesReturnLineSumAggregateOutputType = {
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SalesReturnLineMinAggregateOutputType = {
    id: string | null
    salesReturnId: string | null
    productId: string | null
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SalesReturnLineMaxAggregateOutputType = {
    id: string | null
    salesReturnId: string | null
    productId: string | null
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type SalesReturnLineCountAggregateOutputType = {
    id: number
    salesReturnId: number
    productId: number
    quantity: number
    unitPrice: number
    taxRate: number
    lineTotal: number
    _all: number
  }


  export type SalesReturnLineAvgAggregateInputType = {
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SalesReturnLineSumAggregateInputType = {
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SalesReturnLineMinAggregateInputType = {
    id?: true
    salesReturnId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SalesReturnLineMaxAggregateInputType = {
    id?: true
    salesReturnId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type SalesReturnLineCountAggregateInputType = {
    id?: true
    salesReturnId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
    _all?: true
  }

  export type SalesReturnLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SalesReturnLine to aggregate.
     */
    where?: SalesReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturnLines to fetch.
     */
    orderBy?: SalesReturnLineOrderByWithRelationInput | SalesReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SalesReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturnLines 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` SalesReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned SalesReturnLines
    **/
    _count?: true | SalesReturnLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: SalesReturnLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: SalesReturnLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SalesReturnLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SalesReturnLineMaxAggregateInputType
  }

  export type GetSalesReturnLineAggregateType<T extends SalesReturnLineAggregateArgs> = {
        [P in keyof T & keyof AggregateSalesReturnLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSalesReturnLine[P]>
      : GetScalarType<T[P], AggregateSalesReturnLine[P]>
  }




  export type SalesReturnLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SalesReturnLineWhereInput
    orderBy?: SalesReturnLineOrderByWithAggregationInput | SalesReturnLineOrderByWithAggregationInput[]
    by: SalesReturnLineScalarFieldEnum[] | SalesReturnLineScalarFieldEnum
    having?: SalesReturnLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SalesReturnLineCountAggregateInputType | true
    _avg?: SalesReturnLineAvgAggregateInputType
    _sum?: SalesReturnLineSumAggregateInputType
    _min?: SalesReturnLineMinAggregateInputType
    _max?: SalesReturnLineMaxAggregateInputType
  }

  export type SalesReturnLineGroupByOutputType = {
    id: string
    salesReturnId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate: number
    lineTotal: number
    _count: SalesReturnLineCountAggregateOutputType | null
    _avg: SalesReturnLineAvgAggregateOutputType | null
    _sum: SalesReturnLineSumAggregateOutputType | null
    _min: SalesReturnLineMinAggregateOutputType | null
    _max: SalesReturnLineMaxAggregateOutputType | null
  }

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


  export type SalesReturnLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    salesReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    salesReturn?: boolean | SalesReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["salesReturnLine"]>

  export type SalesReturnLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    salesReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    salesReturn?: boolean | SalesReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["salesReturnLine"]>

  export type SalesReturnLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    salesReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    salesReturn?: boolean | SalesReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["salesReturnLine"]>

  export type SalesReturnLineSelectScalar = {
    id?: boolean
    salesReturnId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
  }

  export type SalesReturnLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "salesReturnId" | "productId" | "quantity" | "unitPrice" | "taxRate" | "lineTotal", ExtArgs["result"]["salesReturnLine"]>
  export type SalesReturnLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    salesReturn?: boolean | SalesReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type SalesReturnLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    salesReturn?: boolean | SalesReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type SalesReturnLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    salesReturn?: boolean | SalesReturnDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $SalesReturnLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "SalesReturnLine"
    objects: {
      salesReturn: Prisma.$SalesReturnPayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      salesReturnId: string
      productId: string
      quantity: number
      unitPrice: number
      taxRate: number
      lineTotal: number
    }, ExtArgs["result"]["salesReturnLine"]>
    composites: {}
  }

  type SalesReturnLineGetPayload<S extends boolean | null | undefined | SalesReturnLineDefaultArgs> = $Result.GetResult<Prisma.$SalesReturnLinePayload, S>

  type SalesReturnLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SalesReturnLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SalesReturnLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a SalesReturnLine.
     * @param {SalesReturnLineCreateArgs} args - Arguments to create a SalesReturnLine.
     * @example
     * // Create one SalesReturnLine
     * const SalesReturnLine = await prisma.salesReturnLine.create({
     *   data: {
     *     // ... data to create a SalesReturnLine
     *   }
     * })
     * 
     */
    create<T extends SalesReturnLineCreateArgs>(args: SelectSubset<T, SalesReturnLineCreateArgs<ExtArgs>>): Prisma__SalesReturnLineClient<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many SalesReturnLines and returns the data saved in the database.
     * @param {SalesReturnLineCreateManyAndReturnArgs} args - Arguments to create many SalesReturnLines.
     * @example
     * // Create many SalesReturnLines
     * const salesReturnLine = await prisma.salesReturnLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many SalesReturnLines and only return the `id`
     * const salesReturnLineWithIdOnly = await prisma.salesReturnLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SalesReturnLineCreateManyAndReturnArgs>(args?: SelectSubset<T, SalesReturnLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a SalesReturnLine.
     * @param {SalesReturnLineDeleteArgs} args - Arguments to delete one SalesReturnLine.
     * @example
     * // Delete one SalesReturnLine
     * const SalesReturnLine = await prisma.salesReturnLine.delete({
     *   where: {
     *     // ... filter to delete one SalesReturnLine
     *   }
     * })
     * 
     */
    delete<T extends SalesReturnLineDeleteArgs>(args: SelectSubset<T, SalesReturnLineDeleteArgs<ExtArgs>>): Prisma__SalesReturnLineClient<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one SalesReturnLine.
     * @param {SalesReturnLineUpdateArgs} args - Arguments to update one SalesReturnLine.
     * @example
     * // Update one SalesReturnLine
     * const salesReturnLine = await prisma.salesReturnLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SalesReturnLineUpdateArgs>(args: SelectSubset<T, SalesReturnLineUpdateArgs<ExtArgs>>): Prisma__SalesReturnLineClient<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more SalesReturnLines and returns the data updated in the database.
     * @param {SalesReturnLineUpdateManyAndReturnArgs} args - Arguments to update many SalesReturnLines.
     * @example
     * // Update many SalesReturnLines
     * const salesReturnLine = await prisma.salesReturnLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more SalesReturnLines and only return the `id`
     * const salesReturnLineWithIdOnly = await prisma.salesReturnLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SalesReturnLineUpdateManyAndReturnArgs>(args: SelectSubset<T, SalesReturnLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a SalesReturnLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SalesReturnLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SalesReturnLineAggregateArgs>(args: Subset<T, SalesReturnLineAggregateArgs>): Prisma.PrismaPromise<GetSalesReturnLineAggregateType<T>>

    /**
     * Group by SalesReturnLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SalesReturnLineGroupByArgs} 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 SalesReturnLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SalesReturnLineGroupByArgs['orderBy'] }
        : { orderBy?: SalesReturnLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SalesReturnLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSalesReturnLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the SalesReturnLine model
   */
  readonly fields: SalesReturnLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for SalesReturnLine.
   * 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__SalesReturnLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    salesReturn<T extends SalesReturnDefaultArgs<ExtArgs> = {}>(args?: Subset<T, SalesReturnDefaultArgs<ExtArgs>>): Prisma__SalesReturnClient<$Result.GetResult<Prisma.$SalesReturnPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the SalesReturnLine model
   */
  interface SalesReturnLineFieldRefs {
    readonly id: FieldRef<"SalesReturnLine", 'String'>
    readonly salesReturnId: FieldRef<"SalesReturnLine", 'String'>
    readonly productId: FieldRef<"SalesReturnLine", 'String'>
    readonly quantity: FieldRef<"SalesReturnLine", 'Int'>
    readonly unitPrice: FieldRef<"SalesReturnLine", 'Float'>
    readonly taxRate: FieldRef<"SalesReturnLine", 'Float'>
    readonly lineTotal: FieldRef<"SalesReturnLine", 'Float'>
  }
    

  // Custom InputTypes
  /**
   * SalesReturnLine findUnique
   */
  export type SalesReturnLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturnLine to fetch.
     */
    where: SalesReturnLineWhereUniqueInput
  }

  /**
   * SalesReturnLine findUniqueOrThrow
   */
  export type SalesReturnLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturnLine to fetch.
     */
    where: SalesReturnLineWhereUniqueInput
  }

  /**
   * SalesReturnLine findFirst
   */
  export type SalesReturnLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturnLine to fetch.
     */
    where?: SalesReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturnLines to fetch.
     */
    orderBy?: SalesReturnLineOrderByWithRelationInput | SalesReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SalesReturnLines.
     */
    cursor?: SalesReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturnLines 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` SalesReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SalesReturnLines.
     */
    distinct?: SalesReturnLineScalarFieldEnum | SalesReturnLineScalarFieldEnum[]
  }

  /**
   * SalesReturnLine findFirstOrThrow
   */
  export type SalesReturnLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturnLine to fetch.
     */
    where?: SalesReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturnLines to fetch.
     */
    orderBy?: SalesReturnLineOrderByWithRelationInput | SalesReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SalesReturnLines.
     */
    cursor?: SalesReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturnLines 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` SalesReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SalesReturnLines.
     */
    distinct?: SalesReturnLineScalarFieldEnum | SalesReturnLineScalarFieldEnum[]
  }

  /**
   * SalesReturnLine findMany
   */
  export type SalesReturnLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * Filter, which SalesReturnLines to fetch.
     */
    where?: SalesReturnLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SalesReturnLines to fetch.
     */
    orderBy?: SalesReturnLineOrderByWithRelationInput | SalesReturnLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing SalesReturnLines.
     */
    cursor?: SalesReturnLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SalesReturnLines 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` SalesReturnLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SalesReturnLines.
     */
    distinct?: SalesReturnLineScalarFieldEnum | SalesReturnLineScalarFieldEnum[]
  }

  /**
   * SalesReturnLine create
   */
  export type SalesReturnLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * The data needed to create a SalesReturnLine.
     */
    data: XOR<SalesReturnLineCreateInput, SalesReturnLineUncheckedCreateInput>
  }

  /**
   * SalesReturnLine createMany
   */
  export type SalesReturnLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many SalesReturnLines.
     */
    data: SalesReturnLineCreateManyInput | SalesReturnLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * SalesReturnLine createManyAndReturn
   */
  export type SalesReturnLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * The data used to create many SalesReturnLines.
     */
    data: SalesReturnLineCreateManyInput | SalesReturnLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * SalesReturnLine update
   */
  export type SalesReturnLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * The data needed to update a SalesReturnLine.
     */
    data: XOR<SalesReturnLineUpdateInput, SalesReturnLineUncheckedUpdateInput>
    /**
     * Choose, which SalesReturnLine to update.
     */
    where: SalesReturnLineWhereUniqueInput
  }

  /**
   * SalesReturnLine updateMany
   */
  export type SalesReturnLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update SalesReturnLines.
     */
    data: XOR<SalesReturnLineUpdateManyMutationInput, SalesReturnLineUncheckedUpdateManyInput>
    /**
     * Filter which SalesReturnLines to update
     */
    where?: SalesReturnLineWhereInput
    /**
     * Limit how many SalesReturnLines to update.
     */
    limit?: number
  }

  /**
   * SalesReturnLine updateManyAndReturn
   */
  export type SalesReturnLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * The data used to update SalesReturnLines.
     */
    data: XOR<SalesReturnLineUpdateManyMutationInput, SalesReturnLineUncheckedUpdateManyInput>
    /**
     * Filter which SalesReturnLines to update
     */
    where?: SalesReturnLineWhereInput
    /**
     * Limit how many SalesReturnLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * SalesReturnLine upsert
   */
  export type SalesReturnLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * The filter to search for the SalesReturnLine to update in case it exists.
     */
    where: SalesReturnLineWhereUniqueInput
    /**
     * In case the SalesReturnLine found by the `where` argument doesn't exist, create a new SalesReturnLine with this data.
     */
    create: XOR<SalesReturnLineCreateInput, SalesReturnLineUncheckedCreateInput>
    /**
     * In case the SalesReturnLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SalesReturnLineUpdateInput, SalesReturnLineUncheckedUpdateInput>
  }

  /**
   * SalesReturnLine delete
   */
  export type SalesReturnLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    /**
     * Filter which SalesReturnLine to delete.
     */
    where: SalesReturnLineWhereUniqueInput
  }

  /**
   * SalesReturnLine deleteMany
   */
  export type SalesReturnLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SalesReturnLines to delete
     */
    where?: SalesReturnLineWhereInput
    /**
     * Limit how many SalesReturnLines to delete.
     */
    limit?: number
  }

  /**
   * SalesReturnLine without action
   */
  export type SalesReturnLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
  }


  /**
   * Model Tax
   */

  export type AggregateTax = {
    _count: TaxCountAggregateOutputType | null
    _avg: TaxAvgAggregateOutputType | null
    _sum: TaxSumAggregateOutputType | null
    _min: TaxMinAggregateOutputType | null
    _max: TaxMaxAggregateOutputType | null
  }

  export type TaxAvgAggregateOutputType = {
    rate: number | null
    sortOrder: number | null
  }

  export type TaxSumAggregateOutputType = {
    rate: number | null
    sortOrder: number | null
  }

  export type TaxMinAggregateOutputType = {
    id: string | null
    name: string | null
    rate: number | null
    branchId: string | null
    isActive: boolean | null
    sortOrder: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type TaxMaxAggregateOutputType = {
    id: string | null
    name: string | null
    rate: number | null
    branchId: string | null
    isActive: boolean | null
    sortOrder: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type TaxCountAggregateOutputType = {
    id: number
    name: number
    rate: number
    branchId: number
    isActive: number
    sortOrder: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type TaxAvgAggregateInputType = {
    rate?: true
    sortOrder?: true
  }

  export type TaxSumAggregateInputType = {
    rate?: true
    sortOrder?: true
  }

  export type TaxMinAggregateInputType = {
    id?: true
    name?: true
    rate?: true
    branchId?: true
    isActive?: true
    sortOrder?: true
    createdAt?: true
    updatedAt?: true
  }

  export type TaxMaxAggregateInputType = {
    id?: true
    name?: true
    rate?: true
    branchId?: true
    isActive?: true
    sortOrder?: true
    createdAt?: true
    updatedAt?: true
  }

  export type TaxCountAggregateInputType = {
    id?: true
    name?: true
    rate?: true
    branchId?: true
    isActive?: true
    sortOrder?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type TaxAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Tax to aggregate.
     */
    where?: TaxWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Taxes to fetch.
     */
    orderBy?: TaxOrderByWithRelationInput | TaxOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: TaxWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Taxes 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` Taxes.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Taxes
    **/
    _count?: true | TaxCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: TaxAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: TaxSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: TaxMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: TaxMaxAggregateInputType
  }

  export type GetTaxAggregateType<T extends TaxAggregateArgs> = {
        [P in keyof T & keyof AggregateTax]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateTax[P]>
      : GetScalarType<T[P], AggregateTax[P]>
  }




  export type TaxGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: TaxWhereInput
    orderBy?: TaxOrderByWithAggregationInput | TaxOrderByWithAggregationInput[]
    by: TaxScalarFieldEnum[] | TaxScalarFieldEnum
    having?: TaxScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: TaxCountAggregateInputType | true
    _avg?: TaxAvgAggregateInputType
    _sum?: TaxSumAggregateInputType
    _min?: TaxMinAggregateInputType
    _max?: TaxMaxAggregateInputType
  }

  export type TaxGroupByOutputType = {
    id: string
    name: string
    rate: number
    branchId: string | null
    isActive: boolean
    sortOrder: number
    createdAt: Date
    updatedAt: Date
    _count: TaxCountAggregateOutputType | null
    _avg: TaxAvgAggregateOutputType | null
    _sum: TaxSumAggregateOutputType | null
    _min: TaxMinAggregateOutputType | null
    _max: TaxMaxAggregateOutputType | null
  }

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


  export type TaxSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    rate?: boolean
    branchId?: boolean
    isActive?: boolean
    sortOrder?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Tax$branchArgs<ExtArgs>
    productsSales?: boolean | Tax$productsSalesArgs<ExtArgs>
    productsPurchase?: boolean | Tax$productsPurchaseArgs<ExtArgs>
    _count?: boolean | TaxCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["tax"]>

  export type TaxSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    rate?: boolean
    branchId?: boolean
    isActive?: boolean
    sortOrder?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Tax$branchArgs<ExtArgs>
  }, ExtArgs["result"]["tax"]>

  export type TaxSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    rate?: boolean
    branchId?: boolean
    isActive?: boolean
    sortOrder?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | Tax$branchArgs<ExtArgs>
  }, ExtArgs["result"]["tax"]>

  export type TaxSelectScalar = {
    id?: boolean
    name?: boolean
    rate?: boolean
    branchId?: boolean
    isActive?: boolean
    sortOrder?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type TaxOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "rate" | "branchId" | "isActive" | "sortOrder" | "createdAt" | "updatedAt", ExtArgs["result"]["tax"]>
  export type TaxInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Tax$branchArgs<ExtArgs>
    productsSales?: boolean | Tax$productsSalesArgs<ExtArgs>
    productsPurchase?: boolean | Tax$productsPurchaseArgs<ExtArgs>
    _count?: boolean | TaxCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type TaxIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Tax$branchArgs<ExtArgs>
  }
  export type TaxIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Tax$branchArgs<ExtArgs>
  }

  export type $TaxPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Tax"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      productsSales: Prisma.$ProductPayload<ExtArgs>[]
      productsPurchase: Prisma.$ProductPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      /**
       * Percentage rate. Example: 15 for 15%.
       */
      rate: number
      branchId: string | null
      isActive: boolean
      sortOrder: number
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["tax"]>
    composites: {}
  }

  type TaxGetPayload<S extends boolean | null | undefined | TaxDefaultArgs> = $Result.GetResult<Prisma.$TaxPayload, S>

  type TaxCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<TaxFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: TaxCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Tax.
     * @param {TaxCreateArgs} args - Arguments to create a Tax.
     * @example
     * // Create one Tax
     * const Tax = await prisma.tax.create({
     *   data: {
     *     // ... data to create a Tax
     *   }
     * })
     * 
     */
    create<T extends TaxCreateArgs>(args: SelectSubset<T, TaxCreateArgs<ExtArgs>>): Prisma__TaxClient<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Taxes and returns the data saved in the database.
     * @param {TaxCreateManyAndReturnArgs} args - Arguments to create many Taxes.
     * @example
     * // Create many Taxes
     * const tax = await prisma.tax.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Taxes and only return the `id`
     * const taxWithIdOnly = await prisma.tax.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends TaxCreateManyAndReturnArgs>(args?: SelectSubset<T, TaxCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Tax.
     * @param {TaxDeleteArgs} args - Arguments to delete one Tax.
     * @example
     * // Delete one Tax
     * const Tax = await prisma.tax.delete({
     *   where: {
     *     // ... filter to delete one Tax
     *   }
     * })
     * 
     */
    delete<T extends TaxDeleteArgs>(args: SelectSubset<T, TaxDeleteArgs<ExtArgs>>): Prisma__TaxClient<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Tax.
     * @param {TaxUpdateArgs} args - Arguments to update one Tax.
     * @example
     * // Update one Tax
     * const tax = await prisma.tax.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends TaxUpdateArgs>(args: SelectSubset<T, TaxUpdateArgs<ExtArgs>>): Prisma__TaxClient<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Taxes and returns the data updated in the database.
     * @param {TaxUpdateManyAndReturnArgs} args - Arguments to update many Taxes.
     * @example
     * // Update many Taxes
     * const tax = await prisma.tax.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Taxes and only return the `id`
     * const taxWithIdOnly = await prisma.tax.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends TaxUpdateManyAndReturnArgs>(args: SelectSubset<T, TaxUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Tax.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {TaxAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends TaxAggregateArgs>(args: Subset<T, TaxAggregateArgs>): Prisma.PrismaPromise<GetTaxAggregateType<T>>

    /**
     * Group by Tax.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {TaxGroupByArgs} 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 TaxGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: TaxGroupByArgs['orderBy'] }
        : { orderBy?: TaxGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, TaxGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetTaxGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Tax model
   */
  readonly fields: TaxFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Tax.
   * 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__TaxClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Tax$branchArgs<ExtArgs> = {}>(args?: Subset<T, Tax$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    productsSales<T extends Tax$productsSalesArgs<ExtArgs> = {}>(args?: Subset<T, Tax$productsSalesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    productsPurchase<T extends Tax$productsPurchaseArgs<ExtArgs> = {}>(args?: Subset<T, Tax$productsPurchaseArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Tax model
   */
  interface TaxFieldRefs {
    readonly id: FieldRef<"Tax", 'String'>
    readonly name: FieldRef<"Tax", 'String'>
    readonly rate: FieldRef<"Tax", 'Float'>
    readonly branchId: FieldRef<"Tax", 'String'>
    readonly isActive: FieldRef<"Tax", 'Boolean'>
    readonly sortOrder: FieldRef<"Tax", 'Int'>
    readonly createdAt: FieldRef<"Tax", 'DateTime'>
    readonly updatedAt: FieldRef<"Tax", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Tax findUnique
   */
  export type TaxFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * Filter, which Tax to fetch.
     */
    where: TaxWhereUniqueInput
  }

  /**
   * Tax findUniqueOrThrow
   */
  export type TaxFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * Filter, which Tax to fetch.
     */
    where: TaxWhereUniqueInput
  }

  /**
   * Tax findFirst
   */
  export type TaxFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * Filter, which Tax to fetch.
     */
    where?: TaxWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Taxes to fetch.
     */
    orderBy?: TaxOrderByWithRelationInput | TaxOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Taxes.
     */
    cursor?: TaxWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Taxes 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` Taxes.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Taxes.
     */
    distinct?: TaxScalarFieldEnum | TaxScalarFieldEnum[]
  }

  /**
   * Tax findFirstOrThrow
   */
  export type TaxFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * Filter, which Tax to fetch.
     */
    where?: TaxWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Taxes to fetch.
     */
    orderBy?: TaxOrderByWithRelationInput | TaxOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Taxes.
     */
    cursor?: TaxWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Taxes 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` Taxes.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Taxes.
     */
    distinct?: TaxScalarFieldEnum | TaxScalarFieldEnum[]
  }

  /**
   * Tax findMany
   */
  export type TaxFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * Filter, which Taxes to fetch.
     */
    where?: TaxWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Taxes to fetch.
     */
    orderBy?: TaxOrderByWithRelationInput | TaxOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Taxes.
     */
    cursor?: TaxWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Taxes 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` Taxes.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Taxes.
     */
    distinct?: TaxScalarFieldEnum | TaxScalarFieldEnum[]
  }

  /**
   * Tax create
   */
  export type TaxCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * The data needed to create a Tax.
     */
    data: XOR<TaxCreateInput, TaxUncheckedCreateInput>
  }

  /**
   * Tax createMany
   */
  export type TaxCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Taxes.
     */
    data: TaxCreateManyInput | TaxCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Tax createManyAndReturn
   */
  export type TaxCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * The data used to create many Taxes.
     */
    data: TaxCreateManyInput | TaxCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Tax update
   */
  export type TaxUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * The data needed to update a Tax.
     */
    data: XOR<TaxUpdateInput, TaxUncheckedUpdateInput>
    /**
     * Choose, which Tax to update.
     */
    where: TaxWhereUniqueInput
  }

  /**
   * Tax updateMany
   */
  export type TaxUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Taxes.
     */
    data: XOR<TaxUpdateManyMutationInput, TaxUncheckedUpdateManyInput>
    /**
     * Filter which Taxes to update
     */
    where?: TaxWhereInput
    /**
     * Limit how many Taxes to update.
     */
    limit?: number
  }

  /**
   * Tax updateManyAndReturn
   */
  export type TaxUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * The data used to update Taxes.
     */
    data: XOR<TaxUpdateManyMutationInput, TaxUncheckedUpdateManyInput>
    /**
     * Filter which Taxes to update
     */
    where?: TaxWhereInput
    /**
     * Limit how many Taxes to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Tax upsert
   */
  export type TaxUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * The filter to search for the Tax to update in case it exists.
     */
    where: TaxWhereUniqueInput
    /**
     * In case the Tax found by the `where` argument doesn't exist, create a new Tax with this data.
     */
    create: XOR<TaxCreateInput, TaxUncheckedCreateInput>
    /**
     * In case the Tax was found with the provided `where` argument, update it with this data.
     */
    update: XOR<TaxUpdateInput, TaxUncheckedUpdateInput>
  }

  /**
   * Tax delete
   */
  export type TaxDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    /**
     * Filter which Tax to delete.
     */
    where: TaxWhereUniqueInput
  }

  /**
   * Tax deleteMany
   */
  export type TaxDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Taxes to delete
     */
    where?: TaxWhereInput
    /**
     * Limit how many Taxes to delete.
     */
    limit?: number
  }

  /**
   * Tax.branch
   */
  export type Tax$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Tax.productsSales
   */
  export type Tax$productsSalesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Tax.productsPurchase
   */
  export type Tax$productsPurchaseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    cursor?: ProductWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Tax without action
   */
  export type TaxDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
  }


  /**
   * Model ExpenseCategory
   */

  export type AggregateExpenseCategory = {
    _count: ExpenseCategoryCountAggregateOutputType | null
    _avg: ExpenseCategoryAvgAggregateOutputType | null
    _sum: ExpenseCategorySumAggregateOutputType | null
    _min: ExpenseCategoryMinAggregateOutputType | null
    _max: ExpenseCategoryMaxAggregateOutputType | null
  }

  export type ExpenseCategoryAvgAggregateOutputType = {
    sortOrder: number | null
  }

  export type ExpenseCategorySumAggregateOutputType = {
    sortOrder: number | null
  }

  export type ExpenseCategoryMinAggregateOutputType = {
    id: string | null
    name: string | null
    description: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type ExpenseCategoryMaxAggregateOutputType = {
    id: string | null
    name: string | null
    description: string | null
    branchId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type ExpenseCategoryCountAggregateOutputType = {
    id: number
    name: number
    description: number
    branchId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type ExpenseCategoryAvgAggregateInputType = {
    sortOrder?: true
  }

  export type ExpenseCategorySumAggregateInputType = {
    sortOrder?: true
  }

  export type ExpenseCategoryMinAggregateInputType = {
    id?: true
    name?: true
    description?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type ExpenseCategoryMaxAggregateInputType = {
    id?: true
    name?: true
    description?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type ExpenseCategoryCountAggregateInputType = {
    id?: true
    name?: true
    description?: true
    branchId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type ExpenseCategoryAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which ExpenseCategory to aggregate.
     */
    where?: ExpenseCategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ExpenseCategories to fetch.
     */
    orderBy?: ExpenseCategoryOrderByWithRelationInput | ExpenseCategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: ExpenseCategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ExpenseCategories 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` ExpenseCategories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned ExpenseCategories
    **/
    _count?: true | ExpenseCategoryCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: ExpenseCategoryAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: ExpenseCategorySumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: ExpenseCategoryMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: ExpenseCategoryMaxAggregateInputType
  }

  export type GetExpenseCategoryAggregateType<T extends ExpenseCategoryAggregateArgs> = {
        [P in keyof T & keyof AggregateExpenseCategory]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateExpenseCategory[P]>
      : GetScalarType<T[P], AggregateExpenseCategory[P]>
  }




  export type ExpenseCategoryGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseCategoryWhereInput
    orderBy?: ExpenseCategoryOrderByWithAggregationInput | ExpenseCategoryOrderByWithAggregationInput[]
    by: ExpenseCategoryScalarFieldEnum[] | ExpenseCategoryScalarFieldEnum
    having?: ExpenseCategoryScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: ExpenseCategoryCountAggregateInputType | true
    _avg?: ExpenseCategoryAvgAggregateInputType
    _sum?: ExpenseCategorySumAggregateInputType
    _min?: ExpenseCategoryMinAggregateInputType
    _max?: ExpenseCategoryMaxAggregateInputType
  }

  export type ExpenseCategoryGroupByOutputType = {
    id: string
    name: string
    description: string | null
    branchId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: ExpenseCategoryCountAggregateOutputType | null
    _avg: ExpenseCategoryAvgAggregateOutputType | null
    _sum: ExpenseCategorySumAggregateOutputType | null
    _min: ExpenseCategoryMinAggregateOutputType | null
    _max: ExpenseCategoryMaxAggregateOutputType | null
  }

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


  export type ExpenseCategorySelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    description?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | ExpenseCategory$branchArgs<ExtArgs>
    expenses?: boolean | ExpenseCategory$expensesArgs<ExtArgs>
    _count?: boolean | ExpenseCategoryCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["expenseCategory"]>

  export type ExpenseCategorySelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    description?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | ExpenseCategory$branchArgs<ExtArgs>
  }, ExtArgs["result"]["expenseCategory"]>

  export type ExpenseCategorySelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    description?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    branch?: boolean | ExpenseCategory$branchArgs<ExtArgs>
  }, ExtArgs["result"]["expenseCategory"]>

  export type ExpenseCategorySelectScalar = {
    id?: boolean
    name?: boolean
    description?: boolean
    branchId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type ExpenseCategoryOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "description" | "branchId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["expenseCategory"]>
  export type ExpenseCategoryInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | ExpenseCategory$branchArgs<ExtArgs>
    expenses?: boolean | ExpenseCategory$expensesArgs<ExtArgs>
    _count?: boolean | ExpenseCategoryCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type ExpenseCategoryIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | ExpenseCategory$branchArgs<ExtArgs>
  }
  export type ExpenseCategoryIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | ExpenseCategory$branchArgs<ExtArgs>
  }

  export type $ExpenseCategoryPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "ExpenseCategory"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      expenses: Prisma.$ExpensePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      description: string | null
      branchId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["expenseCategory"]>
    composites: {}
  }

  type ExpenseCategoryGetPayload<S extends boolean | null | undefined | ExpenseCategoryDefaultArgs> = $Result.GetResult<Prisma.$ExpenseCategoryPayload, S>

  type ExpenseCategoryCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<ExpenseCategoryFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: ExpenseCategoryCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a ExpenseCategory.
     * @param {ExpenseCategoryCreateArgs} args - Arguments to create a ExpenseCategory.
     * @example
     * // Create one ExpenseCategory
     * const ExpenseCategory = await prisma.expenseCategory.create({
     *   data: {
     *     // ... data to create a ExpenseCategory
     *   }
     * })
     * 
     */
    create<T extends ExpenseCategoryCreateArgs>(args: SelectSubset<T, ExpenseCategoryCreateArgs<ExtArgs>>): Prisma__ExpenseCategoryClient<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many ExpenseCategories and returns the data saved in the database.
     * @param {ExpenseCategoryCreateManyAndReturnArgs} args - Arguments to create many ExpenseCategories.
     * @example
     * // Create many ExpenseCategories
     * const expenseCategory = await prisma.expenseCategory.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many ExpenseCategories and only return the `id`
     * const expenseCategoryWithIdOnly = await prisma.expenseCategory.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends ExpenseCategoryCreateManyAndReturnArgs>(args?: SelectSubset<T, ExpenseCategoryCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a ExpenseCategory.
     * @param {ExpenseCategoryDeleteArgs} args - Arguments to delete one ExpenseCategory.
     * @example
     * // Delete one ExpenseCategory
     * const ExpenseCategory = await prisma.expenseCategory.delete({
     *   where: {
     *     // ... filter to delete one ExpenseCategory
     *   }
     * })
     * 
     */
    delete<T extends ExpenseCategoryDeleteArgs>(args: SelectSubset<T, ExpenseCategoryDeleteArgs<ExtArgs>>): Prisma__ExpenseCategoryClient<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one ExpenseCategory.
     * @param {ExpenseCategoryUpdateArgs} args - Arguments to update one ExpenseCategory.
     * @example
     * // Update one ExpenseCategory
     * const expenseCategory = await prisma.expenseCategory.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends ExpenseCategoryUpdateArgs>(args: SelectSubset<T, ExpenseCategoryUpdateArgs<ExtArgs>>): Prisma__ExpenseCategoryClient<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more ExpenseCategories and returns the data updated in the database.
     * @param {ExpenseCategoryUpdateManyAndReturnArgs} args - Arguments to update many ExpenseCategories.
     * @example
     * // Update many ExpenseCategories
     * const expenseCategory = await prisma.expenseCategory.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more ExpenseCategories and only return the `id`
     * const expenseCategoryWithIdOnly = await prisma.expenseCategory.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends ExpenseCategoryUpdateManyAndReturnArgs>(args: SelectSubset<T, ExpenseCategoryUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a ExpenseCategory.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ExpenseCategoryAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends ExpenseCategoryAggregateArgs>(args: Subset<T, ExpenseCategoryAggregateArgs>): Prisma.PrismaPromise<GetExpenseCategoryAggregateType<T>>

    /**
     * Group by ExpenseCategory.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ExpenseCategoryGroupByArgs} 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 ExpenseCategoryGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: ExpenseCategoryGroupByArgs['orderBy'] }
        : { orderBy?: ExpenseCategoryGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, ExpenseCategoryGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetExpenseCategoryGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the ExpenseCategory model
   */
  readonly fields: ExpenseCategoryFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for ExpenseCategory.
   * 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__ExpenseCategoryClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends ExpenseCategory$branchArgs<ExtArgs> = {}>(args?: Subset<T, ExpenseCategory$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    expenses<T extends ExpenseCategory$expensesArgs<ExtArgs> = {}>(args?: Subset<T, ExpenseCategory$expensesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the ExpenseCategory model
   */
  interface ExpenseCategoryFieldRefs {
    readonly id: FieldRef<"ExpenseCategory", 'String'>
    readonly name: FieldRef<"ExpenseCategory", 'String'>
    readonly description: FieldRef<"ExpenseCategory", 'String'>
    readonly branchId: FieldRef<"ExpenseCategory", 'String'>
    readonly sortOrder: FieldRef<"ExpenseCategory", 'Int'>
    readonly isActive: FieldRef<"ExpenseCategory", 'Boolean'>
    readonly createdAt: FieldRef<"ExpenseCategory", 'DateTime'>
    readonly updatedAt: FieldRef<"ExpenseCategory", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * ExpenseCategory findUnique
   */
  export type ExpenseCategoryFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * Filter, which ExpenseCategory to fetch.
     */
    where: ExpenseCategoryWhereUniqueInput
  }

  /**
   * ExpenseCategory findUniqueOrThrow
   */
  export type ExpenseCategoryFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * Filter, which ExpenseCategory to fetch.
     */
    where: ExpenseCategoryWhereUniqueInput
  }

  /**
   * ExpenseCategory findFirst
   */
  export type ExpenseCategoryFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * Filter, which ExpenseCategory to fetch.
     */
    where?: ExpenseCategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ExpenseCategories to fetch.
     */
    orderBy?: ExpenseCategoryOrderByWithRelationInput | ExpenseCategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for ExpenseCategories.
     */
    cursor?: ExpenseCategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ExpenseCategories 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` ExpenseCategories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of ExpenseCategories.
     */
    distinct?: ExpenseCategoryScalarFieldEnum | ExpenseCategoryScalarFieldEnum[]
  }

  /**
   * ExpenseCategory findFirstOrThrow
   */
  export type ExpenseCategoryFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * Filter, which ExpenseCategory to fetch.
     */
    where?: ExpenseCategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ExpenseCategories to fetch.
     */
    orderBy?: ExpenseCategoryOrderByWithRelationInput | ExpenseCategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for ExpenseCategories.
     */
    cursor?: ExpenseCategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ExpenseCategories 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` ExpenseCategories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of ExpenseCategories.
     */
    distinct?: ExpenseCategoryScalarFieldEnum | ExpenseCategoryScalarFieldEnum[]
  }

  /**
   * ExpenseCategory findMany
   */
  export type ExpenseCategoryFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * Filter, which ExpenseCategories to fetch.
     */
    where?: ExpenseCategoryWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ExpenseCategories to fetch.
     */
    orderBy?: ExpenseCategoryOrderByWithRelationInput | ExpenseCategoryOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing ExpenseCategories.
     */
    cursor?: ExpenseCategoryWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ExpenseCategories 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` ExpenseCategories.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of ExpenseCategories.
     */
    distinct?: ExpenseCategoryScalarFieldEnum | ExpenseCategoryScalarFieldEnum[]
  }

  /**
   * ExpenseCategory create
   */
  export type ExpenseCategoryCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * The data needed to create a ExpenseCategory.
     */
    data: XOR<ExpenseCategoryCreateInput, ExpenseCategoryUncheckedCreateInput>
  }

  /**
   * ExpenseCategory createMany
   */
  export type ExpenseCategoryCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many ExpenseCategories.
     */
    data: ExpenseCategoryCreateManyInput | ExpenseCategoryCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * ExpenseCategory createManyAndReturn
   */
  export type ExpenseCategoryCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * The data used to create many ExpenseCategories.
     */
    data: ExpenseCategoryCreateManyInput | ExpenseCategoryCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * ExpenseCategory update
   */
  export type ExpenseCategoryUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * The data needed to update a ExpenseCategory.
     */
    data: XOR<ExpenseCategoryUpdateInput, ExpenseCategoryUncheckedUpdateInput>
    /**
     * Choose, which ExpenseCategory to update.
     */
    where: ExpenseCategoryWhereUniqueInput
  }

  /**
   * ExpenseCategory updateMany
   */
  export type ExpenseCategoryUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update ExpenseCategories.
     */
    data: XOR<ExpenseCategoryUpdateManyMutationInput, ExpenseCategoryUncheckedUpdateManyInput>
    /**
     * Filter which ExpenseCategories to update
     */
    where?: ExpenseCategoryWhereInput
    /**
     * Limit how many ExpenseCategories to update.
     */
    limit?: number
  }

  /**
   * ExpenseCategory updateManyAndReturn
   */
  export type ExpenseCategoryUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * The data used to update ExpenseCategories.
     */
    data: XOR<ExpenseCategoryUpdateManyMutationInput, ExpenseCategoryUncheckedUpdateManyInput>
    /**
     * Filter which ExpenseCategories to update
     */
    where?: ExpenseCategoryWhereInput
    /**
     * Limit how many ExpenseCategories to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * ExpenseCategory upsert
   */
  export type ExpenseCategoryUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * The filter to search for the ExpenseCategory to update in case it exists.
     */
    where: ExpenseCategoryWhereUniqueInput
    /**
     * In case the ExpenseCategory found by the `where` argument doesn't exist, create a new ExpenseCategory with this data.
     */
    create: XOR<ExpenseCategoryCreateInput, ExpenseCategoryUncheckedCreateInput>
    /**
     * In case the ExpenseCategory was found with the provided `where` argument, update it with this data.
     */
    update: XOR<ExpenseCategoryUpdateInput, ExpenseCategoryUncheckedUpdateInput>
  }

  /**
   * ExpenseCategory delete
   */
  export type ExpenseCategoryDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    /**
     * Filter which ExpenseCategory to delete.
     */
    where: ExpenseCategoryWhereUniqueInput
  }

  /**
   * ExpenseCategory deleteMany
   */
  export type ExpenseCategoryDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which ExpenseCategories to delete
     */
    where?: ExpenseCategoryWhereInput
    /**
     * Limit how many ExpenseCategories to delete.
     */
    limit?: number
  }

  /**
   * ExpenseCategory.branch
   */
  export type ExpenseCategory$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * ExpenseCategory.expenses
   */
  export type ExpenseCategory$expensesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    where?: ExpenseWhereInput
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    cursor?: ExpenseWhereUniqueInput
    take?: number
    skip?: number
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * ExpenseCategory without action
   */
  export type ExpenseCategoryDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
  }


  /**
   * Model Expense
   */

  export type AggregateExpense = {
    _count: ExpenseCountAggregateOutputType | null
    _avg: ExpenseAvgAggregateOutputType | null
    _sum: ExpenseSumAggregateOutputType | null
    _min: ExpenseMinAggregateOutputType | null
    _max: ExpenseMaxAggregateOutputType | null
  }

  export type ExpenseAvgAggregateOutputType = {
    amount: number | null
  }

  export type ExpenseSumAggregateOutputType = {
    amount: number | null
  }

  export type ExpenseMinAggregateOutputType = {
    id: string | null
    reference: string | null
    categoryId: string | null
    warehouseId: string | null
    branchId: string | null
    paymentMethodId: string | null
    status: string | null
    expenseDate: Date | null
    title: string | null
    notes: string | null
    amount: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type ExpenseMaxAggregateOutputType = {
    id: string | null
    reference: string | null
    categoryId: string | null
    warehouseId: string | null
    branchId: string | null
    paymentMethodId: string | null
    status: string | null
    expenseDate: Date | null
    title: string | null
    notes: string | null
    amount: number | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type ExpenseCountAggregateOutputType = {
    id: number
    reference: number
    categoryId: number
    warehouseId: number
    branchId: number
    paymentMethodId: number
    status: number
    expenseDate: number
    title: number
    notes: number
    amount: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type ExpenseAvgAggregateInputType = {
    amount?: true
  }

  export type ExpenseSumAggregateInputType = {
    amount?: true
  }

  export type ExpenseMinAggregateInputType = {
    id?: true
    reference?: true
    categoryId?: true
    warehouseId?: true
    branchId?: true
    paymentMethodId?: true
    status?: true
    expenseDate?: true
    title?: true
    notes?: true
    amount?: true
    createdAt?: true
    updatedAt?: true
  }

  export type ExpenseMaxAggregateInputType = {
    id?: true
    reference?: true
    categoryId?: true
    warehouseId?: true
    branchId?: true
    paymentMethodId?: true
    status?: true
    expenseDate?: true
    title?: true
    notes?: true
    amount?: true
    createdAt?: true
    updatedAt?: true
  }

  export type ExpenseCountAggregateInputType = {
    id?: true
    reference?: true
    categoryId?: true
    warehouseId?: true
    branchId?: true
    paymentMethodId?: true
    status?: true
    expenseDate?: true
    title?: true
    notes?: true
    amount?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type ExpenseAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Expense to aggregate.
     */
    where?: ExpenseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Expenses to fetch.
     */
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: ExpenseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Expenses 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` Expenses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Expenses
    **/
    _count?: true | ExpenseCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: ExpenseAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: ExpenseSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: ExpenseMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: ExpenseMaxAggregateInputType
  }

  export type GetExpenseAggregateType<T extends ExpenseAggregateArgs> = {
        [P in keyof T & keyof AggregateExpense]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateExpense[P]>
      : GetScalarType<T[P], AggregateExpense[P]>
  }




  export type ExpenseGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ExpenseWhereInput
    orderBy?: ExpenseOrderByWithAggregationInput | ExpenseOrderByWithAggregationInput[]
    by: ExpenseScalarFieldEnum[] | ExpenseScalarFieldEnum
    having?: ExpenseScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: ExpenseCountAggregateInputType | true
    _avg?: ExpenseAvgAggregateInputType
    _sum?: ExpenseSumAggregateInputType
    _min?: ExpenseMinAggregateInputType
    _max?: ExpenseMaxAggregateInputType
  }

  export type ExpenseGroupByOutputType = {
    id: string
    reference: string
    categoryId: string | null
    warehouseId: string | null
    branchId: string | null
    paymentMethodId: string | null
    status: string
    expenseDate: Date
    title: string | null
    notes: string | null
    amount: number
    createdAt: Date
    updatedAt: Date
    _count: ExpenseCountAggregateOutputType | null
    _avg: ExpenseAvgAggregateOutputType | null
    _sum: ExpenseSumAggregateOutputType | null
    _min: ExpenseMinAggregateOutputType | null
    _max: ExpenseMaxAggregateOutputType | null
  }

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


  export type ExpenseSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    categoryId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    expenseDate?: boolean
    title?: boolean
    notes?: boolean
    amount?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    category?: boolean | Expense$categoryArgs<ExtArgs>
    warehouse?: boolean | Expense$warehouseArgs<ExtArgs>
    branch?: boolean | Expense$branchArgs<ExtArgs>
    paymentMethod?: boolean | Expense$paymentMethodArgs<ExtArgs>
  }, ExtArgs["result"]["expense"]>

  export type ExpenseSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    categoryId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    expenseDate?: boolean
    title?: boolean
    notes?: boolean
    amount?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    category?: boolean | Expense$categoryArgs<ExtArgs>
    warehouse?: boolean | Expense$warehouseArgs<ExtArgs>
    branch?: boolean | Expense$branchArgs<ExtArgs>
    paymentMethod?: boolean | Expense$paymentMethodArgs<ExtArgs>
  }, ExtArgs["result"]["expense"]>

  export type ExpenseSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    categoryId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    expenseDate?: boolean
    title?: boolean
    notes?: boolean
    amount?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    category?: boolean | Expense$categoryArgs<ExtArgs>
    warehouse?: boolean | Expense$warehouseArgs<ExtArgs>
    branch?: boolean | Expense$branchArgs<ExtArgs>
    paymentMethod?: boolean | Expense$paymentMethodArgs<ExtArgs>
  }, ExtArgs["result"]["expense"]>

  export type ExpenseSelectScalar = {
    id?: boolean
    reference?: boolean
    categoryId?: boolean
    warehouseId?: boolean
    branchId?: boolean
    paymentMethodId?: boolean
    status?: boolean
    expenseDate?: boolean
    title?: boolean
    notes?: boolean
    amount?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type ExpenseOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "reference" | "categoryId" | "warehouseId" | "branchId" | "paymentMethodId" | "status" | "expenseDate" | "title" | "notes" | "amount" | "createdAt" | "updatedAt", ExtArgs["result"]["expense"]>
  export type ExpenseInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    category?: boolean | Expense$categoryArgs<ExtArgs>
    warehouse?: boolean | Expense$warehouseArgs<ExtArgs>
    branch?: boolean | Expense$branchArgs<ExtArgs>
    paymentMethod?: boolean | Expense$paymentMethodArgs<ExtArgs>
  }
  export type ExpenseIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    category?: boolean | Expense$categoryArgs<ExtArgs>
    warehouse?: boolean | Expense$warehouseArgs<ExtArgs>
    branch?: boolean | Expense$branchArgs<ExtArgs>
    paymentMethod?: boolean | Expense$paymentMethodArgs<ExtArgs>
  }
  export type ExpenseIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    category?: boolean | Expense$categoryArgs<ExtArgs>
    warehouse?: boolean | Expense$warehouseArgs<ExtArgs>
    branch?: boolean | Expense$branchArgs<ExtArgs>
    paymentMethod?: boolean | Expense$paymentMethodArgs<ExtArgs>
  }

  export type $ExpensePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Expense"
    objects: {
      category: Prisma.$ExpenseCategoryPayload<ExtArgs> | null
      warehouse: Prisma.$WarehousePayload<ExtArgs> | null
      branch: Prisma.$BranchPayload<ExtArgs> | null
      paymentMethod: Prisma.$PaymentMethodPayload<ExtArgs> | null
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      reference: string
      categoryId: string | null
      warehouseId: string | null
      branchId: string | null
      paymentMethodId: string | null
      status: string
      expenseDate: Date
      title: string | null
      notes: string | null
      amount: number
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["expense"]>
    composites: {}
  }

  type ExpenseGetPayload<S extends boolean | null | undefined | ExpenseDefaultArgs> = $Result.GetResult<Prisma.$ExpensePayload, S>

  type ExpenseCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<ExpenseFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: ExpenseCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Expense.
     * @param {ExpenseCreateArgs} args - Arguments to create a Expense.
     * @example
     * // Create one Expense
     * const Expense = await prisma.expense.create({
     *   data: {
     *     // ... data to create a Expense
     *   }
     * })
     * 
     */
    create<T extends ExpenseCreateArgs>(args: SelectSubset<T, ExpenseCreateArgs<ExtArgs>>): Prisma__ExpenseClient<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Expenses and returns the data saved in the database.
     * @param {ExpenseCreateManyAndReturnArgs} args - Arguments to create many Expenses.
     * @example
     * // Create many Expenses
     * const expense = await prisma.expense.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Expenses and only return the `id`
     * const expenseWithIdOnly = await prisma.expense.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends ExpenseCreateManyAndReturnArgs>(args?: SelectSubset<T, ExpenseCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Expense.
     * @param {ExpenseDeleteArgs} args - Arguments to delete one Expense.
     * @example
     * // Delete one Expense
     * const Expense = await prisma.expense.delete({
     *   where: {
     *     // ... filter to delete one Expense
     *   }
     * })
     * 
     */
    delete<T extends ExpenseDeleteArgs>(args: SelectSubset<T, ExpenseDeleteArgs<ExtArgs>>): Prisma__ExpenseClient<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Expense.
     * @param {ExpenseUpdateArgs} args - Arguments to update one Expense.
     * @example
     * // Update one Expense
     * const expense = await prisma.expense.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends ExpenseUpdateArgs>(args: SelectSubset<T, ExpenseUpdateArgs<ExtArgs>>): Prisma__ExpenseClient<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Expenses and returns the data updated in the database.
     * @param {ExpenseUpdateManyAndReturnArgs} args - Arguments to update many Expenses.
     * @example
     * // Update many Expenses
     * const expense = await prisma.expense.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Expenses and only return the `id`
     * const expenseWithIdOnly = await prisma.expense.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends ExpenseUpdateManyAndReturnArgs>(args: SelectSubset<T, ExpenseUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ExpensePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Expense.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ExpenseAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends ExpenseAggregateArgs>(args: Subset<T, ExpenseAggregateArgs>): Prisma.PrismaPromise<GetExpenseAggregateType<T>>

    /**
     * Group by Expense.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ExpenseGroupByArgs} 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 ExpenseGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: ExpenseGroupByArgs['orderBy'] }
        : { orderBy?: ExpenseGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, ExpenseGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetExpenseGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Expense model
   */
  readonly fields: ExpenseFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Expense.
   * 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__ExpenseClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    category<T extends Expense$categoryArgs<ExtArgs> = {}>(args?: Subset<T, Expense$categoryArgs<ExtArgs>>): Prisma__ExpenseCategoryClient<$Result.GetResult<Prisma.$ExpenseCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    warehouse<T extends Expense$warehouseArgs<ExtArgs> = {}>(args?: Subset<T, Expense$warehouseArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branch<T extends Expense$branchArgs<ExtArgs> = {}>(args?: Subset<T, Expense$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    paymentMethod<T extends Expense$paymentMethodArgs<ExtArgs> = {}>(args?: Subset<T, Expense$paymentMethodArgs<ExtArgs>>): Prisma__PaymentMethodClient<$Result.GetResult<Prisma.$PaymentMethodPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Expense model
   */
  interface ExpenseFieldRefs {
    readonly id: FieldRef<"Expense", 'String'>
    readonly reference: FieldRef<"Expense", 'String'>
    readonly categoryId: FieldRef<"Expense", 'String'>
    readonly warehouseId: FieldRef<"Expense", 'String'>
    readonly branchId: FieldRef<"Expense", 'String'>
    readonly paymentMethodId: FieldRef<"Expense", 'String'>
    readonly status: FieldRef<"Expense", 'String'>
    readonly expenseDate: FieldRef<"Expense", 'DateTime'>
    readonly title: FieldRef<"Expense", 'String'>
    readonly notes: FieldRef<"Expense", 'String'>
    readonly amount: FieldRef<"Expense", 'Float'>
    readonly createdAt: FieldRef<"Expense", 'DateTime'>
    readonly updatedAt: FieldRef<"Expense", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Expense findUnique
   */
  export type ExpenseFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * Filter, which Expense to fetch.
     */
    where: ExpenseWhereUniqueInput
  }

  /**
   * Expense findUniqueOrThrow
   */
  export type ExpenseFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * Filter, which Expense to fetch.
     */
    where: ExpenseWhereUniqueInput
  }

  /**
   * Expense findFirst
   */
  export type ExpenseFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * Filter, which Expense to fetch.
     */
    where?: ExpenseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Expenses to fetch.
     */
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Expenses.
     */
    cursor?: ExpenseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Expenses 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` Expenses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Expenses.
     */
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * Expense findFirstOrThrow
   */
  export type ExpenseFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * Filter, which Expense to fetch.
     */
    where?: ExpenseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Expenses to fetch.
     */
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Expenses.
     */
    cursor?: ExpenseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Expenses 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` Expenses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Expenses.
     */
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * Expense findMany
   */
  export type ExpenseFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * Filter, which Expenses to fetch.
     */
    where?: ExpenseWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Expenses to fetch.
     */
    orderBy?: ExpenseOrderByWithRelationInput | ExpenseOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Expenses.
     */
    cursor?: ExpenseWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Expenses 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` Expenses.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Expenses.
     */
    distinct?: ExpenseScalarFieldEnum | ExpenseScalarFieldEnum[]
  }

  /**
   * Expense create
   */
  export type ExpenseCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * The data needed to create a Expense.
     */
    data: XOR<ExpenseCreateInput, ExpenseUncheckedCreateInput>
  }

  /**
   * Expense createMany
   */
  export type ExpenseCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Expenses.
     */
    data: ExpenseCreateManyInput | ExpenseCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Expense createManyAndReturn
   */
  export type ExpenseCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * The data used to create many Expenses.
     */
    data: ExpenseCreateManyInput | ExpenseCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Expense update
   */
  export type ExpenseUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * The data needed to update a Expense.
     */
    data: XOR<ExpenseUpdateInput, ExpenseUncheckedUpdateInput>
    /**
     * Choose, which Expense to update.
     */
    where: ExpenseWhereUniqueInput
  }

  /**
   * Expense updateMany
   */
  export type ExpenseUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Expenses.
     */
    data: XOR<ExpenseUpdateManyMutationInput, ExpenseUncheckedUpdateManyInput>
    /**
     * Filter which Expenses to update
     */
    where?: ExpenseWhereInput
    /**
     * Limit how many Expenses to update.
     */
    limit?: number
  }

  /**
   * Expense updateManyAndReturn
   */
  export type ExpenseUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * The data used to update Expenses.
     */
    data: XOR<ExpenseUpdateManyMutationInput, ExpenseUncheckedUpdateManyInput>
    /**
     * Filter which Expenses to update
     */
    where?: ExpenseWhereInput
    /**
     * Limit how many Expenses to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Expense upsert
   */
  export type ExpenseUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * The filter to search for the Expense to update in case it exists.
     */
    where: ExpenseWhereUniqueInput
    /**
     * In case the Expense found by the `where` argument doesn't exist, create a new Expense with this data.
     */
    create: XOR<ExpenseCreateInput, ExpenseUncheckedCreateInput>
    /**
     * In case the Expense was found with the provided `where` argument, update it with this data.
     */
    update: XOR<ExpenseUpdateInput, ExpenseUncheckedUpdateInput>
  }

  /**
   * Expense delete
   */
  export type ExpenseDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
    /**
     * Filter which Expense to delete.
     */
    where: ExpenseWhereUniqueInput
  }

  /**
   * Expense deleteMany
   */
  export type ExpenseDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Expenses to delete
     */
    where?: ExpenseWhereInput
    /**
     * Limit how many Expenses to delete.
     */
    limit?: number
  }

  /**
   * Expense.category
   */
  export type Expense$categoryArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ExpenseCategory
     */
    select?: ExpenseCategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the ExpenseCategory
     */
    omit?: ExpenseCategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseCategoryInclude<ExtArgs> | null
    where?: ExpenseCategoryWhereInput
  }

  /**
   * Expense.warehouse
   */
  export type Expense$warehouseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
  }

  /**
   * Expense.branch
   */
  export type Expense$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Expense.paymentMethod
   */
  export type Expense$paymentMethodArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PaymentMethod
     */
    select?: PaymentMethodSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PaymentMethod
     */
    omit?: PaymentMethodOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PaymentMethodInclude<ExtArgs> | null
    where?: PaymentMethodWhereInput
  }

  /**
   * Expense without action
   */
  export type ExpenseDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Expense
     */
    select?: ExpenseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Expense
     */
    omit?: ExpenseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ExpenseInclude<ExtArgs> | null
  }


  /**
   * Model Product
   */

  export type AggregateProduct = {
    _count: ProductCountAggregateOutputType | null
    _avg: ProductAvgAggregateOutputType | null
    _sum: ProductSumAggregateOutputType | null
    _min: ProductMinAggregateOutputType | null
    _max: ProductMaxAggregateOutputType | null
  }

  export type ProductAvgAggregateOutputType = {
    quantity: number | null
    sellingPrice: number | null
    costPrice: number | null
    sortOrder: number | null
  }

  export type ProductSumAggregateOutputType = {
    quantity: number | null
    sellingPrice: number | null
    costPrice: number | null
    sortOrder: number | null
  }

  export type ProductMinAggregateOutputType = {
    id: string | null
    name: string | null
    sku: string | null
    barcode: string | null
    description: string | null
    isReturnable: boolean | null
    branchId: string | null
    categoryId: string | null
    unitId: string | null
    brandId: string | null
    expiryDate: Date | null
    productType: string | null
    quantity: number | null
    sellingPrice: number | null
    salesTaxId: string | null
    costPrice: number | null
    purchaseTaxId: string | null
    warehouseId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type ProductMaxAggregateOutputType = {
    id: string | null
    name: string | null
    sku: string | null
    barcode: string | null
    description: string | null
    isReturnable: boolean | null
    branchId: string | null
    categoryId: string | null
    unitId: string | null
    brandId: string | null
    expiryDate: Date | null
    productType: string | null
    quantity: number | null
    sellingPrice: number | null
    salesTaxId: string | null
    costPrice: number | null
    purchaseTaxId: string | null
    warehouseId: string | null
    sortOrder: number | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type ProductCountAggregateOutputType = {
    id: number
    name: number
    sku: number
    barcode: number
    description: number
    isReturnable: number
    branchId: number
    categoryId: number
    unitId: number
    brandId: number
    expiryDate: number
    productType: number
    variationIds: number
    quantity: number
    images: number
    sellingPrice: number
    salesTaxId: number
    costPrice: number
    purchaseTaxId: number
    warehouseId: number
    sortOrder: number
    isActive: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type ProductAvgAggregateInputType = {
    quantity?: true
    sellingPrice?: true
    costPrice?: true
    sortOrder?: true
  }

  export type ProductSumAggregateInputType = {
    quantity?: true
    sellingPrice?: true
    costPrice?: true
    sortOrder?: true
  }

  export type ProductMinAggregateInputType = {
    id?: true
    name?: true
    sku?: true
    barcode?: true
    description?: true
    isReturnable?: true
    branchId?: true
    categoryId?: true
    unitId?: true
    brandId?: true
    expiryDate?: true
    productType?: true
    quantity?: true
    sellingPrice?: true
    salesTaxId?: true
    costPrice?: true
    purchaseTaxId?: true
    warehouseId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type ProductMaxAggregateInputType = {
    id?: true
    name?: true
    sku?: true
    barcode?: true
    description?: true
    isReturnable?: true
    branchId?: true
    categoryId?: true
    unitId?: true
    brandId?: true
    expiryDate?: true
    productType?: true
    quantity?: true
    sellingPrice?: true
    salesTaxId?: true
    costPrice?: true
    purchaseTaxId?: true
    warehouseId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type ProductCountAggregateInputType = {
    id?: true
    name?: true
    sku?: true
    barcode?: true
    description?: true
    isReturnable?: true
    branchId?: true
    categoryId?: true
    unitId?: true
    brandId?: true
    expiryDate?: true
    productType?: true
    variationIds?: true
    quantity?: true
    images?: true
    sellingPrice?: true
    salesTaxId?: true
    costPrice?: true
    purchaseTaxId?: true
    warehouseId?: true
    sortOrder?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

  export type ProductAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Product to aggregate.
     */
    where?: ProductWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Products to fetch.
     */
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: ProductWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Products 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` Products.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Products
    **/
    _count?: true | ProductCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: ProductAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: ProductSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: ProductMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: ProductMaxAggregateInputType
  }

  export type GetProductAggregateType<T extends ProductAggregateArgs> = {
        [P in keyof T & keyof AggregateProduct]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateProduct[P]>
      : GetScalarType<T[P], AggregateProduct[P]>
  }




  export type ProductGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ProductWhereInput
    orderBy?: ProductOrderByWithAggregationInput | ProductOrderByWithAggregationInput[]
    by: ProductScalarFieldEnum[] | ProductScalarFieldEnum
    having?: ProductScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: ProductCountAggregateInputType | true
    _avg?: ProductAvgAggregateInputType
    _sum?: ProductSumAggregateInputType
    _min?: ProductMinAggregateInputType
    _max?: ProductMaxAggregateInputType
  }

  export type ProductGroupByOutputType = {
    id: string
    name: string
    sku: string
    barcode: string | null
    description: string | null
    isReturnable: boolean
    branchId: string | null
    categoryId: string | null
    unitId: string | null
    brandId: string | null
    expiryDate: Date | null
    productType: string | null
    variationIds: JsonValue | null
    quantity: number
    images: JsonValue | null
    sellingPrice: number | null
    salesTaxId: string | null
    costPrice: number | null
    purchaseTaxId: string | null
    warehouseId: string | null
    sortOrder: number
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: ProductCountAggregateOutputType | null
    _avg: ProductAvgAggregateOutputType | null
    _sum: ProductSumAggregateOutputType | null
    _min: ProductMinAggregateOutputType | null
    _max: ProductMaxAggregateOutputType | null
  }

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


  export type ProductSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    sku?: boolean
    barcode?: boolean
    description?: boolean
    isReturnable?: boolean
    branchId?: boolean
    categoryId?: boolean
    unitId?: boolean
    brandId?: boolean
    expiryDate?: boolean
    productType?: boolean
    variationIds?: boolean
    quantity?: boolean
    images?: boolean
    sellingPrice?: boolean
    salesTaxId?: boolean
    costPrice?: boolean
    purchaseTaxId?: boolean
    warehouseId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Product$branchArgs<ExtArgs>
    category?: boolean | Product$categoryArgs<ExtArgs>
    unit?: boolean | Product$unitArgs<ExtArgs>
    brand?: boolean | Product$brandArgs<ExtArgs>
    salesTax?: boolean | Product$salesTaxArgs<ExtArgs>
    purchaseTax?: boolean | Product$purchaseTaxArgs<ExtArgs>
    warehouse?: boolean | Product$warehouseArgs<ExtArgs>
    adjustmentLines?: boolean | Product$adjustmentLinesArgs<ExtArgs>
    invoiceLines?: boolean | Product$invoiceLinesArgs<ExtArgs>
    purchaseLines?: boolean | Product$purchaseLinesArgs<ExtArgs>
    purchaseReturnLines?: boolean | Product$purchaseReturnLinesArgs<ExtArgs>
    saleLines?: boolean | Product$saleLinesArgs<ExtArgs>
    salesReturnLines?: boolean | Product$salesReturnLinesArgs<ExtArgs>
    transferLines?: boolean | Product$transferLinesArgs<ExtArgs>
    warehouseStocks?: boolean | Product$warehouseStocksArgs<ExtArgs>
    _count?: boolean | ProductCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["product"]>

  export type ProductSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    sku?: boolean
    barcode?: boolean
    description?: boolean
    isReturnable?: boolean
    branchId?: boolean
    categoryId?: boolean
    unitId?: boolean
    brandId?: boolean
    expiryDate?: boolean
    productType?: boolean
    variationIds?: boolean
    quantity?: boolean
    images?: boolean
    sellingPrice?: boolean
    salesTaxId?: boolean
    costPrice?: boolean
    purchaseTaxId?: boolean
    warehouseId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Product$branchArgs<ExtArgs>
    category?: boolean | Product$categoryArgs<ExtArgs>
    unit?: boolean | Product$unitArgs<ExtArgs>
    brand?: boolean | Product$brandArgs<ExtArgs>
    salesTax?: boolean | Product$salesTaxArgs<ExtArgs>
    purchaseTax?: boolean | Product$purchaseTaxArgs<ExtArgs>
    warehouse?: boolean | Product$warehouseArgs<ExtArgs>
  }, ExtArgs["result"]["product"]>

  export type ProductSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    sku?: boolean
    barcode?: boolean
    description?: boolean
    isReturnable?: boolean
    branchId?: boolean
    categoryId?: boolean
    unitId?: boolean
    brandId?: boolean
    expiryDate?: boolean
    productType?: boolean
    variationIds?: boolean
    quantity?: boolean
    images?: boolean
    sellingPrice?: boolean
    salesTaxId?: boolean
    costPrice?: boolean
    purchaseTaxId?: boolean
    warehouseId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    branch?: boolean | Product$branchArgs<ExtArgs>
    category?: boolean | Product$categoryArgs<ExtArgs>
    unit?: boolean | Product$unitArgs<ExtArgs>
    brand?: boolean | Product$brandArgs<ExtArgs>
    salesTax?: boolean | Product$salesTaxArgs<ExtArgs>
    purchaseTax?: boolean | Product$purchaseTaxArgs<ExtArgs>
    warehouse?: boolean | Product$warehouseArgs<ExtArgs>
  }, ExtArgs["result"]["product"]>

  export type ProductSelectScalar = {
    id?: boolean
    name?: boolean
    sku?: boolean
    barcode?: boolean
    description?: boolean
    isReturnable?: boolean
    branchId?: boolean
    categoryId?: boolean
    unitId?: boolean
    brandId?: boolean
    expiryDate?: boolean
    productType?: boolean
    variationIds?: boolean
    quantity?: boolean
    images?: boolean
    sellingPrice?: boolean
    salesTaxId?: boolean
    costPrice?: boolean
    purchaseTaxId?: boolean
    warehouseId?: boolean
    sortOrder?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type ProductOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "sku" | "barcode" | "description" | "isReturnable" | "branchId" | "categoryId" | "unitId" | "brandId" | "expiryDate" | "productType" | "variationIds" | "quantity" | "images" | "sellingPrice" | "salesTaxId" | "costPrice" | "purchaseTaxId" | "warehouseId" | "sortOrder" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["product"]>
  export type ProductInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Product$branchArgs<ExtArgs>
    category?: boolean | Product$categoryArgs<ExtArgs>
    unit?: boolean | Product$unitArgs<ExtArgs>
    brand?: boolean | Product$brandArgs<ExtArgs>
    salesTax?: boolean | Product$salesTaxArgs<ExtArgs>
    purchaseTax?: boolean | Product$purchaseTaxArgs<ExtArgs>
    warehouse?: boolean | Product$warehouseArgs<ExtArgs>
    adjustmentLines?: boolean | Product$adjustmentLinesArgs<ExtArgs>
    invoiceLines?: boolean | Product$invoiceLinesArgs<ExtArgs>
    purchaseLines?: boolean | Product$purchaseLinesArgs<ExtArgs>
    purchaseReturnLines?: boolean | Product$purchaseReturnLinesArgs<ExtArgs>
    saleLines?: boolean | Product$saleLinesArgs<ExtArgs>
    salesReturnLines?: boolean | Product$salesReturnLinesArgs<ExtArgs>
    transferLines?: boolean | Product$transferLinesArgs<ExtArgs>
    warehouseStocks?: boolean | Product$warehouseStocksArgs<ExtArgs>
    _count?: boolean | ProductCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type ProductIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Product$branchArgs<ExtArgs>
    category?: boolean | Product$categoryArgs<ExtArgs>
    unit?: boolean | Product$unitArgs<ExtArgs>
    brand?: boolean | Product$brandArgs<ExtArgs>
    salesTax?: boolean | Product$salesTaxArgs<ExtArgs>
    purchaseTax?: boolean | Product$purchaseTaxArgs<ExtArgs>
    warehouse?: boolean | Product$warehouseArgs<ExtArgs>
  }
  export type ProductIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    branch?: boolean | Product$branchArgs<ExtArgs>
    category?: boolean | Product$categoryArgs<ExtArgs>
    unit?: boolean | Product$unitArgs<ExtArgs>
    brand?: boolean | Product$brandArgs<ExtArgs>
    salesTax?: boolean | Product$salesTaxArgs<ExtArgs>
    purchaseTax?: boolean | Product$purchaseTaxArgs<ExtArgs>
    warehouse?: boolean | Product$warehouseArgs<ExtArgs>
  }

  export type $ProductPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Product"
    objects: {
      branch: Prisma.$BranchPayload<ExtArgs> | null
      category: Prisma.$CategoryPayload<ExtArgs> | null
      unit: Prisma.$UnitPayload<ExtArgs> | null
      brand: Prisma.$BrandPayload<ExtArgs> | null
      salesTax: Prisma.$TaxPayload<ExtArgs> | null
      purchaseTax: Prisma.$TaxPayload<ExtArgs> | null
      warehouse: Prisma.$WarehousePayload<ExtArgs> | null
      adjustmentLines: Prisma.$InventoryAdjustmentLinePayload<ExtArgs>[]
      invoiceLines: Prisma.$InvoiceLinePayload<ExtArgs>[]
      purchaseLines: Prisma.$PurchaseLinePayload<ExtArgs>[]
      purchaseReturnLines: Prisma.$PurchaseReturnLinePayload<ExtArgs>[]
      saleLines: Prisma.$SaleLinePayload<ExtArgs>[]
      salesReturnLines: Prisma.$SalesReturnLinePayload<ExtArgs>[]
      transferLines: Prisma.$InventoryTransferLinePayload<ExtArgs>[]
      warehouseStocks: Prisma.$WarehouseStockPayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      sku: string
      barcode: string | null
      description: string | null
      isReturnable: boolean
      branchId: string | null
      categoryId: string | null
      unitId: string | null
      brandId: string | null
      /**
       * Used for tracking expiry-based inventory (optional).
       */
      expiryDate: Date | null
      /**
       * e.g. Standard, Variant, Service (optional).
       */
      productType: string | null
      /**
       * When productType is \"Variation\", selected variation IDs (JSON array of strings).
       */
      variationIds: Prisma.JsonValue | null
      /**
       * Default product quantity (can be used as starting stock).
       */
      quantity: number
      /**
       * Cloudinary image URLs (JSON array of strings).
       */
      images: Prisma.JsonValue | null
      sellingPrice: number | null
      salesTaxId: string | null
      costPrice: number | null
      purchaseTaxId: string | null
      warehouseId: string | null
      sortOrder: number
      isActive: boolean
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["product"]>
    composites: {}
  }

  type ProductGetPayload<S extends boolean | null | undefined | ProductDefaultArgs> = $Result.GetResult<Prisma.$ProductPayload, S>

  type ProductCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<ProductFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: ProductCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Product.
     * @param {ProductCreateArgs} args - Arguments to create a Product.
     * @example
     * // Create one Product
     * const Product = await prisma.product.create({
     *   data: {
     *     // ... data to create a Product
     *   }
     * })
     * 
     */
    create<T extends ProductCreateArgs>(args: SelectSubset<T, ProductCreateArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Products and returns the data saved in the database.
     * @param {ProductCreateManyAndReturnArgs} args - Arguments to create many Products.
     * @example
     * // Create many Products
     * const product = await prisma.product.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Products and only return the `id`
     * const productWithIdOnly = await prisma.product.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends ProductCreateManyAndReturnArgs>(args?: SelectSubset<T, ProductCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Product.
     * @param {ProductDeleteArgs} args - Arguments to delete one Product.
     * @example
     * // Delete one Product
     * const Product = await prisma.product.delete({
     *   where: {
     *     // ... filter to delete one Product
     *   }
     * })
     * 
     */
    delete<T extends ProductDeleteArgs>(args: SelectSubset<T, ProductDeleteArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Product.
     * @param {ProductUpdateArgs} args - Arguments to update one Product.
     * @example
     * // Update one Product
     * const product = await prisma.product.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends ProductUpdateArgs>(args: SelectSubset<T, ProductUpdateArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Products and returns the data updated in the database.
     * @param {ProductUpdateManyAndReturnArgs} args - Arguments to update many Products.
     * @example
     * // Update many Products
     * const product = await prisma.product.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Products and only return the `id`
     * const productWithIdOnly = await prisma.product.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends ProductUpdateManyAndReturnArgs>(args: SelectSubset<T, ProductUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Product.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ProductAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends ProductAggregateArgs>(args: Subset<T, ProductAggregateArgs>): Prisma.PrismaPromise<GetProductAggregateType<T>>

    /**
     * Group by Product.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ProductGroupByArgs} 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 ProductGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: ProductGroupByArgs['orderBy'] }
        : { orderBy?: ProductGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, ProductGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetProductGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Product model
   */
  readonly fields: ProductFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Product.
   * 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__ProductClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    branch<T extends Product$branchArgs<ExtArgs> = {}>(args?: Subset<T, Product$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    category<T extends Product$categoryArgs<ExtArgs> = {}>(args?: Subset<T, Product$categoryArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    unit<T extends Product$unitArgs<ExtArgs> = {}>(args?: Subset<T, Product$unitArgs<ExtArgs>>): Prisma__UnitClient<$Result.GetResult<Prisma.$UnitPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    brand<T extends Product$brandArgs<ExtArgs> = {}>(args?: Subset<T, Product$brandArgs<ExtArgs>>): Prisma__BrandClient<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    salesTax<T extends Product$salesTaxArgs<ExtArgs> = {}>(args?: Subset<T, Product$salesTaxArgs<ExtArgs>>): Prisma__TaxClient<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    purchaseTax<T extends Product$purchaseTaxArgs<ExtArgs> = {}>(args?: Subset<T, Product$purchaseTaxArgs<ExtArgs>>): Prisma__TaxClient<$Result.GetResult<Prisma.$TaxPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    warehouse<T extends Product$warehouseArgs<ExtArgs> = {}>(args?: Subset<T, Product$warehouseArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    adjustmentLines<T extends Product$adjustmentLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$adjustmentLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    invoiceLines<T extends Product$invoiceLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$invoiceLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchaseLines<T extends Product$purchaseLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$purchaseLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    purchaseReturnLines<T extends Product$purchaseReturnLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$purchaseReturnLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PurchaseReturnLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    saleLines<T extends Product$saleLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$saleLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SaleLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    salesReturnLines<T extends Product$salesReturnLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$salesReturnLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SalesReturnLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    transferLines<T extends Product$transferLinesArgs<ExtArgs> = {}>(args?: Subset<T, Product$transferLinesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    warehouseStocks<T extends Product$warehouseStocksArgs<ExtArgs> = {}>(args?: Subset<T, Product$warehouseStocksArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WarehouseStockPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Product model
   */
  interface ProductFieldRefs {
    readonly id: FieldRef<"Product", 'String'>
    readonly name: FieldRef<"Product", 'String'>
    readonly sku: FieldRef<"Product", 'String'>
    readonly barcode: FieldRef<"Product", 'String'>
    readonly description: FieldRef<"Product", 'String'>
    readonly isReturnable: FieldRef<"Product", 'Boolean'>
    readonly branchId: FieldRef<"Product", 'String'>
    readonly categoryId: FieldRef<"Product", 'String'>
    readonly unitId: FieldRef<"Product", 'String'>
    readonly brandId: FieldRef<"Product", 'String'>
    readonly expiryDate: FieldRef<"Product", 'DateTime'>
    readonly productType: FieldRef<"Product", 'String'>
    readonly variationIds: FieldRef<"Product", 'Json'>
    readonly quantity: FieldRef<"Product", 'Int'>
    readonly images: FieldRef<"Product", 'Json'>
    readonly sellingPrice: FieldRef<"Product", 'Float'>
    readonly salesTaxId: FieldRef<"Product", 'String'>
    readonly costPrice: FieldRef<"Product", 'Float'>
    readonly purchaseTaxId: FieldRef<"Product", 'String'>
    readonly warehouseId: FieldRef<"Product", 'String'>
    readonly sortOrder: FieldRef<"Product", 'Int'>
    readonly isActive: FieldRef<"Product", 'Boolean'>
    readonly createdAt: FieldRef<"Product", 'DateTime'>
    readonly updatedAt: FieldRef<"Product", 'DateTime'>
    readonly deletedAt: FieldRef<"Product", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Product findUnique
   */
  export type ProductFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * Filter, which Product to fetch.
     */
    where: ProductWhereUniqueInput
  }

  /**
   * Product findUniqueOrThrow
   */
  export type ProductFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * Filter, which Product to fetch.
     */
    where: ProductWhereUniqueInput
  }

  /**
   * Product findFirst
   */
  export type ProductFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * Filter, which Product to fetch.
     */
    where?: ProductWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Products to fetch.
     */
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Products.
     */
    cursor?: ProductWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Products 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` Products.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Products.
     */
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Product findFirstOrThrow
   */
  export type ProductFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * Filter, which Product to fetch.
     */
    where?: ProductWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Products to fetch.
     */
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Products.
     */
    cursor?: ProductWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Products 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` Products.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Products.
     */
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Product findMany
   */
  export type ProductFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * Filter, which Products to fetch.
     */
    where?: ProductWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Products to fetch.
     */
    orderBy?: ProductOrderByWithRelationInput | ProductOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Products.
     */
    cursor?: ProductWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Products 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` Products.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Products.
     */
    distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[]
  }

  /**
   * Product create
   */
  export type ProductCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * The data needed to create a Product.
     */
    data: XOR<ProductCreateInput, ProductUncheckedCreateInput>
  }

  /**
   * Product createMany
   */
  export type ProductCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Products.
     */
    data: ProductCreateManyInput | ProductCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Product createManyAndReturn
   */
  export type ProductCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * The data used to create many Products.
     */
    data: ProductCreateManyInput | ProductCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Product update
   */
  export type ProductUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * The data needed to update a Product.
     */
    data: XOR<ProductUpdateInput, ProductUncheckedUpdateInput>
    /**
     * Choose, which Product to update.
     */
    where: ProductWhereUniqueInput
  }

  /**
   * Product updateMany
   */
  export type ProductUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Products.
     */
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyInput>
    /**
     * Filter which Products to update
     */
    where?: ProductWhereInput
    /**
     * Limit how many Products to update.
     */
    limit?: number
  }

  /**
   * Product updateManyAndReturn
   */
  export type ProductUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * The data used to update Products.
     */
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyInput>
    /**
     * Filter which Products to update
     */
    where?: ProductWhereInput
    /**
     * Limit how many Products to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Product upsert
   */
  export type ProductUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * The filter to search for the Product to update in case it exists.
     */
    where: ProductWhereUniqueInput
    /**
     * In case the Product found by the `where` argument doesn't exist, create a new Product with this data.
     */
    create: XOR<ProductCreateInput, ProductUncheckedCreateInput>
    /**
     * In case the Product was found with the provided `where` argument, update it with this data.
     */
    update: XOR<ProductUpdateInput, ProductUncheckedUpdateInput>
  }

  /**
   * Product delete
   */
  export type ProductDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
    /**
     * Filter which Product to delete.
     */
    where: ProductWhereUniqueInput
  }

  /**
   * Product deleteMany
   */
  export type ProductDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Products to delete
     */
    where?: ProductWhereInput
    /**
     * Limit how many Products to delete.
     */
    limit?: number
  }

  /**
   * Product.branch
   */
  export type Product$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Product.category
   */
  export type Product$categoryArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Category
     */
    select?: CategorySelect<ExtArgs> | null
    /**
     * Omit specific fields from the Category
     */
    omit?: CategoryOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CategoryInclude<ExtArgs> | null
    where?: CategoryWhereInput
  }

  /**
   * Product.unit
   */
  export type Product$unitArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Unit
     */
    select?: UnitSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Unit
     */
    omit?: UnitOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UnitInclude<ExtArgs> | null
    where?: UnitWhereInput
  }

  /**
   * Product.brand
   */
  export type Product$brandArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Brand
     */
    select?: BrandSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Brand
     */
    omit?: BrandOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BrandInclude<ExtArgs> | null
    where?: BrandWhereInput
  }

  /**
   * Product.salesTax
   */
  export type Product$salesTaxArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    where?: TaxWhereInput
  }

  /**
   * Product.purchaseTax
   */
  export type Product$purchaseTaxArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Tax
     */
    select?: TaxSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Tax
     */
    omit?: TaxOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: TaxInclude<ExtArgs> | null
    where?: TaxWhereInput
  }

  /**
   * Product.warehouse
   */
  export type Product$warehouseArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Warehouse
     */
    select?: WarehouseSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Warehouse
     */
    omit?: WarehouseOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseInclude<ExtArgs> | null
    where?: WarehouseWhereInput
  }

  /**
   * Product.adjustmentLines
   */
  export type Product$adjustmentLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    where?: InventoryAdjustmentLineWhereInput
    orderBy?: InventoryAdjustmentLineOrderByWithRelationInput | InventoryAdjustmentLineOrderByWithRelationInput[]
    cursor?: InventoryAdjustmentLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryAdjustmentLineScalarFieldEnum | InventoryAdjustmentLineScalarFieldEnum[]
  }

  /**
   * Product.invoiceLines
   */
  export type Product$invoiceLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    where?: InvoiceLineWhereInput
    orderBy?: InvoiceLineOrderByWithRelationInput | InvoiceLineOrderByWithRelationInput[]
    cursor?: InvoiceLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InvoiceLineScalarFieldEnum | InvoiceLineScalarFieldEnum[]
  }

  /**
   * Product.purchaseLines
   */
  export type Product$purchaseLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseLine
     */
    select?: PurchaseLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseLine
     */
    omit?: PurchaseLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseLineInclude<ExtArgs> | null
    where?: PurchaseLineWhereInput
    orderBy?: PurchaseLineOrderByWithRelationInput | PurchaseLineOrderByWithRelationInput[]
    cursor?: PurchaseLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseLineScalarFieldEnum | PurchaseLineScalarFieldEnum[]
  }

  /**
   * Product.purchaseReturnLines
   */
  export type Product$purchaseReturnLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the PurchaseReturnLine
     */
    select?: PurchaseReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the PurchaseReturnLine
     */
    omit?: PurchaseReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: PurchaseReturnLineInclude<ExtArgs> | null
    where?: PurchaseReturnLineWhereInput
    orderBy?: PurchaseReturnLineOrderByWithRelationInput | PurchaseReturnLineOrderByWithRelationInput[]
    cursor?: PurchaseReturnLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: PurchaseReturnLineScalarFieldEnum | PurchaseReturnLineScalarFieldEnum[]
  }

  /**
   * Product.saleLines
   */
  export type Product$saleLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SaleLine
     */
    select?: SaleLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SaleLine
     */
    omit?: SaleLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleLineInclude<ExtArgs> | null
    where?: SaleLineWhereInput
    orderBy?: SaleLineOrderByWithRelationInput | SaleLineOrderByWithRelationInput[]
    cursor?: SaleLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SaleLineScalarFieldEnum | SaleLineScalarFieldEnum[]
  }

  /**
   * Product.salesReturnLines
   */
  export type Product$salesReturnLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SalesReturnLine
     */
    select?: SalesReturnLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SalesReturnLine
     */
    omit?: SalesReturnLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SalesReturnLineInclude<ExtArgs> | null
    where?: SalesReturnLineWhereInput
    orderBy?: SalesReturnLineOrderByWithRelationInput | SalesReturnLineOrderByWithRelationInput[]
    cursor?: SalesReturnLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: SalesReturnLineScalarFieldEnum | SalesReturnLineScalarFieldEnum[]
  }

  /**
   * Product.transferLines
   */
  export type Product$transferLinesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    where?: InventoryTransferLineWhereInput
    orderBy?: InventoryTransferLineOrderByWithRelationInput | InventoryTransferLineOrderByWithRelationInput[]
    cursor?: InventoryTransferLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryTransferLineScalarFieldEnum | InventoryTransferLineScalarFieldEnum[]
  }

  /**
   * Product.warehouseStocks
   */
  export type Product$warehouseStocksArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the WarehouseStock
     */
    select?: WarehouseStockSelect<ExtArgs> | null
    /**
     * Omit specific fields from the WarehouseStock
     */
    omit?: WarehouseStockOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: WarehouseStockInclude<ExtArgs> | null
    where?: WarehouseStockWhereInput
    orderBy?: WarehouseStockOrderByWithRelationInput | WarehouseStockOrderByWithRelationInput[]
    cursor?: WarehouseStockWhereUniqueInput
    take?: number
    skip?: number
    distinct?: WarehouseStockScalarFieldEnum | WarehouseStockScalarFieldEnum[]
  }

  /**
   * Product without action
   */
  export type ProductDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Product
     */
    select?: ProductSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Product
     */
    omit?: ProductOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ProductInclude<ExtArgs> | null
  }


  /**
   * Model InventoryTransfer
   */

  export type AggregateInventoryTransfer = {
    _count: InventoryTransferCountAggregateOutputType | null
    _min: InventoryTransferMinAggregateOutputType | null
    _max: InventoryTransferMaxAggregateOutputType | null
  }

  export type InventoryTransferMinAggregateOutputType = {
    id: string | null
    reference: string | null
    fromWarehouseId: string | null
    toWarehouseId: string | null
    branchId: string | null
    status: string | null
    transferDate: Date | null
    notes: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type InventoryTransferMaxAggregateOutputType = {
    id: string | null
    reference: string | null
    fromWarehouseId: string | null
    toWarehouseId: string | null
    branchId: string | null
    status: string | null
    transferDate: Date | null
    notes: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type InventoryTransferCountAggregateOutputType = {
    id: number
    reference: number
    fromWarehouseId: number
    toWarehouseId: number
    branchId: number
    status: number
    transferDate: number
    notes: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type InventoryTransferMinAggregateInputType = {
    id?: true
    reference?: true
    fromWarehouseId?: true
    toWarehouseId?: true
    branchId?: true
    status?: true
    transferDate?: true
    notes?: true
    createdAt?: true
    updatedAt?: true
  }

  export type InventoryTransferMaxAggregateInputType = {
    id?: true
    reference?: true
    fromWarehouseId?: true
    toWarehouseId?: true
    branchId?: true
    status?: true
    transferDate?: true
    notes?: true
    createdAt?: true
    updatedAt?: true
  }

  export type InventoryTransferCountAggregateInputType = {
    id?: true
    reference?: true
    fromWarehouseId?: true
    toWarehouseId?: true
    branchId?: true
    status?: true
    transferDate?: true
    notes?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type InventoryTransferAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryTransfer to aggregate.
     */
    where?: InventoryTransferWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransfers to fetch.
     */
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: InventoryTransferWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransfers 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` InventoryTransfers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned InventoryTransfers
    **/
    _count?: true | InventoryTransferCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: InventoryTransferMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: InventoryTransferMaxAggregateInputType
  }

  export type GetInventoryTransferAggregateType<T extends InventoryTransferAggregateArgs> = {
        [P in keyof T & keyof AggregateInventoryTransfer]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateInventoryTransfer[P]>
      : GetScalarType<T[P], AggregateInventoryTransfer[P]>
  }




  export type InventoryTransferGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferWhereInput
    orderBy?: InventoryTransferOrderByWithAggregationInput | InventoryTransferOrderByWithAggregationInput[]
    by: InventoryTransferScalarFieldEnum[] | InventoryTransferScalarFieldEnum
    having?: InventoryTransferScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: InventoryTransferCountAggregateInputType | true
    _min?: InventoryTransferMinAggregateInputType
    _max?: InventoryTransferMaxAggregateInputType
  }

  export type InventoryTransferGroupByOutputType = {
    id: string
    reference: string
    fromWarehouseId: string
    toWarehouseId: string
    branchId: string | null
    status: string
    transferDate: Date
    notes: string | null
    createdAt: Date
    updatedAt: Date
    _count: InventoryTransferCountAggregateOutputType | null
    _min: InventoryTransferMinAggregateOutputType | null
    _max: InventoryTransferMaxAggregateOutputType | null
  }

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


  export type InventoryTransferSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    fromWarehouseId?: boolean
    toWarehouseId?: boolean
    branchId?: boolean
    status?: boolean
    transferDate?: boolean
    notes?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    fromWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    toWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryTransfer$branchArgs<ExtArgs>
    lines?: boolean | InventoryTransfer$linesArgs<ExtArgs>
    _count?: boolean | InventoryTransferCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryTransfer"]>

  export type InventoryTransferSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    fromWarehouseId?: boolean
    toWarehouseId?: boolean
    branchId?: boolean
    status?: boolean
    transferDate?: boolean
    notes?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    fromWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    toWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryTransfer$branchArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryTransfer"]>

  export type InventoryTransferSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    fromWarehouseId?: boolean
    toWarehouseId?: boolean
    branchId?: boolean
    status?: boolean
    transferDate?: boolean
    notes?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    fromWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    toWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryTransfer$branchArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryTransfer"]>

  export type InventoryTransferSelectScalar = {
    id?: boolean
    reference?: boolean
    fromWarehouseId?: boolean
    toWarehouseId?: boolean
    branchId?: boolean
    status?: boolean
    transferDate?: boolean
    notes?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type InventoryTransferOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "reference" | "fromWarehouseId" | "toWarehouseId" | "branchId" | "status" | "transferDate" | "notes" | "createdAt" | "updatedAt", ExtArgs["result"]["inventoryTransfer"]>
  export type InventoryTransferInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    fromWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    toWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryTransfer$branchArgs<ExtArgs>
    lines?: boolean | InventoryTransfer$linesArgs<ExtArgs>
    _count?: boolean | InventoryTransferCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type InventoryTransferIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    fromWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    toWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryTransfer$branchArgs<ExtArgs>
  }
  export type InventoryTransferIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    fromWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    toWarehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryTransfer$branchArgs<ExtArgs>
  }

  export type $InventoryTransferPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "InventoryTransfer"
    objects: {
      fromWarehouse: Prisma.$WarehousePayload<ExtArgs>
      toWarehouse: Prisma.$WarehousePayload<ExtArgs>
      branch: Prisma.$BranchPayload<ExtArgs> | null
      lines: Prisma.$InventoryTransferLinePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      reference: string
      fromWarehouseId: string
      toWarehouseId: string
      branchId: string | null
      status: string
      transferDate: Date
      notes: string | null
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["inventoryTransfer"]>
    composites: {}
  }

  type InventoryTransferGetPayload<S extends boolean | null | undefined | InventoryTransferDefaultArgs> = $Result.GetResult<Prisma.$InventoryTransferPayload, S>

  type InventoryTransferCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<InventoryTransferFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: InventoryTransferCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a InventoryTransfer.
     * @param {InventoryTransferCreateArgs} args - Arguments to create a InventoryTransfer.
     * @example
     * // Create one InventoryTransfer
     * const InventoryTransfer = await prisma.inventoryTransfer.create({
     *   data: {
     *     // ... data to create a InventoryTransfer
     *   }
     * })
     * 
     */
    create<T extends InventoryTransferCreateArgs>(args: SelectSubset<T, InventoryTransferCreateArgs<ExtArgs>>): Prisma__InventoryTransferClient<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many InventoryTransfers and returns the data saved in the database.
     * @param {InventoryTransferCreateManyAndReturnArgs} args - Arguments to create many InventoryTransfers.
     * @example
     * // Create many InventoryTransfers
     * const inventoryTransfer = await prisma.inventoryTransfer.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many InventoryTransfers and only return the `id`
     * const inventoryTransferWithIdOnly = await prisma.inventoryTransfer.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends InventoryTransferCreateManyAndReturnArgs>(args?: SelectSubset<T, InventoryTransferCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a InventoryTransfer.
     * @param {InventoryTransferDeleteArgs} args - Arguments to delete one InventoryTransfer.
     * @example
     * // Delete one InventoryTransfer
     * const InventoryTransfer = await prisma.inventoryTransfer.delete({
     *   where: {
     *     // ... filter to delete one InventoryTransfer
     *   }
     * })
     * 
     */
    delete<T extends InventoryTransferDeleteArgs>(args: SelectSubset<T, InventoryTransferDeleteArgs<ExtArgs>>): Prisma__InventoryTransferClient<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one InventoryTransfer.
     * @param {InventoryTransferUpdateArgs} args - Arguments to update one InventoryTransfer.
     * @example
     * // Update one InventoryTransfer
     * const inventoryTransfer = await prisma.inventoryTransfer.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends InventoryTransferUpdateArgs>(args: SelectSubset<T, InventoryTransferUpdateArgs<ExtArgs>>): Prisma__InventoryTransferClient<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more InventoryTransfers and returns the data updated in the database.
     * @param {InventoryTransferUpdateManyAndReturnArgs} args - Arguments to update many InventoryTransfers.
     * @example
     * // Update many InventoryTransfers
     * const inventoryTransfer = await prisma.inventoryTransfer.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more InventoryTransfers and only return the `id`
     * const inventoryTransferWithIdOnly = await prisma.inventoryTransfer.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends InventoryTransferUpdateManyAndReturnArgs>(args: SelectSubset<T, InventoryTransferUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a InventoryTransfer.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryTransferAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends InventoryTransferAggregateArgs>(args: Subset<T, InventoryTransferAggregateArgs>): Prisma.PrismaPromise<GetInventoryTransferAggregateType<T>>

    /**
     * Group by InventoryTransfer.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryTransferGroupByArgs} 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 InventoryTransferGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: InventoryTransferGroupByArgs['orderBy'] }
        : { orderBy?: InventoryTransferGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, InventoryTransferGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetInventoryTransferGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the InventoryTransfer model
   */
  readonly fields: InventoryTransferFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for InventoryTransfer.
   * 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__InventoryTransferClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    fromWarehouse<T extends WarehouseDefaultArgs<ExtArgs> = {}>(args?: Subset<T, WarehouseDefaultArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    toWarehouse<T extends WarehouseDefaultArgs<ExtArgs> = {}>(args?: Subset<T, WarehouseDefaultArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    branch<T extends InventoryTransfer$branchArgs<ExtArgs> = {}>(args?: Subset<T, InventoryTransfer$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends InventoryTransfer$linesArgs<ExtArgs> = {}>(args?: Subset<T, InventoryTransfer$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the InventoryTransfer model
   */
  interface InventoryTransferFieldRefs {
    readonly id: FieldRef<"InventoryTransfer", 'String'>
    readonly reference: FieldRef<"InventoryTransfer", 'String'>
    readonly fromWarehouseId: FieldRef<"InventoryTransfer", 'String'>
    readonly toWarehouseId: FieldRef<"InventoryTransfer", 'String'>
    readonly branchId: FieldRef<"InventoryTransfer", 'String'>
    readonly status: FieldRef<"InventoryTransfer", 'String'>
    readonly transferDate: FieldRef<"InventoryTransfer", 'DateTime'>
    readonly notes: FieldRef<"InventoryTransfer", 'String'>
    readonly createdAt: FieldRef<"InventoryTransfer", 'DateTime'>
    readonly updatedAt: FieldRef<"InventoryTransfer", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * InventoryTransfer findUnique
   */
  export type InventoryTransferFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransfer to fetch.
     */
    where: InventoryTransferWhereUniqueInput
  }

  /**
   * InventoryTransfer findUniqueOrThrow
   */
  export type InventoryTransferFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransfer to fetch.
     */
    where: InventoryTransferWhereUniqueInput
  }

  /**
   * InventoryTransfer findFirst
   */
  export type InventoryTransferFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransfer to fetch.
     */
    where?: InventoryTransferWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransfers to fetch.
     */
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryTransfers.
     */
    cursor?: InventoryTransferWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransfers 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` InventoryTransfers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryTransfers.
     */
    distinct?: InventoryTransferScalarFieldEnum | InventoryTransferScalarFieldEnum[]
  }

  /**
   * InventoryTransfer findFirstOrThrow
   */
  export type InventoryTransferFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransfer to fetch.
     */
    where?: InventoryTransferWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransfers to fetch.
     */
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryTransfers.
     */
    cursor?: InventoryTransferWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransfers 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` InventoryTransfers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryTransfers.
     */
    distinct?: InventoryTransferScalarFieldEnum | InventoryTransferScalarFieldEnum[]
  }

  /**
   * InventoryTransfer findMany
   */
  export type InventoryTransferFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransfers to fetch.
     */
    where?: InventoryTransferWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransfers to fetch.
     */
    orderBy?: InventoryTransferOrderByWithRelationInput | InventoryTransferOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing InventoryTransfers.
     */
    cursor?: InventoryTransferWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransfers 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` InventoryTransfers.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryTransfers.
     */
    distinct?: InventoryTransferScalarFieldEnum | InventoryTransferScalarFieldEnum[]
  }

  /**
   * InventoryTransfer create
   */
  export type InventoryTransferCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * The data needed to create a InventoryTransfer.
     */
    data: XOR<InventoryTransferCreateInput, InventoryTransferUncheckedCreateInput>
  }

  /**
   * InventoryTransfer createMany
   */
  export type InventoryTransferCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many InventoryTransfers.
     */
    data: InventoryTransferCreateManyInput | InventoryTransferCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * InventoryTransfer createManyAndReturn
   */
  export type InventoryTransferCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * The data used to create many InventoryTransfers.
     */
    data: InventoryTransferCreateManyInput | InventoryTransferCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryTransfer update
   */
  export type InventoryTransferUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * The data needed to update a InventoryTransfer.
     */
    data: XOR<InventoryTransferUpdateInput, InventoryTransferUncheckedUpdateInput>
    /**
     * Choose, which InventoryTransfer to update.
     */
    where: InventoryTransferWhereUniqueInput
  }

  /**
   * InventoryTransfer updateMany
   */
  export type InventoryTransferUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update InventoryTransfers.
     */
    data: XOR<InventoryTransferUpdateManyMutationInput, InventoryTransferUncheckedUpdateManyInput>
    /**
     * Filter which InventoryTransfers to update
     */
    where?: InventoryTransferWhereInput
    /**
     * Limit how many InventoryTransfers to update.
     */
    limit?: number
  }

  /**
   * InventoryTransfer updateManyAndReturn
   */
  export type InventoryTransferUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * The data used to update InventoryTransfers.
     */
    data: XOR<InventoryTransferUpdateManyMutationInput, InventoryTransferUncheckedUpdateManyInput>
    /**
     * Filter which InventoryTransfers to update
     */
    where?: InventoryTransferWhereInput
    /**
     * Limit how many InventoryTransfers to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryTransfer upsert
   */
  export type InventoryTransferUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * The filter to search for the InventoryTransfer to update in case it exists.
     */
    where: InventoryTransferWhereUniqueInput
    /**
     * In case the InventoryTransfer found by the `where` argument doesn't exist, create a new InventoryTransfer with this data.
     */
    create: XOR<InventoryTransferCreateInput, InventoryTransferUncheckedCreateInput>
    /**
     * In case the InventoryTransfer was found with the provided `where` argument, update it with this data.
     */
    update: XOR<InventoryTransferUpdateInput, InventoryTransferUncheckedUpdateInput>
  }

  /**
   * InventoryTransfer delete
   */
  export type InventoryTransferDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
    /**
     * Filter which InventoryTransfer to delete.
     */
    where: InventoryTransferWhereUniqueInput
  }

  /**
   * InventoryTransfer deleteMany
   */
  export type InventoryTransferDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryTransfers to delete
     */
    where?: InventoryTransferWhereInput
    /**
     * Limit how many InventoryTransfers to delete.
     */
    limit?: number
  }

  /**
   * InventoryTransfer.branch
   */
  export type InventoryTransfer$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * InventoryTransfer.lines
   */
  export type InventoryTransfer$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    where?: InventoryTransferLineWhereInput
    orderBy?: InventoryTransferLineOrderByWithRelationInput | InventoryTransferLineOrderByWithRelationInput[]
    cursor?: InventoryTransferLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryTransferLineScalarFieldEnum | InventoryTransferLineScalarFieldEnum[]
  }

  /**
   * InventoryTransfer without action
   */
  export type InventoryTransferDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransfer
     */
    select?: InventoryTransferSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransfer
     */
    omit?: InventoryTransferOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferInclude<ExtArgs> | null
  }


  /**
   * Model InventoryTransferLine
   */

  export type AggregateInventoryTransferLine = {
    _count: InventoryTransferLineCountAggregateOutputType | null
    _avg: InventoryTransferLineAvgAggregateOutputType | null
    _sum: InventoryTransferLineSumAggregateOutputType | null
    _min: InventoryTransferLineMinAggregateOutputType | null
    _max: InventoryTransferLineMaxAggregateOutputType | null
  }

  export type InventoryTransferLineAvgAggregateOutputType = {
    quantity: number | null
  }

  export type InventoryTransferLineSumAggregateOutputType = {
    quantity: number | null
  }

  export type InventoryTransferLineMinAggregateOutputType = {
    id: string | null
    transferId: string | null
    productId: string | null
    quantity: number | null
  }

  export type InventoryTransferLineMaxAggregateOutputType = {
    id: string | null
    transferId: string | null
    productId: string | null
    quantity: number | null
  }

  export type InventoryTransferLineCountAggregateOutputType = {
    id: number
    transferId: number
    productId: number
    quantity: number
    _all: number
  }


  export type InventoryTransferLineAvgAggregateInputType = {
    quantity?: true
  }

  export type InventoryTransferLineSumAggregateInputType = {
    quantity?: true
  }

  export type InventoryTransferLineMinAggregateInputType = {
    id?: true
    transferId?: true
    productId?: true
    quantity?: true
  }

  export type InventoryTransferLineMaxAggregateInputType = {
    id?: true
    transferId?: true
    productId?: true
    quantity?: true
  }

  export type InventoryTransferLineCountAggregateInputType = {
    id?: true
    transferId?: true
    productId?: true
    quantity?: true
    _all?: true
  }

  export type InventoryTransferLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryTransferLine to aggregate.
     */
    where?: InventoryTransferLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransferLines to fetch.
     */
    orderBy?: InventoryTransferLineOrderByWithRelationInput | InventoryTransferLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: InventoryTransferLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransferLines 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` InventoryTransferLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned InventoryTransferLines
    **/
    _count?: true | InventoryTransferLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: InventoryTransferLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: InventoryTransferLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: InventoryTransferLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: InventoryTransferLineMaxAggregateInputType
  }

  export type GetInventoryTransferLineAggregateType<T extends InventoryTransferLineAggregateArgs> = {
        [P in keyof T & keyof AggregateInventoryTransferLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateInventoryTransferLine[P]>
      : GetScalarType<T[P], AggregateInventoryTransferLine[P]>
  }




  export type InventoryTransferLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryTransferLineWhereInput
    orderBy?: InventoryTransferLineOrderByWithAggregationInput | InventoryTransferLineOrderByWithAggregationInput[]
    by: InventoryTransferLineScalarFieldEnum[] | InventoryTransferLineScalarFieldEnum
    having?: InventoryTransferLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: InventoryTransferLineCountAggregateInputType | true
    _avg?: InventoryTransferLineAvgAggregateInputType
    _sum?: InventoryTransferLineSumAggregateInputType
    _min?: InventoryTransferLineMinAggregateInputType
    _max?: InventoryTransferLineMaxAggregateInputType
  }

  export type InventoryTransferLineGroupByOutputType = {
    id: string
    transferId: string
    productId: string
    quantity: number
    _count: InventoryTransferLineCountAggregateOutputType | null
    _avg: InventoryTransferLineAvgAggregateOutputType | null
    _sum: InventoryTransferLineSumAggregateOutputType | null
    _min: InventoryTransferLineMinAggregateOutputType | null
    _max: InventoryTransferLineMaxAggregateOutputType | null
  }

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


  export type InventoryTransferLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    transferId?: boolean
    productId?: boolean
    quantity?: boolean
    transfer?: boolean | InventoryTransferDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryTransferLine"]>

  export type InventoryTransferLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    transferId?: boolean
    productId?: boolean
    quantity?: boolean
    transfer?: boolean | InventoryTransferDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryTransferLine"]>

  export type InventoryTransferLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    transferId?: boolean
    productId?: boolean
    quantity?: boolean
    transfer?: boolean | InventoryTransferDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryTransferLine"]>

  export type InventoryTransferLineSelectScalar = {
    id?: boolean
    transferId?: boolean
    productId?: boolean
    quantity?: boolean
  }

  export type InventoryTransferLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "transferId" | "productId" | "quantity", ExtArgs["result"]["inventoryTransferLine"]>
  export type InventoryTransferLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    transfer?: boolean | InventoryTransferDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type InventoryTransferLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    transfer?: boolean | InventoryTransferDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type InventoryTransferLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    transfer?: boolean | InventoryTransferDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $InventoryTransferLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "InventoryTransferLine"
    objects: {
      transfer: Prisma.$InventoryTransferPayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      transferId: string
      productId: string
      quantity: number
    }, ExtArgs["result"]["inventoryTransferLine"]>
    composites: {}
  }

  type InventoryTransferLineGetPayload<S extends boolean | null | undefined | InventoryTransferLineDefaultArgs> = $Result.GetResult<Prisma.$InventoryTransferLinePayload, S>

  type InventoryTransferLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<InventoryTransferLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: InventoryTransferLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a InventoryTransferLine.
     * @param {InventoryTransferLineCreateArgs} args - Arguments to create a InventoryTransferLine.
     * @example
     * // Create one InventoryTransferLine
     * const InventoryTransferLine = await prisma.inventoryTransferLine.create({
     *   data: {
     *     // ... data to create a InventoryTransferLine
     *   }
     * })
     * 
     */
    create<T extends InventoryTransferLineCreateArgs>(args: SelectSubset<T, InventoryTransferLineCreateArgs<ExtArgs>>): Prisma__InventoryTransferLineClient<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many InventoryTransferLines and returns the data saved in the database.
     * @param {InventoryTransferLineCreateManyAndReturnArgs} args - Arguments to create many InventoryTransferLines.
     * @example
     * // Create many InventoryTransferLines
     * const inventoryTransferLine = await prisma.inventoryTransferLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many InventoryTransferLines and only return the `id`
     * const inventoryTransferLineWithIdOnly = await prisma.inventoryTransferLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends InventoryTransferLineCreateManyAndReturnArgs>(args?: SelectSubset<T, InventoryTransferLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a InventoryTransferLine.
     * @param {InventoryTransferLineDeleteArgs} args - Arguments to delete one InventoryTransferLine.
     * @example
     * // Delete one InventoryTransferLine
     * const InventoryTransferLine = await prisma.inventoryTransferLine.delete({
     *   where: {
     *     // ... filter to delete one InventoryTransferLine
     *   }
     * })
     * 
     */
    delete<T extends InventoryTransferLineDeleteArgs>(args: SelectSubset<T, InventoryTransferLineDeleteArgs<ExtArgs>>): Prisma__InventoryTransferLineClient<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one InventoryTransferLine.
     * @param {InventoryTransferLineUpdateArgs} args - Arguments to update one InventoryTransferLine.
     * @example
     * // Update one InventoryTransferLine
     * const inventoryTransferLine = await prisma.inventoryTransferLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends InventoryTransferLineUpdateArgs>(args: SelectSubset<T, InventoryTransferLineUpdateArgs<ExtArgs>>): Prisma__InventoryTransferLineClient<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more InventoryTransferLines and returns the data updated in the database.
     * @param {InventoryTransferLineUpdateManyAndReturnArgs} args - Arguments to update many InventoryTransferLines.
     * @example
     * // Update many InventoryTransferLines
     * const inventoryTransferLine = await prisma.inventoryTransferLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more InventoryTransferLines and only return the `id`
     * const inventoryTransferLineWithIdOnly = await prisma.inventoryTransferLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends InventoryTransferLineUpdateManyAndReturnArgs>(args: SelectSubset<T, InventoryTransferLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryTransferLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a InventoryTransferLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryTransferLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends InventoryTransferLineAggregateArgs>(args: Subset<T, InventoryTransferLineAggregateArgs>): Prisma.PrismaPromise<GetInventoryTransferLineAggregateType<T>>

    /**
     * Group by InventoryTransferLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryTransferLineGroupByArgs} 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 InventoryTransferLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: InventoryTransferLineGroupByArgs['orderBy'] }
        : { orderBy?: InventoryTransferLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, InventoryTransferLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetInventoryTransferLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the InventoryTransferLine model
   */
  readonly fields: InventoryTransferLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for InventoryTransferLine.
   * 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__InventoryTransferLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    transfer<T extends InventoryTransferDefaultArgs<ExtArgs> = {}>(args?: Subset<T, InventoryTransferDefaultArgs<ExtArgs>>): Prisma__InventoryTransferClient<$Result.GetResult<Prisma.$InventoryTransferPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the InventoryTransferLine model
   */
  interface InventoryTransferLineFieldRefs {
    readonly id: FieldRef<"InventoryTransferLine", 'String'>
    readonly transferId: FieldRef<"InventoryTransferLine", 'String'>
    readonly productId: FieldRef<"InventoryTransferLine", 'String'>
    readonly quantity: FieldRef<"InventoryTransferLine", 'Int'>
  }
    

  // Custom InputTypes
  /**
   * InventoryTransferLine findUnique
   */
  export type InventoryTransferLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransferLine to fetch.
     */
    where: InventoryTransferLineWhereUniqueInput
  }

  /**
   * InventoryTransferLine findUniqueOrThrow
   */
  export type InventoryTransferLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransferLine to fetch.
     */
    where: InventoryTransferLineWhereUniqueInput
  }

  /**
   * InventoryTransferLine findFirst
   */
  export type InventoryTransferLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransferLine to fetch.
     */
    where?: InventoryTransferLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransferLines to fetch.
     */
    orderBy?: InventoryTransferLineOrderByWithRelationInput | InventoryTransferLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryTransferLines.
     */
    cursor?: InventoryTransferLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransferLines 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` InventoryTransferLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryTransferLines.
     */
    distinct?: InventoryTransferLineScalarFieldEnum | InventoryTransferLineScalarFieldEnum[]
  }

  /**
   * InventoryTransferLine findFirstOrThrow
   */
  export type InventoryTransferLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransferLine to fetch.
     */
    where?: InventoryTransferLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransferLines to fetch.
     */
    orderBy?: InventoryTransferLineOrderByWithRelationInput | InventoryTransferLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryTransferLines.
     */
    cursor?: InventoryTransferLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransferLines 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` InventoryTransferLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryTransferLines.
     */
    distinct?: InventoryTransferLineScalarFieldEnum | InventoryTransferLineScalarFieldEnum[]
  }

  /**
   * InventoryTransferLine findMany
   */
  export type InventoryTransferLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryTransferLines to fetch.
     */
    where?: InventoryTransferLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryTransferLines to fetch.
     */
    orderBy?: InventoryTransferLineOrderByWithRelationInput | InventoryTransferLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing InventoryTransferLines.
     */
    cursor?: InventoryTransferLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryTransferLines 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` InventoryTransferLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryTransferLines.
     */
    distinct?: InventoryTransferLineScalarFieldEnum | InventoryTransferLineScalarFieldEnum[]
  }

  /**
   * InventoryTransferLine create
   */
  export type InventoryTransferLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * The data needed to create a InventoryTransferLine.
     */
    data: XOR<InventoryTransferLineCreateInput, InventoryTransferLineUncheckedCreateInput>
  }

  /**
   * InventoryTransferLine createMany
   */
  export type InventoryTransferLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many InventoryTransferLines.
     */
    data: InventoryTransferLineCreateManyInput | InventoryTransferLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * InventoryTransferLine createManyAndReturn
   */
  export type InventoryTransferLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * The data used to create many InventoryTransferLines.
     */
    data: InventoryTransferLineCreateManyInput | InventoryTransferLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryTransferLine update
   */
  export type InventoryTransferLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * The data needed to update a InventoryTransferLine.
     */
    data: XOR<InventoryTransferLineUpdateInput, InventoryTransferLineUncheckedUpdateInput>
    /**
     * Choose, which InventoryTransferLine to update.
     */
    where: InventoryTransferLineWhereUniqueInput
  }

  /**
   * InventoryTransferLine updateMany
   */
  export type InventoryTransferLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update InventoryTransferLines.
     */
    data: XOR<InventoryTransferLineUpdateManyMutationInput, InventoryTransferLineUncheckedUpdateManyInput>
    /**
     * Filter which InventoryTransferLines to update
     */
    where?: InventoryTransferLineWhereInput
    /**
     * Limit how many InventoryTransferLines to update.
     */
    limit?: number
  }

  /**
   * InventoryTransferLine updateManyAndReturn
   */
  export type InventoryTransferLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * The data used to update InventoryTransferLines.
     */
    data: XOR<InventoryTransferLineUpdateManyMutationInput, InventoryTransferLineUncheckedUpdateManyInput>
    /**
     * Filter which InventoryTransferLines to update
     */
    where?: InventoryTransferLineWhereInput
    /**
     * Limit how many InventoryTransferLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryTransferLine upsert
   */
  export type InventoryTransferLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * The filter to search for the InventoryTransferLine to update in case it exists.
     */
    where: InventoryTransferLineWhereUniqueInput
    /**
     * In case the InventoryTransferLine found by the `where` argument doesn't exist, create a new InventoryTransferLine with this data.
     */
    create: XOR<InventoryTransferLineCreateInput, InventoryTransferLineUncheckedCreateInput>
    /**
     * In case the InventoryTransferLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<InventoryTransferLineUpdateInput, InventoryTransferLineUncheckedUpdateInput>
  }

  /**
   * InventoryTransferLine delete
   */
  export type InventoryTransferLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
    /**
     * Filter which InventoryTransferLine to delete.
     */
    where: InventoryTransferLineWhereUniqueInput
  }

  /**
   * InventoryTransferLine deleteMany
   */
  export type InventoryTransferLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryTransferLines to delete
     */
    where?: InventoryTransferLineWhereInput
    /**
     * Limit how many InventoryTransferLines to delete.
     */
    limit?: number
  }

  /**
   * InventoryTransferLine without action
   */
  export type InventoryTransferLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryTransferLine
     */
    select?: InventoryTransferLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryTransferLine
     */
    omit?: InventoryTransferLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryTransferLineInclude<ExtArgs> | null
  }


  /**
   * Model Invoice
   */

  export type AggregateInvoice = {
    _count: InvoiceCountAggregateOutputType | null
    _avg: InvoiceAvgAggregateOutputType | null
    _sum: InvoiceSumAggregateOutputType | null
    _min: InvoiceMinAggregateOutputType | null
    _max: InvoiceMaxAggregateOutputType | null
  }

  export type InvoiceAvgAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type InvoiceSumAggregateOutputType = {
    subtotal: number | null
    taxTotal: number | null
    total: number | null
  }

  export type InvoiceMinAggregateOutputType = {
    id: string | null
    number: string | null
    customerId: string | null
    saleId: string | null
    branchId: string | null
    status: string | null
    issueDate: Date | null
    dueDate: Date | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type InvoiceMaxAggregateOutputType = {
    id: string | null
    number: string | null
    customerId: string | null
    saleId: string | null
    branchId: string | null
    status: string | null
    issueDate: Date | null
    dueDate: Date | null
    notes: string | null
    subtotal: number | null
    taxTotal: number | null
    total: number | null
    createdAt: Date | null
    updatedAt: Date | null
    deletedAt: Date | null
  }

  export type InvoiceCountAggregateOutputType = {
    id: number
    number: number
    customerId: number
    saleId: number
    branchId: number
    status: number
    issueDate: number
    dueDate: number
    notes: number
    subtotal: number
    taxTotal: number
    total: number
    createdAt: number
    updatedAt: number
    deletedAt: number
    _all: number
  }


  export type InvoiceAvgAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type InvoiceSumAggregateInputType = {
    subtotal?: true
    taxTotal?: true
    total?: true
  }

  export type InvoiceMinAggregateInputType = {
    id?: true
    number?: true
    customerId?: true
    saleId?: true
    branchId?: true
    status?: true
    issueDate?: true
    dueDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type InvoiceMaxAggregateInputType = {
    id?: true
    number?: true
    customerId?: true
    saleId?: true
    branchId?: true
    status?: true
    issueDate?: true
    dueDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
  }

  export type InvoiceCountAggregateInputType = {
    id?: true
    number?: true
    customerId?: true
    saleId?: true
    branchId?: true
    status?: true
    issueDate?: true
    dueDate?: true
    notes?: true
    subtotal?: true
    taxTotal?: true
    total?: true
    createdAt?: true
    updatedAt?: true
    deletedAt?: true
    _all?: true
  }

  export type InvoiceAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Invoice to aggregate.
     */
    where?: InvoiceWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Invoices to fetch.
     */
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: InvoiceWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Invoices 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` Invoices.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Invoices
    **/
    _count?: true | InvoiceCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: InvoiceAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: InvoiceSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: InvoiceMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: InvoiceMaxAggregateInputType
  }

  export type GetInvoiceAggregateType<T extends InvoiceAggregateArgs> = {
        [P in keyof T & keyof AggregateInvoice]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateInvoice[P]>
      : GetScalarType<T[P], AggregateInvoice[P]>
  }




  export type InvoiceGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceWhereInput
    orderBy?: InvoiceOrderByWithAggregationInput | InvoiceOrderByWithAggregationInput[]
    by: InvoiceScalarFieldEnum[] | InvoiceScalarFieldEnum
    having?: InvoiceScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: InvoiceCountAggregateInputType | true
    _avg?: InvoiceAvgAggregateInputType
    _sum?: InvoiceSumAggregateInputType
    _min?: InvoiceMinAggregateInputType
    _max?: InvoiceMaxAggregateInputType
  }

  export type InvoiceGroupByOutputType = {
    id: string
    number: string
    customerId: string | null
    saleId: string | null
    branchId: string | null
    status: string
    issueDate: Date
    dueDate: Date | null
    notes: string | null
    subtotal: number
    taxTotal: number
    total: number
    createdAt: Date
    updatedAt: Date
    deletedAt: Date | null
    _count: InvoiceCountAggregateOutputType | null
    _avg: InvoiceAvgAggregateOutputType | null
    _sum: InvoiceSumAggregateOutputType | null
    _min: InvoiceMinAggregateOutputType | null
    _max: InvoiceMaxAggregateOutputType | null
  }

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


  export type InvoiceSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    customerId?: boolean
    saleId?: boolean
    branchId?: boolean
    status?: boolean
    issueDate?: boolean
    dueDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    customer?: boolean | Invoice$customerArgs<ExtArgs>
    sale?: boolean | Invoice$saleArgs<ExtArgs>
    branch?: boolean | Invoice$branchArgs<ExtArgs>
    lines?: boolean | Invoice$linesArgs<ExtArgs>
    _count?: boolean | InvoiceCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["invoice"]>

  export type InvoiceSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    customerId?: boolean
    saleId?: boolean
    branchId?: boolean
    status?: boolean
    issueDate?: boolean
    dueDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    customer?: boolean | Invoice$customerArgs<ExtArgs>
    sale?: boolean | Invoice$saleArgs<ExtArgs>
    branch?: boolean | Invoice$branchArgs<ExtArgs>
  }, ExtArgs["result"]["invoice"]>

  export type InvoiceSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    number?: boolean
    customerId?: boolean
    saleId?: boolean
    branchId?: boolean
    status?: boolean
    issueDate?: boolean
    dueDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
    customer?: boolean | Invoice$customerArgs<ExtArgs>
    sale?: boolean | Invoice$saleArgs<ExtArgs>
    branch?: boolean | Invoice$branchArgs<ExtArgs>
  }, ExtArgs["result"]["invoice"]>

  export type InvoiceSelectScalar = {
    id?: boolean
    number?: boolean
    customerId?: boolean
    saleId?: boolean
    branchId?: boolean
    status?: boolean
    issueDate?: boolean
    dueDate?: boolean
    notes?: boolean
    subtotal?: boolean
    taxTotal?: boolean
    total?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    deletedAt?: boolean
  }

  export type InvoiceOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "number" | "customerId" | "saleId" | "branchId" | "status" | "issueDate" | "dueDate" | "notes" | "subtotal" | "taxTotal" | "total" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["invoice"]>
  export type InvoiceInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    customer?: boolean | Invoice$customerArgs<ExtArgs>
    sale?: boolean | Invoice$saleArgs<ExtArgs>
    branch?: boolean | Invoice$branchArgs<ExtArgs>
    lines?: boolean | Invoice$linesArgs<ExtArgs>
    _count?: boolean | InvoiceCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type InvoiceIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    customer?: boolean | Invoice$customerArgs<ExtArgs>
    sale?: boolean | Invoice$saleArgs<ExtArgs>
    branch?: boolean | Invoice$branchArgs<ExtArgs>
  }
  export type InvoiceIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    customer?: boolean | Invoice$customerArgs<ExtArgs>
    sale?: boolean | Invoice$saleArgs<ExtArgs>
    branch?: boolean | Invoice$branchArgs<ExtArgs>
  }

  export type $InvoicePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Invoice"
    objects: {
      customer: Prisma.$CustomerPayload<ExtArgs> | null
      sale: Prisma.$SalePayload<ExtArgs> | null
      branch: Prisma.$BranchPayload<ExtArgs> | null
      lines: Prisma.$InvoiceLinePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      number: string
      customerId: string | null
      saleId: string | null
      branchId: string | null
      status: string
      issueDate: Date
      dueDate: Date | null
      notes: string | null
      subtotal: number
      taxTotal: number
      total: number
      createdAt: Date
      updatedAt: Date
      deletedAt: Date | null
    }, ExtArgs["result"]["invoice"]>
    composites: {}
  }

  type InvoiceGetPayload<S extends boolean | null | undefined | InvoiceDefaultArgs> = $Result.GetResult<Prisma.$InvoicePayload, S>

  type InvoiceCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<InvoiceFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: InvoiceCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Invoice.
     * @param {InvoiceCreateArgs} args - Arguments to create a Invoice.
     * @example
     * // Create one Invoice
     * const Invoice = await prisma.invoice.create({
     *   data: {
     *     // ... data to create a Invoice
     *   }
     * })
     * 
     */
    create<T extends InvoiceCreateArgs>(args: SelectSubset<T, InvoiceCreateArgs<ExtArgs>>): Prisma__InvoiceClient<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Invoices and returns the data saved in the database.
     * @param {InvoiceCreateManyAndReturnArgs} args - Arguments to create many Invoices.
     * @example
     * // Create many Invoices
     * const invoice = await prisma.invoice.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Invoices and only return the `id`
     * const invoiceWithIdOnly = await prisma.invoice.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends InvoiceCreateManyAndReturnArgs>(args?: SelectSubset<T, InvoiceCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Invoice.
     * @param {InvoiceDeleteArgs} args - Arguments to delete one Invoice.
     * @example
     * // Delete one Invoice
     * const Invoice = await prisma.invoice.delete({
     *   where: {
     *     // ... filter to delete one Invoice
     *   }
     * })
     * 
     */
    delete<T extends InvoiceDeleteArgs>(args: SelectSubset<T, InvoiceDeleteArgs<ExtArgs>>): Prisma__InvoiceClient<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Invoice.
     * @param {InvoiceUpdateArgs} args - Arguments to update one Invoice.
     * @example
     * // Update one Invoice
     * const invoice = await prisma.invoice.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends InvoiceUpdateArgs>(args: SelectSubset<T, InvoiceUpdateArgs<ExtArgs>>): Prisma__InvoiceClient<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Invoices and returns the data updated in the database.
     * @param {InvoiceUpdateManyAndReturnArgs} args - Arguments to update many Invoices.
     * @example
     * // Update many Invoices
     * const invoice = await prisma.invoice.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Invoices and only return the `id`
     * const invoiceWithIdOnly = await prisma.invoice.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends InvoiceUpdateManyAndReturnArgs>(args: SelectSubset<T, InvoiceUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Invoice.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InvoiceAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends InvoiceAggregateArgs>(args: Subset<T, InvoiceAggregateArgs>): Prisma.PrismaPromise<GetInvoiceAggregateType<T>>

    /**
     * Group by Invoice.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InvoiceGroupByArgs} 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 InvoiceGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: InvoiceGroupByArgs['orderBy'] }
        : { orderBy?: InvoiceGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, InvoiceGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetInvoiceGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Invoice model
   */
  readonly fields: InvoiceFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Invoice.
   * 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__InvoiceClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    customer<T extends Invoice$customerArgs<ExtArgs> = {}>(args?: Subset<T, Invoice$customerArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    sale<T extends Invoice$saleArgs<ExtArgs> = {}>(args?: Subset<T, Invoice$saleArgs<ExtArgs>>): Prisma__SaleClient<$Result.GetResult<Prisma.$SalePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    branch<T extends Invoice$branchArgs<ExtArgs> = {}>(args?: Subset<T, Invoice$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends Invoice$linesArgs<ExtArgs> = {}>(args?: Subset<T, Invoice$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Invoice model
   */
  interface InvoiceFieldRefs {
    readonly id: FieldRef<"Invoice", 'String'>
    readonly number: FieldRef<"Invoice", 'String'>
    readonly customerId: FieldRef<"Invoice", 'String'>
    readonly saleId: FieldRef<"Invoice", 'String'>
    readonly branchId: FieldRef<"Invoice", 'String'>
    readonly status: FieldRef<"Invoice", 'String'>
    readonly issueDate: FieldRef<"Invoice", 'DateTime'>
    readonly dueDate: FieldRef<"Invoice", 'DateTime'>
    readonly notes: FieldRef<"Invoice", 'String'>
    readonly subtotal: FieldRef<"Invoice", 'Float'>
    readonly taxTotal: FieldRef<"Invoice", 'Float'>
    readonly total: FieldRef<"Invoice", 'Float'>
    readonly createdAt: FieldRef<"Invoice", 'DateTime'>
    readonly updatedAt: FieldRef<"Invoice", 'DateTime'>
    readonly deletedAt: FieldRef<"Invoice", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Invoice findUnique
   */
  export type InvoiceFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * Filter, which Invoice to fetch.
     */
    where: InvoiceWhereUniqueInput
  }

  /**
   * Invoice findUniqueOrThrow
   */
  export type InvoiceFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * Filter, which Invoice to fetch.
     */
    where: InvoiceWhereUniqueInput
  }

  /**
   * Invoice findFirst
   */
  export type InvoiceFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * Filter, which Invoice to fetch.
     */
    where?: InvoiceWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Invoices to fetch.
     */
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Invoices.
     */
    cursor?: InvoiceWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Invoices 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` Invoices.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Invoices.
     */
    distinct?: InvoiceScalarFieldEnum | InvoiceScalarFieldEnum[]
  }

  /**
   * Invoice findFirstOrThrow
   */
  export type InvoiceFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * Filter, which Invoice to fetch.
     */
    where?: InvoiceWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Invoices to fetch.
     */
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Invoices.
     */
    cursor?: InvoiceWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Invoices 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` Invoices.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Invoices.
     */
    distinct?: InvoiceScalarFieldEnum | InvoiceScalarFieldEnum[]
  }

  /**
   * Invoice findMany
   */
  export type InvoiceFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * Filter, which Invoices to fetch.
     */
    where?: InvoiceWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Invoices to fetch.
     */
    orderBy?: InvoiceOrderByWithRelationInput | InvoiceOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Invoices.
     */
    cursor?: InvoiceWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Invoices 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` Invoices.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Invoices.
     */
    distinct?: InvoiceScalarFieldEnum | InvoiceScalarFieldEnum[]
  }

  /**
   * Invoice create
   */
  export type InvoiceCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * The data needed to create a Invoice.
     */
    data: XOR<InvoiceCreateInput, InvoiceUncheckedCreateInput>
  }

  /**
   * Invoice createMany
   */
  export type InvoiceCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Invoices.
     */
    data: InvoiceCreateManyInput | InvoiceCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Invoice createManyAndReturn
   */
  export type InvoiceCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * The data used to create many Invoices.
     */
    data: InvoiceCreateManyInput | InvoiceCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Invoice update
   */
  export type InvoiceUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * The data needed to update a Invoice.
     */
    data: XOR<InvoiceUpdateInput, InvoiceUncheckedUpdateInput>
    /**
     * Choose, which Invoice to update.
     */
    where: InvoiceWhereUniqueInput
  }

  /**
   * Invoice updateMany
   */
  export type InvoiceUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Invoices.
     */
    data: XOR<InvoiceUpdateManyMutationInput, InvoiceUncheckedUpdateManyInput>
    /**
     * Filter which Invoices to update
     */
    where?: InvoiceWhereInput
    /**
     * Limit how many Invoices to update.
     */
    limit?: number
  }

  /**
   * Invoice updateManyAndReturn
   */
  export type InvoiceUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * The data used to update Invoices.
     */
    data: XOR<InvoiceUpdateManyMutationInput, InvoiceUncheckedUpdateManyInput>
    /**
     * Filter which Invoices to update
     */
    where?: InvoiceWhereInput
    /**
     * Limit how many Invoices to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Invoice upsert
   */
  export type InvoiceUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * The filter to search for the Invoice to update in case it exists.
     */
    where: InvoiceWhereUniqueInput
    /**
     * In case the Invoice found by the `where` argument doesn't exist, create a new Invoice with this data.
     */
    create: XOR<InvoiceCreateInput, InvoiceUncheckedCreateInput>
    /**
     * In case the Invoice was found with the provided `where` argument, update it with this data.
     */
    update: XOR<InvoiceUpdateInput, InvoiceUncheckedUpdateInput>
  }

  /**
   * Invoice delete
   */
  export type InvoiceDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
    /**
     * Filter which Invoice to delete.
     */
    where: InvoiceWhereUniqueInput
  }

  /**
   * Invoice deleteMany
   */
  export type InvoiceDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Invoices to delete
     */
    where?: InvoiceWhereInput
    /**
     * Limit how many Invoices to delete.
     */
    limit?: number
  }

  /**
   * Invoice.customer
   */
  export type Invoice$customerArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Customer
     */
    select?: CustomerSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Customer
     */
    omit?: CustomerOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: CustomerInclude<ExtArgs> | null
    where?: CustomerWhereInput
  }

  /**
   * Invoice.sale
   */
  export type Invoice$saleArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Sale
     */
    select?: SaleSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Sale
     */
    omit?: SaleOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: SaleInclude<ExtArgs> | null
    where?: SaleWhereInput
  }

  /**
   * Invoice.branch
   */
  export type Invoice$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * Invoice.lines
   */
  export type Invoice$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    where?: InvoiceLineWhereInput
    orderBy?: InvoiceLineOrderByWithRelationInput | InvoiceLineOrderByWithRelationInput[]
    cursor?: InvoiceLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InvoiceLineScalarFieldEnum | InvoiceLineScalarFieldEnum[]
  }

  /**
   * Invoice without action
   */
  export type InvoiceDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Invoice
     */
    select?: InvoiceSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Invoice
     */
    omit?: InvoiceOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceInclude<ExtArgs> | null
  }


  /**
   * Model InvoiceLine
   */

  export type AggregateInvoiceLine = {
    _count: InvoiceLineCountAggregateOutputType | null
    _avg: InvoiceLineAvgAggregateOutputType | null
    _sum: InvoiceLineSumAggregateOutputType | null
    _min: InvoiceLineMinAggregateOutputType | null
    _max: InvoiceLineMaxAggregateOutputType | null
  }

  export type InvoiceLineAvgAggregateOutputType = {
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type InvoiceLineSumAggregateOutputType = {
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type InvoiceLineMinAggregateOutputType = {
    id: string | null
    invoiceId: string | null
    productId: string | null
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type InvoiceLineMaxAggregateOutputType = {
    id: string | null
    invoiceId: string | null
    productId: string | null
    quantity: number | null
    unitPrice: number | null
    taxRate: number | null
    lineTotal: number | null
  }

  export type InvoiceLineCountAggregateOutputType = {
    id: number
    invoiceId: number
    productId: number
    quantity: number
    unitPrice: number
    taxRate: number
    lineTotal: number
    _all: number
  }


  export type InvoiceLineAvgAggregateInputType = {
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type InvoiceLineSumAggregateInputType = {
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type InvoiceLineMinAggregateInputType = {
    id?: true
    invoiceId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type InvoiceLineMaxAggregateInputType = {
    id?: true
    invoiceId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
  }

  export type InvoiceLineCountAggregateInputType = {
    id?: true
    invoiceId?: true
    productId?: true
    quantity?: true
    unitPrice?: true
    taxRate?: true
    lineTotal?: true
    _all?: true
  }

  export type InvoiceLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InvoiceLine to aggregate.
     */
    where?: InvoiceLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InvoiceLines to fetch.
     */
    orderBy?: InvoiceLineOrderByWithRelationInput | InvoiceLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: InvoiceLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InvoiceLines 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` InvoiceLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned InvoiceLines
    **/
    _count?: true | InvoiceLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: InvoiceLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: InvoiceLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: InvoiceLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: InvoiceLineMaxAggregateInputType
  }

  export type GetInvoiceLineAggregateType<T extends InvoiceLineAggregateArgs> = {
        [P in keyof T & keyof AggregateInvoiceLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateInvoiceLine[P]>
      : GetScalarType<T[P], AggregateInvoiceLine[P]>
  }




  export type InvoiceLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InvoiceLineWhereInput
    orderBy?: InvoiceLineOrderByWithAggregationInput | InvoiceLineOrderByWithAggregationInput[]
    by: InvoiceLineScalarFieldEnum[] | InvoiceLineScalarFieldEnum
    having?: InvoiceLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: InvoiceLineCountAggregateInputType | true
    _avg?: InvoiceLineAvgAggregateInputType
    _sum?: InvoiceLineSumAggregateInputType
    _min?: InvoiceLineMinAggregateInputType
    _max?: InvoiceLineMaxAggregateInputType
  }

  export type InvoiceLineGroupByOutputType = {
    id: string
    invoiceId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate: number
    lineTotal: number
    _count: InvoiceLineCountAggregateOutputType | null
    _avg: InvoiceLineAvgAggregateOutputType | null
    _sum: InvoiceLineSumAggregateOutputType | null
    _min: InvoiceLineMinAggregateOutputType | null
    _max: InvoiceLineMaxAggregateOutputType | null
  }

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


  export type InvoiceLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    invoiceId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    invoice?: boolean | InvoiceDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["invoiceLine"]>

  export type InvoiceLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    invoiceId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    invoice?: boolean | InvoiceDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["invoiceLine"]>

  export type InvoiceLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    invoiceId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
    invoice?: boolean | InvoiceDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["invoiceLine"]>

  export type InvoiceLineSelectScalar = {
    id?: boolean
    invoiceId?: boolean
    productId?: boolean
    quantity?: boolean
    unitPrice?: boolean
    taxRate?: boolean
    lineTotal?: boolean
  }

  export type InvoiceLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "invoiceId" | "productId" | "quantity" | "unitPrice" | "taxRate" | "lineTotal", ExtArgs["result"]["invoiceLine"]>
  export type InvoiceLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    invoice?: boolean | InvoiceDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type InvoiceLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    invoice?: boolean | InvoiceDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type InvoiceLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    invoice?: boolean | InvoiceDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $InvoiceLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "InvoiceLine"
    objects: {
      invoice: Prisma.$InvoicePayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      invoiceId: string
      productId: string
      quantity: number
      unitPrice: number
      taxRate: number
      lineTotal: number
    }, ExtArgs["result"]["invoiceLine"]>
    composites: {}
  }

  type InvoiceLineGetPayload<S extends boolean | null | undefined | InvoiceLineDefaultArgs> = $Result.GetResult<Prisma.$InvoiceLinePayload, S>

  type InvoiceLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<InvoiceLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: InvoiceLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a InvoiceLine.
     * @param {InvoiceLineCreateArgs} args - Arguments to create a InvoiceLine.
     * @example
     * // Create one InvoiceLine
     * const InvoiceLine = await prisma.invoiceLine.create({
     *   data: {
     *     // ... data to create a InvoiceLine
     *   }
     * })
     * 
     */
    create<T extends InvoiceLineCreateArgs>(args: SelectSubset<T, InvoiceLineCreateArgs<ExtArgs>>): Prisma__InvoiceLineClient<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many InvoiceLines and returns the data saved in the database.
     * @param {InvoiceLineCreateManyAndReturnArgs} args - Arguments to create many InvoiceLines.
     * @example
     * // Create many InvoiceLines
     * const invoiceLine = await prisma.invoiceLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many InvoiceLines and only return the `id`
     * const invoiceLineWithIdOnly = await prisma.invoiceLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends InvoiceLineCreateManyAndReturnArgs>(args?: SelectSubset<T, InvoiceLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a InvoiceLine.
     * @param {InvoiceLineDeleteArgs} args - Arguments to delete one InvoiceLine.
     * @example
     * // Delete one InvoiceLine
     * const InvoiceLine = await prisma.invoiceLine.delete({
     *   where: {
     *     // ... filter to delete one InvoiceLine
     *   }
     * })
     * 
     */
    delete<T extends InvoiceLineDeleteArgs>(args: SelectSubset<T, InvoiceLineDeleteArgs<ExtArgs>>): Prisma__InvoiceLineClient<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one InvoiceLine.
     * @param {InvoiceLineUpdateArgs} args - Arguments to update one InvoiceLine.
     * @example
     * // Update one InvoiceLine
     * const invoiceLine = await prisma.invoiceLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends InvoiceLineUpdateArgs>(args: SelectSubset<T, InvoiceLineUpdateArgs<ExtArgs>>): Prisma__InvoiceLineClient<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more InvoiceLines and returns the data updated in the database.
     * @param {InvoiceLineUpdateManyAndReturnArgs} args - Arguments to update many InvoiceLines.
     * @example
     * // Update many InvoiceLines
     * const invoiceLine = await prisma.invoiceLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more InvoiceLines and only return the `id`
     * const invoiceLineWithIdOnly = await prisma.invoiceLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends InvoiceLineUpdateManyAndReturnArgs>(args: SelectSubset<T, InvoiceLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InvoiceLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a InvoiceLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InvoiceLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends InvoiceLineAggregateArgs>(args: Subset<T, InvoiceLineAggregateArgs>): Prisma.PrismaPromise<GetInvoiceLineAggregateType<T>>

    /**
     * Group by InvoiceLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InvoiceLineGroupByArgs} 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 InvoiceLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: InvoiceLineGroupByArgs['orderBy'] }
        : { orderBy?: InvoiceLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, InvoiceLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetInvoiceLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the InvoiceLine model
   */
  readonly fields: InvoiceLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for InvoiceLine.
   * 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__InvoiceLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    invoice<T extends InvoiceDefaultArgs<ExtArgs> = {}>(args?: Subset<T, InvoiceDefaultArgs<ExtArgs>>): Prisma__InvoiceClient<$Result.GetResult<Prisma.$InvoicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the InvoiceLine model
   */
  interface InvoiceLineFieldRefs {
    readonly id: FieldRef<"InvoiceLine", 'String'>
    readonly invoiceId: FieldRef<"InvoiceLine", 'String'>
    readonly productId: FieldRef<"InvoiceLine", 'String'>
    readonly quantity: FieldRef<"InvoiceLine", 'Int'>
    readonly unitPrice: FieldRef<"InvoiceLine", 'Float'>
    readonly taxRate: FieldRef<"InvoiceLine", 'Float'>
    readonly lineTotal: FieldRef<"InvoiceLine", 'Float'>
  }
    

  // Custom InputTypes
  /**
   * InvoiceLine findUnique
   */
  export type InvoiceLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * Filter, which InvoiceLine to fetch.
     */
    where: InvoiceLineWhereUniqueInput
  }

  /**
   * InvoiceLine findUniqueOrThrow
   */
  export type InvoiceLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * Filter, which InvoiceLine to fetch.
     */
    where: InvoiceLineWhereUniqueInput
  }

  /**
   * InvoiceLine findFirst
   */
  export type InvoiceLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * Filter, which InvoiceLine to fetch.
     */
    where?: InvoiceLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InvoiceLines to fetch.
     */
    orderBy?: InvoiceLineOrderByWithRelationInput | InvoiceLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InvoiceLines.
     */
    cursor?: InvoiceLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InvoiceLines 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` InvoiceLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InvoiceLines.
     */
    distinct?: InvoiceLineScalarFieldEnum | InvoiceLineScalarFieldEnum[]
  }

  /**
   * InvoiceLine findFirstOrThrow
   */
  export type InvoiceLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * Filter, which InvoiceLine to fetch.
     */
    where?: InvoiceLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InvoiceLines to fetch.
     */
    orderBy?: InvoiceLineOrderByWithRelationInput | InvoiceLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InvoiceLines.
     */
    cursor?: InvoiceLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InvoiceLines 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` InvoiceLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InvoiceLines.
     */
    distinct?: InvoiceLineScalarFieldEnum | InvoiceLineScalarFieldEnum[]
  }

  /**
   * InvoiceLine findMany
   */
  export type InvoiceLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * Filter, which InvoiceLines to fetch.
     */
    where?: InvoiceLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InvoiceLines to fetch.
     */
    orderBy?: InvoiceLineOrderByWithRelationInput | InvoiceLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing InvoiceLines.
     */
    cursor?: InvoiceLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InvoiceLines 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` InvoiceLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InvoiceLines.
     */
    distinct?: InvoiceLineScalarFieldEnum | InvoiceLineScalarFieldEnum[]
  }

  /**
   * InvoiceLine create
   */
  export type InvoiceLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * The data needed to create a InvoiceLine.
     */
    data: XOR<InvoiceLineCreateInput, InvoiceLineUncheckedCreateInput>
  }

  /**
   * InvoiceLine createMany
   */
  export type InvoiceLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many InvoiceLines.
     */
    data: InvoiceLineCreateManyInput | InvoiceLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * InvoiceLine createManyAndReturn
   */
  export type InvoiceLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * The data used to create many InvoiceLines.
     */
    data: InvoiceLineCreateManyInput | InvoiceLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * InvoiceLine update
   */
  export type InvoiceLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * The data needed to update a InvoiceLine.
     */
    data: XOR<InvoiceLineUpdateInput, InvoiceLineUncheckedUpdateInput>
    /**
     * Choose, which InvoiceLine to update.
     */
    where: InvoiceLineWhereUniqueInput
  }

  /**
   * InvoiceLine updateMany
   */
  export type InvoiceLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update InvoiceLines.
     */
    data: XOR<InvoiceLineUpdateManyMutationInput, InvoiceLineUncheckedUpdateManyInput>
    /**
     * Filter which InvoiceLines to update
     */
    where?: InvoiceLineWhereInput
    /**
     * Limit how many InvoiceLines to update.
     */
    limit?: number
  }

  /**
   * InvoiceLine updateManyAndReturn
   */
  export type InvoiceLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * The data used to update InvoiceLines.
     */
    data: XOR<InvoiceLineUpdateManyMutationInput, InvoiceLineUncheckedUpdateManyInput>
    /**
     * Filter which InvoiceLines to update
     */
    where?: InvoiceLineWhereInput
    /**
     * Limit how many InvoiceLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * InvoiceLine upsert
   */
  export type InvoiceLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * The filter to search for the InvoiceLine to update in case it exists.
     */
    where: InvoiceLineWhereUniqueInput
    /**
     * In case the InvoiceLine found by the `where` argument doesn't exist, create a new InvoiceLine with this data.
     */
    create: XOR<InvoiceLineCreateInput, InvoiceLineUncheckedCreateInput>
    /**
     * In case the InvoiceLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<InvoiceLineUpdateInput, InvoiceLineUncheckedUpdateInput>
  }

  /**
   * InvoiceLine delete
   */
  export type InvoiceLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
    /**
     * Filter which InvoiceLine to delete.
     */
    where: InvoiceLineWhereUniqueInput
  }

  /**
   * InvoiceLine deleteMany
   */
  export type InvoiceLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InvoiceLines to delete
     */
    where?: InvoiceLineWhereInput
    /**
     * Limit how many InvoiceLines to delete.
     */
    limit?: number
  }

  /**
   * InvoiceLine without action
   */
  export type InvoiceLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InvoiceLine
     */
    select?: InvoiceLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InvoiceLine
     */
    omit?: InvoiceLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InvoiceLineInclude<ExtArgs> | null
  }


  /**
   * Model InventoryAdjustment
   */

  export type AggregateInventoryAdjustment = {
    _count: InventoryAdjustmentCountAggregateOutputType | null
    _min: InventoryAdjustmentMinAggregateOutputType | null
    _max: InventoryAdjustmentMaxAggregateOutputType | null
  }

  export type InventoryAdjustmentMinAggregateOutputType = {
    id: string | null
    reference: string | null
    warehouseId: string | null
    branchId: string | null
    type: string | null
    reason: string | null
    notes: string | null
    status: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type InventoryAdjustmentMaxAggregateOutputType = {
    id: string | null
    reference: string | null
    warehouseId: string | null
    branchId: string | null
    type: string | null
    reason: string | null
    notes: string | null
    status: string | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type InventoryAdjustmentCountAggregateOutputType = {
    id: number
    reference: number
    warehouseId: number
    branchId: number
    type: number
    reason: number
    notes: number
    status: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type InventoryAdjustmentMinAggregateInputType = {
    id?: true
    reference?: true
    warehouseId?: true
    branchId?: true
    type?: true
    reason?: true
    notes?: true
    status?: true
    createdAt?: true
    updatedAt?: true
  }

  export type InventoryAdjustmentMaxAggregateInputType = {
    id?: true
    reference?: true
    warehouseId?: true
    branchId?: true
    type?: true
    reason?: true
    notes?: true
    status?: true
    createdAt?: true
    updatedAt?: true
  }

  export type InventoryAdjustmentCountAggregateInputType = {
    id?: true
    reference?: true
    warehouseId?: true
    branchId?: true
    type?: true
    reason?: true
    notes?: true
    status?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type InventoryAdjustmentAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryAdjustment to aggregate.
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustments to fetch.
     */
    orderBy?: InventoryAdjustmentOrderByWithRelationInput | InventoryAdjustmentOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: InventoryAdjustmentWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustments 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` InventoryAdjustments.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned InventoryAdjustments
    **/
    _count?: true | InventoryAdjustmentCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: InventoryAdjustmentMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: InventoryAdjustmentMaxAggregateInputType
  }

  export type GetInventoryAdjustmentAggregateType<T extends InventoryAdjustmentAggregateArgs> = {
        [P in keyof T & keyof AggregateInventoryAdjustment]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateInventoryAdjustment[P]>
      : GetScalarType<T[P], AggregateInventoryAdjustment[P]>
  }




  export type InventoryAdjustmentGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryAdjustmentWhereInput
    orderBy?: InventoryAdjustmentOrderByWithAggregationInput | InventoryAdjustmentOrderByWithAggregationInput[]
    by: InventoryAdjustmentScalarFieldEnum[] | InventoryAdjustmentScalarFieldEnum
    having?: InventoryAdjustmentScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: InventoryAdjustmentCountAggregateInputType | true
    _min?: InventoryAdjustmentMinAggregateInputType
    _max?: InventoryAdjustmentMaxAggregateInputType
  }

  export type InventoryAdjustmentGroupByOutputType = {
    id: string
    reference: string | null
    warehouseId: string
    branchId: string | null
    type: string
    reason: string | null
    notes: string | null
    status: string
    createdAt: Date
    updatedAt: Date
    _count: InventoryAdjustmentCountAggregateOutputType | null
    _min: InventoryAdjustmentMinAggregateOutputType | null
    _max: InventoryAdjustmentMaxAggregateOutputType | null
  }

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


  export type InventoryAdjustmentSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    warehouseId?: boolean
    branchId?: boolean
    type?: boolean
    reason?: boolean
    notes?: boolean
    status?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryAdjustment$branchArgs<ExtArgs>
    lines?: boolean | InventoryAdjustment$linesArgs<ExtArgs>
    _count?: boolean | InventoryAdjustmentCountOutputTypeDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryAdjustment"]>

  export type InventoryAdjustmentSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    warehouseId?: boolean
    branchId?: boolean
    type?: boolean
    reason?: boolean
    notes?: boolean
    status?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryAdjustment$branchArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryAdjustment"]>

  export type InventoryAdjustmentSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    reference?: boolean
    warehouseId?: boolean
    branchId?: boolean
    type?: boolean
    reason?: boolean
    notes?: boolean
    status?: boolean
    createdAt?: boolean
    updatedAt?: boolean
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryAdjustment$branchArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryAdjustment"]>

  export type InventoryAdjustmentSelectScalar = {
    id?: boolean
    reference?: boolean
    warehouseId?: boolean
    branchId?: boolean
    type?: boolean
    reason?: boolean
    notes?: boolean
    status?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type InventoryAdjustmentOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "reference" | "warehouseId" | "branchId" | "type" | "reason" | "notes" | "status" | "createdAt" | "updatedAt", ExtArgs["result"]["inventoryAdjustment"]>
  export type InventoryAdjustmentInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryAdjustment$branchArgs<ExtArgs>
    lines?: boolean | InventoryAdjustment$linesArgs<ExtArgs>
    _count?: boolean | InventoryAdjustmentCountOutputTypeDefaultArgs<ExtArgs>
  }
  export type InventoryAdjustmentIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryAdjustment$branchArgs<ExtArgs>
  }
  export type InventoryAdjustmentIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    warehouse?: boolean | WarehouseDefaultArgs<ExtArgs>
    branch?: boolean | InventoryAdjustment$branchArgs<ExtArgs>
  }

  export type $InventoryAdjustmentPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "InventoryAdjustment"
    objects: {
      warehouse: Prisma.$WarehousePayload<ExtArgs>
      branch: Prisma.$BranchPayload<ExtArgs> | null
      lines: Prisma.$InventoryAdjustmentLinePayload<ExtArgs>[]
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      reference: string | null
      warehouseId: string
      branchId: string | null
      type: string
      reason: string | null
      notes: string | null
      status: string
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["inventoryAdjustment"]>
    composites: {}
  }

  type InventoryAdjustmentGetPayload<S extends boolean | null | undefined | InventoryAdjustmentDefaultArgs> = $Result.GetResult<Prisma.$InventoryAdjustmentPayload, S>

  type InventoryAdjustmentCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<InventoryAdjustmentFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: InventoryAdjustmentCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a InventoryAdjustment.
     * @param {InventoryAdjustmentCreateArgs} args - Arguments to create a InventoryAdjustment.
     * @example
     * // Create one InventoryAdjustment
     * const InventoryAdjustment = await prisma.inventoryAdjustment.create({
     *   data: {
     *     // ... data to create a InventoryAdjustment
     *   }
     * })
     * 
     */
    create<T extends InventoryAdjustmentCreateArgs>(args: SelectSubset<T, InventoryAdjustmentCreateArgs<ExtArgs>>): Prisma__InventoryAdjustmentClient<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many InventoryAdjustments and returns the data saved in the database.
     * @param {InventoryAdjustmentCreateManyAndReturnArgs} args - Arguments to create many InventoryAdjustments.
     * @example
     * // Create many InventoryAdjustments
     * const inventoryAdjustment = await prisma.inventoryAdjustment.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many InventoryAdjustments and only return the `id`
     * const inventoryAdjustmentWithIdOnly = await prisma.inventoryAdjustment.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends InventoryAdjustmentCreateManyAndReturnArgs>(args?: SelectSubset<T, InventoryAdjustmentCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a InventoryAdjustment.
     * @param {InventoryAdjustmentDeleteArgs} args - Arguments to delete one InventoryAdjustment.
     * @example
     * // Delete one InventoryAdjustment
     * const InventoryAdjustment = await prisma.inventoryAdjustment.delete({
     *   where: {
     *     // ... filter to delete one InventoryAdjustment
     *   }
     * })
     * 
     */
    delete<T extends InventoryAdjustmentDeleteArgs>(args: SelectSubset<T, InventoryAdjustmentDeleteArgs<ExtArgs>>): Prisma__InventoryAdjustmentClient<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one InventoryAdjustment.
     * @param {InventoryAdjustmentUpdateArgs} args - Arguments to update one InventoryAdjustment.
     * @example
     * // Update one InventoryAdjustment
     * const inventoryAdjustment = await prisma.inventoryAdjustment.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends InventoryAdjustmentUpdateArgs>(args: SelectSubset<T, InventoryAdjustmentUpdateArgs<ExtArgs>>): Prisma__InventoryAdjustmentClient<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more InventoryAdjustments and returns the data updated in the database.
     * @param {InventoryAdjustmentUpdateManyAndReturnArgs} args - Arguments to update many InventoryAdjustments.
     * @example
     * // Update many InventoryAdjustments
     * const inventoryAdjustment = await prisma.inventoryAdjustment.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more InventoryAdjustments and only return the `id`
     * const inventoryAdjustmentWithIdOnly = await prisma.inventoryAdjustment.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends InventoryAdjustmentUpdateManyAndReturnArgs>(args: SelectSubset<T, InventoryAdjustmentUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a InventoryAdjustment.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryAdjustmentAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends InventoryAdjustmentAggregateArgs>(args: Subset<T, InventoryAdjustmentAggregateArgs>): Prisma.PrismaPromise<GetInventoryAdjustmentAggregateType<T>>

    /**
     * Group by InventoryAdjustment.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryAdjustmentGroupByArgs} 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 InventoryAdjustmentGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: InventoryAdjustmentGroupByArgs['orderBy'] }
        : { orderBy?: InventoryAdjustmentGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, InventoryAdjustmentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetInventoryAdjustmentGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the InventoryAdjustment model
   */
  readonly fields: InventoryAdjustmentFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for InventoryAdjustment.
   * 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__InventoryAdjustmentClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    warehouse<T extends WarehouseDefaultArgs<ExtArgs> = {}>(args?: Subset<T, WarehouseDefaultArgs<ExtArgs>>): Prisma__WarehouseClient<$Result.GetResult<Prisma.$WarehousePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    branch<T extends InventoryAdjustment$branchArgs<ExtArgs> = {}>(args?: Subset<T, InventoryAdjustment$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    lines<T extends InventoryAdjustment$linesArgs<ExtArgs> = {}>(args?: Subset<T, InventoryAdjustment$linesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the InventoryAdjustment model
   */
  interface InventoryAdjustmentFieldRefs {
    readonly id: FieldRef<"InventoryAdjustment", 'String'>
    readonly reference: FieldRef<"InventoryAdjustment", 'String'>
    readonly warehouseId: FieldRef<"InventoryAdjustment", 'String'>
    readonly branchId: FieldRef<"InventoryAdjustment", 'String'>
    readonly type: FieldRef<"InventoryAdjustment", 'String'>
    readonly reason: FieldRef<"InventoryAdjustment", 'String'>
    readonly notes: FieldRef<"InventoryAdjustment", 'String'>
    readonly status: FieldRef<"InventoryAdjustment", 'String'>
    readonly createdAt: FieldRef<"InventoryAdjustment", 'DateTime'>
    readonly updatedAt: FieldRef<"InventoryAdjustment", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * InventoryAdjustment findUnique
   */
  export type InventoryAdjustmentFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustment to fetch.
     */
    where: InventoryAdjustmentWhereUniqueInput
  }

  /**
   * InventoryAdjustment findUniqueOrThrow
   */
  export type InventoryAdjustmentFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustment to fetch.
     */
    where: InventoryAdjustmentWhereUniqueInput
  }

  /**
   * InventoryAdjustment findFirst
   */
  export type InventoryAdjustmentFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustment to fetch.
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustments to fetch.
     */
    orderBy?: InventoryAdjustmentOrderByWithRelationInput | InventoryAdjustmentOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryAdjustments.
     */
    cursor?: InventoryAdjustmentWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustments 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` InventoryAdjustments.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryAdjustments.
     */
    distinct?: InventoryAdjustmentScalarFieldEnum | InventoryAdjustmentScalarFieldEnum[]
  }

  /**
   * InventoryAdjustment findFirstOrThrow
   */
  export type InventoryAdjustmentFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustment to fetch.
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustments to fetch.
     */
    orderBy?: InventoryAdjustmentOrderByWithRelationInput | InventoryAdjustmentOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryAdjustments.
     */
    cursor?: InventoryAdjustmentWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustments 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` InventoryAdjustments.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryAdjustments.
     */
    distinct?: InventoryAdjustmentScalarFieldEnum | InventoryAdjustmentScalarFieldEnum[]
  }

  /**
   * InventoryAdjustment findMany
   */
  export type InventoryAdjustmentFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustments to fetch.
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustments to fetch.
     */
    orderBy?: InventoryAdjustmentOrderByWithRelationInput | InventoryAdjustmentOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing InventoryAdjustments.
     */
    cursor?: InventoryAdjustmentWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustments 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` InventoryAdjustments.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryAdjustments.
     */
    distinct?: InventoryAdjustmentScalarFieldEnum | InventoryAdjustmentScalarFieldEnum[]
  }

  /**
   * InventoryAdjustment create
   */
  export type InventoryAdjustmentCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * The data needed to create a InventoryAdjustment.
     */
    data: XOR<InventoryAdjustmentCreateInput, InventoryAdjustmentUncheckedCreateInput>
  }

  /**
   * InventoryAdjustment createMany
   */
  export type InventoryAdjustmentCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many InventoryAdjustments.
     */
    data: InventoryAdjustmentCreateManyInput | InventoryAdjustmentCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * InventoryAdjustment createManyAndReturn
   */
  export type InventoryAdjustmentCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * The data used to create many InventoryAdjustments.
     */
    data: InventoryAdjustmentCreateManyInput | InventoryAdjustmentCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryAdjustment update
   */
  export type InventoryAdjustmentUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * The data needed to update a InventoryAdjustment.
     */
    data: XOR<InventoryAdjustmentUpdateInput, InventoryAdjustmentUncheckedUpdateInput>
    /**
     * Choose, which InventoryAdjustment to update.
     */
    where: InventoryAdjustmentWhereUniqueInput
  }

  /**
   * InventoryAdjustment updateMany
   */
  export type InventoryAdjustmentUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update InventoryAdjustments.
     */
    data: XOR<InventoryAdjustmentUpdateManyMutationInput, InventoryAdjustmentUncheckedUpdateManyInput>
    /**
     * Filter which InventoryAdjustments to update
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * Limit how many InventoryAdjustments to update.
     */
    limit?: number
  }

  /**
   * InventoryAdjustment updateManyAndReturn
   */
  export type InventoryAdjustmentUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * The data used to update InventoryAdjustments.
     */
    data: XOR<InventoryAdjustmentUpdateManyMutationInput, InventoryAdjustmentUncheckedUpdateManyInput>
    /**
     * Filter which InventoryAdjustments to update
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * Limit how many InventoryAdjustments to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryAdjustment upsert
   */
  export type InventoryAdjustmentUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * The filter to search for the InventoryAdjustment to update in case it exists.
     */
    where: InventoryAdjustmentWhereUniqueInput
    /**
     * In case the InventoryAdjustment found by the `where` argument doesn't exist, create a new InventoryAdjustment with this data.
     */
    create: XOR<InventoryAdjustmentCreateInput, InventoryAdjustmentUncheckedCreateInput>
    /**
     * In case the InventoryAdjustment was found with the provided `where` argument, update it with this data.
     */
    update: XOR<InventoryAdjustmentUpdateInput, InventoryAdjustmentUncheckedUpdateInput>
  }

  /**
   * InventoryAdjustment delete
   */
  export type InventoryAdjustmentDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
    /**
     * Filter which InventoryAdjustment to delete.
     */
    where: InventoryAdjustmentWhereUniqueInput
  }

  /**
   * InventoryAdjustment deleteMany
   */
  export type InventoryAdjustmentDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryAdjustments to delete
     */
    where?: InventoryAdjustmentWhereInput
    /**
     * Limit how many InventoryAdjustments to delete.
     */
    limit?: number
  }

  /**
   * InventoryAdjustment.branch
   */
  export type InventoryAdjustment$branchArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Branch
     */
    select?: BranchSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Branch
     */
    omit?: BranchOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: BranchInclude<ExtArgs> | null
    where?: BranchWhereInput
  }

  /**
   * InventoryAdjustment.lines
   */
  export type InventoryAdjustment$linesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    where?: InventoryAdjustmentLineWhereInput
    orderBy?: InventoryAdjustmentLineOrderByWithRelationInput | InventoryAdjustmentLineOrderByWithRelationInput[]
    cursor?: InventoryAdjustmentLineWhereUniqueInput
    take?: number
    skip?: number
    distinct?: InventoryAdjustmentLineScalarFieldEnum | InventoryAdjustmentLineScalarFieldEnum[]
  }

  /**
   * InventoryAdjustment without action
   */
  export type InventoryAdjustmentDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustment
     */
    select?: InventoryAdjustmentSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustment
     */
    omit?: InventoryAdjustmentOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentInclude<ExtArgs> | null
  }


  /**
   * Model InventoryAdjustmentLine
   */

  export type AggregateInventoryAdjustmentLine = {
    _count: InventoryAdjustmentLineCountAggregateOutputType | null
    _avg: InventoryAdjustmentLineAvgAggregateOutputType | null
    _sum: InventoryAdjustmentLineSumAggregateOutputType | null
    _min: InventoryAdjustmentLineMinAggregateOutputType | null
    _max: InventoryAdjustmentLineMaxAggregateOutputType | null
  }

  export type InventoryAdjustmentLineAvgAggregateOutputType = {
    quantity: number | null
  }

  export type InventoryAdjustmentLineSumAggregateOutputType = {
    quantity: number | null
  }

  export type InventoryAdjustmentLineMinAggregateOutputType = {
    id: string | null
    adjustmentId: string | null
    productId: string | null
    quantity: number | null
  }

  export type InventoryAdjustmentLineMaxAggregateOutputType = {
    id: string | null
    adjustmentId: string | null
    productId: string | null
    quantity: number | null
  }

  export type InventoryAdjustmentLineCountAggregateOutputType = {
    id: number
    adjustmentId: number
    productId: number
    quantity: number
    _all: number
  }


  export type InventoryAdjustmentLineAvgAggregateInputType = {
    quantity?: true
  }

  export type InventoryAdjustmentLineSumAggregateInputType = {
    quantity?: true
  }

  export type InventoryAdjustmentLineMinAggregateInputType = {
    id?: true
    adjustmentId?: true
    productId?: true
    quantity?: true
  }

  export type InventoryAdjustmentLineMaxAggregateInputType = {
    id?: true
    adjustmentId?: true
    productId?: true
    quantity?: true
  }

  export type InventoryAdjustmentLineCountAggregateInputType = {
    id?: true
    adjustmentId?: true
    productId?: true
    quantity?: true
    _all?: true
  }

  export type InventoryAdjustmentLineAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryAdjustmentLine to aggregate.
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustmentLines to fetch.
     */
    orderBy?: InventoryAdjustmentLineOrderByWithRelationInput | InventoryAdjustmentLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: InventoryAdjustmentLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustmentLines 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` InventoryAdjustmentLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned InventoryAdjustmentLines
    **/
    _count?: true | InventoryAdjustmentLineCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to average
    **/
    _avg?: InventoryAdjustmentLineAvgAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to sum
    **/
    _sum?: InventoryAdjustmentLineSumAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: InventoryAdjustmentLineMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: InventoryAdjustmentLineMaxAggregateInputType
  }

  export type GetInventoryAdjustmentLineAggregateType<T extends InventoryAdjustmentLineAggregateArgs> = {
        [P in keyof T & keyof AggregateInventoryAdjustmentLine]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateInventoryAdjustmentLine[P]>
      : GetScalarType<T[P], AggregateInventoryAdjustmentLine[P]>
  }




  export type InventoryAdjustmentLineGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: InventoryAdjustmentLineWhereInput
    orderBy?: InventoryAdjustmentLineOrderByWithAggregationInput | InventoryAdjustmentLineOrderByWithAggregationInput[]
    by: InventoryAdjustmentLineScalarFieldEnum[] | InventoryAdjustmentLineScalarFieldEnum
    having?: InventoryAdjustmentLineScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: InventoryAdjustmentLineCountAggregateInputType | true
    _avg?: InventoryAdjustmentLineAvgAggregateInputType
    _sum?: InventoryAdjustmentLineSumAggregateInputType
    _min?: InventoryAdjustmentLineMinAggregateInputType
    _max?: InventoryAdjustmentLineMaxAggregateInputType
  }

  export type InventoryAdjustmentLineGroupByOutputType = {
    id: string
    adjustmentId: string
    productId: string
    quantity: number
    _count: InventoryAdjustmentLineCountAggregateOutputType | null
    _avg: InventoryAdjustmentLineAvgAggregateOutputType | null
    _sum: InventoryAdjustmentLineSumAggregateOutputType | null
    _min: InventoryAdjustmentLineMinAggregateOutputType | null
    _max: InventoryAdjustmentLineMaxAggregateOutputType | null
  }

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


  export type InventoryAdjustmentLineSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    adjustmentId?: boolean
    productId?: boolean
    quantity?: boolean
    adjustment?: boolean | InventoryAdjustmentDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryAdjustmentLine"]>

  export type InventoryAdjustmentLineSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    adjustmentId?: boolean
    productId?: boolean
    quantity?: boolean
    adjustment?: boolean | InventoryAdjustmentDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryAdjustmentLine"]>

  export type InventoryAdjustmentLineSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    adjustmentId?: boolean
    productId?: boolean
    quantity?: boolean
    adjustment?: boolean | InventoryAdjustmentDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["inventoryAdjustmentLine"]>

  export type InventoryAdjustmentLineSelectScalar = {
    id?: boolean
    adjustmentId?: boolean
    productId?: boolean
    quantity?: boolean
  }

  export type InventoryAdjustmentLineOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "adjustmentId" | "productId" | "quantity", ExtArgs["result"]["inventoryAdjustmentLine"]>
  export type InventoryAdjustmentLineInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    adjustment?: boolean | InventoryAdjustmentDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type InventoryAdjustmentLineIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    adjustment?: boolean | InventoryAdjustmentDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }
  export type InventoryAdjustmentLineIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    adjustment?: boolean | InventoryAdjustmentDefaultArgs<ExtArgs>
    product?: boolean | ProductDefaultArgs<ExtArgs>
  }

  export type $InventoryAdjustmentLinePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "InventoryAdjustmentLine"
    objects: {
      adjustment: Prisma.$InventoryAdjustmentPayload<ExtArgs>
      product: Prisma.$ProductPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      adjustmentId: string
      productId: string
      quantity: number
    }, ExtArgs["result"]["inventoryAdjustmentLine"]>
    composites: {}
  }

  type InventoryAdjustmentLineGetPayload<S extends boolean | null | undefined | InventoryAdjustmentLineDefaultArgs> = $Result.GetResult<Prisma.$InventoryAdjustmentLinePayload, S>

  type InventoryAdjustmentLineCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<InventoryAdjustmentLineFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: InventoryAdjustmentLineCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a InventoryAdjustmentLine.
     * @param {InventoryAdjustmentLineCreateArgs} args - Arguments to create a InventoryAdjustmentLine.
     * @example
     * // Create one InventoryAdjustmentLine
     * const InventoryAdjustmentLine = await prisma.inventoryAdjustmentLine.create({
     *   data: {
     *     // ... data to create a InventoryAdjustmentLine
     *   }
     * })
     * 
     */
    create<T extends InventoryAdjustmentLineCreateArgs>(args: SelectSubset<T, InventoryAdjustmentLineCreateArgs<ExtArgs>>): Prisma__InventoryAdjustmentLineClient<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many InventoryAdjustmentLines and returns the data saved in the database.
     * @param {InventoryAdjustmentLineCreateManyAndReturnArgs} args - Arguments to create many InventoryAdjustmentLines.
     * @example
     * // Create many InventoryAdjustmentLines
     * const inventoryAdjustmentLine = await prisma.inventoryAdjustmentLine.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many InventoryAdjustmentLines and only return the `id`
     * const inventoryAdjustmentLineWithIdOnly = await prisma.inventoryAdjustmentLine.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends InventoryAdjustmentLineCreateManyAndReturnArgs>(args?: SelectSubset<T, InventoryAdjustmentLineCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a InventoryAdjustmentLine.
     * @param {InventoryAdjustmentLineDeleteArgs} args - Arguments to delete one InventoryAdjustmentLine.
     * @example
     * // Delete one InventoryAdjustmentLine
     * const InventoryAdjustmentLine = await prisma.inventoryAdjustmentLine.delete({
     *   where: {
     *     // ... filter to delete one InventoryAdjustmentLine
     *   }
     * })
     * 
     */
    delete<T extends InventoryAdjustmentLineDeleteArgs>(args: SelectSubset<T, InventoryAdjustmentLineDeleteArgs<ExtArgs>>): Prisma__InventoryAdjustmentLineClient<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one InventoryAdjustmentLine.
     * @param {InventoryAdjustmentLineUpdateArgs} args - Arguments to update one InventoryAdjustmentLine.
     * @example
     * // Update one InventoryAdjustmentLine
     * const inventoryAdjustmentLine = await prisma.inventoryAdjustmentLine.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends InventoryAdjustmentLineUpdateArgs>(args: SelectSubset<T, InventoryAdjustmentLineUpdateArgs<ExtArgs>>): Prisma__InventoryAdjustmentLineClient<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more InventoryAdjustmentLines and returns the data updated in the database.
     * @param {InventoryAdjustmentLineUpdateManyAndReturnArgs} args - Arguments to update many InventoryAdjustmentLines.
     * @example
     * // Update many InventoryAdjustmentLines
     * const inventoryAdjustmentLine = await prisma.inventoryAdjustmentLine.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more InventoryAdjustmentLines and only return the `id`
     * const inventoryAdjustmentLineWithIdOnly = await prisma.inventoryAdjustmentLine.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends InventoryAdjustmentLineUpdateManyAndReturnArgs>(args: SelectSubset<T, InventoryAdjustmentLineUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$InventoryAdjustmentLinePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a InventoryAdjustmentLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryAdjustmentLineAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends InventoryAdjustmentLineAggregateArgs>(args: Subset<T, InventoryAdjustmentLineAggregateArgs>): Prisma.PrismaPromise<GetInventoryAdjustmentLineAggregateType<T>>

    /**
     * Group by InventoryAdjustmentLine.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {InventoryAdjustmentLineGroupByArgs} 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 InventoryAdjustmentLineGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: InventoryAdjustmentLineGroupByArgs['orderBy'] }
        : { orderBy?: InventoryAdjustmentLineGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, InventoryAdjustmentLineGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetInventoryAdjustmentLineGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the InventoryAdjustmentLine model
   */
  readonly fields: InventoryAdjustmentLineFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for InventoryAdjustmentLine.
   * 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__InventoryAdjustmentLineClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    adjustment<T extends InventoryAdjustmentDefaultArgs<ExtArgs> = {}>(args?: Subset<T, InventoryAdjustmentDefaultArgs<ExtArgs>>): Prisma__InventoryAdjustmentClient<$Result.GetResult<Prisma.$InventoryAdjustmentPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the InventoryAdjustmentLine model
   */
  interface InventoryAdjustmentLineFieldRefs {
    readonly id: FieldRef<"InventoryAdjustmentLine", 'String'>
    readonly adjustmentId: FieldRef<"InventoryAdjustmentLine", 'String'>
    readonly productId: FieldRef<"InventoryAdjustmentLine", 'String'>
    readonly quantity: FieldRef<"InventoryAdjustmentLine", 'Int'>
  }
    

  // Custom InputTypes
  /**
   * InventoryAdjustmentLine findUnique
   */
  export type InventoryAdjustmentLineFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustmentLine to fetch.
     */
    where: InventoryAdjustmentLineWhereUniqueInput
  }

  /**
   * InventoryAdjustmentLine findUniqueOrThrow
   */
  export type InventoryAdjustmentLineFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustmentLine to fetch.
     */
    where: InventoryAdjustmentLineWhereUniqueInput
  }

  /**
   * InventoryAdjustmentLine findFirst
   */
  export type InventoryAdjustmentLineFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustmentLine to fetch.
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustmentLines to fetch.
     */
    orderBy?: InventoryAdjustmentLineOrderByWithRelationInput | InventoryAdjustmentLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryAdjustmentLines.
     */
    cursor?: InventoryAdjustmentLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustmentLines 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` InventoryAdjustmentLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryAdjustmentLines.
     */
    distinct?: InventoryAdjustmentLineScalarFieldEnum | InventoryAdjustmentLineScalarFieldEnum[]
  }

  /**
   * InventoryAdjustmentLine findFirstOrThrow
   */
  export type InventoryAdjustmentLineFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustmentLine to fetch.
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustmentLines to fetch.
     */
    orderBy?: InventoryAdjustmentLineOrderByWithRelationInput | InventoryAdjustmentLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for InventoryAdjustmentLines.
     */
    cursor?: InventoryAdjustmentLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustmentLines 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` InventoryAdjustmentLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryAdjustmentLines.
     */
    distinct?: InventoryAdjustmentLineScalarFieldEnum | InventoryAdjustmentLineScalarFieldEnum[]
  }

  /**
   * InventoryAdjustmentLine findMany
   */
  export type InventoryAdjustmentLineFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * Filter, which InventoryAdjustmentLines to fetch.
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of InventoryAdjustmentLines to fetch.
     */
    orderBy?: InventoryAdjustmentLineOrderByWithRelationInput | InventoryAdjustmentLineOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing InventoryAdjustmentLines.
     */
    cursor?: InventoryAdjustmentLineWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` InventoryAdjustmentLines 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` InventoryAdjustmentLines.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of InventoryAdjustmentLines.
     */
    distinct?: InventoryAdjustmentLineScalarFieldEnum | InventoryAdjustmentLineScalarFieldEnum[]
  }

  /**
   * InventoryAdjustmentLine create
   */
  export type InventoryAdjustmentLineCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * The data needed to create a InventoryAdjustmentLine.
     */
    data: XOR<InventoryAdjustmentLineCreateInput, InventoryAdjustmentLineUncheckedCreateInput>
  }

  /**
   * InventoryAdjustmentLine createMany
   */
  export type InventoryAdjustmentLineCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many InventoryAdjustmentLines.
     */
    data: InventoryAdjustmentLineCreateManyInput | InventoryAdjustmentLineCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * InventoryAdjustmentLine createManyAndReturn
   */
  export type InventoryAdjustmentLineCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * The data used to create many InventoryAdjustmentLines.
     */
    data: InventoryAdjustmentLineCreateManyInput | InventoryAdjustmentLineCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryAdjustmentLine update
   */
  export type InventoryAdjustmentLineUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * The data needed to update a InventoryAdjustmentLine.
     */
    data: XOR<InventoryAdjustmentLineUpdateInput, InventoryAdjustmentLineUncheckedUpdateInput>
    /**
     * Choose, which InventoryAdjustmentLine to update.
     */
    where: InventoryAdjustmentLineWhereUniqueInput
  }

  /**
   * InventoryAdjustmentLine updateMany
   */
  export type InventoryAdjustmentLineUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update InventoryAdjustmentLines.
     */
    data: XOR<InventoryAdjustmentLineUpdateManyMutationInput, InventoryAdjustmentLineUncheckedUpdateManyInput>
    /**
     * Filter which InventoryAdjustmentLines to update
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * Limit how many InventoryAdjustmentLines to update.
     */
    limit?: number
  }

  /**
   * InventoryAdjustmentLine updateManyAndReturn
   */
  export type InventoryAdjustmentLineUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * The data used to update InventoryAdjustmentLines.
     */
    data: XOR<InventoryAdjustmentLineUpdateManyMutationInput, InventoryAdjustmentLineUncheckedUpdateManyInput>
    /**
     * Filter which InventoryAdjustmentLines to update
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * Limit how many InventoryAdjustmentLines to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * InventoryAdjustmentLine upsert
   */
  export type InventoryAdjustmentLineUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * The filter to search for the InventoryAdjustmentLine to update in case it exists.
     */
    where: InventoryAdjustmentLineWhereUniqueInput
    /**
     * In case the InventoryAdjustmentLine found by the `where` argument doesn't exist, create a new InventoryAdjustmentLine with this data.
     */
    create: XOR<InventoryAdjustmentLineCreateInput, InventoryAdjustmentLineUncheckedCreateInput>
    /**
     * In case the InventoryAdjustmentLine was found with the provided `where` argument, update it with this data.
     */
    update: XOR<InventoryAdjustmentLineUpdateInput, InventoryAdjustmentLineUncheckedUpdateInput>
  }

  /**
   * InventoryAdjustmentLine delete
   */
  export type InventoryAdjustmentLineDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
    /**
     * Filter which InventoryAdjustmentLine to delete.
     */
    where: InventoryAdjustmentLineWhereUniqueInput
  }

  /**
   * InventoryAdjustmentLine deleteMany
   */
  export type InventoryAdjustmentLineDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which InventoryAdjustmentLines to delete
     */
    where?: InventoryAdjustmentLineWhereInput
    /**
     * Limit how many InventoryAdjustmentLines to delete.
     */
    limit?: number
  }

  /**
   * InventoryAdjustmentLine without action
   */
  export type InventoryAdjustmentLineDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the InventoryAdjustmentLine
     */
    select?: InventoryAdjustmentLineSelect<ExtArgs> | null
    /**
     * Omit specific fields from the InventoryAdjustmentLine
     */
    omit?: InventoryAdjustmentLineOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: InventoryAdjustmentLineInclude<ExtArgs> | null
  }


  /**
   * Model EmailTemplate
   */

  export type AggregateEmailTemplate = {
    _count: EmailTemplateCountAggregateOutputType | null
    _min: EmailTemplateMinAggregateOutputType | null
    _max: EmailTemplateMaxAggregateOutputType | null
  }

  export type EmailTemplateMinAggregateOutputType = {
    id: string | null
    name: string | null
    subject: string | null
    body: string | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type EmailTemplateMaxAggregateOutputType = {
    id: string | null
    name: string | null
    subject: string | null
    body: string | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type EmailTemplateCountAggregateOutputType = {
    id: number
    name: number
    subject: number
    body: number
    variables: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type EmailTemplateMinAggregateInputType = {
    id?: true
    name?: true
    subject?: true
    body?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type EmailTemplateMaxAggregateInputType = {
    id?: true
    name?: true
    subject?: true
    body?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type EmailTemplateCountAggregateInputType = {
    id?: true
    name?: true
    subject?: true
    body?: true
    variables?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type EmailTemplateAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which EmailTemplate to aggregate.
     */
    where?: EmailTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of EmailTemplates to fetch.
     */
    orderBy?: EmailTemplateOrderByWithRelationInput | EmailTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: EmailTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` EmailTemplates 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` EmailTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned EmailTemplates
    **/
    _count?: true | EmailTemplateCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: EmailTemplateMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: EmailTemplateMaxAggregateInputType
  }

  export type GetEmailTemplateAggregateType<T extends EmailTemplateAggregateArgs> = {
        [P in keyof T & keyof AggregateEmailTemplate]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateEmailTemplate[P]>
      : GetScalarType<T[P], AggregateEmailTemplate[P]>
  }




  export type EmailTemplateGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: EmailTemplateWhereInput
    orderBy?: EmailTemplateOrderByWithAggregationInput | EmailTemplateOrderByWithAggregationInput[]
    by: EmailTemplateScalarFieldEnum[] | EmailTemplateScalarFieldEnum
    having?: EmailTemplateScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: EmailTemplateCountAggregateInputType | true
    _min?: EmailTemplateMinAggregateInputType
    _max?: EmailTemplateMaxAggregateInputType
  }

  export type EmailTemplateGroupByOutputType = {
    id: string
    name: string
    subject: string
    body: string
    variables: JsonValue | null
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: EmailTemplateCountAggregateOutputType | null
    _min: EmailTemplateMinAggregateOutputType | null
    _max: EmailTemplateMaxAggregateOutputType | null
  }

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


  export type EmailTemplateSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    subject?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["emailTemplate"]>

  export type EmailTemplateSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    subject?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["emailTemplate"]>

  export type EmailTemplateSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    subject?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["emailTemplate"]>

  export type EmailTemplateSelectScalar = {
    id?: boolean
    name?: boolean
    subject?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type EmailTemplateOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "subject" | "body" | "variables" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["emailTemplate"]>

  export type $EmailTemplatePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "EmailTemplate"
    objects: {}
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      subject: string
      body: string
      variables: Prisma.JsonValue | null
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["emailTemplate"]>
    composites: {}
  }

  type EmailTemplateGetPayload<S extends boolean | null | undefined | EmailTemplateDefaultArgs> = $Result.GetResult<Prisma.$EmailTemplatePayload, S>

  type EmailTemplateCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<EmailTemplateFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: EmailTemplateCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a EmailTemplate.
     * @param {EmailTemplateCreateArgs} args - Arguments to create a EmailTemplate.
     * @example
     * // Create one EmailTemplate
     * const EmailTemplate = await prisma.emailTemplate.create({
     *   data: {
     *     // ... data to create a EmailTemplate
     *   }
     * })
     * 
     */
    create<T extends EmailTemplateCreateArgs>(args: SelectSubset<T, EmailTemplateCreateArgs<ExtArgs>>): Prisma__EmailTemplateClient<$Result.GetResult<Prisma.$EmailTemplatePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many EmailTemplates and returns the data saved in the database.
     * @param {EmailTemplateCreateManyAndReturnArgs} args - Arguments to create many EmailTemplates.
     * @example
     * // Create many EmailTemplates
     * const emailTemplate = await prisma.emailTemplate.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many EmailTemplates and only return the `id`
     * const emailTemplateWithIdOnly = await prisma.emailTemplate.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends EmailTemplateCreateManyAndReturnArgs>(args?: SelectSubset<T, EmailTemplateCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$EmailTemplatePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a EmailTemplate.
     * @param {EmailTemplateDeleteArgs} args - Arguments to delete one EmailTemplate.
     * @example
     * // Delete one EmailTemplate
     * const EmailTemplate = await prisma.emailTemplate.delete({
     *   where: {
     *     // ... filter to delete one EmailTemplate
     *   }
     * })
     * 
     */
    delete<T extends EmailTemplateDeleteArgs>(args: SelectSubset<T, EmailTemplateDeleteArgs<ExtArgs>>): Prisma__EmailTemplateClient<$Result.GetResult<Prisma.$EmailTemplatePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one EmailTemplate.
     * @param {EmailTemplateUpdateArgs} args - Arguments to update one EmailTemplate.
     * @example
     * // Update one EmailTemplate
     * const emailTemplate = await prisma.emailTemplate.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends EmailTemplateUpdateArgs>(args: SelectSubset<T, EmailTemplateUpdateArgs<ExtArgs>>): Prisma__EmailTemplateClient<$Result.GetResult<Prisma.$EmailTemplatePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more EmailTemplates and returns the data updated in the database.
     * @param {EmailTemplateUpdateManyAndReturnArgs} args - Arguments to update many EmailTemplates.
     * @example
     * // Update many EmailTemplates
     * const emailTemplate = await prisma.emailTemplate.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more EmailTemplates and only return the `id`
     * const emailTemplateWithIdOnly = await prisma.emailTemplate.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends EmailTemplateUpdateManyAndReturnArgs>(args: SelectSubset<T, EmailTemplateUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$EmailTemplatePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a EmailTemplate.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {EmailTemplateAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends EmailTemplateAggregateArgs>(args: Subset<T, EmailTemplateAggregateArgs>): Prisma.PrismaPromise<GetEmailTemplateAggregateType<T>>

    /**
     * Group by EmailTemplate.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {EmailTemplateGroupByArgs} 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 EmailTemplateGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: EmailTemplateGroupByArgs['orderBy'] }
        : { orderBy?: EmailTemplateGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, EmailTemplateGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetEmailTemplateGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the EmailTemplate model
   */
  readonly fields: EmailTemplateFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for EmailTemplate.
   * 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__EmailTemplateClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the EmailTemplate model
   */
  interface EmailTemplateFieldRefs {
    readonly id: FieldRef<"EmailTemplate", 'String'>
    readonly name: FieldRef<"EmailTemplate", 'String'>
    readonly subject: FieldRef<"EmailTemplate", 'String'>
    readonly body: FieldRef<"EmailTemplate", 'String'>
    readonly variables: FieldRef<"EmailTemplate", 'Json'>
    readonly isActive: FieldRef<"EmailTemplate", 'Boolean'>
    readonly createdAt: FieldRef<"EmailTemplate", 'DateTime'>
    readonly updatedAt: FieldRef<"EmailTemplate", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * EmailTemplate findUnique
   */
  export type EmailTemplateFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * Filter, which EmailTemplate to fetch.
     */
    where: EmailTemplateWhereUniqueInput
  }

  /**
   * EmailTemplate findUniqueOrThrow
   */
  export type EmailTemplateFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * Filter, which EmailTemplate to fetch.
     */
    where: EmailTemplateWhereUniqueInput
  }

  /**
   * EmailTemplate findFirst
   */
  export type EmailTemplateFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * Filter, which EmailTemplate to fetch.
     */
    where?: EmailTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of EmailTemplates to fetch.
     */
    orderBy?: EmailTemplateOrderByWithRelationInput | EmailTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for EmailTemplates.
     */
    cursor?: EmailTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` EmailTemplates 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` EmailTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of EmailTemplates.
     */
    distinct?: EmailTemplateScalarFieldEnum | EmailTemplateScalarFieldEnum[]
  }

  /**
   * EmailTemplate findFirstOrThrow
   */
  export type EmailTemplateFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * Filter, which EmailTemplate to fetch.
     */
    where?: EmailTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of EmailTemplates to fetch.
     */
    orderBy?: EmailTemplateOrderByWithRelationInput | EmailTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for EmailTemplates.
     */
    cursor?: EmailTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` EmailTemplates 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` EmailTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of EmailTemplates.
     */
    distinct?: EmailTemplateScalarFieldEnum | EmailTemplateScalarFieldEnum[]
  }

  /**
   * EmailTemplate findMany
   */
  export type EmailTemplateFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * Filter, which EmailTemplates to fetch.
     */
    where?: EmailTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of EmailTemplates to fetch.
     */
    orderBy?: EmailTemplateOrderByWithRelationInput | EmailTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing EmailTemplates.
     */
    cursor?: EmailTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` EmailTemplates 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` EmailTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of EmailTemplates.
     */
    distinct?: EmailTemplateScalarFieldEnum | EmailTemplateScalarFieldEnum[]
  }

  /**
   * EmailTemplate create
   */
  export type EmailTemplateCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * The data needed to create a EmailTemplate.
     */
    data: XOR<EmailTemplateCreateInput, EmailTemplateUncheckedCreateInput>
  }

  /**
   * EmailTemplate createMany
   */
  export type EmailTemplateCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many EmailTemplates.
     */
    data: EmailTemplateCreateManyInput | EmailTemplateCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * EmailTemplate createManyAndReturn
   */
  export type EmailTemplateCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * The data used to create many EmailTemplates.
     */
    data: EmailTemplateCreateManyInput | EmailTemplateCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * EmailTemplate update
   */
  export type EmailTemplateUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * The data needed to update a EmailTemplate.
     */
    data: XOR<EmailTemplateUpdateInput, EmailTemplateUncheckedUpdateInput>
    /**
     * Choose, which EmailTemplate to update.
     */
    where: EmailTemplateWhereUniqueInput
  }

  /**
   * EmailTemplate updateMany
   */
  export type EmailTemplateUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update EmailTemplates.
     */
    data: XOR<EmailTemplateUpdateManyMutationInput, EmailTemplateUncheckedUpdateManyInput>
    /**
     * Filter which EmailTemplates to update
     */
    where?: EmailTemplateWhereInput
    /**
     * Limit how many EmailTemplates to update.
     */
    limit?: number
  }

  /**
   * EmailTemplate updateManyAndReturn
   */
  export type EmailTemplateUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * The data used to update EmailTemplates.
     */
    data: XOR<EmailTemplateUpdateManyMutationInput, EmailTemplateUncheckedUpdateManyInput>
    /**
     * Filter which EmailTemplates to update
     */
    where?: EmailTemplateWhereInput
    /**
     * Limit how many EmailTemplates to update.
     */
    limit?: number
  }

  /**
   * EmailTemplate upsert
   */
  export type EmailTemplateUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * The filter to search for the EmailTemplate to update in case it exists.
     */
    where: EmailTemplateWhereUniqueInput
    /**
     * In case the EmailTemplate found by the `where` argument doesn't exist, create a new EmailTemplate with this data.
     */
    create: XOR<EmailTemplateCreateInput, EmailTemplateUncheckedCreateInput>
    /**
     * In case the EmailTemplate was found with the provided `where` argument, update it with this data.
     */
    update: XOR<EmailTemplateUpdateInput, EmailTemplateUncheckedUpdateInput>
  }

  /**
   * EmailTemplate delete
   */
  export type EmailTemplateDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
    /**
     * Filter which EmailTemplate to delete.
     */
    where: EmailTemplateWhereUniqueInput
  }

  /**
   * EmailTemplate deleteMany
   */
  export type EmailTemplateDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which EmailTemplates to delete
     */
    where?: EmailTemplateWhereInput
    /**
     * Limit how many EmailTemplates to delete.
     */
    limit?: number
  }

  /**
   * EmailTemplate without action
   */
  export type EmailTemplateDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the EmailTemplate
     */
    select?: EmailTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the EmailTemplate
     */
    omit?: EmailTemplateOmit<ExtArgs> | null
  }


  /**
   * Model SmsTemplate
   */

  export type AggregateSmsTemplate = {
    _count: SmsTemplateCountAggregateOutputType | null
    _min: SmsTemplateMinAggregateOutputType | null
    _max: SmsTemplateMaxAggregateOutputType | null
  }

  export type SmsTemplateMinAggregateOutputType = {
    id: string | null
    name: string | null
    body: string | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type SmsTemplateMaxAggregateOutputType = {
    id: string | null
    name: string | null
    body: string | null
    isActive: boolean | null
    createdAt: Date | null
    updatedAt: Date | null
  }

  export type SmsTemplateCountAggregateOutputType = {
    id: number
    name: number
    body: number
    variables: number
    isActive: number
    createdAt: number
    updatedAt: number
    _all: number
  }


  export type SmsTemplateMinAggregateInputType = {
    id?: true
    name?: true
    body?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type SmsTemplateMaxAggregateInputType = {
    id?: true
    name?: true
    body?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
  }

  export type SmsTemplateCountAggregateInputType = {
    id?: true
    name?: true
    body?: true
    variables?: true
    isActive?: true
    createdAt?: true
    updatedAt?: true
    _all?: true
  }

  export type SmsTemplateAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SmsTemplate to aggregate.
     */
    where?: SmsTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SmsTemplates to fetch.
     */
    orderBy?: SmsTemplateOrderByWithRelationInput | SmsTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: SmsTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SmsTemplates 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` SmsTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned SmsTemplates
    **/
    _count?: true | SmsTemplateCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: SmsTemplateMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: SmsTemplateMaxAggregateInputType
  }

  export type GetSmsTemplateAggregateType<T extends SmsTemplateAggregateArgs> = {
        [P in keyof T & keyof AggregateSmsTemplate]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateSmsTemplate[P]>
      : GetScalarType<T[P], AggregateSmsTemplate[P]>
  }




  export type SmsTemplateGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: SmsTemplateWhereInput
    orderBy?: SmsTemplateOrderByWithAggregationInput | SmsTemplateOrderByWithAggregationInput[]
    by: SmsTemplateScalarFieldEnum[] | SmsTemplateScalarFieldEnum
    having?: SmsTemplateScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: SmsTemplateCountAggregateInputType | true
    _min?: SmsTemplateMinAggregateInputType
    _max?: SmsTemplateMaxAggregateInputType
  }

  export type SmsTemplateGroupByOutputType = {
    id: string
    name: string
    body: string
    variables: JsonValue | null
    isActive: boolean
    createdAt: Date
    updatedAt: Date
    _count: SmsTemplateCountAggregateOutputType | null
    _min: SmsTemplateMinAggregateOutputType | null
    _max: SmsTemplateMaxAggregateOutputType | null
  }

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


  export type SmsTemplateSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["smsTemplate"]>

  export type SmsTemplateSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["smsTemplate"]>

  export type SmsTemplateSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    name?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }, ExtArgs["result"]["smsTemplate"]>

  export type SmsTemplateSelectScalar = {
    id?: boolean
    name?: boolean
    body?: boolean
    variables?: boolean
    isActive?: boolean
    createdAt?: boolean
    updatedAt?: boolean
  }

  export type SmsTemplateOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "name" | "body" | "variables" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["smsTemplate"]>

  export type $SmsTemplatePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "SmsTemplate"
    objects: {}
    scalars: $Extensions.GetPayloadResult<{
      id: string
      name: string
      body: string
      variables: Prisma.JsonValue | null
      isActive: boolean
      createdAt: Date
      updatedAt: Date
    }, ExtArgs["result"]["smsTemplate"]>
    composites: {}
  }

  type SmsTemplateGetPayload<S extends boolean | null | undefined | SmsTemplateDefaultArgs> = $Result.GetResult<Prisma.$SmsTemplatePayload, S>

  type SmsTemplateCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<SmsTemplateFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: SmsTemplateCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a SmsTemplate.
     * @param {SmsTemplateCreateArgs} args - Arguments to create a SmsTemplate.
     * @example
     * // Create one SmsTemplate
     * const SmsTemplate = await prisma.smsTemplate.create({
     *   data: {
     *     // ... data to create a SmsTemplate
     *   }
     * })
     * 
     */
    create<T extends SmsTemplateCreateArgs>(args: SelectSubset<T, SmsTemplateCreateArgs<ExtArgs>>): Prisma__SmsTemplateClient<$Result.GetResult<Prisma.$SmsTemplatePayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many SmsTemplates and returns the data saved in the database.
     * @param {SmsTemplateCreateManyAndReturnArgs} args - Arguments to create many SmsTemplates.
     * @example
     * // Create many SmsTemplates
     * const smsTemplate = await prisma.smsTemplate.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many SmsTemplates and only return the `id`
     * const smsTemplateWithIdOnly = await prisma.smsTemplate.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends SmsTemplateCreateManyAndReturnArgs>(args?: SelectSubset<T, SmsTemplateCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SmsTemplatePayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a SmsTemplate.
     * @param {SmsTemplateDeleteArgs} args - Arguments to delete one SmsTemplate.
     * @example
     * // Delete one SmsTemplate
     * const SmsTemplate = await prisma.smsTemplate.delete({
     *   where: {
     *     // ... filter to delete one SmsTemplate
     *   }
     * })
     * 
     */
    delete<T extends SmsTemplateDeleteArgs>(args: SelectSubset<T, SmsTemplateDeleteArgs<ExtArgs>>): Prisma__SmsTemplateClient<$Result.GetResult<Prisma.$SmsTemplatePayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one SmsTemplate.
     * @param {SmsTemplateUpdateArgs} args - Arguments to update one SmsTemplate.
     * @example
     * // Update one SmsTemplate
     * const smsTemplate = await prisma.smsTemplate.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends SmsTemplateUpdateArgs>(args: SelectSubset<T, SmsTemplateUpdateArgs<ExtArgs>>): Prisma__SmsTemplateClient<$Result.GetResult<Prisma.$SmsTemplatePayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more SmsTemplates and returns the data updated in the database.
     * @param {SmsTemplateUpdateManyAndReturnArgs} args - Arguments to update many SmsTemplates.
     * @example
     * // Update many SmsTemplates
     * const smsTemplate = await prisma.smsTemplate.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more SmsTemplates and only return the `id`
     * const smsTemplateWithIdOnly = await prisma.smsTemplate.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends SmsTemplateUpdateManyAndReturnArgs>(args: SelectSubset<T, SmsTemplateUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SmsTemplatePayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a SmsTemplate.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SmsTemplateAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends SmsTemplateAggregateArgs>(args: Subset<T, SmsTemplateAggregateArgs>): Prisma.PrismaPromise<GetSmsTemplateAggregateType<T>>

    /**
     * Group by SmsTemplate.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {SmsTemplateGroupByArgs} 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 SmsTemplateGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: SmsTemplateGroupByArgs['orderBy'] }
        : { orderBy?: SmsTemplateGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, SmsTemplateGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSmsTemplateGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the SmsTemplate model
   */
  readonly fields: SmsTemplateFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for SmsTemplate.
   * 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__SmsTemplateClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the SmsTemplate model
   */
  interface SmsTemplateFieldRefs {
    readonly id: FieldRef<"SmsTemplate", 'String'>
    readonly name: FieldRef<"SmsTemplate", 'String'>
    readonly body: FieldRef<"SmsTemplate", 'String'>
    readonly variables: FieldRef<"SmsTemplate", 'Json'>
    readonly isActive: FieldRef<"SmsTemplate", 'Boolean'>
    readonly createdAt: FieldRef<"SmsTemplate", 'DateTime'>
    readonly updatedAt: FieldRef<"SmsTemplate", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * SmsTemplate findUnique
   */
  export type SmsTemplateFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * Filter, which SmsTemplate to fetch.
     */
    where: SmsTemplateWhereUniqueInput
  }

  /**
   * SmsTemplate findUniqueOrThrow
   */
  export type SmsTemplateFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * Filter, which SmsTemplate to fetch.
     */
    where: SmsTemplateWhereUniqueInput
  }

  /**
   * SmsTemplate findFirst
   */
  export type SmsTemplateFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * Filter, which SmsTemplate to fetch.
     */
    where?: SmsTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SmsTemplates to fetch.
     */
    orderBy?: SmsTemplateOrderByWithRelationInput | SmsTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SmsTemplates.
     */
    cursor?: SmsTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SmsTemplates 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` SmsTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SmsTemplates.
     */
    distinct?: SmsTemplateScalarFieldEnum | SmsTemplateScalarFieldEnum[]
  }

  /**
   * SmsTemplate findFirstOrThrow
   */
  export type SmsTemplateFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * Filter, which SmsTemplate to fetch.
     */
    where?: SmsTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SmsTemplates to fetch.
     */
    orderBy?: SmsTemplateOrderByWithRelationInput | SmsTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for SmsTemplates.
     */
    cursor?: SmsTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SmsTemplates 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` SmsTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SmsTemplates.
     */
    distinct?: SmsTemplateScalarFieldEnum | SmsTemplateScalarFieldEnum[]
  }

  /**
   * SmsTemplate findMany
   */
  export type SmsTemplateFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * Filter, which SmsTemplates to fetch.
     */
    where?: SmsTemplateWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of SmsTemplates to fetch.
     */
    orderBy?: SmsTemplateOrderByWithRelationInput | SmsTemplateOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing SmsTemplates.
     */
    cursor?: SmsTemplateWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` SmsTemplates 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` SmsTemplates.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of SmsTemplates.
     */
    distinct?: SmsTemplateScalarFieldEnum | SmsTemplateScalarFieldEnum[]
  }

  /**
   * SmsTemplate create
   */
  export type SmsTemplateCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * The data needed to create a SmsTemplate.
     */
    data: XOR<SmsTemplateCreateInput, SmsTemplateUncheckedCreateInput>
  }

  /**
   * SmsTemplate createMany
   */
  export type SmsTemplateCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many SmsTemplates.
     */
    data: SmsTemplateCreateManyInput | SmsTemplateCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * SmsTemplate createManyAndReturn
   */
  export type SmsTemplateCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * The data used to create many SmsTemplates.
     */
    data: SmsTemplateCreateManyInput | SmsTemplateCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * SmsTemplate update
   */
  export type SmsTemplateUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * The data needed to update a SmsTemplate.
     */
    data: XOR<SmsTemplateUpdateInput, SmsTemplateUncheckedUpdateInput>
    /**
     * Choose, which SmsTemplate to update.
     */
    where: SmsTemplateWhereUniqueInput
  }

  /**
   * SmsTemplate updateMany
   */
  export type SmsTemplateUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update SmsTemplates.
     */
    data: XOR<SmsTemplateUpdateManyMutationInput, SmsTemplateUncheckedUpdateManyInput>
    /**
     * Filter which SmsTemplates to update
     */
    where?: SmsTemplateWhereInput
    /**
     * Limit how many SmsTemplates to update.
     */
    limit?: number
  }

  /**
   * SmsTemplate updateManyAndReturn
   */
  export type SmsTemplateUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * The data used to update SmsTemplates.
     */
    data: XOR<SmsTemplateUpdateManyMutationInput, SmsTemplateUncheckedUpdateManyInput>
    /**
     * Filter which SmsTemplates to update
     */
    where?: SmsTemplateWhereInput
    /**
     * Limit how many SmsTemplates to update.
     */
    limit?: number
  }

  /**
   * SmsTemplate upsert
   */
  export type SmsTemplateUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * The filter to search for the SmsTemplate to update in case it exists.
     */
    where: SmsTemplateWhereUniqueInput
    /**
     * In case the SmsTemplate found by the `where` argument doesn't exist, create a new SmsTemplate with this data.
     */
    create: XOR<SmsTemplateCreateInput, SmsTemplateUncheckedCreateInput>
    /**
     * In case the SmsTemplate was found with the provided `where` argument, update it with this data.
     */
    update: XOR<SmsTemplateUpdateInput, SmsTemplateUncheckedUpdateInput>
  }

  /**
   * SmsTemplate delete
   */
  export type SmsTemplateDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
    /**
     * Filter which SmsTemplate to delete.
     */
    where: SmsTemplateWhereUniqueInput
  }

  /**
   * SmsTemplate deleteMany
   */
  export type SmsTemplateDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which SmsTemplates to delete
     */
    where?: SmsTemplateWhereInput
    /**
     * Limit how many SmsTemplates to delete.
     */
    limit?: number
  }

  /**
   * SmsTemplate without action
   */
  export type SmsTemplateDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the SmsTemplate
     */
    select?: SmsTemplateSelect<ExtArgs> | null
    /**
     * Omit specific fields from the SmsTemplate
     */
    omit?: SmsTemplateOmit<ExtArgs> | null
  }


  /**
   * Model Notification
   */

  export type AggregateNotification = {
    _count: NotificationCountAggregateOutputType | null
    _min: NotificationMinAggregateOutputType | null
    _max: NotificationMaxAggregateOutputType | null
  }

  export type NotificationMinAggregateOutputType = {
    id: string | null
    userId: string | null
    title: string | null
    message: string | null
    type: string | null
    link: string | null
    isRead: boolean | null
    createdAt: Date | null
  }

  export type NotificationMaxAggregateOutputType = {
    id: string | null
    userId: string | null
    title: string | null
    message: string | null
    type: string | null
    link: string | null
    isRead: boolean | null
    createdAt: Date | null
  }

  export type NotificationCountAggregateOutputType = {
    id: number
    userId: number
    title: number
    message: number
    type: number
    link: number
    isRead: number
    createdAt: number
    _all: number
  }


  export type NotificationMinAggregateInputType = {
    id?: true
    userId?: true
    title?: true
    message?: true
    type?: true
    link?: true
    isRead?: true
    createdAt?: true
  }

  export type NotificationMaxAggregateInputType = {
    id?: true
    userId?: true
    title?: true
    message?: true
    type?: true
    link?: true
    isRead?: true
    createdAt?: true
  }

  export type NotificationCountAggregateInputType = {
    id?: true
    userId?: true
    title?: true
    message?: true
    type?: true
    link?: true
    isRead?: true
    createdAt?: true
    _all?: true
  }

  export type NotificationAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Notification to aggregate.
     */
    where?: NotificationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Notifications to fetch.
     */
    orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: NotificationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Notifications 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` Notifications.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned Notifications
    **/
    _count?: true | NotificationCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: NotificationMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: NotificationMaxAggregateInputType
  }

  export type GetNotificationAggregateType<T extends NotificationAggregateArgs> = {
        [P in keyof T & keyof AggregateNotification]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateNotification[P]>
      : GetScalarType<T[P], AggregateNotification[P]>
  }




  export type NotificationGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: NotificationWhereInput
    orderBy?: NotificationOrderByWithAggregationInput | NotificationOrderByWithAggregationInput[]
    by: NotificationScalarFieldEnum[] | NotificationScalarFieldEnum
    having?: NotificationScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: NotificationCountAggregateInputType | true
    _min?: NotificationMinAggregateInputType
    _max?: NotificationMaxAggregateInputType
  }

  export type NotificationGroupByOutputType = {
    id: string
    userId: string
    title: string
    message: string
    type: string
    link: string | null
    isRead: boolean
    createdAt: Date
    _count: NotificationCountAggregateOutputType | null
    _min: NotificationMinAggregateOutputType | null
    _max: NotificationMaxAggregateOutputType | null
  }

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


  export type NotificationSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    userId?: boolean
    title?: boolean
    message?: boolean
    type?: boolean
    link?: boolean
    isRead?: boolean
    createdAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["notification"]>

  export type NotificationSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    userId?: boolean
    title?: boolean
    message?: boolean
    type?: boolean
    link?: boolean
    isRead?: boolean
    createdAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["notification"]>

  export type NotificationSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    userId?: boolean
    title?: boolean
    message?: boolean
    type?: boolean
    link?: boolean
    isRead?: boolean
    createdAt?: boolean
    user?: boolean | UserDefaultArgs<ExtArgs>
  }, ExtArgs["result"]["notification"]>

  export type NotificationSelectScalar = {
    id?: boolean
    userId?: boolean
    title?: boolean
    message?: boolean
    type?: boolean
    link?: boolean
    isRead?: boolean
    createdAt?: boolean
  }

  export type NotificationOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "userId" | "title" | "message" | "type" | "link" | "isRead" | "createdAt", ExtArgs["result"]["notification"]>
  export type NotificationInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
  }
  export type NotificationIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
  }
  export type NotificationIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | UserDefaultArgs<ExtArgs>
  }

  export type $NotificationPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "Notification"
    objects: {
      user: Prisma.$UserPayload<ExtArgs>
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      userId: string
      title: string
      message: string
      type: string
      link: string | null
      isRead: boolean
      createdAt: Date
    }, ExtArgs["result"]["notification"]>
    composites: {}
  }

  type NotificationGetPayload<S extends boolean | null | undefined | NotificationDefaultArgs> = $Result.GetResult<Prisma.$NotificationPayload, S>

  type NotificationCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<NotificationFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: NotificationCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a Notification.
     * @param {NotificationCreateArgs} args - Arguments to create a Notification.
     * @example
     * // Create one Notification
     * const Notification = await prisma.notification.create({
     *   data: {
     *     // ... data to create a Notification
     *   }
     * })
     * 
     */
    create<T extends NotificationCreateArgs>(args: SelectSubset<T, NotificationCreateArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many Notifications and returns the data saved in the database.
     * @param {NotificationCreateManyAndReturnArgs} args - Arguments to create many Notifications.
     * @example
     * // Create many Notifications
     * const notification = await prisma.notification.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many Notifications and only return the `id`
     * const notificationWithIdOnly = await prisma.notification.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends NotificationCreateManyAndReturnArgs>(args?: SelectSubset<T, NotificationCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a Notification.
     * @param {NotificationDeleteArgs} args - Arguments to delete one Notification.
     * @example
     * // Delete one Notification
     * const Notification = await prisma.notification.delete({
     *   where: {
     *     // ... filter to delete one Notification
     *   }
     * })
     * 
     */
    delete<T extends NotificationDeleteArgs>(args: SelectSubset<T, NotificationDeleteArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one Notification.
     * @param {NotificationUpdateArgs} args - Arguments to update one Notification.
     * @example
     * // Update one Notification
     * const notification = await prisma.notification.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends NotificationUpdateArgs>(args: SelectSubset<T, NotificationUpdateArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more Notifications and returns the data updated in the database.
     * @param {NotificationUpdateManyAndReturnArgs} args - Arguments to update many Notifications.
     * @example
     * // Update many Notifications
     * const notification = await prisma.notification.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more Notifications and only return the `id`
     * const notificationWithIdOnly = await prisma.notification.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends NotificationUpdateManyAndReturnArgs>(args: SelectSubset<T, NotificationUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a Notification.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {NotificationAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends NotificationAggregateArgs>(args: Subset<T, NotificationAggregateArgs>): Prisma.PrismaPromise<GetNotificationAggregateType<T>>

    /**
     * Group by Notification.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {NotificationGroupByArgs} 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 NotificationGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: NotificationGroupByArgs['orderBy'] }
        : { orderBy?: NotificationGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, NotificationGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetNotificationGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the Notification model
   */
  readonly fields: NotificationFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for Notification.
   * 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__NotificationClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    user<T extends UserDefaultArgs<ExtArgs> = {}>(args?: Subset<T, UserDefaultArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the Notification model
   */
  interface NotificationFieldRefs {
    readonly id: FieldRef<"Notification", 'String'>
    readonly userId: FieldRef<"Notification", 'String'>
    readonly title: FieldRef<"Notification", 'String'>
    readonly message: FieldRef<"Notification", 'String'>
    readonly type: FieldRef<"Notification", 'String'>
    readonly link: FieldRef<"Notification", 'String'>
    readonly isRead: FieldRef<"Notification", 'Boolean'>
    readonly createdAt: FieldRef<"Notification", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * Notification findUnique
   */
  export type NotificationFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * Filter, which Notification to fetch.
     */
    where: NotificationWhereUniqueInput
  }

  /**
   * Notification findUniqueOrThrow
   */
  export type NotificationFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * Filter, which Notification to fetch.
     */
    where: NotificationWhereUniqueInput
  }

  /**
   * Notification findFirst
   */
  export type NotificationFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * Filter, which Notification to fetch.
     */
    where?: NotificationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Notifications to fetch.
     */
    orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Notifications.
     */
    cursor?: NotificationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Notifications 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` Notifications.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Notifications.
     */
    distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[]
  }

  /**
   * Notification findFirstOrThrow
   */
  export type NotificationFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * Filter, which Notification to fetch.
     */
    where?: NotificationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Notifications to fetch.
     */
    orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for Notifications.
     */
    cursor?: NotificationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Notifications 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` Notifications.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Notifications.
     */
    distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[]
  }

  /**
   * Notification findMany
   */
  export type NotificationFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * Filter, which Notifications to fetch.
     */
    where?: NotificationWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of Notifications to fetch.
     */
    orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing Notifications.
     */
    cursor?: NotificationWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` Notifications 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` Notifications.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of Notifications.
     */
    distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[]
  }

  /**
   * Notification create
   */
  export type NotificationCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * The data needed to create a Notification.
     */
    data: XOR<NotificationCreateInput, NotificationUncheckedCreateInput>
  }

  /**
   * Notification createMany
   */
  export type NotificationCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many Notifications.
     */
    data: NotificationCreateManyInput | NotificationCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * Notification createManyAndReturn
   */
  export type NotificationCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * The data used to create many Notifications.
     */
    data: NotificationCreateManyInput | NotificationCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * Notification update
   */
  export type NotificationUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * The data needed to update a Notification.
     */
    data: XOR<NotificationUpdateInput, NotificationUncheckedUpdateInput>
    /**
     * Choose, which Notification to update.
     */
    where: NotificationWhereUniqueInput
  }

  /**
   * Notification updateMany
   */
  export type NotificationUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update Notifications.
     */
    data: XOR<NotificationUpdateManyMutationInput, NotificationUncheckedUpdateManyInput>
    /**
     * Filter which Notifications to update
     */
    where?: NotificationWhereInput
    /**
     * Limit how many Notifications to update.
     */
    limit?: number
  }

  /**
   * Notification updateManyAndReturn
   */
  export type NotificationUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * The data used to update Notifications.
     */
    data: XOR<NotificationUpdateManyMutationInput, NotificationUncheckedUpdateManyInput>
    /**
     * Filter which Notifications to update
     */
    where?: NotificationWhereInput
    /**
     * Limit how many Notifications to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * Notification upsert
   */
  export type NotificationUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * The filter to search for the Notification to update in case it exists.
     */
    where: NotificationWhereUniqueInput
    /**
     * In case the Notification found by the `where` argument doesn't exist, create a new Notification with this data.
     */
    create: XOR<NotificationCreateInput, NotificationUncheckedCreateInput>
    /**
     * In case the Notification was found with the provided `where` argument, update it with this data.
     */
    update: XOR<NotificationUpdateInput, NotificationUncheckedUpdateInput>
  }

  /**
   * Notification delete
   */
  export type NotificationDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
    /**
     * Filter which Notification to delete.
     */
    where: NotificationWhereUniqueInput
  }

  /**
   * Notification deleteMany
   */
  export type NotificationDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which Notifications to delete
     */
    where?: NotificationWhereInput
    /**
     * Limit how many Notifications to delete.
     */
    limit?: number
  }

  /**
   * Notification without action
   */
  export type NotificationDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the Notification
     */
    select?: NotificationSelect<ExtArgs> | null
    /**
     * Omit specific fields from the Notification
     */
    omit?: NotificationOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: NotificationInclude<ExtArgs> | null
  }


  /**
   * Model ActivityLog
   */

  export type AggregateActivityLog = {
    _count: ActivityLogCountAggregateOutputType | null
    _min: ActivityLogMinAggregateOutputType | null
    _max: ActivityLogMaxAggregateOutputType | null
  }

  export type ActivityLogMinAggregateOutputType = {
    id: string | null
    userId: string | null
    action: string | null
    entityType: string | null
    entityId: string | null
    summary: string | null
    createdAt: Date | null
  }

  export type ActivityLogMaxAggregateOutputType = {
    id: string | null
    userId: string | null
    action: string | null
    entityType: string | null
    entityId: string | null
    summary: string | null
    createdAt: Date | null
  }

  export type ActivityLogCountAggregateOutputType = {
    id: number
    userId: number
    action: number
    entityType: number
    entityId: number
    summary: number
    metadata: number
    createdAt: number
    _all: number
  }


  export type ActivityLogMinAggregateInputType = {
    id?: true
    userId?: true
    action?: true
    entityType?: true
    entityId?: true
    summary?: true
    createdAt?: true
  }

  export type ActivityLogMaxAggregateInputType = {
    id?: true
    userId?: true
    action?: true
    entityType?: true
    entityId?: true
    summary?: true
    createdAt?: true
  }

  export type ActivityLogCountAggregateInputType = {
    id?: true
    userId?: true
    action?: true
    entityType?: true
    entityId?: true
    summary?: true
    metadata?: true
    createdAt?: true
    _all?: true
  }

  export type ActivityLogAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which ActivityLog to aggregate.
     */
    where?: ActivityLogWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ActivityLogs to fetch.
     */
    orderBy?: ActivityLogOrderByWithRelationInput | ActivityLogOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the start position
     */
    cursor?: ActivityLogWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ActivityLogs 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` ActivityLogs.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Count returned ActivityLogs
    **/
    _count?: true | ActivityLogCountAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the minimum value
    **/
    _min?: ActivityLogMinAggregateInputType
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
     * 
     * Select which fields to find the maximum value
    **/
    _max?: ActivityLogMaxAggregateInputType
  }

  export type GetActivityLogAggregateType<T extends ActivityLogAggregateArgs> = {
        [P in keyof T & keyof AggregateActivityLog]: P extends '_count' | 'count'
      ? T[P] extends true
        ? number
        : GetScalarType<T[P], AggregateActivityLog[P]>
      : GetScalarType<T[P], AggregateActivityLog[P]>
  }




  export type ActivityLogGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    where?: ActivityLogWhereInput
    orderBy?: ActivityLogOrderByWithAggregationInput | ActivityLogOrderByWithAggregationInput[]
    by: ActivityLogScalarFieldEnum[] | ActivityLogScalarFieldEnum
    having?: ActivityLogScalarWhereWithAggregatesInput
    take?: number
    skip?: number
    _count?: ActivityLogCountAggregateInputType | true
    _min?: ActivityLogMinAggregateInputType
    _max?: ActivityLogMaxAggregateInputType
  }

  export type ActivityLogGroupByOutputType = {
    id: string
    userId: string | null
    action: string
    entityType: string
    entityId: string | null
    summary: string | null
    metadata: JsonValue | null
    createdAt: Date
    _count: ActivityLogCountAggregateOutputType | null
    _min: ActivityLogMinAggregateOutputType | null
    _max: ActivityLogMaxAggregateOutputType | null
  }

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


  export type ActivityLogSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    userId?: boolean
    action?: boolean
    entityType?: boolean
    entityId?: boolean
    summary?: boolean
    metadata?: boolean
    createdAt?: boolean
    user?: boolean | ActivityLog$userArgs<ExtArgs>
  }, ExtArgs["result"]["activityLog"]>

  export type ActivityLogSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    userId?: boolean
    action?: boolean
    entityType?: boolean
    entityId?: boolean
    summary?: boolean
    metadata?: boolean
    createdAt?: boolean
    user?: boolean | ActivityLog$userArgs<ExtArgs>
  }, ExtArgs["result"]["activityLog"]>

  export type ActivityLogSelectUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{
    id?: boolean
    userId?: boolean
    action?: boolean
    entityType?: boolean
    entityId?: boolean
    summary?: boolean
    metadata?: boolean
    createdAt?: boolean
    user?: boolean | ActivityLog$userArgs<ExtArgs>
  }, ExtArgs["result"]["activityLog"]>

  export type ActivityLogSelectScalar = {
    id?: boolean
    userId?: boolean
    action?: boolean
    entityType?: boolean
    entityId?: boolean
    summary?: boolean
    metadata?: boolean
    createdAt?: boolean
  }

  export type ActivityLogOmit<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetOmit<"id" | "userId" | "action" | "entityType" | "entityId" | "summary" | "metadata" | "createdAt", ExtArgs["result"]["activityLog"]>
  export type ActivityLogInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | ActivityLog$userArgs<ExtArgs>
  }
  export type ActivityLogIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | ActivityLog$userArgs<ExtArgs>
  }
  export type ActivityLogIncludeUpdateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    user?: boolean | ActivityLog$userArgs<ExtArgs>
  }

  export type $ActivityLogPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    name: "ActivityLog"
    objects: {
      user: Prisma.$UserPayload<ExtArgs> | null
    }
    scalars: $Extensions.GetPayloadResult<{
      id: string
      userId: string | null
      action: string
      entityType: string
      entityId: string | null
      summary: string | null
      metadata: Prisma.JsonValue | null
      createdAt: Date
    }, ExtArgs["result"]["activityLog"]>
    composites: {}
  }

  type ActivityLogGetPayload<S extends boolean | null | undefined | ActivityLogDefaultArgs> = $Result.GetResult<Prisma.$ActivityLogPayload, S>

  type ActivityLogCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
    Omit<ActivityLogFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
      select?: ActivityLogCountAggregateInputType | true
    }

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

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

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

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

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

    /**
     * Create a ActivityLog.
     * @param {ActivityLogCreateArgs} args - Arguments to create a ActivityLog.
     * @example
     * // Create one ActivityLog
     * const ActivityLog = await prisma.activityLog.create({
     *   data: {
     *     // ... data to create a ActivityLog
     *   }
     * })
     * 
     */
    create<T extends ActivityLogCreateArgs>(args: SelectSubset<T, ActivityLogCreateArgs<ExtArgs>>): Prisma__ActivityLogClient<$Result.GetResult<Prisma.$ActivityLogPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

    /**
     * Create many ActivityLogs and returns the data saved in the database.
     * @param {ActivityLogCreateManyAndReturnArgs} args - Arguments to create many ActivityLogs.
     * @example
     * // Create many ActivityLogs
     * const activityLog = await prisma.activityLog.createManyAndReturn({
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Create many ActivityLogs and only return the `id`
     * const activityLogWithIdOnly = await prisma.activityLog.createManyAndReturn({
     *   select: { id: true },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    createManyAndReturn<T extends ActivityLogCreateManyAndReturnArgs>(args?: SelectSubset<T, ActivityLogCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ActivityLogPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

    /**
     * Delete a ActivityLog.
     * @param {ActivityLogDeleteArgs} args - Arguments to delete one ActivityLog.
     * @example
     * // Delete one ActivityLog
     * const ActivityLog = await prisma.activityLog.delete({
     *   where: {
     *     // ... filter to delete one ActivityLog
     *   }
     * })
     * 
     */
    delete<T extends ActivityLogDeleteArgs>(args: SelectSubset<T, ActivityLogDeleteArgs<ExtArgs>>): Prisma__ActivityLogClient<$Result.GetResult<Prisma.$ActivityLogPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

    /**
     * Update one ActivityLog.
     * @param {ActivityLogUpdateArgs} args - Arguments to update one ActivityLog.
     * @example
     * // Update one ActivityLog
     * const activityLog = await prisma.activityLog.update({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: {
     *     // ... provide data here
     *   }
     * })
     * 
     */
    update<T extends ActivityLogUpdateArgs>(args: SelectSubset<T, ActivityLogUpdateArgs<ExtArgs>>): Prisma__ActivityLogClient<$Result.GetResult<Prisma.$ActivityLogPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

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

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

    /**
     * Update zero or more ActivityLogs and returns the data updated in the database.
     * @param {ActivityLogUpdateManyAndReturnArgs} args - Arguments to update many ActivityLogs.
     * @example
     * // Update many ActivityLogs
     * const activityLog = await prisma.activityLog.updateManyAndReturn({
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * 
     * // Update zero or more ActivityLogs and only return the `id`
     * const activityLogWithIdOnly = await prisma.activityLog.updateManyAndReturn({
     *   select: { id: true },
     *   where: {
     *     // ... provide filter here
     *   },
     *   data: [
     *     // ... provide data here
     *   ]
     * })
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * 
     */
    updateManyAndReturn<T extends ActivityLogUpdateManyAndReturnArgs>(args: SelectSubset<T, ActivityLogUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ActivityLogPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

    /**
     * Allows you to perform aggregations operations on a ActivityLog.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ActivityLogAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
     * @example
     * // Ordered by age ascending
     * // Where email contains prisma.io
     * // Limited to the 10 users
     * const aggregations = await prisma.user.aggregate({
     *   _avg: {
     *     age: true,
     *   },
     *   where: {
     *     email: {
     *       contains: "prisma.io",
     *     },
     *   },
     *   orderBy: {
     *     age: "asc",
     *   },
     *   take: 10,
     * })
    **/
    aggregate<T extends ActivityLogAggregateArgs>(args: Subset<T, ActivityLogAggregateArgs>): Prisma.PrismaPromise<GetActivityLogAggregateType<T>>

    /**
     * Group by ActivityLog.
     * Note, that providing `undefined` is treated as the value not being there.
     * Read more here: https://pris.ly/d/null-undefined
     * @param {ActivityLogGroupByArgs} 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 ActivityLogGroupByArgs,
      HasSelectOrTake extends Or<
        Extends<'skip', Keys<T>>,
        Extends<'take', Keys<T>>
      >,
      OrderByArg extends True extends HasSelectOrTake
        ? { orderBy: ActivityLogGroupByArgs['orderBy'] }
        : { orderBy?: ActivityLogGroupByArgs['orderBy'] },
      OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>,
      ByFields extends MaybeTupleToUnion<T['by']>,
      ByValid extends Has<ByFields, OrderFields>,
      HavingFields extends GetHavingFields<T['having']>,
      HavingValid extends Has<ByFields, HavingFields>,
      ByEmpty extends T['by'] extends never[] ? True : False,
      InputErrors extends ByEmpty extends True
      ? `Error: "by" must not be empty.`
      : HavingValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 Keys<T>
      ? 'orderBy' extends Keys<T>
        ? ByValid extends 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 True
      ? {}
      : {
          [P in OrderFields]: P extends ByFields
            ? never
            : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
        }[OrderFields]
    >(args: SubsetIntersection<T, ActivityLogGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetActivityLogGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
  /**
   * Fields of the ActivityLog model
   */
  readonly fields: ActivityLogFieldRefs;
  }

  /**
   * The delegate class that acts as a "Promise-like" for ActivityLog.
   * 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__ActivityLogClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
    readonly [Symbol.toStringTag]: "PrismaPromise"
    user<T extends ActivityLog$userArgs<ExtArgs> = {}>(args?: Subset<T, ActivityLog$userArgs<ExtArgs>>): Prisma__UserClient<$Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
    /**
     * Attaches callbacks for the resolution and/or rejection of the Promise.
     * @param onfulfilled The callback to execute when the Promise is resolved.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of which ever callback is executed.
     */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2>
    /**
     * Attaches a callback for only the rejection of the Promise.
     * @param onrejected The callback to execute when the Promise is rejected.
     * @returns A Promise for the completion of the callback.
     */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult>
    /**
     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
     * resolved value cannot be modified from the callback.
     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
     * @returns A Promise for the completion of the callback.
     */
    finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise<T>
  }




  /**
   * Fields of the ActivityLog model
   */
  interface ActivityLogFieldRefs {
    readonly id: FieldRef<"ActivityLog", 'String'>
    readonly userId: FieldRef<"ActivityLog", 'String'>
    readonly action: FieldRef<"ActivityLog", 'String'>
    readonly entityType: FieldRef<"ActivityLog", 'String'>
    readonly entityId: FieldRef<"ActivityLog", 'String'>
    readonly summary: FieldRef<"ActivityLog", 'String'>
    readonly metadata: FieldRef<"ActivityLog", 'Json'>
    readonly createdAt: FieldRef<"ActivityLog", 'DateTime'>
  }
    

  // Custom InputTypes
  /**
   * ActivityLog findUnique
   */
  export type ActivityLogFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * Filter, which ActivityLog to fetch.
     */
    where: ActivityLogWhereUniqueInput
  }

  /**
   * ActivityLog findUniqueOrThrow
   */
  export type ActivityLogFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * Filter, which ActivityLog to fetch.
     */
    where: ActivityLogWhereUniqueInput
  }

  /**
   * ActivityLog findFirst
   */
  export type ActivityLogFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * Filter, which ActivityLog to fetch.
     */
    where?: ActivityLogWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ActivityLogs to fetch.
     */
    orderBy?: ActivityLogOrderByWithRelationInput | ActivityLogOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for ActivityLogs.
     */
    cursor?: ActivityLogWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ActivityLogs 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` ActivityLogs.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of ActivityLogs.
     */
    distinct?: ActivityLogScalarFieldEnum | ActivityLogScalarFieldEnum[]
  }

  /**
   * ActivityLog findFirstOrThrow
   */
  export type ActivityLogFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * Filter, which ActivityLog to fetch.
     */
    where?: ActivityLogWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ActivityLogs to fetch.
     */
    orderBy?: ActivityLogOrderByWithRelationInput | ActivityLogOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for searching for ActivityLogs.
     */
    cursor?: ActivityLogWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ActivityLogs 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` ActivityLogs.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of ActivityLogs.
     */
    distinct?: ActivityLogScalarFieldEnum | ActivityLogScalarFieldEnum[]
  }

  /**
   * ActivityLog findMany
   */
  export type ActivityLogFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * Filter, which ActivityLogs to fetch.
     */
    where?: ActivityLogWhereInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
     * 
     * Determine the order of ActivityLogs to fetch.
     */
    orderBy?: ActivityLogOrderByWithRelationInput | ActivityLogOrderByWithRelationInput[]
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
     * 
     * Sets the position for listing ActivityLogs.
     */
    cursor?: ActivityLogWhereUniqueInput
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
     * 
     * Take `±n` ActivityLogs 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` ActivityLogs.
     */
    skip?: number
    /**
     * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
     * 
     * Filter by unique combinations of ActivityLogs.
     */
    distinct?: ActivityLogScalarFieldEnum | ActivityLogScalarFieldEnum[]
  }

  /**
   * ActivityLog create
   */
  export type ActivityLogCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * The data needed to create a ActivityLog.
     */
    data: XOR<ActivityLogCreateInput, ActivityLogUncheckedCreateInput>
  }

  /**
   * ActivityLog createMany
   */
  export type ActivityLogCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to create many ActivityLogs.
     */
    data: ActivityLogCreateManyInput | ActivityLogCreateManyInput[]
    skipDuplicates?: boolean
  }

  /**
   * ActivityLog createManyAndReturn
   */
  export type ActivityLogCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelectCreateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * The data used to create many ActivityLogs.
     */
    data: ActivityLogCreateManyInput | ActivityLogCreateManyInput[]
    skipDuplicates?: boolean
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogIncludeCreateManyAndReturn<ExtArgs> | null
  }

  /**
   * ActivityLog update
   */
  export type ActivityLogUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * The data needed to update a ActivityLog.
     */
    data: XOR<ActivityLogUpdateInput, ActivityLogUncheckedUpdateInput>
    /**
     * Choose, which ActivityLog to update.
     */
    where: ActivityLogWhereUniqueInput
  }

  /**
   * ActivityLog updateMany
   */
  export type ActivityLogUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * The data used to update ActivityLogs.
     */
    data: XOR<ActivityLogUpdateManyMutationInput, ActivityLogUncheckedUpdateManyInput>
    /**
     * Filter which ActivityLogs to update
     */
    where?: ActivityLogWhereInput
    /**
     * Limit how many ActivityLogs to update.
     */
    limit?: number
  }

  /**
   * ActivityLog updateManyAndReturn
   */
  export type ActivityLogUpdateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelectUpdateManyAndReturn<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * The data used to update ActivityLogs.
     */
    data: XOR<ActivityLogUpdateManyMutationInput, ActivityLogUncheckedUpdateManyInput>
    /**
     * Filter which ActivityLogs to update
     */
    where?: ActivityLogWhereInput
    /**
     * Limit how many ActivityLogs to update.
     */
    limit?: number
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogIncludeUpdateManyAndReturn<ExtArgs> | null
  }

  /**
   * ActivityLog upsert
   */
  export type ActivityLogUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * The filter to search for the ActivityLog to update in case it exists.
     */
    where: ActivityLogWhereUniqueInput
    /**
     * In case the ActivityLog found by the `where` argument doesn't exist, create a new ActivityLog with this data.
     */
    create: XOR<ActivityLogCreateInput, ActivityLogUncheckedCreateInput>
    /**
     * In case the ActivityLog was found with the provided `where` argument, update it with this data.
     */
    update: XOR<ActivityLogUpdateInput, ActivityLogUncheckedUpdateInput>
  }

  /**
   * ActivityLog delete
   */
  export type ActivityLogDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
    /**
     * Filter which ActivityLog to delete.
     */
    where: ActivityLogWhereUniqueInput
  }

  /**
   * ActivityLog deleteMany
   */
  export type ActivityLogDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Filter which ActivityLogs to delete
     */
    where?: ActivityLogWhereInput
    /**
     * Limit how many ActivityLogs to delete.
     */
    limit?: number
  }

  /**
   * ActivityLog.user
   */
  export type ActivityLog$userArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the User
     */
    select?: UserSelect<ExtArgs> | null
    /**
     * Omit specific fields from the User
     */
    omit?: UserOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: UserInclude<ExtArgs> | null
    where?: UserWhereInput
  }

  /**
   * ActivityLog without action
   */
  export type ActivityLogDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
    /**
     * Select specific fields to fetch from the ActivityLog
     */
    select?: ActivityLogSelect<ExtArgs> | null
    /**
     * Omit specific fields from the ActivityLog
     */
    omit?: ActivityLogOmit<ExtArgs> | null
    /**
     * Choose, which related nodes to fetch as well
     */
    include?: ActivityLogInclude<ExtArgs> | null
  }


  /**
   * Enums
   */

  export const TransactionIsolationLevel: {
    ReadUncommitted: 'ReadUncommitted',
    ReadCommitted: 'ReadCommitted',
    RepeatableRead: 'RepeatableRead',
    Serializable: 'Serializable'
  };

  export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]


  export const HealthcheckScalarFieldEnum: {
    id: 'id',
    createdAt: 'createdAt'
  };

  export type HealthcheckScalarFieldEnum = (typeof HealthcheckScalarFieldEnum)[keyof typeof HealthcheckScalarFieldEnum]


  export const SettingScalarFieldEnum: {
    key: 'key',
    value: 'value',
    updatedAt: 'updatedAt'
  };

  export type SettingScalarFieldEnum = (typeof SettingScalarFieldEnum)[keyof typeof SettingScalarFieldEnum]


  export const UserScalarFieldEnum: {
    id: 'id',
    email: 'email',
    username: 'username',
    fullName: 'fullName',
    passwordHash: 'passwordHash',
    isVerified: 'isVerified',
    isApproved: 'isApproved',
    verificationToken: 'verificationToken',
    verificationTokenExpiry: 'verificationTokenExpiry',
    passwordResetToken: 'passwordResetToken',
    passwordResetTokenExpiry: 'passwordResetTokenExpiry',
    activeBranchId: 'activeBranchId',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]


  export const BranchScalarFieldEnum: {
    id: 'id',
    name: 'name',
    code: 'code',
    address: 'address',
    city: 'city',
    country: 'country',
    phone: 'phone',
    phones: 'phones',
    email: 'email',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type BranchScalarFieldEnum = (typeof BranchScalarFieldEnum)[keyof typeof BranchScalarFieldEnum]


  export const UserBranchScalarFieldEnum: {
    userId: 'userId',
    branchId: 'branchId',
    assignedAt: 'assignedAt'
  };

  export type UserBranchScalarFieldEnum = (typeof UserBranchScalarFieldEnum)[keyof typeof UserBranchScalarFieldEnum]


  export const RoleScalarFieldEnum: {
    id: 'id',
    name: 'name',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type RoleScalarFieldEnum = (typeof RoleScalarFieldEnum)[keyof typeof RoleScalarFieldEnum]


  export const PermissionScalarFieldEnum: {
    id: 'id',
    name: 'name',
    label: 'label',
    description: 'description',
    category: 'category',
    sortOrder: 'sortOrder',
    isSystem: 'isSystem',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type PermissionScalarFieldEnum = (typeof PermissionScalarFieldEnum)[keyof typeof PermissionScalarFieldEnum]


  export const UserRoleScalarFieldEnum: {
    userId: 'userId',
    roleId: 'roleId',
    assignedAt: 'assignedAt'
  };

  export type UserRoleScalarFieldEnum = (typeof UserRoleScalarFieldEnum)[keyof typeof UserRoleScalarFieldEnum]


  export const RolePermissionScalarFieldEnum: {
    roleId: 'roleId',
    permissionId: 'permissionId'
  };

  export type RolePermissionScalarFieldEnum = (typeof RolePermissionScalarFieldEnum)[keyof typeof RolePermissionScalarFieldEnum]


  export const CategoryScalarFieldEnum: {
    id: 'id',
    name: 'name',
    code: 'code',
    description: 'description',
    color: 'color',
    icon: 'icon',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    tags: 'tags',
    branchId: 'branchId',
    parentId: 'parentId',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type CategoryScalarFieldEnum = (typeof CategoryScalarFieldEnum)[keyof typeof CategoryScalarFieldEnum]


  export const VariationScalarFieldEnum: {
    id: 'id',
    name: 'name',
    options: 'options',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    branchId: 'branchId',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type VariationScalarFieldEnum = (typeof VariationScalarFieldEnum)[keyof typeof VariationScalarFieldEnum]


  export const BrandScalarFieldEnum: {
    id: 'id',
    name: 'name',
    logo: 'logo',
    branchId: 'branchId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type BrandScalarFieldEnum = (typeof BrandScalarFieldEnum)[keyof typeof BrandScalarFieldEnum]


  export const UnitScalarFieldEnum: {
    id: 'id',
    name: 'name',
    symbol: 'symbol',
    branchId: 'branchId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type UnitScalarFieldEnum = (typeof UnitScalarFieldEnum)[keyof typeof UnitScalarFieldEnum]


  export const WarehouseScalarFieldEnum: {
    id: 'id',
    name: 'name',
    branchId: 'branchId',
    email: 'email',
    phone: 'phone',
    country: 'country',
    city: 'city',
    zipCode: 'zipCode',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type WarehouseScalarFieldEnum = (typeof WarehouseScalarFieldEnum)[keyof typeof WarehouseScalarFieldEnum]


  export const WarehouseStockScalarFieldEnum: {
    id: 'id',
    warehouseId: 'warehouseId',
    productId: 'productId',
    quantity: 'quantity',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type WarehouseStockScalarFieldEnum = (typeof WarehouseStockScalarFieldEnum)[keyof typeof WarehouseStockScalarFieldEnum]


  export const SupplierScalarFieldEnum: {
    id: 'id',
    name: 'name',
    email: 'email',
    phone: 'phone',
    country: 'country',
    city: 'city',
    zipCode: 'zipCode',
    branchId: 'branchId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum]


  export const PurchaseScalarFieldEnum: {
    id: 'id',
    number: 'number',
    supplierId: 'supplierId',
    warehouseId: 'warehouseId',
    branchId: 'branchId',
    status: 'status',
    purchaseDate: 'purchaseDate',
    notes: 'notes',
    subtotal: 'subtotal',
    taxTotal: 'taxTotal',
    total: 'total',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type PurchaseScalarFieldEnum = (typeof PurchaseScalarFieldEnum)[keyof typeof PurchaseScalarFieldEnum]


  export const PurchaseLineScalarFieldEnum: {
    id: 'id',
    purchaseId: 'purchaseId',
    productId: 'productId',
    quantity: 'quantity',
    unitCost: 'unitCost',
    taxRate: 'taxRate',
    lineTotal: 'lineTotal'
  };

  export type PurchaseLineScalarFieldEnum = (typeof PurchaseLineScalarFieldEnum)[keyof typeof PurchaseLineScalarFieldEnum]


  export const PurchaseReturnScalarFieldEnum: {
    id: 'id',
    number: 'number',
    purchaseId: 'purchaseId',
    supplierId: 'supplierId',
    warehouseId: 'warehouseId',
    branchId: 'branchId',
    status: 'status',
    returnDate: 'returnDate',
    reason: 'reason',
    notes: 'notes',
    subtotal: 'subtotal',
    taxTotal: 'taxTotal',
    total: 'total',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type PurchaseReturnScalarFieldEnum = (typeof PurchaseReturnScalarFieldEnum)[keyof typeof PurchaseReturnScalarFieldEnum]


  export const PurchaseReturnLineScalarFieldEnum: {
    id: 'id',
    purchaseReturnId: 'purchaseReturnId',
    productId: 'productId',
    quantity: 'quantity',
    unitCost: 'unitCost',
    taxRate: 'taxRate',
    lineTotal: 'lineTotal'
  };

  export type PurchaseReturnLineScalarFieldEnum = (typeof PurchaseReturnLineScalarFieldEnum)[keyof typeof PurchaseReturnLineScalarFieldEnum]


  export const CustomerScalarFieldEnum: {
    id: 'id',
    name: 'name',
    email: 'email',
    phone: 'phone',
    country: 'country',
    city: 'city',
    zipCode: 'zipCode',
    branchId: 'branchId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum]


  export const PaymentMethodScalarFieldEnum: {
    id: 'id',
    name: 'name',
    branchId: 'branchId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type PaymentMethodScalarFieldEnum = (typeof PaymentMethodScalarFieldEnum)[keyof typeof PaymentMethodScalarFieldEnum]


  export const SaleScalarFieldEnum: {
    id: 'id',
    number: 'number',
    customerId: 'customerId',
    warehouseId: 'warehouseId',
    branchId: 'branchId',
    paymentMethodId: 'paymentMethodId',
    status: 'status',
    saleDate: 'saleDate',
    notes: 'notes',
    subtotal: 'subtotal',
    taxTotal: 'taxTotal',
    total: 'total',
    amountPaid: 'amountPaid',
    changeGiven: 'changeGiven',
    taxBreakdown: 'taxBreakdown',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type SaleScalarFieldEnum = (typeof SaleScalarFieldEnum)[keyof typeof SaleScalarFieldEnum]


  export const SaleLineScalarFieldEnum: {
    id: 'id',
    saleId: 'saleId',
    productId: 'productId',
    quantity: 'quantity',
    unitPrice: 'unitPrice',
    taxRate: 'taxRate',
    lineTotal: 'lineTotal'
  };

  export type SaleLineScalarFieldEnum = (typeof SaleLineScalarFieldEnum)[keyof typeof SaleLineScalarFieldEnum]


  export const SalesReturnScalarFieldEnum: {
    id: 'id',
    number: 'number',
    saleId: 'saleId',
    customerId: 'customerId',
    warehouseId: 'warehouseId',
    branchId: 'branchId',
    status: 'status',
    returnDate: 'returnDate',
    reason: 'reason',
    notes: 'notes',
    subtotal: 'subtotal',
    taxTotal: 'taxTotal',
    total: 'total',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type SalesReturnScalarFieldEnum = (typeof SalesReturnScalarFieldEnum)[keyof typeof SalesReturnScalarFieldEnum]


  export const SalesReturnLineScalarFieldEnum: {
    id: 'id',
    salesReturnId: 'salesReturnId',
    productId: 'productId',
    quantity: 'quantity',
    unitPrice: 'unitPrice',
    taxRate: 'taxRate',
    lineTotal: 'lineTotal'
  };

  export type SalesReturnLineScalarFieldEnum = (typeof SalesReturnLineScalarFieldEnum)[keyof typeof SalesReturnLineScalarFieldEnum]


  export const TaxScalarFieldEnum: {
    id: 'id',
    name: 'name',
    rate: 'rate',
    branchId: 'branchId',
    isActive: 'isActive',
    sortOrder: 'sortOrder',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type TaxScalarFieldEnum = (typeof TaxScalarFieldEnum)[keyof typeof TaxScalarFieldEnum]


  export const ExpenseCategoryScalarFieldEnum: {
    id: 'id',
    name: 'name',
    description: 'description',
    branchId: 'branchId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type ExpenseCategoryScalarFieldEnum = (typeof ExpenseCategoryScalarFieldEnum)[keyof typeof ExpenseCategoryScalarFieldEnum]


  export const ExpenseScalarFieldEnum: {
    id: 'id',
    reference: 'reference',
    categoryId: 'categoryId',
    warehouseId: 'warehouseId',
    branchId: 'branchId',
    paymentMethodId: 'paymentMethodId',
    status: 'status',
    expenseDate: 'expenseDate',
    title: 'title',
    notes: 'notes',
    amount: 'amount',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type ExpenseScalarFieldEnum = (typeof ExpenseScalarFieldEnum)[keyof typeof ExpenseScalarFieldEnum]


  export const ProductScalarFieldEnum: {
    id: 'id',
    name: 'name',
    sku: 'sku',
    barcode: 'barcode',
    description: 'description',
    isReturnable: 'isReturnable',
    branchId: 'branchId',
    categoryId: 'categoryId',
    unitId: 'unitId',
    brandId: 'brandId',
    expiryDate: 'expiryDate',
    productType: 'productType',
    variationIds: 'variationIds',
    quantity: 'quantity',
    images: 'images',
    sellingPrice: 'sellingPrice',
    salesTaxId: 'salesTaxId',
    costPrice: 'costPrice',
    purchaseTaxId: 'purchaseTaxId',
    warehouseId: 'warehouseId',
    sortOrder: 'sortOrder',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type ProductScalarFieldEnum = (typeof ProductScalarFieldEnum)[keyof typeof ProductScalarFieldEnum]


  export const InventoryTransferScalarFieldEnum: {
    id: 'id',
    reference: 'reference',
    fromWarehouseId: 'fromWarehouseId',
    toWarehouseId: 'toWarehouseId',
    branchId: 'branchId',
    status: 'status',
    transferDate: 'transferDate',
    notes: 'notes',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum]


  export const InventoryTransferLineScalarFieldEnum: {
    id: 'id',
    transferId: 'transferId',
    productId: 'productId',
    quantity: 'quantity'
  };

  export type InventoryTransferLineScalarFieldEnum = (typeof InventoryTransferLineScalarFieldEnum)[keyof typeof InventoryTransferLineScalarFieldEnum]


  export const InvoiceScalarFieldEnum: {
    id: 'id',
    number: 'number',
    customerId: 'customerId',
    saleId: 'saleId',
    branchId: 'branchId',
    status: 'status',
    issueDate: 'issueDate',
    dueDate: 'dueDate',
    notes: 'notes',
    subtotal: 'subtotal',
    taxTotal: 'taxTotal',
    total: 'total',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt',
    deletedAt: 'deletedAt'
  };

  export type InvoiceScalarFieldEnum = (typeof InvoiceScalarFieldEnum)[keyof typeof InvoiceScalarFieldEnum]


  export const InvoiceLineScalarFieldEnum: {
    id: 'id',
    invoiceId: 'invoiceId',
    productId: 'productId',
    quantity: 'quantity',
    unitPrice: 'unitPrice',
    taxRate: 'taxRate',
    lineTotal: 'lineTotal'
  };

  export type InvoiceLineScalarFieldEnum = (typeof InvoiceLineScalarFieldEnum)[keyof typeof InvoiceLineScalarFieldEnum]


  export const InventoryAdjustmentScalarFieldEnum: {
    id: 'id',
    reference: 'reference',
    warehouseId: 'warehouseId',
    branchId: 'branchId',
    type: 'type',
    reason: 'reason',
    notes: 'notes',
    status: 'status',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type InventoryAdjustmentScalarFieldEnum = (typeof InventoryAdjustmentScalarFieldEnum)[keyof typeof InventoryAdjustmentScalarFieldEnum]


  export const InventoryAdjustmentLineScalarFieldEnum: {
    id: 'id',
    adjustmentId: 'adjustmentId',
    productId: 'productId',
    quantity: 'quantity'
  };

  export type InventoryAdjustmentLineScalarFieldEnum = (typeof InventoryAdjustmentLineScalarFieldEnum)[keyof typeof InventoryAdjustmentLineScalarFieldEnum]


  export const EmailTemplateScalarFieldEnum: {
    id: 'id',
    name: 'name',
    subject: 'subject',
    body: 'body',
    variables: 'variables',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type EmailTemplateScalarFieldEnum = (typeof EmailTemplateScalarFieldEnum)[keyof typeof EmailTemplateScalarFieldEnum]


  export const SmsTemplateScalarFieldEnum: {
    id: 'id',
    name: 'name',
    body: 'body',
    variables: 'variables',
    isActive: 'isActive',
    createdAt: 'createdAt',
    updatedAt: 'updatedAt'
  };

  export type SmsTemplateScalarFieldEnum = (typeof SmsTemplateScalarFieldEnum)[keyof typeof SmsTemplateScalarFieldEnum]


  export const NotificationScalarFieldEnum: {
    id: 'id',
    userId: 'userId',
    title: 'title',
    message: 'message',
    type: 'type',
    link: 'link',
    isRead: 'isRead',
    createdAt: 'createdAt'
  };

  export type NotificationScalarFieldEnum = (typeof NotificationScalarFieldEnum)[keyof typeof NotificationScalarFieldEnum]


  export const ActivityLogScalarFieldEnum: {
    id: 'id',
    userId: 'userId',
    action: 'action',
    entityType: 'entityType',
    entityId: 'entityId',
    summary: 'summary',
    metadata: 'metadata',
    createdAt: 'createdAt'
  };

  export type ActivityLogScalarFieldEnum = (typeof ActivityLogScalarFieldEnum)[keyof typeof ActivityLogScalarFieldEnum]


  export const SortOrder: {
    asc: 'asc',
    desc: 'desc'
  };

  export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]


  export const NullableJsonNullValueInput: {
    DbNull: typeof DbNull,
    JsonNull: typeof JsonNull
  };

  export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]


  export const QueryMode: {
    default: 'default',
    insensitive: 'insensitive'
  };

  export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]


  export const NullsOrder: {
    first: 'first',
    last: 'last'
  };

  export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]


  export const JsonNullValueFilter: {
    DbNull: typeof DbNull,
    JsonNull: typeof JsonNull,
    AnyNull: typeof AnyNull
  };

  export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]


  /**
   * Field references
   */


  /**
   * Reference to a field of type 'Int'
   */
  export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'>
    


  /**
   * Reference to a field of type 'Int[]'
   */
  export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'>
    


  /**
   * Reference to a field of type 'DateTime'
   */
  export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'>
    


  /**
   * Reference to a field of type 'DateTime[]'
   */
  export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'>
    


  /**
   * Reference to a field of type 'String'
   */
  export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'>
    


  /**
   * Reference to a field of type 'String[]'
   */
  export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'>
    


  /**
   * Reference to a field of type 'Boolean'
   */
  export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'>
    


  /**
   * Reference to a field of type 'Json'
   */
  export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'>
    


  /**
   * Reference to a field of type 'QueryMode'
   */
  export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'>
    


  /**
   * Reference to a field of type 'Float'
   */
  export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'>
    


  /**
   * Reference to a field of type 'Float[]'
   */
  export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'>
    
  /**
   * Deep Input Types
   */


  export type HealthcheckWhereInput = {
    AND?: HealthcheckWhereInput | HealthcheckWhereInput[]
    OR?: HealthcheckWhereInput[]
    NOT?: HealthcheckWhereInput | HealthcheckWhereInput[]
    id?: IntFilter<"Healthcheck"> | number
    createdAt?: DateTimeFilter<"Healthcheck"> | Date | string
  }

  export type HealthcheckOrderByWithRelationInput = {
    id?: SortOrder
    createdAt?: SortOrder
  }

  export type HealthcheckWhereUniqueInput = Prisma.AtLeast<{
    id?: number
    AND?: HealthcheckWhereInput | HealthcheckWhereInput[]
    OR?: HealthcheckWhereInput[]
    NOT?: HealthcheckWhereInput | HealthcheckWhereInput[]
    createdAt?: DateTimeFilter<"Healthcheck"> | Date | string
  }, "id">

  export type HealthcheckOrderByWithAggregationInput = {
    id?: SortOrder
    createdAt?: SortOrder
    _count?: HealthcheckCountOrderByAggregateInput
    _avg?: HealthcheckAvgOrderByAggregateInput
    _max?: HealthcheckMaxOrderByAggregateInput
    _min?: HealthcheckMinOrderByAggregateInput
    _sum?: HealthcheckSumOrderByAggregateInput
  }

  export type HealthcheckScalarWhereWithAggregatesInput = {
    AND?: HealthcheckScalarWhereWithAggregatesInput | HealthcheckScalarWhereWithAggregatesInput[]
    OR?: HealthcheckScalarWhereWithAggregatesInput[]
    NOT?: HealthcheckScalarWhereWithAggregatesInput | HealthcheckScalarWhereWithAggregatesInput[]
    id?: IntWithAggregatesFilter<"Healthcheck"> | number
    createdAt?: DateTimeWithAggregatesFilter<"Healthcheck"> | Date | string
  }

  export type SettingWhereInput = {
    AND?: SettingWhereInput | SettingWhereInput[]
    OR?: SettingWhereInput[]
    NOT?: SettingWhereInput | SettingWhereInput[]
    key?: StringFilter<"Setting"> | string
    value?: StringFilter<"Setting"> | string
    updatedAt?: DateTimeFilter<"Setting"> | Date | string
  }

  export type SettingOrderByWithRelationInput = {
    key?: SortOrder
    value?: SortOrder
    updatedAt?: SortOrder
  }

  export type SettingWhereUniqueInput = Prisma.AtLeast<{
    key?: string
    AND?: SettingWhereInput | SettingWhereInput[]
    OR?: SettingWhereInput[]
    NOT?: SettingWhereInput | SettingWhereInput[]
    value?: StringFilter<"Setting"> | string
    updatedAt?: DateTimeFilter<"Setting"> | Date | string
  }, "key">

  export type SettingOrderByWithAggregationInput = {
    key?: SortOrder
    value?: SortOrder
    updatedAt?: SortOrder
    _count?: SettingCountOrderByAggregateInput
    _max?: SettingMaxOrderByAggregateInput
    _min?: SettingMinOrderByAggregateInput
  }

  export type SettingScalarWhereWithAggregatesInput = {
    AND?: SettingScalarWhereWithAggregatesInput | SettingScalarWhereWithAggregatesInput[]
    OR?: SettingScalarWhereWithAggregatesInput[]
    NOT?: SettingScalarWhereWithAggregatesInput | SettingScalarWhereWithAggregatesInput[]
    key?: StringWithAggregatesFilter<"Setting"> | string
    value?: StringWithAggregatesFilter<"Setting"> | string
    updatedAt?: DateTimeWithAggregatesFilter<"Setting"> | Date | string
  }

  export type UserWhereInput = {
    AND?: UserWhereInput | UserWhereInput[]
    OR?: UserWhereInput[]
    NOT?: UserWhereInput | UserWhereInput[]
    id?: StringFilter<"User"> | string
    email?: StringFilter<"User"> | string
    username?: StringNullableFilter<"User"> | string | null
    fullName?: StringFilter<"User"> | string
    passwordHash?: StringFilter<"User"> | string
    isVerified?: BoolFilter<"User"> | boolean
    isApproved?: BoolFilter<"User"> | boolean
    verificationToken?: StringNullableFilter<"User"> | string | null
    verificationTokenExpiry?: DateTimeNullableFilter<"User"> | Date | string | null
    passwordResetToken?: StringNullableFilter<"User"> | string | null
    passwordResetTokenExpiry?: DateTimeNullableFilter<"User"> | Date | string | null
    activeBranchId?: StringNullableFilter<"User"> | string | null
    createdAt?: DateTimeFilter<"User"> | Date | string
    updatedAt?: DateTimeFilter<"User"> | Date | string
    deletedAt?: DateTimeNullableFilter<"User"> | Date | string | null
    roles?: UserRoleListRelationFilter
    activeBranch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    branches?: UserBranchListRelationFilter
    notifications?: NotificationListRelationFilter
    activityLogs?: ActivityLogListRelationFilter
  }

  export type UserOrderByWithRelationInput = {
    id?: SortOrder
    email?: SortOrder
    username?: SortOrderInput | SortOrder
    fullName?: SortOrder
    passwordHash?: SortOrder
    isVerified?: SortOrder
    isApproved?: SortOrder
    verificationToken?: SortOrderInput | SortOrder
    verificationTokenExpiry?: SortOrderInput | SortOrder
    passwordResetToken?: SortOrderInput | SortOrder
    passwordResetTokenExpiry?: SortOrderInput | SortOrder
    activeBranchId?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    roles?: UserRoleOrderByRelationAggregateInput
    activeBranch?: BranchOrderByWithRelationInput
    branches?: UserBranchOrderByRelationAggregateInput
    notifications?: NotificationOrderByRelationAggregateInput
    activityLogs?: ActivityLogOrderByRelationAggregateInput
  }

  export type UserWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    email?: string
    username?: string
    verificationToken?: string
    passwordResetToken?: string
    AND?: UserWhereInput | UserWhereInput[]
    OR?: UserWhereInput[]
    NOT?: UserWhereInput | UserWhereInput[]
    fullName?: StringFilter<"User"> | string
    passwordHash?: StringFilter<"User"> | string
    isVerified?: BoolFilter<"User"> | boolean
    isApproved?: BoolFilter<"User"> | boolean
    verificationTokenExpiry?: DateTimeNullableFilter<"User"> | Date | string | null
    passwordResetTokenExpiry?: DateTimeNullableFilter<"User"> | Date | string | null
    activeBranchId?: StringNullableFilter<"User"> | string | null
    createdAt?: DateTimeFilter<"User"> | Date | string
    updatedAt?: DateTimeFilter<"User"> | Date | string
    deletedAt?: DateTimeNullableFilter<"User"> | Date | string | null
    roles?: UserRoleListRelationFilter
    activeBranch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    branches?: UserBranchListRelationFilter
    notifications?: NotificationListRelationFilter
    activityLogs?: ActivityLogListRelationFilter
  }, "id" | "email" | "username" | "verificationToken" | "passwordResetToken">

  export type UserOrderByWithAggregationInput = {
    id?: SortOrder
    email?: SortOrder
    username?: SortOrderInput | SortOrder
    fullName?: SortOrder
    passwordHash?: SortOrder
    isVerified?: SortOrder
    isApproved?: SortOrder
    verificationToken?: SortOrderInput | SortOrder
    verificationTokenExpiry?: SortOrderInput | SortOrder
    passwordResetToken?: SortOrderInput | SortOrder
    passwordResetTokenExpiry?: SortOrderInput | SortOrder
    activeBranchId?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: UserCountOrderByAggregateInput
    _max?: UserMaxOrderByAggregateInput
    _min?: UserMinOrderByAggregateInput
  }

  export type UserScalarWhereWithAggregatesInput = {
    AND?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[]
    OR?: UserScalarWhereWithAggregatesInput[]
    NOT?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"User"> | string
    email?: StringWithAggregatesFilter<"User"> | string
    username?: StringNullableWithAggregatesFilter<"User"> | string | null
    fullName?: StringWithAggregatesFilter<"User"> | string
    passwordHash?: StringWithAggregatesFilter<"User"> | string
    isVerified?: BoolWithAggregatesFilter<"User"> | boolean
    isApproved?: BoolWithAggregatesFilter<"User"> | boolean
    verificationToken?: StringNullableWithAggregatesFilter<"User"> | string | null
    verificationTokenExpiry?: DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null
    passwordResetToken?: StringNullableWithAggregatesFilter<"User"> | string | null
    passwordResetTokenExpiry?: DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null
    activeBranchId?: StringNullableWithAggregatesFilter<"User"> | string | null
    createdAt?: DateTimeWithAggregatesFilter<"User"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"User"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null
  }

  export type BranchWhereInput = {
    AND?: BranchWhereInput | BranchWhereInput[]
    OR?: BranchWhereInput[]
    NOT?: BranchWhereInput | BranchWhereInput[]
    id?: StringFilter<"Branch"> | string
    name?: StringFilter<"Branch"> | string
    code?: StringNullableFilter<"Branch"> | string | null
    address?: StringNullableFilter<"Branch"> | string | null
    city?: StringNullableFilter<"Branch"> | string | null
    country?: StringNullableFilter<"Branch"> | string | null
    phone?: StringNullableFilter<"Branch"> | string | null
    phones?: JsonNullableFilter<"Branch">
    email?: StringNullableFilter<"Branch"> | string | null
    sortOrder?: IntFilter<"Branch"> | number
    isActive?: BoolFilter<"Branch"> | boolean
    createdAt?: DateTimeFilter<"Branch"> | Date | string
    updatedAt?: DateTimeFilter<"Branch"> | Date | string
    users?: UserBranchListRelationFilter
    activeUsers?: UserListRelationFilter
    suppliers?: SupplierListRelationFilter
    customers?: CustomerListRelationFilter
    products?: ProductListRelationFilter
    sales?: SaleListRelationFilter
    salesReturns?: SalesReturnListRelationFilter
    purchases?: PurchaseListRelationFilter
    purchaseReturns?: PurchaseReturnListRelationFilter
    invoices?: InvoiceListRelationFilter
    expenseCategories?: ExpenseCategoryListRelationFilter
    expenses?: ExpenseListRelationFilter
    adjustments?: InventoryAdjustmentListRelationFilter
    transfers?: InventoryTransferListRelationFilter
    categories?: CategoryListRelationFilter
    brands?: BrandListRelationFilter
    units?: UnitListRelationFilter
    variations?: VariationListRelationFilter
    taxes?: TaxListRelationFilter
    warehouses?: WarehouseListRelationFilter
    paymentMethods?: PaymentMethodListRelationFilter
  }

  export type BranchOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrderInput | SortOrder
    address?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    phones?: SortOrderInput | SortOrder
    email?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    users?: UserBranchOrderByRelationAggregateInput
    activeUsers?: UserOrderByRelationAggregateInput
    suppliers?: SupplierOrderByRelationAggregateInput
    customers?: CustomerOrderByRelationAggregateInput
    products?: ProductOrderByRelationAggregateInput
    sales?: SaleOrderByRelationAggregateInput
    salesReturns?: SalesReturnOrderByRelationAggregateInput
    purchases?: PurchaseOrderByRelationAggregateInput
    purchaseReturns?: PurchaseReturnOrderByRelationAggregateInput
    invoices?: InvoiceOrderByRelationAggregateInput
    expenseCategories?: ExpenseCategoryOrderByRelationAggregateInput
    expenses?: ExpenseOrderByRelationAggregateInput
    adjustments?: InventoryAdjustmentOrderByRelationAggregateInput
    transfers?: InventoryTransferOrderByRelationAggregateInput
    categories?: CategoryOrderByRelationAggregateInput
    brands?: BrandOrderByRelationAggregateInput
    units?: UnitOrderByRelationAggregateInput
    variations?: VariationOrderByRelationAggregateInput
    taxes?: TaxOrderByRelationAggregateInput
    warehouses?: WarehouseOrderByRelationAggregateInput
    paymentMethods?: PaymentMethodOrderByRelationAggregateInput
  }

  export type BranchWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    code?: string
    AND?: BranchWhereInput | BranchWhereInput[]
    OR?: BranchWhereInput[]
    NOT?: BranchWhereInput | BranchWhereInput[]
    address?: StringNullableFilter<"Branch"> | string | null
    city?: StringNullableFilter<"Branch"> | string | null
    country?: StringNullableFilter<"Branch"> | string | null
    phone?: StringNullableFilter<"Branch"> | string | null
    phones?: JsonNullableFilter<"Branch">
    email?: StringNullableFilter<"Branch"> | string | null
    sortOrder?: IntFilter<"Branch"> | number
    isActive?: BoolFilter<"Branch"> | boolean
    createdAt?: DateTimeFilter<"Branch"> | Date | string
    updatedAt?: DateTimeFilter<"Branch"> | Date | string
    users?: UserBranchListRelationFilter
    activeUsers?: UserListRelationFilter
    suppliers?: SupplierListRelationFilter
    customers?: CustomerListRelationFilter
    products?: ProductListRelationFilter
    sales?: SaleListRelationFilter
    salesReturns?: SalesReturnListRelationFilter
    purchases?: PurchaseListRelationFilter
    purchaseReturns?: PurchaseReturnListRelationFilter
    invoices?: InvoiceListRelationFilter
    expenseCategories?: ExpenseCategoryListRelationFilter
    expenses?: ExpenseListRelationFilter
    adjustments?: InventoryAdjustmentListRelationFilter
    transfers?: InventoryTransferListRelationFilter
    categories?: CategoryListRelationFilter
    brands?: BrandListRelationFilter
    units?: UnitListRelationFilter
    variations?: VariationListRelationFilter
    taxes?: TaxListRelationFilter
    warehouses?: WarehouseListRelationFilter
    paymentMethods?: PaymentMethodListRelationFilter
  }, "id" | "name" | "code">

  export type BranchOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrderInput | SortOrder
    address?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    phones?: SortOrderInput | SortOrder
    email?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: BranchCountOrderByAggregateInput
    _avg?: BranchAvgOrderByAggregateInput
    _max?: BranchMaxOrderByAggregateInput
    _min?: BranchMinOrderByAggregateInput
    _sum?: BranchSumOrderByAggregateInput
  }

  export type BranchScalarWhereWithAggregatesInput = {
    AND?: BranchScalarWhereWithAggregatesInput | BranchScalarWhereWithAggregatesInput[]
    OR?: BranchScalarWhereWithAggregatesInput[]
    NOT?: BranchScalarWhereWithAggregatesInput | BranchScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Branch"> | string
    name?: StringWithAggregatesFilter<"Branch"> | string
    code?: StringNullableWithAggregatesFilter<"Branch"> | string | null
    address?: StringNullableWithAggregatesFilter<"Branch"> | string | null
    city?: StringNullableWithAggregatesFilter<"Branch"> | string | null
    country?: StringNullableWithAggregatesFilter<"Branch"> | string | null
    phone?: StringNullableWithAggregatesFilter<"Branch"> | string | null
    phones?: JsonNullableWithAggregatesFilter<"Branch">
    email?: StringNullableWithAggregatesFilter<"Branch"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Branch"> | number
    isActive?: BoolWithAggregatesFilter<"Branch"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Branch"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Branch"> | Date | string
  }

  export type UserBranchWhereInput = {
    AND?: UserBranchWhereInput | UserBranchWhereInput[]
    OR?: UserBranchWhereInput[]
    NOT?: UserBranchWhereInput | UserBranchWhereInput[]
    userId?: StringFilter<"UserBranch"> | string
    branchId?: StringFilter<"UserBranch"> | string
    assignedAt?: DateTimeFilter<"UserBranch"> | Date | string
    user?: XOR<UserScalarRelationFilter, UserWhereInput>
    branch?: XOR<BranchScalarRelationFilter, BranchWhereInput>
  }

  export type UserBranchOrderByWithRelationInput = {
    userId?: SortOrder
    branchId?: SortOrder
    assignedAt?: SortOrder
    user?: UserOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
  }

  export type UserBranchWhereUniqueInput = Prisma.AtLeast<{
    userId_branchId?: UserBranchUserIdBranchIdCompoundUniqueInput
    AND?: UserBranchWhereInput | UserBranchWhereInput[]
    OR?: UserBranchWhereInput[]
    NOT?: UserBranchWhereInput | UserBranchWhereInput[]
    userId?: StringFilter<"UserBranch"> | string
    branchId?: StringFilter<"UserBranch"> | string
    assignedAt?: DateTimeFilter<"UserBranch"> | Date | string
    user?: XOR<UserScalarRelationFilter, UserWhereInput>
    branch?: XOR<BranchScalarRelationFilter, BranchWhereInput>
  }, "userId_branchId">

  export type UserBranchOrderByWithAggregationInput = {
    userId?: SortOrder
    branchId?: SortOrder
    assignedAt?: SortOrder
    _count?: UserBranchCountOrderByAggregateInput
    _max?: UserBranchMaxOrderByAggregateInput
    _min?: UserBranchMinOrderByAggregateInput
  }

  export type UserBranchScalarWhereWithAggregatesInput = {
    AND?: UserBranchScalarWhereWithAggregatesInput | UserBranchScalarWhereWithAggregatesInput[]
    OR?: UserBranchScalarWhereWithAggregatesInput[]
    NOT?: UserBranchScalarWhereWithAggregatesInput | UserBranchScalarWhereWithAggregatesInput[]
    userId?: StringWithAggregatesFilter<"UserBranch"> | string
    branchId?: StringWithAggregatesFilter<"UserBranch"> | string
    assignedAt?: DateTimeWithAggregatesFilter<"UserBranch"> | Date | string
  }

  export type RoleWhereInput = {
    AND?: RoleWhereInput | RoleWhereInput[]
    OR?: RoleWhereInput[]
    NOT?: RoleWhereInput | RoleWhereInput[]
    id?: StringFilter<"Role"> | string
    name?: StringFilter<"Role"> | string
    createdAt?: DateTimeFilter<"Role"> | Date | string
    updatedAt?: DateTimeFilter<"Role"> | Date | string
    users?: UserRoleListRelationFilter
    permissions?: RolePermissionListRelationFilter
  }

  export type RoleOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    users?: UserRoleOrderByRelationAggregateInput
    permissions?: RolePermissionOrderByRelationAggregateInput
  }

  export type RoleWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    AND?: RoleWhereInput | RoleWhereInput[]
    OR?: RoleWhereInput[]
    NOT?: RoleWhereInput | RoleWhereInput[]
    createdAt?: DateTimeFilter<"Role"> | Date | string
    updatedAt?: DateTimeFilter<"Role"> | Date | string
    users?: UserRoleListRelationFilter
    permissions?: RolePermissionListRelationFilter
  }, "id" | "name">

  export type RoleOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: RoleCountOrderByAggregateInput
    _max?: RoleMaxOrderByAggregateInput
    _min?: RoleMinOrderByAggregateInput
  }

  export type RoleScalarWhereWithAggregatesInput = {
    AND?: RoleScalarWhereWithAggregatesInput | RoleScalarWhereWithAggregatesInput[]
    OR?: RoleScalarWhereWithAggregatesInput[]
    NOT?: RoleScalarWhereWithAggregatesInput | RoleScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Role"> | string
    name?: StringWithAggregatesFilter<"Role"> | string
    createdAt?: DateTimeWithAggregatesFilter<"Role"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Role"> | Date | string
  }

  export type PermissionWhereInput = {
    AND?: PermissionWhereInput | PermissionWhereInput[]
    OR?: PermissionWhereInput[]
    NOT?: PermissionWhereInput | PermissionWhereInput[]
    id?: StringFilter<"Permission"> | string
    name?: StringFilter<"Permission"> | string
    label?: StringFilter<"Permission"> | string
    description?: StringFilter<"Permission"> | string
    category?: StringFilter<"Permission"> | string
    sortOrder?: IntFilter<"Permission"> | number
    isSystem?: BoolFilter<"Permission"> | boolean
    createdAt?: DateTimeFilter<"Permission"> | Date | string
    updatedAt?: DateTimeFilter<"Permission"> | Date | string
    roles?: RolePermissionListRelationFilter
  }

  export type PermissionOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    label?: SortOrder
    description?: SortOrder
    category?: SortOrder
    sortOrder?: SortOrder
    isSystem?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    roles?: RolePermissionOrderByRelationAggregateInput
  }

  export type PermissionWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    AND?: PermissionWhereInput | PermissionWhereInput[]
    OR?: PermissionWhereInput[]
    NOT?: PermissionWhereInput | PermissionWhereInput[]
    label?: StringFilter<"Permission"> | string
    description?: StringFilter<"Permission"> | string
    category?: StringFilter<"Permission"> | string
    sortOrder?: IntFilter<"Permission"> | number
    isSystem?: BoolFilter<"Permission"> | boolean
    createdAt?: DateTimeFilter<"Permission"> | Date | string
    updatedAt?: DateTimeFilter<"Permission"> | Date | string
    roles?: RolePermissionListRelationFilter
  }, "id" | "name">

  export type PermissionOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    label?: SortOrder
    description?: SortOrder
    category?: SortOrder
    sortOrder?: SortOrder
    isSystem?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: PermissionCountOrderByAggregateInput
    _avg?: PermissionAvgOrderByAggregateInput
    _max?: PermissionMaxOrderByAggregateInput
    _min?: PermissionMinOrderByAggregateInput
    _sum?: PermissionSumOrderByAggregateInput
  }

  export type PermissionScalarWhereWithAggregatesInput = {
    AND?: PermissionScalarWhereWithAggregatesInput | PermissionScalarWhereWithAggregatesInput[]
    OR?: PermissionScalarWhereWithAggregatesInput[]
    NOT?: PermissionScalarWhereWithAggregatesInput | PermissionScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Permission"> | string
    name?: StringWithAggregatesFilter<"Permission"> | string
    label?: StringWithAggregatesFilter<"Permission"> | string
    description?: StringWithAggregatesFilter<"Permission"> | string
    category?: StringWithAggregatesFilter<"Permission"> | string
    sortOrder?: IntWithAggregatesFilter<"Permission"> | number
    isSystem?: BoolWithAggregatesFilter<"Permission"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Permission"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Permission"> | Date | string
  }

  export type UserRoleWhereInput = {
    AND?: UserRoleWhereInput | UserRoleWhereInput[]
    OR?: UserRoleWhereInput[]
    NOT?: UserRoleWhereInput | UserRoleWhereInput[]
    userId?: StringFilter<"UserRole"> | string
    roleId?: StringFilter<"UserRole"> | string
    assignedAt?: DateTimeFilter<"UserRole"> | Date | string
    user?: XOR<UserScalarRelationFilter, UserWhereInput>
    role?: XOR<RoleScalarRelationFilter, RoleWhereInput>
  }

  export type UserRoleOrderByWithRelationInput = {
    userId?: SortOrder
    roleId?: SortOrder
    assignedAt?: SortOrder
    user?: UserOrderByWithRelationInput
    role?: RoleOrderByWithRelationInput
  }

  export type UserRoleWhereUniqueInput = Prisma.AtLeast<{
    userId_roleId?: UserRoleUserIdRoleIdCompoundUniqueInput
    AND?: UserRoleWhereInput | UserRoleWhereInput[]
    OR?: UserRoleWhereInput[]
    NOT?: UserRoleWhereInput | UserRoleWhereInput[]
    userId?: StringFilter<"UserRole"> | string
    roleId?: StringFilter<"UserRole"> | string
    assignedAt?: DateTimeFilter<"UserRole"> | Date | string
    user?: XOR<UserScalarRelationFilter, UserWhereInput>
    role?: XOR<RoleScalarRelationFilter, RoleWhereInput>
  }, "userId_roleId">

  export type UserRoleOrderByWithAggregationInput = {
    userId?: SortOrder
    roleId?: SortOrder
    assignedAt?: SortOrder
    _count?: UserRoleCountOrderByAggregateInput
    _max?: UserRoleMaxOrderByAggregateInput
    _min?: UserRoleMinOrderByAggregateInput
  }

  export type UserRoleScalarWhereWithAggregatesInput = {
    AND?: UserRoleScalarWhereWithAggregatesInput | UserRoleScalarWhereWithAggregatesInput[]
    OR?: UserRoleScalarWhereWithAggregatesInput[]
    NOT?: UserRoleScalarWhereWithAggregatesInput | UserRoleScalarWhereWithAggregatesInput[]
    userId?: StringWithAggregatesFilter<"UserRole"> | string
    roleId?: StringWithAggregatesFilter<"UserRole"> | string
    assignedAt?: DateTimeWithAggregatesFilter<"UserRole"> | Date | string
  }

  export type RolePermissionWhereInput = {
    AND?: RolePermissionWhereInput | RolePermissionWhereInput[]
    OR?: RolePermissionWhereInput[]
    NOT?: RolePermissionWhereInput | RolePermissionWhereInput[]
    roleId?: StringFilter<"RolePermission"> | string
    permissionId?: StringFilter<"RolePermission"> | string
    role?: XOR<RoleScalarRelationFilter, RoleWhereInput>
    permission?: XOR<PermissionScalarRelationFilter, PermissionWhereInput>
  }

  export type RolePermissionOrderByWithRelationInput = {
    roleId?: SortOrder
    permissionId?: SortOrder
    role?: RoleOrderByWithRelationInput
    permission?: PermissionOrderByWithRelationInput
  }

  export type RolePermissionWhereUniqueInput = Prisma.AtLeast<{
    roleId_permissionId?: RolePermissionRoleIdPermissionIdCompoundUniqueInput
    AND?: RolePermissionWhereInput | RolePermissionWhereInput[]
    OR?: RolePermissionWhereInput[]
    NOT?: RolePermissionWhereInput | RolePermissionWhereInput[]
    roleId?: StringFilter<"RolePermission"> | string
    permissionId?: StringFilter<"RolePermission"> | string
    role?: XOR<RoleScalarRelationFilter, RoleWhereInput>
    permission?: XOR<PermissionScalarRelationFilter, PermissionWhereInput>
  }, "roleId_permissionId">

  export type RolePermissionOrderByWithAggregationInput = {
    roleId?: SortOrder
    permissionId?: SortOrder
    _count?: RolePermissionCountOrderByAggregateInput
    _max?: RolePermissionMaxOrderByAggregateInput
    _min?: RolePermissionMinOrderByAggregateInput
  }

  export type RolePermissionScalarWhereWithAggregatesInput = {
    AND?: RolePermissionScalarWhereWithAggregatesInput | RolePermissionScalarWhereWithAggregatesInput[]
    OR?: RolePermissionScalarWhereWithAggregatesInput[]
    NOT?: RolePermissionScalarWhereWithAggregatesInput | RolePermissionScalarWhereWithAggregatesInput[]
    roleId?: StringWithAggregatesFilter<"RolePermission"> | string
    permissionId?: StringWithAggregatesFilter<"RolePermission"> | string
  }

  export type CategoryWhereInput = {
    AND?: CategoryWhereInput | CategoryWhereInput[]
    OR?: CategoryWhereInput[]
    NOT?: CategoryWhereInput | CategoryWhereInput[]
    id?: StringFilter<"Category"> | string
    name?: StringFilter<"Category"> | string
    code?: StringNullableFilter<"Category"> | string | null
    description?: StringNullableFilter<"Category"> | string | null
    color?: StringNullableFilter<"Category"> | string | null
    icon?: StringNullableFilter<"Category"> | string | null
    sortOrder?: IntFilter<"Category"> | number
    isActive?: BoolFilter<"Category"> | boolean
    tags?: JsonNullableFilter<"Category">
    branchId?: StringNullableFilter<"Category"> | string | null
    parentId?: StringNullableFilter<"Category"> | string | null
    createdAt?: DateTimeFilter<"Category"> | Date | string
    updatedAt?: DateTimeFilter<"Category"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    parent?: XOR<CategoryNullableScalarRelationFilter, CategoryWhereInput> | null
    children?: CategoryListRelationFilter
    products?: ProductListRelationFilter
  }

  export type CategoryOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrderInput | SortOrder
    description?: SortOrderInput | SortOrder
    color?: SortOrderInput | SortOrder
    icon?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    tags?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    parentId?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    parent?: CategoryOrderByWithRelationInput
    children?: CategoryOrderByRelationAggregateInput
    products?: ProductOrderByRelationAggregateInput
  }

  export type CategoryWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_code?: CategoryBranchIdCodeCompoundUniqueInput
    AND?: CategoryWhereInput | CategoryWhereInput[]
    OR?: CategoryWhereInput[]
    NOT?: CategoryWhereInput | CategoryWhereInput[]
    name?: StringFilter<"Category"> | string
    code?: StringNullableFilter<"Category"> | string | null
    description?: StringNullableFilter<"Category"> | string | null
    color?: StringNullableFilter<"Category"> | string | null
    icon?: StringNullableFilter<"Category"> | string | null
    sortOrder?: IntFilter<"Category"> | number
    isActive?: BoolFilter<"Category"> | boolean
    tags?: JsonNullableFilter<"Category">
    branchId?: StringNullableFilter<"Category"> | string | null
    parentId?: StringNullableFilter<"Category"> | string | null
    createdAt?: DateTimeFilter<"Category"> | Date | string
    updatedAt?: DateTimeFilter<"Category"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    parent?: XOR<CategoryNullableScalarRelationFilter, CategoryWhereInput> | null
    children?: CategoryListRelationFilter
    products?: ProductListRelationFilter
  }, "id" | "branchId_code">

  export type CategoryOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrderInput | SortOrder
    description?: SortOrderInput | SortOrder
    color?: SortOrderInput | SortOrder
    icon?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    tags?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    parentId?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: CategoryCountOrderByAggregateInput
    _avg?: CategoryAvgOrderByAggregateInput
    _max?: CategoryMaxOrderByAggregateInput
    _min?: CategoryMinOrderByAggregateInput
    _sum?: CategorySumOrderByAggregateInput
  }

  export type CategoryScalarWhereWithAggregatesInput = {
    AND?: CategoryScalarWhereWithAggregatesInput | CategoryScalarWhereWithAggregatesInput[]
    OR?: CategoryScalarWhereWithAggregatesInput[]
    NOT?: CategoryScalarWhereWithAggregatesInput | CategoryScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Category"> | string
    name?: StringWithAggregatesFilter<"Category"> | string
    code?: StringNullableWithAggregatesFilter<"Category"> | string | null
    description?: StringNullableWithAggregatesFilter<"Category"> | string | null
    color?: StringNullableWithAggregatesFilter<"Category"> | string | null
    icon?: StringNullableWithAggregatesFilter<"Category"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Category"> | number
    isActive?: BoolWithAggregatesFilter<"Category"> | boolean
    tags?: JsonNullableWithAggregatesFilter<"Category">
    branchId?: StringNullableWithAggregatesFilter<"Category"> | string | null
    parentId?: StringNullableWithAggregatesFilter<"Category"> | string | null
    createdAt?: DateTimeWithAggregatesFilter<"Category"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Category"> | Date | string
  }

  export type VariationWhereInput = {
    AND?: VariationWhereInput | VariationWhereInput[]
    OR?: VariationWhereInput[]
    NOT?: VariationWhereInput | VariationWhereInput[]
    id?: StringFilter<"Variation"> | string
    name?: StringFilter<"Variation"> | string
    options?: JsonNullableFilter<"Variation">
    sortOrder?: IntFilter<"Variation"> | number
    isActive?: BoolFilter<"Variation"> | boolean
    branchId?: StringNullableFilter<"Variation"> | string | null
    createdAt?: DateTimeFilter<"Variation"> | Date | string
    updatedAt?: DateTimeFilter<"Variation"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
  }

  export type VariationOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    options?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
  }

  export type VariationWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: VariationWhereInput | VariationWhereInput[]
    OR?: VariationWhereInput[]
    NOT?: VariationWhereInput | VariationWhereInput[]
    name?: StringFilter<"Variation"> | string
    options?: JsonNullableFilter<"Variation">
    sortOrder?: IntFilter<"Variation"> | number
    isActive?: BoolFilter<"Variation"> | boolean
    branchId?: StringNullableFilter<"Variation"> | string | null
    createdAt?: DateTimeFilter<"Variation"> | Date | string
    updatedAt?: DateTimeFilter<"Variation"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
  }, "id">

  export type VariationOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    options?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: VariationCountOrderByAggregateInput
    _avg?: VariationAvgOrderByAggregateInput
    _max?: VariationMaxOrderByAggregateInput
    _min?: VariationMinOrderByAggregateInput
    _sum?: VariationSumOrderByAggregateInput
  }

  export type VariationScalarWhereWithAggregatesInput = {
    AND?: VariationScalarWhereWithAggregatesInput | VariationScalarWhereWithAggregatesInput[]
    OR?: VariationScalarWhereWithAggregatesInput[]
    NOT?: VariationScalarWhereWithAggregatesInput | VariationScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Variation"> | string
    name?: StringWithAggregatesFilter<"Variation"> | string
    options?: JsonNullableWithAggregatesFilter<"Variation">
    sortOrder?: IntWithAggregatesFilter<"Variation"> | number
    isActive?: BoolWithAggregatesFilter<"Variation"> | boolean
    branchId?: StringNullableWithAggregatesFilter<"Variation"> | string | null
    createdAt?: DateTimeWithAggregatesFilter<"Variation"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Variation"> | Date | string
  }

  export type BrandWhereInput = {
    AND?: BrandWhereInput | BrandWhereInput[]
    OR?: BrandWhereInput[]
    NOT?: BrandWhereInput | BrandWhereInput[]
    id?: StringFilter<"Brand"> | string
    name?: StringFilter<"Brand"> | string
    logo?: StringNullableFilter<"Brand"> | string | null
    branchId?: StringNullableFilter<"Brand"> | string | null
    sortOrder?: IntFilter<"Brand"> | number
    isActive?: BoolFilter<"Brand"> | boolean
    createdAt?: DateTimeFilter<"Brand"> | Date | string
    updatedAt?: DateTimeFilter<"Brand"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    products?: ProductListRelationFilter
  }

  export type BrandOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    logo?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    products?: ProductOrderByRelationAggregateInput
  }

  export type BrandWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_name?: BrandBranchIdNameCompoundUniqueInput
    AND?: BrandWhereInput | BrandWhereInput[]
    OR?: BrandWhereInput[]
    NOT?: BrandWhereInput | BrandWhereInput[]
    name?: StringFilter<"Brand"> | string
    logo?: StringNullableFilter<"Brand"> | string | null
    branchId?: StringNullableFilter<"Brand"> | string | null
    sortOrder?: IntFilter<"Brand"> | number
    isActive?: BoolFilter<"Brand"> | boolean
    createdAt?: DateTimeFilter<"Brand"> | Date | string
    updatedAt?: DateTimeFilter<"Brand"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    products?: ProductListRelationFilter
  }, "id" | "branchId_name">

  export type BrandOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    logo?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: BrandCountOrderByAggregateInput
    _avg?: BrandAvgOrderByAggregateInput
    _max?: BrandMaxOrderByAggregateInput
    _min?: BrandMinOrderByAggregateInput
    _sum?: BrandSumOrderByAggregateInput
  }

  export type BrandScalarWhereWithAggregatesInput = {
    AND?: BrandScalarWhereWithAggregatesInput | BrandScalarWhereWithAggregatesInput[]
    OR?: BrandScalarWhereWithAggregatesInput[]
    NOT?: BrandScalarWhereWithAggregatesInput | BrandScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Brand"> | string
    name?: StringWithAggregatesFilter<"Brand"> | string
    logo?: StringNullableWithAggregatesFilter<"Brand"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Brand"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Brand"> | number
    isActive?: BoolWithAggregatesFilter<"Brand"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Brand"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Brand"> | Date | string
  }

  export type UnitWhereInput = {
    AND?: UnitWhereInput | UnitWhereInput[]
    OR?: UnitWhereInput[]
    NOT?: UnitWhereInput | UnitWhereInput[]
    id?: StringFilter<"Unit"> | string
    name?: StringFilter<"Unit"> | string
    symbol?: StringNullableFilter<"Unit"> | string | null
    branchId?: StringNullableFilter<"Unit"> | string | null
    sortOrder?: IntFilter<"Unit"> | number
    isActive?: BoolFilter<"Unit"> | boolean
    createdAt?: DateTimeFilter<"Unit"> | Date | string
    updatedAt?: DateTimeFilter<"Unit"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    products?: ProductListRelationFilter
  }

  export type UnitOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    symbol?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    products?: ProductOrderByRelationAggregateInput
  }

  export type UnitWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_name?: UnitBranchIdNameCompoundUniqueInput
    AND?: UnitWhereInput | UnitWhereInput[]
    OR?: UnitWhereInput[]
    NOT?: UnitWhereInput | UnitWhereInput[]
    name?: StringFilter<"Unit"> | string
    symbol?: StringNullableFilter<"Unit"> | string | null
    branchId?: StringNullableFilter<"Unit"> | string | null
    sortOrder?: IntFilter<"Unit"> | number
    isActive?: BoolFilter<"Unit"> | boolean
    createdAt?: DateTimeFilter<"Unit"> | Date | string
    updatedAt?: DateTimeFilter<"Unit"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    products?: ProductListRelationFilter
  }, "id" | "branchId_name">

  export type UnitOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    symbol?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: UnitCountOrderByAggregateInput
    _avg?: UnitAvgOrderByAggregateInput
    _max?: UnitMaxOrderByAggregateInput
    _min?: UnitMinOrderByAggregateInput
    _sum?: UnitSumOrderByAggregateInput
  }

  export type UnitScalarWhereWithAggregatesInput = {
    AND?: UnitScalarWhereWithAggregatesInput | UnitScalarWhereWithAggregatesInput[]
    OR?: UnitScalarWhereWithAggregatesInput[]
    NOT?: UnitScalarWhereWithAggregatesInput | UnitScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Unit"> | string
    name?: StringWithAggregatesFilter<"Unit"> | string
    symbol?: StringNullableWithAggregatesFilter<"Unit"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Unit"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Unit"> | number
    isActive?: BoolWithAggregatesFilter<"Unit"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Unit"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Unit"> | Date | string
  }

  export type WarehouseWhereInput = {
    AND?: WarehouseWhereInput | WarehouseWhereInput[]
    OR?: WarehouseWhereInput[]
    NOT?: WarehouseWhereInput | WarehouseWhereInput[]
    id?: StringFilter<"Warehouse"> | string
    name?: StringFilter<"Warehouse"> | string
    branchId?: StringNullableFilter<"Warehouse"> | string | null
    email?: StringNullableFilter<"Warehouse"> | string | null
    phone?: StringNullableFilter<"Warehouse"> | string | null
    country?: StringNullableFilter<"Warehouse"> | string | null
    city?: StringNullableFilter<"Warehouse"> | string | null
    zipCode?: StringNullableFilter<"Warehouse"> | string | null
    sortOrder?: IntFilter<"Warehouse"> | number
    isActive?: BoolFilter<"Warehouse"> | boolean
    createdAt?: DateTimeFilter<"Warehouse"> | Date | string
    updatedAt?: DateTimeFilter<"Warehouse"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    products?: ProductListRelationFilter
    adjustments?: InventoryAdjustmentListRelationFilter
    purchases?: PurchaseListRelationFilter
    purchaseReturns?: PurchaseReturnListRelationFilter
    sales?: SaleListRelationFilter
    salesReturns?: SalesReturnListRelationFilter
    expenses?: ExpenseListRelationFilter
    transfersFrom?: InventoryTransferListRelationFilter
    transfersTo?: InventoryTransferListRelationFilter
    stocks?: WarehouseStockListRelationFilter
  }

  export type WarehouseOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrderInput | SortOrder
    email?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    zipCode?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    products?: ProductOrderByRelationAggregateInput
    adjustments?: InventoryAdjustmentOrderByRelationAggregateInput
    purchases?: PurchaseOrderByRelationAggregateInput
    purchaseReturns?: PurchaseReturnOrderByRelationAggregateInput
    sales?: SaleOrderByRelationAggregateInput
    salesReturns?: SalesReturnOrderByRelationAggregateInput
    expenses?: ExpenseOrderByRelationAggregateInput
    transfersFrom?: InventoryTransferOrderByRelationAggregateInput
    transfersTo?: InventoryTransferOrderByRelationAggregateInput
    stocks?: WarehouseStockOrderByRelationAggregateInput
  }

  export type WarehouseWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_name?: WarehouseBranchIdNameCompoundUniqueInput
    AND?: WarehouseWhereInput | WarehouseWhereInput[]
    OR?: WarehouseWhereInput[]
    NOT?: WarehouseWhereInput | WarehouseWhereInput[]
    name?: StringFilter<"Warehouse"> | string
    branchId?: StringNullableFilter<"Warehouse"> | string | null
    email?: StringNullableFilter<"Warehouse"> | string | null
    phone?: StringNullableFilter<"Warehouse"> | string | null
    country?: StringNullableFilter<"Warehouse"> | string | null
    city?: StringNullableFilter<"Warehouse"> | string | null
    zipCode?: StringNullableFilter<"Warehouse"> | string | null
    sortOrder?: IntFilter<"Warehouse"> | number
    isActive?: BoolFilter<"Warehouse"> | boolean
    createdAt?: DateTimeFilter<"Warehouse"> | Date | string
    updatedAt?: DateTimeFilter<"Warehouse"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    products?: ProductListRelationFilter
    adjustments?: InventoryAdjustmentListRelationFilter
    purchases?: PurchaseListRelationFilter
    purchaseReturns?: PurchaseReturnListRelationFilter
    sales?: SaleListRelationFilter
    salesReturns?: SalesReturnListRelationFilter
    expenses?: ExpenseListRelationFilter
    transfersFrom?: InventoryTransferListRelationFilter
    transfersTo?: InventoryTransferListRelationFilter
    stocks?: WarehouseStockListRelationFilter
  }, "id" | "branchId_name">

  export type WarehouseOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrderInput | SortOrder
    email?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    zipCode?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: WarehouseCountOrderByAggregateInput
    _avg?: WarehouseAvgOrderByAggregateInput
    _max?: WarehouseMaxOrderByAggregateInput
    _min?: WarehouseMinOrderByAggregateInput
    _sum?: WarehouseSumOrderByAggregateInput
  }

  export type WarehouseScalarWhereWithAggregatesInput = {
    AND?: WarehouseScalarWhereWithAggregatesInput | WarehouseScalarWhereWithAggregatesInput[]
    OR?: WarehouseScalarWhereWithAggregatesInput[]
    NOT?: WarehouseScalarWhereWithAggregatesInput | WarehouseScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Warehouse"> | string
    name?: StringWithAggregatesFilter<"Warehouse"> | string
    branchId?: StringNullableWithAggregatesFilter<"Warehouse"> | string | null
    email?: StringNullableWithAggregatesFilter<"Warehouse"> | string | null
    phone?: StringNullableWithAggregatesFilter<"Warehouse"> | string | null
    country?: StringNullableWithAggregatesFilter<"Warehouse"> | string | null
    city?: StringNullableWithAggregatesFilter<"Warehouse"> | string | null
    zipCode?: StringNullableWithAggregatesFilter<"Warehouse"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Warehouse"> | number
    isActive?: BoolWithAggregatesFilter<"Warehouse"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Warehouse"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Warehouse"> | Date | string
  }

  export type WarehouseStockWhereInput = {
    AND?: WarehouseStockWhereInput | WarehouseStockWhereInput[]
    OR?: WarehouseStockWhereInput[]
    NOT?: WarehouseStockWhereInput | WarehouseStockWhereInput[]
    id?: StringFilter<"WarehouseStock"> | string
    warehouseId?: StringFilter<"WarehouseStock"> | string
    productId?: StringFilter<"WarehouseStock"> | string
    quantity?: IntFilter<"WarehouseStock"> | number
    createdAt?: DateTimeFilter<"WarehouseStock"> | Date | string
    updatedAt?: DateTimeFilter<"WarehouseStock"> | Date | string
    warehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type WarehouseStockOrderByWithRelationInput = {
    id?: SortOrder
    warehouseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    warehouse?: WarehouseOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type WarehouseStockWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    warehouseId_productId?: WarehouseStockWarehouseIdProductIdCompoundUniqueInput
    AND?: WarehouseStockWhereInput | WarehouseStockWhereInput[]
    OR?: WarehouseStockWhereInput[]
    NOT?: WarehouseStockWhereInput | WarehouseStockWhereInput[]
    warehouseId?: StringFilter<"WarehouseStock"> | string
    productId?: StringFilter<"WarehouseStock"> | string
    quantity?: IntFilter<"WarehouseStock"> | number
    createdAt?: DateTimeFilter<"WarehouseStock"> | Date | string
    updatedAt?: DateTimeFilter<"WarehouseStock"> | Date | string
    warehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id" | "warehouseId_productId">

  export type WarehouseStockOrderByWithAggregationInput = {
    id?: SortOrder
    warehouseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: WarehouseStockCountOrderByAggregateInput
    _avg?: WarehouseStockAvgOrderByAggregateInput
    _max?: WarehouseStockMaxOrderByAggregateInput
    _min?: WarehouseStockMinOrderByAggregateInput
    _sum?: WarehouseStockSumOrderByAggregateInput
  }

  export type WarehouseStockScalarWhereWithAggregatesInput = {
    AND?: WarehouseStockScalarWhereWithAggregatesInput | WarehouseStockScalarWhereWithAggregatesInput[]
    OR?: WarehouseStockScalarWhereWithAggregatesInput[]
    NOT?: WarehouseStockScalarWhereWithAggregatesInput | WarehouseStockScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"WarehouseStock"> | string
    warehouseId?: StringWithAggregatesFilter<"WarehouseStock"> | string
    productId?: StringWithAggregatesFilter<"WarehouseStock"> | string
    quantity?: IntWithAggregatesFilter<"WarehouseStock"> | number
    createdAt?: DateTimeWithAggregatesFilter<"WarehouseStock"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"WarehouseStock"> | Date | string
  }

  export type SupplierWhereInput = {
    AND?: SupplierWhereInput | SupplierWhereInput[]
    OR?: SupplierWhereInput[]
    NOT?: SupplierWhereInput | SupplierWhereInput[]
    id?: StringFilter<"Supplier"> | string
    name?: StringFilter<"Supplier"> | string
    email?: StringNullableFilter<"Supplier"> | string | null
    phone?: StringNullableFilter<"Supplier"> | string | null
    country?: StringNullableFilter<"Supplier"> | string | null
    city?: StringNullableFilter<"Supplier"> | string | null
    zipCode?: StringNullableFilter<"Supplier"> | string | null
    branchId?: StringNullableFilter<"Supplier"> | string | null
    sortOrder?: IntFilter<"Supplier"> | number
    isActive?: BoolFilter<"Supplier"> | boolean
    createdAt?: DateTimeFilter<"Supplier"> | Date | string
    updatedAt?: DateTimeFilter<"Supplier"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Supplier"> | Date | string | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    purchases?: PurchaseListRelationFilter
    purchaseReturns?: PurchaseReturnListRelationFilter
  }

  export type SupplierOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    zipCode?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    branch?: BranchOrderByWithRelationInput
    purchases?: PurchaseOrderByRelationAggregateInput
    purchaseReturns?: PurchaseReturnOrderByRelationAggregateInput
  }

  export type SupplierWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    AND?: SupplierWhereInput | SupplierWhereInput[]
    OR?: SupplierWhereInput[]
    NOT?: SupplierWhereInput | SupplierWhereInput[]
    email?: StringNullableFilter<"Supplier"> | string | null
    phone?: StringNullableFilter<"Supplier"> | string | null
    country?: StringNullableFilter<"Supplier"> | string | null
    city?: StringNullableFilter<"Supplier"> | string | null
    zipCode?: StringNullableFilter<"Supplier"> | string | null
    branchId?: StringNullableFilter<"Supplier"> | string | null
    sortOrder?: IntFilter<"Supplier"> | number
    isActive?: BoolFilter<"Supplier"> | boolean
    createdAt?: DateTimeFilter<"Supplier"> | Date | string
    updatedAt?: DateTimeFilter<"Supplier"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Supplier"> | Date | string | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    purchases?: PurchaseListRelationFilter
    purchaseReturns?: PurchaseReturnListRelationFilter
  }, "id" | "name">

  export type SupplierOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    zipCode?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: SupplierCountOrderByAggregateInput
    _avg?: SupplierAvgOrderByAggregateInput
    _max?: SupplierMaxOrderByAggregateInput
    _min?: SupplierMinOrderByAggregateInput
    _sum?: SupplierSumOrderByAggregateInput
  }

  export type SupplierScalarWhereWithAggregatesInput = {
    AND?: SupplierScalarWhereWithAggregatesInput | SupplierScalarWhereWithAggregatesInput[]
    OR?: SupplierScalarWhereWithAggregatesInput[]
    NOT?: SupplierScalarWhereWithAggregatesInput | SupplierScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Supplier"> | string
    name?: StringWithAggregatesFilter<"Supplier"> | string
    email?: StringNullableWithAggregatesFilter<"Supplier"> | string | null
    phone?: StringNullableWithAggregatesFilter<"Supplier"> | string | null
    country?: StringNullableWithAggregatesFilter<"Supplier"> | string | null
    city?: StringNullableWithAggregatesFilter<"Supplier"> | string | null
    zipCode?: StringNullableWithAggregatesFilter<"Supplier"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Supplier"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Supplier"> | number
    isActive?: BoolWithAggregatesFilter<"Supplier"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Supplier"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Supplier"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null
  }

  export type PurchaseWhereInput = {
    AND?: PurchaseWhereInput | PurchaseWhereInput[]
    OR?: PurchaseWhereInput[]
    NOT?: PurchaseWhereInput | PurchaseWhereInput[]
    id?: StringFilter<"Purchase"> | string
    number?: StringFilter<"Purchase"> | string
    supplierId?: StringNullableFilter<"Purchase"> | string | null
    warehouseId?: StringNullableFilter<"Purchase"> | string | null
    branchId?: StringNullableFilter<"Purchase"> | string | null
    status?: StringFilter<"Purchase"> | string
    purchaseDate?: DateTimeFilter<"Purchase"> | Date | string
    notes?: StringNullableFilter<"Purchase"> | string | null
    subtotal?: FloatFilter<"Purchase"> | number
    taxTotal?: FloatFilter<"Purchase"> | number
    total?: FloatFilter<"Purchase"> | number
    createdAt?: DateTimeFilter<"Purchase"> | Date | string
    updatedAt?: DateTimeFilter<"Purchase"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Purchase"> | Date | string | null
    supplier?: XOR<SupplierNullableScalarRelationFilter, SupplierWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: PurchaseLineListRelationFilter
    returns?: PurchaseReturnListRelationFilter
  }

  export type PurchaseOrderByWithRelationInput = {
    id?: SortOrder
    number?: SortOrder
    supplierId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    purchaseDate?: SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    supplier?: SupplierOrderByWithRelationInput
    warehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    lines?: PurchaseLineOrderByRelationAggregateInput
    returns?: PurchaseReturnOrderByRelationAggregateInput
  }

  export type PurchaseWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    number?: string
    AND?: PurchaseWhereInput | PurchaseWhereInput[]
    OR?: PurchaseWhereInput[]
    NOT?: PurchaseWhereInput | PurchaseWhereInput[]
    supplierId?: StringNullableFilter<"Purchase"> | string | null
    warehouseId?: StringNullableFilter<"Purchase"> | string | null
    branchId?: StringNullableFilter<"Purchase"> | string | null
    status?: StringFilter<"Purchase"> | string
    purchaseDate?: DateTimeFilter<"Purchase"> | Date | string
    notes?: StringNullableFilter<"Purchase"> | string | null
    subtotal?: FloatFilter<"Purchase"> | number
    taxTotal?: FloatFilter<"Purchase"> | number
    total?: FloatFilter<"Purchase"> | number
    createdAt?: DateTimeFilter<"Purchase"> | Date | string
    updatedAt?: DateTimeFilter<"Purchase"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Purchase"> | Date | string | null
    supplier?: XOR<SupplierNullableScalarRelationFilter, SupplierWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: PurchaseLineListRelationFilter
    returns?: PurchaseReturnListRelationFilter
  }, "id" | "number">

  export type PurchaseOrderByWithAggregationInput = {
    id?: SortOrder
    number?: SortOrder
    supplierId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    purchaseDate?: SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: PurchaseCountOrderByAggregateInput
    _avg?: PurchaseAvgOrderByAggregateInput
    _max?: PurchaseMaxOrderByAggregateInput
    _min?: PurchaseMinOrderByAggregateInput
    _sum?: PurchaseSumOrderByAggregateInput
  }

  export type PurchaseScalarWhereWithAggregatesInput = {
    AND?: PurchaseScalarWhereWithAggregatesInput | PurchaseScalarWhereWithAggregatesInput[]
    OR?: PurchaseScalarWhereWithAggregatesInput[]
    NOT?: PurchaseScalarWhereWithAggregatesInput | PurchaseScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Purchase"> | string
    number?: StringWithAggregatesFilter<"Purchase"> | string
    supplierId?: StringNullableWithAggregatesFilter<"Purchase"> | string | null
    warehouseId?: StringNullableWithAggregatesFilter<"Purchase"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Purchase"> | string | null
    status?: StringWithAggregatesFilter<"Purchase"> | string
    purchaseDate?: DateTimeWithAggregatesFilter<"Purchase"> | Date | string
    notes?: StringNullableWithAggregatesFilter<"Purchase"> | string | null
    subtotal?: FloatWithAggregatesFilter<"Purchase"> | number
    taxTotal?: FloatWithAggregatesFilter<"Purchase"> | number
    total?: FloatWithAggregatesFilter<"Purchase"> | number
    createdAt?: DateTimeWithAggregatesFilter<"Purchase"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Purchase"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"Purchase"> | Date | string | null
  }

  export type PurchaseLineWhereInput = {
    AND?: PurchaseLineWhereInput | PurchaseLineWhereInput[]
    OR?: PurchaseLineWhereInput[]
    NOT?: PurchaseLineWhereInput | PurchaseLineWhereInput[]
    id?: StringFilter<"PurchaseLine"> | string
    purchaseId?: StringFilter<"PurchaseLine"> | string
    productId?: StringFilter<"PurchaseLine"> | string
    quantity?: IntFilter<"PurchaseLine"> | number
    unitCost?: FloatFilter<"PurchaseLine"> | number
    taxRate?: FloatFilter<"PurchaseLine"> | number
    lineTotal?: FloatFilter<"PurchaseLine"> | number
    purchase?: XOR<PurchaseScalarRelationFilter, PurchaseWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type PurchaseLineOrderByWithRelationInput = {
    id?: SortOrder
    purchaseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    purchase?: PurchaseOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type PurchaseLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: PurchaseLineWhereInput | PurchaseLineWhereInput[]
    OR?: PurchaseLineWhereInput[]
    NOT?: PurchaseLineWhereInput | PurchaseLineWhereInput[]
    purchaseId?: StringFilter<"PurchaseLine"> | string
    productId?: StringFilter<"PurchaseLine"> | string
    quantity?: IntFilter<"PurchaseLine"> | number
    unitCost?: FloatFilter<"PurchaseLine"> | number
    taxRate?: FloatFilter<"PurchaseLine"> | number
    lineTotal?: FloatFilter<"PurchaseLine"> | number
    purchase?: XOR<PurchaseScalarRelationFilter, PurchaseWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type PurchaseLineOrderByWithAggregationInput = {
    id?: SortOrder
    purchaseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    _count?: PurchaseLineCountOrderByAggregateInput
    _avg?: PurchaseLineAvgOrderByAggregateInput
    _max?: PurchaseLineMaxOrderByAggregateInput
    _min?: PurchaseLineMinOrderByAggregateInput
    _sum?: PurchaseLineSumOrderByAggregateInput
  }

  export type PurchaseLineScalarWhereWithAggregatesInput = {
    AND?: PurchaseLineScalarWhereWithAggregatesInput | PurchaseLineScalarWhereWithAggregatesInput[]
    OR?: PurchaseLineScalarWhereWithAggregatesInput[]
    NOT?: PurchaseLineScalarWhereWithAggregatesInput | PurchaseLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"PurchaseLine"> | string
    purchaseId?: StringWithAggregatesFilter<"PurchaseLine"> | string
    productId?: StringWithAggregatesFilter<"PurchaseLine"> | string
    quantity?: IntWithAggregatesFilter<"PurchaseLine"> | number
    unitCost?: FloatWithAggregatesFilter<"PurchaseLine"> | number
    taxRate?: FloatWithAggregatesFilter<"PurchaseLine"> | number
    lineTotal?: FloatWithAggregatesFilter<"PurchaseLine"> | number
  }

  export type PurchaseReturnWhereInput = {
    AND?: PurchaseReturnWhereInput | PurchaseReturnWhereInput[]
    OR?: PurchaseReturnWhereInput[]
    NOT?: PurchaseReturnWhereInput | PurchaseReturnWhereInput[]
    id?: StringFilter<"PurchaseReturn"> | string
    number?: StringFilter<"PurchaseReturn"> | string
    purchaseId?: StringNullableFilter<"PurchaseReturn"> | string | null
    supplierId?: StringNullableFilter<"PurchaseReturn"> | string | null
    warehouseId?: StringNullableFilter<"PurchaseReturn"> | string | null
    branchId?: StringNullableFilter<"PurchaseReturn"> | string | null
    status?: StringFilter<"PurchaseReturn"> | string
    returnDate?: DateTimeFilter<"PurchaseReturn"> | Date | string
    reason?: StringNullableFilter<"PurchaseReturn"> | string | null
    notes?: StringNullableFilter<"PurchaseReturn"> | string | null
    subtotal?: FloatFilter<"PurchaseReturn"> | number
    taxTotal?: FloatFilter<"PurchaseReturn"> | number
    total?: FloatFilter<"PurchaseReturn"> | number
    createdAt?: DateTimeFilter<"PurchaseReturn"> | Date | string
    updatedAt?: DateTimeFilter<"PurchaseReturn"> | Date | string
    purchase?: XOR<PurchaseNullableScalarRelationFilter, PurchaseWhereInput> | null
    supplier?: XOR<SupplierNullableScalarRelationFilter, SupplierWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: PurchaseReturnLineListRelationFilter
  }

  export type PurchaseReturnOrderByWithRelationInput = {
    id?: SortOrder
    number?: SortOrder
    purchaseId?: SortOrderInput | SortOrder
    supplierId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    purchase?: PurchaseOrderByWithRelationInput
    supplier?: SupplierOrderByWithRelationInput
    warehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    lines?: PurchaseReturnLineOrderByRelationAggregateInput
  }

  export type PurchaseReturnWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    number?: string
    AND?: PurchaseReturnWhereInput | PurchaseReturnWhereInput[]
    OR?: PurchaseReturnWhereInput[]
    NOT?: PurchaseReturnWhereInput | PurchaseReturnWhereInput[]
    purchaseId?: StringNullableFilter<"PurchaseReturn"> | string | null
    supplierId?: StringNullableFilter<"PurchaseReturn"> | string | null
    warehouseId?: StringNullableFilter<"PurchaseReturn"> | string | null
    branchId?: StringNullableFilter<"PurchaseReturn"> | string | null
    status?: StringFilter<"PurchaseReturn"> | string
    returnDate?: DateTimeFilter<"PurchaseReturn"> | Date | string
    reason?: StringNullableFilter<"PurchaseReturn"> | string | null
    notes?: StringNullableFilter<"PurchaseReturn"> | string | null
    subtotal?: FloatFilter<"PurchaseReturn"> | number
    taxTotal?: FloatFilter<"PurchaseReturn"> | number
    total?: FloatFilter<"PurchaseReturn"> | number
    createdAt?: DateTimeFilter<"PurchaseReturn"> | Date | string
    updatedAt?: DateTimeFilter<"PurchaseReturn"> | Date | string
    purchase?: XOR<PurchaseNullableScalarRelationFilter, PurchaseWhereInput> | null
    supplier?: XOR<SupplierNullableScalarRelationFilter, SupplierWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: PurchaseReturnLineListRelationFilter
  }, "id" | "number">

  export type PurchaseReturnOrderByWithAggregationInput = {
    id?: SortOrder
    number?: SortOrder
    purchaseId?: SortOrderInput | SortOrder
    supplierId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: PurchaseReturnCountOrderByAggregateInput
    _avg?: PurchaseReturnAvgOrderByAggregateInput
    _max?: PurchaseReturnMaxOrderByAggregateInput
    _min?: PurchaseReturnMinOrderByAggregateInput
    _sum?: PurchaseReturnSumOrderByAggregateInput
  }

  export type PurchaseReturnScalarWhereWithAggregatesInput = {
    AND?: PurchaseReturnScalarWhereWithAggregatesInput | PurchaseReturnScalarWhereWithAggregatesInput[]
    OR?: PurchaseReturnScalarWhereWithAggregatesInput[]
    NOT?: PurchaseReturnScalarWhereWithAggregatesInput | PurchaseReturnScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"PurchaseReturn"> | string
    number?: StringWithAggregatesFilter<"PurchaseReturn"> | string
    purchaseId?: StringNullableWithAggregatesFilter<"PurchaseReturn"> | string | null
    supplierId?: StringNullableWithAggregatesFilter<"PurchaseReturn"> | string | null
    warehouseId?: StringNullableWithAggregatesFilter<"PurchaseReturn"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"PurchaseReturn"> | string | null
    status?: StringWithAggregatesFilter<"PurchaseReturn"> | string
    returnDate?: DateTimeWithAggregatesFilter<"PurchaseReturn"> | Date | string
    reason?: StringNullableWithAggregatesFilter<"PurchaseReturn"> | string | null
    notes?: StringNullableWithAggregatesFilter<"PurchaseReturn"> | string | null
    subtotal?: FloatWithAggregatesFilter<"PurchaseReturn"> | number
    taxTotal?: FloatWithAggregatesFilter<"PurchaseReturn"> | number
    total?: FloatWithAggregatesFilter<"PurchaseReturn"> | number
    createdAt?: DateTimeWithAggregatesFilter<"PurchaseReturn"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"PurchaseReturn"> | Date | string
  }

  export type PurchaseReturnLineWhereInput = {
    AND?: PurchaseReturnLineWhereInput | PurchaseReturnLineWhereInput[]
    OR?: PurchaseReturnLineWhereInput[]
    NOT?: PurchaseReturnLineWhereInput | PurchaseReturnLineWhereInput[]
    id?: StringFilter<"PurchaseReturnLine"> | string
    purchaseReturnId?: StringFilter<"PurchaseReturnLine"> | string
    productId?: StringFilter<"PurchaseReturnLine"> | string
    quantity?: IntFilter<"PurchaseReturnLine"> | number
    unitCost?: FloatFilter<"PurchaseReturnLine"> | number
    taxRate?: FloatFilter<"PurchaseReturnLine"> | number
    lineTotal?: FloatFilter<"PurchaseReturnLine"> | number
    purchaseReturn?: XOR<PurchaseReturnScalarRelationFilter, PurchaseReturnWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type PurchaseReturnLineOrderByWithRelationInput = {
    id?: SortOrder
    purchaseReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    purchaseReturn?: PurchaseReturnOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type PurchaseReturnLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: PurchaseReturnLineWhereInput | PurchaseReturnLineWhereInput[]
    OR?: PurchaseReturnLineWhereInput[]
    NOT?: PurchaseReturnLineWhereInput | PurchaseReturnLineWhereInput[]
    purchaseReturnId?: StringFilter<"PurchaseReturnLine"> | string
    productId?: StringFilter<"PurchaseReturnLine"> | string
    quantity?: IntFilter<"PurchaseReturnLine"> | number
    unitCost?: FloatFilter<"PurchaseReturnLine"> | number
    taxRate?: FloatFilter<"PurchaseReturnLine"> | number
    lineTotal?: FloatFilter<"PurchaseReturnLine"> | number
    purchaseReturn?: XOR<PurchaseReturnScalarRelationFilter, PurchaseReturnWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type PurchaseReturnLineOrderByWithAggregationInput = {
    id?: SortOrder
    purchaseReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    _count?: PurchaseReturnLineCountOrderByAggregateInput
    _avg?: PurchaseReturnLineAvgOrderByAggregateInput
    _max?: PurchaseReturnLineMaxOrderByAggregateInput
    _min?: PurchaseReturnLineMinOrderByAggregateInput
    _sum?: PurchaseReturnLineSumOrderByAggregateInput
  }

  export type PurchaseReturnLineScalarWhereWithAggregatesInput = {
    AND?: PurchaseReturnLineScalarWhereWithAggregatesInput | PurchaseReturnLineScalarWhereWithAggregatesInput[]
    OR?: PurchaseReturnLineScalarWhereWithAggregatesInput[]
    NOT?: PurchaseReturnLineScalarWhereWithAggregatesInput | PurchaseReturnLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"PurchaseReturnLine"> | string
    purchaseReturnId?: StringWithAggregatesFilter<"PurchaseReturnLine"> | string
    productId?: StringWithAggregatesFilter<"PurchaseReturnLine"> | string
    quantity?: IntWithAggregatesFilter<"PurchaseReturnLine"> | number
    unitCost?: FloatWithAggregatesFilter<"PurchaseReturnLine"> | number
    taxRate?: FloatWithAggregatesFilter<"PurchaseReturnLine"> | number
    lineTotal?: FloatWithAggregatesFilter<"PurchaseReturnLine"> | number
  }

  export type CustomerWhereInput = {
    AND?: CustomerWhereInput | CustomerWhereInput[]
    OR?: CustomerWhereInput[]
    NOT?: CustomerWhereInput | CustomerWhereInput[]
    id?: StringFilter<"Customer"> | string
    name?: StringFilter<"Customer"> | string
    email?: StringNullableFilter<"Customer"> | string | null
    phone?: StringNullableFilter<"Customer"> | string | null
    country?: StringNullableFilter<"Customer"> | string | null
    city?: StringNullableFilter<"Customer"> | string | null
    zipCode?: StringNullableFilter<"Customer"> | string | null
    branchId?: StringNullableFilter<"Customer"> | string | null
    sortOrder?: IntFilter<"Customer"> | number
    isActive?: BoolFilter<"Customer"> | boolean
    createdAt?: DateTimeFilter<"Customer"> | Date | string
    updatedAt?: DateTimeFilter<"Customer"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Customer"> | Date | string | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    invoices?: InvoiceListRelationFilter
    sales?: SaleListRelationFilter
    salesReturns?: SalesReturnListRelationFilter
  }

  export type CustomerOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    zipCode?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    branch?: BranchOrderByWithRelationInput
    invoices?: InvoiceOrderByRelationAggregateInput
    sales?: SaleOrderByRelationAggregateInput
    salesReturns?: SalesReturnOrderByRelationAggregateInput
  }

  export type CustomerWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    AND?: CustomerWhereInput | CustomerWhereInput[]
    OR?: CustomerWhereInput[]
    NOT?: CustomerWhereInput | CustomerWhereInput[]
    email?: StringNullableFilter<"Customer"> | string | null
    phone?: StringNullableFilter<"Customer"> | string | null
    country?: StringNullableFilter<"Customer"> | string | null
    city?: StringNullableFilter<"Customer"> | string | null
    zipCode?: StringNullableFilter<"Customer"> | string | null
    branchId?: StringNullableFilter<"Customer"> | string | null
    sortOrder?: IntFilter<"Customer"> | number
    isActive?: BoolFilter<"Customer"> | boolean
    createdAt?: DateTimeFilter<"Customer"> | Date | string
    updatedAt?: DateTimeFilter<"Customer"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Customer"> | Date | string | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    invoices?: InvoiceListRelationFilter
    sales?: SaleListRelationFilter
    salesReturns?: SalesReturnListRelationFilter
  }, "id" | "name">

  export type CustomerOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrderInput | SortOrder
    phone?: SortOrderInput | SortOrder
    country?: SortOrderInput | SortOrder
    city?: SortOrderInput | SortOrder
    zipCode?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: CustomerCountOrderByAggregateInput
    _avg?: CustomerAvgOrderByAggregateInput
    _max?: CustomerMaxOrderByAggregateInput
    _min?: CustomerMinOrderByAggregateInput
    _sum?: CustomerSumOrderByAggregateInput
  }

  export type CustomerScalarWhereWithAggregatesInput = {
    AND?: CustomerScalarWhereWithAggregatesInput | CustomerScalarWhereWithAggregatesInput[]
    OR?: CustomerScalarWhereWithAggregatesInput[]
    NOT?: CustomerScalarWhereWithAggregatesInput | CustomerScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Customer"> | string
    name?: StringWithAggregatesFilter<"Customer"> | string
    email?: StringNullableWithAggregatesFilter<"Customer"> | string | null
    phone?: StringNullableWithAggregatesFilter<"Customer"> | string | null
    country?: StringNullableWithAggregatesFilter<"Customer"> | string | null
    city?: StringNullableWithAggregatesFilter<"Customer"> | string | null
    zipCode?: StringNullableWithAggregatesFilter<"Customer"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Customer"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Customer"> | number
    isActive?: BoolWithAggregatesFilter<"Customer"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Customer"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Customer"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null
  }

  export type PaymentMethodWhereInput = {
    AND?: PaymentMethodWhereInput | PaymentMethodWhereInput[]
    OR?: PaymentMethodWhereInput[]
    NOT?: PaymentMethodWhereInput | PaymentMethodWhereInput[]
    id?: StringFilter<"PaymentMethod"> | string
    name?: StringFilter<"PaymentMethod"> | string
    branchId?: StringNullableFilter<"PaymentMethod"> | string | null
    sortOrder?: IntFilter<"PaymentMethod"> | number
    isActive?: BoolFilter<"PaymentMethod"> | boolean
    createdAt?: DateTimeFilter<"PaymentMethod"> | Date | string
    updatedAt?: DateTimeFilter<"PaymentMethod"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    sales?: SaleListRelationFilter
    expenses?: ExpenseListRelationFilter
  }

  export type PaymentMethodOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    sales?: SaleOrderByRelationAggregateInput
    expenses?: ExpenseOrderByRelationAggregateInput
  }

  export type PaymentMethodWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_name?: PaymentMethodBranchIdNameCompoundUniqueInput
    AND?: PaymentMethodWhereInput | PaymentMethodWhereInput[]
    OR?: PaymentMethodWhereInput[]
    NOT?: PaymentMethodWhereInput | PaymentMethodWhereInput[]
    name?: StringFilter<"PaymentMethod"> | string
    branchId?: StringNullableFilter<"PaymentMethod"> | string | null
    sortOrder?: IntFilter<"PaymentMethod"> | number
    isActive?: BoolFilter<"PaymentMethod"> | boolean
    createdAt?: DateTimeFilter<"PaymentMethod"> | Date | string
    updatedAt?: DateTimeFilter<"PaymentMethod"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    sales?: SaleListRelationFilter
    expenses?: ExpenseListRelationFilter
  }, "id" | "branchId_name">

  export type PaymentMethodOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: PaymentMethodCountOrderByAggregateInput
    _avg?: PaymentMethodAvgOrderByAggregateInput
    _max?: PaymentMethodMaxOrderByAggregateInput
    _min?: PaymentMethodMinOrderByAggregateInput
    _sum?: PaymentMethodSumOrderByAggregateInput
  }

  export type PaymentMethodScalarWhereWithAggregatesInput = {
    AND?: PaymentMethodScalarWhereWithAggregatesInput | PaymentMethodScalarWhereWithAggregatesInput[]
    OR?: PaymentMethodScalarWhereWithAggregatesInput[]
    NOT?: PaymentMethodScalarWhereWithAggregatesInput | PaymentMethodScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"PaymentMethod"> | string
    name?: StringWithAggregatesFilter<"PaymentMethod"> | string
    branchId?: StringNullableWithAggregatesFilter<"PaymentMethod"> | string | null
    sortOrder?: IntWithAggregatesFilter<"PaymentMethod"> | number
    isActive?: BoolWithAggregatesFilter<"PaymentMethod"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"PaymentMethod"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"PaymentMethod"> | Date | string
  }

  export type SaleWhereInput = {
    AND?: SaleWhereInput | SaleWhereInput[]
    OR?: SaleWhereInput[]
    NOT?: SaleWhereInput | SaleWhereInput[]
    id?: StringFilter<"Sale"> | string
    number?: StringFilter<"Sale"> | string
    customerId?: StringNullableFilter<"Sale"> | string | null
    warehouseId?: StringNullableFilter<"Sale"> | string | null
    branchId?: StringNullableFilter<"Sale"> | string | null
    paymentMethodId?: StringNullableFilter<"Sale"> | string | null
    status?: StringFilter<"Sale"> | string
    saleDate?: DateTimeFilter<"Sale"> | Date | string
    notes?: StringNullableFilter<"Sale"> | string | null
    subtotal?: FloatFilter<"Sale"> | number
    taxTotal?: FloatFilter<"Sale"> | number
    total?: FloatFilter<"Sale"> | number
    amountPaid?: FloatNullableFilter<"Sale"> | number | null
    changeGiven?: FloatNullableFilter<"Sale"> | number | null
    taxBreakdown?: JsonNullableFilter<"Sale">
    createdAt?: DateTimeFilter<"Sale"> | Date | string
    updatedAt?: DateTimeFilter<"Sale"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Sale"> | Date | string | null
    customer?: XOR<CustomerNullableScalarRelationFilter, CustomerWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    paymentMethod?: XOR<PaymentMethodNullableScalarRelationFilter, PaymentMethodWhereInput> | null
    lines?: SaleLineListRelationFilter
    returns?: SalesReturnListRelationFilter
    invoices?: InvoiceListRelationFilter
  }

  export type SaleOrderByWithRelationInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    paymentMethodId?: SortOrderInput | SortOrder
    status?: SortOrder
    saleDate?: SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrderInput | SortOrder
    changeGiven?: SortOrderInput | SortOrder
    taxBreakdown?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    customer?: CustomerOrderByWithRelationInput
    warehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    paymentMethod?: PaymentMethodOrderByWithRelationInput
    lines?: SaleLineOrderByRelationAggregateInput
    returns?: SalesReturnOrderByRelationAggregateInput
    invoices?: InvoiceOrderByRelationAggregateInput
  }

  export type SaleWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    number?: string
    AND?: SaleWhereInput | SaleWhereInput[]
    OR?: SaleWhereInput[]
    NOT?: SaleWhereInput | SaleWhereInput[]
    customerId?: StringNullableFilter<"Sale"> | string | null
    warehouseId?: StringNullableFilter<"Sale"> | string | null
    branchId?: StringNullableFilter<"Sale"> | string | null
    paymentMethodId?: StringNullableFilter<"Sale"> | string | null
    status?: StringFilter<"Sale"> | string
    saleDate?: DateTimeFilter<"Sale"> | Date | string
    notes?: StringNullableFilter<"Sale"> | string | null
    subtotal?: FloatFilter<"Sale"> | number
    taxTotal?: FloatFilter<"Sale"> | number
    total?: FloatFilter<"Sale"> | number
    amountPaid?: FloatNullableFilter<"Sale"> | number | null
    changeGiven?: FloatNullableFilter<"Sale"> | number | null
    taxBreakdown?: JsonNullableFilter<"Sale">
    createdAt?: DateTimeFilter<"Sale"> | Date | string
    updatedAt?: DateTimeFilter<"Sale"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Sale"> | Date | string | null
    customer?: XOR<CustomerNullableScalarRelationFilter, CustomerWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    paymentMethod?: XOR<PaymentMethodNullableScalarRelationFilter, PaymentMethodWhereInput> | null
    lines?: SaleLineListRelationFilter
    returns?: SalesReturnListRelationFilter
    invoices?: InvoiceListRelationFilter
  }, "id" | "number">

  export type SaleOrderByWithAggregationInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    paymentMethodId?: SortOrderInput | SortOrder
    status?: SortOrder
    saleDate?: SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrderInput | SortOrder
    changeGiven?: SortOrderInput | SortOrder
    taxBreakdown?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: SaleCountOrderByAggregateInput
    _avg?: SaleAvgOrderByAggregateInput
    _max?: SaleMaxOrderByAggregateInput
    _min?: SaleMinOrderByAggregateInput
    _sum?: SaleSumOrderByAggregateInput
  }

  export type SaleScalarWhereWithAggregatesInput = {
    AND?: SaleScalarWhereWithAggregatesInput | SaleScalarWhereWithAggregatesInput[]
    OR?: SaleScalarWhereWithAggregatesInput[]
    NOT?: SaleScalarWhereWithAggregatesInput | SaleScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Sale"> | string
    number?: StringWithAggregatesFilter<"Sale"> | string
    customerId?: StringNullableWithAggregatesFilter<"Sale"> | string | null
    warehouseId?: StringNullableWithAggregatesFilter<"Sale"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Sale"> | string | null
    paymentMethodId?: StringNullableWithAggregatesFilter<"Sale"> | string | null
    status?: StringWithAggregatesFilter<"Sale"> | string
    saleDate?: DateTimeWithAggregatesFilter<"Sale"> | Date | string
    notes?: StringNullableWithAggregatesFilter<"Sale"> | string | null
    subtotal?: FloatWithAggregatesFilter<"Sale"> | number
    taxTotal?: FloatWithAggregatesFilter<"Sale"> | number
    total?: FloatWithAggregatesFilter<"Sale"> | number
    amountPaid?: FloatNullableWithAggregatesFilter<"Sale"> | number | null
    changeGiven?: FloatNullableWithAggregatesFilter<"Sale"> | number | null
    taxBreakdown?: JsonNullableWithAggregatesFilter<"Sale">
    createdAt?: DateTimeWithAggregatesFilter<"Sale"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Sale"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"Sale"> | Date | string | null
  }

  export type SaleLineWhereInput = {
    AND?: SaleLineWhereInput | SaleLineWhereInput[]
    OR?: SaleLineWhereInput[]
    NOT?: SaleLineWhereInput | SaleLineWhereInput[]
    id?: StringFilter<"SaleLine"> | string
    saleId?: StringFilter<"SaleLine"> | string
    productId?: StringFilter<"SaleLine"> | string
    quantity?: IntFilter<"SaleLine"> | number
    unitPrice?: FloatFilter<"SaleLine"> | number
    taxRate?: FloatFilter<"SaleLine"> | number
    lineTotal?: FloatFilter<"SaleLine"> | number
    sale?: XOR<SaleScalarRelationFilter, SaleWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type SaleLineOrderByWithRelationInput = {
    id?: SortOrder
    saleId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    sale?: SaleOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type SaleLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: SaleLineWhereInput | SaleLineWhereInput[]
    OR?: SaleLineWhereInput[]
    NOT?: SaleLineWhereInput | SaleLineWhereInput[]
    saleId?: StringFilter<"SaleLine"> | string
    productId?: StringFilter<"SaleLine"> | string
    quantity?: IntFilter<"SaleLine"> | number
    unitPrice?: FloatFilter<"SaleLine"> | number
    taxRate?: FloatFilter<"SaleLine"> | number
    lineTotal?: FloatFilter<"SaleLine"> | number
    sale?: XOR<SaleScalarRelationFilter, SaleWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type SaleLineOrderByWithAggregationInput = {
    id?: SortOrder
    saleId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    _count?: SaleLineCountOrderByAggregateInput
    _avg?: SaleLineAvgOrderByAggregateInput
    _max?: SaleLineMaxOrderByAggregateInput
    _min?: SaleLineMinOrderByAggregateInput
    _sum?: SaleLineSumOrderByAggregateInput
  }

  export type SaleLineScalarWhereWithAggregatesInput = {
    AND?: SaleLineScalarWhereWithAggregatesInput | SaleLineScalarWhereWithAggregatesInput[]
    OR?: SaleLineScalarWhereWithAggregatesInput[]
    NOT?: SaleLineScalarWhereWithAggregatesInput | SaleLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"SaleLine"> | string
    saleId?: StringWithAggregatesFilter<"SaleLine"> | string
    productId?: StringWithAggregatesFilter<"SaleLine"> | string
    quantity?: IntWithAggregatesFilter<"SaleLine"> | number
    unitPrice?: FloatWithAggregatesFilter<"SaleLine"> | number
    taxRate?: FloatWithAggregatesFilter<"SaleLine"> | number
    lineTotal?: FloatWithAggregatesFilter<"SaleLine"> | number
  }

  export type SalesReturnWhereInput = {
    AND?: SalesReturnWhereInput | SalesReturnWhereInput[]
    OR?: SalesReturnWhereInput[]
    NOT?: SalesReturnWhereInput | SalesReturnWhereInput[]
    id?: StringFilter<"SalesReturn"> | string
    number?: StringFilter<"SalesReturn"> | string
    saleId?: StringNullableFilter<"SalesReturn"> | string | null
    customerId?: StringNullableFilter<"SalesReturn"> | string | null
    warehouseId?: StringNullableFilter<"SalesReturn"> | string | null
    branchId?: StringNullableFilter<"SalesReturn"> | string | null
    status?: StringFilter<"SalesReturn"> | string
    returnDate?: DateTimeFilter<"SalesReturn"> | Date | string
    reason?: StringNullableFilter<"SalesReturn"> | string | null
    notes?: StringNullableFilter<"SalesReturn"> | string | null
    subtotal?: FloatFilter<"SalesReturn"> | number
    taxTotal?: FloatFilter<"SalesReturn"> | number
    total?: FloatFilter<"SalesReturn"> | number
    createdAt?: DateTimeFilter<"SalesReturn"> | Date | string
    updatedAt?: DateTimeFilter<"SalesReturn"> | Date | string
    sale?: XOR<SaleNullableScalarRelationFilter, SaleWhereInput> | null
    customer?: XOR<CustomerNullableScalarRelationFilter, CustomerWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: SalesReturnLineListRelationFilter
  }

  export type SalesReturnOrderByWithRelationInput = {
    id?: SortOrder
    number?: SortOrder
    saleId?: SortOrderInput | SortOrder
    customerId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    sale?: SaleOrderByWithRelationInput
    customer?: CustomerOrderByWithRelationInput
    warehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    lines?: SalesReturnLineOrderByRelationAggregateInput
  }

  export type SalesReturnWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    number?: string
    AND?: SalesReturnWhereInput | SalesReturnWhereInput[]
    OR?: SalesReturnWhereInput[]
    NOT?: SalesReturnWhereInput | SalesReturnWhereInput[]
    saleId?: StringNullableFilter<"SalesReturn"> | string | null
    customerId?: StringNullableFilter<"SalesReturn"> | string | null
    warehouseId?: StringNullableFilter<"SalesReturn"> | string | null
    branchId?: StringNullableFilter<"SalesReturn"> | string | null
    status?: StringFilter<"SalesReturn"> | string
    returnDate?: DateTimeFilter<"SalesReturn"> | Date | string
    reason?: StringNullableFilter<"SalesReturn"> | string | null
    notes?: StringNullableFilter<"SalesReturn"> | string | null
    subtotal?: FloatFilter<"SalesReturn"> | number
    taxTotal?: FloatFilter<"SalesReturn"> | number
    total?: FloatFilter<"SalesReturn"> | number
    createdAt?: DateTimeFilter<"SalesReturn"> | Date | string
    updatedAt?: DateTimeFilter<"SalesReturn"> | Date | string
    sale?: XOR<SaleNullableScalarRelationFilter, SaleWhereInput> | null
    customer?: XOR<CustomerNullableScalarRelationFilter, CustomerWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: SalesReturnLineListRelationFilter
  }, "id" | "number">

  export type SalesReturnOrderByWithAggregationInput = {
    id?: SortOrder
    number?: SortOrder
    saleId?: SortOrderInput | SortOrder
    customerId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: SalesReturnCountOrderByAggregateInput
    _avg?: SalesReturnAvgOrderByAggregateInput
    _max?: SalesReturnMaxOrderByAggregateInput
    _min?: SalesReturnMinOrderByAggregateInput
    _sum?: SalesReturnSumOrderByAggregateInput
  }

  export type SalesReturnScalarWhereWithAggregatesInput = {
    AND?: SalesReturnScalarWhereWithAggregatesInput | SalesReturnScalarWhereWithAggregatesInput[]
    OR?: SalesReturnScalarWhereWithAggregatesInput[]
    NOT?: SalesReturnScalarWhereWithAggregatesInput | SalesReturnScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"SalesReturn"> | string
    number?: StringWithAggregatesFilter<"SalesReturn"> | string
    saleId?: StringNullableWithAggregatesFilter<"SalesReturn"> | string | null
    customerId?: StringNullableWithAggregatesFilter<"SalesReturn"> | string | null
    warehouseId?: StringNullableWithAggregatesFilter<"SalesReturn"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"SalesReturn"> | string | null
    status?: StringWithAggregatesFilter<"SalesReturn"> | string
    returnDate?: DateTimeWithAggregatesFilter<"SalesReturn"> | Date | string
    reason?: StringNullableWithAggregatesFilter<"SalesReturn"> | string | null
    notes?: StringNullableWithAggregatesFilter<"SalesReturn"> | string | null
    subtotal?: FloatWithAggregatesFilter<"SalesReturn"> | number
    taxTotal?: FloatWithAggregatesFilter<"SalesReturn"> | number
    total?: FloatWithAggregatesFilter<"SalesReturn"> | number
    createdAt?: DateTimeWithAggregatesFilter<"SalesReturn"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"SalesReturn"> | Date | string
  }

  export type SalesReturnLineWhereInput = {
    AND?: SalesReturnLineWhereInput | SalesReturnLineWhereInput[]
    OR?: SalesReturnLineWhereInput[]
    NOT?: SalesReturnLineWhereInput | SalesReturnLineWhereInput[]
    id?: StringFilter<"SalesReturnLine"> | string
    salesReturnId?: StringFilter<"SalesReturnLine"> | string
    productId?: StringFilter<"SalesReturnLine"> | string
    quantity?: IntFilter<"SalesReturnLine"> | number
    unitPrice?: FloatFilter<"SalesReturnLine"> | number
    taxRate?: FloatFilter<"SalesReturnLine"> | number
    lineTotal?: FloatFilter<"SalesReturnLine"> | number
    salesReturn?: XOR<SalesReturnScalarRelationFilter, SalesReturnWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type SalesReturnLineOrderByWithRelationInput = {
    id?: SortOrder
    salesReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    salesReturn?: SalesReturnOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type SalesReturnLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: SalesReturnLineWhereInput | SalesReturnLineWhereInput[]
    OR?: SalesReturnLineWhereInput[]
    NOT?: SalesReturnLineWhereInput | SalesReturnLineWhereInput[]
    salesReturnId?: StringFilter<"SalesReturnLine"> | string
    productId?: StringFilter<"SalesReturnLine"> | string
    quantity?: IntFilter<"SalesReturnLine"> | number
    unitPrice?: FloatFilter<"SalesReturnLine"> | number
    taxRate?: FloatFilter<"SalesReturnLine"> | number
    lineTotal?: FloatFilter<"SalesReturnLine"> | number
    salesReturn?: XOR<SalesReturnScalarRelationFilter, SalesReturnWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type SalesReturnLineOrderByWithAggregationInput = {
    id?: SortOrder
    salesReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    _count?: SalesReturnLineCountOrderByAggregateInput
    _avg?: SalesReturnLineAvgOrderByAggregateInput
    _max?: SalesReturnLineMaxOrderByAggregateInput
    _min?: SalesReturnLineMinOrderByAggregateInput
    _sum?: SalesReturnLineSumOrderByAggregateInput
  }

  export type SalesReturnLineScalarWhereWithAggregatesInput = {
    AND?: SalesReturnLineScalarWhereWithAggregatesInput | SalesReturnLineScalarWhereWithAggregatesInput[]
    OR?: SalesReturnLineScalarWhereWithAggregatesInput[]
    NOT?: SalesReturnLineScalarWhereWithAggregatesInput | SalesReturnLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"SalesReturnLine"> | string
    salesReturnId?: StringWithAggregatesFilter<"SalesReturnLine"> | string
    productId?: StringWithAggregatesFilter<"SalesReturnLine"> | string
    quantity?: IntWithAggregatesFilter<"SalesReturnLine"> | number
    unitPrice?: FloatWithAggregatesFilter<"SalesReturnLine"> | number
    taxRate?: FloatWithAggregatesFilter<"SalesReturnLine"> | number
    lineTotal?: FloatWithAggregatesFilter<"SalesReturnLine"> | number
  }

  export type TaxWhereInput = {
    AND?: TaxWhereInput | TaxWhereInput[]
    OR?: TaxWhereInput[]
    NOT?: TaxWhereInput | TaxWhereInput[]
    id?: StringFilter<"Tax"> | string
    name?: StringFilter<"Tax"> | string
    rate?: FloatFilter<"Tax"> | number
    branchId?: StringNullableFilter<"Tax"> | string | null
    isActive?: BoolFilter<"Tax"> | boolean
    sortOrder?: IntFilter<"Tax"> | number
    createdAt?: DateTimeFilter<"Tax"> | Date | string
    updatedAt?: DateTimeFilter<"Tax"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    productsSales?: ProductListRelationFilter
    productsPurchase?: ProductListRelationFilter
  }

  export type TaxOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    rate?: SortOrder
    branchId?: SortOrderInput | SortOrder
    isActive?: SortOrder
    sortOrder?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    productsSales?: ProductOrderByRelationAggregateInput
    productsPurchase?: ProductOrderByRelationAggregateInput
  }

  export type TaxWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_name?: TaxBranchIdNameCompoundUniqueInput
    AND?: TaxWhereInput | TaxWhereInput[]
    OR?: TaxWhereInput[]
    NOT?: TaxWhereInput | TaxWhereInput[]
    name?: StringFilter<"Tax"> | string
    rate?: FloatFilter<"Tax"> | number
    branchId?: StringNullableFilter<"Tax"> | string | null
    isActive?: BoolFilter<"Tax"> | boolean
    sortOrder?: IntFilter<"Tax"> | number
    createdAt?: DateTimeFilter<"Tax"> | Date | string
    updatedAt?: DateTimeFilter<"Tax"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    productsSales?: ProductListRelationFilter
    productsPurchase?: ProductListRelationFilter
  }, "id" | "branchId_name">

  export type TaxOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    rate?: SortOrder
    branchId?: SortOrderInput | SortOrder
    isActive?: SortOrder
    sortOrder?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: TaxCountOrderByAggregateInput
    _avg?: TaxAvgOrderByAggregateInput
    _max?: TaxMaxOrderByAggregateInput
    _min?: TaxMinOrderByAggregateInput
    _sum?: TaxSumOrderByAggregateInput
  }

  export type TaxScalarWhereWithAggregatesInput = {
    AND?: TaxScalarWhereWithAggregatesInput | TaxScalarWhereWithAggregatesInput[]
    OR?: TaxScalarWhereWithAggregatesInput[]
    NOT?: TaxScalarWhereWithAggregatesInput | TaxScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Tax"> | string
    name?: StringWithAggregatesFilter<"Tax"> | string
    rate?: FloatWithAggregatesFilter<"Tax"> | number
    branchId?: StringNullableWithAggregatesFilter<"Tax"> | string | null
    isActive?: BoolWithAggregatesFilter<"Tax"> | boolean
    sortOrder?: IntWithAggregatesFilter<"Tax"> | number
    createdAt?: DateTimeWithAggregatesFilter<"Tax"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Tax"> | Date | string
  }

  export type ExpenseCategoryWhereInput = {
    AND?: ExpenseCategoryWhereInput | ExpenseCategoryWhereInput[]
    OR?: ExpenseCategoryWhereInput[]
    NOT?: ExpenseCategoryWhereInput | ExpenseCategoryWhereInput[]
    id?: StringFilter<"ExpenseCategory"> | string
    name?: StringFilter<"ExpenseCategory"> | string
    description?: StringNullableFilter<"ExpenseCategory"> | string | null
    branchId?: StringNullableFilter<"ExpenseCategory"> | string | null
    sortOrder?: IntFilter<"ExpenseCategory"> | number
    isActive?: BoolFilter<"ExpenseCategory"> | boolean
    createdAt?: DateTimeFilter<"ExpenseCategory"> | Date | string
    updatedAt?: DateTimeFilter<"ExpenseCategory"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    expenses?: ExpenseListRelationFilter
  }

  export type ExpenseCategoryOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    description?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    branch?: BranchOrderByWithRelationInput
    expenses?: ExpenseOrderByRelationAggregateInput
  }

  export type ExpenseCategoryWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    branchId_name?: ExpenseCategoryBranchIdNameCompoundUniqueInput
    AND?: ExpenseCategoryWhereInput | ExpenseCategoryWhereInput[]
    OR?: ExpenseCategoryWhereInput[]
    NOT?: ExpenseCategoryWhereInput | ExpenseCategoryWhereInput[]
    name?: StringFilter<"ExpenseCategory"> | string
    description?: StringNullableFilter<"ExpenseCategory"> | string | null
    branchId?: StringNullableFilter<"ExpenseCategory"> | string | null
    sortOrder?: IntFilter<"ExpenseCategory"> | number
    isActive?: BoolFilter<"ExpenseCategory"> | boolean
    createdAt?: DateTimeFilter<"ExpenseCategory"> | Date | string
    updatedAt?: DateTimeFilter<"ExpenseCategory"> | Date | string
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    expenses?: ExpenseListRelationFilter
  }, "id" | "branchId_name">

  export type ExpenseCategoryOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    description?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: ExpenseCategoryCountOrderByAggregateInput
    _avg?: ExpenseCategoryAvgOrderByAggregateInput
    _max?: ExpenseCategoryMaxOrderByAggregateInput
    _min?: ExpenseCategoryMinOrderByAggregateInput
    _sum?: ExpenseCategorySumOrderByAggregateInput
  }

  export type ExpenseCategoryScalarWhereWithAggregatesInput = {
    AND?: ExpenseCategoryScalarWhereWithAggregatesInput | ExpenseCategoryScalarWhereWithAggregatesInput[]
    OR?: ExpenseCategoryScalarWhereWithAggregatesInput[]
    NOT?: ExpenseCategoryScalarWhereWithAggregatesInput | ExpenseCategoryScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"ExpenseCategory"> | string
    name?: StringWithAggregatesFilter<"ExpenseCategory"> | string
    description?: StringNullableWithAggregatesFilter<"ExpenseCategory"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"ExpenseCategory"> | string | null
    sortOrder?: IntWithAggregatesFilter<"ExpenseCategory"> | number
    isActive?: BoolWithAggregatesFilter<"ExpenseCategory"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"ExpenseCategory"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"ExpenseCategory"> | Date | string
  }

  export type ExpenseWhereInput = {
    AND?: ExpenseWhereInput | ExpenseWhereInput[]
    OR?: ExpenseWhereInput[]
    NOT?: ExpenseWhereInput | ExpenseWhereInput[]
    id?: StringFilter<"Expense"> | string
    reference?: StringFilter<"Expense"> | string
    categoryId?: StringNullableFilter<"Expense"> | string | null
    warehouseId?: StringNullableFilter<"Expense"> | string | null
    branchId?: StringNullableFilter<"Expense"> | string | null
    paymentMethodId?: StringNullableFilter<"Expense"> | string | null
    status?: StringFilter<"Expense"> | string
    expenseDate?: DateTimeFilter<"Expense"> | Date | string
    title?: StringNullableFilter<"Expense"> | string | null
    notes?: StringNullableFilter<"Expense"> | string | null
    amount?: FloatFilter<"Expense"> | number
    createdAt?: DateTimeFilter<"Expense"> | Date | string
    updatedAt?: DateTimeFilter<"Expense"> | Date | string
    category?: XOR<ExpenseCategoryNullableScalarRelationFilter, ExpenseCategoryWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    paymentMethod?: XOR<PaymentMethodNullableScalarRelationFilter, PaymentMethodWhereInput> | null
  }

  export type ExpenseOrderByWithRelationInput = {
    id?: SortOrder
    reference?: SortOrder
    categoryId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    paymentMethodId?: SortOrderInput | SortOrder
    status?: SortOrder
    expenseDate?: SortOrder
    title?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    amount?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    category?: ExpenseCategoryOrderByWithRelationInput
    warehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    paymentMethod?: PaymentMethodOrderByWithRelationInput
  }

  export type ExpenseWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    reference?: string
    AND?: ExpenseWhereInput | ExpenseWhereInput[]
    OR?: ExpenseWhereInput[]
    NOT?: ExpenseWhereInput | ExpenseWhereInput[]
    categoryId?: StringNullableFilter<"Expense"> | string | null
    warehouseId?: StringNullableFilter<"Expense"> | string | null
    branchId?: StringNullableFilter<"Expense"> | string | null
    paymentMethodId?: StringNullableFilter<"Expense"> | string | null
    status?: StringFilter<"Expense"> | string
    expenseDate?: DateTimeFilter<"Expense"> | Date | string
    title?: StringNullableFilter<"Expense"> | string | null
    notes?: StringNullableFilter<"Expense"> | string | null
    amount?: FloatFilter<"Expense"> | number
    createdAt?: DateTimeFilter<"Expense"> | Date | string
    updatedAt?: DateTimeFilter<"Expense"> | Date | string
    category?: XOR<ExpenseCategoryNullableScalarRelationFilter, ExpenseCategoryWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    paymentMethod?: XOR<PaymentMethodNullableScalarRelationFilter, PaymentMethodWhereInput> | null
  }, "id" | "reference">

  export type ExpenseOrderByWithAggregationInput = {
    id?: SortOrder
    reference?: SortOrder
    categoryId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    paymentMethodId?: SortOrderInput | SortOrder
    status?: SortOrder
    expenseDate?: SortOrder
    title?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    amount?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: ExpenseCountOrderByAggregateInput
    _avg?: ExpenseAvgOrderByAggregateInput
    _max?: ExpenseMaxOrderByAggregateInput
    _min?: ExpenseMinOrderByAggregateInput
    _sum?: ExpenseSumOrderByAggregateInput
  }

  export type ExpenseScalarWhereWithAggregatesInput = {
    AND?: ExpenseScalarWhereWithAggregatesInput | ExpenseScalarWhereWithAggregatesInput[]
    OR?: ExpenseScalarWhereWithAggregatesInput[]
    NOT?: ExpenseScalarWhereWithAggregatesInput | ExpenseScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Expense"> | string
    reference?: StringWithAggregatesFilter<"Expense"> | string
    categoryId?: StringNullableWithAggregatesFilter<"Expense"> | string | null
    warehouseId?: StringNullableWithAggregatesFilter<"Expense"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Expense"> | string | null
    paymentMethodId?: StringNullableWithAggregatesFilter<"Expense"> | string | null
    status?: StringWithAggregatesFilter<"Expense"> | string
    expenseDate?: DateTimeWithAggregatesFilter<"Expense"> | Date | string
    title?: StringNullableWithAggregatesFilter<"Expense"> | string | null
    notes?: StringNullableWithAggregatesFilter<"Expense"> | string | null
    amount?: FloatWithAggregatesFilter<"Expense"> | number
    createdAt?: DateTimeWithAggregatesFilter<"Expense"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Expense"> | Date | string
  }

  export type ProductWhereInput = {
    AND?: ProductWhereInput | ProductWhereInput[]
    OR?: ProductWhereInput[]
    NOT?: ProductWhereInput | ProductWhereInput[]
    id?: StringFilter<"Product"> | string
    name?: StringFilter<"Product"> | string
    sku?: StringFilter<"Product"> | string
    barcode?: StringNullableFilter<"Product"> | string | null
    description?: StringNullableFilter<"Product"> | string | null
    isReturnable?: BoolFilter<"Product"> | boolean
    branchId?: StringNullableFilter<"Product"> | string | null
    categoryId?: StringNullableFilter<"Product"> | string | null
    unitId?: StringNullableFilter<"Product"> | string | null
    brandId?: StringNullableFilter<"Product"> | string | null
    expiryDate?: DateTimeNullableFilter<"Product"> | Date | string | null
    productType?: StringNullableFilter<"Product"> | string | null
    variationIds?: JsonNullableFilter<"Product">
    quantity?: IntFilter<"Product"> | number
    images?: JsonNullableFilter<"Product">
    sellingPrice?: FloatNullableFilter<"Product"> | number | null
    salesTaxId?: StringNullableFilter<"Product"> | string | null
    costPrice?: FloatNullableFilter<"Product"> | number | null
    purchaseTaxId?: StringNullableFilter<"Product"> | string | null
    warehouseId?: StringNullableFilter<"Product"> | string | null
    sortOrder?: IntFilter<"Product"> | number
    isActive?: BoolFilter<"Product"> | boolean
    createdAt?: DateTimeFilter<"Product"> | Date | string
    updatedAt?: DateTimeFilter<"Product"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Product"> | Date | string | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    category?: XOR<CategoryNullableScalarRelationFilter, CategoryWhereInput> | null
    unit?: XOR<UnitNullableScalarRelationFilter, UnitWhereInput> | null
    brand?: XOR<BrandNullableScalarRelationFilter, BrandWhereInput> | null
    salesTax?: XOR<TaxNullableScalarRelationFilter, TaxWhereInput> | null
    purchaseTax?: XOR<TaxNullableScalarRelationFilter, TaxWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    adjustmentLines?: InventoryAdjustmentLineListRelationFilter
    invoiceLines?: InvoiceLineListRelationFilter
    purchaseLines?: PurchaseLineListRelationFilter
    purchaseReturnLines?: PurchaseReturnLineListRelationFilter
    saleLines?: SaleLineListRelationFilter
    salesReturnLines?: SalesReturnLineListRelationFilter
    transferLines?: InventoryTransferLineListRelationFilter
    warehouseStocks?: WarehouseStockListRelationFilter
  }

  export type ProductOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    sku?: SortOrder
    barcode?: SortOrderInput | SortOrder
    description?: SortOrderInput | SortOrder
    isReturnable?: SortOrder
    branchId?: SortOrderInput | SortOrder
    categoryId?: SortOrderInput | SortOrder
    unitId?: SortOrderInput | SortOrder
    brandId?: SortOrderInput | SortOrder
    expiryDate?: SortOrderInput | SortOrder
    productType?: SortOrderInput | SortOrder
    variationIds?: SortOrderInput | SortOrder
    quantity?: SortOrder
    images?: SortOrderInput | SortOrder
    sellingPrice?: SortOrderInput | SortOrder
    salesTaxId?: SortOrderInput | SortOrder
    costPrice?: SortOrderInput | SortOrder
    purchaseTaxId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    branch?: BranchOrderByWithRelationInput
    category?: CategoryOrderByWithRelationInput
    unit?: UnitOrderByWithRelationInput
    brand?: BrandOrderByWithRelationInput
    salesTax?: TaxOrderByWithRelationInput
    purchaseTax?: TaxOrderByWithRelationInput
    warehouse?: WarehouseOrderByWithRelationInput
    adjustmentLines?: InventoryAdjustmentLineOrderByRelationAggregateInput
    invoiceLines?: InvoiceLineOrderByRelationAggregateInput
    purchaseLines?: PurchaseLineOrderByRelationAggregateInput
    purchaseReturnLines?: PurchaseReturnLineOrderByRelationAggregateInput
    saleLines?: SaleLineOrderByRelationAggregateInput
    salesReturnLines?: SalesReturnLineOrderByRelationAggregateInput
    transferLines?: InventoryTransferLineOrderByRelationAggregateInput
    warehouseStocks?: WarehouseStockOrderByRelationAggregateInput
  }

  export type ProductWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    sku?: string
    AND?: ProductWhereInput | ProductWhereInput[]
    OR?: ProductWhereInput[]
    NOT?: ProductWhereInput | ProductWhereInput[]
    name?: StringFilter<"Product"> | string
    barcode?: StringNullableFilter<"Product"> | string | null
    description?: StringNullableFilter<"Product"> | string | null
    isReturnable?: BoolFilter<"Product"> | boolean
    branchId?: StringNullableFilter<"Product"> | string | null
    categoryId?: StringNullableFilter<"Product"> | string | null
    unitId?: StringNullableFilter<"Product"> | string | null
    brandId?: StringNullableFilter<"Product"> | string | null
    expiryDate?: DateTimeNullableFilter<"Product"> | Date | string | null
    productType?: StringNullableFilter<"Product"> | string | null
    variationIds?: JsonNullableFilter<"Product">
    quantity?: IntFilter<"Product"> | number
    images?: JsonNullableFilter<"Product">
    sellingPrice?: FloatNullableFilter<"Product"> | number | null
    salesTaxId?: StringNullableFilter<"Product"> | string | null
    costPrice?: FloatNullableFilter<"Product"> | number | null
    purchaseTaxId?: StringNullableFilter<"Product"> | string | null
    warehouseId?: StringNullableFilter<"Product"> | string | null
    sortOrder?: IntFilter<"Product"> | number
    isActive?: BoolFilter<"Product"> | boolean
    createdAt?: DateTimeFilter<"Product"> | Date | string
    updatedAt?: DateTimeFilter<"Product"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Product"> | Date | string | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    category?: XOR<CategoryNullableScalarRelationFilter, CategoryWhereInput> | null
    unit?: XOR<UnitNullableScalarRelationFilter, UnitWhereInput> | null
    brand?: XOR<BrandNullableScalarRelationFilter, BrandWhereInput> | null
    salesTax?: XOR<TaxNullableScalarRelationFilter, TaxWhereInput> | null
    purchaseTax?: XOR<TaxNullableScalarRelationFilter, TaxWhereInput> | null
    warehouse?: XOR<WarehouseNullableScalarRelationFilter, WarehouseWhereInput> | null
    adjustmentLines?: InventoryAdjustmentLineListRelationFilter
    invoiceLines?: InvoiceLineListRelationFilter
    purchaseLines?: PurchaseLineListRelationFilter
    purchaseReturnLines?: PurchaseReturnLineListRelationFilter
    saleLines?: SaleLineListRelationFilter
    salesReturnLines?: SalesReturnLineListRelationFilter
    transferLines?: InventoryTransferLineListRelationFilter
    warehouseStocks?: WarehouseStockListRelationFilter
  }, "id" | "sku">

  export type ProductOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    sku?: SortOrder
    barcode?: SortOrderInput | SortOrder
    description?: SortOrderInput | SortOrder
    isReturnable?: SortOrder
    branchId?: SortOrderInput | SortOrder
    categoryId?: SortOrderInput | SortOrder
    unitId?: SortOrderInput | SortOrder
    brandId?: SortOrderInput | SortOrder
    expiryDate?: SortOrderInput | SortOrder
    productType?: SortOrderInput | SortOrder
    variationIds?: SortOrderInput | SortOrder
    quantity?: SortOrder
    images?: SortOrderInput | SortOrder
    sellingPrice?: SortOrderInput | SortOrder
    salesTaxId?: SortOrderInput | SortOrder
    costPrice?: SortOrderInput | SortOrder
    purchaseTaxId?: SortOrderInput | SortOrder
    warehouseId?: SortOrderInput | SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: ProductCountOrderByAggregateInput
    _avg?: ProductAvgOrderByAggregateInput
    _max?: ProductMaxOrderByAggregateInput
    _min?: ProductMinOrderByAggregateInput
    _sum?: ProductSumOrderByAggregateInput
  }

  export type ProductScalarWhereWithAggregatesInput = {
    AND?: ProductScalarWhereWithAggregatesInput | ProductScalarWhereWithAggregatesInput[]
    OR?: ProductScalarWhereWithAggregatesInput[]
    NOT?: ProductScalarWhereWithAggregatesInput | ProductScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Product"> | string
    name?: StringWithAggregatesFilter<"Product"> | string
    sku?: StringWithAggregatesFilter<"Product"> | string
    barcode?: StringNullableWithAggregatesFilter<"Product"> | string | null
    description?: StringNullableWithAggregatesFilter<"Product"> | string | null
    isReturnable?: BoolWithAggregatesFilter<"Product"> | boolean
    branchId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    categoryId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    unitId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    brandId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    expiryDate?: DateTimeNullableWithAggregatesFilter<"Product"> | Date | string | null
    productType?: StringNullableWithAggregatesFilter<"Product"> | string | null
    variationIds?: JsonNullableWithAggregatesFilter<"Product">
    quantity?: IntWithAggregatesFilter<"Product"> | number
    images?: JsonNullableWithAggregatesFilter<"Product">
    sellingPrice?: FloatNullableWithAggregatesFilter<"Product"> | number | null
    salesTaxId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    costPrice?: FloatNullableWithAggregatesFilter<"Product"> | number | null
    purchaseTaxId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    warehouseId?: StringNullableWithAggregatesFilter<"Product"> | string | null
    sortOrder?: IntWithAggregatesFilter<"Product"> | number
    isActive?: BoolWithAggregatesFilter<"Product"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Product"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Product"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"Product"> | Date | string | null
  }

  export type InventoryTransferWhereInput = {
    AND?: InventoryTransferWhereInput | InventoryTransferWhereInput[]
    OR?: InventoryTransferWhereInput[]
    NOT?: InventoryTransferWhereInput | InventoryTransferWhereInput[]
    id?: StringFilter<"InventoryTransfer"> | string
    reference?: StringFilter<"InventoryTransfer"> | string
    fromWarehouseId?: StringFilter<"InventoryTransfer"> | string
    toWarehouseId?: StringFilter<"InventoryTransfer"> | string
    branchId?: StringNullableFilter<"InventoryTransfer"> | string | null
    status?: StringFilter<"InventoryTransfer"> | string
    transferDate?: DateTimeFilter<"InventoryTransfer"> | Date | string
    notes?: StringNullableFilter<"InventoryTransfer"> | string | null
    createdAt?: DateTimeFilter<"InventoryTransfer"> | Date | string
    updatedAt?: DateTimeFilter<"InventoryTransfer"> | Date | string
    fromWarehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    toWarehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: InventoryTransferLineListRelationFilter
  }

  export type InventoryTransferOrderByWithRelationInput = {
    id?: SortOrder
    reference?: SortOrder
    fromWarehouseId?: SortOrder
    toWarehouseId?: SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    transferDate?: SortOrder
    notes?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    fromWarehouse?: WarehouseOrderByWithRelationInput
    toWarehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    lines?: InventoryTransferLineOrderByRelationAggregateInput
  }

  export type InventoryTransferWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    reference?: string
    AND?: InventoryTransferWhereInput | InventoryTransferWhereInput[]
    OR?: InventoryTransferWhereInput[]
    NOT?: InventoryTransferWhereInput | InventoryTransferWhereInput[]
    fromWarehouseId?: StringFilter<"InventoryTransfer"> | string
    toWarehouseId?: StringFilter<"InventoryTransfer"> | string
    branchId?: StringNullableFilter<"InventoryTransfer"> | string | null
    status?: StringFilter<"InventoryTransfer"> | string
    transferDate?: DateTimeFilter<"InventoryTransfer"> | Date | string
    notes?: StringNullableFilter<"InventoryTransfer"> | string | null
    createdAt?: DateTimeFilter<"InventoryTransfer"> | Date | string
    updatedAt?: DateTimeFilter<"InventoryTransfer"> | Date | string
    fromWarehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    toWarehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: InventoryTransferLineListRelationFilter
  }, "id" | "reference">

  export type InventoryTransferOrderByWithAggregationInput = {
    id?: SortOrder
    reference?: SortOrder
    fromWarehouseId?: SortOrder
    toWarehouseId?: SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    transferDate?: SortOrder
    notes?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: InventoryTransferCountOrderByAggregateInput
    _max?: InventoryTransferMaxOrderByAggregateInput
    _min?: InventoryTransferMinOrderByAggregateInput
  }

  export type InventoryTransferScalarWhereWithAggregatesInput = {
    AND?: InventoryTransferScalarWhereWithAggregatesInput | InventoryTransferScalarWhereWithAggregatesInput[]
    OR?: InventoryTransferScalarWhereWithAggregatesInput[]
    NOT?: InventoryTransferScalarWhereWithAggregatesInput | InventoryTransferScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"InventoryTransfer"> | string
    reference?: StringWithAggregatesFilter<"InventoryTransfer"> | string
    fromWarehouseId?: StringWithAggregatesFilter<"InventoryTransfer"> | string
    toWarehouseId?: StringWithAggregatesFilter<"InventoryTransfer"> | string
    branchId?: StringNullableWithAggregatesFilter<"InventoryTransfer"> | string | null
    status?: StringWithAggregatesFilter<"InventoryTransfer"> | string
    transferDate?: DateTimeWithAggregatesFilter<"InventoryTransfer"> | Date | string
    notes?: StringNullableWithAggregatesFilter<"InventoryTransfer"> | string | null
    createdAt?: DateTimeWithAggregatesFilter<"InventoryTransfer"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"InventoryTransfer"> | Date | string
  }

  export type InventoryTransferLineWhereInput = {
    AND?: InventoryTransferLineWhereInput | InventoryTransferLineWhereInput[]
    OR?: InventoryTransferLineWhereInput[]
    NOT?: InventoryTransferLineWhereInput | InventoryTransferLineWhereInput[]
    id?: StringFilter<"InventoryTransferLine"> | string
    transferId?: StringFilter<"InventoryTransferLine"> | string
    productId?: StringFilter<"InventoryTransferLine"> | string
    quantity?: IntFilter<"InventoryTransferLine"> | number
    transfer?: XOR<InventoryTransferScalarRelationFilter, InventoryTransferWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type InventoryTransferLineOrderByWithRelationInput = {
    id?: SortOrder
    transferId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    transfer?: InventoryTransferOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type InventoryTransferLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: InventoryTransferLineWhereInput | InventoryTransferLineWhereInput[]
    OR?: InventoryTransferLineWhereInput[]
    NOT?: InventoryTransferLineWhereInput | InventoryTransferLineWhereInput[]
    transferId?: StringFilter<"InventoryTransferLine"> | string
    productId?: StringFilter<"InventoryTransferLine"> | string
    quantity?: IntFilter<"InventoryTransferLine"> | number
    transfer?: XOR<InventoryTransferScalarRelationFilter, InventoryTransferWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type InventoryTransferLineOrderByWithAggregationInput = {
    id?: SortOrder
    transferId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    _count?: InventoryTransferLineCountOrderByAggregateInput
    _avg?: InventoryTransferLineAvgOrderByAggregateInput
    _max?: InventoryTransferLineMaxOrderByAggregateInput
    _min?: InventoryTransferLineMinOrderByAggregateInput
    _sum?: InventoryTransferLineSumOrderByAggregateInput
  }

  export type InventoryTransferLineScalarWhereWithAggregatesInput = {
    AND?: InventoryTransferLineScalarWhereWithAggregatesInput | InventoryTransferLineScalarWhereWithAggregatesInput[]
    OR?: InventoryTransferLineScalarWhereWithAggregatesInput[]
    NOT?: InventoryTransferLineScalarWhereWithAggregatesInput | InventoryTransferLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"InventoryTransferLine"> | string
    transferId?: StringWithAggregatesFilter<"InventoryTransferLine"> | string
    productId?: StringWithAggregatesFilter<"InventoryTransferLine"> | string
    quantity?: IntWithAggregatesFilter<"InventoryTransferLine"> | number
  }

  export type InvoiceWhereInput = {
    AND?: InvoiceWhereInput | InvoiceWhereInput[]
    OR?: InvoiceWhereInput[]
    NOT?: InvoiceWhereInput | InvoiceWhereInput[]
    id?: StringFilter<"Invoice"> | string
    number?: StringFilter<"Invoice"> | string
    customerId?: StringNullableFilter<"Invoice"> | string | null
    saleId?: StringNullableFilter<"Invoice"> | string | null
    branchId?: StringNullableFilter<"Invoice"> | string | null
    status?: StringFilter<"Invoice"> | string
    issueDate?: DateTimeFilter<"Invoice"> | Date | string
    dueDate?: DateTimeNullableFilter<"Invoice"> | Date | string | null
    notes?: StringNullableFilter<"Invoice"> | string | null
    subtotal?: FloatFilter<"Invoice"> | number
    taxTotal?: FloatFilter<"Invoice"> | number
    total?: FloatFilter<"Invoice"> | number
    createdAt?: DateTimeFilter<"Invoice"> | Date | string
    updatedAt?: DateTimeFilter<"Invoice"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Invoice"> | Date | string | null
    customer?: XOR<CustomerNullableScalarRelationFilter, CustomerWhereInput> | null
    sale?: XOR<SaleNullableScalarRelationFilter, SaleWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: InvoiceLineListRelationFilter
  }

  export type InvoiceOrderByWithRelationInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrderInput | SortOrder
    saleId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    issueDate?: SortOrder
    dueDate?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    customer?: CustomerOrderByWithRelationInput
    sale?: SaleOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    lines?: InvoiceLineOrderByRelationAggregateInput
  }

  export type InvoiceWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    number?: string
    AND?: InvoiceWhereInput | InvoiceWhereInput[]
    OR?: InvoiceWhereInput[]
    NOT?: InvoiceWhereInput | InvoiceWhereInput[]
    customerId?: StringNullableFilter<"Invoice"> | string | null
    saleId?: StringNullableFilter<"Invoice"> | string | null
    branchId?: StringNullableFilter<"Invoice"> | string | null
    status?: StringFilter<"Invoice"> | string
    issueDate?: DateTimeFilter<"Invoice"> | Date | string
    dueDate?: DateTimeNullableFilter<"Invoice"> | Date | string | null
    notes?: StringNullableFilter<"Invoice"> | string | null
    subtotal?: FloatFilter<"Invoice"> | number
    taxTotal?: FloatFilter<"Invoice"> | number
    total?: FloatFilter<"Invoice"> | number
    createdAt?: DateTimeFilter<"Invoice"> | Date | string
    updatedAt?: DateTimeFilter<"Invoice"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Invoice"> | Date | string | null
    customer?: XOR<CustomerNullableScalarRelationFilter, CustomerWhereInput> | null
    sale?: XOR<SaleNullableScalarRelationFilter, SaleWhereInput> | null
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: InvoiceLineListRelationFilter
  }, "id" | "number">

  export type InvoiceOrderByWithAggregationInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrderInput | SortOrder
    saleId?: SortOrderInput | SortOrder
    branchId?: SortOrderInput | SortOrder
    status?: SortOrder
    issueDate?: SortOrder
    dueDate?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrderInput | SortOrder
    _count?: InvoiceCountOrderByAggregateInput
    _avg?: InvoiceAvgOrderByAggregateInput
    _max?: InvoiceMaxOrderByAggregateInput
    _min?: InvoiceMinOrderByAggregateInput
    _sum?: InvoiceSumOrderByAggregateInput
  }

  export type InvoiceScalarWhereWithAggregatesInput = {
    AND?: InvoiceScalarWhereWithAggregatesInput | InvoiceScalarWhereWithAggregatesInput[]
    OR?: InvoiceScalarWhereWithAggregatesInput[]
    NOT?: InvoiceScalarWhereWithAggregatesInput | InvoiceScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Invoice"> | string
    number?: StringWithAggregatesFilter<"Invoice"> | string
    customerId?: StringNullableWithAggregatesFilter<"Invoice"> | string | null
    saleId?: StringNullableWithAggregatesFilter<"Invoice"> | string | null
    branchId?: StringNullableWithAggregatesFilter<"Invoice"> | string | null
    status?: StringWithAggregatesFilter<"Invoice"> | string
    issueDate?: DateTimeWithAggregatesFilter<"Invoice"> | Date | string
    dueDate?: DateTimeNullableWithAggregatesFilter<"Invoice"> | Date | string | null
    notes?: StringNullableWithAggregatesFilter<"Invoice"> | string | null
    subtotal?: FloatWithAggregatesFilter<"Invoice"> | number
    taxTotal?: FloatWithAggregatesFilter<"Invoice"> | number
    total?: FloatWithAggregatesFilter<"Invoice"> | number
    createdAt?: DateTimeWithAggregatesFilter<"Invoice"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"Invoice"> | Date | string
    deletedAt?: DateTimeNullableWithAggregatesFilter<"Invoice"> | Date | string | null
  }

  export type InvoiceLineWhereInput = {
    AND?: InvoiceLineWhereInput | InvoiceLineWhereInput[]
    OR?: InvoiceLineWhereInput[]
    NOT?: InvoiceLineWhereInput | InvoiceLineWhereInput[]
    id?: StringFilter<"InvoiceLine"> | string
    invoiceId?: StringFilter<"InvoiceLine"> | string
    productId?: StringFilter<"InvoiceLine"> | string
    quantity?: IntFilter<"InvoiceLine"> | number
    unitPrice?: FloatFilter<"InvoiceLine"> | number
    taxRate?: FloatFilter<"InvoiceLine"> | number
    lineTotal?: FloatFilter<"InvoiceLine"> | number
    invoice?: XOR<InvoiceScalarRelationFilter, InvoiceWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type InvoiceLineOrderByWithRelationInput = {
    id?: SortOrder
    invoiceId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    invoice?: InvoiceOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type InvoiceLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: InvoiceLineWhereInput | InvoiceLineWhereInput[]
    OR?: InvoiceLineWhereInput[]
    NOT?: InvoiceLineWhereInput | InvoiceLineWhereInput[]
    invoiceId?: StringFilter<"InvoiceLine"> | string
    productId?: StringFilter<"InvoiceLine"> | string
    quantity?: IntFilter<"InvoiceLine"> | number
    unitPrice?: FloatFilter<"InvoiceLine"> | number
    taxRate?: FloatFilter<"InvoiceLine"> | number
    lineTotal?: FloatFilter<"InvoiceLine"> | number
    invoice?: XOR<InvoiceScalarRelationFilter, InvoiceWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type InvoiceLineOrderByWithAggregationInput = {
    id?: SortOrder
    invoiceId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
    _count?: InvoiceLineCountOrderByAggregateInput
    _avg?: InvoiceLineAvgOrderByAggregateInput
    _max?: InvoiceLineMaxOrderByAggregateInput
    _min?: InvoiceLineMinOrderByAggregateInput
    _sum?: InvoiceLineSumOrderByAggregateInput
  }

  export type InvoiceLineScalarWhereWithAggregatesInput = {
    AND?: InvoiceLineScalarWhereWithAggregatesInput | InvoiceLineScalarWhereWithAggregatesInput[]
    OR?: InvoiceLineScalarWhereWithAggregatesInput[]
    NOT?: InvoiceLineScalarWhereWithAggregatesInput | InvoiceLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"InvoiceLine"> | string
    invoiceId?: StringWithAggregatesFilter<"InvoiceLine"> | string
    productId?: StringWithAggregatesFilter<"InvoiceLine"> | string
    quantity?: IntWithAggregatesFilter<"InvoiceLine"> | number
    unitPrice?: FloatWithAggregatesFilter<"InvoiceLine"> | number
    taxRate?: FloatWithAggregatesFilter<"InvoiceLine"> | number
    lineTotal?: FloatWithAggregatesFilter<"InvoiceLine"> | number
  }

  export type InventoryAdjustmentWhereInput = {
    AND?: InventoryAdjustmentWhereInput | InventoryAdjustmentWhereInput[]
    OR?: InventoryAdjustmentWhereInput[]
    NOT?: InventoryAdjustmentWhereInput | InventoryAdjustmentWhereInput[]
    id?: StringFilter<"InventoryAdjustment"> | string
    reference?: StringNullableFilter<"InventoryAdjustment"> | string | null
    warehouseId?: StringFilter<"InventoryAdjustment"> | string
    branchId?: StringNullableFilter<"InventoryAdjustment"> | string | null
    type?: StringFilter<"InventoryAdjustment"> | string
    reason?: StringNullableFilter<"InventoryAdjustment"> | string | null
    notes?: StringNullableFilter<"InventoryAdjustment"> | string | null
    status?: StringFilter<"InventoryAdjustment"> | string
    createdAt?: DateTimeFilter<"InventoryAdjustment"> | Date | string
    updatedAt?: DateTimeFilter<"InventoryAdjustment"> | Date | string
    warehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: InventoryAdjustmentLineListRelationFilter
  }

  export type InventoryAdjustmentOrderByWithRelationInput = {
    id?: SortOrder
    reference?: SortOrderInput | SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrderInput | SortOrder
    type?: SortOrder
    reason?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    status?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    warehouse?: WarehouseOrderByWithRelationInput
    branch?: BranchOrderByWithRelationInput
    lines?: InventoryAdjustmentLineOrderByRelationAggregateInput
  }

  export type InventoryAdjustmentWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    reference?: string
    AND?: InventoryAdjustmentWhereInput | InventoryAdjustmentWhereInput[]
    OR?: InventoryAdjustmentWhereInput[]
    NOT?: InventoryAdjustmentWhereInput | InventoryAdjustmentWhereInput[]
    warehouseId?: StringFilter<"InventoryAdjustment"> | string
    branchId?: StringNullableFilter<"InventoryAdjustment"> | string | null
    type?: StringFilter<"InventoryAdjustment"> | string
    reason?: StringNullableFilter<"InventoryAdjustment"> | string | null
    notes?: StringNullableFilter<"InventoryAdjustment"> | string | null
    status?: StringFilter<"InventoryAdjustment"> | string
    createdAt?: DateTimeFilter<"InventoryAdjustment"> | Date | string
    updatedAt?: DateTimeFilter<"InventoryAdjustment"> | Date | string
    warehouse?: XOR<WarehouseScalarRelationFilter, WarehouseWhereInput>
    branch?: XOR<BranchNullableScalarRelationFilter, BranchWhereInput> | null
    lines?: InventoryAdjustmentLineListRelationFilter
  }, "id" | "reference">

  export type InventoryAdjustmentOrderByWithAggregationInput = {
    id?: SortOrder
    reference?: SortOrderInput | SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrderInput | SortOrder
    type?: SortOrder
    reason?: SortOrderInput | SortOrder
    notes?: SortOrderInput | SortOrder
    status?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: InventoryAdjustmentCountOrderByAggregateInput
    _max?: InventoryAdjustmentMaxOrderByAggregateInput
    _min?: InventoryAdjustmentMinOrderByAggregateInput
  }

  export type InventoryAdjustmentScalarWhereWithAggregatesInput = {
    AND?: InventoryAdjustmentScalarWhereWithAggregatesInput | InventoryAdjustmentScalarWhereWithAggregatesInput[]
    OR?: InventoryAdjustmentScalarWhereWithAggregatesInput[]
    NOT?: InventoryAdjustmentScalarWhereWithAggregatesInput | InventoryAdjustmentScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"InventoryAdjustment"> | string
    reference?: StringNullableWithAggregatesFilter<"InventoryAdjustment"> | string | null
    warehouseId?: StringWithAggregatesFilter<"InventoryAdjustment"> | string
    branchId?: StringNullableWithAggregatesFilter<"InventoryAdjustment"> | string | null
    type?: StringWithAggregatesFilter<"InventoryAdjustment"> | string
    reason?: StringNullableWithAggregatesFilter<"InventoryAdjustment"> | string | null
    notes?: StringNullableWithAggregatesFilter<"InventoryAdjustment"> | string | null
    status?: StringWithAggregatesFilter<"InventoryAdjustment"> | string
    createdAt?: DateTimeWithAggregatesFilter<"InventoryAdjustment"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"InventoryAdjustment"> | Date | string
  }

  export type InventoryAdjustmentLineWhereInput = {
    AND?: InventoryAdjustmentLineWhereInput | InventoryAdjustmentLineWhereInput[]
    OR?: InventoryAdjustmentLineWhereInput[]
    NOT?: InventoryAdjustmentLineWhereInput | InventoryAdjustmentLineWhereInput[]
    id?: StringFilter<"InventoryAdjustmentLine"> | string
    adjustmentId?: StringFilter<"InventoryAdjustmentLine"> | string
    productId?: StringFilter<"InventoryAdjustmentLine"> | string
    quantity?: IntFilter<"InventoryAdjustmentLine"> | number
    adjustment?: XOR<InventoryAdjustmentScalarRelationFilter, InventoryAdjustmentWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }

  export type InventoryAdjustmentLineOrderByWithRelationInput = {
    id?: SortOrder
    adjustmentId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    adjustment?: InventoryAdjustmentOrderByWithRelationInput
    product?: ProductOrderByWithRelationInput
  }

  export type InventoryAdjustmentLineWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: InventoryAdjustmentLineWhereInput | InventoryAdjustmentLineWhereInput[]
    OR?: InventoryAdjustmentLineWhereInput[]
    NOT?: InventoryAdjustmentLineWhereInput | InventoryAdjustmentLineWhereInput[]
    adjustmentId?: StringFilter<"InventoryAdjustmentLine"> | string
    productId?: StringFilter<"InventoryAdjustmentLine"> | string
    quantity?: IntFilter<"InventoryAdjustmentLine"> | number
    adjustment?: XOR<InventoryAdjustmentScalarRelationFilter, InventoryAdjustmentWhereInput>
    product?: XOR<ProductScalarRelationFilter, ProductWhereInput>
  }, "id">

  export type InventoryAdjustmentLineOrderByWithAggregationInput = {
    id?: SortOrder
    adjustmentId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    _count?: InventoryAdjustmentLineCountOrderByAggregateInput
    _avg?: InventoryAdjustmentLineAvgOrderByAggregateInput
    _max?: InventoryAdjustmentLineMaxOrderByAggregateInput
    _min?: InventoryAdjustmentLineMinOrderByAggregateInput
    _sum?: InventoryAdjustmentLineSumOrderByAggregateInput
  }

  export type InventoryAdjustmentLineScalarWhereWithAggregatesInput = {
    AND?: InventoryAdjustmentLineScalarWhereWithAggregatesInput | InventoryAdjustmentLineScalarWhereWithAggregatesInput[]
    OR?: InventoryAdjustmentLineScalarWhereWithAggregatesInput[]
    NOT?: InventoryAdjustmentLineScalarWhereWithAggregatesInput | InventoryAdjustmentLineScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"InventoryAdjustmentLine"> | string
    adjustmentId?: StringWithAggregatesFilter<"InventoryAdjustmentLine"> | string
    productId?: StringWithAggregatesFilter<"InventoryAdjustmentLine"> | string
    quantity?: IntWithAggregatesFilter<"InventoryAdjustmentLine"> | number
  }

  export type EmailTemplateWhereInput = {
    AND?: EmailTemplateWhereInput | EmailTemplateWhereInput[]
    OR?: EmailTemplateWhereInput[]
    NOT?: EmailTemplateWhereInput | EmailTemplateWhereInput[]
    id?: StringFilter<"EmailTemplate"> | string
    name?: StringFilter<"EmailTemplate"> | string
    subject?: StringFilter<"EmailTemplate"> | string
    body?: StringFilter<"EmailTemplate"> | string
    variables?: JsonNullableFilter<"EmailTemplate">
    isActive?: BoolFilter<"EmailTemplate"> | boolean
    createdAt?: DateTimeFilter<"EmailTemplate"> | Date | string
    updatedAt?: DateTimeFilter<"EmailTemplate"> | Date | string
  }

  export type EmailTemplateOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    subject?: SortOrder
    body?: SortOrder
    variables?: SortOrderInput | SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type EmailTemplateWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    AND?: EmailTemplateWhereInput | EmailTemplateWhereInput[]
    OR?: EmailTemplateWhereInput[]
    NOT?: EmailTemplateWhereInput | EmailTemplateWhereInput[]
    subject?: StringFilter<"EmailTemplate"> | string
    body?: StringFilter<"EmailTemplate"> | string
    variables?: JsonNullableFilter<"EmailTemplate">
    isActive?: BoolFilter<"EmailTemplate"> | boolean
    createdAt?: DateTimeFilter<"EmailTemplate"> | Date | string
    updatedAt?: DateTimeFilter<"EmailTemplate"> | Date | string
  }, "id" | "name">

  export type EmailTemplateOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    subject?: SortOrder
    body?: SortOrder
    variables?: SortOrderInput | SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: EmailTemplateCountOrderByAggregateInput
    _max?: EmailTemplateMaxOrderByAggregateInput
    _min?: EmailTemplateMinOrderByAggregateInput
  }

  export type EmailTemplateScalarWhereWithAggregatesInput = {
    AND?: EmailTemplateScalarWhereWithAggregatesInput | EmailTemplateScalarWhereWithAggregatesInput[]
    OR?: EmailTemplateScalarWhereWithAggregatesInput[]
    NOT?: EmailTemplateScalarWhereWithAggregatesInput | EmailTemplateScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"EmailTemplate"> | string
    name?: StringWithAggregatesFilter<"EmailTemplate"> | string
    subject?: StringWithAggregatesFilter<"EmailTemplate"> | string
    body?: StringWithAggregatesFilter<"EmailTemplate"> | string
    variables?: JsonNullableWithAggregatesFilter<"EmailTemplate">
    isActive?: BoolWithAggregatesFilter<"EmailTemplate"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"EmailTemplate"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"EmailTemplate"> | Date | string
  }

  export type SmsTemplateWhereInput = {
    AND?: SmsTemplateWhereInput | SmsTemplateWhereInput[]
    OR?: SmsTemplateWhereInput[]
    NOT?: SmsTemplateWhereInput | SmsTemplateWhereInput[]
    id?: StringFilter<"SmsTemplate"> | string
    name?: StringFilter<"SmsTemplate"> | string
    body?: StringFilter<"SmsTemplate"> | string
    variables?: JsonNullableFilter<"SmsTemplate">
    isActive?: BoolFilter<"SmsTemplate"> | boolean
    createdAt?: DateTimeFilter<"SmsTemplate"> | Date | string
    updatedAt?: DateTimeFilter<"SmsTemplate"> | Date | string
  }

  export type SmsTemplateOrderByWithRelationInput = {
    id?: SortOrder
    name?: SortOrder
    body?: SortOrder
    variables?: SortOrderInput | SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SmsTemplateWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    name?: string
    AND?: SmsTemplateWhereInput | SmsTemplateWhereInput[]
    OR?: SmsTemplateWhereInput[]
    NOT?: SmsTemplateWhereInput | SmsTemplateWhereInput[]
    body?: StringFilter<"SmsTemplate"> | string
    variables?: JsonNullableFilter<"SmsTemplate">
    isActive?: BoolFilter<"SmsTemplate"> | boolean
    createdAt?: DateTimeFilter<"SmsTemplate"> | Date | string
    updatedAt?: DateTimeFilter<"SmsTemplate"> | Date | string
  }, "id" | "name">

  export type SmsTemplateOrderByWithAggregationInput = {
    id?: SortOrder
    name?: SortOrder
    body?: SortOrder
    variables?: SortOrderInput | SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    _count?: SmsTemplateCountOrderByAggregateInput
    _max?: SmsTemplateMaxOrderByAggregateInput
    _min?: SmsTemplateMinOrderByAggregateInput
  }

  export type SmsTemplateScalarWhereWithAggregatesInput = {
    AND?: SmsTemplateScalarWhereWithAggregatesInput | SmsTemplateScalarWhereWithAggregatesInput[]
    OR?: SmsTemplateScalarWhereWithAggregatesInput[]
    NOT?: SmsTemplateScalarWhereWithAggregatesInput | SmsTemplateScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"SmsTemplate"> | string
    name?: StringWithAggregatesFilter<"SmsTemplate"> | string
    body?: StringWithAggregatesFilter<"SmsTemplate"> | string
    variables?: JsonNullableWithAggregatesFilter<"SmsTemplate">
    isActive?: BoolWithAggregatesFilter<"SmsTemplate"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"SmsTemplate"> | Date | string
    updatedAt?: DateTimeWithAggregatesFilter<"SmsTemplate"> | Date | string
  }

  export type NotificationWhereInput = {
    AND?: NotificationWhereInput | NotificationWhereInput[]
    OR?: NotificationWhereInput[]
    NOT?: NotificationWhereInput | NotificationWhereInput[]
    id?: StringFilter<"Notification"> | string
    userId?: StringFilter<"Notification"> | string
    title?: StringFilter<"Notification"> | string
    message?: StringFilter<"Notification"> | string
    type?: StringFilter<"Notification"> | string
    link?: StringNullableFilter<"Notification"> | string | null
    isRead?: BoolFilter<"Notification"> | boolean
    createdAt?: DateTimeFilter<"Notification"> | Date | string
    user?: XOR<UserScalarRelationFilter, UserWhereInput>
  }

  export type NotificationOrderByWithRelationInput = {
    id?: SortOrder
    userId?: SortOrder
    title?: SortOrder
    message?: SortOrder
    type?: SortOrder
    link?: SortOrderInput | SortOrder
    isRead?: SortOrder
    createdAt?: SortOrder
    user?: UserOrderByWithRelationInput
  }

  export type NotificationWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: NotificationWhereInput | NotificationWhereInput[]
    OR?: NotificationWhereInput[]
    NOT?: NotificationWhereInput | NotificationWhereInput[]
    userId?: StringFilter<"Notification"> | string
    title?: StringFilter<"Notification"> | string
    message?: StringFilter<"Notification"> | string
    type?: StringFilter<"Notification"> | string
    link?: StringNullableFilter<"Notification"> | string | null
    isRead?: BoolFilter<"Notification"> | boolean
    createdAt?: DateTimeFilter<"Notification"> | Date | string
    user?: XOR<UserScalarRelationFilter, UserWhereInput>
  }, "id">

  export type NotificationOrderByWithAggregationInput = {
    id?: SortOrder
    userId?: SortOrder
    title?: SortOrder
    message?: SortOrder
    type?: SortOrder
    link?: SortOrderInput | SortOrder
    isRead?: SortOrder
    createdAt?: SortOrder
    _count?: NotificationCountOrderByAggregateInput
    _max?: NotificationMaxOrderByAggregateInput
    _min?: NotificationMinOrderByAggregateInput
  }

  export type NotificationScalarWhereWithAggregatesInput = {
    AND?: NotificationScalarWhereWithAggregatesInput | NotificationScalarWhereWithAggregatesInput[]
    OR?: NotificationScalarWhereWithAggregatesInput[]
    NOT?: NotificationScalarWhereWithAggregatesInput | NotificationScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"Notification"> | string
    userId?: StringWithAggregatesFilter<"Notification"> | string
    title?: StringWithAggregatesFilter<"Notification"> | string
    message?: StringWithAggregatesFilter<"Notification"> | string
    type?: StringWithAggregatesFilter<"Notification"> | string
    link?: StringNullableWithAggregatesFilter<"Notification"> | string | null
    isRead?: BoolWithAggregatesFilter<"Notification"> | boolean
    createdAt?: DateTimeWithAggregatesFilter<"Notification"> | Date | string
  }

  export type ActivityLogWhereInput = {
    AND?: ActivityLogWhereInput | ActivityLogWhereInput[]
    OR?: ActivityLogWhereInput[]
    NOT?: ActivityLogWhereInput | ActivityLogWhereInput[]
    id?: StringFilter<"ActivityLog"> | string
    userId?: StringNullableFilter<"ActivityLog"> | string | null
    action?: StringFilter<"ActivityLog"> | string
    entityType?: StringFilter<"ActivityLog"> | string
    entityId?: StringNullableFilter<"ActivityLog"> | string | null
    summary?: StringNullableFilter<"ActivityLog"> | string | null
    metadata?: JsonNullableFilter<"ActivityLog">
    createdAt?: DateTimeFilter<"ActivityLog"> | Date | string
    user?: XOR<UserNullableScalarRelationFilter, UserWhereInput> | null
  }

  export type ActivityLogOrderByWithRelationInput = {
    id?: SortOrder
    userId?: SortOrderInput | SortOrder
    action?: SortOrder
    entityType?: SortOrder
    entityId?: SortOrderInput | SortOrder
    summary?: SortOrderInput | SortOrder
    metadata?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    user?: UserOrderByWithRelationInput
  }

  export type ActivityLogWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: ActivityLogWhereInput | ActivityLogWhereInput[]
    OR?: ActivityLogWhereInput[]
    NOT?: ActivityLogWhereInput | ActivityLogWhereInput[]
    userId?: StringNullableFilter<"ActivityLog"> | string | null
    action?: StringFilter<"ActivityLog"> | string
    entityType?: StringFilter<"ActivityLog"> | string
    entityId?: StringNullableFilter<"ActivityLog"> | string | null
    summary?: StringNullableFilter<"ActivityLog"> | string | null
    metadata?: JsonNullableFilter<"ActivityLog">
    createdAt?: DateTimeFilter<"ActivityLog"> | Date | string
    user?: XOR<UserNullableScalarRelationFilter, UserWhereInput> | null
  }, "id">

  export type ActivityLogOrderByWithAggregationInput = {
    id?: SortOrder
    userId?: SortOrderInput | SortOrder
    action?: SortOrder
    entityType?: SortOrder
    entityId?: SortOrderInput | SortOrder
    summary?: SortOrderInput | SortOrder
    metadata?: SortOrderInput | SortOrder
    createdAt?: SortOrder
    _count?: ActivityLogCountOrderByAggregateInput
    _max?: ActivityLogMaxOrderByAggregateInput
    _min?: ActivityLogMinOrderByAggregateInput
  }

  export type ActivityLogScalarWhereWithAggregatesInput = {
    AND?: ActivityLogScalarWhereWithAggregatesInput | ActivityLogScalarWhereWithAggregatesInput[]
    OR?: ActivityLogScalarWhereWithAggregatesInput[]
    NOT?: ActivityLogScalarWhereWithAggregatesInput | ActivityLogScalarWhereWithAggregatesInput[]
    id?: StringWithAggregatesFilter<"ActivityLog"> | string
    userId?: StringNullableWithAggregatesFilter<"ActivityLog"> | string | null
    action?: StringWithAggregatesFilter<"ActivityLog"> | string
    entityType?: StringWithAggregatesFilter<"ActivityLog"> | string
    entityId?: StringNullableWithAggregatesFilter<"ActivityLog"> | string | null
    summary?: StringNullableWithAggregatesFilter<"ActivityLog"> | string | null
    metadata?: JsonNullableWithAggregatesFilter<"ActivityLog">
    createdAt?: DateTimeWithAggregatesFilter<"ActivityLog"> | Date | string
  }

  export type HealthcheckCreateInput = {
    createdAt?: Date | string
  }

  export type HealthcheckUncheckedCreateInput = {
    id?: number
    createdAt?: Date | string
  }

  export type HealthcheckUpdateInput = {
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type HealthcheckUncheckedUpdateInput = {
    id?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type HealthcheckCreateManyInput = {
    id?: number
    createdAt?: Date | string
  }

  export type HealthcheckUpdateManyMutationInput = {
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type HealthcheckUncheckedUpdateManyInput = {
    id?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SettingCreateInput = {
    key: string
    value: string
    updatedAt?: Date | string
  }

  export type SettingUncheckedCreateInput = {
    key: string
    value: string
    updatedAt?: Date | string
  }

  export type SettingUpdateInput = {
    key?: StringFieldUpdateOperationsInput | string
    value?: StringFieldUpdateOperationsInput | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SettingUncheckedUpdateInput = {
    key?: StringFieldUpdateOperationsInput | string
    value?: StringFieldUpdateOperationsInput | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SettingCreateManyInput = {
    key: string
    value: string
    updatedAt?: Date | string
  }

  export type SettingUpdateManyMutationInput = {
    key?: StringFieldUpdateOperationsInput | string
    value?: StringFieldUpdateOperationsInput | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SettingUncheckedUpdateManyInput = {
    key?: StringFieldUpdateOperationsInput | string
    value?: StringFieldUpdateOperationsInput | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserCreateInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleCreateNestedManyWithoutUserInput
    activeBranch?: BranchCreateNestedOneWithoutActiveUsersInput
    branches?: UserBranchCreateNestedManyWithoutUserInput
    notifications?: NotificationCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogCreateNestedManyWithoutUserInput
  }

  export type UserUncheckedCreateInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    activeBranchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleUncheckedCreateNestedManyWithoutUserInput
    branches?: UserBranchUncheckedCreateNestedManyWithoutUserInput
    notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogUncheckedCreateNestedManyWithoutUserInput
  }

  export type UserUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUpdateManyWithoutUserNestedInput
    activeBranch?: BranchUpdateOneWithoutActiveUsersNestedInput
    branches?: UserBranchUpdateManyWithoutUserNestedInput
    notifications?: NotificationUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUncheckedUpdateManyWithoutUserNestedInput
    branches?: UserBranchUncheckedUpdateManyWithoutUserNestedInput
    notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUncheckedUpdateManyWithoutUserNestedInput
  }

  export type UserCreateManyInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    activeBranchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type UserUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type UserUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type BranchCreateInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type BranchCreateManyInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type BranchUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type BranchUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchCreateInput = {
    assignedAt?: Date | string
    user: UserCreateNestedOneWithoutBranchesInput
    branch: BranchCreateNestedOneWithoutUsersInput
  }

  export type UserBranchUncheckedCreateInput = {
    userId: string
    branchId: string
    assignedAt?: Date | string
  }

  export type UserBranchUpdateInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    user?: UserUpdateOneRequiredWithoutBranchesNestedInput
    branch?: BranchUpdateOneRequiredWithoutUsersNestedInput
  }

  export type UserBranchUncheckedUpdateInput = {
    userId?: StringFieldUpdateOperationsInput | string
    branchId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchCreateManyInput = {
    userId: string
    branchId: string
    assignedAt?: Date | string
  }

  export type UserBranchUpdateManyMutationInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchUncheckedUpdateManyInput = {
    userId?: StringFieldUpdateOperationsInput | string
    branchId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type RoleCreateInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserRoleCreateNestedManyWithoutRoleInput
    permissions?: RolePermissionCreateNestedManyWithoutRoleInput
  }

  export type RoleUncheckedCreateInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserRoleUncheckedCreateNestedManyWithoutRoleInput
    permissions?: RolePermissionUncheckedCreateNestedManyWithoutRoleInput
  }

  export type RoleUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserRoleUpdateManyWithoutRoleNestedInput
    permissions?: RolePermissionUpdateManyWithoutRoleNestedInput
  }

  export type RoleUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserRoleUncheckedUpdateManyWithoutRoleNestedInput
    permissions?: RolePermissionUncheckedUpdateManyWithoutRoleNestedInput
  }

  export type RoleCreateManyInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type RoleUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type RoleUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PermissionCreateInput = {
    id?: string
    name: string
    label?: string
    description?: string
    category?: string
    sortOrder?: number
    isSystem?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    roles?: RolePermissionCreateNestedManyWithoutPermissionInput
  }

  export type PermissionUncheckedCreateInput = {
    id?: string
    name: string
    label?: string
    description?: string
    category?: string
    sortOrder?: number
    isSystem?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    roles?: RolePermissionUncheckedCreateNestedManyWithoutPermissionInput
  }

  export type PermissionUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    label?: StringFieldUpdateOperationsInput | string
    description?: StringFieldUpdateOperationsInput | string
    category?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isSystem?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    roles?: RolePermissionUpdateManyWithoutPermissionNestedInput
  }

  export type PermissionUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    label?: StringFieldUpdateOperationsInput | string
    description?: StringFieldUpdateOperationsInput | string
    category?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isSystem?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    roles?: RolePermissionUncheckedUpdateManyWithoutPermissionNestedInput
  }

  export type PermissionCreateManyInput = {
    id?: string
    name: string
    label?: string
    description?: string
    category?: string
    sortOrder?: number
    isSystem?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PermissionUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    label?: StringFieldUpdateOperationsInput | string
    description?: StringFieldUpdateOperationsInput | string
    category?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isSystem?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PermissionUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    label?: StringFieldUpdateOperationsInput | string
    description?: StringFieldUpdateOperationsInput | string
    category?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isSystem?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserRoleCreateInput = {
    assignedAt?: Date | string
    user: UserCreateNestedOneWithoutRolesInput
    role: RoleCreateNestedOneWithoutUsersInput
  }

  export type UserRoleUncheckedCreateInput = {
    userId: string
    roleId: string
    assignedAt?: Date | string
  }

  export type UserRoleUpdateInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    user?: UserUpdateOneRequiredWithoutRolesNestedInput
    role?: RoleUpdateOneRequiredWithoutUsersNestedInput
  }

  export type UserRoleUncheckedUpdateInput = {
    userId?: StringFieldUpdateOperationsInput | string
    roleId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserRoleCreateManyInput = {
    userId: string
    roleId: string
    assignedAt?: Date | string
  }

  export type UserRoleUpdateManyMutationInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserRoleUncheckedUpdateManyInput = {
    userId?: StringFieldUpdateOperationsInput | string
    roleId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type RolePermissionCreateInput = {
    role: RoleCreateNestedOneWithoutPermissionsInput
    permission: PermissionCreateNestedOneWithoutRolesInput
  }

  export type RolePermissionUncheckedCreateInput = {
    roleId: string
    permissionId: string
  }

  export type RolePermissionUpdateInput = {
    role?: RoleUpdateOneRequiredWithoutPermissionsNestedInput
    permission?: PermissionUpdateOneRequiredWithoutRolesNestedInput
  }

  export type RolePermissionUncheckedUpdateInput = {
    roleId?: StringFieldUpdateOperationsInput | string
    permissionId?: StringFieldUpdateOperationsInput | string
  }

  export type RolePermissionCreateManyInput = {
    roleId: string
    permissionId: string
  }

  export type RolePermissionUpdateManyMutationInput = {

  }

  export type RolePermissionUncheckedUpdateManyInput = {
    roleId?: StringFieldUpdateOperationsInput | string
    permissionId?: StringFieldUpdateOperationsInput | string
  }

  export type CategoryCreateInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutCategoriesInput
    parent?: CategoryCreateNestedOneWithoutChildrenInput
    children?: CategoryCreateNestedManyWithoutParentInput
    products?: ProductCreateNestedManyWithoutCategoryInput
  }

  export type CategoryUncheckedCreateInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: string | null
    parentId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    children?: CategoryUncheckedCreateNestedManyWithoutParentInput
    products?: ProductUncheckedCreateNestedManyWithoutCategoryInput
  }

  export type CategoryUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutCategoriesNestedInput
    parent?: CategoryUpdateOneWithoutChildrenNestedInput
    children?: CategoryUpdateManyWithoutParentNestedInput
    products?: ProductUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    parentId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    children?: CategoryUncheckedUpdateManyWithoutParentNestedInput
    products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryCreateManyInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: string | null
    parentId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type CategoryUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type CategoryUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    parentId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type VariationCreateInput = {
    id?: string
    name: string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutVariationsInput
  }

  export type VariationUncheckedCreateInput = {
    id?: string
    name: string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: number
    isActive?: boolean
    branchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type VariationUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutVariationsNestedInput
  }

  export type VariationUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type VariationCreateManyInput = {
    id?: string
    name: string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: number
    isActive?: boolean
    branchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type VariationUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type VariationUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type BrandCreateInput = {
    id?: string
    name: string
    logo?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutBrandsInput
    products?: ProductCreateNestedManyWithoutBrandInput
  }

  export type BrandUncheckedCreateInput = {
    id?: string
    name: string
    logo?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutBrandInput
  }

  export type BrandUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutBrandsNestedInput
    products?: ProductUpdateManyWithoutBrandNestedInput
  }

  export type BrandUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutBrandNestedInput
  }

  export type BrandCreateManyInput = {
    id?: string
    name: string
    logo?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type BrandUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type BrandUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UnitCreateInput = {
    id?: string
    name: string
    symbol?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutUnitsInput
    products?: ProductCreateNestedManyWithoutUnitInput
  }

  export type UnitUncheckedCreateInput = {
    id?: string
    name: string
    symbol?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutUnitInput
  }

  export type UnitUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutUnitsNestedInput
    products?: ProductUpdateManyWithoutUnitNestedInput
  }

  export type UnitUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutUnitNestedInput
  }

  export type UnitCreateManyInput = {
    id?: string
    name: string
    symbol?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type UnitUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UnitUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseCreateInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseCreateManyInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseStockCreateInput = {
    id?: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    warehouse: WarehouseCreateNestedOneWithoutStocksInput
    product: ProductCreateNestedOneWithoutWarehouseStocksInput
  }

  export type WarehouseStockUncheckedCreateInput = {
    id?: string
    warehouseId: string
    productId: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseStockUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    warehouse?: WarehouseUpdateOneRequiredWithoutStocksNestedInput
    product?: ProductUpdateOneRequiredWithoutWarehouseStocksNestedInput
  }

  export type WarehouseStockUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    warehouseId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseStockCreateManyInput = {
    id?: string
    warehouseId: string
    productId: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseStockUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseStockUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    warehouseId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SupplierCreateInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutSuppliersInput
    purchases?: PurchaseCreateNestedManyWithoutSupplierInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutSupplierInput
  }

  export type SupplierUncheckedCreateInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    purchases?: PurchaseUncheckedCreateNestedManyWithoutSupplierInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutSupplierInput
  }

  export type SupplierUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutSuppliersNestedInput
    purchases?: PurchaseUpdateManyWithoutSupplierNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutSupplierNestedInput
  }

  export type SupplierUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    purchases?: PurchaseUncheckedUpdateManyWithoutSupplierNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutSupplierNestedInput
  }

  export type SupplierCreateManyInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SupplierUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SupplierUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PurchaseCreateInput = {
    id?: string
    number: string
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    supplier?: SupplierCreateNestedOneWithoutPurchasesInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchasesInput
    branch?: BranchCreateNestedOneWithoutPurchasesInput
    lines?: PurchaseLineCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUncheckedCreateInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: PurchaseLineUncheckedCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnUncheckedCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    supplier?: SupplierUpdateOneWithoutPurchasesNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchasesNestedInput
    branch?: BranchUpdateOneWithoutPurchasesNestedInput
    lines?: PurchaseLineUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: PurchaseLineUncheckedUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUncheckedUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseCreateManyInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type PurchaseUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PurchaseUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PurchaseLineCreateInput = {
    id?: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
    purchase: PurchaseCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutPurchaseLinesInput
  }

  export type PurchaseLineUncheckedCreateInput = {
    id?: string
    purchaseId: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    purchase?: PurchaseUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutPurchaseLinesNestedInput
  }

  export type PurchaseLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseLineCreateManyInput = {
    id?: string
    purchaseId: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnCreateInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    purchase?: PurchaseCreateNestedOneWithoutReturnsInput
    supplier?: SupplierCreateNestedOneWithoutPurchaseReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchaseReturnsInput
    branch?: BranchCreateNestedOneWithoutPurchaseReturnsInput
    lines?: PurchaseReturnLineCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnUncheckedCreateInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    purchase?: PurchaseUpdateOneWithoutReturnsNestedInput
    supplier?: SupplierUpdateOneWithoutPurchaseReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchaseReturnsNestedInput
    branch?: BranchUpdateOneWithoutPurchaseReturnsNestedInput
    lines?: PurchaseReturnLineUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnCreateManyInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PurchaseReturnUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseReturnUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseReturnLineCreateInput = {
    id?: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
    purchaseReturn: PurchaseReturnCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutPurchaseReturnLinesInput
  }

  export type PurchaseReturnLineUncheckedCreateInput = {
    id?: string
    purchaseReturnId: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    purchaseReturn?: PurchaseReturnUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutPurchaseReturnLinesNestedInput
  }

  export type PurchaseReturnLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseReturnId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnLineCreateManyInput = {
    id?: string
    purchaseReturnId: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseReturnId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type CustomerCreateInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutCustomersInput
    invoices?: InvoiceCreateNestedManyWithoutCustomerInput
    sales?: SaleCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnCreateNestedManyWithoutCustomerInput
  }

  export type CustomerUncheckedCreateInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    invoices?: InvoiceUncheckedCreateNestedManyWithoutCustomerInput
    sales?: SaleUncheckedCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutCustomerInput
  }

  export type CustomerUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutCustomersNestedInput
    invoices?: InvoiceUpdateManyWithoutCustomerNestedInput
    sales?: SaleUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    invoices?: InvoiceUncheckedUpdateManyWithoutCustomerNestedInput
    sales?: SaleUncheckedUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerCreateManyInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type CustomerUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type CustomerUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PaymentMethodCreateInput = {
    id?: string
    name: string
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutPaymentMethodsInput
    sales?: SaleCreateNestedManyWithoutPaymentMethodInput
    expenses?: ExpenseCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodUncheckedCreateInput = {
    id?: string
    name: string
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    sales?: SaleUncheckedCreateNestedManyWithoutPaymentMethodInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutPaymentMethodsNestedInput
    sales?: SaleUpdateManyWithoutPaymentMethodNestedInput
    expenses?: ExpenseUpdateManyWithoutPaymentMethodNestedInput
  }

  export type PaymentMethodUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sales?: SaleUncheckedUpdateManyWithoutPaymentMethodNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutPaymentMethodNestedInput
  }

  export type PaymentMethodCreateManyInput = {
    id?: string
    name: string
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PaymentMethodUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PaymentMethodUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SaleCreateInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type SaleCreateManyInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SaleUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SaleUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SaleLineCreateInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    sale: SaleCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutSaleLinesInput
  }

  export type SaleLineUncheckedCreateInput = {
    id?: string
    saleId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SaleLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    sale?: SaleUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutSaleLinesNestedInput
  }

  export type SaleLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    saleId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SaleLineCreateManyInput = {
    id?: string
    saleId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SaleLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SaleLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    saleId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnCreateInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    sale?: SaleCreateNestedOneWithoutReturnsInput
    customer?: CustomerCreateNestedOneWithoutSalesReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesReturnsInput
    branch?: BranchCreateNestedOneWithoutSalesReturnsInput
    lines?: SalesReturnLineCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnUncheckedCreateInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: SalesReturnLineUncheckedCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sale?: SaleUpdateOneWithoutReturnsNestedInput
    customer?: CustomerUpdateOneWithoutSalesReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesReturnsNestedInput
    branch?: BranchUpdateOneWithoutSalesReturnsNestedInput
    lines?: SalesReturnLineUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: SalesReturnLineUncheckedUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnCreateManyInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SalesReturnUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SalesReturnUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SalesReturnLineCreateInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    salesReturn: SalesReturnCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutSalesReturnLinesInput
  }

  export type SalesReturnLineUncheckedCreateInput = {
    id?: string
    salesReturnId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    salesReturn?: SalesReturnUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutSalesReturnLinesNestedInput
  }

  export type SalesReturnLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    salesReturnId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnLineCreateManyInput = {
    id?: string
    salesReturnId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    salesReturnId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type TaxCreateInput = {
    id?: string
    name: string
    rate?: number
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutTaxesInput
    productsSales?: ProductCreateNestedManyWithoutSalesTaxInput
    productsPurchase?: ProductCreateNestedManyWithoutPurchaseTaxInput
  }

  export type TaxUncheckedCreateInput = {
    id?: string
    name: string
    rate?: number
    branchId?: string | null
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    productsSales?: ProductUncheckedCreateNestedManyWithoutSalesTaxInput
    productsPurchase?: ProductUncheckedCreateNestedManyWithoutPurchaseTaxInput
  }

  export type TaxUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutTaxesNestedInput
    productsSales?: ProductUpdateManyWithoutSalesTaxNestedInput
    productsPurchase?: ProductUpdateManyWithoutPurchaseTaxNestedInput
  }

  export type TaxUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    productsSales?: ProductUncheckedUpdateManyWithoutSalesTaxNestedInput
    productsPurchase?: ProductUncheckedUpdateManyWithoutPurchaseTaxNestedInput
  }

  export type TaxCreateManyInput = {
    id?: string
    name: string
    rate?: number
    branchId?: string | null
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type TaxUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type TaxUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseCategoryCreateInput = {
    id?: string
    name: string
    description?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutExpenseCategoriesInput
    expenses?: ExpenseCreateNestedManyWithoutCategoryInput
  }

  export type ExpenseCategoryUncheckedCreateInput = {
    id?: string
    name: string
    description?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    expenses?: ExpenseUncheckedCreateNestedManyWithoutCategoryInput
  }

  export type ExpenseCategoryUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutExpenseCategoriesNestedInput
    expenses?: ExpenseUpdateManyWithoutCategoryNestedInput
  }

  export type ExpenseCategoryUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    expenses?: ExpenseUncheckedUpdateManyWithoutCategoryNestedInput
  }

  export type ExpenseCategoryCreateManyInput = {
    id?: string
    name: string
    description?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCategoryUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseCategoryUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseCreateInput = {
    id?: string
    reference: string
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    category?: ExpenseCategoryCreateNestedOneWithoutExpensesInput
    warehouse?: WarehouseCreateNestedOneWithoutExpensesInput
    branch?: BranchCreateNestedOneWithoutExpensesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutExpensesInput
  }

  export type ExpenseUncheckedCreateInput = {
    id?: string
    reference: string
    categoryId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    category?: ExpenseCategoryUpdateOneWithoutExpensesNestedInput
    warehouse?: WarehouseUpdateOneWithoutExpensesNestedInput
    branch?: BranchUpdateOneWithoutExpensesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutExpensesNestedInput
  }

  export type ExpenseUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseCreateManyInput = {
    id?: string
    reference: string
    categoryId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ProductCreateInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductCreateManyInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ProductUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type InventoryTransferCreateInput = {
    id?: string
    reference: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    fromWarehouse: WarehouseCreateNestedOneWithoutTransfersFromInput
    toWarehouse: WarehouseCreateNestedOneWithoutTransfersToInput
    branch?: BranchCreateNestedOneWithoutTransfersInput
    lines?: InventoryTransferLineCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferUncheckedCreateInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    toWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryTransferLineUncheckedCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    fromWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersFromNestedInput
    toWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersToNestedInput
    branch?: BranchUpdateOneWithoutTransfersNestedInput
    lines?: InventoryTransferLineUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryTransferLineUncheckedUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferCreateManyInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    toWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryTransferUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryTransferUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryTransferLineCreateInput = {
    id?: string
    quantity: number
    transfer: InventoryTransferCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutTransferLinesInput
  }

  export type InventoryTransferLineUncheckedCreateInput = {
    id?: string
    transferId: string
    productId: string
    quantity: number
  }

  export type InventoryTransferLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    transfer?: InventoryTransferUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutTransferLinesNestedInput
  }

  export type InventoryTransferLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    transferId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryTransferLineCreateManyInput = {
    id?: string
    transferId: string
    productId: string
    quantity: number
  }

  export type InventoryTransferLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryTransferLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    transferId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InvoiceCreateInput = {
    id?: string
    number: string
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutInvoicesInput
    sale?: SaleCreateNestedOneWithoutInvoicesInput
    branch?: BranchCreateNestedOneWithoutInvoicesInput
    lines?: InvoiceLineCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceUncheckedCreateInput = {
    id?: string
    number: string
    customerId?: string | null
    saleId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: InvoiceLineUncheckedCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutInvoicesNestedInput
    sale?: SaleUpdateOneWithoutInvoicesNestedInput
    branch?: BranchUpdateOneWithoutInvoicesNestedInput
    lines?: InvoiceLineUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: InvoiceLineUncheckedUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceCreateManyInput = {
    id?: string
    number: string
    customerId?: string | null
    saleId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type InvoiceUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type InvoiceUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type InvoiceLineCreateInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    invoice: InvoiceCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutInvoiceLinesInput
  }

  export type InvoiceLineUncheckedCreateInput = {
    id?: string
    invoiceId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type InvoiceLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    invoice?: InvoiceUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutInvoiceLinesNestedInput
  }

  export type InvoiceLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    invoiceId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InvoiceLineCreateManyInput = {
    id?: string
    invoiceId: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type InvoiceLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InvoiceLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    invoiceId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InventoryAdjustmentCreateInput = {
    id?: string
    reference?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    warehouse: WarehouseCreateNestedOneWithoutAdjustmentsInput
    branch?: BranchCreateNestedOneWithoutAdjustmentsInput
    lines?: InventoryAdjustmentLineCreateNestedManyWithoutAdjustmentInput
  }

  export type InventoryAdjustmentUncheckedCreateInput = {
    id?: string
    reference?: string | null
    warehouseId: string
    branchId?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutAdjustmentInput
  }

  export type InventoryAdjustmentUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    warehouse?: WarehouseUpdateOneRequiredWithoutAdjustmentsNestedInput
    branch?: BranchUpdateOneWithoutAdjustmentsNestedInput
    lines?: InventoryAdjustmentLineUpdateManyWithoutAdjustmentNestedInput
  }

  export type InventoryAdjustmentUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutAdjustmentNestedInput
  }

  export type InventoryAdjustmentCreateManyInput = {
    id?: string
    reference?: string | null
    warehouseId: string
    branchId?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryAdjustmentUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryAdjustmentUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryAdjustmentLineCreateInput = {
    id?: string
    quantity: number
    adjustment: InventoryAdjustmentCreateNestedOneWithoutLinesInput
    product: ProductCreateNestedOneWithoutAdjustmentLinesInput
  }

  export type InventoryAdjustmentLineUncheckedCreateInput = {
    id?: string
    adjustmentId: string
    productId: string
    quantity: number
  }

  export type InventoryAdjustmentLineUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    adjustment?: InventoryAdjustmentUpdateOneRequiredWithoutLinesNestedInput
    product?: ProductUpdateOneRequiredWithoutAdjustmentLinesNestedInput
  }

  export type InventoryAdjustmentLineUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    adjustmentId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryAdjustmentLineCreateManyInput = {
    id?: string
    adjustmentId: string
    productId: string
    quantity: number
  }

  export type InventoryAdjustmentLineUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryAdjustmentLineUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    adjustmentId?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type EmailTemplateCreateInput = {
    id?: string
    name: string
    subject: string
    body: string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type EmailTemplateUncheckedCreateInput = {
    id?: string
    name: string
    subject: string
    body: string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type EmailTemplateUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    subject?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type EmailTemplateUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    subject?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type EmailTemplateCreateManyInput = {
    id?: string
    name: string
    subject: string
    body: string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type EmailTemplateUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    subject?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type EmailTemplateUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    subject?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SmsTemplateCreateInput = {
    id?: string
    name: string
    body: string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SmsTemplateUncheckedCreateInput = {
    id?: string
    name: string
    body: string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SmsTemplateUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SmsTemplateUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SmsTemplateCreateManyInput = {
    id?: string
    name: string
    body: string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SmsTemplateUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SmsTemplateUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    body?: StringFieldUpdateOperationsInput | string
    variables?: NullableJsonNullValueInput | InputJsonValue
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type NotificationCreateInput = {
    id?: string
    title: string
    message: string
    type?: string
    link?: string | null
    isRead?: boolean
    createdAt?: Date | string
    user: UserCreateNestedOneWithoutNotificationsInput
  }

  export type NotificationUncheckedCreateInput = {
    id?: string
    userId: string
    title: string
    message: string
    type?: string
    link?: string | null
    isRead?: boolean
    createdAt?: Date | string
  }

  export type NotificationUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    user?: UserUpdateOneRequiredWithoutNotificationsNestedInput
  }

  export type NotificationUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    userId?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type NotificationCreateManyInput = {
    id?: string
    userId: string
    title: string
    message: string
    type?: string
    link?: string | null
    isRead?: boolean
    createdAt?: Date | string
  }

  export type NotificationUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type NotificationUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    userId?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ActivityLogCreateInput = {
    id?: string
    action: string
    entityType: string
    entityId?: string | null
    summary?: string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    user?: UserCreateNestedOneWithoutActivityLogsInput
  }

  export type ActivityLogUncheckedCreateInput = {
    id?: string
    userId?: string | null
    action: string
    entityType: string
    entityId?: string | null
    summary?: string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
  }

  export type ActivityLogUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    user?: UserUpdateOneWithoutActivityLogsNestedInput
  }

  export type ActivityLogUncheckedUpdateInput = {
    id?: StringFieldUpdateOperationsInput | string
    userId?: NullableStringFieldUpdateOperationsInput | string | null
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ActivityLogCreateManyInput = {
    id?: string
    userId?: string | null
    action: string
    entityType: string
    entityId?: string | null
    summary?: string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
  }

  export type ActivityLogUpdateManyMutationInput = {
    id?: StringFieldUpdateOperationsInput | string
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ActivityLogUncheckedUpdateManyInput = {
    id?: StringFieldUpdateOperationsInput | string
    userId?: NullableStringFieldUpdateOperationsInput | string | null
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type IntFilter<$PrismaModel = never> = {
    equals?: number | IntFieldRefInput<$PrismaModel>
    in?: number[] | ListIntFieldRefInput<$PrismaModel>
    notIn?: number[] | ListIntFieldRefInput<$PrismaModel>
    lt?: number | IntFieldRefInput<$PrismaModel>
    lte?: number | IntFieldRefInput<$PrismaModel>
    gt?: number | IntFieldRefInput<$PrismaModel>
    gte?: number | IntFieldRefInput<$PrismaModel>
    not?: NestedIntFilter<$PrismaModel> | number
  }

  export type DateTimeFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeFilter<$PrismaModel> | Date | string
  }

  export type HealthcheckCountOrderByAggregateInput = {
    id?: SortOrder
    createdAt?: SortOrder
  }

  export type HealthcheckAvgOrderByAggregateInput = {
    id?: SortOrder
  }

  export type HealthcheckMaxOrderByAggregateInput = {
    id?: SortOrder
    createdAt?: SortOrder
  }

  export type HealthcheckMinOrderByAggregateInput = {
    id?: SortOrder
    createdAt?: SortOrder
  }

  export type HealthcheckSumOrderByAggregateInput = {
    id?: SortOrder
  }

  export type IntWithAggregatesFilter<$PrismaModel = never> = {
    equals?: number | IntFieldRefInput<$PrismaModel>
    in?: number[] | ListIntFieldRefInput<$PrismaModel>
    notIn?: number[] | ListIntFieldRefInput<$PrismaModel>
    lt?: number | IntFieldRefInput<$PrismaModel>
    lte?: number | IntFieldRefInput<$PrismaModel>
    gt?: number | IntFieldRefInput<$PrismaModel>
    gte?: number | IntFieldRefInput<$PrismaModel>
    not?: NestedIntWithAggregatesFilter<$PrismaModel> | number
    _count?: NestedIntFilter<$PrismaModel>
    _avg?: NestedFloatFilter<$PrismaModel>
    _sum?: NestedIntFilter<$PrismaModel>
    _min?: NestedIntFilter<$PrismaModel>
    _max?: NestedIntFilter<$PrismaModel>
  }

  export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
    _count?: NestedIntFilter<$PrismaModel>
    _min?: NestedDateTimeFilter<$PrismaModel>
    _max?: NestedDateTimeFilter<$PrismaModel>
  }

  export type StringFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel>
    in?: string[] | ListStringFieldRefInput<$PrismaModel>
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel>
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    mode?: QueryMode
    not?: NestedStringFilter<$PrismaModel> | string
  }

  export type SettingCountOrderByAggregateInput = {
    key?: SortOrder
    value?: SortOrder
    updatedAt?: SortOrder
  }

  export type SettingMaxOrderByAggregateInput = {
    key?: SortOrder
    value?: SortOrder
    updatedAt?: SortOrder
  }

  export type SettingMinOrderByAggregateInput = {
    key?: SortOrder
    value?: SortOrder
    updatedAt?: SortOrder
  }

  export type StringWithAggregatesFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel>
    in?: string[] | ListStringFieldRefInput<$PrismaModel>
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel>
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    mode?: QueryMode
    not?: NestedStringWithAggregatesFilter<$PrismaModel> | string
    _count?: NestedIntFilter<$PrismaModel>
    _min?: NestedStringFilter<$PrismaModel>
    _max?: NestedStringFilter<$PrismaModel>
  }

  export type StringNullableFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel> | null
    in?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    mode?: QueryMode
    not?: NestedStringNullableFilter<$PrismaModel> | string | null
  }

  export type BoolFilter<$PrismaModel = never> = {
    equals?: boolean | BooleanFieldRefInput<$PrismaModel>
    not?: NestedBoolFilter<$PrismaModel> | boolean
  }

  export type DateTimeNullableFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
  }

  export type UserRoleListRelationFilter = {
    every?: UserRoleWhereInput
    some?: UserRoleWhereInput
    none?: UserRoleWhereInput
  }

  export type BranchNullableScalarRelationFilter = {
    is?: BranchWhereInput | null
    isNot?: BranchWhereInput | null
  }

  export type UserBranchListRelationFilter = {
    every?: UserBranchWhereInput
    some?: UserBranchWhereInput
    none?: UserBranchWhereInput
  }

  export type NotificationListRelationFilter = {
    every?: NotificationWhereInput
    some?: NotificationWhereInput
    none?: NotificationWhereInput
  }

  export type ActivityLogListRelationFilter = {
    every?: ActivityLogWhereInput
    some?: ActivityLogWhereInput
    none?: ActivityLogWhereInput
  }

  export type SortOrderInput = {
    sort: SortOrder
    nulls?: NullsOrder
  }

  export type UserRoleOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type UserBranchOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type NotificationOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type ActivityLogOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type UserCountOrderByAggregateInput = {
    id?: SortOrder
    email?: SortOrder
    username?: SortOrder
    fullName?: SortOrder
    passwordHash?: SortOrder
    isVerified?: SortOrder
    isApproved?: SortOrder
    verificationToken?: SortOrder
    verificationTokenExpiry?: SortOrder
    passwordResetToken?: SortOrder
    passwordResetTokenExpiry?: SortOrder
    activeBranchId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type UserMaxOrderByAggregateInput = {
    id?: SortOrder
    email?: SortOrder
    username?: SortOrder
    fullName?: SortOrder
    passwordHash?: SortOrder
    isVerified?: SortOrder
    isApproved?: SortOrder
    verificationToken?: SortOrder
    verificationTokenExpiry?: SortOrder
    passwordResetToken?: SortOrder
    passwordResetTokenExpiry?: SortOrder
    activeBranchId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type UserMinOrderByAggregateInput = {
    id?: SortOrder
    email?: SortOrder
    username?: SortOrder
    fullName?: SortOrder
    passwordHash?: SortOrder
    isVerified?: SortOrder
    isApproved?: SortOrder
    verificationToken?: SortOrder
    verificationTokenExpiry?: SortOrder
    passwordResetToken?: SortOrder
    passwordResetTokenExpiry?: SortOrder
    activeBranchId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel> | null
    in?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    mode?: QueryMode
    not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null
    _count?: NestedIntNullableFilter<$PrismaModel>
    _min?: NestedStringNullableFilter<$PrismaModel>
    _max?: NestedStringNullableFilter<$PrismaModel>
  }

  export type BoolWithAggregatesFilter<$PrismaModel = never> = {
    equals?: boolean | BooleanFieldRefInput<$PrismaModel>
    not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
    _count?: NestedIntFilter<$PrismaModel>
    _min?: NestedBoolFilter<$PrismaModel>
    _max?: NestedBoolFilter<$PrismaModel>
  }

  export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
    _count?: NestedIntNullableFilter<$PrismaModel>
    _min?: NestedDateTimeNullableFilter<$PrismaModel>
    _max?: NestedDateTimeNullableFilter<$PrismaModel>
  }
  export type JsonNullableFilter<$PrismaModel = never> =
    | PatchUndefined<
        Either<Required<JsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>,
        Required<JsonNullableFilterBase<$PrismaModel>>
      >
    | OptionalFlat<Omit<Required<JsonNullableFilterBase<$PrismaModel>>, 'path'>>

  export type JsonNullableFilterBase<$PrismaModel = never> = {
    equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter
    path?: string[]
    mode?: QueryMode | EnumQueryModeFieldRefInput<$PrismaModel>
    string_contains?: string | StringFieldRefInput<$PrismaModel>
    string_starts_with?: string | StringFieldRefInput<$PrismaModel>
    string_ends_with?: string | StringFieldRefInput<$PrismaModel>
    array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter
  }

  export type UserListRelationFilter = {
    every?: UserWhereInput
    some?: UserWhereInput
    none?: UserWhereInput
  }

  export type SupplierListRelationFilter = {
    every?: SupplierWhereInput
    some?: SupplierWhereInput
    none?: SupplierWhereInput
  }

  export type CustomerListRelationFilter = {
    every?: CustomerWhereInput
    some?: CustomerWhereInput
    none?: CustomerWhereInput
  }

  export type ProductListRelationFilter = {
    every?: ProductWhereInput
    some?: ProductWhereInput
    none?: ProductWhereInput
  }

  export type SaleListRelationFilter = {
    every?: SaleWhereInput
    some?: SaleWhereInput
    none?: SaleWhereInput
  }

  export type SalesReturnListRelationFilter = {
    every?: SalesReturnWhereInput
    some?: SalesReturnWhereInput
    none?: SalesReturnWhereInput
  }

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

  export type PurchaseReturnListRelationFilter = {
    every?: PurchaseReturnWhereInput
    some?: PurchaseReturnWhereInput
    none?: PurchaseReturnWhereInput
  }

  export type InvoiceListRelationFilter = {
    every?: InvoiceWhereInput
    some?: InvoiceWhereInput
    none?: InvoiceWhereInput
  }

  export type ExpenseCategoryListRelationFilter = {
    every?: ExpenseCategoryWhereInput
    some?: ExpenseCategoryWhereInput
    none?: ExpenseCategoryWhereInput
  }

  export type ExpenseListRelationFilter = {
    every?: ExpenseWhereInput
    some?: ExpenseWhereInput
    none?: ExpenseWhereInput
  }

  export type InventoryAdjustmentListRelationFilter = {
    every?: InventoryAdjustmentWhereInput
    some?: InventoryAdjustmentWhereInput
    none?: InventoryAdjustmentWhereInput
  }

  export type InventoryTransferListRelationFilter = {
    every?: InventoryTransferWhereInput
    some?: InventoryTransferWhereInput
    none?: InventoryTransferWhereInput
  }

  export type CategoryListRelationFilter = {
    every?: CategoryWhereInput
    some?: CategoryWhereInput
    none?: CategoryWhereInput
  }

  export type BrandListRelationFilter = {
    every?: BrandWhereInput
    some?: BrandWhereInput
    none?: BrandWhereInput
  }

  export type UnitListRelationFilter = {
    every?: UnitWhereInput
    some?: UnitWhereInput
    none?: UnitWhereInput
  }

  export type VariationListRelationFilter = {
    every?: VariationWhereInput
    some?: VariationWhereInput
    none?: VariationWhereInput
  }

  export type TaxListRelationFilter = {
    every?: TaxWhereInput
    some?: TaxWhereInput
    none?: TaxWhereInput
  }

  export type WarehouseListRelationFilter = {
    every?: WarehouseWhereInput
    some?: WarehouseWhereInput
    none?: WarehouseWhereInput
  }

  export type PaymentMethodListRelationFilter = {
    every?: PaymentMethodWhereInput
    some?: PaymentMethodWhereInput
    none?: PaymentMethodWhereInput
  }

  export type UserOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type SupplierOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type CustomerOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type ProductOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type SaleOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type SalesReturnOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type PurchaseOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type PurchaseReturnOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type InvoiceOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type ExpenseCategoryOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type ExpenseOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type InventoryAdjustmentOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type InventoryTransferOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type CategoryOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type BrandOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type UnitOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type VariationOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type TaxOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type WarehouseOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type PaymentMethodOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type BranchCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrder
    address?: SortOrder
    city?: SortOrder
    country?: SortOrder
    phone?: SortOrder
    phones?: SortOrder
    email?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type BranchAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type BranchMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrder
    address?: SortOrder
    city?: SortOrder
    country?: SortOrder
    phone?: SortOrder
    email?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type BranchMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrder
    address?: SortOrder
    city?: SortOrder
    country?: SortOrder
    phone?: SortOrder
    email?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type BranchSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }
  export type JsonNullableWithAggregatesFilter<$PrismaModel = never> =
    | PatchUndefined<
        Either<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
        Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>
      >
    | OptionalFlat<Omit<Required<JsonNullableWithAggregatesFilterBase<$PrismaModel>>, 'path'>>

  export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = {
    equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter
    path?: string[]
    mode?: QueryMode | EnumQueryModeFieldRefInput<$PrismaModel>
    string_contains?: string | StringFieldRefInput<$PrismaModel>
    string_starts_with?: string | StringFieldRefInput<$PrismaModel>
    string_ends_with?: string | StringFieldRefInput<$PrismaModel>
    array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter
    _count?: NestedIntNullableFilter<$PrismaModel>
    _min?: NestedJsonNullableFilter<$PrismaModel>
    _max?: NestedJsonNullableFilter<$PrismaModel>
  }

  export type UserScalarRelationFilter = {
    is?: UserWhereInput
    isNot?: UserWhereInput
  }

  export type BranchScalarRelationFilter = {
    is?: BranchWhereInput
    isNot?: BranchWhereInput
  }

  export type UserBranchUserIdBranchIdCompoundUniqueInput = {
    userId: string
    branchId: string
  }

  export type UserBranchCountOrderByAggregateInput = {
    userId?: SortOrder
    branchId?: SortOrder
    assignedAt?: SortOrder
  }

  export type UserBranchMaxOrderByAggregateInput = {
    userId?: SortOrder
    branchId?: SortOrder
    assignedAt?: SortOrder
  }

  export type UserBranchMinOrderByAggregateInput = {
    userId?: SortOrder
    branchId?: SortOrder
    assignedAt?: SortOrder
  }

  export type RolePermissionListRelationFilter = {
    every?: RolePermissionWhereInput
    some?: RolePermissionWhereInput
    none?: RolePermissionWhereInput
  }

  export type RolePermissionOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type RoleCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type RoleMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type RoleMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PermissionCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    label?: SortOrder
    description?: SortOrder
    category?: SortOrder
    sortOrder?: SortOrder
    isSystem?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PermissionAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type PermissionMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    label?: SortOrder
    description?: SortOrder
    category?: SortOrder
    sortOrder?: SortOrder
    isSystem?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PermissionMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    label?: SortOrder
    description?: SortOrder
    category?: SortOrder
    sortOrder?: SortOrder
    isSystem?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PermissionSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type RoleScalarRelationFilter = {
    is?: RoleWhereInput
    isNot?: RoleWhereInput
  }

  export type UserRoleUserIdRoleIdCompoundUniqueInput = {
    userId: string
    roleId: string
  }

  export type UserRoleCountOrderByAggregateInput = {
    userId?: SortOrder
    roleId?: SortOrder
    assignedAt?: SortOrder
  }

  export type UserRoleMaxOrderByAggregateInput = {
    userId?: SortOrder
    roleId?: SortOrder
    assignedAt?: SortOrder
  }

  export type UserRoleMinOrderByAggregateInput = {
    userId?: SortOrder
    roleId?: SortOrder
    assignedAt?: SortOrder
  }

  export type PermissionScalarRelationFilter = {
    is?: PermissionWhereInput
    isNot?: PermissionWhereInput
  }

  export type RolePermissionRoleIdPermissionIdCompoundUniqueInput = {
    roleId: string
    permissionId: string
  }

  export type RolePermissionCountOrderByAggregateInput = {
    roleId?: SortOrder
    permissionId?: SortOrder
  }

  export type RolePermissionMaxOrderByAggregateInput = {
    roleId?: SortOrder
    permissionId?: SortOrder
  }

  export type RolePermissionMinOrderByAggregateInput = {
    roleId?: SortOrder
    permissionId?: SortOrder
  }

  export type CategoryNullableScalarRelationFilter = {
    is?: CategoryWhereInput | null
    isNot?: CategoryWhereInput | null
  }

  export type CategoryBranchIdCodeCompoundUniqueInput = {
    branchId: string
    code: string
  }

  export type CategoryCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrder
    description?: SortOrder
    color?: SortOrder
    icon?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    tags?: SortOrder
    branchId?: SortOrder
    parentId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type CategoryAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type CategoryMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrder
    description?: SortOrder
    color?: SortOrder
    icon?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrder
    parentId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type CategoryMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    code?: SortOrder
    description?: SortOrder
    color?: SortOrder
    icon?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrder
    parentId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type CategorySumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type VariationCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    options?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type VariationAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type VariationMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type VariationMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    branchId?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type VariationSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type BrandBranchIdNameCompoundUniqueInput = {
    branchId: string
    name: string
  }

  export type BrandCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    logo?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type BrandAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type BrandMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    logo?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type BrandMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    logo?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type BrandSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type UnitBranchIdNameCompoundUniqueInput = {
    branchId: string
    name: string
  }

  export type UnitCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    symbol?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type UnitAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type UnitMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    symbol?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type UnitMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    symbol?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type UnitSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type WarehouseStockListRelationFilter = {
    every?: WarehouseStockWhereInput
    some?: WarehouseStockWhereInput
    none?: WarehouseStockWhereInput
  }

  export type WarehouseStockOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type WarehouseBranchIdNameCompoundUniqueInput = {
    branchId: string
    name: string
  }

  export type WarehouseCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type WarehouseAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type WarehouseMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type WarehouseMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type WarehouseSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type WarehouseScalarRelationFilter = {
    is?: WarehouseWhereInput
    isNot?: WarehouseWhereInput
  }

  export type ProductScalarRelationFilter = {
    is?: ProductWhereInput
    isNot?: ProductWhereInput
  }

  export type WarehouseStockWarehouseIdProductIdCompoundUniqueInput = {
    warehouseId: string
    productId: string
  }

  export type WarehouseStockCountOrderByAggregateInput = {
    id?: SortOrder
    warehouseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type WarehouseStockAvgOrderByAggregateInput = {
    quantity?: SortOrder
  }

  export type WarehouseStockMaxOrderByAggregateInput = {
    id?: SortOrder
    warehouseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type WarehouseStockMinOrderByAggregateInput = {
    id?: SortOrder
    warehouseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type WarehouseStockSumOrderByAggregateInput = {
    quantity?: SortOrder
  }

  export type SupplierCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type SupplierAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type SupplierMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type SupplierMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type SupplierSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type FloatFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel>
    in?: number[] | ListFloatFieldRefInput<$PrismaModel>
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel>
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatFilter<$PrismaModel> | number
  }

  export type SupplierNullableScalarRelationFilter = {
    is?: SupplierWhereInput | null
    isNot?: SupplierWhereInput | null
  }

  export type WarehouseNullableScalarRelationFilter = {
    is?: WarehouseWhereInput | null
    isNot?: WarehouseWhereInput | null
  }

  export type PurchaseLineListRelationFilter = {
    every?: PurchaseLineWhereInput
    some?: PurchaseLineWhereInput
    none?: PurchaseLineWhereInput
  }

  export type PurchaseLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type PurchaseCountOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    supplierId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    purchaseDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type PurchaseAvgOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type PurchaseMaxOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    supplierId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    purchaseDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type PurchaseMinOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    supplierId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    purchaseDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type PurchaseSumOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type FloatWithAggregatesFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel>
    in?: number[] | ListFloatFieldRefInput<$PrismaModel>
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel>
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatWithAggregatesFilter<$PrismaModel> | number
    _count?: NestedIntFilter<$PrismaModel>
    _avg?: NestedFloatFilter<$PrismaModel>
    _sum?: NestedFloatFilter<$PrismaModel>
    _min?: NestedFloatFilter<$PrismaModel>
    _max?: NestedFloatFilter<$PrismaModel>
  }

  export type PurchaseScalarRelationFilter = {
    is?: PurchaseWhereInput
    isNot?: PurchaseWhereInput
  }

  export type PurchaseLineCountOrderByAggregateInput = {
    id?: SortOrder
    purchaseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseLineMaxOrderByAggregateInput = {
    id?: SortOrder
    purchaseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseLineMinOrderByAggregateInput = {
    id?: SortOrder
    purchaseId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseLineSumOrderByAggregateInput = {
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseNullableScalarRelationFilter = {
    is?: PurchaseWhereInput | null
    isNot?: PurchaseWhereInput | null
  }

  export type PurchaseReturnLineListRelationFilter = {
    every?: PurchaseReturnLineWhereInput
    some?: PurchaseReturnLineWhereInput
    none?: PurchaseReturnLineWhereInput
  }

  export type PurchaseReturnLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type PurchaseReturnCountOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    purchaseId?: SortOrder
    supplierId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PurchaseReturnAvgOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type PurchaseReturnMaxOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    purchaseId?: SortOrder
    supplierId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PurchaseReturnMinOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    purchaseId?: SortOrder
    supplierId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PurchaseReturnSumOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type PurchaseReturnScalarRelationFilter = {
    is?: PurchaseReturnWhereInput
    isNot?: PurchaseReturnWhereInput
  }

  export type PurchaseReturnLineCountOrderByAggregateInput = {
    id?: SortOrder
    purchaseReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseReturnLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseReturnLineMaxOrderByAggregateInput = {
    id?: SortOrder
    purchaseReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseReturnLineMinOrderByAggregateInput = {
    id?: SortOrder
    purchaseReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type PurchaseReturnLineSumOrderByAggregateInput = {
    quantity?: SortOrder
    unitCost?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type CustomerCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type CustomerAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type CustomerMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type CustomerMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    email?: SortOrder
    phone?: SortOrder
    country?: SortOrder
    city?: SortOrder
    zipCode?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type CustomerSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type PaymentMethodBranchIdNameCompoundUniqueInput = {
    branchId: string
    name: string
  }

  export type PaymentMethodCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PaymentMethodAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type PaymentMethodMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PaymentMethodMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type PaymentMethodSumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type FloatNullableFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel> | null
    in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatNullableFilter<$PrismaModel> | number | null
  }

  export type CustomerNullableScalarRelationFilter = {
    is?: CustomerWhereInput | null
    isNot?: CustomerWhereInput | null
  }

  export type PaymentMethodNullableScalarRelationFilter = {
    is?: PaymentMethodWhereInput | null
    isNot?: PaymentMethodWhereInput | null
  }

  export type SaleLineListRelationFilter = {
    every?: SaleLineWhereInput
    some?: SaleLineWhereInput
    none?: SaleLineWhereInput
  }

  export type SaleLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type SaleCountOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    paymentMethodId?: SortOrder
    status?: SortOrder
    saleDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrder
    changeGiven?: SortOrder
    taxBreakdown?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type SaleAvgOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrder
    changeGiven?: SortOrder
  }

  export type SaleMaxOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    paymentMethodId?: SortOrder
    status?: SortOrder
    saleDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrder
    changeGiven?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type SaleMinOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    paymentMethodId?: SortOrder
    status?: SortOrder
    saleDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrder
    changeGiven?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type SaleSumOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    amountPaid?: SortOrder
    changeGiven?: SortOrder
  }

  export type FloatNullableWithAggregatesFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel> | null
    in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatNullableWithAggregatesFilter<$PrismaModel> | number | null
    _count?: NestedIntNullableFilter<$PrismaModel>
    _avg?: NestedFloatNullableFilter<$PrismaModel>
    _sum?: NestedFloatNullableFilter<$PrismaModel>
    _min?: NestedFloatNullableFilter<$PrismaModel>
    _max?: NestedFloatNullableFilter<$PrismaModel>
  }

  export type SaleScalarRelationFilter = {
    is?: SaleWhereInput
    isNot?: SaleWhereInput
  }

  export type SaleLineCountOrderByAggregateInput = {
    id?: SortOrder
    saleId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SaleLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SaleLineMaxOrderByAggregateInput = {
    id?: SortOrder
    saleId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SaleLineMinOrderByAggregateInput = {
    id?: SortOrder
    saleId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SaleLineSumOrderByAggregateInput = {
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SaleNullableScalarRelationFilter = {
    is?: SaleWhereInput | null
    isNot?: SaleWhereInput | null
  }

  export type SalesReturnLineListRelationFilter = {
    every?: SalesReturnLineWhereInput
    some?: SalesReturnLineWhereInput
    none?: SalesReturnLineWhereInput
  }

  export type SalesReturnLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type SalesReturnCountOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    saleId?: SortOrder
    customerId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SalesReturnAvgOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type SalesReturnMaxOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    saleId?: SortOrder
    customerId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SalesReturnMinOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    saleId?: SortOrder
    customerId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    returnDate?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SalesReturnSumOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type SalesReturnScalarRelationFilter = {
    is?: SalesReturnWhereInput
    isNot?: SalesReturnWhereInput
  }

  export type SalesReturnLineCountOrderByAggregateInput = {
    id?: SortOrder
    salesReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SalesReturnLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SalesReturnLineMaxOrderByAggregateInput = {
    id?: SortOrder
    salesReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SalesReturnLineMinOrderByAggregateInput = {
    id?: SortOrder
    salesReturnId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type SalesReturnLineSumOrderByAggregateInput = {
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type TaxBranchIdNameCompoundUniqueInput = {
    branchId: string
    name: string
  }

  export type TaxCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    rate?: SortOrder
    branchId?: SortOrder
    isActive?: SortOrder
    sortOrder?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type TaxAvgOrderByAggregateInput = {
    rate?: SortOrder
    sortOrder?: SortOrder
  }

  export type TaxMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    rate?: SortOrder
    branchId?: SortOrder
    isActive?: SortOrder
    sortOrder?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type TaxMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    rate?: SortOrder
    branchId?: SortOrder
    isActive?: SortOrder
    sortOrder?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type TaxSumOrderByAggregateInput = {
    rate?: SortOrder
    sortOrder?: SortOrder
  }

  export type ExpenseCategoryBranchIdNameCompoundUniqueInput = {
    branchId: string
    name: string
  }

  export type ExpenseCategoryCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    description?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type ExpenseCategoryAvgOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type ExpenseCategoryMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    description?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type ExpenseCategoryMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    description?: SortOrder
    branchId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type ExpenseCategorySumOrderByAggregateInput = {
    sortOrder?: SortOrder
  }

  export type ExpenseCategoryNullableScalarRelationFilter = {
    is?: ExpenseCategoryWhereInput | null
    isNot?: ExpenseCategoryWhereInput | null
  }

  export type ExpenseCountOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    categoryId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    paymentMethodId?: SortOrder
    status?: SortOrder
    expenseDate?: SortOrder
    title?: SortOrder
    notes?: SortOrder
    amount?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type ExpenseAvgOrderByAggregateInput = {
    amount?: SortOrder
  }

  export type ExpenseMaxOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    categoryId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    paymentMethodId?: SortOrder
    status?: SortOrder
    expenseDate?: SortOrder
    title?: SortOrder
    notes?: SortOrder
    amount?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type ExpenseMinOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    categoryId?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    paymentMethodId?: SortOrder
    status?: SortOrder
    expenseDate?: SortOrder
    title?: SortOrder
    notes?: SortOrder
    amount?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type ExpenseSumOrderByAggregateInput = {
    amount?: SortOrder
  }

  export type UnitNullableScalarRelationFilter = {
    is?: UnitWhereInput | null
    isNot?: UnitWhereInput | null
  }

  export type BrandNullableScalarRelationFilter = {
    is?: BrandWhereInput | null
    isNot?: BrandWhereInput | null
  }

  export type TaxNullableScalarRelationFilter = {
    is?: TaxWhereInput | null
    isNot?: TaxWhereInput | null
  }

  export type InventoryAdjustmentLineListRelationFilter = {
    every?: InventoryAdjustmentLineWhereInput
    some?: InventoryAdjustmentLineWhereInput
    none?: InventoryAdjustmentLineWhereInput
  }

  export type InvoiceLineListRelationFilter = {
    every?: InvoiceLineWhereInput
    some?: InvoiceLineWhereInput
    none?: InvoiceLineWhereInput
  }

  export type InventoryTransferLineListRelationFilter = {
    every?: InventoryTransferLineWhereInput
    some?: InventoryTransferLineWhereInput
    none?: InventoryTransferLineWhereInput
  }

  export type InventoryAdjustmentLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type InvoiceLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type InventoryTransferLineOrderByRelationAggregateInput = {
    _count?: SortOrder
  }

  export type ProductCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    sku?: SortOrder
    barcode?: SortOrder
    description?: SortOrder
    isReturnable?: SortOrder
    branchId?: SortOrder
    categoryId?: SortOrder
    unitId?: SortOrder
    brandId?: SortOrder
    expiryDate?: SortOrder
    productType?: SortOrder
    variationIds?: SortOrder
    quantity?: SortOrder
    images?: SortOrder
    sellingPrice?: SortOrder
    salesTaxId?: SortOrder
    costPrice?: SortOrder
    purchaseTaxId?: SortOrder
    warehouseId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type ProductAvgOrderByAggregateInput = {
    quantity?: SortOrder
    sellingPrice?: SortOrder
    costPrice?: SortOrder
    sortOrder?: SortOrder
  }

  export type ProductMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    sku?: SortOrder
    barcode?: SortOrder
    description?: SortOrder
    isReturnable?: SortOrder
    branchId?: SortOrder
    categoryId?: SortOrder
    unitId?: SortOrder
    brandId?: SortOrder
    expiryDate?: SortOrder
    productType?: SortOrder
    quantity?: SortOrder
    sellingPrice?: SortOrder
    salesTaxId?: SortOrder
    costPrice?: SortOrder
    purchaseTaxId?: SortOrder
    warehouseId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type ProductMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    sku?: SortOrder
    barcode?: SortOrder
    description?: SortOrder
    isReturnable?: SortOrder
    branchId?: SortOrder
    categoryId?: SortOrder
    unitId?: SortOrder
    brandId?: SortOrder
    expiryDate?: SortOrder
    productType?: SortOrder
    quantity?: SortOrder
    sellingPrice?: SortOrder
    salesTaxId?: SortOrder
    costPrice?: SortOrder
    purchaseTaxId?: SortOrder
    warehouseId?: SortOrder
    sortOrder?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type ProductSumOrderByAggregateInput = {
    quantity?: SortOrder
    sellingPrice?: SortOrder
    costPrice?: SortOrder
    sortOrder?: SortOrder
  }

  export type InventoryTransferCountOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    fromWarehouseId?: SortOrder
    toWarehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    transferDate?: SortOrder
    notes?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type InventoryTransferMaxOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    fromWarehouseId?: SortOrder
    toWarehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    transferDate?: SortOrder
    notes?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type InventoryTransferMinOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    fromWarehouseId?: SortOrder
    toWarehouseId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    transferDate?: SortOrder
    notes?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type InventoryTransferScalarRelationFilter = {
    is?: InventoryTransferWhereInput
    isNot?: InventoryTransferWhereInput
  }

  export type InventoryTransferLineCountOrderByAggregateInput = {
    id?: SortOrder
    transferId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
  }

  export type InventoryTransferLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
  }

  export type InventoryTransferLineMaxOrderByAggregateInput = {
    id?: SortOrder
    transferId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
  }

  export type InventoryTransferLineMinOrderByAggregateInput = {
    id?: SortOrder
    transferId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
  }

  export type InventoryTransferLineSumOrderByAggregateInput = {
    quantity?: SortOrder
  }

  export type InvoiceCountOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrder
    saleId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    issueDate?: SortOrder
    dueDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type InvoiceAvgOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type InvoiceMaxOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrder
    saleId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    issueDate?: SortOrder
    dueDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type InvoiceMinOrderByAggregateInput = {
    id?: SortOrder
    number?: SortOrder
    customerId?: SortOrder
    saleId?: SortOrder
    branchId?: SortOrder
    status?: SortOrder
    issueDate?: SortOrder
    dueDate?: SortOrder
    notes?: SortOrder
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
    deletedAt?: SortOrder
  }

  export type InvoiceSumOrderByAggregateInput = {
    subtotal?: SortOrder
    taxTotal?: SortOrder
    total?: SortOrder
  }

  export type InvoiceScalarRelationFilter = {
    is?: InvoiceWhereInput
    isNot?: InvoiceWhereInput
  }

  export type InvoiceLineCountOrderByAggregateInput = {
    id?: SortOrder
    invoiceId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type InvoiceLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type InvoiceLineMaxOrderByAggregateInput = {
    id?: SortOrder
    invoiceId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type InvoiceLineMinOrderByAggregateInput = {
    id?: SortOrder
    invoiceId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type InvoiceLineSumOrderByAggregateInput = {
    quantity?: SortOrder
    unitPrice?: SortOrder
    taxRate?: SortOrder
    lineTotal?: SortOrder
  }

  export type InventoryAdjustmentCountOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    type?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    status?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type InventoryAdjustmentMaxOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    type?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    status?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type InventoryAdjustmentMinOrderByAggregateInput = {
    id?: SortOrder
    reference?: SortOrder
    warehouseId?: SortOrder
    branchId?: SortOrder
    type?: SortOrder
    reason?: SortOrder
    notes?: SortOrder
    status?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type InventoryAdjustmentScalarRelationFilter = {
    is?: InventoryAdjustmentWhereInput
    isNot?: InventoryAdjustmentWhereInput
  }

  export type InventoryAdjustmentLineCountOrderByAggregateInput = {
    id?: SortOrder
    adjustmentId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
  }

  export type InventoryAdjustmentLineAvgOrderByAggregateInput = {
    quantity?: SortOrder
  }

  export type InventoryAdjustmentLineMaxOrderByAggregateInput = {
    id?: SortOrder
    adjustmentId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
  }

  export type InventoryAdjustmentLineMinOrderByAggregateInput = {
    id?: SortOrder
    adjustmentId?: SortOrder
    productId?: SortOrder
    quantity?: SortOrder
  }

  export type InventoryAdjustmentLineSumOrderByAggregateInput = {
    quantity?: SortOrder
  }

  export type EmailTemplateCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    subject?: SortOrder
    body?: SortOrder
    variables?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type EmailTemplateMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    subject?: SortOrder
    body?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type EmailTemplateMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    subject?: SortOrder
    body?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SmsTemplateCountOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    body?: SortOrder
    variables?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SmsTemplateMaxOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    body?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type SmsTemplateMinOrderByAggregateInput = {
    id?: SortOrder
    name?: SortOrder
    body?: SortOrder
    isActive?: SortOrder
    createdAt?: SortOrder
    updatedAt?: SortOrder
  }

  export type NotificationCountOrderByAggregateInput = {
    id?: SortOrder
    userId?: SortOrder
    title?: SortOrder
    message?: SortOrder
    type?: SortOrder
    link?: SortOrder
    isRead?: SortOrder
    createdAt?: SortOrder
  }

  export type NotificationMaxOrderByAggregateInput = {
    id?: SortOrder
    userId?: SortOrder
    title?: SortOrder
    message?: SortOrder
    type?: SortOrder
    link?: SortOrder
    isRead?: SortOrder
    createdAt?: SortOrder
  }

  export type NotificationMinOrderByAggregateInput = {
    id?: SortOrder
    userId?: SortOrder
    title?: SortOrder
    message?: SortOrder
    type?: SortOrder
    link?: SortOrder
    isRead?: SortOrder
    createdAt?: SortOrder
  }

  export type UserNullableScalarRelationFilter = {
    is?: UserWhereInput | null
    isNot?: UserWhereInput | null
  }

  export type ActivityLogCountOrderByAggregateInput = {
    id?: SortOrder
    userId?: SortOrder
    action?: SortOrder
    entityType?: SortOrder
    entityId?: SortOrder
    summary?: SortOrder
    metadata?: SortOrder
    createdAt?: SortOrder
  }

  export type ActivityLogMaxOrderByAggregateInput = {
    id?: SortOrder
    userId?: SortOrder
    action?: SortOrder
    entityType?: SortOrder
    entityId?: SortOrder
    summary?: SortOrder
    createdAt?: SortOrder
  }

  export type ActivityLogMinOrderByAggregateInput = {
    id?: SortOrder
    userId?: SortOrder
    action?: SortOrder
    entityType?: SortOrder
    entityId?: SortOrder
    summary?: SortOrder
    createdAt?: SortOrder
  }

  export type DateTimeFieldUpdateOperationsInput = {
    set?: Date | string
  }

  export type IntFieldUpdateOperationsInput = {
    set?: number
    increment?: number
    decrement?: number
    multiply?: number
    divide?: number
  }

  export type StringFieldUpdateOperationsInput = {
    set?: string
  }

  export type UserRoleCreateNestedManyWithoutUserInput = {
    create?: XOR<UserRoleCreateWithoutUserInput, UserRoleUncheckedCreateWithoutUserInput> | UserRoleCreateWithoutUserInput[] | UserRoleUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutUserInput | UserRoleCreateOrConnectWithoutUserInput[]
    createMany?: UserRoleCreateManyUserInputEnvelope
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
  }

  export type BranchCreateNestedOneWithoutActiveUsersInput = {
    create?: XOR<BranchCreateWithoutActiveUsersInput, BranchUncheckedCreateWithoutActiveUsersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutActiveUsersInput
    connect?: BranchWhereUniqueInput
  }

  export type UserBranchCreateNestedManyWithoutUserInput = {
    create?: XOR<UserBranchCreateWithoutUserInput, UserBranchUncheckedCreateWithoutUserInput> | UserBranchCreateWithoutUserInput[] | UserBranchUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutUserInput | UserBranchCreateOrConnectWithoutUserInput[]
    createMany?: UserBranchCreateManyUserInputEnvelope
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
  }

  export type NotificationCreateNestedManyWithoutUserInput = {
    create?: XOR<NotificationCreateWithoutUserInput, NotificationUncheckedCreateWithoutUserInput> | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[]
    connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[]
    createMany?: NotificationCreateManyUserInputEnvelope
    connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
  }

  export type ActivityLogCreateNestedManyWithoutUserInput = {
    create?: XOR<ActivityLogCreateWithoutUserInput, ActivityLogUncheckedCreateWithoutUserInput> | ActivityLogCreateWithoutUserInput[] | ActivityLogUncheckedCreateWithoutUserInput[]
    connectOrCreate?: ActivityLogCreateOrConnectWithoutUserInput | ActivityLogCreateOrConnectWithoutUserInput[]
    createMany?: ActivityLogCreateManyUserInputEnvelope
    connect?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
  }

  export type UserRoleUncheckedCreateNestedManyWithoutUserInput = {
    create?: XOR<UserRoleCreateWithoutUserInput, UserRoleUncheckedCreateWithoutUserInput> | UserRoleCreateWithoutUserInput[] | UserRoleUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutUserInput | UserRoleCreateOrConnectWithoutUserInput[]
    createMany?: UserRoleCreateManyUserInputEnvelope
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
  }

  export type UserBranchUncheckedCreateNestedManyWithoutUserInput = {
    create?: XOR<UserBranchCreateWithoutUserInput, UserBranchUncheckedCreateWithoutUserInput> | UserBranchCreateWithoutUserInput[] | UserBranchUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutUserInput | UserBranchCreateOrConnectWithoutUserInput[]
    createMany?: UserBranchCreateManyUserInputEnvelope
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
  }

  export type NotificationUncheckedCreateNestedManyWithoutUserInput = {
    create?: XOR<NotificationCreateWithoutUserInput, NotificationUncheckedCreateWithoutUserInput> | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[]
    connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[]
    createMany?: NotificationCreateManyUserInputEnvelope
    connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
  }

  export type ActivityLogUncheckedCreateNestedManyWithoutUserInput = {
    create?: XOR<ActivityLogCreateWithoutUserInput, ActivityLogUncheckedCreateWithoutUserInput> | ActivityLogCreateWithoutUserInput[] | ActivityLogUncheckedCreateWithoutUserInput[]
    connectOrCreate?: ActivityLogCreateOrConnectWithoutUserInput | ActivityLogCreateOrConnectWithoutUserInput[]
    createMany?: ActivityLogCreateManyUserInputEnvelope
    connect?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
  }

  export type NullableStringFieldUpdateOperationsInput = {
    set?: string | null
  }

  export type BoolFieldUpdateOperationsInput = {
    set?: boolean
  }

  export type NullableDateTimeFieldUpdateOperationsInput = {
    set?: Date | string | null
  }

  export type UserRoleUpdateManyWithoutUserNestedInput = {
    create?: XOR<UserRoleCreateWithoutUserInput, UserRoleUncheckedCreateWithoutUserInput> | UserRoleCreateWithoutUserInput[] | UserRoleUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutUserInput | UserRoleCreateOrConnectWithoutUserInput[]
    upsert?: UserRoleUpsertWithWhereUniqueWithoutUserInput | UserRoleUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: UserRoleCreateManyUserInputEnvelope
    set?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    disconnect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    delete?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    update?: UserRoleUpdateWithWhereUniqueWithoutUserInput | UserRoleUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: UserRoleUpdateManyWithWhereWithoutUserInput | UserRoleUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: UserRoleScalarWhereInput | UserRoleScalarWhereInput[]
  }

  export type BranchUpdateOneWithoutActiveUsersNestedInput = {
    create?: XOR<BranchCreateWithoutActiveUsersInput, BranchUncheckedCreateWithoutActiveUsersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutActiveUsersInput
    upsert?: BranchUpsertWithoutActiveUsersInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutActiveUsersInput, BranchUpdateWithoutActiveUsersInput>, BranchUncheckedUpdateWithoutActiveUsersInput>
  }

  export type UserBranchUpdateManyWithoutUserNestedInput = {
    create?: XOR<UserBranchCreateWithoutUserInput, UserBranchUncheckedCreateWithoutUserInput> | UserBranchCreateWithoutUserInput[] | UserBranchUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutUserInput | UserBranchCreateOrConnectWithoutUserInput[]
    upsert?: UserBranchUpsertWithWhereUniqueWithoutUserInput | UserBranchUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: UserBranchCreateManyUserInputEnvelope
    set?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    disconnect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    delete?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    update?: UserBranchUpdateWithWhereUniqueWithoutUserInput | UserBranchUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: UserBranchUpdateManyWithWhereWithoutUserInput | UserBranchUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: UserBranchScalarWhereInput | UserBranchScalarWhereInput[]
  }

  export type NotificationUpdateManyWithoutUserNestedInput = {
    create?: XOR<NotificationCreateWithoutUserInput, NotificationUncheckedCreateWithoutUserInput> | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[]
    connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[]
    upsert?: NotificationUpsertWithWhereUniqueWithoutUserInput | NotificationUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: NotificationCreateManyUserInputEnvelope
    set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    update?: NotificationUpdateWithWhereUniqueWithoutUserInput | NotificationUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: NotificationUpdateManyWithWhereWithoutUserInput | NotificationUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[]
  }

  export type ActivityLogUpdateManyWithoutUserNestedInput = {
    create?: XOR<ActivityLogCreateWithoutUserInput, ActivityLogUncheckedCreateWithoutUserInput> | ActivityLogCreateWithoutUserInput[] | ActivityLogUncheckedCreateWithoutUserInput[]
    connectOrCreate?: ActivityLogCreateOrConnectWithoutUserInput | ActivityLogCreateOrConnectWithoutUserInput[]
    upsert?: ActivityLogUpsertWithWhereUniqueWithoutUserInput | ActivityLogUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: ActivityLogCreateManyUserInputEnvelope
    set?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    disconnect?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    delete?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    connect?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    update?: ActivityLogUpdateWithWhereUniqueWithoutUserInput | ActivityLogUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: ActivityLogUpdateManyWithWhereWithoutUserInput | ActivityLogUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: ActivityLogScalarWhereInput | ActivityLogScalarWhereInput[]
  }

  export type UserRoleUncheckedUpdateManyWithoutUserNestedInput = {
    create?: XOR<UserRoleCreateWithoutUserInput, UserRoleUncheckedCreateWithoutUserInput> | UserRoleCreateWithoutUserInput[] | UserRoleUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutUserInput | UserRoleCreateOrConnectWithoutUserInput[]
    upsert?: UserRoleUpsertWithWhereUniqueWithoutUserInput | UserRoleUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: UserRoleCreateManyUserInputEnvelope
    set?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    disconnect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    delete?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    update?: UserRoleUpdateWithWhereUniqueWithoutUserInput | UserRoleUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: UserRoleUpdateManyWithWhereWithoutUserInput | UserRoleUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: UserRoleScalarWhereInput | UserRoleScalarWhereInput[]
  }

  export type UserBranchUncheckedUpdateManyWithoutUserNestedInput = {
    create?: XOR<UserBranchCreateWithoutUserInput, UserBranchUncheckedCreateWithoutUserInput> | UserBranchCreateWithoutUserInput[] | UserBranchUncheckedCreateWithoutUserInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutUserInput | UserBranchCreateOrConnectWithoutUserInput[]
    upsert?: UserBranchUpsertWithWhereUniqueWithoutUserInput | UserBranchUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: UserBranchCreateManyUserInputEnvelope
    set?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    disconnect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    delete?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    update?: UserBranchUpdateWithWhereUniqueWithoutUserInput | UserBranchUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: UserBranchUpdateManyWithWhereWithoutUserInput | UserBranchUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: UserBranchScalarWhereInput | UserBranchScalarWhereInput[]
  }

  export type NotificationUncheckedUpdateManyWithoutUserNestedInput = {
    create?: XOR<NotificationCreateWithoutUserInput, NotificationUncheckedCreateWithoutUserInput> | NotificationCreateWithoutUserInput[] | NotificationUncheckedCreateWithoutUserInput[]
    connectOrCreate?: NotificationCreateOrConnectWithoutUserInput | NotificationCreateOrConnectWithoutUserInput[]
    upsert?: NotificationUpsertWithWhereUniqueWithoutUserInput | NotificationUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: NotificationCreateManyUserInputEnvelope
    set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[]
    update?: NotificationUpdateWithWhereUniqueWithoutUserInput | NotificationUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: NotificationUpdateManyWithWhereWithoutUserInput | NotificationUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[]
  }

  export type ActivityLogUncheckedUpdateManyWithoutUserNestedInput = {
    create?: XOR<ActivityLogCreateWithoutUserInput, ActivityLogUncheckedCreateWithoutUserInput> | ActivityLogCreateWithoutUserInput[] | ActivityLogUncheckedCreateWithoutUserInput[]
    connectOrCreate?: ActivityLogCreateOrConnectWithoutUserInput | ActivityLogCreateOrConnectWithoutUserInput[]
    upsert?: ActivityLogUpsertWithWhereUniqueWithoutUserInput | ActivityLogUpsertWithWhereUniqueWithoutUserInput[]
    createMany?: ActivityLogCreateManyUserInputEnvelope
    set?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    disconnect?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    delete?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    connect?: ActivityLogWhereUniqueInput | ActivityLogWhereUniqueInput[]
    update?: ActivityLogUpdateWithWhereUniqueWithoutUserInput | ActivityLogUpdateWithWhereUniqueWithoutUserInput[]
    updateMany?: ActivityLogUpdateManyWithWhereWithoutUserInput | ActivityLogUpdateManyWithWhereWithoutUserInput[]
    deleteMany?: ActivityLogScalarWhereInput | ActivityLogScalarWhereInput[]
  }

  export type UserBranchCreateNestedManyWithoutBranchInput = {
    create?: XOR<UserBranchCreateWithoutBranchInput, UserBranchUncheckedCreateWithoutBranchInput> | UserBranchCreateWithoutBranchInput[] | UserBranchUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutBranchInput | UserBranchCreateOrConnectWithoutBranchInput[]
    createMany?: UserBranchCreateManyBranchInputEnvelope
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
  }

  export type UserCreateNestedManyWithoutActiveBranchInput = {
    create?: XOR<UserCreateWithoutActiveBranchInput, UserUncheckedCreateWithoutActiveBranchInput> | UserCreateWithoutActiveBranchInput[] | UserUncheckedCreateWithoutActiveBranchInput[]
    connectOrCreate?: UserCreateOrConnectWithoutActiveBranchInput | UserCreateOrConnectWithoutActiveBranchInput[]
    createMany?: UserCreateManyActiveBranchInputEnvelope
    connect?: UserWhereUniqueInput | UserWhereUniqueInput[]
  }

  export type SupplierCreateNestedManyWithoutBranchInput = {
    create?: XOR<SupplierCreateWithoutBranchInput, SupplierUncheckedCreateWithoutBranchInput> | SupplierCreateWithoutBranchInput[] | SupplierUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SupplierCreateOrConnectWithoutBranchInput | SupplierCreateOrConnectWithoutBranchInput[]
    createMany?: SupplierCreateManyBranchInputEnvelope
    connect?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
  }

  export type CustomerCreateNestedManyWithoutBranchInput = {
    create?: XOR<CustomerCreateWithoutBranchInput, CustomerUncheckedCreateWithoutBranchInput> | CustomerCreateWithoutBranchInput[] | CustomerUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CustomerCreateOrConnectWithoutBranchInput | CustomerCreateOrConnectWithoutBranchInput[]
    createMany?: CustomerCreateManyBranchInputEnvelope
    connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
  }

  export type ProductCreateNestedManyWithoutBranchInput = {
    create?: XOR<ProductCreateWithoutBranchInput, ProductUncheckedCreateWithoutBranchInput> | ProductCreateWithoutBranchInput[] | ProductUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBranchInput | ProductCreateOrConnectWithoutBranchInput[]
    createMany?: ProductCreateManyBranchInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type SaleCreateNestedManyWithoutBranchInput = {
    create?: XOR<SaleCreateWithoutBranchInput, SaleUncheckedCreateWithoutBranchInput> | SaleCreateWithoutBranchInput[] | SaleUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutBranchInput | SaleCreateOrConnectWithoutBranchInput[]
    createMany?: SaleCreateManyBranchInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type SalesReturnCreateNestedManyWithoutBranchInput = {
    create?: XOR<SalesReturnCreateWithoutBranchInput, SalesReturnUncheckedCreateWithoutBranchInput> | SalesReturnCreateWithoutBranchInput[] | SalesReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutBranchInput | SalesReturnCreateOrConnectWithoutBranchInput[]
    createMany?: SalesReturnCreateManyBranchInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type PurchaseCreateNestedManyWithoutBranchInput = {
    create?: XOR<PurchaseCreateWithoutBranchInput, PurchaseUncheckedCreateWithoutBranchInput> | PurchaseCreateWithoutBranchInput[] | PurchaseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutBranchInput | PurchaseCreateOrConnectWithoutBranchInput[]
    createMany?: PurchaseCreateManyBranchInputEnvelope
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
  }

  export type PurchaseReturnCreateNestedManyWithoutBranchInput = {
    create?: XOR<PurchaseReturnCreateWithoutBranchInput, PurchaseReturnUncheckedCreateWithoutBranchInput> | PurchaseReturnCreateWithoutBranchInput[] | PurchaseReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutBranchInput | PurchaseReturnCreateOrConnectWithoutBranchInput[]
    createMany?: PurchaseReturnCreateManyBranchInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type InvoiceCreateNestedManyWithoutBranchInput = {
    create?: XOR<InvoiceCreateWithoutBranchInput, InvoiceUncheckedCreateWithoutBranchInput> | InvoiceCreateWithoutBranchInput[] | InvoiceUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutBranchInput | InvoiceCreateOrConnectWithoutBranchInput[]
    createMany?: InvoiceCreateManyBranchInputEnvelope
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
  }

  export type ExpenseCategoryCreateNestedManyWithoutBranchInput = {
    create?: XOR<ExpenseCategoryCreateWithoutBranchInput, ExpenseCategoryUncheckedCreateWithoutBranchInput> | ExpenseCategoryCreateWithoutBranchInput[] | ExpenseCategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCategoryCreateOrConnectWithoutBranchInput | ExpenseCategoryCreateOrConnectWithoutBranchInput[]
    createMany?: ExpenseCategoryCreateManyBranchInputEnvelope
    connect?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
  }

  export type ExpenseCreateNestedManyWithoutBranchInput = {
    create?: XOR<ExpenseCreateWithoutBranchInput, ExpenseUncheckedCreateWithoutBranchInput> | ExpenseCreateWithoutBranchInput[] | ExpenseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutBranchInput | ExpenseCreateOrConnectWithoutBranchInput[]
    createMany?: ExpenseCreateManyBranchInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type InventoryAdjustmentCreateNestedManyWithoutBranchInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutBranchInput, InventoryAdjustmentUncheckedCreateWithoutBranchInput> | InventoryAdjustmentCreateWithoutBranchInput[] | InventoryAdjustmentUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutBranchInput | InventoryAdjustmentCreateOrConnectWithoutBranchInput[]
    createMany?: InventoryAdjustmentCreateManyBranchInputEnvelope
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
  }

  export type InventoryTransferCreateNestedManyWithoutBranchInput = {
    create?: XOR<InventoryTransferCreateWithoutBranchInput, InventoryTransferUncheckedCreateWithoutBranchInput> | InventoryTransferCreateWithoutBranchInput[] | InventoryTransferUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutBranchInput | InventoryTransferCreateOrConnectWithoutBranchInput[]
    createMany?: InventoryTransferCreateManyBranchInputEnvelope
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
  }

  export type CategoryCreateNestedManyWithoutBranchInput = {
    create?: XOR<CategoryCreateWithoutBranchInput, CategoryUncheckedCreateWithoutBranchInput> | CategoryCreateWithoutBranchInput[] | CategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutBranchInput | CategoryCreateOrConnectWithoutBranchInput[]
    createMany?: CategoryCreateManyBranchInputEnvelope
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
  }

  export type BrandCreateNestedManyWithoutBranchInput = {
    create?: XOR<BrandCreateWithoutBranchInput, BrandUncheckedCreateWithoutBranchInput> | BrandCreateWithoutBranchInput[] | BrandUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: BrandCreateOrConnectWithoutBranchInput | BrandCreateOrConnectWithoutBranchInput[]
    createMany?: BrandCreateManyBranchInputEnvelope
    connect?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
  }

  export type UnitCreateNestedManyWithoutBranchInput = {
    create?: XOR<UnitCreateWithoutBranchInput, UnitUncheckedCreateWithoutBranchInput> | UnitCreateWithoutBranchInput[] | UnitUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UnitCreateOrConnectWithoutBranchInput | UnitCreateOrConnectWithoutBranchInput[]
    createMany?: UnitCreateManyBranchInputEnvelope
    connect?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
  }

  export type VariationCreateNestedManyWithoutBranchInput = {
    create?: XOR<VariationCreateWithoutBranchInput, VariationUncheckedCreateWithoutBranchInput> | VariationCreateWithoutBranchInput[] | VariationUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: VariationCreateOrConnectWithoutBranchInput | VariationCreateOrConnectWithoutBranchInput[]
    createMany?: VariationCreateManyBranchInputEnvelope
    connect?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
  }

  export type TaxCreateNestedManyWithoutBranchInput = {
    create?: XOR<TaxCreateWithoutBranchInput, TaxUncheckedCreateWithoutBranchInput> | TaxCreateWithoutBranchInput[] | TaxUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: TaxCreateOrConnectWithoutBranchInput | TaxCreateOrConnectWithoutBranchInput[]
    createMany?: TaxCreateManyBranchInputEnvelope
    connect?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
  }

  export type WarehouseCreateNestedManyWithoutBranchInput = {
    create?: XOR<WarehouseCreateWithoutBranchInput, WarehouseUncheckedCreateWithoutBranchInput> | WarehouseCreateWithoutBranchInput[] | WarehouseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: WarehouseCreateOrConnectWithoutBranchInput | WarehouseCreateOrConnectWithoutBranchInput[]
    createMany?: WarehouseCreateManyBranchInputEnvelope
    connect?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
  }

  export type PaymentMethodCreateNestedManyWithoutBranchInput = {
    create?: XOR<PaymentMethodCreateWithoutBranchInput, PaymentMethodUncheckedCreateWithoutBranchInput> | PaymentMethodCreateWithoutBranchInput[] | PaymentMethodUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutBranchInput | PaymentMethodCreateOrConnectWithoutBranchInput[]
    createMany?: PaymentMethodCreateManyBranchInputEnvelope
    connect?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
  }

  export type UserBranchUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<UserBranchCreateWithoutBranchInput, UserBranchUncheckedCreateWithoutBranchInput> | UserBranchCreateWithoutBranchInput[] | UserBranchUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutBranchInput | UserBranchCreateOrConnectWithoutBranchInput[]
    createMany?: UserBranchCreateManyBranchInputEnvelope
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
  }

  export type UserUncheckedCreateNestedManyWithoutActiveBranchInput = {
    create?: XOR<UserCreateWithoutActiveBranchInput, UserUncheckedCreateWithoutActiveBranchInput> | UserCreateWithoutActiveBranchInput[] | UserUncheckedCreateWithoutActiveBranchInput[]
    connectOrCreate?: UserCreateOrConnectWithoutActiveBranchInput | UserCreateOrConnectWithoutActiveBranchInput[]
    createMany?: UserCreateManyActiveBranchInputEnvelope
    connect?: UserWhereUniqueInput | UserWhereUniqueInput[]
  }

  export type SupplierUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<SupplierCreateWithoutBranchInput, SupplierUncheckedCreateWithoutBranchInput> | SupplierCreateWithoutBranchInput[] | SupplierUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SupplierCreateOrConnectWithoutBranchInput | SupplierCreateOrConnectWithoutBranchInput[]
    createMany?: SupplierCreateManyBranchInputEnvelope
    connect?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
  }

  export type CustomerUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<CustomerCreateWithoutBranchInput, CustomerUncheckedCreateWithoutBranchInput> | CustomerCreateWithoutBranchInput[] | CustomerUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CustomerCreateOrConnectWithoutBranchInput | CustomerCreateOrConnectWithoutBranchInput[]
    createMany?: CustomerCreateManyBranchInputEnvelope
    connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<ProductCreateWithoutBranchInput, ProductUncheckedCreateWithoutBranchInput> | ProductCreateWithoutBranchInput[] | ProductUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBranchInput | ProductCreateOrConnectWithoutBranchInput[]
    createMany?: ProductCreateManyBranchInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type SaleUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<SaleCreateWithoutBranchInput, SaleUncheckedCreateWithoutBranchInput> | SaleCreateWithoutBranchInput[] | SaleUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutBranchInput | SaleCreateOrConnectWithoutBranchInput[]
    createMany?: SaleCreateManyBranchInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type SalesReturnUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<SalesReturnCreateWithoutBranchInput, SalesReturnUncheckedCreateWithoutBranchInput> | SalesReturnCreateWithoutBranchInput[] | SalesReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutBranchInput | SalesReturnCreateOrConnectWithoutBranchInput[]
    createMany?: SalesReturnCreateManyBranchInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type PurchaseUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<PurchaseCreateWithoutBranchInput, PurchaseUncheckedCreateWithoutBranchInput> | PurchaseCreateWithoutBranchInput[] | PurchaseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutBranchInput | PurchaseCreateOrConnectWithoutBranchInput[]
    createMany?: PurchaseCreateManyBranchInputEnvelope
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
  }

  export type PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<PurchaseReturnCreateWithoutBranchInput, PurchaseReturnUncheckedCreateWithoutBranchInput> | PurchaseReturnCreateWithoutBranchInput[] | PurchaseReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutBranchInput | PurchaseReturnCreateOrConnectWithoutBranchInput[]
    createMany?: PurchaseReturnCreateManyBranchInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type InvoiceUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<InvoiceCreateWithoutBranchInput, InvoiceUncheckedCreateWithoutBranchInput> | InvoiceCreateWithoutBranchInput[] | InvoiceUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutBranchInput | InvoiceCreateOrConnectWithoutBranchInput[]
    createMany?: InvoiceCreateManyBranchInputEnvelope
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
  }

  export type ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<ExpenseCategoryCreateWithoutBranchInput, ExpenseCategoryUncheckedCreateWithoutBranchInput> | ExpenseCategoryCreateWithoutBranchInput[] | ExpenseCategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCategoryCreateOrConnectWithoutBranchInput | ExpenseCategoryCreateOrConnectWithoutBranchInput[]
    createMany?: ExpenseCategoryCreateManyBranchInputEnvelope
    connect?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
  }

  export type ExpenseUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<ExpenseCreateWithoutBranchInput, ExpenseUncheckedCreateWithoutBranchInput> | ExpenseCreateWithoutBranchInput[] | ExpenseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutBranchInput | ExpenseCreateOrConnectWithoutBranchInput[]
    createMany?: ExpenseCreateManyBranchInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutBranchInput, InventoryAdjustmentUncheckedCreateWithoutBranchInput> | InventoryAdjustmentCreateWithoutBranchInput[] | InventoryAdjustmentUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutBranchInput | InventoryAdjustmentCreateOrConnectWithoutBranchInput[]
    createMany?: InventoryAdjustmentCreateManyBranchInputEnvelope
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
  }

  export type InventoryTransferUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<InventoryTransferCreateWithoutBranchInput, InventoryTransferUncheckedCreateWithoutBranchInput> | InventoryTransferCreateWithoutBranchInput[] | InventoryTransferUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutBranchInput | InventoryTransferCreateOrConnectWithoutBranchInput[]
    createMany?: InventoryTransferCreateManyBranchInputEnvelope
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
  }

  export type CategoryUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<CategoryCreateWithoutBranchInput, CategoryUncheckedCreateWithoutBranchInput> | CategoryCreateWithoutBranchInput[] | CategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutBranchInput | CategoryCreateOrConnectWithoutBranchInput[]
    createMany?: CategoryCreateManyBranchInputEnvelope
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
  }

  export type BrandUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<BrandCreateWithoutBranchInput, BrandUncheckedCreateWithoutBranchInput> | BrandCreateWithoutBranchInput[] | BrandUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: BrandCreateOrConnectWithoutBranchInput | BrandCreateOrConnectWithoutBranchInput[]
    createMany?: BrandCreateManyBranchInputEnvelope
    connect?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
  }

  export type UnitUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<UnitCreateWithoutBranchInput, UnitUncheckedCreateWithoutBranchInput> | UnitCreateWithoutBranchInput[] | UnitUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UnitCreateOrConnectWithoutBranchInput | UnitCreateOrConnectWithoutBranchInput[]
    createMany?: UnitCreateManyBranchInputEnvelope
    connect?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
  }

  export type VariationUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<VariationCreateWithoutBranchInput, VariationUncheckedCreateWithoutBranchInput> | VariationCreateWithoutBranchInput[] | VariationUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: VariationCreateOrConnectWithoutBranchInput | VariationCreateOrConnectWithoutBranchInput[]
    createMany?: VariationCreateManyBranchInputEnvelope
    connect?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
  }

  export type TaxUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<TaxCreateWithoutBranchInput, TaxUncheckedCreateWithoutBranchInput> | TaxCreateWithoutBranchInput[] | TaxUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: TaxCreateOrConnectWithoutBranchInput | TaxCreateOrConnectWithoutBranchInput[]
    createMany?: TaxCreateManyBranchInputEnvelope
    connect?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
  }

  export type WarehouseUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<WarehouseCreateWithoutBranchInput, WarehouseUncheckedCreateWithoutBranchInput> | WarehouseCreateWithoutBranchInput[] | WarehouseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: WarehouseCreateOrConnectWithoutBranchInput | WarehouseCreateOrConnectWithoutBranchInput[]
    createMany?: WarehouseCreateManyBranchInputEnvelope
    connect?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
  }

  export type PaymentMethodUncheckedCreateNestedManyWithoutBranchInput = {
    create?: XOR<PaymentMethodCreateWithoutBranchInput, PaymentMethodUncheckedCreateWithoutBranchInput> | PaymentMethodCreateWithoutBranchInput[] | PaymentMethodUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutBranchInput | PaymentMethodCreateOrConnectWithoutBranchInput[]
    createMany?: PaymentMethodCreateManyBranchInputEnvelope
    connect?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
  }

  export type UserBranchUpdateManyWithoutBranchNestedInput = {
    create?: XOR<UserBranchCreateWithoutBranchInput, UserBranchUncheckedCreateWithoutBranchInput> | UserBranchCreateWithoutBranchInput[] | UserBranchUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutBranchInput | UserBranchCreateOrConnectWithoutBranchInput[]
    upsert?: UserBranchUpsertWithWhereUniqueWithoutBranchInput | UserBranchUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: UserBranchCreateManyBranchInputEnvelope
    set?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    disconnect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    delete?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    update?: UserBranchUpdateWithWhereUniqueWithoutBranchInput | UserBranchUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: UserBranchUpdateManyWithWhereWithoutBranchInput | UserBranchUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: UserBranchScalarWhereInput | UserBranchScalarWhereInput[]
  }

  export type UserUpdateManyWithoutActiveBranchNestedInput = {
    create?: XOR<UserCreateWithoutActiveBranchInput, UserUncheckedCreateWithoutActiveBranchInput> | UserCreateWithoutActiveBranchInput[] | UserUncheckedCreateWithoutActiveBranchInput[]
    connectOrCreate?: UserCreateOrConnectWithoutActiveBranchInput | UserCreateOrConnectWithoutActiveBranchInput[]
    upsert?: UserUpsertWithWhereUniqueWithoutActiveBranchInput | UserUpsertWithWhereUniqueWithoutActiveBranchInput[]
    createMany?: UserCreateManyActiveBranchInputEnvelope
    set?: UserWhereUniqueInput | UserWhereUniqueInput[]
    disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[]
    delete?: UserWhereUniqueInput | UserWhereUniqueInput[]
    connect?: UserWhereUniqueInput | UserWhereUniqueInput[]
    update?: UserUpdateWithWhereUniqueWithoutActiveBranchInput | UserUpdateWithWhereUniqueWithoutActiveBranchInput[]
    updateMany?: UserUpdateManyWithWhereWithoutActiveBranchInput | UserUpdateManyWithWhereWithoutActiveBranchInput[]
    deleteMany?: UserScalarWhereInput | UserScalarWhereInput[]
  }

  export type SupplierUpdateManyWithoutBranchNestedInput = {
    create?: XOR<SupplierCreateWithoutBranchInput, SupplierUncheckedCreateWithoutBranchInput> | SupplierCreateWithoutBranchInput[] | SupplierUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SupplierCreateOrConnectWithoutBranchInput | SupplierCreateOrConnectWithoutBranchInput[]
    upsert?: SupplierUpsertWithWhereUniqueWithoutBranchInput | SupplierUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: SupplierCreateManyBranchInputEnvelope
    set?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    disconnect?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    delete?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    connect?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    update?: SupplierUpdateWithWhereUniqueWithoutBranchInput | SupplierUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: SupplierUpdateManyWithWhereWithoutBranchInput | SupplierUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: SupplierScalarWhereInput | SupplierScalarWhereInput[]
  }

  export type CustomerUpdateManyWithoutBranchNestedInput = {
    create?: XOR<CustomerCreateWithoutBranchInput, CustomerUncheckedCreateWithoutBranchInput> | CustomerCreateWithoutBranchInput[] | CustomerUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CustomerCreateOrConnectWithoutBranchInput | CustomerCreateOrConnectWithoutBranchInput[]
    upsert?: CustomerUpsertWithWhereUniqueWithoutBranchInput | CustomerUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: CustomerCreateManyBranchInputEnvelope
    set?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    disconnect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    delete?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    update?: CustomerUpdateWithWhereUniqueWithoutBranchInput | CustomerUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: CustomerUpdateManyWithWhereWithoutBranchInput | CustomerUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: CustomerScalarWhereInput | CustomerScalarWhereInput[]
  }

  export type ProductUpdateManyWithoutBranchNestedInput = {
    create?: XOR<ProductCreateWithoutBranchInput, ProductUncheckedCreateWithoutBranchInput> | ProductCreateWithoutBranchInput[] | ProductUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBranchInput | ProductCreateOrConnectWithoutBranchInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutBranchInput | ProductUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: ProductCreateManyBranchInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutBranchInput | ProductUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutBranchInput | ProductUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type SaleUpdateManyWithoutBranchNestedInput = {
    create?: XOR<SaleCreateWithoutBranchInput, SaleUncheckedCreateWithoutBranchInput> | SaleCreateWithoutBranchInput[] | SaleUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutBranchInput | SaleCreateOrConnectWithoutBranchInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutBranchInput | SaleUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: SaleCreateManyBranchInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutBranchInput | SaleUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutBranchInput | SaleUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type SalesReturnUpdateManyWithoutBranchNestedInput = {
    create?: XOR<SalesReturnCreateWithoutBranchInput, SalesReturnUncheckedCreateWithoutBranchInput> | SalesReturnCreateWithoutBranchInput[] | SalesReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutBranchInput | SalesReturnCreateOrConnectWithoutBranchInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutBranchInput | SalesReturnUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: SalesReturnCreateManyBranchInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutBranchInput | SalesReturnUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutBranchInput | SalesReturnUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type PurchaseUpdateManyWithoutBranchNestedInput = {
    create?: XOR<PurchaseCreateWithoutBranchInput, PurchaseUncheckedCreateWithoutBranchInput> | PurchaseCreateWithoutBranchInput[] | PurchaseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutBranchInput | PurchaseCreateOrConnectWithoutBranchInput[]
    upsert?: PurchaseUpsertWithWhereUniqueWithoutBranchInput | PurchaseUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: PurchaseCreateManyBranchInputEnvelope
    set?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    disconnect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    delete?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    update?: PurchaseUpdateWithWhereUniqueWithoutBranchInput | PurchaseUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: PurchaseUpdateManyWithWhereWithoutBranchInput | PurchaseUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
  }

  export type PurchaseReturnUpdateManyWithoutBranchNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutBranchInput, PurchaseReturnUncheckedCreateWithoutBranchInput> | PurchaseReturnCreateWithoutBranchInput[] | PurchaseReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutBranchInput | PurchaseReturnCreateOrConnectWithoutBranchInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutBranchInput | PurchaseReturnUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: PurchaseReturnCreateManyBranchInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutBranchInput | PurchaseReturnUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutBranchInput | PurchaseReturnUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type InvoiceUpdateManyWithoutBranchNestedInput = {
    create?: XOR<InvoiceCreateWithoutBranchInput, InvoiceUncheckedCreateWithoutBranchInput> | InvoiceCreateWithoutBranchInput[] | InvoiceUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutBranchInput | InvoiceCreateOrConnectWithoutBranchInput[]
    upsert?: InvoiceUpsertWithWhereUniqueWithoutBranchInput | InvoiceUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: InvoiceCreateManyBranchInputEnvelope
    set?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    disconnect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    delete?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    update?: InvoiceUpdateWithWhereUniqueWithoutBranchInput | InvoiceUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: InvoiceUpdateManyWithWhereWithoutBranchInput | InvoiceUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
  }

  export type ExpenseCategoryUpdateManyWithoutBranchNestedInput = {
    create?: XOR<ExpenseCategoryCreateWithoutBranchInput, ExpenseCategoryUncheckedCreateWithoutBranchInput> | ExpenseCategoryCreateWithoutBranchInput[] | ExpenseCategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCategoryCreateOrConnectWithoutBranchInput | ExpenseCategoryCreateOrConnectWithoutBranchInput[]
    upsert?: ExpenseCategoryUpsertWithWhereUniqueWithoutBranchInput | ExpenseCategoryUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: ExpenseCategoryCreateManyBranchInputEnvelope
    set?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    disconnect?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    delete?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    connect?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    update?: ExpenseCategoryUpdateWithWhereUniqueWithoutBranchInput | ExpenseCategoryUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: ExpenseCategoryUpdateManyWithWhereWithoutBranchInput | ExpenseCategoryUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: ExpenseCategoryScalarWhereInput | ExpenseCategoryScalarWhereInput[]
  }

  export type ExpenseUpdateManyWithoutBranchNestedInput = {
    create?: XOR<ExpenseCreateWithoutBranchInput, ExpenseUncheckedCreateWithoutBranchInput> | ExpenseCreateWithoutBranchInput[] | ExpenseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutBranchInput | ExpenseCreateOrConnectWithoutBranchInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutBranchInput | ExpenseUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: ExpenseCreateManyBranchInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutBranchInput | ExpenseUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutBranchInput | ExpenseUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type InventoryAdjustmentUpdateManyWithoutBranchNestedInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutBranchInput, InventoryAdjustmentUncheckedCreateWithoutBranchInput> | InventoryAdjustmentCreateWithoutBranchInput[] | InventoryAdjustmentUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutBranchInput | InventoryAdjustmentCreateOrConnectWithoutBranchInput[]
    upsert?: InventoryAdjustmentUpsertWithWhereUniqueWithoutBranchInput | InventoryAdjustmentUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: InventoryAdjustmentCreateManyBranchInputEnvelope
    set?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    disconnect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    delete?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    update?: InventoryAdjustmentUpdateWithWhereUniqueWithoutBranchInput | InventoryAdjustmentUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: InventoryAdjustmentUpdateManyWithWhereWithoutBranchInput | InventoryAdjustmentUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: InventoryAdjustmentScalarWhereInput | InventoryAdjustmentScalarWhereInput[]
  }

  export type InventoryTransferUpdateManyWithoutBranchNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutBranchInput, InventoryTransferUncheckedCreateWithoutBranchInput> | InventoryTransferCreateWithoutBranchInput[] | InventoryTransferUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutBranchInput | InventoryTransferCreateOrConnectWithoutBranchInput[]
    upsert?: InventoryTransferUpsertWithWhereUniqueWithoutBranchInput | InventoryTransferUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: InventoryTransferCreateManyBranchInputEnvelope
    set?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    disconnect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    delete?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    update?: InventoryTransferUpdateWithWhereUniqueWithoutBranchInput | InventoryTransferUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: InventoryTransferUpdateManyWithWhereWithoutBranchInput | InventoryTransferUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
  }

  export type CategoryUpdateManyWithoutBranchNestedInput = {
    create?: XOR<CategoryCreateWithoutBranchInput, CategoryUncheckedCreateWithoutBranchInput> | CategoryCreateWithoutBranchInput[] | CategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutBranchInput | CategoryCreateOrConnectWithoutBranchInput[]
    upsert?: CategoryUpsertWithWhereUniqueWithoutBranchInput | CategoryUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: CategoryCreateManyBranchInputEnvelope
    set?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    disconnect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    delete?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    update?: CategoryUpdateWithWhereUniqueWithoutBranchInput | CategoryUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: CategoryUpdateManyWithWhereWithoutBranchInput | CategoryUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: CategoryScalarWhereInput | CategoryScalarWhereInput[]
  }

  export type BrandUpdateManyWithoutBranchNestedInput = {
    create?: XOR<BrandCreateWithoutBranchInput, BrandUncheckedCreateWithoutBranchInput> | BrandCreateWithoutBranchInput[] | BrandUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: BrandCreateOrConnectWithoutBranchInput | BrandCreateOrConnectWithoutBranchInput[]
    upsert?: BrandUpsertWithWhereUniqueWithoutBranchInput | BrandUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: BrandCreateManyBranchInputEnvelope
    set?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    disconnect?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    delete?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    connect?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    update?: BrandUpdateWithWhereUniqueWithoutBranchInput | BrandUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: BrandUpdateManyWithWhereWithoutBranchInput | BrandUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: BrandScalarWhereInput | BrandScalarWhereInput[]
  }

  export type UnitUpdateManyWithoutBranchNestedInput = {
    create?: XOR<UnitCreateWithoutBranchInput, UnitUncheckedCreateWithoutBranchInput> | UnitCreateWithoutBranchInput[] | UnitUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UnitCreateOrConnectWithoutBranchInput | UnitCreateOrConnectWithoutBranchInput[]
    upsert?: UnitUpsertWithWhereUniqueWithoutBranchInput | UnitUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: UnitCreateManyBranchInputEnvelope
    set?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    disconnect?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    delete?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    connect?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    update?: UnitUpdateWithWhereUniqueWithoutBranchInput | UnitUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: UnitUpdateManyWithWhereWithoutBranchInput | UnitUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: UnitScalarWhereInput | UnitScalarWhereInput[]
  }

  export type VariationUpdateManyWithoutBranchNestedInput = {
    create?: XOR<VariationCreateWithoutBranchInput, VariationUncheckedCreateWithoutBranchInput> | VariationCreateWithoutBranchInput[] | VariationUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: VariationCreateOrConnectWithoutBranchInput | VariationCreateOrConnectWithoutBranchInput[]
    upsert?: VariationUpsertWithWhereUniqueWithoutBranchInput | VariationUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: VariationCreateManyBranchInputEnvelope
    set?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    disconnect?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    delete?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    connect?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    update?: VariationUpdateWithWhereUniqueWithoutBranchInput | VariationUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: VariationUpdateManyWithWhereWithoutBranchInput | VariationUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: VariationScalarWhereInput | VariationScalarWhereInput[]
  }

  export type TaxUpdateManyWithoutBranchNestedInput = {
    create?: XOR<TaxCreateWithoutBranchInput, TaxUncheckedCreateWithoutBranchInput> | TaxCreateWithoutBranchInput[] | TaxUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: TaxCreateOrConnectWithoutBranchInput | TaxCreateOrConnectWithoutBranchInput[]
    upsert?: TaxUpsertWithWhereUniqueWithoutBranchInput | TaxUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: TaxCreateManyBranchInputEnvelope
    set?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    disconnect?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    delete?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    connect?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    update?: TaxUpdateWithWhereUniqueWithoutBranchInput | TaxUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: TaxUpdateManyWithWhereWithoutBranchInput | TaxUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: TaxScalarWhereInput | TaxScalarWhereInput[]
  }

  export type WarehouseUpdateManyWithoutBranchNestedInput = {
    create?: XOR<WarehouseCreateWithoutBranchInput, WarehouseUncheckedCreateWithoutBranchInput> | WarehouseCreateWithoutBranchInput[] | WarehouseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: WarehouseCreateOrConnectWithoutBranchInput | WarehouseCreateOrConnectWithoutBranchInput[]
    upsert?: WarehouseUpsertWithWhereUniqueWithoutBranchInput | WarehouseUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: WarehouseCreateManyBranchInputEnvelope
    set?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    disconnect?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    delete?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    connect?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    update?: WarehouseUpdateWithWhereUniqueWithoutBranchInput | WarehouseUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: WarehouseUpdateManyWithWhereWithoutBranchInput | WarehouseUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: WarehouseScalarWhereInput | WarehouseScalarWhereInput[]
  }

  export type PaymentMethodUpdateManyWithoutBranchNestedInput = {
    create?: XOR<PaymentMethodCreateWithoutBranchInput, PaymentMethodUncheckedCreateWithoutBranchInput> | PaymentMethodCreateWithoutBranchInput[] | PaymentMethodUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutBranchInput | PaymentMethodCreateOrConnectWithoutBranchInput[]
    upsert?: PaymentMethodUpsertWithWhereUniqueWithoutBranchInput | PaymentMethodUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: PaymentMethodCreateManyBranchInputEnvelope
    set?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    disconnect?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    delete?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    connect?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    update?: PaymentMethodUpdateWithWhereUniqueWithoutBranchInput | PaymentMethodUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: PaymentMethodUpdateManyWithWhereWithoutBranchInput | PaymentMethodUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: PaymentMethodScalarWhereInput | PaymentMethodScalarWhereInput[]
  }

  export type UserBranchUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<UserBranchCreateWithoutBranchInput, UserBranchUncheckedCreateWithoutBranchInput> | UserBranchCreateWithoutBranchInput[] | UserBranchUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UserBranchCreateOrConnectWithoutBranchInput | UserBranchCreateOrConnectWithoutBranchInput[]
    upsert?: UserBranchUpsertWithWhereUniqueWithoutBranchInput | UserBranchUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: UserBranchCreateManyBranchInputEnvelope
    set?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    disconnect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    delete?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    connect?: UserBranchWhereUniqueInput | UserBranchWhereUniqueInput[]
    update?: UserBranchUpdateWithWhereUniqueWithoutBranchInput | UserBranchUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: UserBranchUpdateManyWithWhereWithoutBranchInput | UserBranchUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: UserBranchScalarWhereInput | UserBranchScalarWhereInput[]
  }

  export type UserUncheckedUpdateManyWithoutActiveBranchNestedInput = {
    create?: XOR<UserCreateWithoutActiveBranchInput, UserUncheckedCreateWithoutActiveBranchInput> | UserCreateWithoutActiveBranchInput[] | UserUncheckedCreateWithoutActiveBranchInput[]
    connectOrCreate?: UserCreateOrConnectWithoutActiveBranchInput | UserCreateOrConnectWithoutActiveBranchInput[]
    upsert?: UserUpsertWithWhereUniqueWithoutActiveBranchInput | UserUpsertWithWhereUniqueWithoutActiveBranchInput[]
    createMany?: UserCreateManyActiveBranchInputEnvelope
    set?: UserWhereUniqueInput | UserWhereUniqueInput[]
    disconnect?: UserWhereUniqueInput | UserWhereUniqueInput[]
    delete?: UserWhereUniqueInput | UserWhereUniqueInput[]
    connect?: UserWhereUniqueInput | UserWhereUniqueInput[]
    update?: UserUpdateWithWhereUniqueWithoutActiveBranchInput | UserUpdateWithWhereUniqueWithoutActiveBranchInput[]
    updateMany?: UserUpdateManyWithWhereWithoutActiveBranchInput | UserUpdateManyWithWhereWithoutActiveBranchInput[]
    deleteMany?: UserScalarWhereInput | UserScalarWhereInput[]
  }

  export type SupplierUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<SupplierCreateWithoutBranchInput, SupplierUncheckedCreateWithoutBranchInput> | SupplierCreateWithoutBranchInput[] | SupplierUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SupplierCreateOrConnectWithoutBranchInput | SupplierCreateOrConnectWithoutBranchInput[]
    upsert?: SupplierUpsertWithWhereUniqueWithoutBranchInput | SupplierUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: SupplierCreateManyBranchInputEnvelope
    set?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    disconnect?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    delete?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    connect?: SupplierWhereUniqueInput | SupplierWhereUniqueInput[]
    update?: SupplierUpdateWithWhereUniqueWithoutBranchInput | SupplierUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: SupplierUpdateManyWithWhereWithoutBranchInput | SupplierUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: SupplierScalarWhereInput | SupplierScalarWhereInput[]
  }

  export type CustomerUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<CustomerCreateWithoutBranchInput, CustomerUncheckedCreateWithoutBranchInput> | CustomerCreateWithoutBranchInput[] | CustomerUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CustomerCreateOrConnectWithoutBranchInput | CustomerCreateOrConnectWithoutBranchInput[]
    upsert?: CustomerUpsertWithWhereUniqueWithoutBranchInput | CustomerUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: CustomerCreateManyBranchInputEnvelope
    set?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    disconnect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    delete?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[]
    update?: CustomerUpdateWithWhereUniqueWithoutBranchInput | CustomerUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: CustomerUpdateManyWithWhereWithoutBranchInput | CustomerUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: CustomerScalarWhereInput | CustomerScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<ProductCreateWithoutBranchInput, ProductUncheckedCreateWithoutBranchInput> | ProductCreateWithoutBranchInput[] | ProductUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBranchInput | ProductCreateOrConnectWithoutBranchInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutBranchInput | ProductUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: ProductCreateManyBranchInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutBranchInput | ProductUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutBranchInput | ProductUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type SaleUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<SaleCreateWithoutBranchInput, SaleUncheckedCreateWithoutBranchInput> | SaleCreateWithoutBranchInput[] | SaleUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutBranchInput | SaleCreateOrConnectWithoutBranchInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutBranchInput | SaleUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: SaleCreateManyBranchInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutBranchInput | SaleUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutBranchInput | SaleUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type SalesReturnUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<SalesReturnCreateWithoutBranchInput, SalesReturnUncheckedCreateWithoutBranchInput> | SalesReturnCreateWithoutBranchInput[] | SalesReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutBranchInput | SalesReturnCreateOrConnectWithoutBranchInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutBranchInput | SalesReturnUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: SalesReturnCreateManyBranchInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutBranchInput | SalesReturnUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutBranchInput | SalesReturnUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type PurchaseUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<PurchaseCreateWithoutBranchInput, PurchaseUncheckedCreateWithoutBranchInput> | PurchaseCreateWithoutBranchInput[] | PurchaseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutBranchInput | PurchaseCreateOrConnectWithoutBranchInput[]
    upsert?: PurchaseUpsertWithWhereUniqueWithoutBranchInput | PurchaseUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: PurchaseCreateManyBranchInputEnvelope
    set?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    disconnect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    delete?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    update?: PurchaseUpdateWithWhereUniqueWithoutBranchInput | PurchaseUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: PurchaseUpdateManyWithWhereWithoutBranchInput | PurchaseUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutBranchInput, PurchaseReturnUncheckedCreateWithoutBranchInput> | PurchaseReturnCreateWithoutBranchInput[] | PurchaseReturnUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutBranchInput | PurchaseReturnCreateOrConnectWithoutBranchInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutBranchInput | PurchaseReturnUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: PurchaseReturnCreateManyBranchInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutBranchInput | PurchaseReturnUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutBranchInput | PurchaseReturnUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type InvoiceUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<InvoiceCreateWithoutBranchInput, InvoiceUncheckedCreateWithoutBranchInput> | InvoiceCreateWithoutBranchInput[] | InvoiceUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutBranchInput | InvoiceCreateOrConnectWithoutBranchInput[]
    upsert?: InvoiceUpsertWithWhereUniqueWithoutBranchInput | InvoiceUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: InvoiceCreateManyBranchInputEnvelope
    set?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    disconnect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    delete?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    update?: InvoiceUpdateWithWhereUniqueWithoutBranchInput | InvoiceUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: InvoiceUpdateManyWithWhereWithoutBranchInput | InvoiceUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
  }

  export type ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<ExpenseCategoryCreateWithoutBranchInput, ExpenseCategoryUncheckedCreateWithoutBranchInput> | ExpenseCategoryCreateWithoutBranchInput[] | ExpenseCategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCategoryCreateOrConnectWithoutBranchInput | ExpenseCategoryCreateOrConnectWithoutBranchInput[]
    upsert?: ExpenseCategoryUpsertWithWhereUniqueWithoutBranchInput | ExpenseCategoryUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: ExpenseCategoryCreateManyBranchInputEnvelope
    set?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    disconnect?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    delete?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    connect?: ExpenseCategoryWhereUniqueInput | ExpenseCategoryWhereUniqueInput[]
    update?: ExpenseCategoryUpdateWithWhereUniqueWithoutBranchInput | ExpenseCategoryUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: ExpenseCategoryUpdateManyWithWhereWithoutBranchInput | ExpenseCategoryUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: ExpenseCategoryScalarWhereInput | ExpenseCategoryScalarWhereInput[]
  }

  export type ExpenseUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<ExpenseCreateWithoutBranchInput, ExpenseUncheckedCreateWithoutBranchInput> | ExpenseCreateWithoutBranchInput[] | ExpenseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutBranchInput | ExpenseCreateOrConnectWithoutBranchInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutBranchInput | ExpenseUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: ExpenseCreateManyBranchInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutBranchInput | ExpenseUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutBranchInput | ExpenseUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutBranchInput, InventoryAdjustmentUncheckedCreateWithoutBranchInput> | InventoryAdjustmentCreateWithoutBranchInput[] | InventoryAdjustmentUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutBranchInput | InventoryAdjustmentCreateOrConnectWithoutBranchInput[]
    upsert?: InventoryAdjustmentUpsertWithWhereUniqueWithoutBranchInput | InventoryAdjustmentUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: InventoryAdjustmentCreateManyBranchInputEnvelope
    set?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    disconnect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    delete?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    update?: InventoryAdjustmentUpdateWithWhereUniqueWithoutBranchInput | InventoryAdjustmentUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: InventoryAdjustmentUpdateManyWithWhereWithoutBranchInput | InventoryAdjustmentUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: InventoryAdjustmentScalarWhereInput | InventoryAdjustmentScalarWhereInput[]
  }

  export type InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutBranchInput, InventoryTransferUncheckedCreateWithoutBranchInput> | InventoryTransferCreateWithoutBranchInput[] | InventoryTransferUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutBranchInput | InventoryTransferCreateOrConnectWithoutBranchInput[]
    upsert?: InventoryTransferUpsertWithWhereUniqueWithoutBranchInput | InventoryTransferUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: InventoryTransferCreateManyBranchInputEnvelope
    set?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    disconnect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    delete?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    update?: InventoryTransferUpdateWithWhereUniqueWithoutBranchInput | InventoryTransferUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: InventoryTransferUpdateManyWithWhereWithoutBranchInput | InventoryTransferUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
  }

  export type CategoryUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<CategoryCreateWithoutBranchInput, CategoryUncheckedCreateWithoutBranchInput> | CategoryCreateWithoutBranchInput[] | CategoryUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutBranchInput | CategoryCreateOrConnectWithoutBranchInput[]
    upsert?: CategoryUpsertWithWhereUniqueWithoutBranchInput | CategoryUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: CategoryCreateManyBranchInputEnvelope
    set?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    disconnect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    delete?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    update?: CategoryUpdateWithWhereUniqueWithoutBranchInput | CategoryUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: CategoryUpdateManyWithWhereWithoutBranchInput | CategoryUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: CategoryScalarWhereInput | CategoryScalarWhereInput[]
  }

  export type BrandUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<BrandCreateWithoutBranchInput, BrandUncheckedCreateWithoutBranchInput> | BrandCreateWithoutBranchInput[] | BrandUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: BrandCreateOrConnectWithoutBranchInput | BrandCreateOrConnectWithoutBranchInput[]
    upsert?: BrandUpsertWithWhereUniqueWithoutBranchInput | BrandUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: BrandCreateManyBranchInputEnvelope
    set?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    disconnect?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    delete?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    connect?: BrandWhereUniqueInput | BrandWhereUniqueInput[]
    update?: BrandUpdateWithWhereUniqueWithoutBranchInput | BrandUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: BrandUpdateManyWithWhereWithoutBranchInput | BrandUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: BrandScalarWhereInput | BrandScalarWhereInput[]
  }

  export type UnitUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<UnitCreateWithoutBranchInput, UnitUncheckedCreateWithoutBranchInput> | UnitCreateWithoutBranchInput[] | UnitUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: UnitCreateOrConnectWithoutBranchInput | UnitCreateOrConnectWithoutBranchInput[]
    upsert?: UnitUpsertWithWhereUniqueWithoutBranchInput | UnitUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: UnitCreateManyBranchInputEnvelope
    set?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    disconnect?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    delete?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    connect?: UnitWhereUniqueInput | UnitWhereUniqueInput[]
    update?: UnitUpdateWithWhereUniqueWithoutBranchInput | UnitUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: UnitUpdateManyWithWhereWithoutBranchInput | UnitUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: UnitScalarWhereInput | UnitScalarWhereInput[]
  }

  export type VariationUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<VariationCreateWithoutBranchInput, VariationUncheckedCreateWithoutBranchInput> | VariationCreateWithoutBranchInput[] | VariationUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: VariationCreateOrConnectWithoutBranchInput | VariationCreateOrConnectWithoutBranchInput[]
    upsert?: VariationUpsertWithWhereUniqueWithoutBranchInput | VariationUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: VariationCreateManyBranchInputEnvelope
    set?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    disconnect?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    delete?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    connect?: VariationWhereUniqueInput | VariationWhereUniqueInput[]
    update?: VariationUpdateWithWhereUniqueWithoutBranchInput | VariationUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: VariationUpdateManyWithWhereWithoutBranchInput | VariationUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: VariationScalarWhereInput | VariationScalarWhereInput[]
  }

  export type TaxUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<TaxCreateWithoutBranchInput, TaxUncheckedCreateWithoutBranchInput> | TaxCreateWithoutBranchInput[] | TaxUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: TaxCreateOrConnectWithoutBranchInput | TaxCreateOrConnectWithoutBranchInput[]
    upsert?: TaxUpsertWithWhereUniqueWithoutBranchInput | TaxUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: TaxCreateManyBranchInputEnvelope
    set?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    disconnect?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    delete?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    connect?: TaxWhereUniqueInput | TaxWhereUniqueInput[]
    update?: TaxUpdateWithWhereUniqueWithoutBranchInput | TaxUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: TaxUpdateManyWithWhereWithoutBranchInput | TaxUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: TaxScalarWhereInput | TaxScalarWhereInput[]
  }

  export type WarehouseUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<WarehouseCreateWithoutBranchInput, WarehouseUncheckedCreateWithoutBranchInput> | WarehouseCreateWithoutBranchInput[] | WarehouseUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: WarehouseCreateOrConnectWithoutBranchInput | WarehouseCreateOrConnectWithoutBranchInput[]
    upsert?: WarehouseUpsertWithWhereUniqueWithoutBranchInput | WarehouseUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: WarehouseCreateManyBranchInputEnvelope
    set?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    disconnect?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    delete?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    connect?: WarehouseWhereUniqueInput | WarehouseWhereUniqueInput[]
    update?: WarehouseUpdateWithWhereUniqueWithoutBranchInput | WarehouseUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: WarehouseUpdateManyWithWhereWithoutBranchInput | WarehouseUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: WarehouseScalarWhereInput | WarehouseScalarWhereInput[]
  }

  export type PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput = {
    create?: XOR<PaymentMethodCreateWithoutBranchInput, PaymentMethodUncheckedCreateWithoutBranchInput> | PaymentMethodCreateWithoutBranchInput[] | PaymentMethodUncheckedCreateWithoutBranchInput[]
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutBranchInput | PaymentMethodCreateOrConnectWithoutBranchInput[]
    upsert?: PaymentMethodUpsertWithWhereUniqueWithoutBranchInput | PaymentMethodUpsertWithWhereUniqueWithoutBranchInput[]
    createMany?: PaymentMethodCreateManyBranchInputEnvelope
    set?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    disconnect?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    delete?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    connect?: PaymentMethodWhereUniqueInput | PaymentMethodWhereUniqueInput[]
    update?: PaymentMethodUpdateWithWhereUniqueWithoutBranchInput | PaymentMethodUpdateWithWhereUniqueWithoutBranchInput[]
    updateMany?: PaymentMethodUpdateManyWithWhereWithoutBranchInput | PaymentMethodUpdateManyWithWhereWithoutBranchInput[]
    deleteMany?: PaymentMethodScalarWhereInput | PaymentMethodScalarWhereInput[]
  }

  export type UserCreateNestedOneWithoutBranchesInput = {
    create?: XOR<UserCreateWithoutBranchesInput, UserUncheckedCreateWithoutBranchesInput>
    connectOrCreate?: UserCreateOrConnectWithoutBranchesInput
    connect?: UserWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutUsersInput = {
    create?: XOR<BranchCreateWithoutUsersInput, BranchUncheckedCreateWithoutUsersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutUsersInput
    connect?: BranchWhereUniqueInput
  }

  export type UserUpdateOneRequiredWithoutBranchesNestedInput = {
    create?: XOR<UserCreateWithoutBranchesInput, UserUncheckedCreateWithoutBranchesInput>
    connectOrCreate?: UserCreateOrConnectWithoutBranchesInput
    upsert?: UserUpsertWithoutBranchesInput
    connect?: UserWhereUniqueInput
    update?: XOR<XOR<UserUpdateToOneWithWhereWithoutBranchesInput, UserUpdateWithoutBranchesInput>, UserUncheckedUpdateWithoutBranchesInput>
  }

  export type BranchUpdateOneRequiredWithoutUsersNestedInput = {
    create?: XOR<BranchCreateWithoutUsersInput, BranchUncheckedCreateWithoutUsersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutUsersInput
    upsert?: BranchUpsertWithoutUsersInput
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutUsersInput, BranchUpdateWithoutUsersInput>, BranchUncheckedUpdateWithoutUsersInput>
  }

  export type UserRoleCreateNestedManyWithoutRoleInput = {
    create?: XOR<UserRoleCreateWithoutRoleInput, UserRoleUncheckedCreateWithoutRoleInput> | UserRoleCreateWithoutRoleInput[] | UserRoleUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutRoleInput | UserRoleCreateOrConnectWithoutRoleInput[]
    createMany?: UserRoleCreateManyRoleInputEnvelope
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
  }

  export type RolePermissionCreateNestedManyWithoutRoleInput = {
    create?: XOR<RolePermissionCreateWithoutRoleInput, RolePermissionUncheckedCreateWithoutRoleInput> | RolePermissionCreateWithoutRoleInput[] | RolePermissionUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutRoleInput | RolePermissionCreateOrConnectWithoutRoleInput[]
    createMany?: RolePermissionCreateManyRoleInputEnvelope
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
  }

  export type UserRoleUncheckedCreateNestedManyWithoutRoleInput = {
    create?: XOR<UserRoleCreateWithoutRoleInput, UserRoleUncheckedCreateWithoutRoleInput> | UserRoleCreateWithoutRoleInput[] | UserRoleUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutRoleInput | UserRoleCreateOrConnectWithoutRoleInput[]
    createMany?: UserRoleCreateManyRoleInputEnvelope
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
  }

  export type RolePermissionUncheckedCreateNestedManyWithoutRoleInput = {
    create?: XOR<RolePermissionCreateWithoutRoleInput, RolePermissionUncheckedCreateWithoutRoleInput> | RolePermissionCreateWithoutRoleInput[] | RolePermissionUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutRoleInput | RolePermissionCreateOrConnectWithoutRoleInput[]
    createMany?: RolePermissionCreateManyRoleInputEnvelope
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
  }

  export type UserRoleUpdateManyWithoutRoleNestedInput = {
    create?: XOR<UserRoleCreateWithoutRoleInput, UserRoleUncheckedCreateWithoutRoleInput> | UserRoleCreateWithoutRoleInput[] | UserRoleUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutRoleInput | UserRoleCreateOrConnectWithoutRoleInput[]
    upsert?: UserRoleUpsertWithWhereUniqueWithoutRoleInput | UserRoleUpsertWithWhereUniqueWithoutRoleInput[]
    createMany?: UserRoleCreateManyRoleInputEnvelope
    set?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    disconnect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    delete?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    update?: UserRoleUpdateWithWhereUniqueWithoutRoleInput | UserRoleUpdateWithWhereUniqueWithoutRoleInput[]
    updateMany?: UserRoleUpdateManyWithWhereWithoutRoleInput | UserRoleUpdateManyWithWhereWithoutRoleInput[]
    deleteMany?: UserRoleScalarWhereInput | UserRoleScalarWhereInput[]
  }

  export type RolePermissionUpdateManyWithoutRoleNestedInput = {
    create?: XOR<RolePermissionCreateWithoutRoleInput, RolePermissionUncheckedCreateWithoutRoleInput> | RolePermissionCreateWithoutRoleInput[] | RolePermissionUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutRoleInput | RolePermissionCreateOrConnectWithoutRoleInput[]
    upsert?: RolePermissionUpsertWithWhereUniqueWithoutRoleInput | RolePermissionUpsertWithWhereUniqueWithoutRoleInput[]
    createMany?: RolePermissionCreateManyRoleInputEnvelope
    set?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    disconnect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    delete?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    update?: RolePermissionUpdateWithWhereUniqueWithoutRoleInput | RolePermissionUpdateWithWhereUniqueWithoutRoleInput[]
    updateMany?: RolePermissionUpdateManyWithWhereWithoutRoleInput | RolePermissionUpdateManyWithWhereWithoutRoleInput[]
    deleteMany?: RolePermissionScalarWhereInput | RolePermissionScalarWhereInput[]
  }

  export type UserRoleUncheckedUpdateManyWithoutRoleNestedInput = {
    create?: XOR<UserRoleCreateWithoutRoleInput, UserRoleUncheckedCreateWithoutRoleInput> | UserRoleCreateWithoutRoleInput[] | UserRoleUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: UserRoleCreateOrConnectWithoutRoleInput | UserRoleCreateOrConnectWithoutRoleInput[]
    upsert?: UserRoleUpsertWithWhereUniqueWithoutRoleInput | UserRoleUpsertWithWhereUniqueWithoutRoleInput[]
    createMany?: UserRoleCreateManyRoleInputEnvelope
    set?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    disconnect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    delete?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    connect?: UserRoleWhereUniqueInput | UserRoleWhereUniqueInput[]
    update?: UserRoleUpdateWithWhereUniqueWithoutRoleInput | UserRoleUpdateWithWhereUniqueWithoutRoleInput[]
    updateMany?: UserRoleUpdateManyWithWhereWithoutRoleInput | UserRoleUpdateManyWithWhereWithoutRoleInput[]
    deleteMany?: UserRoleScalarWhereInput | UserRoleScalarWhereInput[]
  }

  export type RolePermissionUncheckedUpdateManyWithoutRoleNestedInput = {
    create?: XOR<RolePermissionCreateWithoutRoleInput, RolePermissionUncheckedCreateWithoutRoleInput> | RolePermissionCreateWithoutRoleInput[] | RolePermissionUncheckedCreateWithoutRoleInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutRoleInput | RolePermissionCreateOrConnectWithoutRoleInput[]
    upsert?: RolePermissionUpsertWithWhereUniqueWithoutRoleInput | RolePermissionUpsertWithWhereUniqueWithoutRoleInput[]
    createMany?: RolePermissionCreateManyRoleInputEnvelope
    set?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    disconnect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    delete?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    update?: RolePermissionUpdateWithWhereUniqueWithoutRoleInput | RolePermissionUpdateWithWhereUniqueWithoutRoleInput[]
    updateMany?: RolePermissionUpdateManyWithWhereWithoutRoleInput | RolePermissionUpdateManyWithWhereWithoutRoleInput[]
    deleteMany?: RolePermissionScalarWhereInput | RolePermissionScalarWhereInput[]
  }

  export type RolePermissionCreateNestedManyWithoutPermissionInput = {
    create?: XOR<RolePermissionCreateWithoutPermissionInput, RolePermissionUncheckedCreateWithoutPermissionInput> | RolePermissionCreateWithoutPermissionInput[] | RolePermissionUncheckedCreateWithoutPermissionInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutPermissionInput | RolePermissionCreateOrConnectWithoutPermissionInput[]
    createMany?: RolePermissionCreateManyPermissionInputEnvelope
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
  }

  export type RolePermissionUncheckedCreateNestedManyWithoutPermissionInput = {
    create?: XOR<RolePermissionCreateWithoutPermissionInput, RolePermissionUncheckedCreateWithoutPermissionInput> | RolePermissionCreateWithoutPermissionInput[] | RolePermissionUncheckedCreateWithoutPermissionInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutPermissionInput | RolePermissionCreateOrConnectWithoutPermissionInput[]
    createMany?: RolePermissionCreateManyPermissionInputEnvelope
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
  }

  export type RolePermissionUpdateManyWithoutPermissionNestedInput = {
    create?: XOR<RolePermissionCreateWithoutPermissionInput, RolePermissionUncheckedCreateWithoutPermissionInput> | RolePermissionCreateWithoutPermissionInput[] | RolePermissionUncheckedCreateWithoutPermissionInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutPermissionInput | RolePermissionCreateOrConnectWithoutPermissionInput[]
    upsert?: RolePermissionUpsertWithWhereUniqueWithoutPermissionInput | RolePermissionUpsertWithWhereUniqueWithoutPermissionInput[]
    createMany?: RolePermissionCreateManyPermissionInputEnvelope
    set?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    disconnect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    delete?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    update?: RolePermissionUpdateWithWhereUniqueWithoutPermissionInput | RolePermissionUpdateWithWhereUniqueWithoutPermissionInput[]
    updateMany?: RolePermissionUpdateManyWithWhereWithoutPermissionInput | RolePermissionUpdateManyWithWhereWithoutPermissionInput[]
    deleteMany?: RolePermissionScalarWhereInput | RolePermissionScalarWhereInput[]
  }

  export type RolePermissionUncheckedUpdateManyWithoutPermissionNestedInput = {
    create?: XOR<RolePermissionCreateWithoutPermissionInput, RolePermissionUncheckedCreateWithoutPermissionInput> | RolePermissionCreateWithoutPermissionInput[] | RolePermissionUncheckedCreateWithoutPermissionInput[]
    connectOrCreate?: RolePermissionCreateOrConnectWithoutPermissionInput | RolePermissionCreateOrConnectWithoutPermissionInput[]
    upsert?: RolePermissionUpsertWithWhereUniqueWithoutPermissionInput | RolePermissionUpsertWithWhereUniqueWithoutPermissionInput[]
    createMany?: RolePermissionCreateManyPermissionInputEnvelope
    set?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    disconnect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    delete?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    connect?: RolePermissionWhereUniqueInput | RolePermissionWhereUniqueInput[]
    update?: RolePermissionUpdateWithWhereUniqueWithoutPermissionInput | RolePermissionUpdateWithWhereUniqueWithoutPermissionInput[]
    updateMany?: RolePermissionUpdateManyWithWhereWithoutPermissionInput | RolePermissionUpdateManyWithWhereWithoutPermissionInput[]
    deleteMany?: RolePermissionScalarWhereInput | RolePermissionScalarWhereInput[]
  }

  export type UserCreateNestedOneWithoutRolesInput = {
    create?: XOR<UserCreateWithoutRolesInput, UserUncheckedCreateWithoutRolesInput>
    connectOrCreate?: UserCreateOrConnectWithoutRolesInput
    connect?: UserWhereUniqueInput
  }

  export type RoleCreateNestedOneWithoutUsersInput = {
    create?: XOR<RoleCreateWithoutUsersInput, RoleUncheckedCreateWithoutUsersInput>
    connectOrCreate?: RoleCreateOrConnectWithoutUsersInput
    connect?: RoleWhereUniqueInput
  }

  export type UserUpdateOneRequiredWithoutRolesNestedInput = {
    create?: XOR<UserCreateWithoutRolesInput, UserUncheckedCreateWithoutRolesInput>
    connectOrCreate?: UserCreateOrConnectWithoutRolesInput
    upsert?: UserUpsertWithoutRolesInput
    connect?: UserWhereUniqueInput
    update?: XOR<XOR<UserUpdateToOneWithWhereWithoutRolesInput, UserUpdateWithoutRolesInput>, UserUncheckedUpdateWithoutRolesInput>
  }

  export type RoleUpdateOneRequiredWithoutUsersNestedInput = {
    create?: XOR<RoleCreateWithoutUsersInput, RoleUncheckedCreateWithoutUsersInput>
    connectOrCreate?: RoleCreateOrConnectWithoutUsersInput
    upsert?: RoleUpsertWithoutUsersInput
    connect?: RoleWhereUniqueInput
    update?: XOR<XOR<RoleUpdateToOneWithWhereWithoutUsersInput, RoleUpdateWithoutUsersInput>, RoleUncheckedUpdateWithoutUsersInput>
  }

  export type RoleCreateNestedOneWithoutPermissionsInput = {
    create?: XOR<RoleCreateWithoutPermissionsInput, RoleUncheckedCreateWithoutPermissionsInput>
    connectOrCreate?: RoleCreateOrConnectWithoutPermissionsInput
    connect?: RoleWhereUniqueInput
  }

  export type PermissionCreateNestedOneWithoutRolesInput = {
    create?: XOR<PermissionCreateWithoutRolesInput, PermissionUncheckedCreateWithoutRolesInput>
    connectOrCreate?: PermissionCreateOrConnectWithoutRolesInput
    connect?: PermissionWhereUniqueInput
  }

  export type RoleUpdateOneRequiredWithoutPermissionsNestedInput = {
    create?: XOR<RoleCreateWithoutPermissionsInput, RoleUncheckedCreateWithoutPermissionsInput>
    connectOrCreate?: RoleCreateOrConnectWithoutPermissionsInput
    upsert?: RoleUpsertWithoutPermissionsInput
    connect?: RoleWhereUniqueInput
    update?: XOR<XOR<RoleUpdateToOneWithWhereWithoutPermissionsInput, RoleUpdateWithoutPermissionsInput>, RoleUncheckedUpdateWithoutPermissionsInput>
  }

  export type PermissionUpdateOneRequiredWithoutRolesNestedInput = {
    create?: XOR<PermissionCreateWithoutRolesInput, PermissionUncheckedCreateWithoutRolesInput>
    connectOrCreate?: PermissionCreateOrConnectWithoutRolesInput
    upsert?: PermissionUpsertWithoutRolesInput
    connect?: PermissionWhereUniqueInput
    update?: XOR<XOR<PermissionUpdateToOneWithWhereWithoutRolesInput, PermissionUpdateWithoutRolesInput>, PermissionUncheckedUpdateWithoutRolesInput>
  }

  export type BranchCreateNestedOneWithoutCategoriesInput = {
    create?: XOR<BranchCreateWithoutCategoriesInput, BranchUncheckedCreateWithoutCategoriesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutCategoriesInput
    connect?: BranchWhereUniqueInput
  }

  export type CategoryCreateNestedOneWithoutChildrenInput = {
    create?: XOR<CategoryCreateWithoutChildrenInput, CategoryUncheckedCreateWithoutChildrenInput>
    connectOrCreate?: CategoryCreateOrConnectWithoutChildrenInput
    connect?: CategoryWhereUniqueInput
  }

  export type CategoryCreateNestedManyWithoutParentInput = {
    create?: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput> | CategoryCreateWithoutParentInput[] | CategoryUncheckedCreateWithoutParentInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutParentInput | CategoryCreateOrConnectWithoutParentInput[]
    createMany?: CategoryCreateManyParentInputEnvelope
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
  }

  export type ProductCreateNestedManyWithoutCategoryInput = {
    create?: XOR<ProductCreateWithoutCategoryInput, ProductUncheckedCreateWithoutCategoryInput> | ProductCreateWithoutCategoryInput[] | ProductUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutCategoryInput | ProductCreateOrConnectWithoutCategoryInput[]
    createMany?: ProductCreateManyCategoryInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type CategoryUncheckedCreateNestedManyWithoutParentInput = {
    create?: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput> | CategoryCreateWithoutParentInput[] | CategoryUncheckedCreateWithoutParentInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutParentInput | CategoryCreateOrConnectWithoutParentInput[]
    createMany?: CategoryCreateManyParentInputEnvelope
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutCategoryInput = {
    create?: XOR<ProductCreateWithoutCategoryInput, ProductUncheckedCreateWithoutCategoryInput> | ProductCreateWithoutCategoryInput[] | ProductUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutCategoryInput | ProductCreateOrConnectWithoutCategoryInput[]
    createMany?: ProductCreateManyCategoryInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutCategoriesNestedInput = {
    create?: XOR<BranchCreateWithoutCategoriesInput, BranchUncheckedCreateWithoutCategoriesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutCategoriesInput
    upsert?: BranchUpsertWithoutCategoriesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutCategoriesInput, BranchUpdateWithoutCategoriesInput>, BranchUncheckedUpdateWithoutCategoriesInput>
  }

  export type CategoryUpdateOneWithoutChildrenNestedInput = {
    create?: XOR<CategoryCreateWithoutChildrenInput, CategoryUncheckedCreateWithoutChildrenInput>
    connectOrCreate?: CategoryCreateOrConnectWithoutChildrenInput
    upsert?: CategoryUpsertWithoutChildrenInput
    disconnect?: CategoryWhereInput | boolean
    delete?: CategoryWhereInput | boolean
    connect?: CategoryWhereUniqueInput
    update?: XOR<XOR<CategoryUpdateToOneWithWhereWithoutChildrenInput, CategoryUpdateWithoutChildrenInput>, CategoryUncheckedUpdateWithoutChildrenInput>
  }

  export type CategoryUpdateManyWithoutParentNestedInput = {
    create?: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput> | CategoryCreateWithoutParentInput[] | CategoryUncheckedCreateWithoutParentInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutParentInput | CategoryCreateOrConnectWithoutParentInput[]
    upsert?: CategoryUpsertWithWhereUniqueWithoutParentInput | CategoryUpsertWithWhereUniqueWithoutParentInput[]
    createMany?: CategoryCreateManyParentInputEnvelope
    set?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    disconnect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    delete?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    update?: CategoryUpdateWithWhereUniqueWithoutParentInput | CategoryUpdateWithWhereUniqueWithoutParentInput[]
    updateMany?: CategoryUpdateManyWithWhereWithoutParentInput | CategoryUpdateManyWithWhereWithoutParentInput[]
    deleteMany?: CategoryScalarWhereInput | CategoryScalarWhereInput[]
  }

  export type ProductUpdateManyWithoutCategoryNestedInput = {
    create?: XOR<ProductCreateWithoutCategoryInput, ProductUncheckedCreateWithoutCategoryInput> | ProductCreateWithoutCategoryInput[] | ProductUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutCategoryInput | ProductCreateOrConnectWithoutCategoryInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutCategoryInput | ProductUpsertWithWhereUniqueWithoutCategoryInput[]
    createMany?: ProductCreateManyCategoryInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutCategoryInput | ProductUpdateWithWhereUniqueWithoutCategoryInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutCategoryInput | ProductUpdateManyWithWhereWithoutCategoryInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type CategoryUncheckedUpdateManyWithoutParentNestedInput = {
    create?: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput> | CategoryCreateWithoutParentInput[] | CategoryUncheckedCreateWithoutParentInput[]
    connectOrCreate?: CategoryCreateOrConnectWithoutParentInput | CategoryCreateOrConnectWithoutParentInput[]
    upsert?: CategoryUpsertWithWhereUniqueWithoutParentInput | CategoryUpsertWithWhereUniqueWithoutParentInput[]
    createMany?: CategoryCreateManyParentInputEnvelope
    set?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    disconnect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    delete?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    connect?: CategoryWhereUniqueInput | CategoryWhereUniqueInput[]
    update?: CategoryUpdateWithWhereUniqueWithoutParentInput | CategoryUpdateWithWhereUniqueWithoutParentInput[]
    updateMany?: CategoryUpdateManyWithWhereWithoutParentInput | CategoryUpdateManyWithWhereWithoutParentInput[]
    deleteMany?: CategoryScalarWhereInput | CategoryScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutCategoryNestedInput = {
    create?: XOR<ProductCreateWithoutCategoryInput, ProductUncheckedCreateWithoutCategoryInput> | ProductCreateWithoutCategoryInput[] | ProductUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutCategoryInput | ProductCreateOrConnectWithoutCategoryInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutCategoryInput | ProductUpsertWithWhereUniqueWithoutCategoryInput[]
    createMany?: ProductCreateManyCategoryInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutCategoryInput | ProductUpdateWithWhereUniqueWithoutCategoryInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutCategoryInput | ProductUpdateManyWithWhereWithoutCategoryInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type BranchCreateNestedOneWithoutVariationsInput = {
    create?: XOR<BranchCreateWithoutVariationsInput, BranchUncheckedCreateWithoutVariationsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutVariationsInput
    connect?: BranchWhereUniqueInput
  }

  export type BranchUpdateOneWithoutVariationsNestedInput = {
    create?: XOR<BranchCreateWithoutVariationsInput, BranchUncheckedCreateWithoutVariationsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutVariationsInput
    upsert?: BranchUpsertWithoutVariationsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutVariationsInput, BranchUpdateWithoutVariationsInput>, BranchUncheckedUpdateWithoutVariationsInput>
  }

  export type BranchCreateNestedOneWithoutBrandsInput = {
    create?: XOR<BranchCreateWithoutBrandsInput, BranchUncheckedCreateWithoutBrandsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutBrandsInput
    connect?: BranchWhereUniqueInput
  }

  export type ProductCreateNestedManyWithoutBrandInput = {
    create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[]
    createMany?: ProductCreateManyBrandInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutBrandInput = {
    create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[]
    createMany?: ProductCreateManyBrandInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutBrandsNestedInput = {
    create?: XOR<BranchCreateWithoutBrandsInput, BranchUncheckedCreateWithoutBrandsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutBrandsInput
    upsert?: BranchUpsertWithoutBrandsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutBrandsInput, BranchUpdateWithoutBrandsInput>, BranchUncheckedUpdateWithoutBrandsInput>
  }

  export type ProductUpdateManyWithoutBrandNestedInput = {
    create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutBrandInput | ProductUpsertWithWhereUniqueWithoutBrandInput[]
    createMany?: ProductCreateManyBrandInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutBrandInput | ProductUpdateWithWhereUniqueWithoutBrandInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutBrandInput | ProductUpdateManyWithWhereWithoutBrandInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutBrandNestedInput = {
    create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutBrandInput | ProductUpsertWithWhereUniqueWithoutBrandInput[]
    createMany?: ProductCreateManyBrandInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutBrandInput | ProductUpdateWithWhereUniqueWithoutBrandInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutBrandInput | ProductUpdateManyWithWhereWithoutBrandInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type BranchCreateNestedOneWithoutUnitsInput = {
    create?: XOR<BranchCreateWithoutUnitsInput, BranchUncheckedCreateWithoutUnitsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutUnitsInput
    connect?: BranchWhereUniqueInput
  }

  export type ProductCreateNestedManyWithoutUnitInput = {
    create?: XOR<ProductCreateWithoutUnitInput, ProductUncheckedCreateWithoutUnitInput> | ProductCreateWithoutUnitInput[] | ProductUncheckedCreateWithoutUnitInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutUnitInput | ProductCreateOrConnectWithoutUnitInput[]
    createMany?: ProductCreateManyUnitInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutUnitInput = {
    create?: XOR<ProductCreateWithoutUnitInput, ProductUncheckedCreateWithoutUnitInput> | ProductCreateWithoutUnitInput[] | ProductUncheckedCreateWithoutUnitInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutUnitInput | ProductCreateOrConnectWithoutUnitInput[]
    createMany?: ProductCreateManyUnitInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutUnitsNestedInput = {
    create?: XOR<BranchCreateWithoutUnitsInput, BranchUncheckedCreateWithoutUnitsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutUnitsInput
    upsert?: BranchUpsertWithoutUnitsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutUnitsInput, BranchUpdateWithoutUnitsInput>, BranchUncheckedUpdateWithoutUnitsInput>
  }

  export type ProductUpdateManyWithoutUnitNestedInput = {
    create?: XOR<ProductCreateWithoutUnitInput, ProductUncheckedCreateWithoutUnitInput> | ProductCreateWithoutUnitInput[] | ProductUncheckedCreateWithoutUnitInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutUnitInput | ProductCreateOrConnectWithoutUnitInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutUnitInput | ProductUpsertWithWhereUniqueWithoutUnitInput[]
    createMany?: ProductCreateManyUnitInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutUnitInput | ProductUpdateWithWhereUniqueWithoutUnitInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutUnitInput | ProductUpdateManyWithWhereWithoutUnitInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutUnitNestedInput = {
    create?: XOR<ProductCreateWithoutUnitInput, ProductUncheckedCreateWithoutUnitInput> | ProductCreateWithoutUnitInput[] | ProductUncheckedCreateWithoutUnitInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutUnitInput | ProductCreateOrConnectWithoutUnitInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutUnitInput | ProductUpsertWithWhereUniqueWithoutUnitInput[]
    createMany?: ProductCreateManyUnitInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutUnitInput | ProductUpdateWithWhereUniqueWithoutUnitInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutUnitInput | ProductUpdateManyWithWhereWithoutUnitInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type BranchCreateNestedOneWithoutWarehousesInput = {
    create?: XOR<BranchCreateWithoutWarehousesInput, BranchUncheckedCreateWithoutWarehousesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutWarehousesInput
    connect?: BranchWhereUniqueInput
  }

  export type ProductCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<ProductCreateWithoutWarehouseInput, ProductUncheckedCreateWithoutWarehouseInput> | ProductCreateWithoutWarehouseInput[] | ProductUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutWarehouseInput | ProductCreateOrConnectWithoutWarehouseInput[]
    createMany?: ProductCreateManyWarehouseInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type InventoryAdjustmentCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutWarehouseInput, InventoryAdjustmentUncheckedCreateWithoutWarehouseInput> | InventoryAdjustmentCreateWithoutWarehouseInput[] | InventoryAdjustmentUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutWarehouseInput | InventoryAdjustmentCreateOrConnectWithoutWarehouseInput[]
    createMany?: InventoryAdjustmentCreateManyWarehouseInputEnvelope
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
  }

  export type PurchaseCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<PurchaseCreateWithoutWarehouseInput, PurchaseUncheckedCreateWithoutWarehouseInput> | PurchaseCreateWithoutWarehouseInput[] | PurchaseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutWarehouseInput | PurchaseCreateOrConnectWithoutWarehouseInput[]
    createMany?: PurchaseCreateManyWarehouseInputEnvelope
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
  }

  export type PurchaseReturnCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<PurchaseReturnCreateWithoutWarehouseInput, PurchaseReturnUncheckedCreateWithoutWarehouseInput> | PurchaseReturnCreateWithoutWarehouseInput[] | PurchaseReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutWarehouseInput | PurchaseReturnCreateOrConnectWithoutWarehouseInput[]
    createMany?: PurchaseReturnCreateManyWarehouseInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type SaleCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<SaleCreateWithoutWarehouseInput, SaleUncheckedCreateWithoutWarehouseInput> | SaleCreateWithoutWarehouseInput[] | SaleUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutWarehouseInput | SaleCreateOrConnectWithoutWarehouseInput[]
    createMany?: SaleCreateManyWarehouseInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type SalesReturnCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<SalesReturnCreateWithoutWarehouseInput, SalesReturnUncheckedCreateWithoutWarehouseInput> | SalesReturnCreateWithoutWarehouseInput[] | SalesReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutWarehouseInput | SalesReturnCreateOrConnectWithoutWarehouseInput[]
    createMany?: SalesReturnCreateManyWarehouseInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type ExpenseCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<ExpenseCreateWithoutWarehouseInput, ExpenseUncheckedCreateWithoutWarehouseInput> | ExpenseCreateWithoutWarehouseInput[] | ExpenseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutWarehouseInput | ExpenseCreateOrConnectWithoutWarehouseInput[]
    createMany?: ExpenseCreateManyWarehouseInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type InventoryTransferCreateNestedManyWithoutFromWarehouseInput = {
    create?: XOR<InventoryTransferCreateWithoutFromWarehouseInput, InventoryTransferUncheckedCreateWithoutFromWarehouseInput> | InventoryTransferCreateWithoutFromWarehouseInput[] | InventoryTransferUncheckedCreateWithoutFromWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutFromWarehouseInput | InventoryTransferCreateOrConnectWithoutFromWarehouseInput[]
    createMany?: InventoryTransferCreateManyFromWarehouseInputEnvelope
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
  }

  export type InventoryTransferCreateNestedManyWithoutToWarehouseInput = {
    create?: XOR<InventoryTransferCreateWithoutToWarehouseInput, InventoryTransferUncheckedCreateWithoutToWarehouseInput> | InventoryTransferCreateWithoutToWarehouseInput[] | InventoryTransferUncheckedCreateWithoutToWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutToWarehouseInput | InventoryTransferCreateOrConnectWithoutToWarehouseInput[]
    createMany?: InventoryTransferCreateManyToWarehouseInputEnvelope
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
  }

  export type WarehouseStockCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<WarehouseStockCreateWithoutWarehouseInput, WarehouseStockUncheckedCreateWithoutWarehouseInput> | WarehouseStockCreateWithoutWarehouseInput[] | WarehouseStockUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutWarehouseInput | WarehouseStockCreateOrConnectWithoutWarehouseInput[]
    createMany?: WarehouseStockCreateManyWarehouseInputEnvelope
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<ProductCreateWithoutWarehouseInput, ProductUncheckedCreateWithoutWarehouseInput> | ProductCreateWithoutWarehouseInput[] | ProductUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutWarehouseInput | ProductCreateOrConnectWithoutWarehouseInput[]
    createMany?: ProductCreateManyWarehouseInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutWarehouseInput, InventoryAdjustmentUncheckedCreateWithoutWarehouseInput> | InventoryAdjustmentCreateWithoutWarehouseInput[] | InventoryAdjustmentUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutWarehouseInput | InventoryAdjustmentCreateOrConnectWithoutWarehouseInput[]
    createMany?: InventoryAdjustmentCreateManyWarehouseInputEnvelope
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
  }

  export type PurchaseUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<PurchaseCreateWithoutWarehouseInput, PurchaseUncheckedCreateWithoutWarehouseInput> | PurchaseCreateWithoutWarehouseInput[] | PurchaseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutWarehouseInput | PurchaseCreateOrConnectWithoutWarehouseInput[]
    createMany?: PurchaseCreateManyWarehouseInputEnvelope
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
  }

  export type PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<PurchaseReturnCreateWithoutWarehouseInput, PurchaseReturnUncheckedCreateWithoutWarehouseInput> | PurchaseReturnCreateWithoutWarehouseInput[] | PurchaseReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutWarehouseInput | PurchaseReturnCreateOrConnectWithoutWarehouseInput[]
    createMany?: PurchaseReturnCreateManyWarehouseInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type SaleUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<SaleCreateWithoutWarehouseInput, SaleUncheckedCreateWithoutWarehouseInput> | SaleCreateWithoutWarehouseInput[] | SaleUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutWarehouseInput | SaleCreateOrConnectWithoutWarehouseInput[]
    createMany?: SaleCreateManyWarehouseInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<SalesReturnCreateWithoutWarehouseInput, SalesReturnUncheckedCreateWithoutWarehouseInput> | SalesReturnCreateWithoutWarehouseInput[] | SalesReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutWarehouseInput | SalesReturnCreateOrConnectWithoutWarehouseInput[]
    createMany?: SalesReturnCreateManyWarehouseInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type ExpenseUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<ExpenseCreateWithoutWarehouseInput, ExpenseUncheckedCreateWithoutWarehouseInput> | ExpenseCreateWithoutWarehouseInput[] | ExpenseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutWarehouseInput | ExpenseCreateOrConnectWithoutWarehouseInput[]
    createMany?: ExpenseCreateManyWarehouseInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput = {
    create?: XOR<InventoryTransferCreateWithoutFromWarehouseInput, InventoryTransferUncheckedCreateWithoutFromWarehouseInput> | InventoryTransferCreateWithoutFromWarehouseInput[] | InventoryTransferUncheckedCreateWithoutFromWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutFromWarehouseInput | InventoryTransferCreateOrConnectWithoutFromWarehouseInput[]
    createMany?: InventoryTransferCreateManyFromWarehouseInputEnvelope
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
  }

  export type InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput = {
    create?: XOR<InventoryTransferCreateWithoutToWarehouseInput, InventoryTransferUncheckedCreateWithoutToWarehouseInput> | InventoryTransferCreateWithoutToWarehouseInput[] | InventoryTransferUncheckedCreateWithoutToWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutToWarehouseInput | InventoryTransferCreateOrConnectWithoutToWarehouseInput[]
    createMany?: InventoryTransferCreateManyToWarehouseInputEnvelope
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
  }

  export type WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput = {
    create?: XOR<WarehouseStockCreateWithoutWarehouseInput, WarehouseStockUncheckedCreateWithoutWarehouseInput> | WarehouseStockCreateWithoutWarehouseInput[] | WarehouseStockUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutWarehouseInput | WarehouseStockCreateOrConnectWithoutWarehouseInput[]
    createMany?: WarehouseStockCreateManyWarehouseInputEnvelope
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutWarehousesNestedInput = {
    create?: XOR<BranchCreateWithoutWarehousesInput, BranchUncheckedCreateWithoutWarehousesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutWarehousesInput
    upsert?: BranchUpsertWithoutWarehousesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutWarehousesInput, BranchUpdateWithoutWarehousesInput>, BranchUncheckedUpdateWithoutWarehousesInput>
  }

  export type ProductUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<ProductCreateWithoutWarehouseInput, ProductUncheckedCreateWithoutWarehouseInput> | ProductCreateWithoutWarehouseInput[] | ProductUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutWarehouseInput | ProductCreateOrConnectWithoutWarehouseInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutWarehouseInput | ProductUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: ProductCreateManyWarehouseInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutWarehouseInput | ProductUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutWarehouseInput | ProductUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutWarehouseInput, InventoryAdjustmentUncheckedCreateWithoutWarehouseInput> | InventoryAdjustmentCreateWithoutWarehouseInput[] | InventoryAdjustmentUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutWarehouseInput | InventoryAdjustmentCreateOrConnectWithoutWarehouseInput[]
    upsert?: InventoryAdjustmentUpsertWithWhereUniqueWithoutWarehouseInput | InventoryAdjustmentUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: InventoryAdjustmentCreateManyWarehouseInputEnvelope
    set?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    disconnect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    delete?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    update?: InventoryAdjustmentUpdateWithWhereUniqueWithoutWarehouseInput | InventoryAdjustmentUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: InventoryAdjustmentUpdateManyWithWhereWithoutWarehouseInput | InventoryAdjustmentUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: InventoryAdjustmentScalarWhereInput | InventoryAdjustmentScalarWhereInput[]
  }

  export type PurchaseUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<PurchaseCreateWithoutWarehouseInput, PurchaseUncheckedCreateWithoutWarehouseInput> | PurchaseCreateWithoutWarehouseInput[] | PurchaseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutWarehouseInput | PurchaseCreateOrConnectWithoutWarehouseInput[]
    upsert?: PurchaseUpsertWithWhereUniqueWithoutWarehouseInput | PurchaseUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: PurchaseCreateManyWarehouseInputEnvelope
    set?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    disconnect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    delete?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    update?: PurchaseUpdateWithWhereUniqueWithoutWarehouseInput | PurchaseUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: PurchaseUpdateManyWithWhereWithoutWarehouseInput | PurchaseUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
  }

  export type PurchaseReturnUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutWarehouseInput, PurchaseReturnUncheckedCreateWithoutWarehouseInput> | PurchaseReturnCreateWithoutWarehouseInput[] | PurchaseReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutWarehouseInput | PurchaseReturnCreateOrConnectWithoutWarehouseInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutWarehouseInput | PurchaseReturnUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: PurchaseReturnCreateManyWarehouseInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutWarehouseInput | PurchaseReturnUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutWarehouseInput | PurchaseReturnUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type SaleUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<SaleCreateWithoutWarehouseInput, SaleUncheckedCreateWithoutWarehouseInput> | SaleCreateWithoutWarehouseInput[] | SaleUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutWarehouseInput | SaleCreateOrConnectWithoutWarehouseInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutWarehouseInput | SaleUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: SaleCreateManyWarehouseInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutWarehouseInput | SaleUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutWarehouseInput | SaleUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type SalesReturnUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<SalesReturnCreateWithoutWarehouseInput, SalesReturnUncheckedCreateWithoutWarehouseInput> | SalesReturnCreateWithoutWarehouseInput[] | SalesReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutWarehouseInput | SalesReturnCreateOrConnectWithoutWarehouseInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutWarehouseInput | SalesReturnUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: SalesReturnCreateManyWarehouseInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutWarehouseInput | SalesReturnUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutWarehouseInput | SalesReturnUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type ExpenseUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<ExpenseCreateWithoutWarehouseInput, ExpenseUncheckedCreateWithoutWarehouseInput> | ExpenseCreateWithoutWarehouseInput[] | ExpenseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutWarehouseInput | ExpenseCreateOrConnectWithoutWarehouseInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutWarehouseInput | ExpenseUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: ExpenseCreateManyWarehouseInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutWarehouseInput | ExpenseUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutWarehouseInput | ExpenseUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type InventoryTransferUpdateManyWithoutFromWarehouseNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutFromWarehouseInput, InventoryTransferUncheckedCreateWithoutFromWarehouseInput> | InventoryTransferCreateWithoutFromWarehouseInput[] | InventoryTransferUncheckedCreateWithoutFromWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutFromWarehouseInput | InventoryTransferCreateOrConnectWithoutFromWarehouseInput[]
    upsert?: InventoryTransferUpsertWithWhereUniqueWithoutFromWarehouseInput | InventoryTransferUpsertWithWhereUniqueWithoutFromWarehouseInput[]
    createMany?: InventoryTransferCreateManyFromWarehouseInputEnvelope
    set?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    disconnect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    delete?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    update?: InventoryTransferUpdateWithWhereUniqueWithoutFromWarehouseInput | InventoryTransferUpdateWithWhereUniqueWithoutFromWarehouseInput[]
    updateMany?: InventoryTransferUpdateManyWithWhereWithoutFromWarehouseInput | InventoryTransferUpdateManyWithWhereWithoutFromWarehouseInput[]
    deleteMany?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
  }

  export type InventoryTransferUpdateManyWithoutToWarehouseNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutToWarehouseInput, InventoryTransferUncheckedCreateWithoutToWarehouseInput> | InventoryTransferCreateWithoutToWarehouseInput[] | InventoryTransferUncheckedCreateWithoutToWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutToWarehouseInput | InventoryTransferCreateOrConnectWithoutToWarehouseInput[]
    upsert?: InventoryTransferUpsertWithWhereUniqueWithoutToWarehouseInput | InventoryTransferUpsertWithWhereUniqueWithoutToWarehouseInput[]
    createMany?: InventoryTransferCreateManyToWarehouseInputEnvelope
    set?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    disconnect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    delete?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    update?: InventoryTransferUpdateWithWhereUniqueWithoutToWarehouseInput | InventoryTransferUpdateWithWhereUniqueWithoutToWarehouseInput[]
    updateMany?: InventoryTransferUpdateManyWithWhereWithoutToWarehouseInput | InventoryTransferUpdateManyWithWhereWithoutToWarehouseInput[]
    deleteMany?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
  }

  export type WarehouseStockUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<WarehouseStockCreateWithoutWarehouseInput, WarehouseStockUncheckedCreateWithoutWarehouseInput> | WarehouseStockCreateWithoutWarehouseInput[] | WarehouseStockUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutWarehouseInput | WarehouseStockCreateOrConnectWithoutWarehouseInput[]
    upsert?: WarehouseStockUpsertWithWhereUniqueWithoutWarehouseInput | WarehouseStockUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: WarehouseStockCreateManyWarehouseInputEnvelope
    set?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    disconnect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    delete?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    update?: WarehouseStockUpdateWithWhereUniqueWithoutWarehouseInput | WarehouseStockUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: WarehouseStockUpdateManyWithWhereWithoutWarehouseInput | WarehouseStockUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: WarehouseStockScalarWhereInput | WarehouseStockScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<ProductCreateWithoutWarehouseInput, ProductUncheckedCreateWithoutWarehouseInput> | ProductCreateWithoutWarehouseInput[] | ProductUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutWarehouseInput | ProductCreateOrConnectWithoutWarehouseInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutWarehouseInput | ProductUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: ProductCreateManyWarehouseInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutWarehouseInput | ProductUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutWarehouseInput | ProductUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutWarehouseInput, InventoryAdjustmentUncheckedCreateWithoutWarehouseInput> | InventoryAdjustmentCreateWithoutWarehouseInput[] | InventoryAdjustmentUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutWarehouseInput | InventoryAdjustmentCreateOrConnectWithoutWarehouseInput[]
    upsert?: InventoryAdjustmentUpsertWithWhereUniqueWithoutWarehouseInput | InventoryAdjustmentUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: InventoryAdjustmentCreateManyWarehouseInputEnvelope
    set?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    disconnect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    delete?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    connect?: InventoryAdjustmentWhereUniqueInput | InventoryAdjustmentWhereUniqueInput[]
    update?: InventoryAdjustmentUpdateWithWhereUniqueWithoutWarehouseInput | InventoryAdjustmentUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: InventoryAdjustmentUpdateManyWithWhereWithoutWarehouseInput | InventoryAdjustmentUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: InventoryAdjustmentScalarWhereInput | InventoryAdjustmentScalarWhereInput[]
  }

  export type PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<PurchaseCreateWithoutWarehouseInput, PurchaseUncheckedCreateWithoutWarehouseInput> | PurchaseCreateWithoutWarehouseInput[] | PurchaseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutWarehouseInput | PurchaseCreateOrConnectWithoutWarehouseInput[]
    upsert?: PurchaseUpsertWithWhereUniqueWithoutWarehouseInput | PurchaseUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: PurchaseCreateManyWarehouseInputEnvelope
    set?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    disconnect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    delete?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    update?: PurchaseUpdateWithWhereUniqueWithoutWarehouseInput | PurchaseUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: PurchaseUpdateManyWithWhereWithoutWarehouseInput | PurchaseUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutWarehouseInput, PurchaseReturnUncheckedCreateWithoutWarehouseInput> | PurchaseReturnCreateWithoutWarehouseInput[] | PurchaseReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutWarehouseInput | PurchaseReturnCreateOrConnectWithoutWarehouseInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutWarehouseInput | PurchaseReturnUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: PurchaseReturnCreateManyWarehouseInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutWarehouseInput | PurchaseReturnUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutWarehouseInput | PurchaseReturnUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type SaleUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<SaleCreateWithoutWarehouseInput, SaleUncheckedCreateWithoutWarehouseInput> | SaleCreateWithoutWarehouseInput[] | SaleUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutWarehouseInput | SaleCreateOrConnectWithoutWarehouseInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutWarehouseInput | SaleUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: SaleCreateManyWarehouseInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutWarehouseInput | SaleUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutWarehouseInput | SaleUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<SalesReturnCreateWithoutWarehouseInput, SalesReturnUncheckedCreateWithoutWarehouseInput> | SalesReturnCreateWithoutWarehouseInput[] | SalesReturnUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutWarehouseInput | SalesReturnCreateOrConnectWithoutWarehouseInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutWarehouseInput | SalesReturnUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: SalesReturnCreateManyWarehouseInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutWarehouseInput | SalesReturnUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutWarehouseInput | SalesReturnUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<ExpenseCreateWithoutWarehouseInput, ExpenseUncheckedCreateWithoutWarehouseInput> | ExpenseCreateWithoutWarehouseInput[] | ExpenseUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutWarehouseInput | ExpenseCreateOrConnectWithoutWarehouseInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutWarehouseInput | ExpenseUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: ExpenseCreateManyWarehouseInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutWarehouseInput | ExpenseUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutWarehouseInput | ExpenseUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutFromWarehouseInput, InventoryTransferUncheckedCreateWithoutFromWarehouseInput> | InventoryTransferCreateWithoutFromWarehouseInput[] | InventoryTransferUncheckedCreateWithoutFromWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutFromWarehouseInput | InventoryTransferCreateOrConnectWithoutFromWarehouseInput[]
    upsert?: InventoryTransferUpsertWithWhereUniqueWithoutFromWarehouseInput | InventoryTransferUpsertWithWhereUniqueWithoutFromWarehouseInput[]
    createMany?: InventoryTransferCreateManyFromWarehouseInputEnvelope
    set?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    disconnect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    delete?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    update?: InventoryTransferUpdateWithWhereUniqueWithoutFromWarehouseInput | InventoryTransferUpdateWithWhereUniqueWithoutFromWarehouseInput[]
    updateMany?: InventoryTransferUpdateManyWithWhereWithoutFromWarehouseInput | InventoryTransferUpdateManyWithWhereWithoutFromWarehouseInput[]
    deleteMany?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
  }

  export type InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutToWarehouseInput, InventoryTransferUncheckedCreateWithoutToWarehouseInput> | InventoryTransferCreateWithoutToWarehouseInput[] | InventoryTransferUncheckedCreateWithoutToWarehouseInput[]
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutToWarehouseInput | InventoryTransferCreateOrConnectWithoutToWarehouseInput[]
    upsert?: InventoryTransferUpsertWithWhereUniqueWithoutToWarehouseInput | InventoryTransferUpsertWithWhereUniqueWithoutToWarehouseInput[]
    createMany?: InventoryTransferCreateManyToWarehouseInputEnvelope
    set?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    disconnect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    delete?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    connect?: InventoryTransferWhereUniqueInput | InventoryTransferWhereUniqueInput[]
    update?: InventoryTransferUpdateWithWhereUniqueWithoutToWarehouseInput | InventoryTransferUpdateWithWhereUniqueWithoutToWarehouseInput[]
    updateMany?: InventoryTransferUpdateManyWithWhereWithoutToWarehouseInput | InventoryTransferUpdateManyWithWhereWithoutToWarehouseInput[]
    deleteMany?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
  }

  export type WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput = {
    create?: XOR<WarehouseStockCreateWithoutWarehouseInput, WarehouseStockUncheckedCreateWithoutWarehouseInput> | WarehouseStockCreateWithoutWarehouseInput[] | WarehouseStockUncheckedCreateWithoutWarehouseInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutWarehouseInput | WarehouseStockCreateOrConnectWithoutWarehouseInput[]
    upsert?: WarehouseStockUpsertWithWhereUniqueWithoutWarehouseInput | WarehouseStockUpsertWithWhereUniqueWithoutWarehouseInput[]
    createMany?: WarehouseStockCreateManyWarehouseInputEnvelope
    set?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    disconnect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    delete?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    update?: WarehouseStockUpdateWithWhereUniqueWithoutWarehouseInput | WarehouseStockUpdateWithWhereUniqueWithoutWarehouseInput[]
    updateMany?: WarehouseStockUpdateManyWithWhereWithoutWarehouseInput | WarehouseStockUpdateManyWithWhereWithoutWarehouseInput[]
    deleteMany?: WarehouseStockScalarWhereInput | WarehouseStockScalarWhereInput[]
  }

  export type WarehouseCreateNestedOneWithoutStocksInput = {
    create?: XOR<WarehouseCreateWithoutStocksInput, WarehouseUncheckedCreateWithoutStocksInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutStocksInput
    connect?: WarehouseWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutWarehouseStocksInput = {
    create?: XOR<ProductCreateWithoutWarehouseStocksInput, ProductUncheckedCreateWithoutWarehouseStocksInput>
    connectOrCreate?: ProductCreateOrConnectWithoutWarehouseStocksInput
    connect?: ProductWhereUniqueInput
  }

  export type WarehouseUpdateOneRequiredWithoutStocksNestedInput = {
    create?: XOR<WarehouseCreateWithoutStocksInput, WarehouseUncheckedCreateWithoutStocksInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutStocksInput
    upsert?: WarehouseUpsertWithoutStocksInput
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutStocksInput, WarehouseUpdateWithoutStocksInput>, WarehouseUncheckedUpdateWithoutStocksInput>
  }

  export type ProductUpdateOneRequiredWithoutWarehouseStocksNestedInput = {
    create?: XOR<ProductCreateWithoutWarehouseStocksInput, ProductUncheckedCreateWithoutWarehouseStocksInput>
    connectOrCreate?: ProductCreateOrConnectWithoutWarehouseStocksInput
    upsert?: ProductUpsertWithoutWarehouseStocksInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutWarehouseStocksInput, ProductUpdateWithoutWarehouseStocksInput>, ProductUncheckedUpdateWithoutWarehouseStocksInput>
  }

  export type BranchCreateNestedOneWithoutSuppliersInput = {
    create?: XOR<BranchCreateWithoutSuppliersInput, BranchUncheckedCreateWithoutSuppliersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutSuppliersInput
    connect?: BranchWhereUniqueInput
  }

  export type PurchaseCreateNestedManyWithoutSupplierInput = {
    create?: XOR<PurchaseCreateWithoutSupplierInput, PurchaseUncheckedCreateWithoutSupplierInput> | PurchaseCreateWithoutSupplierInput[] | PurchaseUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutSupplierInput | PurchaseCreateOrConnectWithoutSupplierInput[]
    createMany?: PurchaseCreateManySupplierInputEnvelope
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
  }

  export type PurchaseReturnCreateNestedManyWithoutSupplierInput = {
    create?: XOR<PurchaseReturnCreateWithoutSupplierInput, PurchaseReturnUncheckedCreateWithoutSupplierInput> | PurchaseReturnCreateWithoutSupplierInput[] | PurchaseReturnUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutSupplierInput | PurchaseReturnCreateOrConnectWithoutSupplierInput[]
    createMany?: PurchaseReturnCreateManySupplierInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type PurchaseUncheckedCreateNestedManyWithoutSupplierInput = {
    create?: XOR<PurchaseCreateWithoutSupplierInput, PurchaseUncheckedCreateWithoutSupplierInput> | PurchaseCreateWithoutSupplierInput[] | PurchaseUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutSupplierInput | PurchaseCreateOrConnectWithoutSupplierInput[]
    createMany?: PurchaseCreateManySupplierInputEnvelope
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
  }

  export type PurchaseReturnUncheckedCreateNestedManyWithoutSupplierInput = {
    create?: XOR<PurchaseReturnCreateWithoutSupplierInput, PurchaseReturnUncheckedCreateWithoutSupplierInput> | PurchaseReturnCreateWithoutSupplierInput[] | PurchaseReturnUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutSupplierInput | PurchaseReturnCreateOrConnectWithoutSupplierInput[]
    createMany?: PurchaseReturnCreateManySupplierInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutSuppliersNestedInput = {
    create?: XOR<BranchCreateWithoutSuppliersInput, BranchUncheckedCreateWithoutSuppliersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutSuppliersInput
    upsert?: BranchUpsertWithoutSuppliersInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutSuppliersInput, BranchUpdateWithoutSuppliersInput>, BranchUncheckedUpdateWithoutSuppliersInput>
  }

  export type PurchaseUpdateManyWithoutSupplierNestedInput = {
    create?: XOR<PurchaseCreateWithoutSupplierInput, PurchaseUncheckedCreateWithoutSupplierInput> | PurchaseCreateWithoutSupplierInput[] | PurchaseUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutSupplierInput | PurchaseCreateOrConnectWithoutSupplierInput[]
    upsert?: PurchaseUpsertWithWhereUniqueWithoutSupplierInput | PurchaseUpsertWithWhereUniqueWithoutSupplierInput[]
    createMany?: PurchaseCreateManySupplierInputEnvelope
    set?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    disconnect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    delete?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    update?: PurchaseUpdateWithWhereUniqueWithoutSupplierInput | PurchaseUpdateWithWhereUniqueWithoutSupplierInput[]
    updateMany?: PurchaseUpdateManyWithWhereWithoutSupplierInput | PurchaseUpdateManyWithWhereWithoutSupplierInput[]
    deleteMany?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
  }

  export type PurchaseReturnUpdateManyWithoutSupplierNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutSupplierInput, PurchaseReturnUncheckedCreateWithoutSupplierInput> | PurchaseReturnCreateWithoutSupplierInput[] | PurchaseReturnUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutSupplierInput | PurchaseReturnCreateOrConnectWithoutSupplierInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutSupplierInput | PurchaseReturnUpsertWithWhereUniqueWithoutSupplierInput[]
    createMany?: PurchaseReturnCreateManySupplierInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutSupplierInput | PurchaseReturnUpdateWithWhereUniqueWithoutSupplierInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutSupplierInput | PurchaseReturnUpdateManyWithWhereWithoutSupplierInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type PurchaseUncheckedUpdateManyWithoutSupplierNestedInput = {
    create?: XOR<PurchaseCreateWithoutSupplierInput, PurchaseUncheckedCreateWithoutSupplierInput> | PurchaseCreateWithoutSupplierInput[] | PurchaseUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseCreateOrConnectWithoutSupplierInput | PurchaseCreateOrConnectWithoutSupplierInput[]
    upsert?: PurchaseUpsertWithWhereUniqueWithoutSupplierInput | PurchaseUpsertWithWhereUniqueWithoutSupplierInput[]
    createMany?: PurchaseCreateManySupplierInputEnvelope
    set?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    disconnect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    delete?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    connect?: PurchaseWhereUniqueInput | PurchaseWhereUniqueInput[]
    update?: PurchaseUpdateWithWhereUniqueWithoutSupplierInput | PurchaseUpdateWithWhereUniqueWithoutSupplierInput[]
    updateMany?: PurchaseUpdateManyWithWhereWithoutSupplierInput | PurchaseUpdateManyWithWhereWithoutSupplierInput[]
    deleteMany?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutSupplierNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutSupplierInput, PurchaseReturnUncheckedCreateWithoutSupplierInput> | PurchaseReturnCreateWithoutSupplierInput[] | PurchaseReturnUncheckedCreateWithoutSupplierInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutSupplierInput | PurchaseReturnCreateOrConnectWithoutSupplierInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutSupplierInput | PurchaseReturnUpsertWithWhereUniqueWithoutSupplierInput[]
    createMany?: PurchaseReturnCreateManySupplierInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutSupplierInput | PurchaseReturnUpdateWithWhereUniqueWithoutSupplierInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutSupplierInput | PurchaseReturnUpdateManyWithWhereWithoutSupplierInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type SupplierCreateNestedOneWithoutPurchasesInput = {
    create?: XOR<SupplierCreateWithoutPurchasesInput, SupplierUncheckedCreateWithoutPurchasesInput>
    connectOrCreate?: SupplierCreateOrConnectWithoutPurchasesInput
    connect?: SupplierWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutPurchasesInput = {
    create?: XOR<WarehouseCreateWithoutPurchasesInput, WarehouseUncheckedCreateWithoutPurchasesInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutPurchasesInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutPurchasesInput = {
    create?: XOR<BranchCreateWithoutPurchasesInput, BranchUncheckedCreateWithoutPurchasesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutPurchasesInput
    connect?: BranchWhereUniqueInput
  }

  export type PurchaseLineCreateNestedManyWithoutPurchaseInput = {
    create?: XOR<PurchaseLineCreateWithoutPurchaseInput, PurchaseLineUncheckedCreateWithoutPurchaseInput> | PurchaseLineCreateWithoutPurchaseInput[] | PurchaseLineUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutPurchaseInput | PurchaseLineCreateOrConnectWithoutPurchaseInput[]
    createMany?: PurchaseLineCreateManyPurchaseInputEnvelope
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
  }

  export type PurchaseReturnCreateNestedManyWithoutPurchaseInput = {
    create?: XOR<PurchaseReturnCreateWithoutPurchaseInput, PurchaseReturnUncheckedCreateWithoutPurchaseInput> | PurchaseReturnCreateWithoutPurchaseInput[] | PurchaseReturnUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutPurchaseInput | PurchaseReturnCreateOrConnectWithoutPurchaseInput[]
    createMany?: PurchaseReturnCreateManyPurchaseInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type PurchaseLineUncheckedCreateNestedManyWithoutPurchaseInput = {
    create?: XOR<PurchaseLineCreateWithoutPurchaseInput, PurchaseLineUncheckedCreateWithoutPurchaseInput> | PurchaseLineCreateWithoutPurchaseInput[] | PurchaseLineUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutPurchaseInput | PurchaseLineCreateOrConnectWithoutPurchaseInput[]
    createMany?: PurchaseLineCreateManyPurchaseInputEnvelope
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
  }

  export type PurchaseReturnUncheckedCreateNestedManyWithoutPurchaseInput = {
    create?: XOR<PurchaseReturnCreateWithoutPurchaseInput, PurchaseReturnUncheckedCreateWithoutPurchaseInput> | PurchaseReturnCreateWithoutPurchaseInput[] | PurchaseReturnUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutPurchaseInput | PurchaseReturnCreateOrConnectWithoutPurchaseInput[]
    createMany?: PurchaseReturnCreateManyPurchaseInputEnvelope
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
  }

  export type FloatFieldUpdateOperationsInput = {
    set?: number
    increment?: number
    decrement?: number
    multiply?: number
    divide?: number
  }

  export type SupplierUpdateOneWithoutPurchasesNestedInput = {
    create?: XOR<SupplierCreateWithoutPurchasesInput, SupplierUncheckedCreateWithoutPurchasesInput>
    connectOrCreate?: SupplierCreateOrConnectWithoutPurchasesInput
    upsert?: SupplierUpsertWithoutPurchasesInput
    disconnect?: SupplierWhereInput | boolean
    delete?: SupplierWhereInput | boolean
    connect?: SupplierWhereUniqueInput
    update?: XOR<XOR<SupplierUpdateToOneWithWhereWithoutPurchasesInput, SupplierUpdateWithoutPurchasesInput>, SupplierUncheckedUpdateWithoutPurchasesInput>
  }

  export type WarehouseUpdateOneWithoutPurchasesNestedInput = {
    create?: XOR<WarehouseCreateWithoutPurchasesInput, WarehouseUncheckedCreateWithoutPurchasesInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutPurchasesInput
    upsert?: WarehouseUpsertWithoutPurchasesInput
    disconnect?: WarehouseWhereInput | boolean
    delete?: WarehouseWhereInput | boolean
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutPurchasesInput, WarehouseUpdateWithoutPurchasesInput>, WarehouseUncheckedUpdateWithoutPurchasesInput>
  }

  export type BranchUpdateOneWithoutPurchasesNestedInput = {
    create?: XOR<BranchCreateWithoutPurchasesInput, BranchUncheckedCreateWithoutPurchasesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutPurchasesInput
    upsert?: BranchUpsertWithoutPurchasesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutPurchasesInput, BranchUpdateWithoutPurchasesInput>, BranchUncheckedUpdateWithoutPurchasesInput>
  }

  export type PurchaseLineUpdateManyWithoutPurchaseNestedInput = {
    create?: XOR<PurchaseLineCreateWithoutPurchaseInput, PurchaseLineUncheckedCreateWithoutPurchaseInput> | PurchaseLineCreateWithoutPurchaseInput[] | PurchaseLineUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutPurchaseInput | PurchaseLineCreateOrConnectWithoutPurchaseInput[]
    upsert?: PurchaseLineUpsertWithWhereUniqueWithoutPurchaseInput | PurchaseLineUpsertWithWhereUniqueWithoutPurchaseInput[]
    createMany?: PurchaseLineCreateManyPurchaseInputEnvelope
    set?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    disconnect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    delete?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    update?: PurchaseLineUpdateWithWhereUniqueWithoutPurchaseInput | PurchaseLineUpdateWithWhereUniqueWithoutPurchaseInput[]
    updateMany?: PurchaseLineUpdateManyWithWhereWithoutPurchaseInput | PurchaseLineUpdateManyWithWhereWithoutPurchaseInput[]
    deleteMany?: PurchaseLineScalarWhereInput | PurchaseLineScalarWhereInput[]
  }

  export type PurchaseReturnUpdateManyWithoutPurchaseNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutPurchaseInput, PurchaseReturnUncheckedCreateWithoutPurchaseInput> | PurchaseReturnCreateWithoutPurchaseInput[] | PurchaseReturnUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutPurchaseInput | PurchaseReturnCreateOrConnectWithoutPurchaseInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutPurchaseInput | PurchaseReturnUpsertWithWhereUniqueWithoutPurchaseInput[]
    createMany?: PurchaseReturnCreateManyPurchaseInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutPurchaseInput | PurchaseReturnUpdateWithWhereUniqueWithoutPurchaseInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutPurchaseInput | PurchaseReturnUpdateManyWithWhereWithoutPurchaseInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type PurchaseLineUncheckedUpdateManyWithoutPurchaseNestedInput = {
    create?: XOR<PurchaseLineCreateWithoutPurchaseInput, PurchaseLineUncheckedCreateWithoutPurchaseInput> | PurchaseLineCreateWithoutPurchaseInput[] | PurchaseLineUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutPurchaseInput | PurchaseLineCreateOrConnectWithoutPurchaseInput[]
    upsert?: PurchaseLineUpsertWithWhereUniqueWithoutPurchaseInput | PurchaseLineUpsertWithWhereUniqueWithoutPurchaseInput[]
    createMany?: PurchaseLineCreateManyPurchaseInputEnvelope
    set?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    disconnect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    delete?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    update?: PurchaseLineUpdateWithWhereUniqueWithoutPurchaseInput | PurchaseLineUpdateWithWhereUniqueWithoutPurchaseInput[]
    updateMany?: PurchaseLineUpdateManyWithWhereWithoutPurchaseInput | PurchaseLineUpdateManyWithWhereWithoutPurchaseInput[]
    deleteMany?: PurchaseLineScalarWhereInput | PurchaseLineScalarWhereInput[]
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutPurchaseNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutPurchaseInput, PurchaseReturnUncheckedCreateWithoutPurchaseInput> | PurchaseReturnCreateWithoutPurchaseInput[] | PurchaseReturnUncheckedCreateWithoutPurchaseInput[]
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutPurchaseInput | PurchaseReturnCreateOrConnectWithoutPurchaseInput[]
    upsert?: PurchaseReturnUpsertWithWhereUniqueWithoutPurchaseInput | PurchaseReturnUpsertWithWhereUniqueWithoutPurchaseInput[]
    createMany?: PurchaseReturnCreateManyPurchaseInputEnvelope
    set?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    disconnect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    delete?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    connect?: PurchaseReturnWhereUniqueInput | PurchaseReturnWhereUniqueInput[]
    update?: PurchaseReturnUpdateWithWhereUniqueWithoutPurchaseInput | PurchaseReturnUpdateWithWhereUniqueWithoutPurchaseInput[]
    updateMany?: PurchaseReturnUpdateManyWithWhereWithoutPurchaseInput | PurchaseReturnUpdateManyWithWhereWithoutPurchaseInput[]
    deleteMany?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
  }

  export type PurchaseCreateNestedOneWithoutLinesInput = {
    create?: XOR<PurchaseCreateWithoutLinesInput, PurchaseUncheckedCreateWithoutLinesInput>
    connectOrCreate?: PurchaseCreateOrConnectWithoutLinesInput
    connect?: PurchaseWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutPurchaseLinesInput = {
    create?: XOR<ProductCreateWithoutPurchaseLinesInput, ProductUncheckedCreateWithoutPurchaseLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type PurchaseUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<PurchaseCreateWithoutLinesInput, PurchaseUncheckedCreateWithoutLinesInput>
    connectOrCreate?: PurchaseCreateOrConnectWithoutLinesInput
    upsert?: PurchaseUpsertWithoutLinesInput
    connect?: PurchaseWhereUniqueInput
    update?: XOR<XOR<PurchaseUpdateToOneWithWhereWithoutLinesInput, PurchaseUpdateWithoutLinesInput>, PurchaseUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutPurchaseLinesNestedInput = {
    create?: XOR<ProductCreateWithoutPurchaseLinesInput, ProductUncheckedCreateWithoutPurchaseLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseLinesInput
    upsert?: ProductUpsertWithoutPurchaseLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutPurchaseLinesInput, ProductUpdateWithoutPurchaseLinesInput>, ProductUncheckedUpdateWithoutPurchaseLinesInput>
  }

  export type PurchaseCreateNestedOneWithoutReturnsInput = {
    create?: XOR<PurchaseCreateWithoutReturnsInput, PurchaseUncheckedCreateWithoutReturnsInput>
    connectOrCreate?: PurchaseCreateOrConnectWithoutReturnsInput
    connect?: PurchaseWhereUniqueInput
  }

  export type SupplierCreateNestedOneWithoutPurchaseReturnsInput = {
    create?: XOR<SupplierCreateWithoutPurchaseReturnsInput, SupplierUncheckedCreateWithoutPurchaseReturnsInput>
    connectOrCreate?: SupplierCreateOrConnectWithoutPurchaseReturnsInput
    connect?: SupplierWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutPurchaseReturnsInput = {
    create?: XOR<WarehouseCreateWithoutPurchaseReturnsInput, WarehouseUncheckedCreateWithoutPurchaseReturnsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutPurchaseReturnsInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutPurchaseReturnsInput = {
    create?: XOR<BranchCreateWithoutPurchaseReturnsInput, BranchUncheckedCreateWithoutPurchaseReturnsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutPurchaseReturnsInput
    connect?: BranchWhereUniqueInput
  }

  export type PurchaseReturnLineCreateNestedManyWithoutPurchaseReturnInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput> | PurchaseReturnLineCreateWithoutPurchaseReturnInput[] | PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput | PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput[]
    createMany?: PurchaseReturnLineCreateManyPurchaseReturnInputEnvelope
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
  }

  export type PurchaseReturnLineUncheckedCreateNestedManyWithoutPurchaseReturnInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput> | PurchaseReturnLineCreateWithoutPurchaseReturnInput[] | PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput | PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput[]
    createMany?: PurchaseReturnLineCreateManyPurchaseReturnInputEnvelope
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
  }

  export type PurchaseUpdateOneWithoutReturnsNestedInput = {
    create?: XOR<PurchaseCreateWithoutReturnsInput, PurchaseUncheckedCreateWithoutReturnsInput>
    connectOrCreate?: PurchaseCreateOrConnectWithoutReturnsInput
    upsert?: PurchaseUpsertWithoutReturnsInput
    disconnect?: PurchaseWhereInput | boolean
    delete?: PurchaseWhereInput | boolean
    connect?: PurchaseWhereUniqueInput
    update?: XOR<XOR<PurchaseUpdateToOneWithWhereWithoutReturnsInput, PurchaseUpdateWithoutReturnsInput>, PurchaseUncheckedUpdateWithoutReturnsInput>
  }

  export type SupplierUpdateOneWithoutPurchaseReturnsNestedInput = {
    create?: XOR<SupplierCreateWithoutPurchaseReturnsInput, SupplierUncheckedCreateWithoutPurchaseReturnsInput>
    connectOrCreate?: SupplierCreateOrConnectWithoutPurchaseReturnsInput
    upsert?: SupplierUpsertWithoutPurchaseReturnsInput
    disconnect?: SupplierWhereInput | boolean
    delete?: SupplierWhereInput | boolean
    connect?: SupplierWhereUniqueInput
    update?: XOR<XOR<SupplierUpdateToOneWithWhereWithoutPurchaseReturnsInput, SupplierUpdateWithoutPurchaseReturnsInput>, SupplierUncheckedUpdateWithoutPurchaseReturnsInput>
  }

  export type WarehouseUpdateOneWithoutPurchaseReturnsNestedInput = {
    create?: XOR<WarehouseCreateWithoutPurchaseReturnsInput, WarehouseUncheckedCreateWithoutPurchaseReturnsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutPurchaseReturnsInput
    upsert?: WarehouseUpsertWithoutPurchaseReturnsInput
    disconnect?: WarehouseWhereInput | boolean
    delete?: WarehouseWhereInput | boolean
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutPurchaseReturnsInput, WarehouseUpdateWithoutPurchaseReturnsInput>, WarehouseUncheckedUpdateWithoutPurchaseReturnsInput>
  }

  export type BranchUpdateOneWithoutPurchaseReturnsNestedInput = {
    create?: XOR<BranchCreateWithoutPurchaseReturnsInput, BranchUncheckedCreateWithoutPurchaseReturnsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutPurchaseReturnsInput
    upsert?: BranchUpsertWithoutPurchaseReturnsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutPurchaseReturnsInput, BranchUpdateWithoutPurchaseReturnsInput>, BranchUncheckedUpdateWithoutPurchaseReturnsInput>
  }

  export type PurchaseReturnLineUpdateManyWithoutPurchaseReturnNestedInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput> | PurchaseReturnLineCreateWithoutPurchaseReturnInput[] | PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput | PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput[]
    upsert?: PurchaseReturnLineUpsertWithWhereUniqueWithoutPurchaseReturnInput | PurchaseReturnLineUpsertWithWhereUniqueWithoutPurchaseReturnInput[]
    createMany?: PurchaseReturnLineCreateManyPurchaseReturnInputEnvelope
    set?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    disconnect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    delete?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    update?: PurchaseReturnLineUpdateWithWhereUniqueWithoutPurchaseReturnInput | PurchaseReturnLineUpdateWithWhereUniqueWithoutPurchaseReturnInput[]
    updateMany?: PurchaseReturnLineUpdateManyWithWhereWithoutPurchaseReturnInput | PurchaseReturnLineUpdateManyWithWhereWithoutPurchaseReturnInput[]
    deleteMany?: PurchaseReturnLineScalarWhereInput | PurchaseReturnLineScalarWhereInput[]
  }

  export type PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnNestedInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput> | PurchaseReturnLineCreateWithoutPurchaseReturnInput[] | PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput | PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput[]
    upsert?: PurchaseReturnLineUpsertWithWhereUniqueWithoutPurchaseReturnInput | PurchaseReturnLineUpsertWithWhereUniqueWithoutPurchaseReturnInput[]
    createMany?: PurchaseReturnLineCreateManyPurchaseReturnInputEnvelope
    set?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    disconnect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    delete?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    update?: PurchaseReturnLineUpdateWithWhereUniqueWithoutPurchaseReturnInput | PurchaseReturnLineUpdateWithWhereUniqueWithoutPurchaseReturnInput[]
    updateMany?: PurchaseReturnLineUpdateManyWithWhereWithoutPurchaseReturnInput | PurchaseReturnLineUpdateManyWithWhereWithoutPurchaseReturnInput[]
    deleteMany?: PurchaseReturnLineScalarWhereInput | PurchaseReturnLineScalarWhereInput[]
  }

  export type PurchaseReturnCreateNestedOneWithoutLinesInput = {
    create?: XOR<PurchaseReturnCreateWithoutLinesInput, PurchaseReturnUncheckedCreateWithoutLinesInput>
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutLinesInput
    connect?: PurchaseReturnWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutPurchaseReturnLinesInput = {
    create?: XOR<ProductCreateWithoutPurchaseReturnLinesInput, ProductUncheckedCreateWithoutPurchaseReturnLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseReturnLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type PurchaseReturnUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<PurchaseReturnCreateWithoutLinesInput, PurchaseReturnUncheckedCreateWithoutLinesInput>
    connectOrCreate?: PurchaseReturnCreateOrConnectWithoutLinesInput
    upsert?: PurchaseReturnUpsertWithoutLinesInput
    connect?: PurchaseReturnWhereUniqueInput
    update?: XOR<XOR<PurchaseReturnUpdateToOneWithWhereWithoutLinesInput, PurchaseReturnUpdateWithoutLinesInput>, PurchaseReturnUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutPurchaseReturnLinesNestedInput = {
    create?: XOR<ProductCreateWithoutPurchaseReturnLinesInput, ProductUncheckedCreateWithoutPurchaseReturnLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseReturnLinesInput
    upsert?: ProductUpsertWithoutPurchaseReturnLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutPurchaseReturnLinesInput, ProductUpdateWithoutPurchaseReturnLinesInput>, ProductUncheckedUpdateWithoutPurchaseReturnLinesInput>
  }

  export type BranchCreateNestedOneWithoutCustomersInput = {
    create?: XOR<BranchCreateWithoutCustomersInput, BranchUncheckedCreateWithoutCustomersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutCustomersInput
    connect?: BranchWhereUniqueInput
  }

  export type InvoiceCreateNestedManyWithoutCustomerInput = {
    create?: XOR<InvoiceCreateWithoutCustomerInput, InvoiceUncheckedCreateWithoutCustomerInput> | InvoiceCreateWithoutCustomerInput[] | InvoiceUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutCustomerInput | InvoiceCreateOrConnectWithoutCustomerInput[]
    createMany?: InvoiceCreateManyCustomerInputEnvelope
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
  }

  export type SaleCreateNestedManyWithoutCustomerInput = {
    create?: XOR<SaleCreateWithoutCustomerInput, SaleUncheckedCreateWithoutCustomerInput> | SaleCreateWithoutCustomerInput[] | SaleUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutCustomerInput | SaleCreateOrConnectWithoutCustomerInput[]
    createMany?: SaleCreateManyCustomerInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type SalesReturnCreateNestedManyWithoutCustomerInput = {
    create?: XOR<SalesReturnCreateWithoutCustomerInput, SalesReturnUncheckedCreateWithoutCustomerInput> | SalesReturnCreateWithoutCustomerInput[] | SalesReturnUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutCustomerInput | SalesReturnCreateOrConnectWithoutCustomerInput[]
    createMany?: SalesReturnCreateManyCustomerInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type InvoiceUncheckedCreateNestedManyWithoutCustomerInput = {
    create?: XOR<InvoiceCreateWithoutCustomerInput, InvoiceUncheckedCreateWithoutCustomerInput> | InvoiceCreateWithoutCustomerInput[] | InvoiceUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutCustomerInput | InvoiceCreateOrConnectWithoutCustomerInput[]
    createMany?: InvoiceCreateManyCustomerInputEnvelope
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
  }

  export type SaleUncheckedCreateNestedManyWithoutCustomerInput = {
    create?: XOR<SaleCreateWithoutCustomerInput, SaleUncheckedCreateWithoutCustomerInput> | SaleCreateWithoutCustomerInput[] | SaleUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutCustomerInput | SaleCreateOrConnectWithoutCustomerInput[]
    createMany?: SaleCreateManyCustomerInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type SalesReturnUncheckedCreateNestedManyWithoutCustomerInput = {
    create?: XOR<SalesReturnCreateWithoutCustomerInput, SalesReturnUncheckedCreateWithoutCustomerInput> | SalesReturnCreateWithoutCustomerInput[] | SalesReturnUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutCustomerInput | SalesReturnCreateOrConnectWithoutCustomerInput[]
    createMany?: SalesReturnCreateManyCustomerInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutCustomersNestedInput = {
    create?: XOR<BranchCreateWithoutCustomersInput, BranchUncheckedCreateWithoutCustomersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutCustomersInput
    upsert?: BranchUpsertWithoutCustomersInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutCustomersInput, BranchUpdateWithoutCustomersInput>, BranchUncheckedUpdateWithoutCustomersInput>
  }

  export type InvoiceUpdateManyWithoutCustomerNestedInput = {
    create?: XOR<InvoiceCreateWithoutCustomerInput, InvoiceUncheckedCreateWithoutCustomerInput> | InvoiceCreateWithoutCustomerInput[] | InvoiceUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutCustomerInput | InvoiceCreateOrConnectWithoutCustomerInput[]
    upsert?: InvoiceUpsertWithWhereUniqueWithoutCustomerInput | InvoiceUpsertWithWhereUniqueWithoutCustomerInput[]
    createMany?: InvoiceCreateManyCustomerInputEnvelope
    set?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    disconnect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    delete?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    update?: InvoiceUpdateWithWhereUniqueWithoutCustomerInput | InvoiceUpdateWithWhereUniqueWithoutCustomerInput[]
    updateMany?: InvoiceUpdateManyWithWhereWithoutCustomerInput | InvoiceUpdateManyWithWhereWithoutCustomerInput[]
    deleteMany?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
  }

  export type SaleUpdateManyWithoutCustomerNestedInput = {
    create?: XOR<SaleCreateWithoutCustomerInput, SaleUncheckedCreateWithoutCustomerInput> | SaleCreateWithoutCustomerInput[] | SaleUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutCustomerInput | SaleCreateOrConnectWithoutCustomerInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutCustomerInput | SaleUpsertWithWhereUniqueWithoutCustomerInput[]
    createMany?: SaleCreateManyCustomerInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutCustomerInput | SaleUpdateWithWhereUniqueWithoutCustomerInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutCustomerInput | SaleUpdateManyWithWhereWithoutCustomerInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type SalesReturnUpdateManyWithoutCustomerNestedInput = {
    create?: XOR<SalesReturnCreateWithoutCustomerInput, SalesReturnUncheckedCreateWithoutCustomerInput> | SalesReturnCreateWithoutCustomerInput[] | SalesReturnUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutCustomerInput | SalesReturnCreateOrConnectWithoutCustomerInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutCustomerInput | SalesReturnUpsertWithWhereUniqueWithoutCustomerInput[]
    createMany?: SalesReturnCreateManyCustomerInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutCustomerInput | SalesReturnUpdateWithWhereUniqueWithoutCustomerInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutCustomerInput | SalesReturnUpdateManyWithWhereWithoutCustomerInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type InvoiceUncheckedUpdateManyWithoutCustomerNestedInput = {
    create?: XOR<InvoiceCreateWithoutCustomerInput, InvoiceUncheckedCreateWithoutCustomerInput> | InvoiceCreateWithoutCustomerInput[] | InvoiceUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutCustomerInput | InvoiceCreateOrConnectWithoutCustomerInput[]
    upsert?: InvoiceUpsertWithWhereUniqueWithoutCustomerInput | InvoiceUpsertWithWhereUniqueWithoutCustomerInput[]
    createMany?: InvoiceCreateManyCustomerInputEnvelope
    set?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    disconnect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    delete?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    update?: InvoiceUpdateWithWhereUniqueWithoutCustomerInput | InvoiceUpdateWithWhereUniqueWithoutCustomerInput[]
    updateMany?: InvoiceUpdateManyWithWhereWithoutCustomerInput | InvoiceUpdateManyWithWhereWithoutCustomerInput[]
    deleteMany?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
  }

  export type SaleUncheckedUpdateManyWithoutCustomerNestedInput = {
    create?: XOR<SaleCreateWithoutCustomerInput, SaleUncheckedCreateWithoutCustomerInput> | SaleCreateWithoutCustomerInput[] | SaleUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutCustomerInput | SaleCreateOrConnectWithoutCustomerInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutCustomerInput | SaleUpsertWithWhereUniqueWithoutCustomerInput[]
    createMany?: SaleCreateManyCustomerInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutCustomerInput | SaleUpdateWithWhereUniqueWithoutCustomerInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutCustomerInput | SaleUpdateManyWithWhereWithoutCustomerInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type SalesReturnUncheckedUpdateManyWithoutCustomerNestedInput = {
    create?: XOR<SalesReturnCreateWithoutCustomerInput, SalesReturnUncheckedCreateWithoutCustomerInput> | SalesReturnCreateWithoutCustomerInput[] | SalesReturnUncheckedCreateWithoutCustomerInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutCustomerInput | SalesReturnCreateOrConnectWithoutCustomerInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutCustomerInput | SalesReturnUpsertWithWhereUniqueWithoutCustomerInput[]
    createMany?: SalesReturnCreateManyCustomerInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutCustomerInput | SalesReturnUpdateWithWhereUniqueWithoutCustomerInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutCustomerInput | SalesReturnUpdateManyWithWhereWithoutCustomerInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type BranchCreateNestedOneWithoutPaymentMethodsInput = {
    create?: XOR<BranchCreateWithoutPaymentMethodsInput, BranchUncheckedCreateWithoutPaymentMethodsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutPaymentMethodsInput
    connect?: BranchWhereUniqueInput
  }

  export type SaleCreateNestedManyWithoutPaymentMethodInput = {
    create?: XOR<SaleCreateWithoutPaymentMethodInput, SaleUncheckedCreateWithoutPaymentMethodInput> | SaleCreateWithoutPaymentMethodInput[] | SaleUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutPaymentMethodInput | SaleCreateOrConnectWithoutPaymentMethodInput[]
    createMany?: SaleCreateManyPaymentMethodInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type ExpenseCreateNestedManyWithoutPaymentMethodInput = {
    create?: XOR<ExpenseCreateWithoutPaymentMethodInput, ExpenseUncheckedCreateWithoutPaymentMethodInput> | ExpenseCreateWithoutPaymentMethodInput[] | ExpenseUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutPaymentMethodInput | ExpenseCreateOrConnectWithoutPaymentMethodInput[]
    createMany?: ExpenseCreateManyPaymentMethodInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type SaleUncheckedCreateNestedManyWithoutPaymentMethodInput = {
    create?: XOR<SaleCreateWithoutPaymentMethodInput, SaleUncheckedCreateWithoutPaymentMethodInput> | SaleCreateWithoutPaymentMethodInput[] | SaleUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutPaymentMethodInput | SaleCreateOrConnectWithoutPaymentMethodInput[]
    createMany?: SaleCreateManyPaymentMethodInputEnvelope
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
  }

  export type ExpenseUncheckedCreateNestedManyWithoutPaymentMethodInput = {
    create?: XOR<ExpenseCreateWithoutPaymentMethodInput, ExpenseUncheckedCreateWithoutPaymentMethodInput> | ExpenseCreateWithoutPaymentMethodInput[] | ExpenseUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutPaymentMethodInput | ExpenseCreateOrConnectWithoutPaymentMethodInput[]
    createMany?: ExpenseCreateManyPaymentMethodInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutPaymentMethodsNestedInput = {
    create?: XOR<BranchCreateWithoutPaymentMethodsInput, BranchUncheckedCreateWithoutPaymentMethodsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutPaymentMethodsInput
    upsert?: BranchUpsertWithoutPaymentMethodsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutPaymentMethodsInput, BranchUpdateWithoutPaymentMethodsInput>, BranchUncheckedUpdateWithoutPaymentMethodsInput>
  }

  export type SaleUpdateManyWithoutPaymentMethodNestedInput = {
    create?: XOR<SaleCreateWithoutPaymentMethodInput, SaleUncheckedCreateWithoutPaymentMethodInput> | SaleCreateWithoutPaymentMethodInput[] | SaleUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutPaymentMethodInput | SaleCreateOrConnectWithoutPaymentMethodInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutPaymentMethodInput | SaleUpsertWithWhereUniqueWithoutPaymentMethodInput[]
    createMany?: SaleCreateManyPaymentMethodInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutPaymentMethodInput | SaleUpdateWithWhereUniqueWithoutPaymentMethodInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutPaymentMethodInput | SaleUpdateManyWithWhereWithoutPaymentMethodInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type ExpenseUpdateManyWithoutPaymentMethodNestedInput = {
    create?: XOR<ExpenseCreateWithoutPaymentMethodInput, ExpenseUncheckedCreateWithoutPaymentMethodInput> | ExpenseCreateWithoutPaymentMethodInput[] | ExpenseUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutPaymentMethodInput | ExpenseCreateOrConnectWithoutPaymentMethodInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutPaymentMethodInput | ExpenseUpsertWithWhereUniqueWithoutPaymentMethodInput[]
    createMany?: ExpenseCreateManyPaymentMethodInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutPaymentMethodInput | ExpenseUpdateWithWhereUniqueWithoutPaymentMethodInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutPaymentMethodInput | ExpenseUpdateManyWithWhereWithoutPaymentMethodInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type SaleUncheckedUpdateManyWithoutPaymentMethodNestedInput = {
    create?: XOR<SaleCreateWithoutPaymentMethodInput, SaleUncheckedCreateWithoutPaymentMethodInput> | SaleCreateWithoutPaymentMethodInput[] | SaleUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: SaleCreateOrConnectWithoutPaymentMethodInput | SaleCreateOrConnectWithoutPaymentMethodInput[]
    upsert?: SaleUpsertWithWhereUniqueWithoutPaymentMethodInput | SaleUpsertWithWhereUniqueWithoutPaymentMethodInput[]
    createMany?: SaleCreateManyPaymentMethodInputEnvelope
    set?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    disconnect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    delete?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    connect?: SaleWhereUniqueInput | SaleWhereUniqueInput[]
    update?: SaleUpdateWithWhereUniqueWithoutPaymentMethodInput | SaleUpdateWithWhereUniqueWithoutPaymentMethodInput[]
    updateMany?: SaleUpdateManyWithWhereWithoutPaymentMethodInput | SaleUpdateManyWithWhereWithoutPaymentMethodInput[]
    deleteMany?: SaleScalarWhereInput | SaleScalarWhereInput[]
  }

  export type ExpenseUncheckedUpdateManyWithoutPaymentMethodNestedInput = {
    create?: XOR<ExpenseCreateWithoutPaymentMethodInput, ExpenseUncheckedCreateWithoutPaymentMethodInput> | ExpenseCreateWithoutPaymentMethodInput[] | ExpenseUncheckedCreateWithoutPaymentMethodInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutPaymentMethodInput | ExpenseCreateOrConnectWithoutPaymentMethodInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutPaymentMethodInput | ExpenseUpsertWithWhereUniqueWithoutPaymentMethodInput[]
    createMany?: ExpenseCreateManyPaymentMethodInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutPaymentMethodInput | ExpenseUpdateWithWhereUniqueWithoutPaymentMethodInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutPaymentMethodInput | ExpenseUpdateManyWithWhereWithoutPaymentMethodInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type CustomerCreateNestedOneWithoutSalesInput = {
    create?: XOR<CustomerCreateWithoutSalesInput, CustomerUncheckedCreateWithoutSalesInput>
    connectOrCreate?: CustomerCreateOrConnectWithoutSalesInput
    connect?: CustomerWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutSalesInput = {
    create?: XOR<WarehouseCreateWithoutSalesInput, WarehouseUncheckedCreateWithoutSalesInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutSalesInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutSalesInput = {
    create?: XOR<BranchCreateWithoutSalesInput, BranchUncheckedCreateWithoutSalesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutSalesInput
    connect?: BranchWhereUniqueInput
  }

  export type PaymentMethodCreateNestedOneWithoutSalesInput = {
    create?: XOR<PaymentMethodCreateWithoutSalesInput, PaymentMethodUncheckedCreateWithoutSalesInput>
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutSalesInput
    connect?: PaymentMethodWhereUniqueInput
  }

  export type SaleLineCreateNestedManyWithoutSaleInput = {
    create?: XOR<SaleLineCreateWithoutSaleInput, SaleLineUncheckedCreateWithoutSaleInput> | SaleLineCreateWithoutSaleInput[] | SaleLineUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutSaleInput | SaleLineCreateOrConnectWithoutSaleInput[]
    createMany?: SaleLineCreateManySaleInputEnvelope
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
  }

  export type SalesReturnCreateNestedManyWithoutSaleInput = {
    create?: XOR<SalesReturnCreateWithoutSaleInput, SalesReturnUncheckedCreateWithoutSaleInput> | SalesReturnCreateWithoutSaleInput[] | SalesReturnUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutSaleInput | SalesReturnCreateOrConnectWithoutSaleInput[]
    createMany?: SalesReturnCreateManySaleInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type InvoiceCreateNestedManyWithoutSaleInput = {
    create?: XOR<InvoiceCreateWithoutSaleInput, InvoiceUncheckedCreateWithoutSaleInput> | InvoiceCreateWithoutSaleInput[] | InvoiceUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutSaleInput | InvoiceCreateOrConnectWithoutSaleInput[]
    createMany?: InvoiceCreateManySaleInputEnvelope
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
  }

  export type SaleLineUncheckedCreateNestedManyWithoutSaleInput = {
    create?: XOR<SaleLineCreateWithoutSaleInput, SaleLineUncheckedCreateWithoutSaleInput> | SaleLineCreateWithoutSaleInput[] | SaleLineUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutSaleInput | SaleLineCreateOrConnectWithoutSaleInput[]
    createMany?: SaleLineCreateManySaleInputEnvelope
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
  }

  export type SalesReturnUncheckedCreateNestedManyWithoutSaleInput = {
    create?: XOR<SalesReturnCreateWithoutSaleInput, SalesReturnUncheckedCreateWithoutSaleInput> | SalesReturnCreateWithoutSaleInput[] | SalesReturnUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutSaleInput | SalesReturnCreateOrConnectWithoutSaleInput[]
    createMany?: SalesReturnCreateManySaleInputEnvelope
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
  }

  export type InvoiceUncheckedCreateNestedManyWithoutSaleInput = {
    create?: XOR<InvoiceCreateWithoutSaleInput, InvoiceUncheckedCreateWithoutSaleInput> | InvoiceCreateWithoutSaleInput[] | InvoiceUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutSaleInput | InvoiceCreateOrConnectWithoutSaleInput[]
    createMany?: InvoiceCreateManySaleInputEnvelope
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
  }

  export type NullableFloatFieldUpdateOperationsInput = {
    set?: number | null
    increment?: number
    decrement?: number
    multiply?: number
    divide?: number
  }

  export type CustomerUpdateOneWithoutSalesNestedInput = {
    create?: XOR<CustomerCreateWithoutSalesInput, CustomerUncheckedCreateWithoutSalesInput>
    connectOrCreate?: CustomerCreateOrConnectWithoutSalesInput
    upsert?: CustomerUpsertWithoutSalesInput
    disconnect?: CustomerWhereInput | boolean
    delete?: CustomerWhereInput | boolean
    connect?: CustomerWhereUniqueInput
    update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutSalesInput, CustomerUpdateWithoutSalesInput>, CustomerUncheckedUpdateWithoutSalesInput>
  }

  export type WarehouseUpdateOneWithoutSalesNestedInput = {
    create?: XOR<WarehouseCreateWithoutSalesInput, WarehouseUncheckedCreateWithoutSalesInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutSalesInput
    upsert?: WarehouseUpsertWithoutSalesInput
    disconnect?: WarehouseWhereInput | boolean
    delete?: WarehouseWhereInput | boolean
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutSalesInput, WarehouseUpdateWithoutSalesInput>, WarehouseUncheckedUpdateWithoutSalesInput>
  }

  export type BranchUpdateOneWithoutSalesNestedInput = {
    create?: XOR<BranchCreateWithoutSalesInput, BranchUncheckedCreateWithoutSalesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutSalesInput
    upsert?: BranchUpsertWithoutSalesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutSalesInput, BranchUpdateWithoutSalesInput>, BranchUncheckedUpdateWithoutSalesInput>
  }

  export type PaymentMethodUpdateOneWithoutSalesNestedInput = {
    create?: XOR<PaymentMethodCreateWithoutSalesInput, PaymentMethodUncheckedCreateWithoutSalesInput>
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutSalesInput
    upsert?: PaymentMethodUpsertWithoutSalesInput
    disconnect?: PaymentMethodWhereInput | boolean
    delete?: PaymentMethodWhereInput | boolean
    connect?: PaymentMethodWhereUniqueInput
    update?: XOR<XOR<PaymentMethodUpdateToOneWithWhereWithoutSalesInput, PaymentMethodUpdateWithoutSalesInput>, PaymentMethodUncheckedUpdateWithoutSalesInput>
  }

  export type SaleLineUpdateManyWithoutSaleNestedInput = {
    create?: XOR<SaleLineCreateWithoutSaleInput, SaleLineUncheckedCreateWithoutSaleInput> | SaleLineCreateWithoutSaleInput[] | SaleLineUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutSaleInput | SaleLineCreateOrConnectWithoutSaleInput[]
    upsert?: SaleLineUpsertWithWhereUniqueWithoutSaleInput | SaleLineUpsertWithWhereUniqueWithoutSaleInput[]
    createMany?: SaleLineCreateManySaleInputEnvelope
    set?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    disconnect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    delete?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    update?: SaleLineUpdateWithWhereUniqueWithoutSaleInput | SaleLineUpdateWithWhereUniqueWithoutSaleInput[]
    updateMany?: SaleLineUpdateManyWithWhereWithoutSaleInput | SaleLineUpdateManyWithWhereWithoutSaleInput[]
    deleteMany?: SaleLineScalarWhereInput | SaleLineScalarWhereInput[]
  }

  export type SalesReturnUpdateManyWithoutSaleNestedInput = {
    create?: XOR<SalesReturnCreateWithoutSaleInput, SalesReturnUncheckedCreateWithoutSaleInput> | SalesReturnCreateWithoutSaleInput[] | SalesReturnUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutSaleInput | SalesReturnCreateOrConnectWithoutSaleInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutSaleInput | SalesReturnUpsertWithWhereUniqueWithoutSaleInput[]
    createMany?: SalesReturnCreateManySaleInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutSaleInput | SalesReturnUpdateWithWhereUniqueWithoutSaleInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutSaleInput | SalesReturnUpdateManyWithWhereWithoutSaleInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type InvoiceUpdateManyWithoutSaleNestedInput = {
    create?: XOR<InvoiceCreateWithoutSaleInput, InvoiceUncheckedCreateWithoutSaleInput> | InvoiceCreateWithoutSaleInput[] | InvoiceUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutSaleInput | InvoiceCreateOrConnectWithoutSaleInput[]
    upsert?: InvoiceUpsertWithWhereUniqueWithoutSaleInput | InvoiceUpsertWithWhereUniqueWithoutSaleInput[]
    createMany?: InvoiceCreateManySaleInputEnvelope
    set?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    disconnect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    delete?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    update?: InvoiceUpdateWithWhereUniqueWithoutSaleInput | InvoiceUpdateWithWhereUniqueWithoutSaleInput[]
    updateMany?: InvoiceUpdateManyWithWhereWithoutSaleInput | InvoiceUpdateManyWithWhereWithoutSaleInput[]
    deleteMany?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
  }

  export type SaleLineUncheckedUpdateManyWithoutSaleNestedInput = {
    create?: XOR<SaleLineCreateWithoutSaleInput, SaleLineUncheckedCreateWithoutSaleInput> | SaleLineCreateWithoutSaleInput[] | SaleLineUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutSaleInput | SaleLineCreateOrConnectWithoutSaleInput[]
    upsert?: SaleLineUpsertWithWhereUniqueWithoutSaleInput | SaleLineUpsertWithWhereUniqueWithoutSaleInput[]
    createMany?: SaleLineCreateManySaleInputEnvelope
    set?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    disconnect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    delete?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    update?: SaleLineUpdateWithWhereUniqueWithoutSaleInput | SaleLineUpdateWithWhereUniqueWithoutSaleInput[]
    updateMany?: SaleLineUpdateManyWithWhereWithoutSaleInput | SaleLineUpdateManyWithWhereWithoutSaleInput[]
    deleteMany?: SaleLineScalarWhereInput | SaleLineScalarWhereInput[]
  }

  export type SalesReturnUncheckedUpdateManyWithoutSaleNestedInput = {
    create?: XOR<SalesReturnCreateWithoutSaleInput, SalesReturnUncheckedCreateWithoutSaleInput> | SalesReturnCreateWithoutSaleInput[] | SalesReturnUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: SalesReturnCreateOrConnectWithoutSaleInput | SalesReturnCreateOrConnectWithoutSaleInput[]
    upsert?: SalesReturnUpsertWithWhereUniqueWithoutSaleInput | SalesReturnUpsertWithWhereUniqueWithoutSaleInput[]
    createMany?: SalesReturnCreateManySaleInputEnvelope
    set?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    disconnect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    delete?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    connect?: SalesReturnWhereUniqueInput | SalesReturnWhereUniqueInput[]
    update?: SalesReturnUpdateWithWhereUniqueWithoutSaleInput | SalesReturnUpdateWithWhereUniqueWithoutSaleInput[]
    updateMany?: SalesReturnUpdateManyWithWhereWithoutSaleInput | SalesReturnUpdateManyWithWhereWithoutSaleInput[]
    deleteMany?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
  }

  export type InvoiceUncheckedUpdateManyWithoutSaleNestedInput = {
    create?: XOR<InvoiceCreateWithoutSaleInput, InvoiceUncheckedCreateWithoutSaleInput> | InvoiceCreateWithoutSaleInput[] | InvoiceUncheckedCreateWithoutSaleInput[]
    connectOrCreate?: InvoiceCreateOrConnectWithoutSaleInput | InvoiceCreateOrConnectWithoutSaleInput[]
    upsert?: InvoiceUpsertWithWhereUniqueWithoutSaleInput | InvoiceUpsertWithWhereUniqueWithoutSaleInput[]
    createMany?: InvoiceCreateManySaleInputEnvelope
    set?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    disconnect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    delete?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    connect?: InvoiceWhereUniqueInput | InvoiceWhereUniqueInput[]
    update?: InvoiceUpdateWithWhereUniqueWithoutSaleInput | InvoiceUpdateWithWhereUniqueWithoutSaleInput[]
    updateMany?: InvoiceUpdateManyWithWhereWithoutSaleInput | InvoiceUpdateManyWithWhereWithoutSaleInput[]
    deleteMany?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
  }

  export type SaleCreateNestedOneWithoutLinesInput = {
    create?: XOR<SaleCreateWithoutLinesInput, SaleUncheckedCreateWithoutLinesInput>
    connectOrCreate?: SaleCreateOrConnectWithoutLinesInput
    connect?: SaleWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutSaleLinesInput = {
    create?: XOR<ProductCreateWithoutSaleLinesInput, ProductUncheckedCreateWithoutSaleLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutSaleLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type SaleUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<SaleCreateWithoutLinesInput, SaleUncheckedCreateWithoutLinesInput>
    connectOrCreate?: SaleCreateOrConnectWithoutLinesInput
    upsert?: SaleUpsertWithoutLinesInput
    connect?: SaleWhereUniqueInput
    update?: XOR<XOR<SaleUpdateToOneWithWhereWithoutLinesInput, SaleUpdateWithoutLinesInput>, SaleUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutSaleLinesNestedInput = {
    create?: XOR<ProductCreateWithoutSaleLinesInput, ProductUncheckedCreateWithoutSaleLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutSaleLinesInput
    upsert?: ProductUpsertWithoutSaleLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutSaleLinesInput, ProductUpdateWithoutSaleLinesInput>, ProductUncheckedUpdateWithoutSaleLinesInput>
  }

  export type SaleCreateNestedOneWithoutReturnsInput = {
    create?: XOR<SaleCreateWithoutReturnsInput, SaleUncheckedCreateWithoutReturnsInput>
    connectOrCreate?: SaleCreateOrConnectWithoutReturnsInput
    connect?: SaleWhereUniqueInput
  }

  export type CustomerCreateNestedOneWithoutSalesReturnsInput = {
    create?: XOR<CustomerCreateWithoutSalesReturnsInput, CustomerUncheckedCreateWithoutSalesReturnsInput>
    connectOrCreate?: CustomerCreateOrConnectWithoutSalesReturnsInput
    connect?: CustomerWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutSalesReturnsInput = {
    create?: XOR<WarehouseCreateWithoutSalesReturnsInput, WarehouseUncheckedCreateWithoutSalesReturnsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutSalesReturnsInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutSalesReturnsInput = {
    create?: XOR<BranchCreateWithoutSalesReturnsInput, BranchUncheckedCreateWithoutSalesReturnsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutSalesReturnsInput
    connect?: BranchWhereUniqueInput
  }

  export type SalesReturnLineCreateNestedManyWithoutSalesReturnInput = {
    create?: XOR<SalesReturnLineCreateWithoutSalesReturnInput, SalesReturnLineUncheckedCreateWithoutSalesReturnInput> | SalesReturnLineCreateWithoutSalesReturnInput[] | SalesReturnLineUncheckedCreateWithoutSalesReturnInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutSalesReturnInput | SalesReturnLineCreateOrConnectWithoutSalesReturnInput[]
    createMany?: SalesReturnLineCreateManySalesReturnInputEnvelope
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
  }

  export type SalesReturnLineUncheckedCreateNestedManyWithoutSalesReturnInput = {
    create?: XOR<SalesReturnLineCreateWithoutSalesReturnInput, SalesReturnLineUncheckedCreateWithoutSalesReturnInput> | SalesReturnLineCreateWithoutSalesReturnInput[] | SalesReturnLineUncheckedCreateWithoutSalesReturnInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutSalesReturnInput | SalesReturnLineCreateOrConnectWithoutSalesReturnInput[]
    createMany?: SalesReturnLineCreateManySalesReturnInputEnvelope
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
  }

  export type SaleUpdateOneWithoutReturnsNestedInput = {
    create?: XOR<SaleCreateWithoutReturnsInput, SaleUncheckedCreateWithoutReturnsInput>
    connectOrCreate?: SaleCreateOrConnectWithoutReturnsInput
    upsert?: SaleUpsertWithoutReturnsInput
    disconnect?: SaleWhereInput | boolean
    delete?: SaleWhereInput | boolean
    connect?: SaleWhereUniqueInput
    update?: XOR<XOR<SaleUpdateToOneWithWhereWithoutReturnsInput, SaleUpdateWithoutReturnsInput>, SaleUncheckedUpdateWithoutReturnsInput>
  }

  export type CustomerUpdateOneWithoutSalesReturnsNestedInput = {
    create?: XOR<CustomerCreateWithoutSalesReturnsInput, CustomerUncheckedCreateWithoutSalesReturnsInput>
    connectOrCreate?: CustomerCreateOrConnectWithoutSalesReturnsInput
    upsert?: CustomerUpsertWithoutSalesReturnsInput
    disconnect?: CustomerWhereInput | boolean
    delete?: CustomerWhereInput | boolean
    connect?: CustomerWhereUniqueInput
    update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutSalesReturnsInput, CustomerUpdateWithoutSalesReturnsInput>, CustomerUncheckedUpdateWithoutSalesReturnsInput>
  }

  export type WarehouseUpdateOneWithoutSalesReturnsNestedInput = {
    create?: XOR<WarehouseCreateWithoutSalesReturnsInput, WarehouseUncheckedCreateWithoutSalesReturnsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutSalesReturnsInput
    upsert?: WarehouseUpsertWithoutSalesReturnsInput
    disconnect?: WarehouseWhereInput | boolean
    delete?: WarehouseWhereInput | boolean
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutSalesReturnsInput, WarehouseUpdateWithoutSalesReturnsInput>, WarehouseUncheckedUpdateWithoutSalesReturnsInput>
  }

  export type BranchUpdateOneWithoutSalesReturnsNestedInput = {
    create?: XOR<BranchCreateWithoutSalesReturnsInput, BranchUncheckedCreateWithoutSalesReturnsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutSalesReturnsInput
    upsert?: BranchUpsertWithoutSalesReturnsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutSalesReturnsInput, BranchUpdateWithoutSalesReturnsInput>, BranchUncheckedUpdateWithoutSalesReturnsInput>
  }

  export type SalesReturnLineUpdateManyWithoutSalesReturnNestedInput = {
    create?: XOR<SalesReturnLineCreateWithoutSalesReturnInput, SalesReturnLineUncheckedCreateWithoutSalesReturnInput> | SalesReturnLineCreateWithoutSalesReturnInput[] | SalesReturnLineUncheckedCreateWithoutSalesReturnInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutSalesReturnInput | SalesReturnLineCreateOrConnectWithoutSalesReturnInput[]
    upsert?: SalesReturnLineUpsertWithWhereUniqueWithoutSalesReturnInput | SalesReturnLineUpsertWithWhereUniqueWithoutSalesReturnInput[]
    createMany?: SalesReturnLineCreateManySalesReturnInputEnvelope
    set?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    disconnect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    delete?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    update?: SalesReturnLineUpdateWithWhereUniqueWithoutSalesReturnInput | SalesReturnLineUpdateWithWhereUniqueWithoutSalesReturnInput[]
    updateMany?: SalesReturnLineUpdateManyWithWhereWithoutSalesReturnInput | SalesReturnLineUpdateManyWithWhereWithoutSalesReturnInput[]
    deleteMany?: SalesReturnLineScalarWhereInput | SalesReturnLineScalarWhereInput[]
  }

  export type SalesReturnLineUncheckedUpdateManyWithoutSalesReturnNestedInput = {
    create?: XOR<SalesReturnLineCreateWithoutSalesReturnInput, SalesReturnLineUncheckedCreateWithoutSalesReturnInput> | SalesReturnLineCreateWithoutSalesReturnInput[] | SalesReturnLineUncheckedCreateWithoutSalesReturnInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutSalesReturnInput | SalesReturnLineCreateOrConnectWithoutSalesReturnInput[]
    upsert?: SalesReturnLineUpsertWithWhereUniqueWithoutSalesReturnInput | SalesReturnLineUpsertWithWhereUniqueWithoutSalesReturnInput[]
    createMany?: SalesReturnLineCreateManySalesReturnInputEnvelope
    set?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    disconnect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    delete?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    update?: SalesReturnLineUpdateWithWhereUniqueWithoutSalesReturnInput | SalesReturnLineUpdateWithWhereUniqueWithoutSalesReturnInput[]
    updateMany?: SalesReturnLineUpdateManyWithWhereWithoutSalesReturnInput | SalesReturnLineUpdateManyWithWhereWithoutSalesReturnInput[]
    deleteMany?: SalesReturnLineScalarWhereInput | SalesReturnLineScalarWhereInput[]
  }

  export type SalesReturnCreateNestedOneWithoutLinesInput = {
    create?: XOR<SalesReturnCreateWithoutLinesInput, SalesReturnUncheckedCreateWithoutLinesInput>
    connectOrCreate?: SalesReturnCreateOrConnectWithoutLinesInput
    connect?: SalesReturnWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutSalesReturnLinesInput = {
    create?: XOR<ProductCreateWithoutSalesReturnLinesInput, ProductUncheckedCreateWithoutSalesReturnLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutSalesReturnLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type SalesReturnUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<SalesReturnCreateWithoutLinesInput, SalesReturnUncheckedCreateWithoutLinesInput>
    connectOrCreate?: SalesReturnCreateOrConnectWithoutLinesInput
    upsert?: SalesReturnUpsertWithoutLinesInput
    connect?: SalesReturnWhereUniqueInput
    update?: XOR<XOR<SalesReturnUpdateToOneWithWhereWithoutLinesInput, SalesReturnUpdateWithoutLinesInput>, SalesReturnUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutSalesReturnLinesNestedInput = {
    create?: XOR<ProductCreateWithoutSalesReturnLinesInput, ProductUncheckedCreateWithoutSalesReturnLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutSalesReturnLinesInput
    upsert?: ProductUpsertWithoutSalesReturnLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutSalesReturnLinesInput, ProductUpdateWithoutSalesReturnLinesInput>, ProductUncheckedUpdateWithoutSalesReturnLinesInput>
  }

  export type BranchCreateNestedOneWithoutTaxesInput = {
    create?: XOR<BranchCreateWithoutTaxesInput, BranchUncheckedCreateWithoutTaxesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutTaxesInput
    connect?: BranchWhereUniqueInput
  }

  export type ProductCreateNestedManyWithoutSalesTaxInput = {
    create?: XOR<ProductCreateWithoutSalesTaxInput, ProductUncheckedCreateWithoutSalesTaxInput> | ProductCreateWithoutSalesTaxInput[] | ProductUncheckedCreateWithoutSalesTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutSalesTaxInput | ProductCreateOrConnectWithoutSalesTaxInput[]
    createMany?: ProductCreateManySalesTaxInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type ProductCreateNestedManyWithoutPurchaseTaxInput = {
    create?: XOR<ProductCreateWithoutPurchaseTaxInput, ProductUncheckedCreateWithoutPurchaseTaxInput> | ProductCreateWithoutPurchaseTaxInput[] | ProductUncheckedCreateWithoutPurchaseTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseTaxInput | ProductCreateOrConnectWithoutPurchaseTaxInput[]
    createMany?: ProductCreateManyPurchaseTaxInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutSalesTaxInput = {
    create?: XOR<ProductCreateWithoutSalesTaxInput, ProductUncheckedCreateWithoutSalesTaxInput> | ProductCreateWithoutSalesTaxInput[] | ProductUncheckedCreateWithoutSalesTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutSalesTaxInput | ProductCreateOrConnectWithoutSalesTaxInput[]
    createMany?: ProductCreateManySalesTaxInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type ProductUncheckedCreateNestedManyWithoutPurchaseTaxInput = {
    create?: XOR<ProductCreateWithoutPurchaseTaxInput, ProductUncheckedCreateWithoutPurchaseTaxInput> | ProductCreateWithoutPurchaseTaxInput[] | ProductUncheckedCreateWithoutPurchaseTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseTaxInput | ProductCreateOrConnectWithoutPurchaseTaxInput[]
    createMany?: ProductCreateManyPurchaseTaxInputEnvelope
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutTaxesNestedInput = {
    create?: XOR<BranchCreateWithoutTaxesInput, BranchUncheckedCreateWithoutTaxesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutTaxesInput
    upsert?: BranchUpsertWithoutTaxesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutTaxesInput, BranchUpdateWithoutTaxesInput>, BranchUncheckedUpdateWithoutTaxesInput>
  }

  export type ProductUpdateManyWithoutSalesTaxNestedInput = {
    create?: XOR<ProductCreateWithoutSalesTaxInput, ProductUncheckedCreateWithoutSalesTaxInput> | ProductCreateWithoutSalesTaxInput[] | ProductUncheckedCreateWithoutSalesTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutSalesTaxInput | ProductCreateOrConnectWithoutSalesTaxInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutSalesTaxInput | ProductUpsertWithWhereUniqueWithoutSalesTaxInput[]
    createMany?: ProductCreateManySalesTaxInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutSalesTaxInput | ProductUpdateWithWhereUniqueWithoutSalesTaxInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutSalesTaxInput | ProductUpdateManyWithWhereWithoutSalesTaxInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type ProductUpdateManyWithoutPurchaseTaxNestedInput = {
    create?: XOR<ProductCreateWithoutPurchaseTaxInput, ProductUncheckedCreateWithoutPurchaseTaxInput> | ProductCreateWithoutPurchaseTaxInput[] | ProductUncheckedCreateWithoutPurchaseTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseTaxInput | ProductCreateOrConnectWithoutPurchaseTaxInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutPurchaseTaxInput | ProductUpsertWithWhereUniqueWithoutPurchaseTaxInput[]
    createMany?: ProductCreateManyPurchaseTaxInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutPurchaseTaxInput | ProductUpdateWithWhereUniqueWithoutPurchaseTaxInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutPurchaseTaxInput | ProductUpdateManyWithWhereWithoutPurchaseTaxInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutSalesTaxNestedInput = {
    create?: XOR<ProductCreateWithoutSalesTaxInput, ProductUncheckedCreateWithoutSalesTaxInput> | ProductCreateWithoutSalesTaxInput[] | ProductUncheckedCreateWithoutSalesTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutSalesTaxInput | ProductCreateOrConnectWithoutSalesTaxInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutSalesTaxInput | ProductUpsertWithWhereUniqueWithoutSalesTaxInput[]
    createMany?: ProductCreateManySalesTaxInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutSalesTaxInput | ProductUpdateWithWhereUniqueWithoutSalesTaxInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutSalesTaxInput | ProductUpdateManyWithWhereWithoutSalesTaxInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type ProductUncheckedUpdateManyWithoutPurchaseTaxNestedInput = {
    create?: XOR<ProductCreateWithoutPurchaseTaxInput, ProductUncheckedCreateWithoutPurchaseTaxInput> | ProductCreateWithoutPurchaseTaxInput[] | ProductUncheckedCreateWithoutPurchaseTaxInput[]
    connectOrCreate?: ProductCreateOrConnectWithoutPurchaseTaxInput | ProductCreateOrConnectWithoutPurchaseTaxInput[]
    upsert?: ProductUpsertWithWhereUniqueWithoutPurchaseTaxInput | ProductUpsertWithWhereUniqueWithoutPurchaseTaxInput[]
    createMany?: ProductCreateManyPurchaseTaxInputEnvelope
    set?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    disconnect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    delete?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[]
    update?: ProductUpdateWithWhereUniqueWithoutPurchaseTaxInput | ProductUpdateWithWhereUniqueWithoutPurchaseTaxInput[]
    updateMany?: ProductUpdateManyWithWhereWithoutPurchaseTaxInput | ProductUpdateManyWithWhereWithoutPurchaseTaxInput[]
    deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[]
  }

  export type BranchCreateNestedOneWithoutExpenseCategoriesInput = {
    create?: XOR<BranchCreateWithoutExpenseCategoriesInput, BranchUncheckedCreateWithoutExpenseCategoriesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutExpenseCategoriesInput
    connect?: BranchWhereUniqueInput
  }

  export type ExpenseCreateNestedManyWithoutCategoryInput = {
    create?: XOR<ExpenseCreateWithoutCategoryInput, ExpenseUncheckedCreateWithoutCategoryInput> | ExpenseCreateWithoutCategoryInput[] | ExpenseUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutCategoryInput | ExpenseCreateOrConnectWithoutCategoryInput[]
    createMany?: ExpenseCreateManyCategoryInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type ExpenseUncheckedCreateNestedManyWithoutCategoryInput = {
    create?: XOR<ExpenseCreateWithoutCategoryInput, ExpenseUncheckedCreateWithoutCategoryInput> | ExpenseCreateWithoutCategoryInput[] | ExpenseUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutCategoryInput | ExpenseCreateOrConnectWithoutCategoryInput[]
    createMany?: ExpenseCreateManyCategoryInputEnvelope
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutExpenseCategoriesNestedInput = {
    create?: XOR<BranchCreateWithoutExpenseCategoriesInput, BranchUncheckedCreateWithoutExpenseCategoriesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutExpenseCategoriesInput
    upsert?: BranchUpsertWithoutExpenseCategoriesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutExpenseCategoriesInput, BranchUpdateWithoutExpenseCategoriesInput>, BranchUncheckedUpdateWithoutExpenseCategoriesInput>
  }

  export type ExpenseUpdateManyWithoutCategoryNestedInput = {
    create?: XOR<ExpenseCreateWithoutCategoryInput, ExpenseUncheckedCreateWithoutCategoryInput> | ExpenseCreateWithoutCategoryInput[] | ExpenseUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutCategoryInput | ExpenseCreateOrConnectWithoutCategoryInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutCategoryInput | ExpenseUpsertWithWhereUniqueWithoutCategoryInput[]
    createMany?: ExpenseCreateManyCategoryInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutCategoryInput | ExpenseUpdateWithWhereUniqueWithoutCategoryInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutCategoryInput | ExpenseUpdateManyWithWhereWithoutCategoryInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type ExpenseUncheckedUpdateManyWithoutCategoryNestedInput = {
    create?: XOR<ExpenseCreateWithoutCategoryInput, ExpenseUncheckedCreateWithoutCategoryInput> | ExpenseCreateWithoutCategoryInput[] | ExpenseUncheckedCreateWithoutCategoryInput[]
    connectOrCreate?: ExpenseCreateOrConnectWithoutCategoryInput | ExpenseCreateOrConnectWithoutCategoryInput[]
    upsert?: ExpenseUpsertWithWhereUniqueWithoutCategoryInput | ExpenseUpsertWithWhereUniqueWithoutCategoryInput[]
    createMany?: ExpenseCreateManyCategoryInputEnvelope
    set?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    disconnect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    delete?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    connect?: ExpenseWhereUniqueInput | ExpenseWhereUniqueInput[]
    update?: ExpenseUpdateWithWhereUniqueWithoutCategoryInput | ExpenseUpdateWithWhereUniqueWithoutCategoryInput[]
    updateMany?: ExpenseUpdateManyWithWhereWithoutCategoryInput | ExpenseUpdateManyWithWhereWithoutCategoryInput[]
    deleteMany?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
  }

  export type ExpenseCategoryCreateNestedOneWithoutExpensesInput = {
    create?: XOR<ExpenseCategoryCreateWithoutExpensesInput, ExpenseCategoryUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: ExpenseCategoryCreateOrConnectWithoutExpensesInput
    connect?: ExpenseCategoryWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutExpensesInput = {
    create?: XOR<WarehouseCreateWithoutExpensesInput, WarehouseUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutExpensesInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutExpensesInput = {
    create?: XOR<BranchCreateWithoutExpensesInput, BranchUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutExpensesInput
    connect?: BranchWhereUniqueInput
  }

  export type PaymentMethodCreateNestedOneWithoutExpensesInput = {
    create?: XOR<PaymentMethodCreateWithoutExpensesInput, PaymentMethodUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutExpensesInput
    connect?: PaymentMethodWhereUniqueInput
  }

  export type ExpenseCategoryUpdateOneWithoutExpensesNestedInput = {
    create?: XOR<ExpenseCategoryCreateWithoutExpensesInput, ExpenseCategoryUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: ExpenseCategoryCreateOrConnectWithoutExpensesInput
    upsert?: ExpenseCategoryUpsertWithoutExpensesInput
    disconnect?: ExpenseCategoryWhereInput | boolean
    delete?: ExpenseCategoryWhereInput | boolean
    connect?: ExpenseCategoryWhereUniqueInput
    update?: XOR<XOR<ExpenseCategoryUpdateToOneWithWhereWithoutExpensesInput, ExpenseCategoryUpdateWithoutExpensesInput>, ExpenseCategoryUncheckedUpdateWithoutExpensesInput>
  }

  export type WarehouseUpdateOneWithoutExpensesNestedInput = {
    create?: XOR<WarehouseCreateWithoutExpensesInput, WarehouseUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutExpensesInput
    upsert?: WarehouseUpsertWithoutExpensesInput
    disconnect?: WarehouseWhereInput | boolean
    delete?: WarehouseWhereInput | boolean
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutExpensesInput, WarehouseUpdateWithoutExpensesInput>, WarehouseUncheckedUpdateWithoutExpensesInput>
  }

  export type BranchUpdateOneWithoutExpensesNestedInput = {
    create?: XOR<BranchCreateWithoutExpensesInput, BranchUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutExpensesInput
    upsert?: BranchUpsertWithoutExpensesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutExpensesInput, BranchUpdateWithoutExpensesInput>, BranchUncheckedUpdateWithoutExpensesInput>
  }

  export type PaymentMethodUpdateOneWithoutExpensesNestedInput = {
    create?: XOR<PaymentMethodCreateWithoutExpensesInput, PaymentMethodUncheckedCreateWithoutExpensesInput>
    connectOrCreate?: PaymentMethodCreateOrConnectWithoutExpensesInput
    upsert?: PaymentMethodUpsertWithoutExpensesInput
    disconnect?: PaymentMethodWhereInput | boolean
    delete?: PaymentMethodWhereInput | boolean
    connect?: PaymentMethodWhereUniqueInput
    update?: XOR<XOR<PaymentMethodUpdateToOneWithWhereWithoutExpensesInput, PaymentMethodUpdateWithoutExpensesInput>, PaymentMethodUncheckedUpdateWithoutExpensesInput>
  }

  export type BranchCreateNestedOneWithoutProductsInput = {
    create?: XOR<BranchCreateWithoutProductsInput, BranchUncheckedCreateWithoutProductsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutProductsInput
    connect?: BranchWhereUniqueInput
  }

  export type CategoryCreateNestedOneWithoutProductsInput = {
    create?: XOR<CategoryCreateWithoutProductsInput, CategoryUncheckedCreateWithoutProductsInput>
    connectOrCreate?: CategoryCreateOrConnectWithoutProductsInput
    connect?: CategoryWhereUniqueInput
  }

  export type UnitCreateNestedOneWithoutProductsInput = {
    create?: XOR<UnitCreateWithoutProductsInput, UnitUncheckedCreateWithoutProductsInput>
    connectOrCreate?: UnitCreateOrConnectWithoutProductsInput
    connect?: UnitWhereUniqueInput
  }

  export type BrandCreateNestedOneWithoutProductsInput = {
    create?: XOR<BrandCreateWithoutProductsInput, BrandUncheckedCreateWithoutProductsInput>
    connectOrCreate?: BrandCreateOrConnectWithoutProductsInput
    connect?: BrandWhereUniqueInput
  }

  export type TaxCreateNestedOneWithoutProductsSalesInput = {
    create?: XOR<TaxCreateWithoutProductsSalesInput, TaxUncheckedCreateWithoutProductsSalesInput>
    connectOrCreate?: TaxCreateOrConnectWithoutProductsSalesInput
    connect?: TaxWhereUniqueInput
  }

  export type TaxCreateNestedOneWithoutProductsPurchaseInput = {
    create?: XOR<TaxCreateWithoutProductsPurchaseInput, TaxUncheckedCreateWithoutProductsPurchaseInput>
    connectOrCreate?: TaxCreateOrConnectWithoutProductsPurchaseInput
    connect?: TaxWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutProductsInput = {
    create?: XOR<WarehouseCreateWithoutProductsInput, WarehouseUncheckedCreateWithoutProductsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutProductsInput
    connect?: WarehouseWhereUniqueInput
  }

  export type InventoryAdjustmentLineCreateNestedManyWithoutProductInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutProductInput, InventoryAdjustmentLineUncheckedCreateWithoutProductInput> | InventoryAdjustmentLineCreateWithoutProductInput[] | InventoryAdjustmentLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutProductInput | InventoryAdjustmentLineCreateOrConnectWithoutProductInput[]
    createMany?: InventoryAdjustmentLineCreateManyProductInputEnvelope
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
  }

  export type InvoiceLineCreateNestedManyWithoutProductInput = {
    create?: XOR<InvoiceLineCreateWithoutProductInput, InvoiceLineUncheckedCreateWithoutProductInput> | InvoiceLineCreateWithoutProductInput[] | InvoiceLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutProductInput | InvoiceLineCreateOrConnectWithoutProductInput[]
    createMany?: InvoiceLineCreateManyProductInputEnvelope
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
  }

  export type PurchaseLineCreateNestedManyWithoutProductInput = {
    create?: XOR<PurchaseLineCreateWithoutProductInput, PurchaseLineUncheckedCreateWithoutProductInput> | PurchaseLineCreateWithoutProductInput[] | PurchaseLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutProductInput | PurchaseLineCreateOrConnectWithoutProductInput[]
    createMany?: PurchaseLineCreateManyProductInputEnvelope
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
  }

  export type PurchaseReturnLineCreateNestedManyWithoutProductInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutProductInput, PurchaseReturnLineUncheckedCreateWithoutProductInput> | PurchaseReturnLineCreateWithoutProductInput[] | PurchaseReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutProductInput | PurchaseReturnLineCreateOrConnectWithoutProductInput[]
    createMany?: PurchaseReturnLineCreateManyProductInputEnvelope
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
  }

  export type SaleLineCreateNestedManyWithoutProductInput = {
    create?: XOR<SaleLineCreateWithoutProductInput, SaleLineUncheckedCreateWithoutProductInput> | SaleLineCreateWithoutProductInput[] | SaleLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutProductInput | SaleLineCreateOrConnectWithoutProductInput[]
    createMany?: SaleLineCreateManyProductInputEnvelope
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
  }

  export type SalesReturnLineCreateNestedManyWithoutProductInput = {
    create?: XOR<SalesReturnLineCreateWithoutProductInput, SalesReturnLineUncheckedCreateWithoutProductInput> | SalesReturnLineCreateWithoutProductInput[] | SalesReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutProductInput | SalesReturnLineCreateOrConnectWithoutProductInput[]
    createMany?: SalesReturnLineCreateManyProductInputEnvelope
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
  }

  export type InventoryTransferLineCreateNestedManyWithoutProductInput = {
    create?: XOR<InventoryTransferLineCreateWithoutProductInput, InventoryTransferLineUncheckedCreateWithoutProductInput> | InventoryTransferLineCreateWithoutProductInput[] | InventoryTransferLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutProductInput | InventoryTransferLineCreateOrConnectWithoutProductInput[]
    createMany?: InventoryTransferLineCreateManyProductInputEnvelope
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
  }

  export type WarehouseStockCreateNestedManyWithoutProductInput = {
    create?: XOR<WarehouseStockCreateWithoutProductInput, WarehouseStockUncheckedCreateWithoutProductInput> | WarehouseStockCreateWithoutProductInput[] | WarehouseStockUncheckedCreateWithoutProductInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutProductInput | WarehouseStockCreateOrConnectWithoutProductInput[]
    createMany?: WarehouseStockCreateManyProductInputEnvelope
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
  }

  export type InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutProductInput, InventoryAdjustmentLineUncheckedCreateWithoutProductInput> | InventoryAdjustmentLineCreateWithoutProductInput[] | InventoryAdjustmentLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutProductInput | InventoryAdjustmentLineCreateOrConnectWithoutProductInput[]
    createMany?: InventoryAdjustmentLineCreateManyProductInputEnvelope
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
  }

  export type InvoiceLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<InvoiceLineCreateWithoutProductInput, InvoiceLineUncheckedCreateWithoutProductInput> | InvoiceLineCreateWithoutProductInput[] | InvoiceLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutProductInput | InvoiceLineCreateOrConnectWithoutProductInput[]
    createMany?: InvoiceLineCreateManyProductInputEnvelope
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
  }

  export type PurchaseLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<PurchaseLineCreateWithoutProductInput, PurchaseLineUncheckedCreateWithoutProductInput> | PurchaseLineCreateWithoutProductInput[] | PurchaseLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutProductInput | PurchaseLineCreateOrConnectWithoutProductInput[]
    createMany?: PurchaseLineCreateManyProductInputEnvelope
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
  }

  export type PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutProductInput, PurchaseReturnLineUncheckedCreateWithoutProductInput> | PurchaseReturnLineCreateWithoutProductInput[] | PurchaseReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutProductInput | PurchaseReturnLineCreateOrConnectWithoutProductInput[]
    createMany?: PurchaseReturnLineCreateManyProductInputEnvelope
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
  }

  export type SaleLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<SaleLineCreateWithoutProductInput, SaleLineUncheckedCreateWithoutProductInput> | SaleLineCreateWithoutProductInput[] | SaleLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutProductInput | SaleLineCreateOrConnectWithoutProductInput[]
    createMany?: SaleLineCreateManyProductInputEnvelope
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
  }

  export type SalesReturnLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<SalesReturnLineCreateWithoutProductInput, SalesReturnLineUncheckedCreateWithoutProductInput> | SalesReturnLineCreateWithoutProductInput[] | SalesReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutProductInput | SalesReturnLineCreateOrConnectWithoutProductInput[]
    createMany?: SalesReturnLineCreateManyProductInputEnvelope
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
  }

  export type InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<InventoryTransferLineCreateWithoutProductInput, InventoryTransferLineUncheckedCreateWithoutProductInput> | InventoryTransferLineCreateWithoutProductInput[] | InventoryTransferLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutProductInput | InventoryTransferLineCreateOrConnectWithoutProductInput[]
    createMany?: InventoryTransferLineCreateManyProductInputEnvelope
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
  }

  export type WarehouseStockUncheckedCreateNestedManyWithoutProductInput = {
    create?: XOR<WarehouseStockCreateWithoutProductInput, WarehouseStockUncheckedCreateWithoutProductInput> | WarehouseStockCreateWithoutProductInput[] | WarehouseStockUncheckedCreateWithoutProductInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutProductInput | WarehouseStockCreateOrConnectWithoutProductInput[]
    createMany?: WarehouseStockCreateManyProductInputEnvelope
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
  }

  export type BranchUpdateOneWithoutProductsNestedInput = {
    create?: XOR<BranchCreateWithoutProductsInput, BranchUncheckedCreateWithoutProductsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutProductsInput
    upsert?: BranchUpsertWithoutProductsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutProductsInput, BranchUpdateWithoutProductsInput>, BranchUncheckedUpdateWithoutProductsInput>
  }

  export type CategoryUpdateOneWithoutProductsNestedInput = {
    create?: XOR<CategoryCreateWithoutProductsInput, CategoryUncheckedCreateWithoutProductsInput>
    connectOrCreate?: CategoryCreateOrConnectWithoutProductsInput
    upsert?: CategoryUpsertWithoutProductsInput
    disconnect?: CategoryWhereInput | boolean
    delete?: CategoryWhereInput | boolean
    connect?: CategoryWhereUniqueInput
    update?: XOR<XOR<CategoryUpdateToOneWithWhereWithoutProductsInput, CategoryUpdateWithoutProductsInput>, CategoryUncheckedUpdateWithoutProductsInput>
  }

  export type UnitUpdateOneWithoutProductsNestedInput = {
    create?: XOR<UnitCreateWithoutProductsInput, UnitUncheckedCreateWithoutProductsInput>
    connectOrCreate?: UnitCreateOrConnectWithoutProductsInput
    upsert?: UnitUpsertWithoutProductsInput
    disconnect?: UnitWhereInput | boolean
    delete?: UnitWhereInput | boolean
    connect?: UnitWhereUniqueInput
    update?: XOR<XOR<UnitUpdateToOneWithWhereWithoutProductsInput, UnitUpdateWithoutProductsInput>, UnitUncheckedUpdateWithoutProductsInput>
  }

  export type BrandUpdateOneWithoutProductsNestedInput = {
    create?: XOR<BrandCreateWithoutProductsInput, BrandUncheckedCreateWithoutProductsInput>
    connectOrCreate?: BrandCreateOrConnectWithoutProductsInput
    upsert?: BrandUpsertWithoutProductsInput
    disconnect?: BrandWhereInput | boolean
    delete?: BrandWhereInput | boolean
    connect?: BrandWhereUniqueInput
    update?: XOR<XOR<BrandUpdateToOneWithWhereWithoutProductsInput, BrandUpdateWithoutProductsInput>, BrandUncheckedUpdateWithoutProductsInput>
  }

  export type TaxUpdateOneWithoutProductsSalesNestedInput = {
    create?: XOR<TaxCreateWithoutProductsSalesInput, TaxUncheckedCreateWithoutProductsSalesInput>
    connectOrCreate?: TaxCreateOrConnectWithoutProductsSalesInput
    upsert?: TaxUpsertWithoutProductsSalesInput
    disconnect?: TaxWhereInput | boolean
    delete?: TaxWhereInput | boolean
    connect?: TaxWhereUniqueInput
    update?: XOR<XOR<TaxUpdateToOneWithWhereWithoutProductsSalesInput, TaxUpdateWithoutProductsSalesInput>, TaxUncheckedUpdateWithoutProductsSalesInput>
  }

  export type TaxUpdateOneWithoutProductsPurchaseNestedInput = {
    create?: XOR<TaxCreateWithoutProductsPurchaseInput, TaxUncheckedCreateWithoutProductsPurchaseInput>
    connectOrCreate?: TaxCreateOrConnectWithoutProductsPurchaseInput
    upsert?: TaxUpsertWithoutProductsPurchaseInput
    disconnect?: TaxWhereInput | boolean
    delete?: TaxWhereInput | boolean
    connect?: TaxWhereUniqueInput
    update?: XOR<XOR<TaxUpdateToOneWithWhereWithoutProductsPurchaseInput, TaxUpdateWithoutProductsPurchaseInput>, TaxUncheckedUpdateWithoutProductsPurchaseInput>
  }

  export type WarehouseUpdateOneWithoutProductsNestedInput = {
    create?: XOR<WarehouseCreateWithoutProductsInput, WarehouseUncheckedCreateWithoutProductsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutProductsInput
    upsert?: WarehouseUpsertWithoutProductsInput
    disconnect?: WarehouseWhereInput | boolean
    delete?: WarehouseWhereInput | boolean
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutProductsInput, WarehouseUpdateWithoutProductsInput>, WarehouseUncheckedUpdateWithoutProductsInput>
  }

  export type InventoryAdjustmentLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutProductInput, InventoryAdjustmentLineUncheckedCreateWithoutProductInput> | InventoryAdjustmentLineCreateWithoutProductInput[] | InventoryAdjustmentLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutProductInput | InventoryAdjustmentLineCreateOrConnectWithoutProductInput[]
    upsert?: InventoryAdjustmentLineUpsertWithWhereUniqueWithoutProductInput | InventoryAdjustmentLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: InventoryAdjustmentLineCreateManyProductInputEnvelope
    set?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    disconnect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    delete?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    update?: InventoryAdjustmentLineUpdateWithWhereUniqueWithoutProductInput | InventoryAdjustmentLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: InventoryAdjustmentLineUpdateManyWithWhereWithoutProductInput | InventoryAdjustmentLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: InventoryAdjustmentLineScalarWhereInput | InventoryAdjustmentLineScalarWhereInput[]
  }

  export type InvoiceLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<InvoiceLineCreateWithoutProductInput, InvoiceLineUncheckedCreateWithoutProductInput> | InvoiceLineCreateWithoutProductInput[] | InvoiceLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutProductInput | InvoiceLineCreateOrConnectWithoutProductInput[]
    upsert?: InvoiceLineUpsertWithWhereUniqueWithoutProductInput | InvoiceLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: InvoiceLineCreateManyProductInputEnvelope
    set?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    disconnect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    delete?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    update?: InvoiceLineUpdateWithWhereUniqueWithoutProductInput | InvoiceLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: InvoiceLineUpdateManyWithWhereWithoutProductInput | InvoiceLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: InvoiceLineScalarWhereInput | InvoiceLineScalarWhereInput[]
  }

  export type PurchaseLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<PurchaseLineCreateWithoutProductInput, PurchaseLineUncheckedCreateWithoutProductInput> | PurchaseLineCreateWithoutProductInput[] | PurchaseLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutProductInput | PurchaseLineCreateOrConnectWithoutProductInput[]
    upsert?: PurchaseLineUpsertWithWhereUniqueWithoutProductInput | PurchaseLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: PurchaseLineCreateManyProductInputEnvelope
    set?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    disconnect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    delete?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    update?: PurchaseLineUpdateWithWhereUniqueWithoutProductInput | PurchaseLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: PurchaseLineUpdateManyWithWhereWithoutProductInput | PurchaseLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: PurchaseLineScalarWhereInput | PurchaseLineScalarWhereInput[]
  }

  export type PurchaseReturnLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutProductInput, PurchaseReturnLineUncheckedCreateWithoutProductInput> | PurchaseReturnLineCreateWithoutProductInput[] | PurchaseReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutProductInput | PurchaseReturnLineCreateOrConnectWithoutProductInput[]
    upsert?: PurchaseReturnLineUpsertWithWhereUniqueWithoutProductInput | PurchaseReturnLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: PurchaseReturnLineCreateManyProductInputEnvelope
    set?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    disconnect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    delete?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    update?: PurchaseReturnLineUpdateWithWhereUniqueWithoutProductInput | PurchaseReturnLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: PurchaseReturnLineUpdateManyWithWhereWithoutProductInput | PurchaseReturnLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: PurchaseReturnLineScalarWhereInput | PurchaseReturnLineScalarWhereInput[]
  }

  export type SaleLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<SaleLineCreateWithoutProductInput, SaleLineUncheckedCreateWithoutProductInput> | SaleLineCreateWithoutProductInput[] | SaleLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutProductInput | SaleLineCreateOrConnectWithoutProductInput[]
    upsert?: SaleLineUpsertWithWhereUniqueWithoutProductInput | SaleLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: SaleLineCreateManyProductInputEnvelope
    set?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    disconnect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    delete?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    update?: SaleLineUpdateWithWhereUniqueWithoutProductInput | SaleLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: SaleLineUpdateManyWithWhereWithoutProductInput | SaleLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: SaleLineScalarWhereInput | SaleLineScalarWhereInput[]
  }

  export type SalesReturnLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<SalesReturnLineCreateWithoutProductInput, SalesReturnLineUncheckedCreateWithoutProductInput> | SalesReturnLineCreateWithoutProductInput[] | SalesReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutProductInput | SalesReturnLineCreateOrConnectWithoutProductInput[]
    upsert?: SalesReturnLineUpsertWithWhereUniqueWithoutProductInput | SalesReturnLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: SalesReturnLineCreateManyProductInputEnvelope
    set?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    disconnect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    delete?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    update?: SalesReturnLineUpdateWithWhereUniqueWithoutProductInput | SalesReturnLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: SalesReturnLineUpdateManyWithWhereWithoutProductInput | SalesReturnLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: SalesReturnLineScalarWhereInput | SalesReturnLineScalarWhereInput[]
  }

  export type InventoryTransferLineUpdateManyWithoutProductNestedInput = {
    create?: XOR<InventoryTransferLineCreateWithoutProductInput, InventoryTransferLineUncheckedCreateWithoutProductInput> | InventoryTransferLineCreateWithoutProductInput[] | InventoryTransferLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutProductInput | InventoryTransferLineCreateOrConnectWithoutProductInput[]
    upsert?: InventoryTransferLineUpsertWithWhereUniqueWithoutProductInput | InventoryTransferLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: InventoryTransferLineCreateManyProductInputEnvelope
    set?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    disconnect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    delete?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    update?: InventoryTransferLineUpdateWithWhereUniqueWithoutProductInput | InventoryTransferLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: InventoryTransferLineUpdateManyWithWhereWithoutProductInput | InventoryTransferLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: InventoryTransferLineScalarWhereInput | InventoryTransferLineScalarWhereInput[]
  }

  export type WarehouseStockUpdateManyWithoutProductNestedInput = {
    create?: XOR<WarehouseStockCreateWithoutProductInput, WarehouseStockUncheckedCreateWithoutProductInput> | WarehouseStockCreateWithoutProductInput[] | WarehouseStockUncheckedCreateWithoutProductInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutProductInput | WarehouseStockCreateOrConnectWithoutProductInput[]
    upsert?: WarehouseStockUpsertWithWhereUniqueWithoutProductInput | WarehouseStockUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: WarehouseStockCreateManyProductInputEnvelope
    set?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    disconnect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    delete?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    update?: WarehouseStockUpdateWithWhereUniqueWithoutProductInput | WarehouseStockUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: WarehouseStockUpdateManyWithWhereWithoutProductInput | WarehouseStockUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: WarehouseStockScalarWhereInput | WarehouseStockScalarWhereInput[]
  }

  export type InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutProductInput, InventoryAdjustmentLineUncheckedCreateWithoutProductInput> | InventoryAdjustmentLineCreateWithoutProductInput[] | InventoryAdjustmentLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutProductInput | InventoryAdjustmentLineCreateOrConnectWithoutProductInput[]
    upsert?: InventoryAdjustmentLineUpsertWithWhereUniqueWithoutProductInput | InventoryAdjustmentLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: InventoryAdjustmentLineCreateManyProductInputEnvelope
    set?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    disconnect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    delete?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    update?: InventoryAdjustmentLineUpdateWithWhereUniqueWithoutProductInput | InventoryAdjustmentLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: InventoryAdjustmentLineUpdateManyWithWhereWithoutProductInput | InventoryAdjustmentLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: InventoryAdjustmentLineScalarWhereInput | InventoryAdjustmentLineScalarWhereInput[]
  }

  export type InvoiceLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<InvoiceLineCreateWithoutProductInput, InvoiceLineUncheckedCreateWithoutProductInput> | InvoiceLineCreateWithoutProductInput[] | InvoiceLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutProductInput | InvoiceLineCreateOrConnectWithoutProductInput[]
    upsert?: InvoiceLineUpsertWithWhereUniqueWithoutProductInput | InvoiceLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: InvoiceLineCreateManyProductInputEnvelope
    set?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    disconnect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    delete?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    update?: InvoiceLineUpdateWithWhereUniqueWithoutProductInput | InvoiceLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: InvoiceLineUpdateManyWithWhereWithoutProductInput | InvoiceLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: InvoiceLineScalarWhereInput | InvoiceLineScalarWhereInput[]
  }

  export type PurchaseLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<PurchaseLineCreateWithoutProductInput, PurchaseLineUncheckedCreateWithoutProductInput> | PurchaseLineCreateWithoutProductInput[] | PurchaseLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseLineCreateOrConnectWithoutProductInput | PurchaseLineCreateOrConnectWithoutProductInput[]
    upsert?: PurchaseLineUpsertWithWhereUniqueWithoutProductInput | PurchaseLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: PurchaseLineCreateManyProductInputEnvelope
    set?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    disconnect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    delete?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    connect?: PurchaseLineWhereUniqueInput | PurchaseLineWhereUniqueInput[]
    update?: PurchaseLineUpdateWithWhereUniqueWithoutProductInput | PurchaseLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: PurchaseLineUpdateManyWithWhereWithoutProductInput | PurchaseLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: PurchaseLineScalarWhereInput | PurchaseLineScalarWhereInput[]
  }

  export type PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<PurchaseReturnLineCreateWithoutProductInput, PurchaseReturnLineUncheckedCreateWithoutProductInput> | PurchaseReturnLineCreateWithoutProductInput[] | PurchaseReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: PurchaseReturnLineCreateOrConnectWithoutProductInput | PurchaseReturnLineCreateOrConnectWithoutProductInput[]
    upsert?: PurchaseReturnLineUpsertWithWhereUniqueWithoutProductInput | PurchaseReturnLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: PurchaseReturnLineCreateManyProductInputEnvelope
    set?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    disconnect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    delete?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    connect?: PurchaseReturnLineWhereUniqueInput | PurchaseReturnLineWhereUniqueInput[]
    update?: PurchaseReturnLineUpdateWithWhereUniqueWithoutProductInput | PurchaseReturnLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: PurchaseReturnLineUpdateManyWithWhereWithoutProductInput | PurchaseReturnLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: PurchaseReturnLineScalarWhereInput | PurchaseReturnLineScalarWhereInput[]
  }

  export type SaleLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<SaleLineCreateWithoutProductInput, SaleLineUncheckedCreateWithoutProductInput> | SaleLineCreateWithoutProductInput[] | SaleLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SaleLineCreateOrConnectWithoutProductInput | SaleLineCreateOrConnectWithoutProductInput[]
    upsert?: SaleLineUpsertWithWhereUniqueWithoutProductInput | SaleLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: SaleLineCreateManyProductInputEnvelope
    set?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    disconnect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    delete?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    connect?: SaleLineWhereUniqueInput | SaleLineWhereUniqueInput[]
    update?: SaleLineUpdateWithWhereUniqueWithoutProductInput | SaleLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: SaleLineUpdateManyWithWhereWithoutProductInput | SaleLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: SaleLineScalarWhereInput | SaleLineScalarWhereInput[]
  }

  export type SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<SalesReturnLineCreateWithoutProductInput, SalesReturnLineUncheckedCreateWithoutProductInput> | SalesReturnLineCreateWithoutProductInput[] | SalesReturnLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: SalesReturnLineCreateOrConnectWithoutProductInput | SalesReturnLineCreateOrConnectWithoutProductInput[]
    upsert?: SalesReturnLineUpsertWithWhereUniqueWithoutProductInput | SalesReturnLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: SalesReturnLineCreateManyProductInputEnvelope
    set?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    disconnect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    delete?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    connect?: SalesReturnLineWhereUniqueInput | SalesReturnLineWhereUniqueInput[]
    update?: SalesReturnLineUpdateWithWhereUniqueWithoutProductInput | SalesReturnLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: SalesReturnLineUpdateManyWithWhereWithoutProductInput | SalesReturnLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: SalesReturnLineScalarWhereInput | SalesReturnLineScalarWhereInput[]
  }

  export type InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<InventoryTransferLineCreateWithoutProductInput, InventoryTransferLineUncheckedCreateWithoutProductInput> | InventoryTransferLineCreateWithoutProductInput[] | InventoryTransferLineUncheckedCreateWithoutProductInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutProductInput | InventoryTransferLineCreateOrConnectWithoutProductInput[]
    upsert?: InventoryTransferLineUpsertWithWhereUniqueWithoutProductInput | InventoryTransferLineUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: InventoryTransferLineCreateManyProductInputEnvelope
    set?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    disconnect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    delete?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    update?: InventoryTransferLineUpdateWithWhereUniqueWithoutProductInput | InventoryTransferLineUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: InventoryTransferLineUpdateManyWithWhereWithoutProductInput | InventoryTransferLineUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: InventoryTransferLineScalarWhereInput | InventoryTransferLineScalarWhereInput[]
  }

  export type WarehouseStockUncheckedUpdateManyWithoutProductNestedInput = {
    create?: XOR<WarehouseStockCreateWithoutProductInput, WarehouseStockUncheckedCreateWithoutProductInput> | WarehouseStockCreateWithoutProductInput[] | WarehouseStockUncheckedCreateWithoutProductInput[]
    connectOrCreate?: WarehouseStockCreateOrConnectWithoutProductInput | WarehouseStockCreateOrConnectWithoutProductInput[]
    upsert?: WarehouseStockUpsertWithWhereUniqueWithoutProductInput | WarehouseStockUpsertWithWhereUniqueWithoutProductInput[]
    createMany?: WarehouseStockCreateManyProductInputEnvelope
    set?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    disconnect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    delete?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    connect?: WarehouseStockWhereUniqueInput | WarehouseStockWhereUniqueInput[]
    update?: WarehouseStockUpdateWithWhereUniqueWithoutProductInput | WarehouseStockUpdateWithWhereUniqueWithoutProductInput[]
    updateMany?: WarehouseStockUpdateManyWithWhereWithoutProductInput | WarehouseStockUpdateManyWithWhereWithoutProductInput[]
    deleteMany?: WarehouseStockScalarWhereInput | WarehouseStockScalarWhereInput[]
  }

  export type WarehouseCreateNestedOneWithoutTransfersFromInput = {
    create?: XOR<WarehouseCreateWithoutTransfersFromInput, WarehouseUncheckedCreateWithoutTransfersFromInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutTransfersFromInput
    connect?: WarehouseWhereUniqueInput
  }

  export type WarehouseCreateNestedOneWithoutTransfersToInput = {
    create?: XOR<WarehouseCreateWithoutTransfersToInput, WarehouseUncheckedCreateWithoutTransfersToInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutTransfersToInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutTransfersInput = {
    create?: XOR<BranchCreateWithoutTransfersInput, BranchUncheckedCreateWithoutTransfersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutTransfersInput
    connect?: BranchWhereUniqueInput
  }

  export type InventoryTransferLineCreateNestedManyWithoutTransferInput = {
    create?: XOR<InventoryTransferLineCreateWithoutTransferInput, InventoryTransferLineUncheckedCreateWithoutTransferInput> | InventoryTransferLineCreateWithoutTransferInput[] | InventoryTransferLineUncheckedCreateWithoutTransferInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutTransferInput | InventoryTransferLineCreateOrConnectWithoutTransferInput[]
    createMany?: InventoryTransferLineCreateManyTransferInputEnvelope
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
  }

  export type InventoryTransferLineUncheckedCreateNestedManyWithoutTransferInput = {
    create?: XOR<InventoryTransferLineCreateWithoutTransferInput, InventoryTransferLineUncheckedCreateWithoutTransferInput> | InventoryTransferLineCreateWithoutTransferInput[] | InventoryTransferLineUncheckedCreateWithoutTransferInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutTransferInput | InventoryTransferLineCreateOrConnectWithoutTransferInput[]
    createMany?: InventoryTransferLineCreateManyTransferInputEnvelope
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
  }

  export type WarehouseUpdateOneRequiredWithoutTransfersFromNestedInput = {
    create?: XOR<WarehouseCreateWithoutTransfersFromInput, WarehouseUncheckedCreateWithoutTransfersFromInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutTransfersFromInput
    upsert?: WarehouseUpsertWithoutTransfersFromInput
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutTransfersFromInput, WarehouseUpdateWithoutTransfersFromInput>, WarehouseUncheckedUpdateWithoutTransfersFromInput>
  }

  export type WarehouseUpdateOneRequiredWithoutTransfersToNestedInput = {
    create?: XOR<WarehouseCreateWithoutTransfersToInput, WarehouseUncheckedCreateWithoutTransfersToInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutTransfersToInput
    upsert?: WarehouseUpsertWithoutTransfersToInput
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutTransfersToInput, WarehouseUpdateWithoutTransfersToInput>, WarehouseUncheckedUpdateWithoutTransfersToInput>
  }

  export type BranchUpdateOneWithoutTransfersNestedInput = {
    create?: XOR<BranchCreateWithoutTransfersInput, BranchUncheckedCreateWithoutTransfersInput>
    connectOrCreate?: BranchCreateOrConnectWithoutTransfersInput
    upsert?: BranchUpsertWithoutTransfersInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutTransfersInput, BranchUpdateWithoutTransfersInput>, BranchUncheckedUpdateWithoutTransfersInput>
  }

  export type InventoryTransferLineUpdateManyWithoutTransferNestedInput = {
    create?: XOR<InventoryTransferLineCreateWithoutTransferInput, InventoryTransferLineUncheckedCreateWithoutTransferInput> | InventoryTransferLineCreateWithoutTransferInput[] | InventoryTransferLineUncheckedCreateWithoutTransferInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutTransferInput | InventoryTransferLineCreateOrConnectWithoutTransferInput[]
    upsert?: InventoryTransferLineUpsertWithWhereUniqueWithoutTransferInput | InventoryTransferLineUpsertWithWhereUniqueWithoutTransferInput[]
    createMany?: InventoryTransferLineCreateManyTransferInputEnvelope
    set?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    disconnect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    delete?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    update?: InventoryTransferLineUpdateWithWhereUniqueWithoutTransferInput | InventoryTransferLineUpdateWithWhereUniqueWithoutTransferInput[]
    updateMany?: InventoryTransferLineUpdateManyWithWhereWithoutTransferInput | InventoryTransferLineUpdateManyWithWhereWithoutTransferInput[]
    deleteMany?: InventoryTransferLineScalarWhereInput | InventoryTransferLineScalarWhereInput[]
  }

  export type InventoryTransferLineUncheckedUpdateManyWithoutTransferNestedInput = {
    create?: XOR<InventoryTransferLineCreateWithoutTransferInput, InventoryTransferLineUncheckedCreateWithoutTransferInput> | InventoryTransferLineCreateWithoutTransferInput[] | InventoryTransferLineUncheckedCreateWithoutTransferInput[]
    connectOrCreate?: InventoryTransferLineCreateOrConnectWithoutTransferInput | InventoryTransferLineCreateOrConnectWithoutTransferInput[]
    upsert?: InventoryTransferLineUpsertWithWhereUniqueWithoutTransferInput | InventoryTransferLineUpsertWithWhereUniqueWithoutTransferInput[]
    createMany?: InventoryTransferLineCreateManyTransferInputEnvelope
    set?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    disconnect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    delete?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    connect?: InventoryTransferLineWhereUniqueInput | InventoryTransferLineWhereUniqueInput[]
    update?: InventoryTransferLineUpdateWithWhereUniqueWithoutTransferInput | InventoryTransferLineUpdateWithWhereUniqueWithoutTransferInput[]
    updateMany?: InventoryTransferLineUpdateManyWithWhereWithoutTransferInput | InventoryTransferLineUpdateManyWithWhereWithoutTransferInput[]
    deleteMany?: InventoryTransferLineScalarWhereInput | InventoryTransferLineScalarWhereInput[]
  }

  export type InventoryTransferCreateNestedOneWithoutLinesInput = {
    create?: XOR<InventoryTransferCreateWithoutLinesInput, InventoryTransferUncheckedCreateWithoutLinesInput>
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutLinesInput
    connect?: InventoryTransferWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutTransferLinesInput = {
    create?: XOR<ProductCreateWithoutTransferLinesInput, ProductUncheckedCreateWithoutTransferLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutTransferLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type InventoryTransferUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<InventoryTransferCreateWithoutLinesInput, InventoryTransferUncheckedCreateWithoutLinesInput>
    connectOrCreate?: InventoryTransferCreateOrConnectWithoutLinesInput
    upsert?: InventoryTransferUpsertWithoutLinesInput
    connect?: InventoryTransferWhereUniqueInput
    update?: XOR<XOR<InventoryTransferUpdateToOneWithWhereWithoutLinesInput, InventoryTransferUpdateWithoutLinesInput>, InventoryTransferUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutTransferLinesNestedInput = {
    create?: XOR<ProductCreateWithoutTransferLinesInput, ProductUncheckedCreateWithoutTransferLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutTransferLinesInput
    upsert?: ProductUpsertWithoutTransferLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutTransferLinesInput, ProductUpdateWithoutTransferLinesInput>, ProductUncheckedUpdateWithoutTransferLinesInput>
  }

  export type CustomerCreateNestedOneWithoutInvoicesInput = {
    create?: XOR<CustomerCreateWithoutInvoicesInput, CustomerUncheckedCreateWithoutInvoicesInput>
    connectOrCreate?: CustomerCreateOrConnectWithoutInvoicesInput
    connect?: CustomerWhereUniqueInput
  }

  export type SaleCreateNestedOneWithoutInvoicesInput = {
    create?: XOR<SaleCreateWithoutInvoicesInput, SaleUncheckedCreateWithoutInvoicesInput>
    connectOrCreate?: SaleCreateOrConnectWithoutInvoicesInput
    connect?: SaleWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutInvoicesInput = {
    create?: XOR<BranchCreateWithoutInvoicesInput, BranchUncheckedCreateWithoutInvoicesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutInvoicesInput
    connect?: BranchWhereUniqueInput
  }

  export type InvoiceLineCreateNestedManyWithoutInvoiceInput = {
    create?: XOR<InvoiceLineCreateWithoutInvoiceInput, InvoiceLineUncheckedCreateWithoutInvoiceInput> | InvoiceLineCreateWithoutInvoiceInput[] | InvoiceLineUncheckedCreateWithoutInvoiceInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutInvoiceInput | InvoiceLineCreateOrConnectWithoutInvoiceInput[]
    createMany?: InvoiceLineCreateManyInvoiceInputEnvelope
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
  }

  export type InvoiceLineUncheckedCreateNestedManyWithoutInvoiceInput = {
    create?: XOR<InvoiceLineCreateWithoutInvoiceInput, InvoiceLineUncheckedCreateWithoutInvoiceInput> | InvoiceLineCreateWithoutInvoiceInput[] | InvoiceLineUncheckedCreateWithoutInvoiceInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutInvoiceInput | InvoiceLineCreateOrConnectWithoutInvoiceInput[]
    createMany?: InvoiceLineCreateManyInvoiceInputEnvelope
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
  }

  export type CustomerUpdateOneWithoutInvoicesNestedInput = {
    create?: XOR<CustomerCreateWithoutInvoicesInput, CustomerUncheckedCreateWithoutInvoicesInput>
    connectOrCreate?: CustomerCreateOrConnectWithoutInvoicesInput
    upsert?: CustomerUpsertWithoutInvoicesInput
    disconnect?: CustomerWhereInput | boolean
    delete?: CustomerWhereInput | boolean
    connect?: CustomerWhereUniqueInput
    update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutInvoicesInput, CustomerUpdateWithoutInvoicesInput>, CustomerUncheckedUpdateWithoutInvoicesInput>
  }

  export type SaleUpdateOneWithoutInvoicesNestedInput = {
    create?: XOR<SaleCreateWithoutInvoicesInput, SaleUncheckedCreateWithoutInvoicesInput>
    connectOrCreate?: SaleCreateOrConnectWithoutInvoicesInput
    upsert?: SaleUpsertWithoutInvoicesInput
    disconnect?: SaleWhereInput | boolean
    delete?: SaleWhereInput | boolean
    connect?: SaleWhereUniqueInput
    update?: XOR<XOR<SaleUpdateToOneWithWhereWithoutInvoicesInput, SaleUpdateWithoutInvoicesInput>, SaleUncheckedUpdateWithoutInvoicesInput>
  }

  export type BranchUpdateOneWithoutInvoicesNestedInput = {
    create?: XOR<BranchCreateWithoutInvoicesInput, BranchUncheckedCreateWithoutInvoicesInput>
    connectOrCreate?: BranchCreateOrConnectWithoutInvoicesInput
    upsert?: BranchUpsertWithoutInvoicesInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutInvoicesInput, BranchUpdateWithoutInvoicesInput>, BranchUncheckedUpdateWithoutInvoicesInput>
  }

  export type InvoiceLineUpdateManyWithoutInvoiceNestedInput = {
    create?: XOR<InvoiceLineCreateWithoutInvoiceInput, InvoiceLineUncheckedCreateWithoutInvoiceInput> | InvoiceLineCreateWithoutInvoiceInput[] | InvoiceLineUncheckedCreateWithoutInvoiceInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutInvoiceInput | InvoiceLineCreateOrConnectWithoutInvoiceInput[]
    upsert?: InvoiceLineUpsertWithWhereUniqueWithoutInvoiceInput | InvoiceLineUpsertWithWhereUniqueWithoutInvoiceInput[]
    createMany?: InvoiceLineCreateManyInvoiceInputEnvelope
    set?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    disconnect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    delete?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    update?: InvoiceLineUpdateWithWhereUniqueWithoutInvoiceInput | InvoiceLineUpdateWithWhereUniqueWithoutInvoiceInput[]
    updateMany?: InvoiceLineUpdateManyWithWhereWithoutInvoiceInput | InvoiceLineUpdateManyWithWhereWithoutInvoiceInput[]
    deleteMany?: InvoiceLineScalarWhereInput | InvoiceLineScalarWhereInput[]
  }

  export type InvoiceLineUncheckedUpdateManyWithoutInvoiceNestedInput = {
    create?: XOR<InvoiceLineCreateWithoutInvoiceInput, InvoiceLineUncheckedCreateWithoutInvoiceInput> | InvoiceLineCreateWithoutInvoiceInput[] | InvoiceLineUncheckedCreateWithoutInvoiceInput[]
    connectOrCreate?: InvoiceLineCreateOrConnectWithoutInvoiceInput | InvoiceLineCreateOrConnectWithoutInvoiceInput[]
    upsert?: InvoiceLineUpsertWithWhereUniqueWithoutInvoiceInput | InvoiceLineUpsertWithWhereUniqueWithoutInvoiceInput[]
    createMany?: InvoiceLineCreateManyInvoiceInputEnvelope
    set?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    disconnect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    delete?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    connect?: InvoiceLineWhereUniqueInput | InvoiceLineWhereUniqueInput[]
    update?: InvoiceLineUpdateWithWhereUniqueWithoutInvoiceInput | InvoiceLineUpdateWithWhereUniqueWithoutInvoiceInput[]
    updateMany?: InvoiceLineUpdateManyWithWhereWithoutInvoiceInput | InvoiceLineUpdateManyWithWhereWithoutInvoiceInput[]
    deleteMany?: InvoiceLineScalarWhereInput | InvoiceLineScalarWhereInput[]
  }

  export type InvoiceCreateNestedOneWithoutLinesInput = {
    create?: XOR<InvoiceCreateWithoutLinesInput, InvoiceUncheckedCreateWithoutLinesInput>
    connectOrCreate?: InvoiceCreateOrConnectWithoutLinesInput
    connect?: InvoiceWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutInvoiceLinesInput = {
    create?: XOR<ProductCreateWithoutInvoiceLinesInput, ProductUncheckedCreateWithoutInvoiceLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutInvoiceLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type InvoiceUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<InvoiceCreateWithoutLinesInput, InvoiceUncheckedCreateWithoutLinesInput>
    connectOrCreate?: InvoiceCreateOrConnectWithoutLinesInput
    upsert?: InvoiceUpsertWithoutLinesInput
    connect?: InvoiceWhereUniqueInput
    update?: XOR<XOR<InvoiceUpdateToOneWithWhereWithoutLinesInput, InvoiceUpdateWithoutLinesInput>, InvoiceUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutInvoiceLinesNestedInput = {
    create?: XOR<ProductCreateWithoutInvoiceLinesInput, ProductUncheckedCreateWithoutInvoiceLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutInvoiceLinesInput
    upsert?: ProductUpsertWithoutInvoiceLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutInvoiceLinesInput, ProductUpdateWithoutInvoiceLinesInput>, ProductUncheckedUpdateWithoutInvoiceLinesInput>
  }

  export type WarehouseCreateNestedOneWithoutAdjustmentsInput = {
    create?: XOR<WarehouseCreateWithoutAdjustmentsInput, WarehouseUncheckedCreateWithoutAdjustmentsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutAdjustmentsInput
    connect?: WarehouseWhereUniqueInput
  }

  export type BranchCreateNestedOneWithoutAdjustmentsInput = {
    create?: XOR<BranchCreateWithoutAdjustmentsInput, BranchUncheckedCreateWithoutAdjustmentsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutAdjustmentsInput
    connect?: BranchWhereUniqueInput
  }

  export type InventoryAdjustmentLineCreateNestedManyWithoutAdjustmentInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput> | InventoryAdjustmentLineCreateWithoutAdjustmentInput[] | InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput | InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput[]
    createMany?: InventoryAdjustmentLineCreateManyAdjustmentInputEnvelope
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
  }

  export type InventoryAdjustmentLineUncheckedCreateNestedManyWithoutAdjustmentInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput> | InventoryAdjustmentLineCreateWithoutAdjustmentInput[] | InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput | InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput[]
    createMany?: InventoryAdjustmentLineCreateManyAdjustmentInputEnvelope
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
  }

  export type WarehouseUpdateOneRequiredWithoutAdjustmentsNestedInput = {
    create?: XOR<WarehouseCreateWithoutAdjustmentsInput, WarehouseUncheckedCreateWithoutAdjustmentsInput>
    connectOrCreate?: WarehouseCreateOrConnectWithoutAdjustmentsInput
    upsert?: WarehouseUpsertWithoutAdjustmentsInput
    connect?: WarehouseWhereUniqueInput
    update?: XOR<XOR<WarehouseUpdateToOneWithWhereWithoutAdjustmentsInput, WarehouseUpdateWithoutAdjustmentsInput>, WarehouseUncheckedUpdateWithoutAdjustmentsInput>
  }

  export type BranchUpdateOneWithoutAdjustmentsNestedInput = {
    create?: XOR<BranchCreateWithoutAdjustmentsInput, BranchUncheckedCreateWithoutAdjustmentsInput>
    connectOrCreate?: BranchCreateOrConnectWithoutAdjustmentsInput
    upsert?: BranchUpsertWithoutAdjustmentsInput
    disconnect?: BranchWhereInput | boolean
    delete?: BranchWhereInput | boolean
    connect?: BranchWhereUniqueInput
    update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutAdjustmentsInput, BranchUpdateWithoutAdjustmentsInput>, BranchUncheckedUpdateWithoutAdjustmentsInput>
  }

  export type InventoryAdjustmentLineUpdateManyWithoutAdjustmentNestedInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput> | InventoryAdjustmentLineCreateWithoutAdjustmentInput[] | InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput | InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput[]
    upsert?: InventoryAdjustmentLineUpsertWithWhereUniqueWithoutAdjustmentInput | InventoryAdjustmentLineUpsertWithWhereUniqueWithoutAdjustmentInput[]
    createMany?: InventoryAdjustmentLineCreateManyAdjustmentInputEnvelope
    set?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    disconnect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    delete?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    update?: InventoryAdjustmentLineUpdateWithWhereUniqueWithoutAdjustmentInput | InventoryAdjustmentLineUpdateWithWhereUniqueWithoutAdjustmentInput[]
    updateMany?: InventoryAdjustmentLineUpdateManyWithWhereWithoutAdjustmentInput | InventoryAdjustmentLineUpdateManyWithWhereWithoutAdjustmentInput[]
    deleteMany?: InventoryAdjustmentLineScalarWhereInput | InventoryAdjustmentLineScalarWhereInput[]
  }

  export type InventoryAdjustmentLineUncheckedUpdateManyWithoutAdjustmentNestedInput = {
    create?: XOR<InventoryAdjustmentLineCreateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput> | InventoryAdjustmentLineCreateWithoutAdjustmentInput[] | InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput[]
    connectOrCreate?: InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput | InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput[]
    upsert?: InventoryAdjustmentLineUpsertWithWhereUniqueWithoutAdjustmentInput | InventoryAdjustmentLineUpsertWithWhereUniqueWithoutAdjustmentInput[]
    createMany?: InventoryAdjustmentLineCreateManyAdjustmentInputEnvelope
    set?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    disconnect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    delete?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    connect?: InventoryAdjustmentLineWhereUniqueInput | InventoryAdjustmentLineWhereUniqueInput[]
    update?: InventoryAdjustmentLineUpdateWithWhereUniqueWithoutAdjustmentInput | InventoryAdjustmentLineUpdateWithWhereUniqueWithoutAdjustmentInput[]
    updateMany?: InventoryAdjustmentLineUpdateManyWithWhereWithoutAdjustmentInput | InventoryAdjustmentLineUpdateManyWithWhereWithoutAdjustmentInput[]
    deleteMany?: InventoryAdjustmentLineScalarWhereInput | InventoryAdjustmentLineScalarWhereInput[]
  }

  export type InventoryAdjustmentCreateNestedOneWithoutLinesInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutLinesInput, InventoryAdjustmentUncheckedCreateWithoutLinesInput>
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutLinesInput
    connect?: InventoryAdjustmentWhereUniqueInput
  }

  export type ProductCreateNestedOneWithoutAdjustmentLinesInput = {
    create?: XOR<ProductCreateWithoutAdjustmentLinesInput, ProductUncheckedCreateWithoutAdjustmentLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutAdjustmentLinesInput
    connect?: ProductWhereUniqueInput
  }

  export type InventoryAdjustmentUpdateOneRequiredWithoutLinesNestedInput = {
    create?: XOR<InventoryAdjustmentCreateWithoutLinesInput, InventoryAdjustmentUncheckedCreateWithoutLinesInput>
    connectOrCreate?: InventoryAdjustmentCreateOrConnectWithoutLinesInput
    upsert?: InventoryAdjustmentUpsertWithoutLinesInput
    connect?: InventoryAdjustmentWhereUniqueInput
    update?: XOR<XOR<InventoryAdjustmentUpdateToOneWithWhereWithoutLinesInput, InventoryAdjustmentUpdateWithoutLinesInput>, InventoryAdjustmentUncheckedUpdateWithoutLinesInput>
  }

  export type ProductUpdateOneRequiredWithoutAdjustmentLinesNestedInput = {
    create?: XOR<ProductCreateWithoutAdjustmentLinesInput, ProductUncheckedCreateWithoutAdjustmentLinesInput>
    connectOrCreate?: ProductCreateOrConnectWithoutAdjustmentLinesInput
    upsert?: ProductUpsertWithoutAdjustmentLinesInput
    connect?: ProductWhereUniqueInput
    update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutAdjustmentLinesInput, ProductUpdateWithoutAdjustmentLinesInput>, ProductUncheckedUpdateWithoutAdjustmentLinesInput>
  }

  export type UserCreateNestedOneWithoutNotificationsInput = {
    create?: XOR<UserCreateWithoutNotificationsInput, UserUncheckedCreateWithoutNotificationsInput>
    connectOrCreate?: UserCreateOrConnectWithoutNotificationsInput
    connect?: UserWhereUniqueInput
  }

  export type UserUpdateOneRequiredWithoutNotificationsNestedInput = {
    create?: XOR<UserCreateWithoutNotificationsInput, UserUncheckedCreateWithoutNotificationsInput>
    connectOrCreate?: UserCreateOrConnectWithoutNotificationsInput
    upsert?: UserUpsertWithoutNotificationsInput
    connect?: UserWhereUniqueInput
    update?: XOR<XOR<UserUpdateToOneWithWhereWithoutNotificationsInput, UserUpdateWithoutNotificationsInput>, UserUncheckedUpdateWithoutNotificationsInput>
  }

  export type UserCreateNestedOneWithoutActivityLogsInput = {
    create?: XOR<UserCreateWithoutActivityLogsInput, UserUncheckedCreateWithoutActivityLogsInput>
    connectOrCreate?: UserCreateOrConnectWithoutActivityLogsInput
    connect?: UserWhereUniqueInput
  }

  export type UserUpdateOneWithoutActivityLogsNestedInput = {
    create?: XOR<UserCreateWithoutActivityLogsInput, UserUncheckedCreateWithoutActivityLogsInput>
    connectOrCreate?: UserCreateOrConnectWithoutActivityLogsInput
    upsert?: UserUpsertWithoutActivityLogsInput
    disconnect?: UserWhereInput | boolean
    delete?: UserWhereInput | boolean
    connect?: UserWhereUniqueInput
    update?: XOR<XOR<UserUpdateToOneWithWhereWithoutActivityLogsInput, UserUpdateWithoutActivityLogsInput>, UserUncheckedUpdateWithoutActivityLogsInput>
  }

  export type NestedIntFilter<$PrismaModel = never> = {
    equals?: number | IntFieldRefInput<$PrismaModel>
    in?: number[] | ListIntFieldRefInput<$PrismaModel>
    notIn?: number[] | ListIntFieldRefInput<$PrismaModel>
    lt?: number | IntFieldRefInput<$PrismaModel>
    lte?: number | IntFieldRefInput<$PrismaModel>
    gt?: number | IntFieldRefInput<$PrismaModel>
    gte?: number | IntFieldRefInput<$PrismaModel>
    not?: NestedIntFilter<$PrismaModel> | number
  }

  export type NestedDateTimeFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeFilter<$PrismaModel> | Date | string
  }

  export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
    equals?: number | IntFieldRefInput<$PrismaModel>
    in?: number[] | ListIntFieldRefInput<$PrismaModel>
    notIn?: number[] | ListIntFieldRefInput<$PrismaModel>
    lt?: number | IntFieldRefInput<$PrismaModel>
    lte?: number | IntFieldRefInput<$PrismaModel>
    gt?: number | IntFieldRefInput<$PrismaModel>
    gte?: number | IntFieldRefInput<$PrismaModel>
    not?: NestedIntWithAggregatesFilter<$PrismaModel> | number
    _count?: NestedIntFilter<$PrismaModel>
    _avg?: NestedFloatFilter<$PrismaModel>
    _sum?: NestedIntFilter<$PrismaModel>
    _min?: NestedIntFilter<$PrismaModel>
    _max?: NestedIntFilter<$PrismaModel>
  }

  export type NestedFloatFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel>
    in?: number[] | ListFloatFieldRefInput<$PrismaModel>
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel>
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatFilter<$PrismaModel> | number
  }

  export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel>
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string
    _count?: NestedIntFilter<$PrismaModel>
    _min?: NestedDateTimeFilter<$PrismaModel>
    _max?: NestedDateTimeFilter<$PrismaModel>
  }

  export type NestedStringFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel>
    in?: string[] | ListStringFieldRefInput<$PrismaModel>
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel>
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    not?: NestedStringFilter<$PrismaModel> | string
  }

  export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel>
    in?: string[] | ListStringFieldRefInput<$PrismaModel>
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel>
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    not?: NestedStringWithAggregatesFilter<$PrismaModel> | string
    _count?: NestedIntFilter<$PrismaModel>
    _min?: NestedStringFilter<$PrismaModel>
    _max?: NestedStringFilter<$PrismaModel>
  }

  export type NestedStringNullableFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel> | null
    in?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    not?: NestedStringNullableFilter<$PrismaModel> | string | null
  }

  export type NestedBoolFilter<$PrismaModel = never> = {
    equals?: boolean | BooleanFieldRefInput<$PrismaModel>
    not?: NestedBoolFilter<$PrismaModel> | boolean
  }

  export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null
  }

  export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
    equals?: string | StringFieldRefInput<$PrismaModel> | null
    in?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null
    lt?: string | StringFieldRefInput<$PrismaModel>
    lte?: string | StringFieldRefInput<$PrismaModel>
    gt?: string | StringFieldRefInput<$PrismaModel>
    gte?: string | StringFieldRefInput<$PrismaModel>
    contains?: string | StringFieldRefInput<$PrismaModel>
    startsWith?: string | StringFieldRefInput<$PrismaModel>
    endsWith?: string | StringFieldRefInput<$PrismaModel>
    not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null
    _count?: NestedIntNullableFilter<$PrismaModel>
    _min?: NestedStringNullableFilter<$PrismaModel>
    _max?: NestedStringNullableFilter<$PrismaModel>
  }

  export type NestedIntNullableFilter<$PrismaModel = never> = {
    equals?: number | IntFieldRefInput<$PrismaModel> | null
    in?: number[] | ListIntFieldRefInput<$PrismaModel> | null
    notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null
    lt?: number | IntFieldRefInput<$PrismaModel>
    lte?: number | IntFieldRefInput<$PrismaModel>
    gt?: number | IntFieldRefInput<$PrismaModel>
    gte?: number | IntFieldRefInput<$PrismaModel>
    not?: NestedIntNullableFilter<$PrismaModel> | number | null
  }

  export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
    equals?: boolean | BooleanFieldRefInput<$PrismaModel>
    not?: NestedBoolWithAggregatesFilter<$PrismaModel> | boolean
    _count?: NestedIntFilter<$PrismaModel>
    _min?: NestedBoolFilter<$PrismaModel>
    _max?: NestedBoolFilter<$PrismaModel>
  }

  export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
    equals?: Date | string | DateTimeFieldRefInput<$PrismaModel> | null
    in?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    notIn?: Date[] | string[] | ListDateTimeFieldRefInput<$PrismaModel> | null
    lt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    lte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gt?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    gte?: Date | string | DateTimeFieldRefInput<$PrismaModel>
    not?: NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null
    _count?: NestedIntNullableFilter<$PrismaModel>
    _min?: NestedDateTimeNullableFilter<$PrismaModel>
    _max?: NestedDateTimeNullableFilter<$PrismaModel>
  }
  export type NestedJsonNullableFilter<$PrismaModel = never> =
    | PatchUndefined<
        Either<Required<NestedJsonNullableFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>,
        Required<NestedJsonNullableFilterBase<$PrismaModel>>
      >
    | OptionalFlat<Omit<Required<NestedJsonNullableFilterBase<$PrismaModel>>, 'path'>>

  export type NestedJsonNullableFilterBase<$PrismaModel = never> = {
    equals?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter
    path?: string[]
    mode?: QueryMode | EnumQueryModeFieldRefInput<$PrismaModel>
    string_contains?: string | StringFieldRefInput<$PrismaModel>
    string_starts_with?: string | StringFieldRefInput<$PrismaModel>
    string_ends_with?: string | StringFieldRefInput<$PrismaModel>
    array_starts_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    array_ends_with?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    array_contains?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | null
    lt?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    lte?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    gt?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    gte?: InputJsonValue | JsonFieldRefInput<$PrismaModel>
    not?: InputJsonValue | JsonFieldRefInput<$PrismaModel> | JsonNullValueFilter
  }

  export type NestedFloatWithAggregatesFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel>
    in?: number[] | ListFloatFieldRefInput<$PrismaModel>
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel>
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatWithAggregatesFilter<$PrismaModel> | number
    _count?: NestedIntFilter<$PrismaModel>
    _avg?: NestedFloatFilter<$PrismaModel>
    _sum?: NestedFloatFilter<$PrismaModel>
    _min?: NestedFloatFilter<$PrismaModel>
    _max?: NestedFloatFilter<$PrismaModel>
  }

  export type NestedFloatNullableFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel> | null
    in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatNullableFilter<$PrismaModel> | number | null
  }

  export type NestedFloatNullableWithAggregatesFilter<$PrismaModel = never> = {
    equals?: number | FloatFieldRefInput<$PrismaModel> | null
    in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null
    lt?: number | FloatFieldRefInput<$PrismaModel>
    lte?: number | FloatFieldRefInput<$PrismaModel>
    gt?: number | FloatFieldRefInput<$PrismaModel>
    gte?: number | FloatFieldRefInput<$PrismaModel>
    not?: NestedFloatNullableWithAggregatesFilter<$PrismaModel> | number | null
    _count?: NestedIntNullableFilter<$PrismaModel>
    _avg?: NestedFloatNullableFilter<$PrismaModel>
    _sum?: NestedFloatNullableFilter<$PrismaModel>
    _min?: NestedFloatNullableFilter<$PrismaModel>
    _max?: NestedFloatNullableFilter<$PrismaModel>
  }

  export type UserRoleCreateWithoutUserInput = {
    assignedAt?: Date | string
    role: RoleCreateNestedOneWithoutUsersInput
  }

  export type UserRoleUncheckedCreateWithoutUserInput = {
    roleId: string
    assignedAt?: Date | string
  }

  export type UserRoleCreateOrConnectWithoutUserInput = {
    where: UserRoleWhereUniqueInput
    create: XOR<UserRoleCreateWithoutUserInput, UserRoleUncheckedCreateWithoutUserInput>
  }

  export type UserRoleCreateManyUserInputEnvelope = {
    data: UserRoleCreateManyUserInput | UserRoleCreateManyUserInput[]
    skipDuplicates?: boolean
  }

  export type BranchCreateWithoutActiveUsersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutActiveUsersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutActiveUsersInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutActiveUsersInput, BranchUncheckedCreateWithoutActiveUsersInput>
  }

  export type UserBranchCreateWithoutUserInput = {
    assignedAt?: Date | string
    branch: BranchCreateNestedOneWithoutUsersInput
  }

  export type UserBranchUncheckedCreateWithoutUserInput = {
    branchId: string
    assignedAt?: Date | string
  }

  export type UserBranchCreateOrConnectWithoutUserInput = {
    where: UserBranchWhereUniqueInput
    create: XOR<UserBranchCreateWithoutUserInput, UserBranchUncheckedCreateWithoutUserInput>
  }

  export type UserBranchCreateManyUserInputEnvelope = {
    data: UserBranchCreateManyUserInput | UserBranchCreateManyUserInput[]
    skipDuplicates?: boolean
  }

  export type NotificationCreateWithoutUserInput = {
    id?: string
    title: string
    message: string
    type?: string
    link?: string | null
    isRead?: boolean
    createdAt?: Date | string
  }

  export type NotificationUncheckedCreateWithoutUserInput = {
    id?: string
    title: string
    message: string
    type?: string
    link?: string | null
    isRead?: boolean
    createdAt?: Date | string
  }

  export type NotificationCreateOrConnectWithoutUserInput = {
    where: NotificationWhereUniqueInput
    create: XOR<NotificationCreateWithoutUserInput, NotificationUncheckedCreateWithoutUserInput>
  }

  export type NotificationCreateManyUserInputEnvelope = {
    data: NotificationCreateManyUserInput | NotificationCreateManyUserInput[]
    skipDuplicates?: boolean
  }

  export type ActivityLogCreateWithoutUserInput = {
    id?: string
    action: string
    entityType: string
    entityId?: string | null
    summary?: string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
  }

  export type ActivityLogUncheckedCreateWithoutUserInput = {
    id?: string
    action: string
    entityType: string
    entityId?: string | null
    summary?: string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
  }

  export type ActivityLogCreateOrConnectWithoutUserInput = {
    where: ActivityLogWhereUniqueInput
    create: XOR<ActivityLogCreateWithoutUserInput, ActivityLogUncheckedCreateWithoutUserInput>
  }

  export type ActivityLogCreateManyUserInputEnvelope = {
    data: ActivityLogCreateManyUserInput | ActivityLogCreateManyUserInput[]
    skipDuplicates?: boolean
  }

  export type UserRoleUpsertWithWhereUniqueWithoutUserInput = {
    where: UserRoleWhereUniqueInput
    update: XOR<UserRoleUpdateWithoutUserInput, UserRoleUncheckedUpdateWithoutUserInput>
    create: XOR<UserRoleCreateWithoutUserInput, UserRoleUncheckedCreateWithoutUserInput>
  }

  export type UserRoleUpdateWithWhereUniqueWithoutUserInput = {
    where: UserRoleWhereUniqueInput
    data: XOR<UserRoleUpdateWithoutUserInput, UserRoleUncheckedUpdateWithoutUserInput>
  }

  export type UserRoleUpdateManyWithWhereWithoutUserInput = {
    where: UserRoleScalarWhereInput
    data: XOR<UserRoleUpdateManyMutationInput, UserRoleUncheckedUpdateManyWithoutUserInput>
  }

  export type UserRoleScalarWhereInput = {
    AND?: UserRoleScalarWhereInput | UserRoleScalarWhereInput[]
    OR?: UserRoleScalarWhereInput[]
    NOT?: UserRoleScalarWhereInput | UserRoleScalarWhereInput[]
    userId?: StringFilter<"UserRole"> | string
    roleId?: StringFilter<"UserRole"> | string
    assignedAt?: DateTimeFilter<"UserRole"> | Date | string
  }

  export type BranchUpsertWithoutActiveUsersInput = {
    update: XOR<BranchUpdateWithoutActiveUsersInput, BranchUncheckedUpdateWithoutActiveUsersInput>
    create: XOR<BranchCreateWithoutActiveUsersInput, BranchUncheckedCreateWithoutActiveUsersInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutActiveUsersInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutActiveUsersInput, BranchUncheckedUpdateWithoutActiveUsersInput>
  }

  export type BranchUpdateWithoutActiveUsersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutActiveUsersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type UserBranchUpsertWithWhereUniqueWithoutUserInput = {
    where: UserBranchWhereUniqueInput
    update: XOR<UserBranchUpdateWithoutUserInput, UserBranchUncheckedUpdateWithoutUserInput>
    create: XOR<UserBranchCreateWithoutUserInput, UserBranchUncheckedCreateWithoutUserInput>
  }

  export type UserBranchUpdateWithWhereUniqueWithoutUserInput = {
    where: UserBranchWhereUniqueInput
    data: XOR<UserBranchUpdateWithoutUserInput, UserBranchUncheckedUpdateWithoutUserInput>
  }

  export type UserBranchUpdateManyWithWhereWithoutUserInput = {
    where: UserBranchScalarWhereInput
    data: XOR<UserBranchUpdateManyMutationInput, UserBranchUncheckedUpdateManyWithoutUserInput>
  }

  export type UserBranchScalarWhereInput = {
    AND?: UserBranchScalarWhereInput | UserBranchScalarWhereInput[]
    OR?: UserBranchScalarWhereInput[]
    NOT?: UserBranchScalarWhereInput | UserBranchScalarWhereInput[]
    userId?: StringFilter<"UserBranch"> | string
    branchId?: StringFilter<"UserBranch"> | string
    assignedAt?: DateTimeFilter<"UserBranch"> | Date | string
  }

  export type NotificationUpsertWithWhereUniqueWithoutUserInput = {
    where: NotificationWhereUniqueInput
    update: XOR<NotificationUpdateWithoutUserInput, NotificationUncheckedUpdateWithoutUserInput>
    create: XOR<NotificationCreateWithoutUserInput, NotificationUncheckedCreateWithoutUserInput>
  }

  export type NotificationUpdateWithWhereUniqueWithoutUserInput = {
    where: NotificationWhereUniqueInput
    data: XOR<NotificationUpdateWithoutUserInput, NotificationUncheckedUpdateWithoutUserInput>
  }

  export type NotificationUpdateManyWithWhereWithoutUserInput = {
    where: NotificationScalarWhereInput
    data: XOR<NotificationUpdateManyMutationInput, NotificationUncheckedUpdateManyWithoutUserInput>
  }

  export type NotificationScalarWhereInput = {
    AND?: NotificationScalarWhereInput | NotificationScalarWhereInput[]
    OR?: NotificationScalarWhereInput[]
    NOT?: NotificationScalarWhereInput | NotificationScalarWhereInput[]
    id?: StringFilter<"Notification"> | string
    userId?: StringFilter<"Notification"> | string
    title?: StringFilter<"Notification"> | string
    message?: StringFilter<"Notification"> | string
    type?: StringFilter<"Notification"> | string
    link?: StringNullableFilter<"Notification"> | string | null
    isRead?: BoolFilter<"Notification"> | boolean
    createdAt?: DateTimeFilter<"Notification"> | Date | string
  }

  export type ActivityLogUpsertWithWhereUniqueWithoutUserInput = {
    where: ActivityLogWhereUniqueInput
    update: XOR<ActivityLogUpdateWithoutUserInput, ActivityLogUncheckedUpdateWithoutUserInput>
    create: XOR<ActivityLogCreateWithoutUserInput, ActivityLogUncheckedCreateWithoutUserInput>
  }

  export type ActivityLogUpdateWithWhereUniqueWithoutUserInput = {
    where: ActivityLogWhereUniqueInput
    data: XOR<ActivityLogUpdateWithoutUserInput, ActivityLogUncheckedUpdateWithoutUserInput>
  }

  export type ActivityLogUpdateManyWithWhereWithoutUserInput = {
    where: ActivityLogScalarWhereInput
    data: XOR<ActivityLogUpdateManyMutationInput, ActivityLogUncheckedUpdateManyWithoutUserInput>
  }

  export type ActivityLogScalarWhereInput = {
    AND?: ActivityLogScalarWhereInput | ActivityLogScalarWhereInput[]
    OR?: ActivityLogScalarWhereInput[]
    NOT?: ActivityLogScalarWhereInput | ActivityLogScalarWhereInput[]
    id?: StringFilter<"ActivityLog"> | string
    userId?: StringNullableFilter<"ActivityLog"> | string | null
    action?: StringFilter<"ActivityLog"> | string
    entityType?: StringFilter<"ActivityLog"> | string
    entityId?: StringNullableFilter<"ActivityLog"> | string | null
    summary?: StringNullableFilter<"ActivityLog"> | string | null
    metadata?: JsonNullableFilter<"ActivityLog">
    createdAt?: DateTimeFilter<"ActivityLog"> | Date | string
  }

  export type UserBranchCreateWithoutBranchInput = {
    assignedAt?: Date | string
    user: UserCreateNestedOneWithoutBranchesInput
  }

  export type UserBranchUncheckedCreateWithoutBranchInput = {
    userId: string
    assignedAt?: Date | string
  }

  export type UserBranchCreateOrConnectWithoutBranchInput = {
    where: UserBranchWhereUniqueInput
    create: XOR<UserBranchCreateWithoutBranchInput, UserBranchUncheckedCreateWithoutBranchInput>
  }

  export type UserBranchCreateManyBranchInputEnvelope = {
    data: UserBranchCreateManyBranchInput | UserBranchCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type UserCreateWithoutActiveBranchInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleCreateNestedManyWithoutUserInput
    branches?: UserBranchCreateNestedManyWithoutUserInput
    notifications?: NotificationCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogCreateNestedManyWithoutUserInput
  }

  export type UserUncheckedCreateWithoutActiveBranchInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleUncheckedCreateNestedManyWithoutUserInput
    branches?: UserBranchUncheckedCreateNestedManyWithoutUserInput
    notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogUncheckedCreateNestedManyWithoutUserInput
  }

  export type UserCreateOrConnectWithoutActiveBranchInput = {
    where: UserWhereUniqueInput
    create: XOR<UserCreateWithoutActiveBranchInput, UserUncheckedCreateWithoutActiveBranchInput>
  }

  export type UserCreateManyActiveBranchInputEnvelope = {
    data: UserCreateManyActiveBranchInput | UserCreateManyActiveBranchInput[]
    skipDuplicates?: boolean
  }

  export type SupplierCreateWithoutBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    purchases?: PurchaseCreateNestedManyWithoutSupplierInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutSupplierInput
  }

  export type SupplierUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    purchases?: PurchaseUncheckedCreateNestedManyWithoutSupplierInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutSupplierInput
  }

  export type SupplierCreateOrConnectWithoutBranchInput = {
    where: SupplierWhereUniqueInput
    create: XOR<SupplierCreateWithoutBranchInput, SupplierUncheckedCreateWithoutBranchInput>
  }

  export type SupplierCreateManyBranchInputEnvelope = {
    data: SupplierCreateManyBranchInput | SupplierCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type CustomerCreateWithoutBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    invoices?: InvoiceCreateNestedManyWithoutCustomerInput
    sales?: SaleCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnCreateNestedManyWithoutCustomerInput
  }

  export type CustomerUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    invoices?: InvoiceUncheckedCreateNestedManyWithoutCustomerInput
    sales?: SaleUncheckedCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutCustomerInput
  }

  export type CustomerCreateOrConnectWithoutBranchInput = {
    where: CustomerWhereUniqueInput
    create: XOR<CustomerCreateWithoutBranchInput, CustomerUncheckedCreateWithoutBranchInput>
  }

  export type CustomerCreateManyBranchInputEnvelope = {
    data: CustomerCreateManyBranchInput | CustomerCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type ProductCreateWithoutBranchInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutBranchInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutBranchInput, ProductUncheckedCreateWithoutBranchInput>
  }

  export type ProductCreateManyBranchInputEnvelope = {
    data: ProductCreateManyBranchInput | ProductCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type SaleCreateWithoutBranchInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutBranchInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutBranchInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutBranchInput, SaleUncheckedCreateWithoutBranchInput>
  }

  export type SaleCreateManyBranchInputEnvelope = {
    data: SaleCreateManyBranchInput | SaleCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type SalesReturnCreateWithoutBranchInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    sale?: SaleCreateNestedOneWithoutReturnsInput
    customer?: CustomerCreateNestedOneWithoutSalesReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesReturnsInput
    lines?: SalesReturnLineCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnUncheckedCreateWithoutBranchInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    warehouseId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: SalesReturnLineUncheckedCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnCreateOrConnectWithoutBranchInput = {
    where: SalesReturnWhereUniqueInput
    create: XOR<SalesReturnCreateWithoutBranchInput, SalesReturnUncheckedCreateWithoutBranchInput>
  }

  export type SalesReturnCreateManyBranchInputEnvelope = {
    data: SalesReturnCreateManyBranchInput | SalesReturnCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseCreateWithoutBranchInput = {
    id?: string
    number: string
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    supplier?: SupplierCreateNestedOneWithoutPurchasesInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchasesInput
    lines?: PurchaseLineCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUncheckedCreateWithoutBranchInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: PurchaseLineUncheckedCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnUncheckedCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseCreateOrConnectWithoutBranchInput = {
    where: PurchaseWhereUniqueInput
    create: XOR<PurchaseCreateWithoutBranchInput, PurchaseUncheckedCreateWithoutBranchInput>
  }

  export type PurchaseCreateManyBranchInputEnvelope = {
    data: PurchaseCreateManyBranchInput | PurchaseCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseReturnCreateWithoutBranchInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    purchase?: PurchaseCreateNestedOneWithoutReturnsInput
    supplier?: SupplierCreateNestedOneWithoutPurchaseReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchaseReturnsInput
    lines?: PurchaseReturnLineCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnUncheckedCreateWithoutBranchInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    warehouseId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnCreateOrConnectWithoutBranchInput = {
    where: PurchaseReturnWhereUniqueInput
    create: XOR<PurchaseReturnCreateWithoutBranchInput, PurchaseReturnUncheckedCreateWithoutBranchInput>
  }

  export type PurchaseReturnCreateManyBranchInputEnvelope = {
    data: PurchaseReturnCreateManyBranchInput | PurchaseReturnCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type InvoiceCreateWithoutBranchInput = {
    id?: string
    number: string
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutInvoicesInput
    sale?: SaleCreateNestedOneWithoutInvoicesInput
    lines?: InvoiceLineCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceUncheckedCreateWithoutBranchInput = {
    id?: string
    number: string
    customerId?: string | null
    saleId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: InvoiceLineUncheckedCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceCreateOrConnectWithoutBranchInput = {
    where: InvoiceWhereUniqueInput
    create: XOR<InvoiceCreateWithoutBranchInput, InvoiceUncheckedCreateWithoutBranchInput>
  }

  export type InvoiceCreateManyBranchInputEnvelope = {
    data: InvoiceCreateManyBranchInput | InvoiceCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type ExpenseCategoryCreateWithoutBranchInput = {
    id?: string
    name: string
    description?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    expenses?: ExpenseCreateNestedManyWithoutCategoryInput
  }

  export type ExpenseCategoryUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    description?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    expenses?: ExpenseUncheckedCreateNestedManyWithoutCategoryInput
  }

  export type ExpenseCategoryCreateOrConnectWithoutBranchInput = {
    where: ExpenseCategoryWhereUniqueInput
    create: XOR<ExpenseCategoryCreateWithoutBranchInput, ExpenseCategoryUncheckedCreateWithoutBranchInput>
  }

  export type ExpenseCategoryCreateManyBranchInputEnvelope = {
    data: ExpenseCategoryCreateManyBranchInput | ExpenseCategoryCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type ExpenseCreateWithoutBranchInput = {
    id?: string
    reference: string
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    category?: ExpenseCategoryCreateNestedOneWithoutExpensesInput
    warehouse?: WarehouseCreateNestedOneWithoutExpensesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutExpensesInput
  }

  export type ExpenseUncheckedCreateWithoutBranchInput = {
    id?: string
    reference: string
    categoryId?: string | null
    warehouseId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCreateOrConnectWithoutBranchInput = {
    where: ExpenseWhereUniqueInput
    create: XOR<ExpenseCreateWithoutBranchInput, ExpenseUncheckedCreateWithoutBranchInput>
  }

  export type ExpenseCreateManyBranchInputEnvelope = {
    data: ExpenseCreateManyBranchInput | ExpenseCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type InventoryAdjustmentCreateWithoutBranchInput = {
    id?: string
    reference?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    warehouse: WarehouseCreateNestedOneWithoutAdjustmentsInput
    lines?: InventoryAdjustmentLineCreateNestedManyWithoutAdjustmentInput
  }

  export type InventoryAdjustmentUncheckedCreateWithoutBranchInput = {
    id?: string
    reference?: string | null
    warehouseId: string
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutAdjustmentInput
  }

  export type InventoryAdjustmentCreateOrConnectWithoutBranchInput = {
    where: InventoryAdjustmentWhereUniqueInput
    create: XOR<InventoryAdjustmentCreateWithoutBranchInput, InventoryAdjustmentUncheckedCreateWithoutBranchInput>
  }

  export type InventoryAdjustmentCreateManyBranchInputEnvelope = {
    data: InventoryAdjustmentCreateManyBranchInput | InventoryAdjustmentCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type InventoryTransferCreateWithoutBranchInput = {
    id?: string
    reference: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    fromWarehouse: WarehouseCreateNestedOneWithoutTransfersFromInput
    toWarehouse: WarehouseCreateNestedOneWithoutTransfersToInput
    lines?: InventoryTransferLineCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferUncheckedCreateWithoutBranchInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    toWarehouseId: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryTransferLineUncheckedCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferCreateOrConnectWithoutBranchInput = {
    where: InventoryTransferWhereUniqueInput
    create: XOR<InventoryTransferCreateWithoutBranchInput, InventoryTransferUncheckedCreateWithoutBranchInput>
  }

  export type InventoryTransferCreateManyBranchInputEnvelope = {
    data: InventoryTransferCreateManyBranchInput | InventoryTransferCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type CategoryCreateWithoutBranchInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    parent?: CategoryCreateNestedOneWithoutChildrenInput
    children?: CategoryCreateNestedManyWithoutParentInput
    products?: ProductCreateNestedManyWithoutCategoryInput
  }

  export type CategoryUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    parentId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    children?: CategoryUncheckedCreateNestedManyWithoutParentInput
    products?: ProductUncheckedCreateNestedManyWithoutCategoryInput
  }

  export type CategoryCreateOrConnectWithoutBranchInput = {
    where: CategoryWhereUniqueInput
    create: XOR<CategoryCreateWithoutBranchInput, CategoryUncheckedCreateWithoutBranchInput>
  }

  export type CategoryCreateManyBranchInputEnvelope = {
    data: CategoryCreateManyBranchInput | CategoryCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type BrandCreateWithoutBranchInput = {
    id?: string
    name: string
    logo?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductCreateNestedManyWithoutBrandInput
  }

  export type BrandUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    logo?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutBrandInput
  }

  export type BrandCreateOrConnectWithoutBranchInput = {
    where: BrandWhereUniqueInput
    create: XOR<BrandCreateWithoutBranchInput, BrandUncheckedCreateWithoutBranchInput>
  }

  export type BrandCreateManyBranchInputEnvelope = {
    data: BrandCreateManyBranchInput | BrandCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type UnitCreateWithoutBranchInput = {
    id?: string
    name: string
    symbol?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductCreateNestedManyWithoutUnitInput
  }

  export type UnitUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    symbol?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutUnitInput
  }

  export type UnitCreateOrConnectWithoutBranchInput = {
    where: UnitWhereUniqueInput
    create: XOR<UnitCreateWithoutBranchInput, UnitUncheckedCreateWithoutBranchInput>
  }

  export type UnitCreateManyBranchInputEnvelope = {
    data: UnitCreateManyBranchInput | UnitCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type VariationCreateWithoutBranchInput = {
    id?: string
    name: string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type VariationUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type VariationCreateOrConnectWithoutBranchInput = {
    where: VariationWhereUniqueInput
    create: XOR<VariationCreateWithoutBranchInput, VariationUncheckedCreateWithoutBranchInput>
  }

  export type VariationCreateManyBranchInputEnvelope = {
    data: VariationCreateManyBranchInput | VariationCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type TaxCreateWithoutBranchInput = {
    id?: string
    name: string
    rate?: number
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    productsSales?: ProductCreateNestedManyWithoutSalesTaxInput
    productsPurchase?: ProductCreateNestedManyWithoutPurchaseTaxInput
  }

  export type TaxUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    rate?: number
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    productsSales?: ProductUncheckedCreateNestedManyWithoutSalesTaxInput
    productsPurchase?: ProductUncheckedCreateNestedManyWithoutPurchaseTaxInput
  }

  export type TaxCreateOrConnectWithoutBranchInput = {
    where: TaxWhereUniqueInput
    create: XOR<TaxCreateWithoutBranchInput, TaxUncheckedCreateWithoutBranchInput>
  }

  export type TaxCreateManyBranchInputEnvelope = {
    data: TaxCreateManyBranchInput | TaxCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type WarehouseCreateWithoutBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutBranchInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutBranchInput, WarehouseUncheckedCreateWithoutBranchInput>
  }

  export type WarehouseCreateManyBranchInputEnvelope = {
    data: WarehouseCreateManyBranchInput | WarehouseCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type PaymentMethodCreateWithoutBranchInput = {
    id?: string
    name: string
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    sales?: SaleCreateNestedManyWithoutPaymentMethodInput
    expenses?: ExpenseCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodUncheckedCreateWithoutBranchInput = {
    id?: string
    name: string
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    sales?: SaleUncheckedCreateNestedManyWithoutPaymentMethodInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodCreateOrConnectWithoutBranchInput = {
    where: PaymentMethodWhereUniqueInput
    create: XOR<PaymentMethodCreateWithoutBranchInput, PaymentMethodUncheckedCreateWithoutBranchInput>
  }

  export type PaymentMethodCreateManyBranchInputEnvelope = {
    data: PaymentMethodCreateManyBranchInput | PaymentMethodCreateManyBranchInput[]
    skipDuplicates?: boolean
  }

  export type UserBranchUpsertWithWhereUniqueWithoutBranchInput = {
    where: UserBranchWhereUniqueInput
    update: XOR<UserBranchUpdateWithoutBranchInput, UserBranchUncheckedUpdateWithoutBranchInput>
    create: XOR<UserBranchCreateWithoutBranchInput, UserBranchUncheckedCreateWithoutBranchInput>
  }

  export type UserBranchUpdateWithWhereUniqueWithoutBranchInput = {
    where: UserBranchWhereUniqueInput
    data: XOR<UserBranchUpdateWithoutBranchInput, UserBranchUncheckedUpdateWithoutBranchInput>
  }

  export type UserBranchUpdateManyWithWhereWithoutBranchInput = {
    where: UserBranchScalarWhereInput
    data: XOR<UserBranchUpdateManyMutationInput, UserBranchUncheckedUpdateManyWithoutBranchInput>
  }

  export type UserUpsertWithWhereUniqueWithoutActiveBranchInput = {
    where: UserWhereUniqueInput
    update: XOR<UserUpdateWithoutActiveBranchInput, UserUncheckedUpdateWithoutActiveBranchInput>
    create: XOR<UserCreateWithoutActiveBranchInput, UserUncheckedCreateWithoutActiveBranchInput>
  }

  export type UserUpdateWithWhereUniqueWithoutActiveBranchInput = {
    where: UserWhereUniqueInput
    data: XOR<UserUpdateWithoutActiveBranchInput, UserUncheckedUpdateWithoutActiveBranchInput>
  }

  export type UserUpdateManyWithWhereWithoutActiveBranchInput = {
    where: UserScalarWhereInput
    data: XOR<UserUpdateManyMutationInput, UserUncheckedUpdateManyWithoutActiveBranchInput>
  }

  export type UserScalarWhereInput = {
    AND?: UserScalarWhereInput | UserScalarWhereInput[]
    OR?: UserScalarWhereInput[]
    NOT?: UserScalarWhereInput | UserScalarWhereInput[]
    id?: StringFilter<"User"> | string
    email?: StringFilter<"User"> | string
    username?: StringNullableFilter<"User"> | string | null
    fullName?: StringFilter<"User"> | string
    passwordHash?: StringFilter<"User"> | string
    isVerified?: BoolFilter<"User"> | boolean
    isApproved?: BoolFilter<"User"> | boolean
    verificationToken?: StringNullableFilter<"User"> | string | null
    verificationTokenExpiry?: DateTimeNullableFilter<"User"> | Date | string | null
    passwordResetToken?: StringNullableFilter<"User"> | string | null
    passwordResetTokenExpiry?: DateTimeNullableFilter<"User"> | Date | string | null
    activeBranchId?: StringNullableFilter<"User"> | string | null
    createdAt?: DateTimeFilter<"User"> | Date | string
    updatedAt?: DateTimeFilter<"User"> | Date | string
    deletedAt?: DateTimeNullableFilter<"User"> | Date | string | null
  }

  export type SupplierUpsertWithWhereUniqueWithoutBranchInput = {
    where: SupplierWhereUniqueInput
    update: XOR<SupplierUpdateWithoutBranchInput, SupplierUncheckedUpdateWithoutBranchInput>
    create: XOR<SupplierCreateWithoutBranchInput, SupplierUncheckedCreateWithoutBranchInput>
  }

  export type SupplierUpdateWithWhereUniqueWithoutBranchInput = {
    where: SupplierWhereUniqueInput
    data: XOR<SupplierUpdateWithoutBranchInput, SupplierUncheckedUpdateWithoutBranchInput>
  }

  export type SupplierUpdateManyWithWhereWithoutBranchInput = {
    where: SupplierScalarWhereInput
    data: XOR<SupplierUpdateManyMutationInput, SupplierUncheckedUpdateManyWithoutBranchInput>
  }

  export type SupplierScalarWhereInput = {
    AND?: SupplierScalarWhereInput | SupplierScalarWhereInput[]
    OR?: SupplierScalarWhereInput[]
    NOT?: SupplierScalarWhereInput | SupplierScalarWhereInput[]
    id?: StringFilter<"Supplier"> | string
    name?: StringFilter<"Supplier"> | string
    email?: StringNullableFilter<"Supplier"> | string | null
    phone?: StringNullableFilter<"Supplier"> | string | null
    country?: StringNullableFilter<"Supplier"> | string | null
    city?: StringNullableFilter<"Supplier"> | string | null
    zipCode?: StringNullableFilter<"Supplier"> | string | null
    branchId?: StringNullableFilter<"Supplier"> | string | null
    sortOrder?: IntFilter<"Supplier"> | number
    isActive?: BoolFilter<"Supplier"> | boolean
    createdAt?: DateTimeFilter<"Supplier"> | Date | string
    updatedAt?: DateTimeFilter<"Supplier"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Supplier"> | Date | string | null
  }

  export type CustomerUpsertWithWhereUniqueWithoutBranchInput = {
    where: CustomerWhereUniqueInput
    update: XOR<CustomerUpdateWithoutBranchInput, CustomerUncheckedUpdateWithoutBranchInput>
    create: XOR<CustomerCreateWithoutBranchInput, CustomerUncheckedCreateWithoutBranchInput>
  }

  export type CustomerUpdateWithWhereUniqueWithoutBranchInput = {
    where: CustomerWhereUniqueInput
    data: XOR<CustomerUpdateWithoutBranchInput, CustomerUncheckedUpdateWithoutBranchInput>
  }

  export type CustomerUpdateManyWithWhereWithoutBranchInput = {
    where: CustomerScalarWhereInput
    data: XOR<CustomerUpdateManyMutationInput, CustomerUncheckedUpdateManyWithoutBranchInput>
  }

  export type CustomerScalarWhereInput = {
    AND?: CustomerScalarWhereInput | CustomerScalarWhereInput[]
    OR?: CustomerScalarWhereInput[]
    NOT?: CustomerScalarWhereInput | CustomerScalarWhereInput[]
    id?: StringFilter<"Customer"> | string
    name?: StringFilter<"Customer"> | string
    email?: StringNullableFilter<"Customer"> | string | null
    phone?: StringNullableFilter<"Customer"> | string | null
    country?: StringNullableFilter<"Customer"> | string | null
    city?: StringNullableFilter<"Customer"> | string | null
    zipCode?: StringNullableFilter<"Customer"> | string | null
    branchId?: StringNullableFilter<"Customer"> | string | null
    sortOrder?: IntFilter<"Customer"> | number
    isActive?: BoolFilter<"Customer"> | boolean
    createdAt?: DateTimeFilter<"Customer"> | Date | string
    updatedAt?: DateTimeFilter<"Customer"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Customer"> | Date | string | null
  }

  export type ProductUpsertWithWhereUniqueWithoutBranchInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutBranchInput, ProductUncheckedUpdateWithoutBranchInput>
    create: XOR<ProductCreateWithoutBranchInput, ProductUncheckedCreateWithoutBranchInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutBranchInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutBranchInput, ProductUncheckedUpdateWithoutBranchInput>
  }

  export type ProductUpdateManyWithWhereWithoutBranchInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutBranchInput>
  }

  export type ProductScalarWhereInput = {
    AND?: ProductScalarWhereInput | ProductScalarWhereInput[]
    OR?: ProductScalarWhereInput[]
    NOT?: ProductScalarWhereInput | ProductScalarWhereInput[]
    id?: StringFilter<"Product"> | string
    name?: StringFilter<"Product"> | string
    sku?: StringFilter<"Product"> | string
    barcode?: StringNullableFilter<"Product"> | string | null
    description?: StringNullableFilter<"Product"> | string | null
    isReturnable?: BoolFilter<"Product"> | boolean
    branchId?: StringNullableFilter<"Product"> | string | null
    categoryId?: StringNullableFilter<"Product"> | string | null
    unitId?: StringNullableFilter<"Product"> | string | null
    brandId?: StringNullableFilter<"Product"> | string | null
    expiryDate?: DateTimeNullableFilter<"Product"> | Date | string | null
    productType?: StringNullableFilter<"Product"> | string | null
    variationIds?: JsonNullableFilter<"Product">
    quantity?: IntFilter<"Product"> | number
    images?: JsonNullableFilter<"Product">
    sellingPrice?: FloatNullableFilter<"Product"> | number | null
    salesTaxId?: StringNullableFilter<"Product"> | string | null
    costPrice?: FloatNullableFilter<"Product"> | number | null
    purchaseTaxId?: StringNullableFilter<"Product"> | string | null
    warehouseId?: StringNullableFilter<"Product"> | string | null
    sortOrder?: IntFilter<"Product"> | number
    isActive?: BoolFilter<"Product"> | boolean
    createdAt?: DateTimeFilter<"Product"> | Date | string
    updatedAt?: DateTimeFilter<"Product"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Product"> | Date | string | null
  }

  export type SaleUpsertWithWhereUniqueWithoutBranchInput = {
    where: SaleWhereUniqueInput
    update: XOR<SaleUpdateWithoutBranchInput, SaleUncheckedUpdateWithoutBranchInput>
    create: XOR<SaleCreateWithoutBranchInput, SaleUncheckedCreateWithoutBranchInput>
  }

  export type SaleUpdateWithWhereUniqueWithoutBranchInput = {
    where: SaleWhereUniqueInput
    data: XOR<SaleUpdateWithoutBranchInput, SaleUncheckedUpdateWithoutBranchInput>
  }

  export type SaleUpdateManyWithWhereWithoutBranchInput = {
    where: SaleScalarWhereInput
    data: XOR<SaleUpdateManyMutationInput, SaleUncheckedUpdateManyWithoutBranchInput>
  }

  export type SaleScalarWhereInput = {
    AND?: SaleScalarWhereInput | SaleScalarWhereInput[]
    OR?: SaleScalarWhereInput[]
    NOT?: SaleScalarWhereInput | SaleScalarWhereInput[]
    id?: StringFilter<"Sale"> | string
    number?: StringFilter<"Sale"> | string
    customerId?: StringNullableFilter<"Sale"> | string | null
    warehouseId?: StringNullableFilter<"Sale"> | string | null
    branchId?: StringNullableFilter<"Sale"> | string | null
    paymentMethodId?: StringNullableFilter<"Sale"> | string | null
    status?: StringFilter<"Sale"> | string
    saleDate?: DateTimeFilter<"Sale"> | Date | string
    notes?: StringNullableFilter<"Sale"> | string | null
    subtotal?: FloatFilter<"Sale"> | number
    taxTotal?: FloatFilter<"Sale"> | number
    total?: FloatFilter<"Sale"> | number
    amountPaid?: FloatNullableFilter<"Sale"> | number | null
    changeGiven?: FloatNullableFilter<"Sale"> | number | null
    taxBreakdown?: JsonNullableFilter<"Sale">
    createdAt?: DateTimeFilter<"Sale"> | Date | string
    updatedAt?: DateTimeFilter<"Sale"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Sale"> | Date | string | null
  }

  export type SalesReturnUpsertWithWhereUniqueWithoutBranchInput = {
    where: SalesReturnWhereUniqueInput
    update: XOR<SalesReturnUpdateWithoutBranchInput, SalesReturnUncheckedUpdateWithoutBranchInput>
    create: XOR<SalesReturnCreateWithoutBranchInput, SalesReturnUncheckedCreateWithoutBranchInput>
  }

  export type SalesReturnUpdateWithWhereUniqueWithoutBranchInput = {
    where: SalesReturnWhereUniqueInput
    data: XOR<SalesReturnUpdateWithoutBranchInput, SalesReturnUncheckedUpdateWithoutBranchInput>
  }

  export type SalesReturnUpdateManyWithWhereWithoutBranchInput = {
    where: SalesReturnScalarWhereInput
    data: XOR<SalesReturnUpdateManyMutationInput, SalesReturnUncheckedUpdateManyWithoutBranchInput>
  }

  export type SalesReturnScalarWhereInput = {
    AND?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
    OR?: SalesReturnScalarWhereInput[]
    NOT?: SalesReturnScalarWhereInput | SalesReturnScalarWhereInput[]
    id?: StringFilter<"SalesReturn"> | string
    number?: StringFilter<"SalesReturn"> | string
    saleId?: StringNullableFilter<"SalesReturn"> | string | null
    customerId?: StringNullableFilter<"SalesReturn"> | string | null
    warehouseId?: StringNullableFilter<"SalesReturn"> | string | null
    branchId?: StringNullableFilter<"SalesReturn"> | string | null
    status?: StringFilter<"SalesReturn"> | string
    returnDate?: DateTimeFilter<"SalesReturn"> | Date | string
    reason?: StringNullableFilter<"SalesReturn"> | string | null
    notes?: StringNullableFilter<"SalesReturn"> | string | null
    subtotal?: FloatFilter<"SalesReturn"> | number
    taxTotal?: FloatFilter<"SalesReturn"> | number
    total?: FloatFilter<"SalesReturn"> | number
    createdAt?: DateTimeFilter<"SalesReturn"> | Date | string
    updatedAt?: DateTimeFilter<"SalesReturn"> | Date | string
  }

  export type PurchaseUpsertWithWhereUniqueWithoutBranchInput = {
    where: PurchaseWhereUniqueInput
    update: XOR<PurchaseUpdateWithoutBranchInput, PurchaseUncheckedUpdateWithoutBranchInput>
    create: XOR<PurchaseCreateWithoutBranchInput, PurchaseUncheckedCreateWithoutBranchInput>
  }

  export type PurchaseUpdateWithWhereUniqueWithoutBranchInput = {
    where: PurchaseWhereUniqueInput
    data: XOR<PurchaseUpdateWithoutBranchInput, PurchaseUncheckedUpdateWithoutBranchInput>
  }

  export type PurchaseUpdateManyWithWhereWithoutBranchInput = {
    where: PurchaseScalarWhereInput
    data: XOR<PurchaseUpdateManyMutationInput, PurchaseUncheckedUpdateManyWithoutBranchInput>
  }

  export type PurchaseScalarWhereInput = {
    AND?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
    OR?: PurchaseScalarWhereInput[]
    NOT?: PurchaseScalarWhereInput | PurchaseScalarWhereInput[]
    id?: StringFilter<"Purchase"> | string
    number?: StringFilter<"Purchase"> | string
    supplierId?: StringNullableFilter<"Purchase"> | string | null
    warehouseId?: StringNullableFilter<"Purchase"> | string | null
    branchId?: StringNullableFilter<"Purchase"> | string | null
    status?: StringFilter<"Purchase"> | string
    purchaseDate?: DateTimeFilter<"Purchase"> | Date | string
    notes?: StringNullableFilter<"Purchase"> | string | null
    subtotal?: FloatFilter<"Purchase"> | number
    taxTotal?: FloatFilter<"Purchase"> | number
    total?: FloatFilter<"Purchase"> | number
    createdAt?: DateTimeFilter<"Purchase"> | Date | string
    updatedAt?: DateTimeFilter<"Purchase"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Purchase"> | Date | string | null
  }

  export type PurchaseReturnUpsertWithWhereUniqueWithoutBranchInput = {
    where: PurchaseReturnWhereUniqueInput
    update: XOR<PurchaseReturnUpdateWithoutBranchInput, PurchaseReturnUncheckedUpdateWithoutBranchInput>
    create: XOR<PurchaseReturnCreateWithoutBranchInput, PurchaseReturnUncheckedCreateWithoutBranchInput>
  }

  export type PurchaseReturnUpdateWithWhereUniqueWithoutBranchInput = {
    where: PurchaseReturnWhereUniqueInput
    data: XOR<PurchaseReturnUpdateWithoutBranchInput, PurchaseReturnUncheckedUpdateWithoutBranchInput>
  }

  export type PurchaseReturnUpdateManyWithWhereWithoutBranchInput = {
    where: PurchaseReturnScalarWhereInput
    data: XOR<PurchaseReturnUpdateManyMutationInput, PurchaseReturnUncheckedUpdateManyWithoutBranchInput>
  }

  export type PurchaseReturnScalarWhereInput = {
    AND?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
    OR?: PurchaseReturnScalarWhereInput[]
    NOT?: PurchaseReturnScalarWhereInput | PurchaseReturnScalarWhereInput[]
    id?: StringFilter<"PurchaseReturn"> | string
    number?: StringFilter<"PurchaseReturn"> | string
    purchaseId?: StringNullableFilter<"PurchaseReturn"> | string | null
    supplierId?: StringNullableFilter<"PurchaseReturn"> | string | null
    warehouseId?: StringNullableFilter<"PurchaseReturn"> | string | null
    branchId?: StringNullableFilter<"PurchaseReturn"> | string | null
    status?: StringFilter<"PurchaseReturn"> | string
    returnDate?: DateTimeFilter<"PurchaseReturn"> | Date | string
    reason?: StringNullableFilter<"PurchaseReturn"> | string | null
    notes?: StringNullableFilter<"PurchaseReturn"> | string | null
    subtotal?: FloatFilter<"PurchaseReturn"> | number
    taxTotal?: FloatFilter<"PurchaseReturn"> | number
    total?: FloatFilter<"PurchaseReturn"> | number
    createdAt?: DateTimeFilter<"PurchaseReturn"> | Date | string
    updatedAt?: DateTimeFilter<"PurchaseReturn"> | Date | string
  }

  export type InvoiceUpsertWithWhereUniqueWithoutBranchInput = {
    where: InvoiceWhereUniqueInput
    update: XOR<InvoiceUpdateWithoutBranchInput, InvoiceUncheckedUpdateWithoutBranchInput>
    create: XOR<InvoiceCreateWithoutBranchInput, InvoiceUncheckedCreateWithoutBranchInput>
  }

  export type InvoiceUpdateWithWhereUniqueWithoutBranchInput = {
    where: InvoiceWhereUniqueInput
    data: XOR<InvoiceUpdateWithoutBranchInput, InvoiceUncheckedUpdateWithoutBranchInput>
  }

  export type InvoiceUpdateManyWithWhereWithoutBranchInput = {
    where: InvoiceScalarWhereInput
    data: XOR<InvoiceUpdateManyMutationInput, InvoiceUncheckedUpdateManyWithoutBranchInput>
  }

  export type InvoiceScalarWhereInput = {
    AND?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
    OR?: InvoiceScalarWhereInput[]
    NOT?: InvoiceScalarWhereInput | InvoiceScalarWhereInput[]
    id?: StringFilter<"Invoice"> | string
    number?: StringFilter<"Invoice"> | string
    customerId?: StringNullableFilter<"Invoice"> | string | null
    saleId?: StringNullableFilter<"Invoice"> | string | null
    branchId?: StringNullableFilter<"Invoice"> | string | null
    status?: StringFilter<"Invoice"> | string
    issueDate?: DateTimeFilter<"Invoice"> | Date | string
    dueDate?: DateTimeNullableFilter<"Invoice"> | Date | string | null
    notes?: StringNullableFilter<"Invoice"> | string | null
    subtotal?: FloatFilter<"Invoice"> | number
    taxTotal?: FloatFilter<"Invoice"> | number
    total?: FloatFilter<"Invoice"> | number
    createdAt?: DateTimeFilter<"Invoice"> | Date | string
    updatedAt?: DateTimeFilter<"Invoice"> | Date | string
    deletedAt?: DateTimeNullableFilter<"Invoice"> | Date | string | null
  }

  export type ExpenseCategoryUpsertWithWhereUniqueWithoutBranchInput = {
    where: ExpenseCategoryWhereUniqueInput
    update: XOR<ExpenseCategoryUpdateWithoutBranchInput, ExpenseCategoryUncheckedUpdateWithoutBranchInput>
    create: XOR<ExpenseCategoryCreateWithoutBranchInput, ExpenseCategoryUncheckedCreateWithoutBranchInput>
  }

  export type ExpenseCategoryUpdateWithWhereUniqueWithoutBranchInput = {
    where: ExpenseCategoryWhereUniqueInput
    data: XOR<ExpenseCategoryUpdateWithoutBranchInput, ExpenseCategoryUncheckedUpdateWithoutBranchInput>
  }

  export type ExpenseCategoryUpdateManyWithWhereWithoutBranchInput = {
    where: ExpenseCategoryScalarWhereInput
    data: XOR<ExpenseCategoryUpdateManyMutationInput, ExpenseCategoryUncheckedUpdateManyWithoutBranchInput>
  }

  export type ExpenseCategoryScalarWhereInput = {
    AND?: ExpenseCategoryScalarWhereInput | ExpenseCategoryScalarWhereInput[]
    OR?: ExpenseCategoryScalarWhereInput[]
    NOT?: ExpenseCategoryScalarWhereInput | ExpenseCategoryScalarWhereInput[]
    id?: StringFilter<"ExpenseCategory"> | string
    name?: StringFilter<"ExpenseCategory"> | string
    description?: StringNullableFilter<"ExpenseCategory"> | string | null
    branchId?: StringNullableFilter<"ExpenseCategory"> | string | null
    sortOrder?: IntFilter<"ExpenseCategory"> | number
    isActive?: BoolFilter<"ExpenseCategory"> | boolean
    createdAt?: DateTimeFilter<"ExpenseCategory"> | Date | string
    updatedAt?: DateTimeFilter<"ExpenseCategory"> | Date | string
  }

  export type ExpenseUpsertWithWhereUniqueWithoutBranchInput = {
    where: ExpenseWhereUniqueInput
    update: XOR<ExpenseUpdateWithoutBranchInput, ExpenseUncheckedUpdateWithoutBranchInput>
    create: XOR<ExpenseCreateWithoutBranchInput, ExpenseUncheckedCreateWithoutBranchInput>
  }

  export type ExpenseUpdateWithWhereUniqueWithoutBranchInput = {
    where: ExpenseWhereUniqueInput
    data: XOR<ExpenseUpdateWithoutBranchInput, ExpenseUncheckedUpdateWithoutBranchInput>
  }

  export type ExpenseUpdateManyWithWhereWithoutBranchInput = {
    where: ExpenseScalarWhereInput
    data: XOR<ExpenseUpdateManyMutationInput, ExpenseUncheckedUpdateManyWithoutBranchInput>
  }

  export type ExpenseScalarWhereInput = {
    AND?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
    OR?: ExpenseScalarWhereInput[]
    NOT?: ExpenseScalarWhereInput | ExpenseScalarWhereInput[]
    id?: StringFilter<"Expense"> | string
    reference?: StringFilter<"Expense"> | string
    categoryId?: StringNullableFilter<"Expense"> | string | null
    warehouseId?: StringNullableFilter<"Expense"> | string | null
    branchId?: StringNullableFilter<"Expense"> | string | null
    paymentMethodId?: StringNullableFilter<"Expense"> | string | null
    status?: StringFilter<"Expense"> | string
    expenseDate?: DateTimeFilter<"Expense"> | Date | string
    title?: StringNullableFilter<"Expense"> | string | null
    notes?: StringNullableFilter<"Expense"> | string | null
    amount?: FloatFilter<"Expense"> | number
    createdAt?: DateTimeFilter<"Expense"> | Date | string
    updatedAt?: DateTimeFilter<"Expense"> | Date | string
  }

  export type InventoryAdjustmentUpsertWithWhereUniqueWithoutBranchInput = {
    where: InventoryAdjustmentWhereUniqueInput
    update: XOR<InventoryAdjustmentUpdateWithoutBranchInput, InventoryAdjustmentUncheckedUpdateWithoutBranchInput>
    create: XOR<InventoryAdjustmentCreateWithoutBranchInput, InventoryAdjustmentUncheckedCreateWithoutBranchInput>
  }

  export type InventoryAdjustmentUpdateWithWhereUniqueWithoutBranchInput = {
    where: InventoryAdjustmentWhereUniqueInput
    data: XOR<InventoryAdjustmentUpdateWithoutBranchInput, InventoryAdjustmentUncheckedUpdateWithoutBranchInput>
  }

  export type InventoryAdjustmentUpdateManyWithWhereWithoutBranchInput = {
    where: InventoryAdjustmentScalarWhereInput
    data: XOR<InventoryAdjustmentUpdateManyMutationInput, InventoryAdjustmentUncheckedUpdateManyWithoutBranchInput>
  }

  export type InventoryAdjustmentScalarWhereInput = {
    AND?: InventoryAdjustmentScalarWhereInput | InventoryAdjustmentScalarWhereInput[]
    OR?: InventoryAdjustmentScalarWhereInput[]
    NOT?: InventoryAdjustmentScalarWhereInput | InventoryAdjustmentScalarWhereInput[]
    id?: StringFilter<"InventoryAdjustment"> | string
    reference?: StringNullableFilter<"InventoryAdjustment"> | string | null
    warehouseId?: StringFilter<"InventoryAdjustment"> | string
    branchId?: StringNullableFilter<"InventoryAdjustment"> | string | null
    type?: StringFilter<"InventoryAdjustment"> | string
    reason?: StringNullableFilter<"InventoryAdjustment"> | string | null
    notes?: StringNullableFilter<"InventoryAdjustment"> | string | null
    status?: StringFilter<"InventoryAdjustment"> | string
    createdAt?: DateTimeFilter<"InventoryAdjustment"> | Date | string
    updatedAt?: DateTimeFilter<"InventoryAdjustment"> | Date | string
  }

  export type InventoryTransferUpsertWithWhereUniqueWithoutBranchInput = {
    where: InventoryTransferWhereUniqueInput
    update: XOR<InventoryTransferUpdateWithoutBranchInput, InventoryTransferUncheckedUpdateWithoutBranchInput>
    create: XOR<InventoryTransferCreateWithoutBranchInput, InventoryTransferUncheckedCreateWithoutBranchInput>
  }

  export type InventoryTransferUpdateWithWhereUniqueWithoutBranchInput = {
    where: InventoryTransferWhereUniqueInput
    data: XOR<InventoryTransferUpdateWithoutBranchInput, InventoryTransferUncheckedUpdateWithoutBranchInput>
  }

  export type InventoryTransferUpdateManyWithWhereWithoutBranchInput = {
    where: InventoryTransferScalarWhereInput
    data: XOR<InventoryTransferUpdateManyMutationInput, InventoryTransferUncheckedUpdateManyWithoutBranchInput>
  }

  export type InventoryTransferScalarWhereInput = {
    AND?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
    OR?: InventoryTransferScalarWhereInput[]
    NOT?: InventoryTransferScalarWhereInput | InventoryTransferScalarWhereInput[]
    id?: StringFilter<"InventoryTransfer"> | string
    reference?: StringFilter<"InventoryTransfer"> | string
    fromWarehouseId?: StringFilter<"InventoryTransfer"> | string
    toWarehouseId?: StringFilter<"InventoryTransfer"> | string
    branchId?: StringNullableFilter<"InventoryTransfer"> | string | null
    status?: StringFilter<"InventoryTransfer"> | string
    transferDate?: DateTimeFilter<"InventoryTransfer"> | Date | string
    notes?: StringNullableFilter<"InventoryTransfer"> | string | null
    createdAt?: DateTimeFilter<"InventoryTransfer"> | Date | string
    updatedAt?: DateTimeFilter<"InventoryTransfer"> | Date | string
  }

  export type CategoryUpsertWithWhereUniqueWithoutBranchInput = {
    where: CategoryWhereUniqueInput
    update: XOR<CategoryUpdateWithoutBranchInput, CategoryUncheckedUpdateWithoutBranchInput>
    create: XOR<CategoryCreateWithoutBranchInput, CategoryUncheckedCreateWithoutBranchInput>
  }

  export type CategoryUpdateWithWhereUniqueWithoutBranchInput = {
    where: CategoryWhereUniqueInput
    data: XOR<CategoryUpdateWithoutBranchInput, CategoryUncheckedUpdateWithoutBranchInput>
  }

  export type CategoryUpdateManyWithWhereWithoutBranchInput = {
    where: CategoryScalarWhereInput
    data: XOR<CategoryUpdateManyMutationInput, CategoryUncheckedUpdateManyWithoutBranchInput>
  }

  export type CategoryScalarWhereInput = {
    AND?: CategoryScalarWhereInput | CategoryScalarWhereInput[]
    OR?: CategoryScalarWhereInput[]
    NOT?: CategoryScalarWhereInput | CategoryScalarWhereInput[]
    id?: StringFilter<"Category"> | string
    name?: StringFilter<"Category"> | string
    code?: StringNullableFilter<"Category"> | string | null
    description?: StringNullableFilter<"Category"> | string | null
    color?: StringNullableFilter<"Category"> | string | null
    icon?: StringNullableFilter<"Category"> | string | null
    sortOrder?: IntFilter<"Category"> | number
    isActive?: BoolFilter<"Category"> | boolean
    tags?: JsonNullableFilter<"Category">
    branchId?: StringNullableFilter<"Category"> | string | null
    parentId?: StringNullableFilter<"Category"> | string | null
    createdAt?: DateTimeFilter<"Category"> | Date | string
    updatedAt?: DateTimeFilter<"Category"> | Date | string
  }

  export type BrandUpsertWithWhereUniqueWithoutBranchInput = {
    where: BrandWhereUniqueInput
    update: XOR<BrandUpdateWithoutBranchInput, BrandUncheckedUpdateWithoutBranchInput>
    create: XOR<BrandCreateWithoutBranchInput, BrandUncheckedCreateWithoutBranchInput>
  }

  export type BrandUpdateWithWhereUniqueWithoutBranchInput = {
    where: BrandWhereUniqueInput
    data: XOR<BrandUpdateWithoutBranchInput, BrandUncheckedUpdateWithoutBranchInput>
  }

  export type BrandUpdateManyWithWhereWithoutBranchInput = {
    where: BrandScalarWhereInput
    data: XOR<BrandUpdateManyMutationInput, BrandUncheckedUpdateManyWithoutBranchInput>
  }

  export type BrandScalarWhereInput = {
    AND?: BrandScalarWhereInput | BrandScalarWhereInput[]
    OR?: BrandScalarWhereInput[]
    NOT?: BrandScalarWhereInput | BrandScalarWhereInput[]
    id?: StringFilter<"Brand"> | string
    name?: StringFilter<"Brand"> | string
    logo?: StringNullableFilter<"Brand"> | string | null
    branchId?: StringNullableFilter<"Brand"> | string | null
    sortOrder?: IntFilter<"Brand"> | number
    isActive?: BoolFilter<"Brand"> | boolean
    createdAt?: DateTimeFilter<"Brand"> | Date | string
    updatedAt?: DateTimeFilter<"Brand"> | Date | string
  }

  export type UnitUpsertWithWhereUniqueWithoutBranchInput = {
    where: UnitWhereUniqueInput
    update: XOR<UnitUpdateWithoutBranchInput, UnitUncheckedUpdateWithoutBranchInput>
    create: XOR<UnitCreateWithoutBranchInput, UnitUncheckedCreateWithoutBranchInput>
  }

  export type UnitUpdateWithWhereUniqueWithoutBranchInput = {
    where: UnitWhereUniqueInput
    data: XOR<UnitUpdateWithoutBranchInput, UnitUncheckedUpdateWithoutBranchInput>
  }

  export type UnitUpdateManyWithWhereWithoutBranchInput = {
    where: UnitScalarWhereInput
    data: XOR<UnitUpdateManyMutationInput, UnitUncheckedUpdateManyWithoutBranchInput>
  }

  export type UnitScalarWhereInput = {
    AND?: UnitScalarWhereInput | UnitScalarWhereInput[]
    OR?: UnitScalarWhereInput[]
    NOT?: UnitScalarWhereInput | UnitScalarWhereInput[]
    id?: StringFilter<"Unit"> | string
    name?: StringFilter<"Unit"> | string
    symbol?: StringNullableFilter<"Unit"> | string | null
    branchId?: StringNullableFilter<"Unit"> | string | null
    sortOrder?: IntFilter<"Unit"> | number
    isActive?: BoolFilter<"Unit"> | boolean
    createdAt?: DateTimeFilter<"Unit"> | Date | string
    updatedAt?: DateTimeFilter<"Unit"> | Date | string
  }

  export type VariationUpsertWithWhereUniqueWithoutBranchInput = {
    where: VariationWhereUniqueInput
    update: XOR<VariationUpdateWithoutBranchInput, VariationUncheckedUpdateWithoutBranchInput>
    create: XOR<VariationCreateWithoutBranchInput, VariationUncheckedCreateWithoutBranchInput>
  }

  export type VariationUpdateWithWhereUniqueWithoutBranchInput = {
    where: VariationWhereUniqueInput
    data: XOR<VariationUpdateWithoutBranchInput, VariationUncheckedUpdateWithoutBranchInput>
  }

  export type VariationUpdateManyWithWhereWithoutBranchInput = {
    where: VariationScalarWhereInput
    data: XOR<VariationUpdateManyMutationInput, VariationUncheckedUpdateManyWithoutBranchInput>
  }

  export type VariationScalarWhereInput = {
    AND?: VariationScalarWhereInput | VariationScalarWhereInput[]
    OR?: VariationScalarWhereInput[]
    NOT?: VariationScalarWhereInput | VariationScalarWhereInput[]
    id?: StringFilter<"Variation"> | string
    name?: StringFilter<"Variation"> | string
    options?: JsonNullableFilter<"Variation">
    sortOrder?: IntFilter<"Variation"> | number
    isActive?: BoolFilter<"Variation"> | boolean
    branchId?: StringNullableFilter<"Variation"> | string | null
    createdAt?: DateTimeFilter<"Variation"> | Date | string
    updatedAt?: DateTimeFilter<"Variation"> | Date | string
  }

  export type TaxUpsertWithWhereUniqueWithoutBranchInput = {
    where: TaxWhereUniqueInput
    update: XOR<TaxUpdateWithoutBranchInput, TaxUncheckedUpdateWithoutBranchInput>
    create: XOR<TaxCreateWithoutBranchInput, TaxUncheckedCreateWithoutBranchInput>
  }

  export type TaxUpdateWithWhereUniqueWithoutBranchInput = {
    where: TaxWhereUniqueInput
    data: XOR<TaxUpdateWithoutBranchInput, TaxUncheckedUpdateWithoutBranchInput>
  }

  export type TaxUpdateManyWithWhereWithoutBranchInput = {
    where: TaxScalarWhereInput
    data: XOR<TaxUpdateManyMutationInput, TaxUncheckedUpdateManyWithoutBranchInput>
  }

  export type TaxScalarWhereInput = {
    AND?: TaxScalarWhereInput | TaxScalarWhereInput[]
    OR?: TaxScalarWhereInput[]
    NOT?: TaxScalarWhereInput | TaxScalarWhereInput[]
    id?: StringFilter<"Tax"> | string
    name?: StringFilter<"Tax"> | string
    rate?: FloatFilter<"Tax"> | number
    branchId?: StringNullableFilter<"Tax"> | string | null
    isActive?: BoolFilter<"Tax"> | boolean
    sortOrder?: IntFilter<"Tax"> | number
    createdAt?: DateTimeFilter<"Tax"> | Date | string
    updatedAt?: DateTimeFilter<"Tax"> | Date | string
  }

  export type WarehouseUpsertWithWhereUniqueWithoutBranchInput = {
    where: WarehouseWhereUniqueInput
    update: XOR<WarehouseUpdateWithoutBranchInput, WarehouseUncheckedUpdateWithoutBranchInput>
    create: XOR<WarehouseCreateWithoutBranchInput, WarehouseUncheckedCreateWithoutBranchInput>
  }

  export type WarehouseUpdateWithWhereUniqueWithoutBranchInput = {
    where: WarehouseWhereUniqueInput
    data: XOR<WarehouseUpdateWithoutBranchInput, WarehouseUncheckedUpdateWithoutBranchInput>
  }

  export type WarehouseUpdateManyWithWhereWithoutBranchInput = {
    where: WarehouseScalarWhereInput
    data: XOR<WarehouseUpdateManyMutationInput, WarehouseUncheckedUpdateManyWithoutBranchInput>
  }

  export type WarehouseScalarWhereInput = {
    AND?: WarehouseScalarWhereInput | WarehouseScalarWhereInput[]
    OR?: WarehouseScalarWhereInput[]
    NOT?: WarehouseScalarWhereInput | WarehouseScalarWhereInput[]
    id?: StringFilter<"Warehouse"> | string
    name?: StringFilter<"Warehouse"> | string
    branchId?: StringNullableFilter<"Warehouse"> | string | null
    email?: StringNullableFilter<"Warehouse"> | string | null
    phone?: StringNullableFilter<"Warehouse"> | string | null
    country?: StringNullableFilter<"Warehouse"> | string | null
    city?: StringNullableFilter<"Warehouse"> | string | null
    zipCode?: StringNullableFilter<"Warehouse"> | string | null
    sortOrder?: IntFilter<"Warehouse"> | number
    isActive?: BoolFilter<"Warehouse"> | boolean
    createdAt?: DateTimeFilter<"Warehouse"> | Date | string
    updatedAt?: DateTimeFilter<"Warehouse"> | Date | string
  }

  export type PaymentMethodUpsertWithWhereUniqueWithoutBranchInput = {
    where: PaymentMethodWhereUniqueInput
    update: XOR<PaymentMethodUpdateWithoutBranchInput, PaymentMethodUncheckedUpdateWithoutBranchInput>
    create: XOR<PaymentMethodCreateWithoutBranchInput, PaymentMethodUncheckedCreateWithoutBranchInput>
  }

  export type PaymentMethodUpdateWithWhereUniqueWithoutBranchInput = {
    where: PaymentMethodWhereUniqueInput
    data: XOR<PaymentMethodUpdateWithoutBranchInput, PaymentMethodUncheckedUpdateWithoutBranchInput>
  }

  export type PaymentMethodUpdateManyWithWhereWithoutBranchInput = {
    where: PaymentMethodScalarWhereInput
    data: XOR<PaymentMethodUpdateManyMutationInput, PaymentMethodUncheckedUpdateManyWithoutBranchInput>
  }

  export type PaymentMethodScalarWhereInput = {
    AND?: PaymentMethodScalarWhereInput | PaymentMethodScalarWhereInput[]
    OR?: PaymentMethodScalarWhereInput[]
    NOT?: PaymentMethodScalarWhereInput | PaymentMethodScalarWhereInput[]
    id?: StringFilter<"PaymentMethod"> | string
    name?: StringFilter<"PaymentMethod"> | string
    branchId?: StringNullableFilter<"PaymentMethod"> | string | null
    sortOrder?: IntFilter<"PaymentMethod"> | number
    isActive?: BoolFilter<"PaymentMethod"> | boolean
    createdAt?: DateTimeFilter<"PaymentMethod"> | Date | string
    updatedAt?: DateTimeFilter<"PaymentMethod"> | Date | string
  }

  export type UserCreateWithoutBranchesInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleCreateNestedManyWithoutUserInput
    activeBranch?: BranchCreateNestedOneWithoutActiveUsersInput
    notifications?: NotificationCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogCreateNestedManyWithoutUserInput
  }

  export type UserUncheckedCreateWithoutBranchesInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    activeBranchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleUncheckedCreateNestedManyWithoutUserInput
    notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogUncheckedCreateNestedManyWithoutUserInput
  }

  export type UserCreateOrConnectWithoutBranchesInput = {
    where: UserWhereUniqueInput
    create: XOR<UserCreateWithoutBranchesInput, UserUncheckedCreateWithoutBranchesInput>
  }

  export type BranchCreateWithoutUsersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutUsersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutUsersInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutUsersInput, BranchUncheckedCreateWithoutUsersInput>
  }

  export type UserUpsertWithoutBranchesInput = {
    update: XOR<UserUpdateWithoutBranchesInput, UserUncheckedUpdateWithoutBranchesInput>
    create: XOR<UserCreateWithoutBranchesInput, UserUncheckedCreateWithoutBranchesInput>
    where?: UserWhereInput
  }

  export type UserUpdateToOneWithWhereWithoutBranchesInput = {
    where?: UserWhereInput
    data: XOR<UserUpdateWithoutBranchesInput, UserUncheckedUpdateWithoutBranchesInput>
  }

  export type UserUpdateWithoutBranchesInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUpdateManyWithoutUserNestedInput
    activeBranch?: BranchUpdateOneWithoutActiveUsersNestedInput
    notifications?: NotificationUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateWithoutBranchesInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUncheckedUpdateManyWithoutUserNestedInput
    notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUncheckedUpdateManyWithoutUserNestedInput
  }

  export type BranchUpsertWithoutUsersInput = {
    update: XOR<BranchUpdateWithoutUsersInput, BranchUncheckedUpdateWithoutUsersInput>
    create: XOR<BranchCreateWithoutUsersInput, BranchUncheckedCreateWithoutUsersInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutUsersInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutUsersInput, BranchUncheckedUpdateWithoutUsersInput>
  }

  export type BranchUpdateWithoutUsersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutUsersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type UserRoleCreateWithoutRoleInput = {
    assignedAt?: Date | string
    user: UserCreateNestedOneWithoutRolesInput
  }

  export type UserRoleUncheckedCreateWithoutRoleInput = {
    userId: string
    assignedAt?: Date | string
  }

  export type UserRoleCreateOrConnectWithoutRoleInput = {
    where: UserRoleWhereUniqueInput
    create: XOR<UserRoleCreateWithoutRoleInput, UserRoleUncheckedCreateWithoutRoleInput>
  }

  export type UserRoleCreateManyRoleInputEnvelope = {
    data: UserRoleCreateManyRoleInput | UserRoleCreateManyRoleInput[]
    skipDuplicates?: boolean
  }

  export type RolePermissionCreateWithoutRoleInput = {
    permission: PermissionCreateNestedOneWithoutRolesInput
  }

  export type RolePermissionUncheckedCreateWithoutRoleInput = {
    permissionId: string
  }

  export type RolePermissionCreateOrConnectWithoutRoleInput = {
    where: RolePermissionWhereUniqueInput
    create: XOR<RolePermissionCreateWithoutRoleInput, RolePermissionUncheckedCreateWithoutRoleInput>
  }

  export type RolePermissionCreateManyRoleInputEnvelope = {
    data: RolePermissionCreateManyRoleInput | RolePermissionCreateManyRoleInput[]
    skipDuplicates?: boolean
  }

  export type UserRoleUpsertWithWhereUniqueWithoutRoleInput = {
    where: UserRoleWhereUniqueInput
    update: XOR<UserRoleUpdateWithoutRoleInput, UserRoleUncheckedUpdateWithoutRoleInput>
    create: XOR<UserRoleCreateWithoutRoleInput, UserRoleUncheckedCreateWithoutRoleInput>
  }

  export type UserRoleUpdateWithWhereUniqueWithoutRoleInput = {
    where: UserRoleWhereUniqueInput
    data: XOR<UserRoleUpdateWithoutRoleInput, UserRoleUncheckedUpdateWithoutRoleInput>
  }

  export type UserRoleUpdateManyWithWhereWithoutRoleInput = {
    where: UserRoleScalarWhereInput
    data: XOR<UserRoleUpdateManyMutationInput, UserRoleUncheckedUpdateManyWithoutRoleInput>
  }

  export type RolePermissionUpsertWithWhereUniqueWithoutRoleInput = {
    where: RolePermissionWhereUniqueInput
    update: XOR<RolePermissionUpdateWithoutRoleInput, RolePermissionUncheckedUpdateWithoutRoleInput>
    create: XOR<RolePermissionCreateWithoutRoleInput, RolePermissionUncheckedCreateWithoutRoleInput>
  }

  export type RolePermissionUpdateWithWhereUniqueWithoutRoleInput = {
    where: RolePermissionWhereUniqueInput
    data: XOR<RolePermissionUpdateWithoutRoleInput, RolePermissionUncheckedUpdateWithoutRoleInput>
  }

  export type RolePermissionUpdateManyWithWhereWithoutRoleInput = {
    where: RolePermissionScalarWhereInput
    data: XOR<RolePermissionUpdateManyMutationInput, RolePermissionUncheckedUpdateManyWithoutRoleInput>
  }

  export type RolePermissionScalarWhereInput = {
    AND?: RolePermissionScalarWhereInput | RolePermissionScalarWhereInput[]
    OR?: RolePermissionScalarWhereInput[]
    NOT?: RolePermissionScalarWhereInput | RolePermissionScalarWhereInput[]
    roleId?: StringFilter<"RolePermission"> | string
    permissionId?: StringFilter<"RolePermission"> | string
  }

  export type RolePermissionCreateWithoutPermissionInput = {
    role: RoleCreateNestedOneWithoutPermissionsInput
  }

  export type RolePermissionUncheckedCreateWithoutPermissionInput = {
    roleId: string
  }

  export type RolePermissionCreateOrConnectWithoutPermissionInput = {
    where: RolePermissionWhereUniqueInput
    create: XOR<RolePermissionCreateWithoutPermissionInput, RolePermissionUncheckedCreateWithoutPermissionInput>
  }

  export type RolePermissionCreateManyPermissionInputEnvelope = {
    data: RolePermissionCreateManyPermissionInput | RolePermissionCreateManyPermissionInput[]
    skipDuplicates?: boolean
  }

  export type RolePermissionUpsertWithWhereUniqueWithoutPermissionInput = {
    where: RolePermissionWhereUniqueInput
    update: XOR<RolePermissionUpdateWithoutPermissionInput, RolePermissionUncheckedUpdateWithoutPermissionInput>
    create: XOR<RolePermissionCreateWithoutPermissionInput, RolePermissionUncheckedCreateWithoutPermissionInput>
  }

  export type RolePermissionUpdateWithWhereUniqueWithoutPermissionInput = {
    where: RolePermissionWhereUniqueInput
    data: XOR<RolePermissionUpdateWithoutPermissionInput, RolePermissionUncheckedUpdateWithoutPermissionInput>
  }

  export type RolePermissionUpdateManyWithWhereWithoutPermissionInput = {
    where: RolePermissionScalarWhereInput
    data: XOR<RolePermissionUpdateManyMutationInput, RolePermissionUncheckedUpdateManyWithoutPermissionInput>
  }

  export type UserCreateWithoutRolesInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    activeBranch?: BranchCreateNestedOneWithoutActiveUsersInput
    branches?: UserBranchCreateNestedManyWithoutUserInput
    notifications?: NotificationCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogCreateNestedManyWithoutUserInput
  }

  export type UserUncheckedCreateWithoutRolesInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    activeBranchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branches?: UserBranchUncheckedCreateNestedManyWithoutUserInput
    notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogUncheckedCreateNestedManyWithoutUserInput
  }

  export type UserCreateOrConnectWithoutRolesInput = {
    where: UserWhereUniqueInput
    create: XOR<UserCreateWithoutRolesInput, UserUncheckedCreateWithoutRolesInput>
  }

  export type RoleCreateWithoutUsersInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
    permissions?: RolePermissionCreateNestedManyWithoutRoleInput
  }

  export type RoleUncheckedCreateWithoutUsersInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
    permissions?: RolePermissionUncheckedCreateNestedManyWithoutRoleInput
  }

  export type RoleCreateOrConnectWithoutUsersInput = {
    where: RoleWhereUniqueInput
    create: XOR<RoleCreateWithoutUsersInput, RoleUncheckedCreateWithoutUsersInput>
  }

  export type UserUpsertWithoutRolesInput = {
    update: XOR<UserUpdateWithoutRolesInput, UserUncheckedUpdateWithoutRolesInput>
    create: XOR<UserCreateWithoutRolesInput, UserUncheckedCreateWithoutRolesInput>
    where?: UserWhereInput
  }

  export type UserUpdateToOneWithWhereWithoutRolesInput = {
    where?: UserWhereInput
    data: XOR<UserUpdateWithoutRolesInput, UserUncheckedUpdateWithoutRolesInput>
  }

  export type UserUpdateWithoutRolesInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranch?: BranchUpdateOneWithoutActiveUsersNestedInput
    branches?: UserBranchUpdateManyWithoutUserNestedInput
    notifications?: NotificationUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateWithoutRolesInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branches?: UserBranchUncheckedUpdateManyWithoutUserNestedInput
    notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUncheckedUpdateManyWithoutUserNestedInput
  }

  export type RoleUpsertWithoutUsersInput = {
    update: XOR<RoleUpdateWithoutUsersInput, RoleUncheckedUpdateWithoutUsersInput>
    create: XOR<RoleCreateWithoutUsersInput, RoleUncheckedCreateWithoutUsersInput>
    where?: RoleWhereInput
  }

  export type RoleUpdateToOneWithWhereWithoutUsersInput = {
    where?: RoleWhereInput
    data: XOR<RoleUpdateWithoutUsersInput, RoleUncheckedUpdateWithoutUsersInput>
  }

  export type RoleUpdateWithoutUsersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    permissions?: RolePermissionUpdateManyWithoutRoleNestedInput
  }

  export type RoleUncheckedUpdateWithoutUsersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    permissions?: RolePermissionUncheckedUpdateManyWithoutRoleNestedInput
  }

  export type RoleCreateWithoutPermissionsInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserRoleCreateNestedManyWithoutRoleInput
  }

  export type RoleUncheckedCreateWithoutPermissionsInput = {
    id?: string
    name: string
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserRoleUncheckedCreateNestedManyWithoutRoleInput
  }

  export type RoleCreateOrConnectWithoutPermissionsInput = {
    where: RoleWhereUniqueInput
    create: XOR<RoleCreateWithoutPermissionsInput, RoleUncheckedCreateWithoutPermissionsInput>
  }

  export type PermissionCreateWithoutRolesInput = {
    id?: string
    name: string
    label?: string
    description?: string
    category?: string
    sortOrder?: number
    isSystem?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PermissionUncheckedCreateWithoutRolesInput = {
    id?: string
    name: string
    label?: string
    description?: string
    category?: string
    sortOrder?: number
    isSystem?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PermissionCreateOrConnectWithoutRolesInput = {
    where: PermissionWhereUniqueInput
    create: XOR<PermissionCreateWithoutRolesInput, PermissionUncheckedCreateWithoutRolesInput>
  }

  export type RoleUpsertWithoutPermissionsInput = {
    update: XOR<RoleUpdateWithoutPermissionsInput, RoleUncheckedUpdateWithoutPermissionsInput>
    create: XOR<RoleCreateWithoutPermissionsInput, RoleUncheckedCreateWithoutPermissionsInput>
    where?: RoleWhereInput
  }

  export type RoleUpdateToOneWithWhereWithoutPermissionsInput = {
    where?: RoleWhereInput
    data: XOR<RoleUpdateWithoutPermissionsInput, RoleUncheckedUpdateWithoutPermissionsInput>
  }

  export type RoleUpdateWithoutPermissionsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserRoleUpdateManyWithoutRoleNestedInput
  }

  export type RoleUncheckedUpdateWithoutPermissionsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserRoleUncheckedUpdateManyWithoutRoleNestedInput
  }

  export type PermissionUpsertWithoutRolesInput = {
    update: XOR<PermissionUpdateWithoutRolesInput, PermissionUncheckedUpdateWithoutRolesInput>
    create: XOR<PermissionCreateWithoutRolesInput, PermissionUncheckedCreateWithoutRolesInput>
    where?: PermissionWhereInput
  }

  export type PermissionUpdateToOneWithWhereWithoutRolesInput = {
    where?: PermissionWhereInput
    data: XOR<PermissionUpdateWithoutRolesInput, PermissionUncheckedUpdateWithoutRolesInput>
  }

  export type PermissionUpdateWithoutRolesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    label?: StringFieldUpdateOperationsInput | string
    description?: StringFieldUpdateOperationsInput | string
    category?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isSystem?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PermissionUncheckedUpdateWithoutRolesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    label?: StringFieldUpdateOperationsInput | string
    description?: StringFieldUpdateOperationsInput | string
    category?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isSystem?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type BranchCreateWithoutCategoriesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutCategoriesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutCategoriesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutCategoriesInput, BranchUncheckedCreateWithoutCategoriesInput>
  }

  export type CategoryCreateWithoutChildrenInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutCategoriesInput
    parent?: CategoryCreateNestedOneWithoutChildrenInput
    products?: ProductCreateNestedManyWithoutCategoryInput
  }

  export type CategoryUncheckedCreateWithoutChildrenInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: string | null
    parentId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutCategoryInput
  }

  export type CategoryCreateOrConnectWithoutChildrenInput = {
    where: CategoryWhereUniqueInput
    create: XOR<CategoryCreateWithoutChildrenInput, CategoryUncheckedCreateWithoutChildrenInput>
  }

  export type CategoryCreateWithoutParentInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutCategoriesInput
    children?: CategoryCreateNestedManyWithoutParentInput
    products?: ProductCreateNestedManyWithoutCategoryInput
  }

  export type CategoryUncheckedCreateWithoutParentInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    children?: CategoryUncheckedCreateNestedManyWithoutParentInput
    products?: ProductUncheckedCreateNestedManyWithoutCategoryInput
  }

  export type CategoryCreateOrConnectWithoutParentInput = {
    where: CategoryWhereUniqueInput
    create: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput>
  }

  export type CategoryCreateManyParentInputEnvelope = {
    data: CategoryCreateManyParentInput | CategoryCreateManyParentInput[]
    skipDuplicates?: boolean
  }

  export type ProductCreateWithoutCategoryInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutCategoryInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutCategoryInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutCategoryInput, ProductUncheckedCreateWithoutCategoryInput>
  }

  export type ProductCreateManyCategoryInputEnvelope = {
    data: ProductCreateManyCategoryInput | ProductCreateManyCategoryInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutCategoriesInput = {
    update: XOR<BranchUpdateWithoutCategoriesInput, BranchUncheckedUpdateWithoutCategoriesInput>
    create: XOR<BranchCreateWithoutCategoriesInput, BranchUncheckedCreateWithoutCategoriesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutCategoriesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutCategoriesInput, BranchUncheckedUpdateWithoutCategoriesInput>
  }

  export type BranchUpdateWithoutCategoriesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutCategoriesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type CategoryUpsertWithoutChildrenInput = {
    update: XOR<CategoryUpdateWithoutChildrenInput, CategoryUncheckedUpdateWithoutChildrenInput>
    create: XOR<CategoryCreateWithoutChildrenInput, CategoryUncheckedCreateWithoutChildrenInput>
    where?: CategoryWhereInput
  }

  export type CategoryUpdateToOneWithWhereWithoutChildrenInput = {
    where?: CategoryWhereInput
    data: XOR<CategoryUpdateWithoutChildrenInput, CategoryUncheckedUpdateWithoutChildrenInput>
  }

  export type CategoryUpdateWithoutChildrenInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutCategoriesNestedInput
    parent?: CategoryUpdateOneWithoutChildrenNestedInput
    products?: ProductUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUncheckedUpdateWithoutChildrenInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    parentId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUpsertWithWhereUniqueWithoutParentInput = {
    where: CategoryWhereUniqueInput
    update: XOR<CategoryUpdateWithoutParentInput, CategoryUncheckedUpdateWithoutParentInput>
    create: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput>
  }

  export type CategoryUpdateWithWhereUniqueWithoutParentInput = {
    where: CategoryWhereUniqueInput
    data: XOR<CategoryUpdateWithoutParentInput, CategoryUncheckedUpdateWithoutParentInput>
  }

  export type CategoryUpdateManyWithWhereWithoutParentInput = {
    where: CategoryScalarWhereInput
    data: XOR<CategoryUpdateManyMutationInput, CategoryUncheckedUpdateManyWithoutParentInput>
  }

  export type ProductUpsertWithWhereUniqueWithoutCategoryInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutCategoryInput, ProductUncheckedUpdateWithoutCategoryInput>
    create: XOR<ProductCreateWithoutCategoryInput, ProductUncheckedCreateWithoutCategoryInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutCategoryInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutCategoryInput, ProductUncheckedUpdateWithoutCategoryInput>
  }

  export type ProductUpdateManyWithWhereWithoutCategoryInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutCategoryInput>
  }

  export type BranchCreateWithoutVariationsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutVariationsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutVariationsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutVariationsInput, BranchUncheckedCreateWithoutVariationsInput>
  }

  export type BranchUpsertWithoutVariationsInput = {
    update: XOR<BranchUpdateWithoutVariationsInput, BranchUncheckedUpdateWithoutVariationsInput>
    create: XOR<BranchCreateWithoutVariationsInput, BranchUncheckedCreateWithoutVariationsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutVariationsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutVariationsInput, BranchUncheckedUpdateWithoutVariationsInput>
  }

  export type BranchUpdateWithoutVariationsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutVariationsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type BranchCreateWithoutBrandsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutBrandsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutBrandsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutBrandsInput, BranchUncheckedCreateWithoutBrandsInput>
  }

  export type ProductCreateWithoutBrandInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutBrandInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutBrandInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput>
  }

  export type ProductCreateManyBrandInputEnvelope = {
    data: ProductCreateManyBrandInput | ProductCreateManyBrandInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutBrandsInput = {
    update: XOR<BranchUpdateWithoutBrandsInput, BranchUncheckedUpdateWithoutBrandsInput>
    create: XOR<BranchCreateWithoutBrandsInput, BranchUncheckedCreateWithoutBrandsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutBrandsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutBrandsInput, BranchUncheckedUpdateWithoutBrandsInput>
  }

  export type BranchUpdateWithoutBrandsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutBrandsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type ProductUpsertWithWhereUniqueWithoutBrandInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutBrandInput, ProductUncheckedUpdateWithoutBrandInput>
    create: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutBrandInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutBrandInput, ProductUncheckedUpdateWithoutBrandInput>
  }

  export type ProductUpdateManyWithWhereWithoutBrandInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutBrandInput>
  }

  export type BranchCreateWithoutUnitsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutUnitsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutUnitsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutUnitsInput, BranchUncheckedCreateWithoutUnitsInput>
  }

  export type ProductCreateWithoutUnitInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutUnitInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutUnitInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutUnitInput, ProductUncheckedCreateWithoutUnitInput>
  }

  export type ProductCreateManyUnitInputEnvelope = {
    data: ProductCreateManyUnitInput | ProductCreateManyUnitInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutUnitsInput = {
    update: XOR<BranchUpdateWithoutUnitsInput, BranchUncheckedUpdateWithoutUnitsInput>
    create: XOR<BranchCreateWithoutUnitsInput, BranchUncheckedCreateWithoutUnitsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutUnitsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutUnitsInput, BranchUncheckedUpdateWithoutUnitsInput>
  }

  export type BranchUpdateWithoutUnitsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutUnitsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type ProductUpsertWithWhereUniqueWithoutUnitInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutUnitInput, ProductUncheckedUpdateWithoutUnitInput>
    create: XOR<ProductCreateWithoutUnitInput, ProductUncheckedCreateWithoutUnitInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutUnitInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutUnitInput, ProductUncheckedUpdateWithoutUnitInput>
  }

  export type ProductUpdateManyWithWhereWithoutUnitInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutUnitInput>
  }

  export type BranchCreateWithoutWarehousesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutWarehousesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutWarehousesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutWarehousesInput, BranchUncheckedCreateWithoutWarehousesInput>
  }

  export type ProductCreateWithoutWarehouseInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutWarehouseInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutWarehouseInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutWarehouseInput, ProductUncheckedCreateWithoutWarehouseInput>
  }

  export type ProductCreateManyWarehouseInputEnvelope = {
    data: ProductCreateManyWarehouseInput | ProductCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type InventoryAdjustmentCreateWithoutWarehouseInput = {
    id?: string
    reference?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutAdjustmentsInput
    lines?: InventoryAdjustmentLineCreateNestedManyWithoutAdjustmentInput
  }

  export type InventoryAdjustmentUncheckedCreateWithoutWarehouseInput = {
    id?: string
    reference?: string | null
    branchId?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutAdjustmentInput
  }

  export type InventoryAdjustmentCreateOrConnectWithoutWarehouseInput = {
    where: InventoryAdjustmentWhereUniqueInput
    create: XOR<InventoryAdjustmentCreateWithoutWarehouseInput, InventoryAdjustmentUncheckedCreateWithoutWarehouseInput>
  }

  export type InventoryAdjustmentCreateManyWarehouseInputEnvelope = {
    data: InventoryAdjustmentCreateManyWarehouseInput | InventoryAdjustmentCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseCreateWithoutWarehouseInput = {
    id?: string
    number: string
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    supplier?: SupplierCreateNestedOneWithoutPurchasesInput
    branch?: BranchCreateNestedOneWithoutPurchasesInput
    lines?: PurchaseLineCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUncheckedCreateWithoutWarehouseInput = {
    id?: string
    number: string
    supplierId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: PurchaseLineUncheckedCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnUncheckedCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseCreateOrConnectWithoutWarehouseInput = {
    where: PurchaseWhereUniqueInput
    create: XOR<PurchaseCreateWithoutWarehouseInput, PurchaseUncheckedCreateWithoutWarehouseInput>
  }

  export type PurchaseCreateManyWarehouseInputEnvelope = {
    data: PurchaseCreateManyWarehouseInput | PurchaseCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseReturnCreateWithoutWarehouseInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    purchase?: PurchaseCreateNestedOneWithoutReturnsInput
    supplier?: SupplierCreateNestedOneWithoutPurchaseReturnsInput
    branch?: BranchCreateNestedOneWithoutPurchaseReturnsInput
    lines?: PurchaseReturnLineCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnUncheckedCreateWithoutWarehouseInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnCreateOrConnectWithoutWarehouseInput = {
    where: PurchaseReturnWhereUniqueInput
    create: XOR<PurchaseReturnCreateWithoutWarehouseInput, PurchaseReturnUncheckedCreateWithoutWarehouseInput>
  }

  export type PurchaseReturnCreateManyWarehouseInputEnvelope = {
    data: PurchaseReturnCreateManyWarehouseInput | PurchaseReturnCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type SaleCreateWithoutWarehouseInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutWarehouseInput = {
    id?: string
    number: string
    customerId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutWarehouseInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutWarehouseInput, SaleUncheckedCreateWithoutWarehouseInput>
  }

  export type SaleCreateManyWarehouseInputEnvelope = {
    data: SaleCreateManyWarehouseInput | SaleCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type SalesReturnCreateWithoutWarehouseInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    sale?: SaleCreateNestedOneWithoutReturnsInput
    customer?: CustomerCreateNestedOneWithoutSalesReturnsInput
    branch?: BranchCreateNestedOneWithoutSalesReturnsInput
    lines?: SalesReturnLineCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnUncheckedCreateWithoutWarehouseInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: SalesReturnLineUncheckedCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnCreateOrConnectWithoutWarehouseInput = {
    where: SalesReturnWhereUniqueInput
    create: XOR<SalesReturnCreateWithoutWarehouseInput, SalesReturnUncheckedCreateWithoutWarehouseInput>
  }

  export type SalesReturnCreateManyWarehouseInputEnvelope = {
    data: SalesReturnCreateManyWarehouseInput | SalesReturnCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type ExpenseCreateWithoutWarehouseInput = {
    id?: string
    reference: string
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    category?: ExpenseCategoryCreateNestedOneWithoutExpensesInput
    branch?: BranchCreateNestedOneWithoutExpensesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutExpensesInput
  }

  export type ExpenseUncheckedCreateWithoutWarehouseInput = {
    id?: string
    reference: string
    categoryId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCreateOrConnectWithoutWarehouseInput = {
    where: ExpenseWhereUniqueInput
    create: XOR<ExpenseCreateWithoutWarehouseInput, ExpenseUncheckedCreateWithoutWarehouseInput>
  }

  export type ExpenseCreateManyWarehouseInputEnvelope = {
    data: ExpenseCreateManyWarehouseInput | ExpenseCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type InventoryTransferCreateWithoutFromWarehouseInput = {
    id?: string
    reference: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    toWarehouse: WarehouseCreateNestedOneWithoutTransfersToInput
    branch?: BranchCreateNestedOneWithoutTransfersInput
    lines?: InventoryTransferLineCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferUncheckedCreateWithoutFromWarehouseInput = {
    id?: string
    reference: string
    toWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryTransferLineUncheckedCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferCreateOrConnectWithoutFromWarehouseInput = {
    where: InventoryTransferWhereUniqueInput
    create: XOR<InventoryTransferCreateWithoutFromWarehouseInput, InventoryTransferUncheckedCreateWithoutFromWarehouseInput>
  }

  export type InventoryTransferCreateManyFromWarehouseInputEnvelope = {
    data: InventoryTransferCreateManyFromWarehouseInput | InventoryTransferCreateManyFromWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type InventoryTransferCreateWithoutToWarehouseInput = {
    id?: string
    reference: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    fromWarehouse: WarehouseCreateNestedOneWithoutTransfersFromInput
    branch?: BranchCreateNestedOneWithoutTransfersInput
    lines?: InventoryTransferLineCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferUncheckedCreateWithoutToWarehouseInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: InventoryTransferLineUncheckedCreateNestedManyWithoutTransferInput
  }

  export type InventoryTransferCreateOrConnectWithoutToWarehouseInput = {
    where: InventoryTransferWhereUniqueInput
    create: XOR<InventoryTransferCreateWithoutToWarehouseInput, InventoryTransferUncheckedCreateWithoutToWarehouseInput>
  }

  export type InventoryTransferCreateManyToWarehouseInputEnvelope = {
    data: InventoryTransferCreateManyToWarehouseInput | InventoryTransferCreateManyToWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type WarehouseStockCreateWithoutWarehouseInput = {
    id?: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    product: ProductCreateNestedOneWithoutWarehouseStocksInput
  }

  export type WarehouseStockUncheckedCreateWithoutWarehouseInput = {
    id?: string
    productId: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseStockCreateOrConnectWithoutWarehouseInput = {
    where: WarehouseStockWhereUniqueInput
    create: XOR<WarehouseStockCreateWithoutWarehouseInput, WarehouseStockUncheckedCreateWithoutWarehouseInput>
  }

  export type WarehouseStockCreateManyWarehouseInputEnvelope = {
    data: WarehouseStockCreateManyWarehouseInput | WarehouseStockCreateManyWarehouseInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutWarehousesInput = {
    update: XOR<BranchUpdateWithoutWarehousesInput, BranchUncheckedUpdateWithoutWarehousesInput>
    create: XOR<BranchCreateWithoutWarehousesInput, BranchUncheckedCreateWithoutWarehousesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutWarehousesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutWarehousesInput, BranchUncheckedUpdateWithoutWarehousesInput>
  }

  export type BranchUpdateWithoutWarehousesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutWarehousesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type ProductUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutWarehouseInput, ProductUncheckedUpdateWithoutWarehouseInput>
    create: XOR<ProductCreateWithoutWarehouseInput, ProductUncheckedCreateWithoutWarehouseInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutWarehouseInput, ProductUncheckedUpdateWithoutWarehouseInput>
  }

  export type ProductUpdateManyWithWhereWithoutWarehouseInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type InventoryAdjustmentUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: InventoryAdjustmentWhereUniqueInput
    update: XOR<InventoryAdjustmentUpdateWithoutWarehouseInput, InventoryAdjustmentUncheckedUpdateWithoutWarehouseInput>
    create: XOR<InventoryAdjustmentCreateWithoutWarehouseInput, InventoryAdjustmentUncheckedCreateWithoutWarehouseInput>
  }

  export type InventoryAdjustmentUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: InventoryAdjustmentWhereUniqueInput
    data: XOR<InventoryAdjustmentUpdateWithoutWarehouseInput, InventoryAdjustmentUncheckedUpdateWithoutWarehouseInput>
  }

  export type InventoryAdjustmentUpdateManyWithWhereWithoutWarehouseInput = {
    where: InventoryAdjustmentScalarWhereInput
    data: XOR<InventoryAdjustmentUpdateManyMutationInput, InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type PurchaseUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: PurchaseWhereUniqueInput
    update: XOR<PurchaseUpdateWithoutWarehouseInput, PurchaseUncheckedUpdateWithoutWarehouseInput>
    create: XOR<PurchaseCreateWithoutWarehouseInput, PurchaseUncheckedCreateWithoutWarehouseInput>
  }

  export type PurchaseUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: PurchaseWhereUniqueInput
    data: XOR<PurchaseUpdateWithoutWarehouseInput, PurchaseUncheckedUpdateWithoutWarehouseInput>
  }

  export type PurchaseUpdateManyWithWhereWithoutWarehouseInput = {
    where: PurchaseScalarWhereInput
    data: XOR<PurchaseUpdateManyMutationInput, PurchaseUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type PurchaseReturnUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: PurchaseReturnWhereUniqueInput
    update: XOR<PurchaseReturnUpdateWithoutWarehouseInput, PurchaseReturnUncheckedUpdateWithoutWarehouseInput>
    create: XOR<PurchaseReturnCreateWithoutWarehouseInput, PurchaseReturnUncheckedCreateWithoutWarehouseInput>
  }

  export type PurchaseReturnUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: PurchaseReturnWhereUniqueInput
    data: XOR<PurchaseReturnUpdateWithoutWarehouseInput, PurchaseReturnUncheckedUpdateWithoutWarehouseInput>
  }

  export type PurchaseReturnUpdateManyWithWhereWithoutWarehouseInput = {
    where: PurchaseReturnScalarWhereInput
    data: XOR<PurchaseReturnUpdateManyMutationInput, PurchaseReturnUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type SaleUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: SaleWhereUniqueInput
    update: XOR<SaleUpdateWithoutWarehouseInput, SaleUncheckedUpdateWithoutWarehouseInput>
    create: XOR<SaleCreateWithoutWarehouseInput, SaleUncheckedCreateWithoutWarehouseInput>
  }

  export type SaleUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: SaleWhereUniqueInput
    data: XOR<SaleUpdateWithoutWarehouseInput, SaleUncheckedUpdateWithoutWarehouseInput>
  }

  export type SaleUpdateManyWithWhereWithoutWarehouseInput = {
    where: SaleScalarWhereInput
    data: XOR<SaleUpdateManyMutationInput, SaleUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type SalesReturnUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: SalesReturnWhereUniqueInput
    update: XOR<SalesReturnUpdateWithoutWarehouseInput, SalesReturnUncheckedUpdateWithoutWarehouseInput>
    create: XOR<SalesReturnCreateWithoutWarehouseInput, SalesReturnUncheckedCreateWithoutWarehouseInput>
  }

  export type SalesReturnUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: SalesReturnWhereUniqueInput
    data: XOR<SalesReturnUpdateWithoutWarehouseInput, SalesReturnUncheckedUpdateWithoutWarehouseInput>
  }

  export type SalesReturnUpdateManyWithWhereWithoutWarehouseInput = {
    where: SalesReturnScalarWhereInput
    data: XOR<SalesReturnUpdateManyMutationInput, SalesReturnUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type ExpenseUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: ExpenseWhereUniqueInput
    update: XOR<ExpenseUpdateWithoutWarehouseInput, ExpenseUncheckedUpdateWithoutWarehouseInput>
    create: XOR<ExpenseCreateWithoutWarehouseInput, ExpenseUncheckedCreateWithoutWarehouseInput>
  }

  export type ExpenseUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: ExpenseWhereUniqueInput
    data: XOR<ExpenseUpdateWithoutWarehouseInput, ExpenseUncheckedUpdateWithoutWarehouseInput>
  }

  export type ExpenseUpdateManyWithWhereWithoutWarehouseInput = {
    where: ExpenseScalarWhereInput
    data: XOR<ExpenseUpdateManyMutationInput, ExpenseUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type InventoryTransferUpsertWithWhereUniqueWithoutFromWarehouseInput = {
    where: InventoryTransferWhereUniqueInput
    update: XOR<InventoryTransferUpdateWithoutFromWarehouseInput, InventoryTransferUncheckedUpdateWithoutFromWarehouseInput>
    create: XOR<InventoryTransferCreateWithoutFromWarehouseInput, InventoryTransferUncheckedCreateWithoutFromWarehouseInput>
  }

  export type InventoryTransferUpdateWithWhereUniqueWithoutFromWarehouseInput = {
    where: InventoryTransferWhereUniqueInput
    data: XOR<InventoryTransferUpdateWithoutFromWarehouseInput, InventoryTransferUncheckedUpdateWithoutFromWarehouseInput>
  }

  export type InventoryTransferUpdateManyWithWhereWithoutFromWarehouseInput = {
    where: InventoryTransferScalarWhereInput
    data: XOR<InventoryTransferUpdateManyMutationInput, InventoryTransferUncheckedUpdateManyWithoutFromWarehouseInput>
  }

  export type InventoryTransferUpsertWithWhereUniqueWithoutToWarehouseInput = {
    where: InventoryTransferWhereUniqueInput
    update: XOR<InventoryTransferUpdateWithoutToWarehouseInput, InventoryTransferUncheckedUpdateWithoutToWarehouseInput>
    create: XOR<InventoryTransferCreateWithoutToWarehouseInput, InventoryTransferUncheckedCreateWithoutToWarehouseInput>
  }

  export type InventoryTransferUpdateWithWhereUniqueWithoutToWarehouseInput = {
    where: InventoryTransferWhereUniqueInput
    data: XOR<InventoryTransferUpdateWithoutToWarehouseInput, InventoryTransferUncheckedUpdateWithoutToWarehouseInput>
  }

  export type InventoryTransferUpdateManyWithWhereWithoutToWarehouseInput = {
    where: InventoryTransferScalarWhereInput
    data: XOR<InventoryTransferUpdateManyMutationInput, InventoryTransferUncheckedUpdateManyWithoutToWarehouseInput>
  }

  export type WarehouseStockUpsertWithWhereUniqueWithoutWarehouseInput = {
    where: WarehouseStockWhereUniqueInput
    update: XOR<WarehouseStockUpdateWithoutWarehouseInput, WarehouseStockUncheckedUpdateWithoutWarehouseInput>
    create: XOR<WarehouseStockCreateWithoutWarehouseInput, WarehouseStockUncheckedCreateWithoutWarehouseInput>
  }

  export type WarehouseStockUpdateWithWhereUniqueWithoutWarehouseInput = {
    where: WarehouseStockWhereUniqueInput
    data: XOR<WarehouseStockUpdateWithoutWarehouseInput, WarehouseStockUncheckedUpdateWithoutWarehouseInput>
  }

  export type WarehouseStockUpdateManyWithWhereWithoutWarehouseInput = {
    where: WarehouseStockScalarWhereInput
    data: XOR<WarehouseStockUpdateManyMutationInput, WarehouseStockUncheckedUpdateManyWithoutWarehouseInput>
  }

  export type WarehouseStockScalarWhereInput = {
    AND?: WarehouseStockScalarWhereInput | WarehouseStockScalarWhereInput[]
    OR?: WarehouseStockScalarWhereInput[]
    NOT?: WarehouseStockScalarWhereInput | WarehouseStockScalarWhereInput[]
    id?: StringFilter<"WarehouseStock"> | string
    warehouseId?: StringFilter<"WarehouseStock"> | string
    productId?: StringFilter<"WarehouseStock"> | string
    quantity?: IntFilter<"WarehouseStock"> | number
    createdAt?: DateTimeFilter<"WarehouseStock"> | Date | string
    updatedAt?: DateTimeFilter<"WarehouseStock"> | Date | string
  }

  export type WarehouseCreateWithoutStocksInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutStocksInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutStocksInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutStocksInput, WarehouseUncheckedCreateWithoutStocksInput>
  }

  export type ProductCreateWithoutWarehouseStocksInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutWarehouseStocksInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutWarehouseStocksInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutWarehouseStocksInput, ProductUncheckedCreateWithoutWarehouseStocksInput>
  }

  export type WarehouseUpsertWithoutStocksInput = {
    update: XOR<WarehouseUpdateWithoutStocksInput, WarehouseUncheckedUpdateWithoutStocksInput>
    create: XOR<WarehouseCreateWithoutStocksInput, WarehouseUncheckedCreateWithoutStocksInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutStocksInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutStocksInput, WarehouseUncheckedUpdateWithoutStocksInput>
  }

  export type WarehouseUpdateWithoutStocksInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutStocksInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
  }

  export type ProductUpsertWithoutWarehouseStocksInput = {
    update: XOR<ProductUpdateWithoutWarehouseStocksInput, ProductUncheckedUpdateWithoutWarehouseStocksInput>
    create: XOR<ProductCreateWithoutWarehouseStocksInput, ProductUncheckedCreateWithoutWarehouseStocksInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutWarehouseStocksInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutWarehouseStocksInput, ProductUncheckedUpdateWithoutWarehouseStocksInput>
  }

  export type ProductUpdateWithoutWarehouseStocksInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutWarehouseStocksInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
  }

  export type BranchCreateWithoutSuppliersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutSuppliersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutSuppliersInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutSuppliersInput, BranchUncheckedCreateWithoutSuppliersInput>
  }

  export type PurchaseCreateWithoutSupplierInput = {
    id?: string
    number: string
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    warehouse?: WarehouseCreateNestedOneWithoutPurchasesInput
    branch?: BranchCreateNestedOneWithoutPurchasesInput
    lines?: PurchaseLineCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUncheckedCreateWithoutSupplierInput = {
    id?: string
    number: string
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: PurchaseLineUncheckedCreateNestedManyWithoutPurchaseInput
    returns?: PurchaseReturnUncheckedCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseCreateOrConnectWithoutSupplierInput = {
    where: PurchaseWhereUniqueInput
    create: XOR<PurchaseCreateWithoutSupplierInput, PurchaseUncheckedCreateWithoutSupplierInput>
  }

  export type PurchaseCreateManySupplierInputEnvelope = {
    data: PurchaseCreateManySupplierInput | PurchaseCreateManySupplierInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseReturnCreateWithoutSupplierInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    purchase?: PurchaseCreateNestedOneWithoutReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchaseReturnsInput
    branch?: BranchCreateNestedOneWithoutPurchaseReturnsInput
    lines?: PurchaseReturnLineCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnUncheckedCreateWithoutSupplierInput = {
    id?: string
    number: string
    purchaseId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnCreateOrConnectWithoutSupplierInput = {
    where: PurchaseReturnWhereUniqueInput
    create: XOR<PurchaseReturnCreateWithoutSupplierInput, PurchaseReturnUncheckedCreateWithoutSupplierInput>
  }

  export type PurchaseReturnCreateManySupplierInputEnvelope = {
    data: PurchaseReturnCreateManySupplierInput | PurchaseReturnCreateManySupplierInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutSuppliersInput = {
    update: XOR<BranchUpdateWithoutSuppliersInput, BranchUncheckedUpdateWithoutSuppliersInput>
    create: XOR<BranchCreateWithoutSuppliersInput, BranchUncheckedCreateWithoutSuppliersInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutSuppliersInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutSuppliersInput, BranchUncheckedUpdateWithoutSuppliersInput>
  }

  export type BranchUpdateWithoutSuppliersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutSuppliersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type PurchaseUpsertWithWhereUniqueWithoutSupplierInput = {
    where: PurchaseWhereUniqueInput
    update: XOR<PurchaseUpdateWithoutSupplierInput, PurchaseUncheckedUpdateWithoutSupplierInput>
    create: XOR<PurchaseCreateWithoutSupplierInput, PurchaseUncheckedCreateWithoutSupplierInput>
  }

  export type PurchaseUpdateWithWhereUniqueWithoutSupplierInput = {
    where: PurchaseWhereUniqueInput
    data: XOR<PurchaseUpdateWithoutSupplierInput, PurchaseUncheckedUpdateWithoutSupplierInput>
  }

  export type PurchaseUpdateManyWithWhereWithoutSupplierInput = {
    where: PurchaseScalarWhereInput
    data: XOR<PurchaseUpdateManyMutationInput, PurchaseUncheckedUpdateManyWithoutSupplierInput>
  }

  export type PurchaseReturnUpsertWithWhereUniqueWithoutSupplierInput = {
    where: PurchaseReturnWhereUniqueInput
    update: XOR<PurchaseReturnUpdateWithoutSupplierInput, PurchaseReturnUncheckedUpdateWithoutSupplierInput>
    create: XOR<PurchaseReturnCreateWithoutSupplierInput, PurchaseReturnUncheckedCreateWithoutSupplierInput>
  }

  export type PurchaseReturnUpdateWithWhereUniqueWithoutSupplierInput = {
    where: PurchaseReturnWhereUniqueInput
    data: XOR<PurchaseReturnUpdateWithoutSupplierInput, PurchaseReturnUncheckedUpdateWithoutSupplierInput>
  }

  export type PurchaseReturnUpdateManyWithWhereWithoutSupplierInput = {
    where: PurchaseReturnScalarWhereInput
    data: XOR<PurchaseReturnUpdateManyMutationInput, PurchaseReturnUncheckedUpdateManyWithoutSupplierInput>
  }

  export type SupplierCreateWithoutPurchasesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutSuppliersInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutSupplierInput
  }

  export type SupplierUncheckedCreateWithoutPurchasesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutSupplierInput
  }

  export type SupplierCreateOrConnectWithoutPurchasesInput = {
    where: SupplierWhereUniqueInput
    create: XOR<SupplierCreateWithoutPurchasesInput, SupplierUncheckedCreateWithoutPurchasesInput>
  }

  export type WarehouseCreateWithoutPurchasesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutPurchasesInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutPurchasesInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutPurchasesInput, WarehouseUncheckedCreateWithoutPurchasesInput>
  }

  export type BranchCreateWithoutPurchasesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutPurchasesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutPurchasesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutPurchasesInput, BranchUncheckedCreateWithoutPurchasesInput>
  }

  export type PurchaseLineCreateWithoutPurchaseInput = {
    id?: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
    product: ProductCreateNestedOneWithoutPurchaseLinesInput
  }

  export type PurchaseLineUncheckedCreateWithoutPurchaseInput = {
    id?: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseLineCreateOrConnectWithoutPurchaseInput = {
    where: PurchaseLineWhereUniqueInput
    create: XOR<PurchaseLineCreateWithoutPurchaseInput, PurchaseLineUncheckedCreateWithoutPurchaseInput>
  }

  export type PurchaseLineCreateManyPurchaseInputEnvelope = {
    data: PurchaseLineCreateManyPurchaseInput | PurchaseLineCreateManyPurchaseInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseReturnCreateWithoutPurchaseInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    supplier?: SupplierCreateNestedOneWithoutPurchaseReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchaseReturnsInput
    branch?: BranchCreateNestedOneWithoutPurchaseReturnsInput
    lines?: PurchaseReturnLineCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnUncheckedCreateWithoutPurchaseInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutPurchaseReturnInput
  }

  export type PurchaseReturnCreateOrConnectWithoutPurchaseInput = {
    where: PurchaseReturnWhereUniqueInput
    create: XOR<PurchaseReturnCreateWithoutPurchaseInput, PurchaseReturnUncheckedCreateWithoutPurchaseInput>
  }

  export type PurchaseReturnCreateManyPurchaseInputEnvelope = {
    data: PurchaseReturnCreateManyPurchaseInput | PurchaseReturnCreateManyPurchaseInput[]
    skipDuplicates?: boolean
  }

  export type SupplierUpsertWithoutPurchasesInput = {
    update: XOR<SupplierUpdateWithoutPurchasesInput, SupplierUncheckedUpdateWithoutPurchasesInput>
    create: XOR<SupplierCreateWithoutPurchasesInput, SupplierUncheckedCreateWithoutPurchasesInput>
    where?: SupplierWhereInput
  }

  export type SupplierUpdateToOneWithWhereWithoutPurchasesInput = {
    where?: SupplierWhereInput
    data: XOR<SupplierUpdateWithoutPurchasesInput, SupplierUncheckedUpdateWithoutPurchasesInput>
  }

  export type SupplierUpdateWithoutPurchasesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutSuppliersNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutSupplierNestedInput
  }

  export type SupplierUncheckedUpdateWithoutPurchasesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutSupplierNestedInput
  }

  export type WarehouseUpsertWithoutPurchasesInput = {
    update: XOR<WarehouseUpdateWithoutPurchasesInput, WarehouseUncheckedUpdateWithoutPurchasesInput>
    create: XOR<WarehouseCreateWithoutPurchasesInput, WarehouseUncheckedCreateWithoutPurchasesInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutPurchasesInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutPurchasesInput, WarehouseUncheckedUpdateWithoutPurchasesInput>
  }

  export type WarehouseUpdateWithoutPurchasesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutPurchasesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutPurchasesInput = {
    update: XOR<BranchUpdateWithoutPurchasesInput, BranchUncheckedUpdateWithoutPurchasesInput>
    create: XOR<BranchCreateWithoutPurchasesInput, BranchUncheckedCreateWithoutPurchasesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutPurchasesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutPurchasesInput, BranchUncheckedUpdateWithoutPurchasesInput>
  }

  export type BranchUpdateWithoutPurchasesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutPurchasesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type PurchaseLineUpsertWithWhereUniqueWithoutPurchaseInput = {
    where: PurchaseLineWhereUniqueInput
    update: XOR<PurchaseLineUpdateWithoutPurchaseInput, PurchaseLineUncheckedUpdateWithoutPurchaseInput>
    create: XOR<PurchaseLineCreateWithoutPurchaseInput, PurchaseLineUncheckedCreateWithoutPurchaseInput>
  }

  export type PurchaseLineUpdateWithWhereUniqueWithoutPurchaseInput = {
    where: PurchaseLineWhereUniqueInput
    data: XOR<PurchaseLineUpdateWithoutPurchaseInput, PurchaseLineUncheckedUpdateWithoutPurchaseInput>
  }

  export type PurchaseLineUpdateManyWithWhereWithoutPurchaseInput = {
    where: PurchaseLineScalarWhereInput
    data: XOR<PurchaseLineUpdateManyMutationInput, PurchaseLineUncheckedUpdateManyWithoutPurchaseInput>
  }

  export type PurchaseLineScalarWhereInput = {
    AND?: PurchaseLineScalarWhereInput | PurchaseLineScalarWhereInput[]
    OR?: PurchaseLineScalarWhereInput[]
    NOT?: PurchaseLineScalarWhereInput | PurchaseLineScalarWhereInput[]
    id?: StringFilter<"PurchaseLine"> | string
    purchaseId?: StringFilter<"PurchaseLine"> | string
    productId?: StringFilter<"PurchaseLine"> | string
    quantity?: IntFilter<"PurchaseLine"> | number
    unitCost?: FloatFilter<"PurchaseLine"> | number
    taxRate?: FloatFilter<"PurchaseLine"> | number
    lineTotal?: FloatFilter<"PurchaseLine"> | number
  }

  export type PurchaseReturnUpsertWithWhereUniqueWithoutPurchaseInput = {
    where: PurchaseReturnWhereUniqueInput
    update: XOR<PurchaseReturnUpdateWithoutPurchaseInput, PurchaseReturnUncheckedUpdateWithoutPurchaseInput>
    create: XOR<PurchaseReturnCreateWithoutPurchaseInput, PurchaseReturnUncheckedCreateWithoutPurchaseInput>
  }

  export type PurchaseReturnUpdateWithWhereUniqueWithoutPurchaseInput = {
    where: PurchaseReturnWhereUniqueInput
    data: XOR<PurchaseReturnUpdateWithoutPurchaseInput, PurchaseReturnUncheckedUpdateWithoutPurchaseInput>
  }

  export type PurchaseReturnUpdateManyWithWhereWithoutPurchaseInput = {
    where: PurchaseReturnScalarWhereInput
    data: XOR<PurchaseReturnUpdateManyMutationInput, PurchaseReturnUncheckedUpdateManyWithoutPurchaseInput>
  }

  export type PurchaseCreateWithoutLinesInput = {
    id?: string
    number: string
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    supplier?: SupplierCreateNestedOneWithoutPurchasesInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchasesInput
    branch?: BranchCreateNestedOneWithoutPurchasesInput
    returns?: PurchaseReturnCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUncheckedCreateWithoutLinesInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    returns?: PurchaseReturnUncheckedCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseCreateOrConnectWithoutLinesInput = {
    where: PurchaseWhereUniqueInput
    create: XOR<PurchaseCreateWithoutLinesInput, PurchaseUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutPurchaseLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutPurchaseLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutPurchaseLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutPurchaseLinesInput, ProductUncheckedCreateWithoutPurchaseLinesInput>
  }

  export type PurchaseUpsertWithoutLinesInput = {
    update: XOR<PurchaseUpdateWithoutLinesInput, PurchaseUncheckedUpdateWithoutLinesInput>
    create: XOR<PurchaseCreateWithoutLinesInput, PurchaseUncheckedCreateWithoutLinesInput>
    where?: PurchaseWhereInput
  }

  export type PurchaseUpdateToOneWithWhereWithoutLinesInput = {
    where?: PurchaseWhereInput
    data: XOR<PurchaseUpdateWithoutLinesInput, PurchaseUncheckedUpdateWithoutLinesInput>
  }

  export type PurchaseUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    supplier?: SupplierUpdateOneWithoutPurchasesNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchasesNestedInput
    branch?: BranchUpdateOneWithoutPurchasesNestedInput
    returns?: PurchaseReturnUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    returns?: PurchaseReturnUncheckedUpdateManyWithoutPurchaseNestedInput
  }

  export type ProductUpsertWithoutPurchaseLinesInput = {
    update: XOR<ProductUpdateWithoutPurchaseLinesInput, ProductUncheckedUpdateWithoutPurchaseLinesInput>
    create: XOR<ProductCreateWithoutPurchaseLinesInput, ProductUncheckedCreateWithoutPurchaseLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutPurchaseLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutPurchaseLinesInput, ProductUncheckedUpdateWithoutPurchaseLinesInput>
  }

  export type ProductUpdateWithoutPurchaseLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutPurchaseLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type PurchaseCreateWithoutReturnsInput = {
    id?: string
    number: string
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    supplier?: SupplierCreateNestedOneWithoutPurchasesInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchasesInput
    branch?: BranchCreateNestedOneWithoutPurchasesInput
    lines?: PurchaseLineCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseUncheckedCreateWithoutReturnsInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: PurchaseLineUncheckedCreateNestedManyWithoutPurchaseInput
  }

  export type PurchaseCreateOrConnectWithoutReturnsInput = {
    where: PurchaseWhereUniqueInput
    create: XOR<PurchaseCreateWithoutReturnsInput, PurchaseUncheckedCreateWithoutReturnsInput>
  }

  export type SupplierCreateWithoutPurchaseReturnsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutSuppliersInput
    purchases?: PurchaseCreateNestedManyWithoutSupplierInput
  }

  export type SupplierUncheckedCreateWithoutPurchaseReturnsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    purchases?: PurchaseUncheckedCreateNestedManyWithoutSupplierInput
  }

  export type SupplierCreateOrConnectWithoutPurchaseReturnsInput = {
    where: SupplierWhereUniqueInput
    create: XOR<SupplierCreateWithoutPurchaseReturnsInput, SupplierUncheckedCreateWithoutPurchaseReturnsInput>
  }

  export type WarehouseCreateWithoutPurchaseReturnsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutPurchaseReturnsInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutPurchaseReturnsInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutPurchaseReturnsInput, WarehouseUncheckedCreateWithoutPurchaseReturnsInput>
  }

  export type BranchCreateWithoutPurchaseReturnsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutPurchaseReturnsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutPurchaseReturnsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutPurchaseReturnsInput, BranchUncheckedCreateWithoutPurchaseReturnsInput>
  }

  export type PurchaseReturnLineCreateWithoutPurchaseReturnInput = {
    id?: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
    product: ProductCreateNestedOneWithoutPurchaseReturnLinesInput
  }

  export type PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput = {
    id?: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnLineCreateOrConnectWithoutPurchaseReturnInput = {
    where: PurchaseReturnLineWhereUniqueInput
    create: XOR<PurchaseReturnLineCreateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput>
  }

  export type PurchaseReturnLineCreateManyPurchaseReturnInputEnvelope = {
    data: PurchaseReturnLineCreateManyPurchaseReturnInput | PurchaseReturnLineCreateManyPurchaseReturnInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseUpsertWithoutReturnsInput = {
    update: XOR<PurchaseUpdateWithoutReturnsInput, PurchaseUncheckedUpdateWithoutReturnsInput>
    create: XOR<PurchaseCreateWithoutReturnsInput, PurchaseUncheckedCreateWithoutReturnsInput>
    where?: PurchaseWhereInput
  }

  export type PurchaseUpdateToOneWithWhereWithoutReturnsInput = {
    where?: PurchaseWhereInput
    data: XOR<PurchaseUpdateWithoutReturnsInput, PurchaseUncheckedUpdateWithoutReturnsInput>
  }

  export type PurchaseUpdateWithoutReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    supplier?: SupplierUpdateOneWithoutPurchasesNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchasesNestedInput
    branch?: BranchUpdateOneWithoutPurchasesNestedInput
    lines?: PurchaseLineUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateWithoutReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: PurchaseLineUncheckedUpdateManyWithoutPurchaseNestedInput
  }

  export type SupplierUpsertWithoutPurchaseReturnsInput = {
    update: XOR<SupplierUpdateWithoutPurchaseReturnsInput, SupplierUncheckedUpdateWithoutPurchaseReturnsInput>
    create: XOR<SupplierCreateWithoutPurchaseReturnsInput, SupplierUncheckedCreateWithoutPurchaseReturnsInput>
    where?: SupplierWhereInput
  }

  export type SupplierUpdateToOneWithWhereWithoutPurchaseReturnsInput = {
    where?: SupplierWhereInput
    data: XOR<SupplierUpdateWithoutPurchaseReturnsInput, SupplierUncheckedUpdateWithoutPurchaseReturnsInput>
  }

  export type SupplierUpdateWithoutPurchaseReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutSuppliersNestedInput
    purchases?: PurchaseUpdateManyWithoutSupplierNestedInput
  }

  export type SupplierUncheckedUpdateWithoutPurchaseReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    purchases?: PurchaseUncheckedUpdateManyWithoutSupplierNestedInput
  }

  export type WarehouseUpsertWithoutPurchaseReturnsInput = {
    update: XOR<WarehouseUpdateWithoutPurchaseReturnsInput, WarehouseUncheckedUpdateWithoutPurchaseReturnsInput>
    create: XOR<WarehouseCreateWithoutPurchaseReturnsInput, WarehouseUncheckedCreateWithoutPurchaseReturnsInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutPurchaseReturnsInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutPurchaseReturnsInput, WarehouseUncheckedUpdateWithoutPurchaseReturnsInput>
  }

  export type WarehouseUpdateWithoutPurchaseReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutPurchaseReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutPurchaseReturnsInput = {
    update: XOR<BranchUpdateWithoutPurchaseReturnsInput, BranchUncheckedUpdateWithoutPurchaseReturnsInput>
    create: XOR<BranchCreateWithoutPurchaseReturnsInput, BranchUncheckedCreateWithoutPurchaseReturnsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutPurchaseReturnsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutPurchaseReturnsInput, BranchUncheckedUpdateWithoutPurchaseReturnsInput>
  }

  export type BranchUpdateWithoutPurchaseReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutPurchaseReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type PurchaseReturnLineUpsertWithWhereUniqueWithoutPurchaseReturnInput = {
    where: PurchaseReturnLineWhereUniqueInput
    update: XOR<PurchaseReturnLineUpdateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedUpdateWithoutPurchaseReturnInput>
    create: XOR<PurchaseReturnLineCreateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedCreateWithoutPurchaseReturnInput>
  }

  export type PurchaseReturnLineUpdateWithWhereUniqueWithoutPurchaseReturnInput = {
    where: PurchaseReturnLineWhereUniqueInput
    data: XOR<PurchaseReturnLineUpdateWithoutPurchaseReturnInput, PurchaseReturnLineUncheckedUpdateWithoutPurchaseReturnInput>
  }

  export type PurchaseReturnLineUpdateManyWithWhereWithoutPurchaseReturnInput = {
    where: PurchaseReturnLineScalarWhereInput
    data: XOR<PurchaseReturnLineUpdateManyMutationInput, PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnInput>
  }

  export type PurchaseReturnLineScalarWhereInput = {
    AND?: PurchaseReturnLineScalarWhereInput | PurchaseReturnLineScalarWhereInput[]
    OR?: PurchaseReturnLineScalarWhereInput[]
    NOT?: PurchaseReturnLineScalarWhereInput | PurchaseReturnLineScalarWhereInput[]
    id?: StringFilter<"PurchaseReturnLine"> | string
    purchaseReturnId?: StringFilter<"PurchaseReturnLine"> | string
    productId?: StringFilter<"PurchaseReturnLine"> | string
    quantity?: IntFilter<"PurchaseReturnLine"> | number
    unitCost?: FloatFilter<"PurchaseReturnLine"> | number
    taxRate?: FloatFilter<"PurchaseReturnLine"> | number
    lineTotal?: FloatFilter<"PurchaseReturnLine"> | number
  }

  export type PurchaseReturnCreateWithoutLinesInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    purchase?: PurchaseCreateNestedOneWithoutReturnsInput
    supplier?: SupplierCreateNestedOneWithoutPurchaseReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutPurchaseReturnsInput
    branch?: BranchCreateNestedOneWithoutPurchaseReturnsInput
  }

  export type PurchaseReturnUncheckedCreateWithoutLinesInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PurchaseReturnCreateOrConnectWithoutLinesInput = {
    where: PurchaseReturnWhereUniqueInput
    create: XOR<PurchaseReturnCreateWithoutLinesInput, PurchaseReturnUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutPurchaseReturnLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutPurchaseReturnLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutPurchaseReturnLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutPurchaseReturnLinesInput, ProductUncheckedCreateWithoutPurchaseReturnLinesInput>
  }

  export type PurchaseReturnUpsertWithoutLinesInput = {
    update: XOR<PurchaseReturnUpdateWithoutLinesInput, PurchaseReturnUncheckedUpdateWithoutLinesInput>
    create: XOR<PurchaseReturnCreateWithoutLinesInput, PurchaseReturnUncheckedCreateWithoutLinesInput>
    where?: PurchaseReturnWhereInput
  }

  export type PurchaseReturnUpdateToOneWithWhereWithoutLinesInput = {
    where?: PurchaseReturnWhereInput
    data: XOR<PurchaseReturnUpdateWithoutLinesInput, PurchaseReturnUncheckedUpdateWithoutLinesInput>
  }

  export type PurchaseReturnUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    purchase?: PurchaseUpdateOneWithoutReturnsNestedInput
    supplier?: SupplierUpdateOneWithoutPurchaseReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchaseReturnsNestedInput
    branch?: BranchUpdateOneWithoutPurchaseReturnsNestedInput
  }

  export type PurchaseReturnUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ProductUpsertWithoutPurchaseReturnLinesInput = {
    update: XOR<ProductUpdateWithoutPurchaseReturnLinesInput, ProductUncheckedUpdateWithoutPurchaseReturnLinesInput>
    create: XOR<ProductCreateWithoutPurchaseReturnLinesInput, ProductUncheckedCreateWithoutPurchaseReturnLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutPurchaseReturnLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutPurchaseReturnLinesInput, ProductUncheckedUpdateWithoutPurchaseReturnLinesInput>
  }

  export type ProductUpdateWithoutPurchaseReturnLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutPurchaseReturnLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type BranchCreateWithoutCustomersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutCustomersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutCustomersInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutCustomersInput, BranchUncheckedCreateWithoutCustomersInput>
  }

  export type InvoiceCreateWithoutCustomerInput = {
    id?: string
    number: string
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    sale?: SaleCreateNestedOneWithoutInvoicesInput
    branch?: BranchCreateNestedOneWithoutInvoicesInput
    lines?: InvoiceLineCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceUncheckedCreateWithoutCustomerInput = {
    id?: string
    number: string
    saleId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: InvoiceLineUncheckedCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceCreateOrConnectWithoutCustomerInput = {
    where: InvoiceWhereUniqueInput
    create: XOR<InvoiceCreateWithoutCustomerInput, InvoiceUncheckedCreateWithoutCustomerInput>
  }

  export type InvoiceCreateManyCustomerInputEnvelope = {
    data: InvoiceCreateManyCustomerInput | InvoiceCreateManyCustomerInput[]
    skipDuplicates?: boolean
  }

  export type SaleCreateWithoutCustomerInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutCustomerInput = {
    id?: string
    number: string
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutCustomerInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutCustomerInput, SaleUncheckedCreateWithoutCustomerInput>
  }

  export type SaleCreateManyCustomerInputEnvelope = {
    data: SaleCreateManyCustomerInput | SaleCreateManyCustomerInput[]
    skipDuplicates?: boolean
  }

  export type SalesReturnCreateWithoutCustomerInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    sale?: SaleCreateNestedOneWithoutReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesReturnsInput
    branch?: BranchCreateNestedOneWithoutSalesReturnsInput
    lines?: SalesReturnLineCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnUncheckedCreateWithoutCustomerInput = {
    id?: string
    number: string
    saleId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: SalesReturnLineUncheckedCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnCreateOrConnectWithoutCustomerInput = {
    where: SalesReturnWhereUniqueInput
    create: XOR<SalesReturnCreateWithoutCustomerInput, SalesReturnUncheckedCreateWithoutCustomerInput>
  }

  export type SalesReturnCreateManyCustomerInputEnvelope = {
    data: SalesReturnCreateManyCustomerInput | SalesReturnCreateManyCustomerInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutCustomersInput = {
    update: XOR<BranchUpdateWithoutCustomersInput, BranchUncheckedUpdateWithoutCustomersInput>
    create: XOR<BranchCreateWithoutCustomersInput, BranchUncheckedCreateWithoutCustomersInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutCustomersInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutCustomersInput, BranchUncheckedUpdateWithoutCustomersInput>
  }

  export type BranchUpdateWithoutCustomersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutCustomersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type InvoiceUpsertWithWhereUniqueWithoutCustomerInput = {
    where: InvoiceWhereUniqueInput
    update: XOR<InvoiceUpdateWithoutCustomerInput, InvoiceUncheckedUpdateWithoutCustomerInput>
    create: XOR<InvoiceCreateWithoutCustomerInput, InvoiceUncheckedCreateWithoutCustomerInput>
  }

  export type InvoiceUpdateWithWhereUniqueWithoutCustomerInput = {
    where: InvoiceWhereUniqueInput
    data: XOR<InvoiceUpdateWithoutCustomerInput, InvoiceUncheckedUpdateWithoutCustomerInput>
  }

  export type InvoiceUpdateManyWithWhereWithoutCustomerInput = {
    where: InvoiceScalarWhereInput
    data: XOR<InvoiceUpdateManyMutationInput, InvoiceUncheckedUpdateManyWithoutCustomerInput>
  }

  export type SaleUpsertWithWhereUniqueWithoutCustomerInput = {
    where: SaleWhereUniqueInput
    update: XOR<SaleUpdateWithoutCustomerInput, SaleUncheckedUpdateWithoutCustomerInput>
    create: XOR<SaleCreateWithoutCustomerInput, SaleUncheckedCreateWithoutCustomerInput>
  }

  export type SaleUpdateWithWhereUniqueWithoutCustomerInput = {
    where: SaleWhereUniqueInput
    data: XOR<SaleUpdateWithoutCustomerInput, SaleUncheckedUpdateWithoutCustomerInput>
  }

  export type SaleUpdateManyWithWhereWithoutCustomerInput = {
    where: SaleScalarWhereInput
    data: XOR<SaleUpdateManyMutationInput, SaleUncheckedUpdateManyWithoutCustomerInput>
  }

  export type SalesReturnUpsertWithWhereUniqueWithoutCustomerInput = {
    where: SalesReturnWhereUniqueInput
    update: XOR<SalesReturnUpdateWithoutCustomerInput, SalesReturnUncheckedUpdateWithoutCustomerInput>
    create: XOR<SalesReturnCreateWithoutCustomerInput, SalesReturnUncheckedCreateWithoutCustomerInput>
  }

  export type SalesReturnUpdateWithWhereUniqueWithoutCustomerInput = {
    where: SalesReturnWhereUniqueInput
    data: XOR<SalesReturnUpdateWithoutCustomerInput, SalesReturnUncheckedUpdateWithoutCustomerInput>
  }

  export type SalesReturnUpdateManyWithWhereWithoutCustomerInput = {
    where: SalesReturnScalarWhereInput
    data: XOR<SalesReturnUpdateManyMutationInput, SalesReturnUncheckedUpdateManyWithoutCustomerInput>
  }

  export type BranchCreateWithoutPaymentMethodsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutPaymentMethodsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutPaymentMethodsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutPaymentMethodsInput, BranchUncheckedCreateWithoutPaymentMethodsInput>
  }

  export type SaleCreateWithoutPaymentMethodInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutPaymentMethodInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutPaymentMethodInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutPaymentMethodInput, SaleUncheckedCreateWithoutPaymentMethodInput>
  }

  export type SaleCreateManyPaymentMethodInputEnvelope = {
    data: SaleCreateManyPaymentMethodInput | SaleCreateManyPaymentMethodInput[]
    skipDuplicates?: boolean
  }

  export type ExpenseCreateWithoutPaymentMethodInput = {
    id?: string
    reference: string
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    category?: ExpenseCategoryCreateNestedOneWithoutExpensesInput
    warehouse?: WarehouseCreateNestedOneWithoutExpensesInput
    branch?: BranchCreateNestedOneWithoutExpensesInput
  }

  export type ExpenseUncheckedCreateWithoutPaymentMethodInput = {
    id?: string
    reference: string
    categoryId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCreateOrConnectWithoutPaymentMethodInput = {
    where: ExpenseWhereUniqueInput
    create: XOR<ExpenseCreateWithoutPaymentMethodInput, ExpenseUncheckedCreateWithoutPaymentMethodInput>
  }

  export type ExpenseCreateManyPaymentMethodInputEnvelope = {
    data: ExpenseCreateManyPaymentMethodInput | ExpenseCreateManyPaymentMethodInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutPaymentMethodsInput = {
    update: XOR<BranchUpdateWithoutPaymentMethodsInput, BranchUncheckedUpdateWithoutPaymentMethodsInput>
    create: XOR<BranchCreateWithoutPaymentMethodsInput, BranchUncheckedCreateWithoutPaymentMethodsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutPaymentMethodsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutPaymentMethodsInput, BranchUncheckedUpdateWithoutPaymentMethodsInput>
  }

  export type BranchUpdateWithoutPaymentMethodsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutPaymentMethodsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type SaleUpsertWithWhereUniqueWithoutPaymentMethodInput = {
    where: SaleWhereUniqueInput
    update: XOR<SaleUpdateWithoutPaymentMethodInput, SaleUncheckedUpdateWithoutPaymentMethodInput>
    create: XOR<SaleCreateWithoutPaymentMethodInput, SaleUncheckedCreateWithoutPaymentMethodInput>
  }

  export type SaleUpdateWithWhereUniqueWithoutPaymentMethodInput = {
    where: SaleWhereUniqueInput
    data: XOR<SaleUpdateWithoutPaymentMethodInput, SaleUncheckedUpdateWithoutPaymentMethodInput>
  }

  export type SaleUpdateManyWithWhereWithoutPaymentMethodInput = {
    where: SaleScalarWhereInput
    data: XOR<SaleUpdateManyMutationInput, SaleUncheckedUpdateManyWithoutPaymentMethodInput>
  }

  export type ExpenseUpsertWithWhereUniqueWithoutPaymentMethodInput = {
    where: ExpenseWhereUniqueInput
    update: XOR<ExpenseUpdateWithoutPaymentMethodInput, ExpenseUncheckedUpdateWithoutPaymentMethodInput>
    create: XOR<ExpenseCreateWithoutPaymentMethodInput, ExpenseUncheckedCreateWithoutPaymentMethodInput>
  }

  export type ExpenseUpdateWithWhereUniqueWithoutPaymentMethodInput = {
    where: ExpenseWhereUniqueInput
    data: XOR<ExpenseUpdateWithoutPaymentMethodInput, ExpenseUncheckedUpdateWithoutPaymentMethodInput>
  }

  export type ExpenseUpdateManyWithWhereWithoutPaymentMethodInput = {
    where: ExpenseScalarWhereInput
    data: XOR<ExpenseUpdateManyMutationInput, ExpenseUncheckedUpdateManyWithoutPaymentMethodInput>
  }

  export type CustomerCreateWithoutSalesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutCustomersInput
    invoices?: InvoiceCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnCreateNestedManyWithoutCustomerInput
  }

  export type CustomerUncheckedCreateWithoutSalesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    invoices?: InvoiceUncheckedCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutCustomerInput
  }

  export type CustomerCreateOrConnectWithoutSalesInput = {
    where: CustomerWhereUniqueInput
    create: XOR<CustomerCreateWithoutSalesInput, CustomerUncheckedCreateWithoutSalesInput>
  }

  export type WarehouseCreateWithoutSalesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutSalesInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutSalesInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutSalesInput, WarehouseUncheckedCreateWithoutSalesInput>
  }

  export type BranchCreateWithoutSalesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutSalesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutSalesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutSalesInput, BranchUncheckedCreateWithoutSalesInput>
  }

  export type PaymentMethodCreateWithoutSalesInput = {
    id?: string
    name: string
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutPaymentMethodsInput
    expenses?: ExpenseCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodUncheckedCreateWithoutSalesInput = {
    id?: string
    name: string
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    expenses?: ExpenseUncheckedCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodCreateOrConnectWithoutSalesInput = {
    where: PaymentMethodWhereUniqueInput
    create: XOR<PaymentMethodCreateWithoutSalesInput, PaymentMethodUncheckedCreateWithoutSalesInput>
  }

  export type SaleLineCreateWithoutSaleInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    product: ProductCreateNestedOneWithoutSaleLinesInput
  }

  export type SaleLineUncheckedCreateWithoutSaleInput = {
    id?: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SaleLineCreateOrConnectWithoutSaleInput = {
    where: SaleLineWhereUniqueInput
    create: XOR<SaleLineCreateWithoutSaleInput, SaleLineUncheckedCreateWithoutSaleInput>
  }

  export type SaleLineCreateManySaleInputEnvelope = {
    data: SaleLineCreateManySaleInput | SaleLineCreateManySaleInput[]
    skipDuplicates?: boolean
  }

  export type SalesReturnCreateWithoutSaleInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    customer?: CustomerCreateNestedOneWithoutSalesReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesReturnsInput
    branch?: BranchCreateNestedOneWithoutSalesReturnsInput
    lines?: SalesReturnLineCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnUncheckedCreateWithoutSaleInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    lines?: SalesReturnLineUncheckedCreateNestedManyWithoutSalesReturnInput
  }

  export type SalesReturnCreateOrConnectWithoutSaleInput = {
    where: SalesReturnWhereUniqueInput
    create: XOR<SalesReturnCreateWithoutSaleInput, SalesReturnUncheckedCreateWithoutSaleInput>
  }

  export type SalesReturnCreateManySaleInputEnvelope = {
    data: SalesReturnCreateManySaleInput | SalesReturnCreateManySaleInput[]
    skipDuplicates?: boolean
  }

  export type InvoiceCreateWithoutSaleInput = {
    id?: string
    number: string
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutInvoicesInput
    branch?: BranchCreateNestedOneWithoutInvoicesInput
    lines?: InvoiceLineCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceUncheckedCreateWithoutSaleInput = {
    id?: string
    number: string
    customerId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: InvoiceLineUncheckedCreateNestedManyWithoutInvoiceInput
  }

  export type InvoiceCreateOrConnectWithoutSaleInput = {
    where: InvoiceWhereUniqueInput
    create: XOR<InvoiceCreateWithoutSaleInput, InvoiceUncheckedCreateWithoutSaleInput>
  }

  export type InvoiceCreateManySaleInputEnvelope = {
    data: InvoiceCreateManySaleInput | InvoiceCreateManySaleInput[]
    skipDuplicates?: boolean
  }

  export type CustomerUpsertWithoutSalesInput = {
    update: XOR<CustomerUpdateWithoutSalesInput, CustomerUncheckedUpdateWithoutSalesInput>
    create: XOR<CustomerCreateWithoutSalesInput, CustomerUncheckedCreateWithoutSalesInput>
    where?: CustomerWhereInput
  }

  export type CustomerUpdateToOneWithWhereWithoutSalesInput = {
    where?: CustomerWhereInput
    data: XOR<CustomerUpdateWithoutSalesInput, CustomerUncheckedUpdateWithoutSalesInput>
  }

  export type CustomerUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutCustomersNestedInput
    invoices?: InvoiceUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerUncheckedUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    invoices?: InvoiceUncheckedUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutCustomerNestedInput
  }

  export type WarehouseUpsertWithoutSalesInput = {
    update: XOR<WarehouseUpdateWithoutSalesInput, WarehouseUncheckedUpdateWithoutSalesInput>
    create: XOR<WarehouseCreateWithoutSalesInput, WarehouseUncheckedCreateWithoutSalesInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutSalesInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutSalesInput, WarehouseUncheckedUpdateWithoutSalesInput>
  }

  export type WarehouseUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutSalesInput = {
    update: XOR<BranchUpdateWithoutSalesInput, BranchUncheckedUpdateWithoutSalesInput>
    create: XOR<BranchCreateWithoutSalesInput, BranchUncheckedCreateWithoutSalesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutSalesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutSalesInput, BranchUncheckedUpdateWithoutSalesInput>
  }

  export type BranchUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type PaymentMethodUpsertWithoutSalesInput = {
    update: XOR<PaymentMethodUpdateWithoutSalesInput, PaymentMethodUncheckedUpdateWithoutSalesInput>
    create: XOR<PaymentMethodCreateWithoutSalesInput, PaymentMethodUncheckedCreateWithoutSalesInput>
    where?: PaymentMethodWhereInput
  }

  export type PaymentMethodUpdateToOneWithWhereWithoutSalesInput = {
    where?: PaymentMethodWhereInput
    data: XOR<PaymentMethodUpdateWithoutSalesInput, PaymentMethodUncheckedUpdateWithoutSalesInput>
  }

  export type PaymentMethodUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutPaymentMethodsNestedInput
    expenses?: ExpenseUpdateManyWithoutPaymentMethodNestedInput
  }

  export type PaymentMethodUncheckedUpdateWithoutSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    expenses?: ExpenseUncheckedUpdateManyWithoutPaymentMethodNestedInput
  }

  export type SaleLineUpsertWithWhereUniqueWithoutSaleInput = {
    where: SaleLineWhereUniqueInput
    update: XOR<SaleLineUpdateWithoutSaleInput, SaleLineUncheckedUpdateWithoutSaleInput>
    create: XOR<SaleLineCreateWithoutSaleInput, SaleLineUncheckedCreateWithoutSaleInput>
  }

  export type SaleLineUpdateWithWhereUniqueWithoutSaleInput = {
    where: SaleLineWhereUniqueInput
    data: XOR<SaleLineUpdateWithoutSaleInput, SaleLineUncheckedUpdateWithoutSaleInput>
  }

  export type SaleLineUpdateManyWithWhereWithoutSaleInput = {
    where: SaleLineScalarWhereInput
    data: XOR<SaleLineUpdateManyMutationInput, SaleLineUncheckedUpdateManyWithoutSaleInput>
  }

  export type SaleLineScalarWhereInput = {
    AND?: SaleLineScalarWhereInput | SaleLineScalarWhereInput[]
    OR?: SaleLineScalarWhereInput[]
    NOT?: SaleLineScalarWhereInput | SaleLineScalarWhereInput[]
    id?: StringFilter<"SaleLine"> | string
    saleId?: StringFilter<"SaleLine"> | string
    productId?: StringFilter<"SaleLine"> | string
    quantity?: IntFilter<"SaleLine"> | number
    unitPrice?: FloatFilter<"SaleLine"> | number
    taxRate?: FloatFilter<"SaleLine"> | number
    lineTotal?: FloatFilter<"SaleLine"> | number
  }

  export type SalesReturnUpsertWithWhereUniqueWithoutSaleInput = {
    where: SalesReturnWhereUniqueInput
    update: XOR<SalesReturnUpdateWithoutSaleInput, SalesReturnUncheckedUpdateWithoutSaleInput>
    create: XOR<SalesReturnCreateWithoutSaleInput, SalesReturnUncheckedCreateWithoutSaleInput>
  }

  export type SalesReturnUpdateWithWhereUniqueWithoutSaleInput = {
    where: SalesReturnWhereUniqueInput
    data: XOR<SalesReturnUpdateWithoutSaleInput, SalesReturnUncheckedUpdateWithoutSaleInput>
  }

  export type SalesReturnUpdateManyWithWhereWithoutSaleInput = {
    where: SalesReturnScalarWhereInput
    data: XOR<SalesReturnUpdateManyMutationInput, SalesReturnUncheckedUpdateManyWithoutSaleInput>
  }

  export type InvoiceUpsertWithWhereUniqueWithoutSaleInput = {
    where: InvoiceWhereUniqueInput
    update: XOR<InvoiceUpdateWithoutSaleInput, InvoiceUncheckedUpdateWithoutSaleInput>
    create: XOR<InvoiceCreateWithoutSaleInput, InvoiceUncheckedCreateWithoutSaleInput>
  }

  export type InvoiceUpdateWithWhereUniqueWithoutSaleInput = {
    where: InvoiceWhereUniqueInput
    data: XOR<InvoiceUpdateWithoutSaleInput, InvoiceUncheckedUpdateWithoutSaleInput>
  }

  export type InvoiceUpdateManyWithWhereWithoutSaleInput = {
    where: InvoiceScalarWhereInput
    data: XOR<InvoiceUpdateManyMutationInput, InvoiceUncheckedUpdateManyWithoutSaleInput>
  }

  export type SaleCreateWithoutLinesInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutLinesInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutLinesInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutLinesInput, SaleUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutSaleLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutSaleLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutSaleLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutSaleLinesInput, ProductUncheckedCreateWithoutSaleLinesInput>
  }

  export type SaleUpsertWithoutLinesInput = {
    update: XOR<SaleUpdateWithoutLinesInput, SaleUncheckedUpdateWithoutLinesInput>
    create: XOR<SaleCreateWithoutLinesInput, SaleUncheckedCreateWithoutLinesInput>
    where?: SaleWhereInput
  }

  export type SaleUpdateToOneWithWhereWithoutLinesInput = {
    where?: SaleWhereInput
    data: XOR<SaleUpdateWithoutLinesInput, SaleUncheckedUpdateWithoutLinesInput>
  }

  export type SaleUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type ProductUpsertWithoutSaleLinesInput = {
    update: XOR<ProductUpdateWithoutSaleLinesInput, ProductUncheckedUpdateWithoutSaleLinesInput>
    create: XOR<ProductCreateWithoutSaleLinesInput, ProductUncheckedCreateWithoutSaleLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutSaleLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutSaleLinesInput, ProductUncheckedUpdateWithoutSaleLinesInput>
  }

  export type ProductUpdateWithoutSaleLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutSaleLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type SaleCreateWithoutReturnsInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    invoices?: InvoiceCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutReturnsInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutReturnsInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutReturnsInput, SaleUncheckedCreateWithoutReturnsInput>
  }

  export type CustomerCreateWithoutSalesReturnsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutCustomersInput
    invoices?: InvoiceCreateNestedManyWithoutCustomerInput
    sales?: SaleCreateNestedManyWithoutCustomerInput
  }

  export type CustomerUncheckedCreateWithoutSalesReturnsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    invoices?: InvoiceUncheckedCreateNestedManyWithoutCustomerInput
    sales?: SaleUncheckedCreateNestedManyWithoutCustomerInput
  }

  export type CustomerCreateOrConnectWithoutSalesReturnsInput = {
    where: CustomerWhereUniqueInput
    create: XOR<CustomerCreateWithoutSalesReturnsInput, CustomerUncheckedCreateWithoutSalesReturnsInput>
  }

  export type WarehouseCreateWithoutSalesReturnsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutSalesReturnsInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutSalesReturnsInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutSalesReturnsInput, WarehouseUncheckedCreateWithoutSalesReturnsInput>
  }

  export type BranchCreateWithoutSalesReturnsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutSalesReturnsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutSalesReturnsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutSalesReturnsInput, BranchUncheckedCreateWithoutSalesReturnsInput>
  }

  export type SalesReturnLineCreateWithoutSalesReturnInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    product: ProductCreateNestedOneWithoutSalesReturnLinesInput
  }

  export type SalesReturnLineUncheckedCreateWithoutSalesReturnInput = {
    id?: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnLineCreateOrConnectWithoutSalesReturnInput = {
    where: SalesReturnLineWhereUniqueInput
    create: XOR<SalesReturnLineCreateWithoutSalesReturnInput, SalesReturnLineUncheckedCreateWithoutSalesReturnInput>
  }

  export type SalesReturnLineCreateManySalesReturnInputEnvelope = {
    data: SalesReturnLineCreateManySalesReturnInput | SalesReturnLineCreateManySalesReturnInput[]
    skipDuplicates?: boolean
  }

  export type SaleUpsertWithoutReturnsInput = {
    update: XOR<SaleUpdateWithoutReturnsInput, SaleUncheckedUpdateWithoutReturnsInput>
    create: XOR<SaleCreateWithoutReturnsInput, SaleUncheckedCreateWithoutReturnsInput>
    where?: SaleWhereInput
  }

  export type SaleUpdateToOneWithWhereWithoutReturnsInput = {
    where?: SaleWhereInput
    data: XOR<SaleUpdateWithoutReturnsInput, SaleUncheckedUpdateWithoutReturnsInput>
  }

  export type SaleUpdateWithoutReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type CustomerUpsertWithoutSalesReturnsInput = {
    update: XOR<CustomerUpdateWithoutSalesReturnsInput, CustomerUncheckedUpdateWithoutSalesReturnsInput>
    create: XOR<CustomerCreateWithoutSalesReturnsInput, CustomerUncheckedCreateWithoutSalesReturnsInput>
    where?: CustomerWhereInput
  }

  export type CustomerUpdateToOneWithWhereWithoutSalesReturnsInput = {
    where?: CustomerWhereInput
    data: XOR<CustomerUpdateWithoutSalesReturnsInput, CustomerUncheckedUpdateWithoutSalesReturnsInput>
  }

  export type CustomerUpdateWithoutSalesReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutCustomersNestedInput
    invoices?: InvoiceUpdateManyWithoutCustomerNestedInput
    sales?: SaleUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerUncheckedUpdateWithoutSalesReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    invoices?: InvoiceUncheckedUpdateManyWithoutCustomerNestedInput
    sales?: SaleUncheckedUpdateManyWithoutCustomerNestedInput
  }

  export type WarehouseUpsertWithoutSalesReturnsInput = {
    update: XOR<WarehouseUpdateWithoutSalesReturnsInput, WarehouseUncheckedUpdateWithoutSalesReturnsInput>
    create: XOR<WarehouseCreateWithoutSalesReturnsInput, WarehouseUncheckedCreateWithoutSalesReturnsInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutSalesReturnsInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutSalesReturnsInput, WarehouseUncheckedUpdateWithoutSalesReturnsInput>
  }

  export type WarehouseUpdateWithoutSalesReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutSalesReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutSalesReturnsInput = {
    update: XOR<BranchUpdateWithoutSalesReturnsInput, BranchUncheckedUpdateWithoutSalesReturnsInput>
    create: XOR<BranchCreateWithoutSalesReturnsInput, BranchUncheckedCreateWithoutSalesReturnsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutSalesReturnsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutSalesReturnsInput, BranchUncheckedUpdateWithoutSalesReturnsInput>
  }

  export type BranchUpdateWithoutSalesReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutSalesReturnsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type SalesReturnLineUpsertWithWhereUniqueWithoutSalesReturnInput = {
    where: SalesReturnLineWhereUniqueInput
    update: XOR<SalesReturnLineUpdateWithoutSalesReturnInput, SalesReturnLineUncheckedUpdateWithoutSalesReturnInput>
    create: XOR<SalesReturnLineCreateWithoutSalesReturnInput, SalesReturnLineUncheckedCreateWithoutSalesReturnInput>
  }

  export type SalesReturnLineUpdateWithWhereUniqueWithoutSalesReturnInput = {
    where: SalesReturnLineWhereUniqueInput
    data: XOR<SalesReturnLineUpdateWithoutSalesReturnInput, SalesReturnLineUncheckedUpdateWithoutSalesReturnInput>
  }

  export type SalesReturnLineUpdateManyWithWhereWithoutSalesReturnInput = {
    where: SalesReturnLineScalarWhereInput
    data: XOR<SalesReturnLineUpdateManyMutationInput, SalesReturnLineUncheckedUpdateManyWithoutSalesReturnInput>
  }

  export type SalesReturnLineScalarWhereInput = {
    AND?: SalesReturnLineScalarWhereInput | SalesReturnLineScalarWhereInput[]
    OR?: SalesReturnLineScalarWhereInput[]
    NOT?: SalesReturnLineScalarWhereInput | SalesReturnLineScalarWhereInput[]
    id?: StringFilter<"SalesReturnLine"> | string
    salesReturnId?: StringFilter<"SalesReturnLine"> | string
    productId?: StringFilter<"SalesReturnLine"> | string
    quantity?: IntFilter<"SalesReturnLine"> | number
    unitPrice?: FloatFilter<"SalesReturnLine"> | number
    taxRate?: FloatFilter<"SalesReturnLine"> | number
    lineTotal?: FloatFilter<"SalesReturnLine"> | number
  }

  export type SalesReturnCreateWithoutLinesInput = {
    id?: string
    number: string
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    sale?: SaleCreateNestedOneWithoutReturnsInput
    customer?: CustomerCreateNestedOneWithoutSalesReturnsInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesReturnsInput
    branch?: BranchCreateNestedOneWithoutSalesReturnsInput
  }

  export type SalesReturnUncheckedCreateWithoutLinesInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SalesReturnCreateOrConnectWithoutLinesInput = {
    where: SalesReturnWhereUniqueInput
    create: XOR<SalesReturnCreateWithoutLinesInput, SalesReturnUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutSalesReturnLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutSalesReturnLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutSalesReturnLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutSalesReturnLinesInput, ProductUncheckedCreateWithoutSalesReturnLinesInput>
  }

  export type SalesReturnUpsertWithoutLinesInput = {
    update: XOR<SalesReturnUpdateWithoutLinesInput, SalesReturnUncheckedUpdateWithoutLinesInput>
    create: XOR<SalesReturnCreateWithoutLinesInput, SalesReturnUncheckedCreateWithoutLinesInput>
    where?: SalesReturnWhereInput
  }

  export type SalesReturnUpdateToOneWithWhereWithoutLinesInput = {
    where?: SalesReturnWhereInput
    data: XOR<SalesReturnUpdateWithoutLinesInput, SalesReturnUncheckedUpdateWithoutLinesInput>
  }

  export type SalesReturnUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sale?: SaleUpdateOneWithoutReturnsNestedInput
    customer?: CustomerUpdateOneWithoutSalesReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesReturnsNestedInput
    branch?: BranchUpdateOneWithoutSalesReturnsNestedInput
  }

  export type SalesReturnUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ProductUpsertWithoutSalesReturnLinesInput = {
    update: XOR<ProductUpdateWithoutSalesReturnLinesInput, ProductUncheckedUpdateWithoutSalesReturnLinesInput>
    create: XOR<ProductCreateWithoutSalesReturnLinesInput, ProductUncheckedCreateWithoutSalesReturnLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutSalesReturnLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutSalesReturnLinesInput, ProductUncheckedUpdateWithoutSalesReturnLinesInput>
  }

  export type ProductUpdateWithoutSalesReturnLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutSalesReturnLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type BranchCreateWithoutTaxesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutTaxesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutTaxesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutTaxesInput, BranchUncheckedCreateWithoutTaxesInput>
  }

  export type ProductCreateWithoutSalesTaxInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutSalesTaxInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutSalesTaxInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutSalesTaxInput, ProductUncheckedCreateWithoutSalesTaxInput>
  }

  export type ProductCreateManySalesTaxInputEnvelope = {
    data: ProductCreateManySalesTaxInput | ProductCreateManySalesTaxInput[]
    skipDuplicates?: boolean
  }

  export type ProductCreateWithoutPurchaseTaxInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutPurchaseTaxInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutPurchaseTaxInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutPurchaseTaxInput, ProductUncheckedCreateWithoutPurchaseTaxInput>
  }

  export type ProductCreateManyPurchaseTaxInputEnvelope = {
    data: ProductCreateManyPurchaseTaxInput | ProductCreateManyPurchaseTaxInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutTaxesInput = {
    update: XOR<BranchUpdateWithoutTaxesInput, BranchUncheckedUpdateWithoutTaxesInput>
    create: XOR<BranchCreateWithoutTaxesInput, BranchUncheckedCreateWithoutTaxesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutTaxesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutTaxesInput, BranchUncheckedUpdateWithoutTaxesInput>
  }

  export type BranchUpdateWithoutTaxesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutTaxesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type ProductUpsertWithWhereUniqueWithoutSalesTaxInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutSalesTaxInput, ProductUncheckedUpdateWithoutSalesTaxInput>
    create: XOR<ProductCreateWithoutSalesTaxInput, ProductUncheckedCreateWithoutSalesTaxInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutSalesTaxInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutSalesTaxInput, ProductUncheckedUpdateWithoutSalesTaxInput>
  }

  export type ProductUpdateManyWithWhereWithoutSalesTaxInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutSalesTaxInput>
  }

  export type ProductUpsertWithWhereUniqueWithoutPurchaseTaxInput = {
    where: ProductWhereUniqueInput
    update: XOR<ProductUpdateWithoutPurchaseTaxInput, ProductUncheckedUpdateWithoutPurchaseTaxInput>
    create: XOR<ProductCreateWithoutPurchaseTaxInput, ProductUncheckedCreateWithoutPurchaseTaxInput>
  }

  export type ProductUpdateWithWhereUniqueWithoutPurchaseTaxInput = {
    where: ProductWhereUniqueInput
    data: XOR<ProductUpdateWithoutPurchaseTaxInput, ProductUncheckedUpdateWithoutPurchaseTaxInput>
  }

  export type ProductUpdateManyWithWhereWithoutPurchaseTaxInput = {
    where: ProductScalarWhereInput
    data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutPurchaseTaxInput>
  }

  export type BranchCreateWithoutExpenseCategoriesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutExpenseCategoriesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutExpenseCategoriesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutExpenseCategoriesInput, BranchUncheckedCreateWithoutExpenseCategoriesInput>
  }

  export type ExpenseCreateWithoutCategoryInput = {
    id?: string
    reference: string
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    warehouse?: WarehouseCreateNestedOneWithoutExpensesInput
    branch?: BranchCreateNestedOneWithoutExpensesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutExpensesInput
  }

  export type ExpenseUncheckedCreateWithoutCategoryInput = {
    id?: string
    reference: string
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCreateOrConnectWithoutCategoryInput = {
    where: ExpenseWhereUniqueInput
    create: XOR<ExpenseCreateWithoutCategoryInput, ExpenseUncheckedCreateWithoutCategoryInput>
  }

  export type ExpenseCreateManyCategoryInputEnvelope = {
    data: ExpenseCreateManyCategoryInput | ExpenseCreateManyCategoryInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutExpenseCategoriesInput = {
    update: XOR<BranchUpdateWithoutExpenseCategoriesInput, BranchUncheckedUpdateWithoutExpenseCategoriesInput>
    create: XOR<BranchCreateWithoutExpenseCategoriesInput, BranchUncheckedCreateWithoutExpenseCategoriesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutExpenseCategoriesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutExpenseCategoriesInput, BranchUncheckedUpdateWithoutExpenseCategoriesInput>
  }

  export type BranchUpdateWithoutExpenseCategoriesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutExpenseCategoriesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type ExpenseUpsertWithWhereUniqueWithoutCategoryInput = {
    where: ExpenseWhereUniqueInput
    update: XOR<ExpenseUpdateWithoutCategoryInput, ExpenseUncheckedUpdateWithoutCategoryInput>
    create: XOR<ExpenseCreateWithoutCategoryInput, ExpenseUncheckedCreateWithoutCategoryInput>
  }

  export type ExpenseUpdateWithWhereUniqueWithoutCategoryInput = {
    where: ExpenseWhereUniqueInput
    data: XOR<ExpenseUpdateWithoutCategoryInput, ExpenseUncheckedUpdateWithoutCategoryInput>
  }

  export type ExpenseUpdateManyWithWhereWithoutCategoryInput = {
    where: ExpenseScalarWhereInput
    data: XOR<ExpenseUpdateManyMutationInput, ExpenseUncheckedUpdateManyWithoutCategoryInput>
  }

  export type ExpenseCategoryCreateWithoutExpensesInput = {
    id?: string
    name: string
    description?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutExpenseCategoriesInput
  }

  export type ExpenseCategoryUncheckedCreateWithoutExpensesInput = {
    id?: string
    name: string
    description?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCategoryCreateOrConnectWithoutExpensesInput = {
    where: ExpenseCategoryWhereUniqueInput
    create: XOR<ExpenseCategoryCreateWithoutExpensesInput, ExpenseCategoryUncheckedCreateWithoutExpensesInput>
  }

  export type WarehouseCreateWithoutExpensesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutExpensesInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutExpensesInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutExpensesInput, WarehouseUncheckedCreateWithoutExpensesInput>
  }

  export type BranchCreateWithoutExpensesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutExpensesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutExpensesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutExpensesInput, BranchUncheckedCreateWithoutExpensesInput>
  }

  export type PaymentMethodCreateWithoutExpensesInput = {
    id?: string
    name: string
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutPaymentMethodsInput
    sales?: SaleCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodUncheckedCreateWithoutExpensesInput = {
    id?: string
    name: string
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    sales?: SaleUncheckedCreateNestedManyWithoutPaymentMethodInput
  }

  export type PaymentMethodCreateOrConnectWithoutExpensesInput = {
    where: PaymentMethodWhereUniqueInput
    create: XOR<PaymentMethodCreateWithoutExpensesInput, PaymentMethodUncheckedCreateWithoutExpensesInput>
  }

  export type ExpenseCategoryUpsertWithoutExpensesInput = {
    update: XOR<ExpenseCategoryUpdateWithoutExpensesInput, ExpenseCategoryUncheckedUpdateWithoutExpensesInput>
    create: XOR<ExpenseCategoryCreateWithoutExpensesInput, ExpenseCategoryUncheckedCreateWithoutExpensesInput>
    where?: ExpenseCategoryWhereInput
  }

  export type ExpenseCategoryUpdateToOneWithWhereWithoutExpensesInput = {
    where?: ExpenseCategoryWhereInput
    data: XOR<ExpenseCategoryUpdateWithoutExpensesInput, ExpenseCategoryUncheckedUpdateWithoutExpensesInput>
  }

  export type ExpenseCategoryUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutExpenseCategoriesNestedInput
  }

  export type ExpenseCategoryUncheckedUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseUpsertWithoutExpensesInput = {
    update: XOR<WarehouseUpdateWithoutExpensesInput, WarehouseUncheckedUpdateWithoutExpensesInput>
    create: XOR<WarehouseCreateWithoutExpensesInput, WarehouseUncheckedCreateWithoutExpensesInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutExpensesInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutExpensesInput, WarehouseUncheckedUpdateWithoutExpensesInput>
  }

  export type WarehouseUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutExpensesInput = {
    update: XOR<BranchUpdateWithoutExpensesInput, BranchUncheckedUpdateWithoutExpensesInput>
    create: XOR<BranchCreateWithoutExpensesInput, BranchUncheckedCreateWithoutExpensesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutExpensesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutExpensesInput, BranchUncheckedUpdateWithoutExpensesInput>
  }

  export type BranchUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type PaymentMethodUpsertWithoutExpensesInput = {
    update: XOR<PaymentMethodUpdateWithoutExpensesInput, PaymentMethodUncheckedUpdateWithoutExpensesInput>
    create: XOR<PaymentMethodCreateWithoutExpensesInput, PaymentMethodUncheckedCreateWithoutExpensesInput>
    where?: PaymentMethodWhereInput
  }

  export type PaymentMethodUpdateToOneWithWhereWithoutExpensesInput = {
    where?: PaymentMethodWhereInput
    data: XOR<PaymentMethodUpdateWithoutExpensesInput, PaymentMethodUncheckedUpdateWithoutExpensesInput>
  }

  export type PaymentMethodUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutPaymentMethodsNestedInput
    sales?: SaleUpdateManyWithoutPaymentMethodNestedInput
  }

  export type PaymentMethodUncheckedUpdateWithoutExpensesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sales?: SaleUncheckedUpdateManyWithoutPaymentMethodNestedInput
  }

  export type BranchCreateWithoutProductsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutProductsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutProductsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutProductsInput, BranchUncheckedCreateWithoutProductsInput>
  }

  export type CategoryCreateWithoutProductsInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutCategoriesInput
    parent?: CategoryCreateNestedOneWithoutChildrenInput
    children?: CategoryCreateNestedManyWithoutParentInput
  }

  export type CategoryUncheckedCreateWithoutProductsInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: string | null
    parentId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    children?: CategoryUncheckedCreateNestedManyWithoutParentInput
  }

  export type CategoryCreateOrConnectWithoutProductsInput = {
    where: CategoryWhereUniqueInput
    create: XOR<CategoryCreateWithoutProductsInput, CategoryUncheckedCreateWithoutProductsInput>
  }

  export type UnitCreateWithoutProductsInput = {
    id?: string
    name: string
    symbol?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutUnitsInput
  }

  export type UnitUncheckedCreateWithoutProductsInput = {
    id?: string
    name: string
    symbol?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type UnitCreateOrConnectWithoutProductsInput = {
    where: UnitWhereUniqueInput
    create: XOR<UnitCreateWithoutProductsInput, UnitUncheckedCreateWithoutProductsInput>
  }

  export type BrandCreateWithoutProductsInput = {
    id?: string
    name: string
    logo?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutBrandsInput
  }

  export type BrandUncheckedCreateWithoutProductsInput = {
    id?: string
    name: string
    logo?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type BrandCreateOrConnectWithoutProductsInput = {
    where: BrandWhereUniqueInput
    create: XOR<BrandCreateWithoutProductsInput, BrandUncheckedCreateWithoutProductsInput>
  }

  export type TaxCreateWithoutProductsSalesInput = {
    id?: string
    name: string
    rate?: number
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutTaxesInput
    productsPurchase?: ProductCreateNestedManyWithoutPurchaseTaxInput
  }

  export type TaxUncheckedCreateWithoutProductsSalesInput = {
    id?: string
    name: string
    rate?: number
    branchId?: string | null
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    productsPurchase?: ProductUncheckedCreateNestedManyWithoutPurchaseTaxInput
  }

  export type TaxCreateOrConnectWithoutProductsSalesInput = {
    where: TaxWhereUniqueInput
    create: XOR<TaxCreateWithoutProductsSalesInput, TaxUncheckedCreateWithoutProductsSalesInput>
  }

  export type TaxCreateWithoutProductsPurchaseInput = {
    id?: string
    name: string
    rate?: number
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutTaxesInput
    productsSales?: ProductCreateNestedManyWithoutSalesTaxInput
  }

  export type TaxUncheckedCreateWithoutProductsPurchaseInput = {
    id?: string
    name: string
    rate?: number
    branchId?: string | null
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    productsSales?: ProductUncheckedCreateNestedManyWithoutSalesTaxInput
  }

  export type TaxCreateOrConnectWithoutProductsPurchaseInput = {
    where: TaxWhereUniqueInput
    create: XOR<TaxCreateWithoutProductsPurchaseInput, TaxUncheckedCreateWithoutProductsPurchaseInput>
  }

  export type WarehouseCreateWithoutProductsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutProductsInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutProductsInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutProductsInput, WarehouseUncheckedCreateWithoutProductsInput>
  }

  export type InventoryAdjustmentLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    adjustment: InventoryAdjustmentCreateNestedOneWithoutLinesInput
  }

  export type InventoryAdjustmentLineUncheckedCreateWithoutProductInput = {
    id?: string
    adjustmentId: string
    quantity: number
  }

  export type InventoryAdjustmentLineCreateOrConnectWithoutProductInput = {
    where: InventoryAdjustmentLineWhereUniqueInput
    create: XOR<InventoryAdjustmentLineCreateWithoutProductInput, InventoryAdjustmentLineUncheckedCreateWithoutProductInput>
  }

  export type InventoryAdjustmentLineCreateManyProductInputEnvelope = {
    data: InventoryAdjustmentLineCreateManyProductInput | InventoryAdjustmentLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type InvoiceLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    invoice: InvoiceCreateNestedOneWithoutLinesInput
  }

  export type InvoiceLineUncheckedCreateWithoutProductInput = {
    id?: string
    invoiceId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type InvoiceLineCreateOrConnectWithoutProductInput = {
    where: InvoiceLineWhereUniqueInput
    create: XOR<InvoiceLineCreateWithoutProductInput, InvoiceLineUncheckedCreateWithoutProductInput>
  }

  export type InvoiceLineCreateManyProductInputEnvelope = {
    data: InvoiceLineCreateManyProductInput | InvoiceLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
    purchase: PurchaseCreateNestedOneWithoutLinesInput
  }

  export type PurchaseLineUncheckedCreateWithoutProductInput = {
    id?: string
    purchaseId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseLineCreateOrConnectWithoutProductInput = {
    where: PurchaseLineWhereUniqueInput
    create: XOR<PurchaseLineCreateWithoutProductInput, PurchaseLineUncheckedCreateWithoutProductInput>
  }

  export type PurchaseLineCreateManyProductInputEnvelope = {
    data: PurchaseLineCreateManyProductInput | PurchaseLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type PurchaseReturnLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
    purchaseReturn: PurchaseReturnCreateNestedOneWithoutLinesInput
  }

  export type PurchaseReturnLineUncheckedCreateWithoutProductInput = {
    id?: string
    purchaseReturnId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnLineCreateOrConnectWithoutProductInput = {
    where: PurchaseReturnLineWhereUniqueInput
    create: XOR<PurchaseReturnLineCreateWithoutProductInput, PurchaseReturnLineUncheckedCreateWithoutProductInput>
  }

  export type PurchaseReturnLineCreateManyProductInputEnvelope = {
    data: PurchaseReturnLineCreateManyProductInput | PurchaseReturnLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type SaleLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    sale: SaleCreateNestedOneWithoutLinesInput
  }

  export type SaleLineUncheckedCreateWithoutProductInput = {
    id?: string
    saleId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SaleLineCreateOrConnectWithoutProductInput = {
    where: SaleLineWhereUniqueInput
    create: XOR<SaleLineCreateWithoutProductInput, SaleLineUncheckedCreateWithoutProductInput>
  }

  export type SaleLineCreateManyProductInputEnvelope = {
    data: SaleLineCreateManyProductInput | SaleLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type SalesReturnLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    salesReturn: SalesReturnCreateNestedOneWithoutLinesInput
  }

  export type SalesReturnLineUncheckedCreateWithoutProductInput = {
    id?: string
    salesReturnId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnLineCreateOrConnectWithoutProductInput = {
    where: SalesReturnLineWhereUniqueInput
    create: XOR<SalesReturnLineCreateWithoutProductInput, SalesReturnLineUncheckedCreateWithoutProductInput>
  }

  export type SalesReturnLineCreateManyProductInputEnvelope = {
    data: SalesReturnLineCreateManyProductInput | SalesReturnLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type InventoryTransferLineCreateWithoutProductInput = {
    id?: string
    quantity: number
    transfer: InventoryTransferCreateNestedOneWithoutLinesInput
  }

  export type InventoryTransferLineUncheckedCreateWithoutProductInput = {
    id?: string
    transferId: string
    quantity: number
  }

  export type InventoryTransferLineCreateOrConnectWithoutProductInput = {
    where: InventoryTransferLineWhereUniqueInput
    create: XOR<InventoryTransferLineCreateWithoutProductInput, InventoryTransferLineUncheckedCreateWithoutProductInput>
  }

  export type InventoryTransferLineCreateManyProductInputEnvelope = {
    data: InventoryTransferLineCreateManyProductInput | InventoryTransferLineCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type WarehouseStockCreateWithoutProductInput = {
    id?: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    warehouse: WarehouseCreateNestedOneWithoutStocksInput
  }

  export type WarehouseStockUncheckedCreateWithoutProductInput = {
    id?: string
    warehouseId: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseStockCreateOrConnectWithoutProductInput = {
    where: WarehouseStockWhereUniqueInput
    create: XOR<WarehouseStockCreateWithoutProductInput, WarehouseStockUncheckedCreateWithoutProductInput>
  }

  export type WarehouseStockCreateManyProductInputEnvelope = {
    data: WarehouseStockCreateManyProductInput | WarehouseStockCreateManyProductInput[]
    skipDuplicates?: boolean
  }

  export type BranchUpsertWithoutProductsInput = {
    update: XOR<BranchUpdateWithoutProductsInput, BranchUncheckedUpdateWithoutProductsInput>
    create: XOR<BranchCreateWithoutProductsInput, BranchUncheckedCreateWithoutProductsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutProductsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutProductsInput, BranchUncheckedUpdateWithoutProductsInput>
  }

  export type BranchUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type CategoryUpsertWithoutProductsInput = {
    update: XOR<CategoryUpdateWithoutProductsInput, CategoryUncheckedUpdateWithoutProductsInput>
    create: XOR<CategoryCreateWithoutProductsInput, CategoryUncheckedCreateWithoutProductsInput>
    where?: CategoryWhereInput
  }

  export type CategoryUpdateToOneWithWhereWithoutProductsInput = {
    where?: CategoryWhereInput
    data: XOR<CategoryUpdateWithoutProductsInput, CategoryUncheckedUpdateWithoutProductsInput>
  }

  export type CategoryUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutCategoriesNestedInput
    parent?: CategoryUpdateOneWithoutChildrenNestedInput
    children?: CategoryUpdateManyWithoutParentNestedInput
  }

  export type CategoryUncheckedUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    parentId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    children?: CategoryUncheckedUpdateManyWithoutParentNestedInput
  }

  export type UnitUpsertWithoutProductsInput = {
    update: XOR<UnitUpdateWithoutProductsInput, UnitUncheckedUpdateWithoutProductsInput>
    create: XOR<UnitCreateWithoutProductsInput, UnitUncheckedCreateWithoutProductsInput>
    where?: UnitWhereInput
  }

  export type UnitUpdateToOneWithWhereWithoutProductsInput = {
    where?: UnitWhereInput
    data: XOR<UnitUpdateWithoutProductsInput, UnitUncheckedUpdateWithoutProductsInput>
  }

  export type UnitUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutUnitsNestedInput
  }

  export type UnitUncheckedUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type BrandUpsertWithoutProductsInput = {
    update: XOR<BrandUpdateWithoutProductsInput, BrandUncheckedUpdateWithoutProductsInput>
    create: XOR<BrandCreateWithoutProductsInput, BrandUncheckedCreateWithoutProductsInput>
    where?: BrandWhereInput
  }

  export type BrandUpdateToOneWithWhereWithoutProductsInput = {
    where?: BrandWhereInput
    data: XOR<BrandUpdateWithoutProductsInput, BrandUncheckedUpdateWithoutProductsInput>
  }

  export type BrandUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutBrandsNestedInput
  }

  export type BrandUncheckedUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type TaxUpsertWithoutProductsSalesInput = {
    update: XOR<TaxUpdateWithoutProductsSalesInput, TaxUncheckedUpdateWithoutProductsSalesInput>
    create: XOR<TaxCreateWithoutProductsSalesInput, TaxUncheckedCreateWithoutProductsSalesInput>
    where?: TaxWhereInput
  }

  export type TaxUpdateToOneWithWhereWithoutProductsSalesInput = {
    where?: TaxWhereInput
    data: XOR<TaxUpdateWithoutProductsSalesInput, TaxUncheckedUpdateWithoutProductsSalesInput>
  }

  export type TaxUpdateWithoutProductsSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutTaxesNestedInput
    productsPurchase?: ProductUpdateManyWithoutPurchaseTaxNestedInput
  }

  export type TaxUncheckedUpdateWithoutProductsSalesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    productsPurchase?: ProductUncheckedUpdateManyWithoutPurchaseTaxNestedInput
  }

  export type TaxUpsertWithoutProductsPurchaseInput = {
    update: XOR<TaxUpdateWithoutProductsPurchaseInput, TaxUncheckedUpdateWithoutProductsPurchaseInput>
    create: XOR<TaxCreateWithoutProductsPurchaseInput, TaxUncheckedCreateWithoutProductsPurchaseInput>
    where?: TaxWhereInput
  }

  export type TaxUpdateToOneWithWhereWithoutProductsPurchaseInput = {
    where?: TaxWhereInput
    data: XOR<TaxUpdateWithoutProductsPurchaseInput, TaxUncheckedUpdateWithoutProductsPurchaseInput>
  }

  export type TaxUpdateWithoutProductsPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutTaxesNestedInput
    productsSales?: ProductUpdateManyWithoutSalesTaxNestedInput
  }

  export type TaxUncheckedUpdateWithoutProductsPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    productsSales?: ProductUncheckedUpdateManyWithoutSalesTaxNestedInput
  }

  export type WarehouseUpsertWithoutProductsInput = {
    update: XOR<WarehouseUpdateWithoutProductsInput, WarehouseUncheckedUpdateWithoutProductsInput>
    create: XOR<WarehouseCreateWithoutProductsInput, WarehouseUncheckedCreateWithoutProductsInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutProductsInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutProductsInput, WarehouseUncheckedUpdateWithoutProductsInput>
  }

  export type WarehouseUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutProductsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type InventoryAdjustmentLineUpsertWithWhereUniqueWithoutProductInput = {
    where: InventoryAdjustmentLineWhereUniqueInput
    update: XOR<InventoryAdjustmentLineUpdateWithoutProductInput, InventoryAdjustmentLineUncheckedUpdateWithoutProductInput>
    create: XOR<InventoryAdjustmentLineCreateWithoutProductInput, InventoryAdjustmentLineUncheckedCreateWithoutProductInput>
  }

  export type InventoryAdjustmentLineUpdateWithWhereUniqueWithoutProductInput = {
    where: InventoryAdjustmentLineWhereUniqueInput
    data: XOR<InventoryAdjustmentLineUpdateWithoutProductInput, InventoryAdjustmentLineUncheckedUpdateWithoutProductInput>
  }

  export type InventoryAdjustmentLineUpdateManyWithWhereWithoutProductInput = {
    where: InventoryAdjustmentLineScalarWhereInput
    data: XOR<InventoryAdjustmentLineUpdateManyMutationInput, InventoryAdjustmentLineUncheckedUpdateManyWithoutProductInput>
  }

  export type InventoryAdjustmentLineScalarWhereInput = {
    AND?: InventoryAdjustmentLineScalarWhereInput | InventoryAdjustmentLineScalarWhereInput[]
    OR?: InventoryAdjustmentLineScalarWhereInput[]
    NOT?: InventoryAdjustmentLineScalarWhereInput | InventoryAdjustmentLineScalarWhereInput[]
    id?: StringFilter<"InventoryAdjustmentLine"> | string
    adjustmentId?: StringFilter<"InventoryAdjustmentLine"> | string
    productId?: StringFilter<"InventoryAdjustmentLine"> | string
    quantity?: IntFilter<"InventoryAdjustmentLine"> | number
  }

  export type InvoiceLineUpsertWithWhereUniqueWithoutProductInput = {
    where: InvoiceLineWhereUniqueInput
    update: XOR<InvoiceLineUpdateWithoutProductInput, InvoiceLineUncheckedUpdateWithoutProductInput>
    create: XOR<InvoiceLineCreateWithoutProductInput, InvoiceLineUncheckedCreateWithoutProductInput>
  }

  export type InvoiceLineUpdateWithWhereUniqueWithoutProductInput = {
    where: InvoiceLineWhereUniqueInput
    data: XOR<InvoiceLineUpdateWithoutProductInput, InvoiceLineUncheckedUpdateWithoutProductInput>
  }

  export type InvoiceLineUpdateManyWithWhereWithoutProductInput = {
    where: InvoiceLineScalarWhereInput
    data: XOR<InvoiceLineUpdateManyMutationInput, InvoiceLineUncheckedUpdateManyWithoutProductInput>
  }

  export type InvoiceLineScalarWhereInput = {
    AND?: InvoiceLineScalarWhereInput | InvoiceLineScalarWhereInput[]
    OR?: InvoiceLineScalarWhereInput[]
    NOT?: InvoiceLineScalarWhereInput | InvoiceLineScalarWhereInput[]
    id?: StringFilter<"InvoiceLine"> | string
    invoiceId?: StringFilter<"InvoiceLine"> | string
    productId?: StringFilter<"InvoiceLine"> | string
    quantity?: IntFilter<"InvoiceLine"> | number
    unitPrice?: FloatFilter<"InvoiceLine"> | number
    taxRate?: FloatFilter<"InvoiceLine"> | number
    lineTotal?: FloatFilter<"InvoiceLine"> | number
  }

  export type PurchaseLineUpsertWithWhereUniqueWithoutProductInput = {
    where: PurchaseLineWhereUniqueInput
    update: XOR<PurchaseLineUpdateWithoutProductInput, PurchaseLineUncheckedUpdateWithoutProductInput>
    create: XOR<PurchaseLineCreateWithoutProductInput, PurchaseLineUncheckedCreateWithoutProductInput>
  }

  export type PurchaseLineUpdateWithWhereUniqueWithoutProductInput = {
    where: PurchaseLineWhereUniqueInput
    data: XOR<PurchaseLineUpdateWithoutProductInput, PurchaseLineUncheckedUpdateWithoutProductInput>
  }

  export type PurchaseLineUpdateManyWithWhereWithoutProductInput = {
    where: PurchaseLineScalarWhereInput
    data: XOR<PurchaseLineUpdateManyMutationInput, PurchaseLineUncheckedUpdateManyWithoutProductInput>
  }

  export type PurchaseReturnLineUpsertWithWhereUniqueWithoutProductInput = {
    where: PurchaseReturnLineWhereUniqueInput
    update: XOR<PurchaseReturnLineUpdateWithoutProductInput, PurchaseReturnLineUncheckedUpdateWithoutProductInput>
    create: XOR<PurchaseReturnLineCreateWithoutProductInput, PurchaseReturnLineUncheckedCreateWithoutProductInput>
  }

  export type PurchaseReturnLineUpdateWithWhereUniqueWithoutProductInput = {
    where: PurchaseReturnLineWhereUniqueInput
    data: XOR<PurchaseReturnLineUpdateWithoutProductInput, PurchaseReturnLineUncheckedUpdateWithoutProductInput>
  }

  export type PurchaseReturnLineUpdateManyWithWhereWithoutProductInput = {
    where: PurchaseReturnLineScalarWhereInput
    data: XOR<PurchaseReturnLineUpdateManyMutationInput, PurchaseReturnLineUncheckedUpdateManyWithoutProductInput>
  }

  export type SaleLineUpsertWithWhereUniqueWithoutProductInput = {
    where: SaleLineWhereUniqueInput
    update: XOR<SaleLineUpdateWithoutProductInput, SaleLineUncheckedUpdateWithoutProductInput>
    create: XOR<SaleLineCreateWithoutProductInput, SaleLineUncheckedCreateWithoutProductInput>
  }

  export type SaleLineUpdateWithWhereUniqueWithoutProductInput = {
    where: SaleLineWhereUniqueInput
    data: XOR<SaleLineUpdateWithoutProductInput, SaleLineUncheckedUpdateWithoutProductInput>
  }

  export type SaleLineUpdateManyWithWhereWithoutProductInput = {
    where: SaleLineScalarWhereInput
    data: XOR<SaleLineUpdateManyMutationInput, SaleLineUncheckedUpdateManyWithoutProductInput>
  }

  export type SalesReturnLineUpsertWithWhereUniqueWithoutProductInput = {
    where: SalesReturnLineWhereUniqueInput
    update: XOR<SalesReturnLineUpdateWithoutProductInput, SalesReturnLineUncheckedUpdateWithoutProductInput>
    create: XOR<SalesReturnLineCreateWithoutProductInput, SalesReturnLineUncheckedCreateWithoutProductInput>
  }

  export type SalesReturnLineUpdateWithWhereUniqueWithoutProductInput = {
    where: SalesReturnLineWhereUniqueInput
    data: XOR<SalesReturnLineUpdateWithoutProductInput, SalesReturnLineUncheckedUpdateWithoutProductInput>
  }

  export type SalesReturnLineUpdateManyWithWhereWithoutProductInput = {
    where: SalesReturnLineScalarWhereInput
    data: XOR<SalesReturnLineUpdateManyMutationInput, SalesReturnLineUncheckedUpdateManyWithoutProductInput>
  }

  export type InventoryTransferLineUpsertWithWhereUniqueWithoutProductInput = {
    where: InventoryTransferLineWhereUniqueInput
    update: XOR<InventoryTransferLineUpdateWithoutProductInput, InventoryTransferLineUncheckedUpdateWithoutProductInput>
    create: XOR<InventoryTransferLineCreateWithoutProductInput, InventoryTransferLineUncheckedCreateWithoutProductInput>
  }

  export type InventoryTransferLineUpdateWithWhereUniqueWithoutProductInput = {
    where: InventoryTransferLineWhereUniqueInput
    data: XOR<InventoryTransferLineUpdateWithoutProductInput, InventoryTransferLineUncheckedUpdateWithoutProductInput>
  }

  export type InventoryTransferLineUpdateManyWithWhereWithoutProductInput = {
    where: InventoryTransferLineScalarWhereInput
    data: XOR<InventoryTransferLineUpdateManyMutationInput, InventoryTransferLineUncheckedUpdateManyWithoutProductInput>
  }

  export type InventoryTransferLineScalarWhereInput = {
    AND?: InventoryTransferLineScalarWhereInput | InventoryTransferLineScalarWhereInput[]
    OR?: InventoryTransferLineScalarWhereInput[]
    NOT?: InventoryTransferLineScalarWhereInput | InventoryTransferLineScalarWhereInput[]
    id?: StringFilter<"InventoryTransferLine"> | string
    transferId?: StringFilter<"InventoryTransferLine"> | string
    productId?: StringFilter<"InventoryTransferLine"> | string
    quantity?: IntFilter<"InventoryTransferLine"> | number
  }

  export type WarehouseStockUpsertWithWhereUniqueWithoutProductInput = {
    where: WarehouseStockWhereUniqueInput
    update: XOR<WarehouseStockUpdateWithoutProductInput, WarehouseStockUncheckedUpdateWithoutProductInput>
    create: XOR<WarehouseStockCreateWithoutProductInput, WarehouseStockUncheckedCreateWithoutProductInput>
  }

  export type WarehouseStockUpdateWithWhereUniqueWithoutProductInput = {
    where: WarehouseStockWhereUniqueInput
    data: XOR<WarehouseStockUpdateWithoutProductInput, WarehouseStockUncheckedUpdateWithoutProductInput>
  }

  export type WarehouseStockUpdateManyWithWhereWithoutProductInput = {
    where: WarehouseStockScalarWhereInput
    data: XOR<WarehouseStockUpdateManyMutationInput, WarehouseStockUncheckedUpdateManyWithoutProductInput>
  }

  export type WarehouseCreateWithoutTransfersFromInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutTransfersFromInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutTransfersFromInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutTransfersFromInput, WarehouseUncheckedCreateWithoutTransfersFromInput>
  }

  export type WarehouseCreateWithoutTransfersToInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutTransfersToInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutTransfersToInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutTransfersToInput, WarehouseUncheckedCreateWithoutTransfersToInput>
  }

  export type BranchCreateWithoutTransfersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutTransfersInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutTransfersInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutTransfersInput, BranchUncheckedCreateWithoutTransfersInput>
  }

  export type InventoryTransferLineCreateWithoutTransferInput = {
    id?: string
    quantity: number
    product: ProductCreateNestedOneWithoutTransferLinesInput
  }

  export type InventoryTransferLineUncheckedCreateWithoutTransferInput = {
    id?: string
    productId: string
    quantity: number
  }

  export type InventoryTransferLineCreateOrConnectWithoutTransferInput = {
    where: InventoryTransferLineWhereUniqueInput
    create: XOR<InventoryTransferLineCreateWithoutTransferInput, InventoryTransferLineUncheckedCreateWithoutTransferInput>
  }

  export type InventoryTransferLineCreateManyTransferInputEnvelope = {
    data: InventoryTransferLineCreateManyTransferInput | InventoryTransferLineCreateManyTransferInput[]
    skipDuplicates?: boolean
  }

  export type WarehouseUpsertWithoutTransfersFromInput = {
    update: XOR<WarehouseUpdateWithoutTransfersFromInput, WarehouseUncheckedUpdateWithoutTransfersFromInput>
    create: XOR<WarehouseCreateWithoutTransfersFromInput, WarehouseUncheckedCreateWithoutTransfersFromInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutTransfersFromInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutTransfersFromInput, WarehouseUncheckedUpdateWithoutTransfersFromInput>
  }

  export type WarehouseUpdateWithoutTransfersFromInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutTransfersFromInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUpsertWithoutTransfersToInput = {
    update: XOR<WarehouseUpdateWithoutTransfersToInput, WarehouseUncheckedUpdateWithoutTransfersToInput>
    create: XOR<WarehouseCreateWithoutTransfersToInput, WarehouseUncheckedCreateWithoutTransfersToInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutTransfersToInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutTransfersToInput, WarehouseUncheckedUpdateWithoutTransfersToInput>
  }

  export type WarehouseUpdateWithoutTransfersToInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutTransfersToInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutTransfersInput = {
    update: XOR<BranchUpdateWithoutTransfersInput, BranchUncheckedUpdateWithoutTransfersInput>
    create: XOR<BranchCreateWithoutTransfersInput, BranchUncheckedCreateWithoutTransfersInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutTransfersInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutTransfersInput, BranchUncheckedUpdateWithoutTransfersInput>
  }

  export type BranchUpdateWithoutTransfersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutTransfersInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type InventoryTransferLineUpsertWithWhereUniqueWithoutTransferInput = {
    where: InventoryTransferLineWhereUniqueInput
    update: XOR<InventoryTransferLineUpdateWithoutTransferInput, InventoryTransferLineUncheckedUpdateWithoutTransferInput>
    create: XOR<InventoryTransferLineCreateWithoutTransferInput, InventoryTransferLineUncheckedCreateWithoutTransferInput>
  }

  export type InventoryTransferLineUpdateWithWhereUniqueWithoutTransferInput = {
    where: InventoryTransferLineWhereUniqueInput
    data: XOR<InventoryTransferLineUpdateWithoutTransferInput, InventoryTransferLineUncheckedUpdateWithoutTransferInput>
  }

  export type InventoryTransferLineUpdateManyWithWhereWithoutTransferInput = {
    where: InventoryTransferLineScalarWhereInput
    data: XOR<InventoryTransferLineUpdateManyMutationInput, InventoryTransferLineUncheckedUpdateManyWithoutTransferInput>
  }

  export type InventoryTransferCreateWithoutLinesInput = {
    id?: string
    reference: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    fromWarehouse: WarehouseCreateNestedOneWithoutTransfersFromInput
    toWarehouse: WarehouseCreateNestedOneWithoutTransfersToInput
    branch?: BranchCreateNestedOneWithoutTransfersInput
  }

  export type InventoryTransferUncheckedCreateWithoutLinesInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    toWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryTransferCreateOrConnectWithoutLinesInput = {
    where: InventoryTransferWhereUniqueInput
    create: XOR<InventoryTransferCreateWithoutLinesInput, InventoryTransferUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutTransferLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutTransferLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutTransferLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutTransferLinesInput, ProductUncheckedCreateWithoutTransferLinesInput>
  }

  export type InventoryTransferUpsertWithoutLinesInput = {
    update: XOR<InventoryTransferUpdateWithoutLinesInput, InventoryTransferUncheckedUpdateWithoutLinesInput>
    create: XOR<InventoryTransferCreateWithoutLinesInput, InventoryTransferUncheckedCreateWithoutLinesInput>
    where?: InventoryTransferWhereInput
  }

  export type InventoryTransferUpdateToOneWithWhereWithoutLinesInput = {
    where?: InventoryTransferWhereInput
    data: XOR<InventoryTransferUpdateWithoutLinesInput, InventoryTransferUncheckedUpdateWithoutLinesInput>
  }

  export type InventoryTransferUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    fromWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersFromNestedInput
    toWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersToNestedInput
    branch?: BranchUpdateOneWithoutTransfersNestedInput
  }

  export type InventoryTransferUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ProductUpsertWithoutTransferLinesInput = {
    update: XOR<ProductUpdateWithoutTransferLinesInput, ProductUncheckedUpdateWithoutTransferLinesInput>
    create: XOR<ProductCreateWithoutTransferLinesInput, ProductUncheckedCreateWithoutTransferLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutTransferLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutTransferLinesInput, ProductUncheckedUpdateWithoutTransferLinesInput>
  }

  export type ProductUpdateWithoutTransferLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutTransferLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type CustomerCreateWithoutInvoicesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutCustomersInput
    sales?: SaleCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnCreateNestedManyWithoutCustomerInput
  }

  export type CustomerUncheckedCreateWithoutInvoicesInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    branchId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    sales?: SaleUncheckedCreateNestedManyWithoutCustomerInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutCustomerInput
  }

  export type CustomerCreateOrConnectWithoutInvoicesInput = {
    where: CustomerWhereUniqueInput
    create: XOR<CustomerCreateWithoutInvoicesInput, CustomerUncheckedCreateWithoutInvoicesInput>
  }

  export type SaleCreateWithoutInvoicesInput = {
    id?: string
    number: string
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutSalesInput
    warehouse?: WarehouseCreateNestedOneWithoutSalesInput
    branch?: BranchCreateNestedOneWithoutSalesInput
    paymentMethod?: PaymentMethodCreateNestedOneWithoutSalesInput
    lines?: SaleLineCreateNestedManyWithoutSaleInput
    returns?: SalesReturnCreateNestedManyWithoutSaleInput
  }

  export type SaleUncheckedCreateWithoutInvoicesInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    lines?: SaleLineUncheckedCreateNestedManyWithoutSaleInput
    returns?: SalesReturnUncheckedCreateNestedManyWithoutSaleInput
  }

  export type SaleCreateOrConnectWithoutInvoicesInput = {
    where: SaleWhereUniqueInput
    create: XOR<SaleCreateWithoutInvoicesInput, SaleUncheckedCreateWithoutInvoicesInput>
  }

  export type BranchCreateWithoutInvoicesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutInvoicesInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    adjustments?: InventoryAdjustmentUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutInvoicesInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutInvoicesInput, BranchUncheckedCreateWithoutInvoicesInput>
  }

  export type InvoiceLineCreateWithoutInvoiceInput = {
    id?: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
    product: ProductCreateNestedOneWithoutInvoiceLinesInput
  }

  export type InvoiceLineUncheckedCreateWithoutInvoiceInput = {
    id?: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type InvoiceLineCreateOrConnectWithoutInvoiceInput = {
    where: InvoiceLineWhereUniqueInput
    create: XOR<InvoiceLineCreateWithoutInvoiceInput, InvoiceLineUncheckedCreateWithoutInvoiceInput>
  }

  export type InvoiceLineCreateManyInvoiceInputEnvelope = {
    data: InvoiceLineCreateManyInvoiceInput | InvoiceLineCreateManyInvoiceInput[]
    skipDuplicates?: boolean
  }

  export type CustomerUpsertWithoutInvoicesInput = {
    update: XOR<CustomerUpdateWithoutInvoicesInput, CustomerUncheckedUpdateWithoutInvoicesInput>
    create: XOR<CustomerCreateWithoutInvoicesInput, CustomerUncheckedCreateWithoutInvoicesInput>
    where?: CustomerWhereInput
  }

  export type CustomerUpdateToOneWithWhereWithoutInvoicesInput = {
    where?: CustomerWhereInput
    data: XOR<CustomerUpdateWithoutInvoicesInput, CustomerUncheckedUpdateWithoutInvoicesInput>
  }

  export type CustomerUpdateWithoutInvoicesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutCustomersNestedInput
    sales?: SaleUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerUncheckedUpdateWithoutInvoicesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    sales?: SaleUncheckedUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutCustomerNestedInput
  }

  export type SaleUpsertWithoutInvoicesInput = {
    update: XOR<SaleUpdateWithoutInvoicesInput, SaleUncheckedUpdateWithoutInvoicesInput>
    create: XOR<SaleCreateWithoutInvoicesInput, SaleUncheckedCreateWithoutInvoicesInput>
    where?: SaleWhereInput
  }

  export type SaleUpdateToOneWithWhereWithoutInvoicesInput = {
    where?: SaleWhereInput
    data: XOR<SaleUpdateWithoutInvoicesInput, SaleUncheckedUpdateWithoutInvoicesInput>
  }

  export type SaleUpdateWithoutInvoicesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutInvoicesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type BranchUpsertWithoutInvoicesInput = {
    update: XOR<BranchUpdateWithoutInvoicesInput, BranchUncheckedUpdateWithoutInvoicesInput>
    create: XOR<BranchCreateWithoutInvoicesInput, BranchUncheckedCreateWithoutInvoicesInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutInvoicesInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutInvoicesInput, BranchUncheckedUpdateWithoutInvoicesInput>
  }

  export type BranchUpdateWithoutInvoicesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutInvoicesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type InvoiceLineUpsertWithWhereUniqueWithoutInvoiceInput = {
    where: InvoiceLineWhereUniqueInput
    update: XOR<InvoiceLineUpdateWithoutInvoiceInput, InvoiceLineUncheckedUpdateWithoutInvoiceInput>
    create: XOR<InvoiceLineCreateWithoutInvoiceInput, InvoiceLineUncheckedCreateWithoutInvoiceInput>
  }

  export type InvoiceLineUpdateWithWhereUniqueWithoutInvoiceInput = {
    where: InvoiceLineWhereUniqueInput
    data: XOR<InvoiceLineUpdateWithoutInvoiceInput, InvoiceLineUncheckedUpdateWithoutInvoiceInput>
  }

  export type InvoiceLineUpdateManyWithWhereWithoutInvoiceInput = {
    where: InvoiceLineScalarWhereInput
    data: XOR<InvoiceLineUpdateManyMutationInput, InvoiceLineUncheckedUpdateManyWithoutInvoiceInput>
  }

  export type InvoiceCreateWithoutLinesInput = {
    id?: string
    number: string
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    customer?: CustomerCreateNestedOneWithoutInvoicesInput
    sale?: SaleCreateNestedOneWithoutInvoicesInput
    branch?: BranchCreateNestedOneWithoutInvoicesInput
  }

  export type InvoiceUncheckedCreateWithoutLinesInput = {
    id?: string
    number: string
    customerId?: string | null
    saleId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type InvoiceCreateOrConnectWithoutLinesInput = {
    where: InvoiceWhereUniqueInput
    create: XOR<InvoiceCreateWithoutLinesInput, InvoiceUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutInvoiceLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    adjustmentLines?: InventoryAdjustmentLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutInvoiceLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutInvoiceLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutInvoiceLinesInput, ProductUncheckedCreateWithoutInvoiceLinesInput>
  }

  export type InvoiceUpsertWithoutLinesInput = {
    update: XOR<InvoiceUpdateWithoutLinesInput, InvoiceUncheckedUpdateWithoutLinesInput>
    create: XOR<InvoiceCreateWithoutLinesInput, InvoiceUncheckedCreateWithoutLinesInput>
    where?: InvoiceWhereInput
  }

  export type InvoiceUpdateToOneWithWhereWithoutLinesInput = {
    where?: InvoiceWhereInput
    data: XOR<InvoiceUpdateWithoutLinesInput, InvoiceUncheckedUpdateWithoutLinesInput>
  }

  export type InvoiceUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutInvoicesNestedInput
    sale?: SaleUpdateOneWithoutInvoicesNestedInput
    branch?: BranchUpdateOneWithoutInvoicesNestedInput
  }

  export type InvoiceUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductUpsertWithoutInvoiceLinesInput = {
    update: XOR<ProductUpdateWithoutInvoiceLinesInput, ProductUncheckedUpdateWithoutInvoiceLinesInput>
    create: XOR<ProductCreateWithoutInvoiceLinesInput, ProductUncheckedCreateWithoutInvoiceLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutInvoiceLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutInvoiceLinesInput, ProductUncheckedUpdateWithoutInvoiceLinesInput>
  }

  export type ProductUpdateWithoutInvoiceLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutInvoiceLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type WarehouseCreateWithoutAdjustmentsInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    branch?: BranchCreateNestedOneWithoutWarehousesInput
    products?: ProductCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutWarehouseInput
    sales?: SaleCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseUncheckedCreateWithoutAdjustmentsInput = {
    id?: string
    name: string
    branchId?: string | null
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    products?: ProductUncheckedCreateNestedManyWithoutWarehouseInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutWarehouseInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutWarehouseInput
    sales?: SaleUncheckedCreateNestedManyWithoutWarehouseInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutWarehouseInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutWarehouseInput
    transfersFrom?: InventoryTransferUncheckedCreateNestedManyWithoutFromWarehouseInput
    transfersTo?: InventoryTransferUncheckedCreateNestedManyWithoutToWarehouseInput
    stocks?: WarehouseStockUncheckedCreateNestedManyWithoutWarehouseInput
  }

  export type WarehouseCreateOrConnectWithoutAdjustmentsInput = {
    where: WarehouseWhereUniqueInput
    create: XOR<WarehouseCreateWithoutAdjustmentsInput, WarehouseUncheckedCreateWithoutAdjustmentsInput>
  }

  export type BranchCreateWithoutAdjustmentsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchCreateNestedManyWithoutBranchInput
    activeUsers?: UserCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierCreateNestedManyWithoutBranchInput
    customers?: CustomerCreateNestedManyWithoutBranchInput
    products?: ProductCreateNestedManyWithoutBranchInput
    sales?: SaleCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnCreateNestedManyWithoutBranchInput
    purchases?: PurchaseCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnCreateNestedManyWithoutBranchInput
    invoices?: InvoiceCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryCreateNestedManyWithoutBranchInput
    expenses?: ExpenseCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferCreateNestedManyWithoutBranchInput
    categories?: CategoryCreateNestedManyWithoutBranchInput
    brands?: BrandCreateNestedManyWithoutBranchInput
    units?: UnitCreateNestedManyWithoutBranchInput
    variations?: VariationCreateNestedManyWithoutBranchInput
    taxes?: TaxCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodCreateNestedManyWithoutBranchInput
  }

  export type BranchUncheckedCreateWithoutAdjustmentsInput = {
    id?: string
    name: string
    code?: string | null
    address?: string | null
    city?: string | null
    country?: string | null
    phone?: string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    users?: UserBranchUncheckedCreateNestedManyWithoutBranchInput
    activeUsers?: UserUncheckedCreateNestedManyWithoutActiveBranchInput
    suppliers?: SupplierUncheckedCreateNestedManyWithoutBranchInput
    customers?: CustomerUncheckedCreateNestedManyWithoutBranchInput
    products?: ProductUncheckedCreateNestedManyWithoutBranchInput
    sales?: SaleUncheckedCreateNestedManyWithoutBranchInput
    salesReturns?: SalesReturnUncheckedCreateNestedManyWithoutBranchInput
    purchases?: PurchaseUncheckedCreateNestedManyWithoutBranchInput
    purchaseReturns?: PurchaseReturnUncheckedCreateNestedManyWithoutBranchInput
    invoices?: InvoiceUncheckedCreateNestedManyWithoutBranchInput
    expenseCategories?: ExpenseCategoryUncheckedCreateNestedManyWithoutBranchInput
    expenses?: ExpenseUncheckedCreateNestedManyWithoutBranchInput
    transfers?: InventoryTransferUncheckedCreateNestedManyWithoutBranchInput
    categories?: CategoryUncheckedCreateNestedManyWithoutBranchInput
    brands?: BrandUncheckedCreateNestedManyWithoutBranchInput
    units?: UnitUncheckedCreateNestedManyWithoutBranchInput
    variations?: VariationUncheckedCreateNestedManyWithoutBranchInput
    taxes?: TaxUncheckedCreateNestedManyWithoutBranchInput
    warehouses?: WarehouseUncheckedCreateNestedManyWithoutBranchInput
    paymentMethods?: PaymentMethodUncheckedCreateNestedManyWithoutBranchInput
  }

  export type BranchCreateOrConnectWithoutAdjustmentsInput = {
    where: BranchWhereUniqueInput
    create: XOR<BranchCreateWithoutAdjustmentsInput, BranchUncheckedCreateWithoutAdjustmentsInput>
  }

  export type InventoryAdjustmentLineCreateWithoutAdjustmentInput = {
    id?: string
    quantity: number
    product: ProductCreateNestedOneWithoutAdjustmentLinesInput
  }

  export type InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput = {
    id?: string
    productId: string
    quantity: number
  }

  export type InventoryAdjustmentLineCreateOrConnectWithoutAdjustmentInput = {
    where: InventoryAdjustmentLineWhereUniqueInput
    create: XOR<InventoryAdjustmentLineCreateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput>
  }

  export type InventoryAdjustmentLineCreateManyAdjustmentInputEnvelope = {
    data: InventoryAdjustmentLineCreateManyAdjustmentInput | InventoryAdjustmentLineCreateManyAdjustmentInput[]
    skipDuplicates?: boolean
  }

  export type WarehouseUpsertWithoutAdjustmentsInput = {
    update: XOR<WarehouseUpdateWithoutAdjustmentsInput, WarehouseUncheckedUpdateWithoutAdjustmentsInput>
    create: XOR<WarehouseCreateWithoutAdjustmentsInput, WarehouseUncheckedCreateWithoutAdjustmentsInput>
    where?: WarehouseWhereInput
  }

  export type WarehouseUpdateToOneWithWhereWithoutAdjustmentsInput = {
    where?: WarehouseWhereInput
    data: XOR<WarehouseUpdateWithoutAdjustmentsInput, WarehouseUncheckedUpdateWithoutAdjustmentsInput>
  }

  export type WarehouseUpdateWithoutAdjustmentsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutWarehousesNestedInput
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutAdjustmentsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type BranchUpsertWithoutAdjustmentsInput = {
    update: XOR<BranchUpdateWithoutAdjustmentsInput, BranchUncheckedUpdateWithoutAdjustmentsInput>
    create: XOR<BranchCreateWithoutAdjustmentsInput, BranchUncheckedCreateWithoutAdjustmentsInput>
    where?: BranchWhereInput
  }

  export type BranchUpdateToOneWithWhereWithoutAdjustmentsInput = {
    where?: BranchWhereInput
    data: XOR<BranchUpdateWithoutAdjustmentsInput, BranchUncheckedUpdateWithoutAdjustmentsInput>
  }

  export type BranchUpdateWithoutAdjustmentsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUpdateManyWithoutBranchNestedInput
    customers?: CustomerUpdateManyWithoutBranchNestedInput
    products?: ProductUpdateManyWithoutBranchNestedInput
    sales?: SaleUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUpdateManyWithoutBranchNestedInput
    categories?: CategoryUpdateManyWithoutBranchNestedInput
    brands?: BrandUpdateManyWithoutBranchNestedInput
    units?: UnitUpdateManyWithoutBranchNestedInput
    variations?: VariationUpdateManyWithoutBranchNestedInput
    taxes?: TaxUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUpdateManyWithoutBranchNestedInput
  }

  export type BranchUncheckedUpdateWithoutAdjustmentsInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    address?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    phones?: NullableJsonNullValueInput | InputJsonValue
    email?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    users?: UserBranchUncheckedUpdateManyWithoutBranchNestedInput
    activeUsers?: UserUncheckedUpdateManyWithoutActiveBranchNestedInput
    suppliers?: SupplierUncheckedUpdateManyWithoutBranchNestedInput
    customers?: CustomerUncheckedUpdateManyWithoutBranchNestedInput
    products?: ProductUncheckedUpdateManyWithoutBranchNestedInput
    sales?: SaleUncheckedUpdateManyWithoutBranchNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutBranchNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutBranchNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutBranchNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutBranchNestedInput
    expenseCategories?: ExpenseCategoryUncheckedUpdateManyWithoutBranchNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutBranchNestedInput
    transfers?: InventoryTransferUncheckedUpdateManyWithoutBranchNestedInput
    categories?: CategoryUncheckedUpdateManyWithoutBranchNestedInput
    brands?: BrandUncheckedUpdateManyWithoutBranchNestedInput
    units?: UnitUncheckedUpdateManyWithoutBranchNestedInput
    variations?: VariationUncheckedUpdateManyWithoutBranchNestedInput
    taxes?: TaxUncheckedUpdateManyWithoutBranchNestedInput
    warehouses?: WarehouseUncheckedUpdateManyWithoutBranchNestedInput
    paymentMethods?: PaymentMethodUncheckedUpdateManyWithoutBranchNestedInput
  }

  export type InventoryAdjustmentLineUpsertWithWhereUniqueWithoutAdjustmentInput = {
    where: InventoryAdjustmentLineWhereUniqueInput
    update: XOR<InventoryAdjustmentLineUpdateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedUpdateWithoutAdjustmentInput>
    create: XOR<InventoryAdjustmentLineCreateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedCreateWithoutAdjustmentInput>
  }

  export type InventoryAdjustmentLineUpdateWithWhereUniqueWithoutAdjustmentInput = {
    where: InventoryAdjustmentLineWhereUniqueInput
    data: XOR<InventoryAdjustmentLineUpdateWithoutAdjustmentInput, InventoryAdjustmentLineUncheckedUpdateWithoutAdjustmentInput>
  }

  export type InventoryAdjustmentLineUpdateManyWithWhereWithoutAdjustmentInput = {
    where: InventoryAdjustmentLineScalarWhereInput
    data: XOR<InventoryAdjustmentLineUpdateManyMutationInput, InventoryAdjustmentLineUncheckedUpdateManyWithoutAdjustmentInput>
  }

  export type InventoryAdjustmentCreateWithoutLinesInput = {
    id?: string
    reference?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
    warehouse: WarehouseCreateNestedOneWithoutAdjustmentsInput
    branch?: BranchCreateNestedOneWithoutAdjustmentsInput
  }

  export type InventoryAdjustmentUncheckedCreateWithoutLinesInput = {
    id?: string
    reference?: string | null
    warehouseId: string
    branchId?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryAdjustmentCreateOrConnectWithoutLinesInput = {
    where: InventoryAdjustmentWhereUniqueInput
    create: XOR<InventoryAdjustmentCreateWithoutLinesInput, InventoryAdjustmentUncheckedCreateWithoutLinesInput>
  }

  export type ProductCreateWithoutAdjustmentLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    branch?: BranchCreateNestedOneWithoutProductsInput
    category?: CategoryCreateNestedOneWithoutProductsInput
    unit?: UnitCreateNestedOneWithoutProductsInput
    brand?: BrandCreateNestedOneWithoutProductsInput
    salesTax?: TaxCreateNestedOneWithoutProductsSalesInput
    purchaseTax?: TaxCreateNestedOneWithoutProductsPurchaseInput
    warehouse?: WarehouseCreateNestedOneWithoutProductsInput
    invoiceLines?: InvoiceLineCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineCreateNestedManyWithoutProductInput
    saleLines?: SaleLineCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockCreateNestedManyWithoutProductInput
  }

  export type ProductUncheckedCreateWithoutAdjustmentLinesInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    invoiceLines?: InvoiceLineUncheckedCreateNestedManyWithoutProductInput
    purchaseLines?: PurchaseLineUncheckedCreateNestedManyWithoutProductInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedCreateNestedManyWithoutProductInput
    saleLines?: SaleLineUncheckedCreateNestedManyWithoutProductInput
    salesReturnLines?: SalesReturnLineUncheckedCreateNestedManyWithoutProductInput
    transferLines?: InventoryTransferLineUncheckedCreateNestedManyWithoutProductInput
    warehouseStocks?: WarehouseStockUncheckedCreateNestedManyWithoutProductInput
  }

  export type ProductCreateOrConnectWithoutAdjustmentLinesInput = {
    where: ProductWhereUniqueInput
    create: XOR<ProductCreateWithoutAdjustmentLinesInput, ProductUncheckedCreateWithoutAdjustmentLinesInput>
  }

  export type InventoryAdjustmentUpsertWithoutLinesInput = {
    update: XOR<InventoryAdjustmentUpdateWithoutLinesInput, InventoryAdjustmentUncheckedUpdateWithoutLinesInput>
    create: XOR<InventoryAdjustmentCreateWithoutLinesInput, InventoryAdjustmentUncheckedCreateWithoutLinesInput>
    where?: InventoryAdjustmentWhereInput
  }

  export type InventoryAdjustmentUpdateToOneWithWhereWithoutLinesInput = {
    where?: InventoryAdjustmentWhereInput
    data: XOR<InventoryAdjustmentUpdateWithoutLinesInput, InventoryAdjustmentUncheckedUpdateWithoutLinesInput>
  }

  export type InventoryAdjustmentUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    warehouse?: WarehouseUpdateOneRequiredWithoutAdjustmentsNestedInput
    branch?: BranchUpdateOneWithoutAdjustmentsNestedInput
  }

  export type InventoryAdjustmentUncheckedUpdateWithoutLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ProductUpsertWithoutAdjustmentLinesInput = {
    update: XOR<ProductUpdateWithoutAdjustmentLinesInput, ProductUncheckedUpdateWithoutAdjustmentLinesInput>
    create: XOR<ProductCreateWithoutAdjustmentLinesInput, ProductUncheckedCreateWithoutAdjustmentLinesInput>
    where?: ProductWhereInput
  }

  export type ProductUpdateToOneWithWhereWithoutAdjustmentLinesInput = {
    where?: ProductWhereInput
    data: XOR<ProductUpdateWithoutAdjustmentLinesInput, ProductUncheckedUpdateWithoutAdjustmentLinesInput>
  }

  export type ProductUpdateWithoutAdjustmentLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutAdjustmentLinesInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type UserCreateWithoutNotificationsInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleCreateNestedManyWithoutUserInput
    activeBranch?: BranchCreateNestedOneWithoutActiveUsersInput
    branches?: UserBranchCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogCreateNestedManyWithoutUserInput
  }

  export type UserUncheckedCreateWithoutNotificationsInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    activeBranchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleUncheckedCreateNestedManyWithoutUserInput
    branches?: UserBranchUncheckedCreateNestedManyWithoutUserInput
    activityLogs?: ActivityLogUncheckedCreateNestedManyWithoutUserInput
  }

  export type UserCreateOrConnectWithoutNotificationsInput = {
    where: UserWhereUniqueInput
    create: XOR<UserCreateWithoutNotificationsInput, UserUncheckedCreateWithoutNotificationsInput>
  }

  export type UserUpsertWithoutNotificationsInput = {
    update: XOR<UserUpdateWithoutNotificationsInput, UserUncheckedUpdateWithoutNotificationsInput>
    create: XOR<UserCreateWithoutNotificationsInput, UserUncheckedCreateWithoutNotificationsInput>
    where?: UserWhereInput
  }

  export type UserUpdateToOneWithWhereWithoutNotificationsInput = {
    where?: UserWhereInput
    data: XOR<UserUpdateWithoutNotificationsInput, UserUncheckedUpdateWithoutNotificationsInput>
  }

  export type UserUpdateWithoutNotificationsInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUpdateManyWithoutUserNestedInput
    activeBranch?: BranchUpdateOneWithoutActiveUsersNestedInput
    branches?: UserBranchUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateWithoutNotificationsInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUncheckedUpdateManyWithoutUserNestedInput
    branches?: UserBranchUncheckedUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUncheckedUpdateManyWithoutUserNestedInput
  }

  export type UserCreateWithoutActivityLogsInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleCreateNestedManyWithoutUserInput
    activeBranch?: BranchCreateNestedOneWithoutActiveUsersInput
    branches?: UserBranchCreateNestedManyWithoutUserInput
    notifications?: NotificationCreateNestedManyWithoutUserInput
  }

  export type UserUncheckedCreateWithoutActivityLogsInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    activeBranchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
    roles?: UserRoleUncheckedCreateNestedManyWithoutUserInput
    branches?: UserBranchUncheckedCreateNestedManyWithoutUserInput
    notifications?: NotificationUncheckedCreateNestedManyWithoutUserInput
  }

  export type UserCreateOrConnectWithoutActivityLogsInput = {
    where: UserWhereUniqueInput
    create: XOR<UserCreateWithoutActivityLogsInput, UserUncheckedCreateWithoutActivityLogsInput>
  }

  export type UserUpsertWithoutActivityLogsInput = {
    update: XOR<UserUpdateWithoutActivityLogsInput, UserUncheckedUpdateWithoutActivityLogsInput>
    create: XOR<UserCreateWithoutActivityLogsInput, UserUncheckedCreateWithoutActivityLogsInput>
    where?: UserWhereInput
  }

  export type UserUpdateToOneWithWhereWithoutActivityLogsInput = {
    where?: UserWhereInput
    data: XOR<UserUpdateWithoutActivityLogsInput, UserUncheckedUpdateWithoutActivityLogsInput>
  }

  export type UserUpdateWithoutActivityLogsInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUpdateManyWithoutUserNestedInput
    activeBranch?: BranchUpdateOneWithoutActiveUsersNestedInput
    branches?: UserBranchUpdateManyWithoutUserNestedInput
    notifications?: NotificationUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateWithoutActivityLogsInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    activeBranchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUncheckedUpdateManyWithoutUserNestedInput
    branches?: UserBranchUncheckedUpdateManyWithoutUserNestedInput
    notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput
  }

  export type UserRoleCreateManyUserInput = {
    roleId: string
    assignedAt?: Date | string
  }

  export type UserBranchCreateManyUserInput = {
    branchId: string
    assignedAt?: Date | string
  }

  export type NotificationCreateManyUserInput = {
    id?: string
    title: string
    message: string
    type?: string
    link?: string | null
    isRead?: boolean
    createdAt?: Date | string
  }

  export type ActivityLogCreateManyUserInput = {
    id?: string
    action: string
    entityType: string
    entityId?: string | null
    summary?: string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
  }

  export type UserRoleUpdateWithoutUserInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    role?: RoleUpdateOneRequiredWithoutUsersNestedInput
  }

  export type UserRoleUncheckedUpdateWithoutUserInput = {
    roleId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserRoleUncheckedUpdateManyWithoutUserInput = {
    roleId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchUpdateWithoutUserInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneRequiredWithoutUsersNestedInput
  }

  export type UserBranchUncheckedUpdateWithoutUserInput = {
    branchId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchUncheckedUpdateManyWithoutUserInput = {
    branchId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type NotificationUpdateWithoutUserInput = {
    id?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type NotificationUncheckedUpdateWithoutUserInput = {
    id?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type NotificationUncheckedUpdateManyWithoutUserInput = {
    id?: StringFieldUpdateOperationsInput | string
    title?: StringFieldUpdateOperationsInput | string
    message?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    link?: NullableStringFieldUpdateOperationsInput | string | null
    isRead?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ActivityLogUpdateWithoutUserInput = {
    id?: StringFieldUpdateOperationsInput | string
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ActivityLogUncheckedUpdateWithoutUserInput = {
    id?: StringFieldUpdateOperationsInput | string
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ActivityLogUncheckedUpdateManyWithoutUserInput = {
    id?: StringFieldUpdateOperationsInput | string
    action?: StringFieldUpdateOperationsInput | string
    entityType?: StringFieldUpdateOperationsInput | string
    entityId?: NullableStringFieldUpdateOperationsInput | string | null
    summary?: NullableStringFieldUpdateOperationsInput | string | null
    metadata?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchCreateManyBranchInput = {
    userId: string
    assignedAt?: Date | string
  }

  export type UserCreateManyActiveBranchInput = {
    id?: string
    email: string
    username?: string | null
    fullName: string
    passwordHash: string
    isVerified?: boolean
    isApproved?: boolean
    verificationToken?: string | null
    verificationTokenExpiry?: Date | string | null
    passwordResetToken?: string | null
    passwordResetTokenExpiry?: Date | string | null
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SupplierCreateManyBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type CustomerCreateManyBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ProductCreateManyBranchInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SaleCreateManyBranchInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SalesReturnCreateManyBranchInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    warehouseId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PurchaseCreateManyBranchInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type PurchaseReturnCreateManyBranchInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    warehouseId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InvoiceCreateManyBranchInput = {
    id?: string
    number: string
    customerId?: string | null
    saleId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ExpenseCategoryCreateManyBranchInput = {
    id?: string
    name: string
    description?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCreateManyBranchInput = {
    id?: string
    reference: string
    categoryId?: string | null
    warehouseId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryAdjustmentCreateManyBranchInput = {
    id?: string
    reference?: string | null
    warehouseId: string
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryTransferCreateManyBranchInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    toWarehouseId: string
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type CategoryCreateManyBranchInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    parentId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type BrandCreateManyBranchInput = {
    id?: string
    name: string
    logo?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type UnitCreateManyBranchInput = {
    id?: string
    name: string
    symbol?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type VariationCreateManyBranchInput = {
    id?: string
    name: string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type TaxCreateManyBranchInput = {
    id?: string
    name: string
    rate?: number
    isActive?: boolean
    sortOrder?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseCreateManyBranchInput = {
    id?: string
    name: string
    email?: string | null
    phone?: string | null
    country?: string | null
    city?: string | null
    zipCode?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PaymentMethodCreateManyBranchInput = {
    id?: string
    name: string
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type UserBranchUpdateWithoutBranchInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    user?: UserUpdateOneRequiredWithoutBranchesNestedInput
  }

  export type UserBranchUncheckedUpdateWithoutBranchInput = {
    userId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserBranchUncheckedUpdateManyWithoutBranchInput = {
    userId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserUpdateWithoutActiveBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUpdateManyWithoutUserNestedInput
    branches?: UserBranchUpdateManyWithoutUserNestedInput
    notifications?: NotificationUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateWithoutActiveBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    roles?: UserRoleUncheckedUpdateManyWithoutUserNestedInput
    branches?: UserBranchUncheckedUpdateManyWithoutUserNestedInput
    notifications?: NotificationUncheckedUpdateManyWithoutUserNestedInput
    activityLogs?: ActivityLogUncheckedUpdateManyWithoutUserNestedInput
  }

  export type UserUncheckedUpdateManyWithoutActiveBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    email?: StringFieldUpdateOperationsInput | string
    username?: NullableStringFieldUpdateOperationsInput | string | null
    fullName?: StringFieldUpdateOperationsInput | string
    passwordHash?: StringFieldUpdateOperationsInput | string
    isVerified?: BoolFieldUpdateOperationsInput | boolean
    isApproved?: BoolFieldUpdateOperationsInput | boolean
    verificationToken?: NullableStringFieldUpdateOperationsInput | string | null
    verificationTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    passwordResetToken?: NullableStringFieldUpdateOperationsInput | string | null
    passwordResetTokenExpiry?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SupplierUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    purchases?: PurchaseUpdateManyWithoutSupplierNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutSupplierNestedInput
  }

  export type SupplierUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    purchases?: PurchaseUncheckedUpdateManyWithoutSupplierNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutSupplierNestedInput
  }

  export type SupplierUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type CustomerUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    invoices?: InvoiceUpdateManyWithoutCustomerNestedInput
    sales?: SaleUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    invoices?: InvoiceUncheckedUpdateManyWithoutCustomerNestedInput
    sales?: SaleUncheckedUpdateManyWithoutCustomerNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutCustomerNestedInput
  }

  export type CustomerUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SaleUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SalesReturnUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sale?: SaleUpdateOneWithoutReturnsNestedInput
    customer?: CustomerUpdateOneWithoutSalesReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesReturnsNestedInput
    lines?: SalesReturnLineUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: SalesReturnLineUncheckedUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    supplier?: SupplierUpdateOneWithoutPurchasesNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchasesNestedInput
    lines?: PurchaseLineUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: PurchaseLineUncheckedUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUncheckedUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PurchaseReturnUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    purchase?: PurchaseUpdateOneWithoutReturnsNestedInput
    supplier?: SupplierUpdateOneWithoutPurchaseReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchaseReturnsNestedInput
    lines?: PurchaseReturnLineUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InvoiceUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutInvoicesNestedInput
    sale?: SaleUpdateOneWithoutInvoicesNestedInput
    lines?: InvoiceLineUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: InvoiceLineUncheckedUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ExpenseCategoryUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    expenses?: ExpenseUpdateManyWithoutCategoryNestedInput
  }

  export type ExpenseCategoryUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    expenses?: ExpenseUncheckedUpdateManyWithoutCategoryNestedInput
  }

  export type ExpenseCategoryUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    description?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    category?: ExpenseCategoryUpdateOneWithoutExpensesNestedInput
    warehouse?: WarehouseUpdateOneWithoutExpensesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutExpensesNestedInput
  }

  export type ExpenseUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryAdjustmentUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    warehouse?: WarehouseUpdateOneRequiredWithoutAdjustmentsNestedInput
    lines?: InventoryAdjustmentLineUpdateManyWithoutAdjustmentNestedInput
  }

  export type InventoryAdjustmentUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutAdjustmentNestedInput
  }

  export type InventoryAdjustmentUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: StringFieldUpdateOperationsInput | string
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryTransferUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    fromWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersFromNestedInput
    toWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersToNestedInput
    lines?: InventoryTransferLineUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryTransferLineUncheckedUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type CategoryUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    parent?: CategoryUpdateOneWithoutChildrenNestedInput
    children?: CategoryUpdateManyWithoutParentNestedInput
    products?: ProductUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    parentId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    children?: CategoryUncheckedUpdateManyWithoutParentNestedInput
    products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    parentId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type BrandUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUpdateManyWithoutBrandNestedInput
  }

  export type BrandUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutBrandNestedInput
  }

  export type BrandUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    logo?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UnitUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUpdateManyWithoutUnitNestedInput
  }

  export type UnitUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutUnitNestedInput
  }

  export type UnitUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    symbol?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type VariationUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type VariationUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type VariationUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    options?: NullableJsonNullValueInput | InputJsonValue
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type TaxUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    productsSales?: ProductUpdateManyWithoutSalesTaxNestedInput
    productsPurchase?: ProductUpdateManyWithoutPurchaseTaxNestedInput
  }

  export type TaxUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    productsSales?: ProductUncheckedUpdateManyWithoutSalesTaxNestedInput
    productsPurchase?: ProductUncheckedUpdateManyWithoutPurchaseTaxNestedInput
  }

  export type TaxUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    rate?: FloatFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    sortOrder?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    products?: ProductUncheckedUpdateManyWithoutWarehouseNestedInput
    adjustments?: InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseNestedInput
    purchases?: PurchaseUncheckedUpdateManyWithoutWarehouseNestedInput
    purchaseReturns?: PurchaseReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    sales?: SaleUncheckedUpdateManyWithoutWarehouseNestedInput
    salesReturns?: SalesReturnUncheckedUpdateManyWithoutWarehouseNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutWarehouseNestedInput
    transfersFrom?: InventoryTransferUncheckedUpdateManyWithoutFromWarehouseNestedInput
    transfersTo?: InventoryTransferUncheckedUpdateManyWithoutToWarehouseNestedInput
    stocks?: WarehouseStockUncheckedUpdateManyWithoutWarehouseNestedInput
  }

  export type WarehouseUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    email?: NullableStringFieldUpdateOperationsInput | string | null
    phone?: NullableStringFieldUpdateOperationsInput | string | null
    country?: NullableStringFieldUpdateOperationsInput | string | null
    city?: NullableStringFieldUpdateOperationsInput | string | null
    zipCode?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PaymentMethodUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sales?: SaleUpdateManyWithoutPaymentMethodNestedInput
    expenses?: ExpenseUpdateManyWithoutPaymentMethodNestedInput
  }

  export type PaymentMethodUncheckedUpdateWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sales?: SaleUncheckedUpdateManyWithoutPaymentMethodNestedInput
    expenses?: ExpenseUncheckedUpdateManyWithoutPaymentMethodNestedInput
  }

  export type PaymentMethodUncheckedUpdateManyWithoutBranchInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserRoleCreateManyRoleInput = {
    userId: string
    assignedAt?: Date | string
  }

  export type RolePermissionCreateManyRoleInput = {
    permissionId: string
  }

  export type UserRoleUpdateWithoutRoleInput = {
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    user?: UserUpdateOneRequiredWithoutRolesNestedInput
  }

  export type UserRoleUncheckedUpdateWithoutRoleInput = {
    userId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type UserRoleUncheckedUpdateManyWithoutRoleInput = {
    userId?: StringFieldUpdateOperationsInput | string
    assignedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type RolePermissionUpdateWithoutRoleInput = {
    permission?: PermissionUpdateOneRequiredWithoutRolesNestedInput
  }

  export type RolePermissionUncheckedUpdateWithoutRoleInput = {
    permissionId?: StringFieldUpdateOperationsInput | string
  }

  export type RolePermissionUncheckedUpdateManyWithoutRoleInput = {
    permissionId?: StringFieldUpdateOperationsInput | string
  }

  export type RolePermissionCreateManyPermissionInput = {
    roleId: string
  }

  export type RolePermissionUpdateWithoutPermissionInput = {
    role?: RoleUpdateOneRequiredWithoutPermissionsNestedInput
  }

  export type RolePermissionUncheckedUpdateWithoutPermissionInput = {
    roleId?: StringFieldUpdateOperationsInput | string
  }

  export type RolePermissionUncheckedUpdateManyWithoutPermissionInput = {
    roleId?: StringFieldUpdateOperationsInput | string
  }

  export type CategoryCreateManyParentInput = {
    id?: string
    name: string
    code?: string | null
    description?: string | null
    color?: string | null
    icon?: string | null
    sortOrder?: number
    isActive?: boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ProductCreateManyCategoryInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type CategoryUpdateWithoutParentInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutCategoriesNestedInput
    children?: CategoryUpdateManyWithoutParentNestedInput
    products?: ProductUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUncheckedUpdateWithoutParentInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    children?: CategoryUncheckedUpdateManyWithoutParentNestedInput
    products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput
  }

  export type CategoryUncheckedUpdateManyWithoutParentInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    code?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    color?: NullableStringFieldUpdateOperationsInput | string | null
    icon?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    tags?: NullableJsonNullValueInput | InputJsonValue
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ProductUpdateWithoutCategoryInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutCategoryInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutCategoryInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductCreateManyBrandInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ProductUpdateWithoutBrandInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutBrandInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutBrandInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductCreateManyUnitInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ProductUpdateWithoutUnitInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutUnitInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutUnitInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductCreateManyWarehouseInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type InventoryAdjustmentCreateManyWarehouseInput = {
    id?: string
    reference?: string | null
    branchId?: string | null
    type?: string
    reason?: string | null
    notes?: string | null
    status?: string
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PurchaseCreateManyWarehouseInput = {
    id?: string
    number: string
    supplierId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type PurchaseReturnCreateManyWarehouseInput = {
    id?: string
    number: string
    purchaseId?: string | null
    supplierId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SaleCreateManyWarehouseInput = {
    id?: string
    number: string
    customerId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SalesReturnCreateManyWarehouseInput = {
    id?: string
    number: string
    saleId?: string | null
    customerId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseCreateManyWarehouseInput = {
    id?: string
    reference: string
    categoryId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryTransferCreateManyFromWarehouseInput = {
    id?: string
    reference: string
    toWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryTransferCreateManyToWarehouseInput = {
    id?: string
    reference: string
    fromWarehouseId: string
    branchId?: string | null
    status?: string
    transferDate?: Date | string
    notes?: string | null
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type WarehouseStockCreateManyWarehouseInput = {
    id?: string
    productId: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ProductUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type InventoryAdjustmentUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    branch?: BranchUpdateOneWithoutAdjustmentsNestedInput
    lines?: InventoryAdjustmentLineUpdateManyWithoutAdjustmentNestedInput
  }

  export type InventoryAdjustmentUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutAdjustmentNestedInput
  }

  export type InventoryAdjustmentUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    type?: StringFieldUpdateOperationsInput | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    supplier?: SupplierUpdateOneWithoutPurchasesNestedInput
    branch?: BranchUpdateOneWithoutPurchasesNestedInput
    lines?: PurchaseLineUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: PurchaseLineUncheckedUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUncheckedUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PurchaseReturnUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    purchase?: PurchaseUpdateOneWithoutReturnsNestedInput
    supplier?: SupplierUpdateOneWithoutPurchaseReturnsNestedInput
    branch?: BranchUpdateOneWithoutPurchaseReturnsNestedInput
    lines?: PurchaseReturnLineUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SaleUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SalesReturnUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sale?: SaleUpdateOneWithoutReturnsNestedInput
    customer?: CustomerUpdateOneWithoutSalesReturnsNestedInput
    branch?: BranchUpdateOneWithoutSalesReturnsNestedInput
    lines?: SalesReturnLineUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: SalesReturnLineUncheckedUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    category?: ExpenseCategoryUpdateOneWithoutExpensesNestedInput
    branch?: BranchUpdateOneWithoutExpensesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutExpensesNestedInput
  }

  export type ExpenseUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryTransferUpdateWithoutFromWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    toWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersToNestedInput
    branch?: BranchUpdateOneWithoutTransfersNestedInput
    lines?: InventoryTransferLineUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateWithoutFromWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryTransferLineUncheckedUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateManyWithoutFromWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    toWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryTransferUpdateWithoutToWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    fromWarehouse?: WarehouseUpdateOneRequiredWithoutTransfersFromNestedInput
    branch?: BranchUpdateOneWithoutTransfersNestedInput
    lines?: InventoryTransferLineUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateWithoutToWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: InventoryTransferLineUncheckedUpdateManyWithoutTransferNestedInput
  }

  export type InventoryTransferUncheckedUpdateManyWithoutToWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    fromWarehouseId?: StringFieldUpdateOperationsInput | string
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    transferDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseStockUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    product?: ProductUpdateOneRequiredWithoutWarehouseStocksNestedInput
  }

  export type WarehouseStockUncheckedUpdateWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseStockUncheckedUpdateManyWithoutWarehouseInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseCreateManySupplierInput = {
    id?: string
    number: string
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    purchaseDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type PurchaseReturnCreateManySupplierInput = {
    id?: string
    number: string
    purchaseId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PurchaseUpdateWithoutSupplierInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    warehouse?: WarehouseUpdateOneWithoutPurchasesNestedInput
    branch?: BranchUpdateOneWithoutPurchasesNestedInput
    lines?: PurchaseLineUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateWithoutSupplierInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: PurchaseLineUncheckedUpdateManyWithoutPurchaseNestedInput
    returns?: PurchaseReturnUncheckedUpdateManyWithoutPurchaseNestedInput
  }

  export type PurchaseUncheckedUpdateManyWithoutSupplierInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    purchaseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type PurchaseReturnUpdateWithoutSupplierInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    purchase?: PurchaseUpdateOneWithoutReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchaseReturnsNestedInput
    branch?: BranchUpdateOneWithoutPurchaseReturnsNestedInput
    lines?: PurchaseReturnLineUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateWithoutSupplierInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutSupplierInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    purchaseId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseLineCreateManyPurchaseInput = {
    id?: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnCreateManyPurchaseInput = {
    id?: string
    number: string
    supplierId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type PurchaseLineUpdateWithoutPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutPurchaseLinesNestedInput
  }

  export type PurchaseLineUncheckedUpdateWithoutPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseLineUncheckedUpdateManyWithoutPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnUpdateWithoutPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    supplier?: SupplierUpdateOneWithoutPurchaseReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutPurchaseReturnsNestedInput
    branch?: BranchUpdateOneWithoutPurchaseReturnsNestedInput
    lines?: PurchaseReturnLineUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateWithoutPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnNestedInput
  }

  export type PurchaseReturnUncheckedUpdateManyWithoutPurchaseInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    supplierId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type PurchaseReturnLineCreateManyPurchaseReturnInput = {
    id?: string
    productId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnLineUpdateWithoutPurchaseReturnInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutPurchaseReturnLinesNestedInput
  }

  export type PurchaseReturnLineUncheckedUpdateWithoutPurchaseReturnInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnLineUncheckedUpdateManyWithoutPurchaseReturnInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InvoiceCreateManyCustomerInput = {
    id?: string
    number: string
    saleId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SaleCreateManyCustomerInput = {
    id?: string
    number: string
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SalesReturnCreateManyCustomerInput = {
    id?: string
    number: string
    saleId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InvoiceUpdateWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    sale?: SaleUpdateOneWithoutInvoicesNestedInput
    branch?: BranchUpdateOneWithoutInvoicesNestedInput
    lines?: InvoiceLineUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: InvoiceLineUncheckedUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateManyWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SaleUpdateWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateManyWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SalesReturnUpdateWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    sale?: SaleUpdateOneWithoutReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesReturnsNestedInput
    branch?: BranchUpdateOneWithoutSalesReturnsNestedInput
    lines?: SalesReturnLineUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: SalesReturnLineUncheckedUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateManyWithoutCustomerInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    saleId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SaleCreateManyPaymentMethodInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    saleDate?: Date | string
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    amountPaid?: number | null
    changeGiven?: number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ExpenseCreateManyPaymentMethodInput = {
    id?: string
    reference: string
    categoryId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type SaleUpdateWithoutPaymentMethodInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesNestedInput
    branch?: BranchUpdateOneWithoutSalesNestedInput
    lines?: SaleLineUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateWithoutPaymentMethodInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: SaleLineUncheckedUpdateManyWithoutSaleNestedInput
    returns?: SalesReturnUncheckedUpdateManyWithoutSaleNestedInput
    invoices?: InvoiceUncheckedUpdateManyWithoutSaleNestedInput
  }

  export type SaleUncheckedUpdateManyWithoutPaymentMethodInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    saleDate?: DateTimeFieldUpdateOperationsInput | Date | string
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    amountPaid?: NullableFloatFieldUpdateOperationsInput | number | null
    changeGiven?: NullableFloatFieldUpdateOperationsInput | number | null
    taxBreakdown?: NullableJsonNullValueInput | InputJsonValue
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ExpenseUpdateWithoutPaymentMethodInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    category?: ExpenseCategoryUpdateOneWithoutExpensesNestedInput
    warehouse?: WarehouseUpdateOneWithoutExpensesNestedInput
    branch?: BranchUpdateOneWithoutExpensesNestedInput
  }

  export type ExpenseUncheckedUpdateWithoutPaymentMethodInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUncheckedUpdateManyWithoutPaymentMethodInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type SaleLineCreateManySaleInput = {
    id?: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnCreateManySaleInput = {
    id?: string
    number: string
    customerId?: string | null
    warehouseId?: string | null
    branchId?: string | null
    status?: string
    returnDate?: Date | string
    reason?: string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InvoiceCreateManySaleInput = {
    id?: string
    number: string
    customerId?: string | null
    branchId?: string | null
    status?: string
    issueDate?: Date | string
    dueDate?: Date | string | null
    notes?: string | null
    subtotal?: number
    taxTotal?: number
    total?: number
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type SaleLineUpdateWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutSaleLinesNestedInput
  }

  export type SaleLineUncheckedUpdateWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SaleLineUncheckedUpdateManyWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnUpdateWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    customer?: CustomerUpdateOneWithoutSalesReturnsNestedInput
    warehouse?: WarehouseUpdateOneWithoutSalesReturnsNestedInput
    branch?: BranchUpdateOneWithoutSalesReturnsNestedInput
    lines?: SalesReturnLineUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    lines?: SalesReturnLineUncheckedUpdateManyWithoutSalesReturnNestedInput
  }

  export type SalesReturnUncheckedUpdateManyWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    returnDate?: DateTimeFieldUpdateOperationsInput | Date | string
    reason?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InvoiceUpdateWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    customer?: CustomerUpdateOneWithoutInvoicesNestedInput
    branch?: BranchUpdateOneWithoutInvoicesNestedInput
    lines?: InvoiceLineUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    lines?: InvoiceLineUncheckedUpdateManyWithoutInvoiceNestedInput
  }

  export type InvoiceUncheckedUpdateManyWithoutSaleInput = {
    id?: StringFieldUpdateOperationsInput | string
    number?: StringFieldUpdateOperationsInput | string
    customerId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    issueDate?: DateTimeFieldUpdateOperationsInput | Date | string
    dueDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    subtotal?: FloatFieldUpdateOperationsInput | number
    taxTotal?: FloatFieldUpdateOperationsInput | number
    total?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type SalesReturnLineCreateManySalesReturnInput = {
    id?: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnLineUpdateWithoutSalesReturnInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutSalesReturnLinesNestedInput
  }

  export type SalesReturnLineUncheckedUpdateWithoutSalesReturnInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnLineUncheckedUpdateManyWithoutSalesReturnInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type ProductCreateManySalesTaxInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    costPrice?: number | null
    purchaseTaxId?: string | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ProductCreateManyPurchaseTaxInput = {
    id?: string
    name: string
    sku: string
    barcode?: string | null
    description?: string | null
    isReturnable?: boolean
    branchId?: string | null
    categoryId?: string | null
    unitId?: string | null
    brandId?: string | null
    expiryDate?: Date | string | null
    productType?: string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: number | null
    salesTaxId?: string | null
    costPrice?: number | null
    warehouseId?: string | null
    sortOrder?: number
    isActive?: boolean
    createdAt?: Date | string
    updatedAt?: Date | string
    deletedAt?: Date | string | null
  }

  export type ProductUpdateWithoutSalesTaxInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    purchaseTax?: TaxUpdateOneWithoutProductsPurchaseNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutSalesTaxInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutSalesTaxInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    purchaseTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ProductUpdateWithoutPurchaseTaxInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    branch?: BranchUpdateOneWithoutProductsNestedInput
    category?: CategoryUpdateOneWithoutProductsNestedInput
    unit?: UnitUpdateOneWithoutProductsNestedInput
    brand?: BrandUpdateOneWithoutProductsNestedInput
    salesTax?: TaxUpdateOneWithoutProductsSalesNestedInput
    warehouse?: WarehouseUpdateOneWithoutProductsNestedInput
    adjustmentLines?: InventoryAdjustmentLineUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateWithoutPurchaseTaxInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    adjustmentLines?: InventoryAdjustmentLineUncheckedUpdateManyWithoutProductNestedInput
    invoiceLines?: InvoiceLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseLines?: PurchaseLineUncheckedUpdateManyWithoutProductNestedInput
    purchaseReturnLines?: PurchaseReturnLineUncheckedUpdateManyWithoutProductNestedInput
    saleLines?: SaleLineUncheckedUpdateManyWithoutProductNestedInput
    salesReturnLines?: SalesReturnLineUncheckedUpdateManyWithoutProductNestedInput
    transferLines?: InventoryTransferLineUncheckedUpdateManyWithoutProductNestedInput
    warehouseStocks?: WarehouseStockUncheckedUpdateManyWithoutProductNestedInput
  }

  export type ProductUncheckedUpdateManyWithoutPurchaseTaxInput = {
    id?: StringFieldUpdateOperationsInput | string
    name?: StringFieldUpdateOperationsInput | string
    sku?: StringFieldUpdateOperationsInput | string
    barcode?: NullableStringFieldUpdateOperationsInput | string | null
    description?: NullableStringFieldUpdateOperationsInput | string | null
    isReturnable?: BoolFieldUpdateOperationsInput | boolean
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    categoryId?: NullableStringFieldUpdateOperationsInput | string | null
    unitId?: NullableStringFieldUpdateOperationsInput | string | null
    brandId?: NullableStringFieldUpdateOperationsInput | string | null
    expiryDate?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
    productType?: NullableStringFieldUpdateOperationsInput | string | null
    variationIds?: NullableJsonNullValueInput | InputJsonValue
    quantity?: IntFieldUpdateOperationsInput | number
    images?: NullableJsonNullValueInput | InputJsonValue
    sellingPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    salesTaxId?: NullableStringFieldUpdateOperationsInput | string | null
    costPrice?: NullableFloatFieldUpdateOperationsInput | number | null
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    sortOrder?: IntFieldUpdateOperationsInput | number
    isActive?: BoolFieldUpdateOperationsInput | boolean
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    deletedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null
  }

  export type ExpenseCreateManyCategoryInput = {
    id?: string
    reference: string
    warehouseId?: string | null
    branchId?: string | null
    paymentMethodId?: string | null
    status?: string
    expenseDate?: Date | string
    title?: string | null
    notes?: string | null
    amount?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type ExpenseUpdateWithoutCategoryInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    warehouse?: WarehouseUpdateOneWithoutExpensesNestedInput
    branch?: BranchUpdateOneWithoutExpensesNestedInput
    paymentMethod?: PaymentMethodUpdateOneWithoutExpensesNestedInput
  }

  export type ExpenseUncheckedUpdateWithoutCategoryInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type ExpenseUncheckedUpdateManyWithoutCategoryInput = {
    id?: StringFieldUpdateOperationsInput | string
    reference?: StringFieldUpdateOperationsInput | string
    warehouseId?: NullableStringFieldUpdateOperationsInput | string | null
    branchId?: NullableStringFieldUpdateOperationsInput | string | null
    paymentMethodId?: NullableStringFieldUpdateOperationsInput | string | null
    status?: StringFieldUpdateOperationsInput | string
    expenseDate?: DateTimeFieldUpdateOperationsInput | Date | string
    title?: NullableStringFieldUpdateOperationsInput | string | null
    notes?: NullableStringFieldUpdateOperationsInput | string | null
    amount?: FloatFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryAdjustmentLineCreateManyProductInput = {
    id?: string
    adjustmentId: string
    quantity: number
  }

  export type InvoiceLineCreateManyProductInput = {
    id?: string
    invoiceId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseLineCreateManyProductInput = {
    id?: string
    purchaseId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type PurchaseReturnLineCreateManyProductInput = {
    id?: string
    purchaseReturnId: string
    quantity: number
    unitCost: number
    taxRate?: number
    lineTotal?: number
  }

  export type SaleLineCreateManyProductInput = {
    id?: string
    saleId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type SalesReturnLineCreateManyProductInput = {
    id?: string
    salesReturnId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type InventoryTransferLineCreateManyProductInput = {
    id?: string
    transferId: string
    quantity: number
  }

  export type WarehouseStockCreateManyProductInput = {
    id?: string
    warehouseId: string
    quantity?: number
    createdAt?: Date | string
    updatedAt?: Date | string
  }

  export type InventoryAdjustmentLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    adjustment?: InventoryAdjustmentUpdateOneRequiredWithoutLinesNestedInput
  }

  export type InventoryAdjustmentLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    adjustmentId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryAdjustmentLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    adjustmentId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InvoiceLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    invoice?: InvoiceUpdateOneRequiredWithoutLinesNestedInput
  }

  export type InvoiceLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    invoiceId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InvoiceLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    invoiceId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    purchase?: PurchaseUpdateOneRequiredWithoutLinesNestedInput
  }

  export type PurchaseLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    purchaseReturn?: PurchaseReturnUpdateOneRequiredWithoutLinesNestedInput
  }

  export type PurchaseReturnLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseReturnId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type PurchaseReturnLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    purchaseReturnId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitCost?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SaleLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    sale?: SaleUpdateOneRequiredWithoutLinesNestedInput
  }

  export type SaleLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    saleId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SaleLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    saleId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    salesReturn?: SalesReturnUpdateOneRequiredWithoutLinesNestedInput
  }

  export type SalesReturnLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    salesReturnId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type SalesReturnLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    salesReturnId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InventoryTransferLineUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    transfer?: InventoryTransferUpdateOneRequiredWithoutLinesNestedInput
  }

  export type InventoryTransferLineUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    transferId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryTransferLineUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    transferId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type WarehouseStockUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
    warehouse?: WarehouseUpdateOneRequiredWithoutStocksNestedInput
  }

  export type WarehouseStockUncheckedUpdateWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    warehouseId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type WarehouseStockUncheckedUpdateManyWithoutProductInput = {
    id?: StringFieldUpdateOperationsInput | string
    warehouseId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    createdAt?: DateTimeFieldUpdateOperationsInput | Date | string
    updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string
  }

  export type InventoryTransferLineCreateManyTransferInput = {
    id?: string
    productId: string
    quantity: number
  }

  export type InventoryTransferLineUpdateWithoutTransferInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutTransferLinesNestedInput
  }

  export type InventoryTransferLineUncheckedUpdateWithoutTransferInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryTransferLineUncheckedUpdateManyWithoutTransferInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InvoiceLineCreateManyInvoiceInput = {
    id?: string
    productId: string
    quantity: number
    unitPrice: number
    taxRate?: number
    lineTotal?: number
  }

  export type InvoiceLineUpdateWithoutInvoiceInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutInvoiceLinesNestedInput
  }

  export type InvoiceLineUncheckedUpdateWithoutInvoiceInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InvoiceLineUncheckedUpdateManyWithoutInvoiceInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    unitPrice?: FloatFieldUpdateOperationsInput | number
    taxRate?: FloatFieldUpdateOperationsInput | number
    lineTotal?: FloatFieldUpdateOperationsInput | number
  }

  export type InventoryAdjustmentLineCreateManyAdjustmentInput = {
    id?: string
    productId: string
    quantity: number
  }

  export type InventoryAdjustmentLineUpdateWithoutAdjustmentInput = {
    id?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
    product?: ProductUpdateOneRequiredWithoutAdjustmentLinesNestedInput
  }

  export type InventoryAdjustmentLineUncheckedUpdateWithoutAdjustmentInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }

  export type InventoryAdjustmentLineUncheckedUpdateManyWithoutAdjustmentInput = {
    id?: StringFieldUpdateOperationsInput | string
    productId?: StringFieldUpdateOperationsInput | string
    quantity?: IntFieldUpdateOperationsInput | number
  }



  /**
   * Batch Payload for updateMany & deleteMany & createMany
   */

  export type BatchPayload = {
    count: number
  }

  /**
   * DMMF
   */
  export const dmmf: runtime.BaseDMMF
}