Files
PDV/apps/api/migrations/snapshots/ff53b6361be3ad5038ae10d0ab16846da058fd448833ffb4b45a0105abe03acb/contract.d.ts
T
2026-09-30 14:45:10 -05:00

3091 lines
131 KiB
TypeScript
Generated

// ⚠️ GENERATED FILE - DO NOT EDIT
// This file is automatically generated by 'prisma contract emit'.
// To regenerate, run: prisma contract emit
import type {
Bit,
Char,
CodecTypes as PgTypes,
Interval,
JsonValue,
Numeric,
Time,
TimeString,
Timestamp,
TimestampString,
Timestamptz,
TimestamptzString,
Timetz,
VarBit,
Varchar,
} from '@prisma/orm-postgres/target/codec-types';
import type { QueryOperationTypes as PgTargetQueryOps } from '@prisma/orm-postgres/target/operation-types';
import type {
ContractWithTypeMaps,
RelationKeys,
TypeMaps as TypeMapsType,
} from '@prisma/orm-postgres/family-contract/types';
import type {
Contract as ContractType,
ExecutionHashBase,
NamespaceId,
ProfileHashBase,
StorageHashBase,
} from '@prisma/orm-postgres/contract/types';
export type StorageHash =
StorageHashBase<'ff53b6361be3ad5038ae10d0ab16846da058fd448833ffb4b45a0105abe03acb'>;
export type ExecutionHash =
ExecutionHashBase<'115c9c7864d44afb5bd29a33cd2a6f2ad1ab90de81a8364be2a3d8c969eeb4db'>;
export type ProfileHash =
ProfileHashBase<'3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2'>;
export type CodecTypes = PgTypes;
export type LaneCodecTypes = CodecTypes;
export type QueryOperationTypes = PgTargetQueryOps<CodecTypes>;
export type AggregateTypes = {
readonly avg: {
readonly byCodec: {
readonly 'pg/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/float4@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/int@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/int2@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/int4@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/int8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/int8number@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/time-string@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/time-temporal@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/unboundedint@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'sql/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'sql/int@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
};
};
readonly avgDecimal: {
readonly byCodec: {
readonly 'pg/int@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/int2@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/int4@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/int8@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/int8number@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/unboundedint@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'sql/int@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
};
};
readonly count: {
readonly byCodec: {};
readonly withoutInput: { readonly output: 'pg/int8number@1'; readonly nullable: false };
readonly anyInput: { readonly output: 'pg/int8number@1'; readonly nullable: false };
};
readonly countBigInt: {
readonly byCodec: {};
readonly withoutInput: { readonly output: 'pg/int8@1'; readonly nullable: false };
readonly anyInput: { readonly output: 'pg/int8@1'; readonly nullable: false };
};
readonly max: {
readonly byCodec: {
readonly 'pg/char@1': { readonly output: 'pg/char@1'; readonly nullable: true };
readonly 'pg/date-string@1': { readonly output: 'pg/date-string@1'; readonly nullable: true };
readonly 'pg/date-temporal@1': {
readonly output: 'pg/date-temporal@1';
readonly nullable: true;
};
readonly 'pg/enum@1': { readonly output: 'pg/enum@1'; readonly nullable: true };
readonly 'pg/float@1': { readonly output: 'pg/float@1'; readonly nullable: true };
readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/inet@1': { readonly output: 'pg/inet@1'; readonly nullable: true };
readonly 'pg/int@1': { readonly output: 'pg/int@1'; readonly nullable: true };
readonly 'pg/int2@1': { readonly output: 'pg/int2@1'; readonly nullable: true };
readonly 'pg/int4@1': { readonly output: 'pg/int4@1'; readonly nullable: true };
readonly 'pg/int8@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
readonly 'pg/int8number@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/text-array@1': { readonly output: 'pg/text-array@1'; readonly nullable: true };
readonly 'pg/text@1': { readonly output: 'pg/text@1'; readonly nullable: true };
readonly 'pg/time-string@1': { readonly output: 'pg/time-string@1'; readonly nullable: true };
readonly 'pg/time-temporal@1': {
readonly output: 'pg/time-temporal@1';
readonly nullable: true;
};
readonly 'pg/timestamp-string@1': {
readonly output: 'pg/timestamp-string@1';
readonly nullable: true;
};
readonly 'pg/timestamp-temporal@1': {
readonly output: 'pg/timestamp-temporal@1';
readonly nullable: true;
};
readonly 'pg/timestamptz-date@1': {
readonly output: 'pg/timestamptz-date@1';
readonly nullable: true;
};
readonly 'pg/timestamptz-string@1': {
readonly output: 'pg/timestamptz-string@1';
readonly nullable: true;
};
readonly 'pg/timestamptz-temporal@1': {
readonly output: 'pg/timestamptz-temporal@1';
readonly nullable: true;
};
readonly 'pg/timetz@1': { readonly output: 'pg/timetz@1'; readonly nullable: true };
readonly 'pg/unboundedint@1': {
readonly output: 'pg/unboundedint@1';
readonly nullable: true;
};
readonly 'pg/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
readonly 'sql/char@1': { readonly output: 'sql/char@1'; readonly nullable: true };
readonly 'sql/float@1': { readonly output: 'sql/float@1'; readonly nullable: true };
readonly 'sql/int@1': { readonly output: 'sql/int@1'; readonly nullable: true };
readonly 'sql/text@1': { readonly output: 'sql/text@1'; readonly nullable: true };
readonly 'sql/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
};
};
readonly min: {
readonly byCodec: {
readonly 'pg/char@1': { readonly output: 'pg/char@1'; readonly nullable: true };
readonly 'pg/date-string@1': { readonly output: 'pg/date-string@1'; readonly nullable: true };
readonly 'pg/date-temporal@1': {
readonly output: 'pg/date-temporal@1';
readonly nullable: true;
};
readonly 'pg/enum@1': { readonly output: 'pg/enum@1'; readonly nullable: true };
readonly 'pg/float@1': { readonly output: 'pg/float@1'; readonly nullable: true };
readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/inet@1': { readonly output: 'pg/inet@1'; readonly nullable: true };
readonly 'pg/int@1': { readonly output: 'pg/int@1'; readonly nullable: true };
readonly 'pg/int2@1': { readonly output: 'pg/int2@1'; readonly nullable: true };
readonly 'pg/int4@1': { readonly output: 'pg/int4@1'; readonly nullable: true };
readonly 'pg/int8@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
readonly 'pg/int8number@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/text-array@1': { readonly output: 'pg/text-array@1'; readonly nullable: true };
readonly 'pg/text@1': { readonly output: 'pg/text@1'; readonly nullable: true };
readonly 'pg/time-string@1': { readonly output: 'pg/time-string@1'; readonly nullable: true };
readonly 'pg/time-temporal@1': {
readonly output: 'pg/time-temporal@1';
readonly nullable: true;
};
readonly 'pg/timestamp-string@1': {
readonly output: 'pg/timestamp-string@1';
readonly nullable: true;
};
readonly 'pg/timestamp-temporal@1': {
readonly output: 'pg/timestamp-temporal@1';
readonly nullable: true;
};
readonly 'pg/timestamptz-date@1': {
readonly output: 'pg/timestamptz-date@1';
readonly nullable: true;
};
readonly 'pg/timestamptz-string@1': {
readonly output: 'pg/timestamptz-string@1';
readonly nullable: true;
};
readonly 'pg/timestamptz-temporal@1': {
readonly output: 'pg/timestamptz-temporal@1';
readonly nullable: true;
};
readonly 'pg/timetz@1': { readonly output: 'pg/timetz@1'; readonly nullable: true };
readonly 'pg/unboundedint@1': {
readonly output: 'pg/unboundedint@1';
readonly nullable: true;
};
readonly 'pg/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
readonly 'sql/char@1': { readonly output: 'sql/char@1'; readonly nullable: true };
readonly 'sql/float@1': { readonly output: 'sql/float@1'; readonly nullable: true };
readonly 'sql/int@1': { readonly output: 'sql/int@1'; readonly nullable: true };
readonly 'sql/text@1': { readonly output: 'sql/text@1'; readonly nullable: true };
readonly 'sql/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
};
};
readonly sum: {
readonly byCodec: {
readonly 'pg/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'pg/int@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/int2@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/int4@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/int8@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/int8number@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
readonly 'pg/time-string@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/time-temporal@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
readonly 'pg/unboundedint@1': {
readonly output: 'pg/unboundedint@1';
readonly nullable: true;
};
readonly 'sql/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
readonly 'sql/int@1': { readonly output: 'pg/int8number@1'; readonly nullable: true };
};
};
readonly sumBigInt: {
readonly byCodec: {
readonly 'pg/int@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
readonly 'pg/int2@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
readonly 'pg/int4@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
readonly 'pg/int8@1': { readonly output: 'pg/unboundedint@1'; readonly nullable: true };
readonly 'pg/int8number@1': { readonly output: 'pg/unboundedint@1'; readonly nullable: true };
readonly 'pg/unboundedint@1': {
readonly output: 'pg/unboundedint@1';
readonly nullable: true;
};
readonly 'sql/int@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
};
};
};
type DefaultLiteralValue<CodecId extends string, Encoded> = CodecId extends keyof CodecTypes
? Encoded extends CodecTypes[CodecId]['json']
? Encoded
: CodecTypes[CodecId]['json']
: Encoded;
export type FieldOutputTypes = {
readonly public: {
readonly CartProduct: {
readonly cartId: CodecTypes['pg/int4@1']['output'];
readonly historyId: CodecTypes['pg/int4@1']['output'];
readonly quantity: CodecTypes['pg/int4@1']['output'];
};
readonly CashRegisterSession: {
readonly closedAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly closedById: CodecTypes['pg/int4@1']['output'] | null;
readonly closingCash: CodecTypes['pg/numeric@1']['output'] | null;
readonly expectedCash: CodecTypes['pg/numeric@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly inventoryId: CodecTypes['pg/int4@1']['output'];
readonly openedAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly openedById: CodecTypes['pg/int4@1']['output'];
readonly openingCash: CodecTypes['pg/numeric@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
};
readonly Category: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
};
readonly Customer: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly email: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
readonly phone: CodecTypes['pg/text@1']['output'] | null;
readonly taxId: CodecTypes['pg/text@1']['output'] | null;
};
readonly Inventory: {
readonly address: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
};
readonly InventoryMovement: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly inventoryId: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
readonly quantity: CodecTypes['pg/int4@1']['output'];
readonly reason: CodecTypes['pg/text@1']['output'] | null;
readonly type: CodecTypes['pg/text@1']['output'];
readonly userId: CodecTypes['pg/int4@1']['output'] | null;
};
readonly Payment: {
readonly amount: CodecTypes['pg/numeric@1']['output'];
readonly cartId: CodecTypes['pg/int4@1']['output'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly orderId: CodecTypes['pg/int4@1']['output'] | null;
readonly paid: CodecTypes['pg/bool@1']['output'];
readonly paidAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly paymentMethod: CodecTypes['pg/text@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
readonly terminalId: CodecTypes['pg/int4@1']['output'] | null;
readonly userId: CodecTypes['pg/int4@1']['output'];
};
readonly Product: {
readonly barcode: CodecTypes['pg/text@1']['output'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly description: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly imageUrl: CodecTypes['pg/text@1']['output'] | null;
readonly minStock: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
readonly sku: CodecTypes['pg/text@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
readonly supplierId: CodecTypes['pg/int4@1']['output'] | null;
readonly unit: CodecTypes['pg/text@1']['output'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['output'];
};
readonly ProductCategory: {
readonly categoryId: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
};
readonly ProductHistory: {
readonly costUnit: CodecTypes['pg/numeric@1']['output'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
readonly soldAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly status: CodecTypes['pg/text@1']['output'];
readonly unitPrice: CodecTypes['pg/numeric@1']['output'];
};
readonly ShopCart: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly customerId: CodecTypes['pg/int4@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
readonly totalPrice: CodecTypes['pg/numeric@1']['output'];
readonly userId: CodecTypes['pg/int4@1']['output'] | null;
};
readonly Supplier: {
readonly address: CodecTypes['pg/text@1']['output'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly email: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly lastSupply: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly name: CodecTypes['pg/text@1']['output'];
readonly phone: CodecTypes['pg/text@1']['output'] | null;
readonly taxId: CodecTypes['pg/text@1']['output'] | null;
};
readonly User: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly email: CodecTypes['pg/text@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
readonly password: CodecTypes['pg/text@1']['output'];
readonly role: CodecTypes['pg/text@1']['output'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['output'];
};
readonly Warehouse: {
readonly inventoryId: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
readonly stock: CodecTypes['pg/int4@1']['output'];
};
};
};
export type FieldInputTypes = {
readonly public: {
readonly CartProduct: {
readonly cartId: CodecTypes['pg/int4@1']['input'];
readonly historyId: CodecTypes['pg/int4@1']['input'];
readonly quantity: CodecTypes['pg/int4@1']['input'];
};
readonly CashRegisterSession: {
readonly closedAt: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly closedById: CodecTypes['pg/int4@1']['input'] | null;
readonly closingCash: CodecTypes['pg/numeric@1']['input'] | null;
readonly expectedCash: CodecTypes['pg/numeric@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly inventoryId: CodecTypes['pg/int4@1']['input'];
readonly openedAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly openedById: CodecTypes['pg/int4@1']['input'];
readonly openingCash: CodecTypes['pg/numeric@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
};
readonly Category: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
};
readonly Customer: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
readonly phone: CodecTypes['pg/text@1']['input'] | null;
readonly taxId: CodecTypes['pg/text@1']['input'] | null;
};
readonly Inventory: {
readonly address: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
};
readonly InventoryMovement: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly inventoryId: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
readonly quantity: CodecTypes['pg/int4@1']['input'];
readonly reason: CodecTypes['pg/text@1']['input'] | null;
readonly type: CodecTypes['pg/text@1']['input'];
readonly userId: CodecTypes['pg/int4@1']['input'] | null;
};
readonly Payment: {
readonly amount: CodecTypes['pg/numeric@1']['input'];
readonly cartId: CodecTypes['pg/int4@1']['input'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly orderId: CodecTypes['pg/int4@1']['input'] | null;
readonly paid: CodecTypes['pg/bool@1']['input'];
readonly paidAt: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly paymentMethod: CodecTypes['pg/text@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
readonly terminalId: CodecTypes['pg/int4@1']['input'] | null;
readonly userId: CodecTypes['pg/int4@1']['input'];
};
readonly Product: {
readonly barcode: CodecTypes['pg/text@1']['input'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly description: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly imageUrl: CodecTypes['pg/text@1']['input'] | null;
readonly minStock: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
readonly sku: CodecTypes['pg/text@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
readonly supplierId: CodecTypes['pg/int4@1']['input'] | null;
readonly unit: CodecTypes['pg/text@1']['input'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['input'];
};
readonly ProductCategory: {
readonly categoryId: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
};
readonly ProductHistory: {
readonly costUnit: CodecTypes['pg/numeric@1']['input'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
readonly soldAt: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly status: CodecTypes['pg/text@1']['input'];
readonly unitPrice: CodecTypes['pg/numeric@1']['input'];
};
readonly ShopCart: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly customerId: CodecTypes['pg/int4@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
readonly totalPrice: CodecTypes['pg/numeric@1']['input'];
readonly userId: CodecTypes['pg/int4@1']['input'] | null;
};
readonly Supplier: {
readonly address: CodecTypes['pg/text@1']['input'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly lastSupply: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly name: CodecTypes['pg/text@1']['input'];
readonly phone: CodecTypes['pg/text@1']['input'] | null;
readonly taxId: CodecTypes['pg/text@1']['input'] | null;
};
readonly User: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
readonly password: CodecTypes['pg/text@1']['input'];
readonly role: CodecTypes['pg/text@1']['input'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['input'];
};
readonly Warehouse: {
readonly inventoryId: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
readonly stock: CodecTypes['pg/int4@1']['input'];
};
};
};
export type StorageColumnTypes = {
readonly public: {
readonly cart_products: {
readonly cartId: CodecTypes['pg/int4@1']['output'];
readonly historyId: CodecTypes['pg/int4@1']['output'];
readonly quantity: CodecTypes['pg/int4@1']['output'];
};
readonly cash_register_session: {
readonly closedAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly closedById: CodecTypes['pg/int4@1']['output'] | null;
readonly closingCash: CodecTypes['pg/numeric@1']['output'] | null;
readonly expectedCash: CodecTypes['pg/numeric@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly inventoryId: CodecTypes['pg/int4@1']['output'];
readonly openedAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly openedById: CodecTypes['pg/int4@1']['output'];
readonly openingCash: CodecTypes['pg/numeric@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
};
readonly category: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
};
readonly customer: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly email: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
readonly phone: CodecTypes['pg/text@1']['output'] | null;
readonly taxId: CodecTypes['pg/text@1']['output'] | null;
};
readonly inventory: {
readonly address: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
};
readonly inventory_movement: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly inventoryId: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
readonly quantity: CodecTypes['pg/int4@1']['output'];
readonly reason: CodecTypes['pg/text@1']['output'] | null;
readonly type: CodecTypes['pg/text@1']['output'];
readonly userId: CodecTypes['pg/int4@1']['output'] | null;
};
readonly payment: {
readonly amount: CodecTypes['pg/numeric@1']['output'];
readonly cartId: CodecTypes['pg/int4@1']['output'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly orderId: CodecTypes['pg/int4@1']['output'] | null;
readonly paid: CodecTypes['pg/bool@1']['output'];
readonly paidAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly paymentMethod: CodecTypes['pg/text@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
readonly terminalId: CodecTypes['pg/int4@1']['output'] | null;
readonly userId: CodecTypes['pg/int4@1']['output'];
};
readonly product: {
readonly barcode: CodecTypes['pg/text@1']['output'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly description: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly imageUrl: CodecTypes['pg/text@1']['output'] | null;
readonly minStock: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
readonly sku: CodecTypes['pg/text@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
readonly supplierId: CodecTypes['pg/int4@1']['output'] | null;
readonly unit: CodecTypes['pg/text@1']['output'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['output'];
};
readonly product_category: {
readonly categoryId: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
};
readonly product_history: {
readonly costUnit: CodecTypes['pg/numeric@1']['output'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
readonly soldAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly status: CodecTypes['pg/text@1']['output'];
readonly unitPrice: CodecTypes['pg/numeric@1']['output'];
};
readonly shop_cart: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly customerId: CodecTypes['pg/int4@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly status: CodecTypes['pg/text@1']['output'];
readonly totalPrice: CodecTypes['pg/numeric@1']['output'];
readonly userId: CodecTypes['pg/int4@1']['output'] | null;
};
readonly supplier: {
readonly address: CodecTypes['pg/text@1']['output'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly email: CodecTypes['pg/text@1']['output'] | null;
readonly id: CodecTypes['pg/int4@1']['output'];
readonly lastSupply: CodecTypes['pg/timestamptz-string@1']['output'] | null;
readonly name: CodecTypes['pg/text@1']['output'];
readonly phone: CodecTypes['pg/text@1']['output'] | null;
readonly taxId: CodecTypes['pg/text@1']['output'] | null;
};
readonly user: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
readonly email: CodecTypes['pg/text@1']['output'];
readonly id: CodecTypes['pg/int4@1']['output'];
readonly name: CodecTypes['pg/text@1']['output'];
readonly password: CodecTypes['pg/text@1']['output'];
readonly role: CodecTypes['pg/text@1']['output'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['output'];
};
readonly warehouse: {
readonly inventoryId: CodecTypes['pg/int4@1']['output'];
readonly productId: CodecTypes['pg/int4@1']['output'];
readonly stock: CodecTypes['pg/int4@1']['output'];
};
};
};
export type StorageColumnInputTypes = {
readonly public: {
readonly cart_products: {
readonly cartId: CodecTypes['pg/int4@1']['input'];
readonly historyId: CodecTypes['pg/int4@1']['input'];
readonly quantity: CodecTypes['pg/int4@1']['input'];
};
readonly cash_register_session: {
readonly closedAt: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly closedById: CodecTypes['pg/int4@1']['input'] | null;
readonly closingCash: CodecTypes['pg/numeric@1']['input'] | null;
readonly expectedCash: CodecTypes['pg/numeric@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly inventoryId: CodecTypes['pg/int4@1']['input'];
readonly openedAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly openedById: CodecTypes['pg/int4@1']['input'];
readonly openingCash: CodecTypes['pg/numeric@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
};
readonly category: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
};
readonly customer: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
readonly phone: CodecTypes['pg/text@1']['input'] | null;
readonly taxId: CodecTypes['pg/text@1']['input'] | null;
};
readonly inventory: {
readonly address: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
};
readonly inventory_movement: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly inventoryId: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
readonly quantity: CodecTypes['pg/int4@1']['input'];
readonly reason: CodecTypes['pg/text@1']['input'] | null;
readonly type: CodecTypes['pg/text@1']['input'];
readonly userId: CodecTypes['pg/int4@1']['input'] | null;
};
readonly payment: {
readonly amount: CodecTypes['pg/numeric@1']['input'];
readonly cartId: CodecTypes['pg/int4@1']['input'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly orderId: CodecTypes['pg/int4@1']['input'] | null;
readonly paid: CodecTypes['pg/bool@1']['input'];
readonly paidAt: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly paymentMethod: CodecTypes['pg/text@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
readonly terminalId: CodecTypes['pg/int4@1']['input'] | null;
readonly userId: CodecTypes['pg/int4@1']['input'];
};
readonly product: {
readonly barcode: CodecTypes['pg/text@1']['input'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly description: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly imageUrl: CodecTypes['pg/text@1']['input'] | null;
readonly minStock: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
readonly sku: CodecTypes['pg/text@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
readonly supplierId: CodecTypes['pg/int4@1']['input'] | null;
readonly unit: CodecTypes['pg/text@1']['input'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['input'];
};
readonly product_category: {
readonly categoryId: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
};
readonly product_history: {
readonly costUnit: CodecTypes['pg/numeric@1']['input'];
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
readonly soldAt: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly status: CodecTypes['pg/text@1']['input'];
readonly unitPrice: CodecTypes['pg/numeric@1']['input'];
};
readonly shop_cart: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly customerId: CodecTypes['pg/int4@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly status: CodecTypes['pg/text@1']['input'];
readonly totalPrice: CodecTypes['pg/numeric@1']['input'];
readonly userId: CodecTypes['pg/int4@1']['input'] | null;
};
readonly supplier: {
readonly address: CodecTypes['pg/text@1']['input'] | null;
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'] | null;
readonly id: CodecTypes['pg/int4@1']['input'];
readonly lastSupply: CodecTypes['pg/timestamptz-string@1']['input'] | null;
readonly name: CodecTypes['pg/text@1']['input'];
readonly phone: CodecTypes['pg/text@1']['input'] | null;
readonly taxId: CodecTypes['pg/text@1']['input'] | null;
};
readonly user: {
readonly createdAt: CodecTypes['pg/timestamptz-string@1']['input'];
readonly email: CodecTypes['pg/text@1']['input'];
readonly id: CodecTypes['pg/int4@1']['input'];
readonly name: CodecTypes['pg/text@1']['input'];
readonly password: CodecTypes['pg/text@1']['input'];
readonly role: CodecTypes['pg/text@1']['input'];
readonly updatedAt: CodecTypes['pg/timestamptz-string@1']['input'];
};
readonly warehouse: {
readonly inventoryId: CodecTypes['pg/int4@1']['input'];
readonly productId: CodecTypes['pg/int4@1']['input'];
readonly stock: CodecTypes['pg/int4@1']['input'];
};
};
};
export namespace Models {
export type public_CartProduct = {
cartId: CodecTypes['pg/int4@1']['output'];
historyId: CodecTypes['pg/int4@1']['output'];
quantity: CodecTypes['pg/int4@1']['output'];
cart: public_ShopCart;
history: public_ProductHistory;
readonly [RelationKeys]?: 'cart' | 'history';
};
export type public_CashRegisterSession = {
closedAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
closedById: CodecTypes['pg/int4@1']['output'] | null;
closingCash: CodecTypes['pg/numeric@1']['output'] | null;
expectedCash: CodecTypes['pg/numeric@1']['output'] | null;
id: CodecTypes['pg/int4@1']['output'];
inventoryId: CodecTypes['pg/int4@1']['output'];
openedAt: CodecTypes['pg/timestamptz-string@1']['output'];
openedById: CodecTypes['pg/int4@1']['output'];
openingCash: CodecTypes['pg/numeric@1']['output'];
status: CodecTypes['pg/text@1']['output'];
closedBy: public_User | null;
inventory: public_Inventory;
openedBy: public_User;
readonly [RelationKeys]?: 'closedBy' | 'inventory' | 'openedBy';
};
export type public_Category = {
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
id: CodecTypes['pg/int4@1']['output'];
name: CodecTypes['pg/text@1']['output'];
products: public_ProductCategory[];
readonly [RelationKeys]?: 'products';
};
export type public_Customer = {
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
email: CodecTypes['pg/text@1']['output'] | null;
id: CodecTypes['pg/int4@1']['output'];
name: CodecTypes['pg/text@1']['output'];
phone: CodecTypes['pg/text@1']['output'] | null;
taxId: CodecTypes['pg/text@1']['output'] | null;
carts: public_ShopCart[];
readonly [RelationKeys]?: 'carts';
};
export type public_Inventory = {
address: CodecTypes['pg/text@1']['output'] | null;
id: CodecTypes['pg/int4@1']['output'];
name: CodecTypes['pg/text@1']['output'];
movements: public_InventoryMovement[];
sessions: public_CashRegisterSession[];
warehouses: public_Warehouse[];
readonly [RelationKeys]?: 'movements' | 'sessions' | 'warehouses';
};
export type public_InventoryMovement = {
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
id: CodecTypes['pg/int4@1']['output'];
inventoryId: CodecTypes['pg/int4@1']['output'];
productId: CodecTypes['pg/int4@1']['output'];
quantity: CodecTypes['pg/int4@1']['output'];
reason: CodecTypes['pg/text@1']['output'] | null;
type: CodecTypes['pg/text@1']['output'];
userId: CodecTypes['pg/int4@1']['output'] | null;
inventory: public_Inventory;
product: public_Product;
user: public_User | null;
readonly [RelationKeys]?: 'inventory' | 'product' | 'user';
};
export type public_Payment = {
amount: CodecTypes['pg/numeric@1']['output'];
cartId: CodecTypes['pg/int4@1']['output'];
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
id: CodecTypes['pg/int4@1']['output'];
orderId: CodecTypes['pg/int4@1']['output'] | null;
paid: CodecTypes['pg/bool@1']['output'];
paidAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
paymentMethod: CodecTypes['pg/text@1']['output'];
status: CodecTypes['pg/text@1']['output'];
terminalId: CodecTypes['pg/int4@1']['output'] | null;
userId: CodecTypes['pg/int4@1']['output'];
cart: public_ShopCart;
user: public_User;
readonly [RelationKeys]?: 'cart' | 'user';
};
export type public_Product = {
barcode: CodecTypes['pg/text@1']['output'] | null;
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
description: CodecTypes['pg/text@1']['output'] | null;
id: CodecTypes['pg/int4@1']['output'];
imageUrl: CodecTypes['pg/text@1']['output'] | null;
minStock: CodecTypes['pg/int4@1']['output'];
name: CodecTypes['pg/text@1']['output'];
sku: CodecTypes['pg/text@1']['output'];
status: CodecTypes['pg/text@1']['output'];
supplierId: CodecTypes['pg/int4@1']['output'] | null;
unit: CodecTypes['pg/text@1']['output'];
updatedAt: CodecTypes['pg/timestamptz-string@1']['output'];
categories: public_ProductCategory[];
history: public_ProductHistory[];
movements: public_InventoryMovement[];
supplier: public_Supplier | null;
warehouses: public_Warehouse[];
readonly [RelationKeys]?: 'categories' | 'history' | 'movements' | 'supplier' | 'warehouses';
};
export type public_ProductCategory = {
categoryId: CodecTypes['pg/int4@1']['output'];
productId: CodecTypes['pg/int4@1']['output'];
category: public_Category;
product: public_Product;
readonly [RelationKeys]?: 'category' | 'product';
};
export type public_ProductHistory = {
costUnit: CodecTypes['pg/numeric@1']['output'];
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
id: CodecTypes['pg/int4@1']['output'];
productId: CodecTypes['pg/int4@1']['output'];
soldAt: CodecTypes['pg/timestamptz-string@1']['output'] | null;
status: CodecTypes['pg/text@1']['output'];
unitPrice: CodecTypes['pg/numeric@1']['output'];
cartProducts: public_CartProduct[];
product: public_Product;
readonly [RelationKeys]?: 'cartProducts' | 'product';
};
export type public_ShopCart = {
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
customerId: CodecTypes['pg/int4@1']['output'] | null;
id: CodecTypes['pg/int4@1']['output'];
status: CodecTypes['pg/text@1']['output'];
totalPrice: CodecTypes['pg/numeric@1']['output'];
userId: CodecTypes['pg/int4@1']['output'] | null;
customer: public_Customer | null;
items: public_CartProduct[];
payments: public_Payment[];
user: public_User | null;
readonly [RelationKeys]?: 'customer' | 'items' | 'payments' | 'user';
};
export type public_Supplier = {
address: CodecTypes['pg/text@1']['output'] | null;
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
email: CodecTypes['pg/text@1']['output'] | null;
id: CodecTypes['pg/int4@1']['output'];
lastSupply: CodecTypes['pg/timestamptz-string@1']['output'] | null;
name: CodecTypes['pg/text@1']['output'];
phone: CodecTypes['pg/text@1']['output'] | null;
taxId: CodecTypes['pg/text@1']['output'] | null;
products: public_Product[];
readonly [RelationKeys]?: 'products';
};
export type public_User = {
createdAt: CodecTypes['pg/timestamptz-string@1']['output'];
email: CodecTypes['pg/text@1']['output'];
id: CodecTypes['pg/int4@1']['output'];
name: CodecTypes['pg/text@1']['output'];
password: CodecTypes['pg/text@1']['output'];
role: CodecTypes['pg/text@1']['output'];
updatedAt: CodecTypes['pg/timestamptz-string@1']['output'];
carts: public_ShopCart[];
closedSessions: public_CashRegisterSession[];
inventoryMovements: public_InventoryMovement[];
openedSessions: public_CashRegisterSession[];
payments: public_Payment[];
readonly [RelationKeys]?:
'carts' | 'closedSessions' | 'inventoryMovements' | 'openedSessions' | 'payments';
};
export type public_Warehouse = {
inventoryId: CodecTypes['pg/int4@1']['output'];
productId: CodecTypes['pg/int4@1']['output'];
stock: CodecTypes['pg/int4@1']['output'];
inventory: public_Inventory;
product: public_Product;
readonly [RelationKeys]?: 'inventory' | 'product';
};
}
export declare const models: {
public: {
CartProduct: Models.public_CartProduct;
CashRegisterSession: Models.public_CashRegisterSession;
Category: Models.public_Category;
Customer: Models.public_Customer;
Inventory: Models.public_Inventory;
InventoryMovement: Models.public_InventoryMovement;
Payment: Models.public_Payment;
Product: Models.public_Product;
ProductCategory: Models.public_ProductCategory;
ProductHistory: Models.public_ProductHistory;
ShopCart: Models.public_ShopCart;
Supplier: Models.public_Supplier;
User: Models.public_User;
Warehouse: Models.public_Warehouse;
};
};
export type TypeMaps = TypeMapsType<
CodecTypes,
QueryOperationTypes,
FieldOutputTypes,
FieldInputTypes,
StorageColumnTypes,
StorageColumnInputTypes,
AggregateTypes
>;
type ContractBase = Omit<
ContractType<{
readonly namespaces: {
readonly public: {
readonly id: 'public';
readonly kind: 'postgres-schema';
readonly entries: {
readonly table: {
readonly cart_products: {
columns: {
readonly cartId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly historyId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly quantity: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['cartId', 'historyId'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'cart_products_cartId_idx_79939295';
readonly prefix: 'cart_products_cartId_idx';
readonly columns: readonly ['cartId'];
readonly unique: false;
},
{
readonly name: 'cart_products_historyId_idx_dfaba3ef';
readonly prefix: 'cart_products_historyId_idx';
readonly columns: readonly ['historyId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'cart_products';
readonly columns: readonly ['cartId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'shop_cart';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'cart_products';
readonly columns: readonly ['historyId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product_history';
readonly columns: readonly ['id'];
};
},
];
};
readonly cash_register_session: {
columns: {
readonly closedAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: true;
};
readonly closedById: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
readonly closingCash: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: true;
};
readonly expectedCash: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: true;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly inventoryId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly openedAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly openedById: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly openingCash: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: false;
};
readonly status: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/text@1', 'open'>;
};
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'cash_register_session_closedById_idx_3fbe6e44';
readonly prefix: 'cash_register_session_closedById_idx';
readonly columns: readonly ['closedById'];
readonly unique: false;
},
{
readonly name: 'cash_register_session_inventoryId_idx_367f33d0';
readonly prefix: 'cash_register_session_inventoryId_idx';
readonly columns: readonly ['inventoryId'];
readonly unique: false;
},
{
readonly name: 'cash_register_session_openedById_idx_40bfe2c9';
readonly prefix: 'cash_register_session_openedById_idx';
readonly columns: readonly ['openedById'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'cash_register_session';
readonly columns: readonly ['inventoryId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'inventory';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'cash_register_session';
readonly columns: readonly ['openedById'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'user';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'cash_register_session';
readonly columns: readonly ['closedById'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'user';
readonly columns: readonly ['id'];
};
},
];
};
readonly category: {
columns: {
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly name: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [];
foreignKeys: readonly [];
};
readonly customer: {
columns: {
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly email: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly name: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly phone: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly taxId: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [];
foreignKeys: readonly [];
};
readonly inventory: {
columns: {
readonly address: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly name: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [];
foreignKeys: readonly [];
};
readonly inventory_movement: {
columns: {
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly inventoryId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly productId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly quantity: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly reason: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly type: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly userId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'inventory_movement_inventoryId_idx_367f33d0';
readonly prefix: 'inventory_movement_inventoryId_idx';
readonly columns: readonly ['inventoryId'];
readonly unique: false;
},
{
readonly name: 'inventory_movement_productId_idx_5858600a';
readonly prefix: 'inventory_movement_productId_idx';
readonly columns: readonly ['productId'];
readonly unique: false;
},
{
readonly name: 'inventory_movement_userId_idx_a489d58a';
readonly prefix: 'inventory_movement_userId_idx';
readonly columns: readonly ['userId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'inventory_movement';
readonly columns: readonly ['userId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'user';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'inventory_movement';
readonly columns: readonly ['productId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'inventory_movement';
readonly columns: readonly ['inventoryId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'inventory';
readonly columns: readonly ['id'];
};
},
];
};
readonly payment: {
columns: {
readonly amount: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: false;
};
readonly cartId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly orderId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
readonly paid: {
readonly nativeType: 'bool';
readonly codecId: 'pg/bool@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/bool@1', false>;
};
};
readonly paidAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: true;
};
readonly paymentMethod: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly status: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly terminalId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
readonly userId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'payment_cartId_idx_79939295';
readonly prefix: 'payment_cartId_idx';
readonly columns: readonly ['cartId'];
readonly unique: false;
},
{
readonly name: 'payment_userId_idx_a489d58a';
readonly prefix: 'payment_userId_idx';
readonly columns: readonly ['userId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'payment';
readonly columns: readonly ['cartId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'shop_cart';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'payment';
readonly columns: readonly ['userId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'user';
readonly columns: readonly ['id'];
};
},
];
};
readonly product: {
columns: {
readonly barcode: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly description: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly imageUrl: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly minStock: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/int4@1', 0>;
};
};
readonly name: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly sku: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly status: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/text@1', 'active'>;
};
};
readonly supplierId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
readonly unit: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/text@1', 'pza'>;
};
};
readonly updatedAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [
{ readonly columns: readonly ['sku'] },
{ readonly columns: readonly ['barcode'] },
];
indexes: readonly [
{
readonly name: 'product_supplierId_idx_c4d9a8b9';
readonly prefix: 'product_supplierId_idx';
readonly columns: readonly ['supplierId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product';
readonly columns: readonly ['supplierId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'supplier';
readonly columns: readonly ['id'];
};
},
];
};
readonly product_category: {
columns: {
readonly categoryId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly productId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['productId', 'categoryId'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'product_category_categoryId_idx_15c304f2';
readonly prefix: 'product_category_categoryId_idx';
readonly columns: readonly ['categoryId'];
readonly unique: false;
},
{
readonly name: 'product_category_productId_idx_5858600a';
readonly prefix: 'product_category_productId_idx';
readonly columns: readonly ['productId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product_category';
readonly columns: readonly ['productId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product_category';
readonly columns: readonly ['categoryId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'category';
readonly columns: readonly ['id'];
};
},
];
};
readonly product_history: {
columns: {
readonly costUnit: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: false;
};
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly productId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly soldAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: true;
};
readonly status: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly unitPrice: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'product_history_productId_idx_5858600a';
readonly prefix: 'product_history_productId_idx';
readonly columns: readonly ['productId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product_history';
readonly columns: readonly ['productId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product';
readonly columns: readonly ['id'];
};
},
];
};
readonly shop_cart: {
columns: {
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly customerId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly status: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/text@1', 'open'>;
};
};
readonly totalPrice: {
readonly nativeType: 'numeric';
readonly codecId: 'pg/numeric@1';
readonly nullable: false;
};
readonly userId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: true;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'shop_cart_customerId_idx_b2a8a46c';
readonly prefix: 'shop_cart_customerId_idx';
readonly columns: readonly ['customerId'];
readonly unique: false;
},
{
readonly name: 'shop_cart_userId_idx_a489d58a';
readonly prefix: 'shop_cart_userId_idx';
readonly columns: readonly ['userId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'shop_cart';
readonly columns: readonly ['userId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'user';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'shop_cart';
readonly columns: readonly ['customerId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'customer';
readonly columns: readonly ['id'];
};
},
];
};
readonly supplier: {
columns: {
readonly address: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly email: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly lastSupply: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: true;
};
readonly name: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly phone: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
readonly taxId: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: true;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [];
indexes: readonly [];
foreignKeys: readonly [];
};
readonly user: {
columns: {
readonly createdAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
readonly default: { readonly kind: 'function'; readonly expression: 'now()' };
};
readonly email: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly id: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'function';
readonly expression: 'autoincrement()';
};
};
readonly name: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly password: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly role: {
readonly nativeType: 'text';
readonly codecId: 'pg/text@1';
readonly nullable: false;
};
readonly updatedAt: {
readonly nativeType: 'timestamptz';
readonly codecId: 'pg/timestamptz-string@1';
readonly nullable: false;
};
};
primaryKey: { readonly columns: readonly ['id'] };
uniques: readonly [{ readonly columns: readonly ['email'] }];
indexes: readonly [];
foreignKeys: readonly [];
};
readonly warehouse: {
columns: {
readonly inventoryId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly productId: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
};
readonly stock: {
readonly nativeType: 'int4';
readonly codecId: 'pg/int4@1';
readonly nullable: false;
readonly default: {
readonly kind: 'literal';
readonly value: DefaultLiteralValue<'pg/int4@1', 0>;
};
};
};
primaryKey: { readonly columns: readonly ['inventoryId', 'productId'] };
uniques: readonly [];
indexes: readonly [
{
readonly name: 'warehouse_inventoryId_idx_367f33d0';
readonly prefix: 'warehouse_inventoryId_idx';
readonly columns: readonly ['inventoryId'];
readonly unique: false;
},
{
readonly name: 'warehouse_productId_idx_5858600a';
readonly prefix: 'warehouse_productId_idx';
readonly columns: readonly ['productId'];
readonly unique: false;
},
];
foreignKeys: readonly [
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'warehouse';
readonly columns: readonly ['inventoryId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'inventory';
readonly columns: readonly ['id'];
};
},
{
readonly source: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'warehouse';
readonly columns: readonly ['productId'];
};
readonly target: {
readonly namespaceId: 'public' & NamespaceId;
readonly tableName: 'product';
readonly columns: readonly ['id'];
};
},
];
};
};
};
};
};
readonly storageHash: StorageHash;
}>,
'roots' | 'domain'
> & {
readonly target: 'postgres';
readonly targetFamily: 'sql';
readonly roots: {
readonly cart_products: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CartProduct';
};
readonly cash_register_session: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CashRegisterSession';
};
readonly category: { readonly namespace: 'public' & NamespaceId; readonly model: 'Category' };
readonly customer: { readonly namespace: 'public' & NamespaceId; readonly model: 'Customer' };
readonly inventory: { readonly namespace: 'public' & NamespaceId; readonly model: 'Inventory' };
readonly inventory_movement: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'InventoryMovement';
};
readonly payment: { readonly namespace: 'public' & NamespaceId; readonly model: 'Payment' };
readonly product: { readonly namespace: 'public' & NamespaceId; readonly model: 'Product' };
readonly product_category: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ProductCategory';
};
readonly product_history: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ProductHistory';
};
readonly shop_cart: { readonly namespace: 'public' & NamespaceId; readonly model: 'ShopCart' };
readonly supplier: { readonly namespace: 'public' & NamespaceId; readonly model: 'Supplier' };
readonly user: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
readonly warehouse: { readonly namespace: 'public' & NamespaceId; readonly model: 'Warehouse' };
};
readonly domain: {
readonly namespaces: {
readonly public: {
readonly models: {
readonly CartProduct: {
readonly fields: {
readonly cartId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly historyId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly quantity: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
};
readonly relations: {
readonly cart: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ShopCart';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['cartId'];
readonly targetFields: readonly ['id'];
};
};
readonly history: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ProductHistory';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['historyId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'cart_products';
readonly namespaceId: 'public';
readonly fields: {
readonly cartId: { readonly column: 'cartId' };
readonly historyId: { readonly column: 'historyId' };
readonly quantity: { readonly column: 'quantity' };
};
};
};
readonly CashRegisterSession: {
readonly fields: {
readonly closedAt: {
readonly nullable: true;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly closedById: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly closingCash: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
readonly expectedCash: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly inventoryId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly openedAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly openedById: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly openingCash: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
readonly status: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
};
readonly relations: {
readonly closedBy: {
readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
readonly cardinality: 'N:1';
readonly nullable: true;
readonly on: {
readonly localFields: readonly ['closedById'];
readonly targetFields: readonly ['id'];
};
};
readonly inventory: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Inventory';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['inventoryId'];
readonly targetFields: readonly ['id'];
};
};
readonly openedBy: {
readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['openedById'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'cash_register_session';
readonly namespaceId: 'public';
readonly fields: {
readonly closedAt: { readonly column: 'closedAt' };
readonly closedById: { readonly column: 'closedById' };
readonly closingCash: { readonly column: 'closingCash' };
readonly expectedCash: { readonly column: 'expectedCash' };
readonly id: { readonly column: 'id' };
readonly inventoryId: { readonly column: 'inventoryId' };
readonly openedAt: { readonly column: 'openedAt' };
readonly openedById: { readonly column: 'openedById' };
readonly openingCash: { readonly column: 'openingCash' };
readonly status: { readonly column: 'status' };
};
};
};
readonly Category: {
readonly fields: {
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly name: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
};
readonly relations: {
readonly products: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ProductCategory';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['categoryId'];
};
};
};
readonly storage: {
readonly table: 'category';
readonly namespaceId: 'public';
readonly fields: {
readonly createdAt: { readonly column: 'createdAt' };
readonly id: { readonly column: 'id' };
readonly name: { readonly column: 'name' };
};
};
};
readonly Customer: {
readonly fields: {
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly email: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly name: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly phone: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly taxId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
};
readonly relations: {
readonly carts: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ShopCart';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['customerId'];
};
};
};
readonly storage: {
readonly table: 'customer';
readonly namespaceId: 'public';
readonly fields: {
readonly createdAt: { readonly column: 'createdAt' };
readonly email: { readonly column: 'email' };
readonly id: { readonly column: 'id' };
readonly name: { readonly column: 'name' };
readonly phone: { readonly column: 'phone' };
readonly taxId: { readonly column: 'taxId' };
};
};
};
readonly Inventory: {
readonly fields: {
readonly address: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly name: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
};
readonly relations: {
readonly movements: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'InventoryMovement';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['inventoryId'];
};
};
readonly sessions: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CashRegisterSession';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['inventoryId'];
};
};
readonly warehouses: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Warehouse';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['inventoryId'];
};
};
};
readonly storage: {
readonly table: 'inventory';
readonly namespaceId: 'public';
readonly fields: {
readonly address: { readonly column: 'address' };
readonly id: { readonly column: 'id' };
readonly name: { readonly column: 'name' };
};
};
};
readonly InventoryMovement: {
readonly fields: {
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly inventoryId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly productId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly quantity: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly reason: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly type: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly userId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
};
readonly relations: {
readonly inventory: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Inventory';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['inventoryId'];
readonly targetFields: readonly ['id'];
};
};
readonly product: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Product';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['productId'];
readonly targetFields: readonly ['id'];
};
};
readonly user: {
readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
readonly cardinality: 'N:1';
readonly nullable: true;
readonly on: {
readonly localFields: readonly ['userId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'inventory_movement';
readonly namespaceId: 'public';
readonly fields: {
readonly createdAt: { readonly column: 'createdAt' };
readonly id: { readonly column: 'id' };
readonly inventoryId: { readonly column: 'inventoryId' };
readonly productId: { readonly column: 'productId' };
readonly quantity: { readonly column: 'quantity' };
readonly reason: { readonly column: 'reason' };
readonly type: { readonly column: 'type' };
readonly userId: { readonly column: 'userId' };
};
};
};
readonly Payment: {
readonly fields: {
readonly amount: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
readonly cartId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly orderId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly paid: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/bool@1' };
};
readonly paidAt: {
readonly nullable: true;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly paymentMethod: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly status: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly terminalId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly userId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
};
readonly relations: {
readonly cart: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ShopCart';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['cartId'];
readonly targetFields: readonly ['id'];
};
};
readonly user: {
readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['userId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'payment';
readonly namespaceId: 'public';
readonly fields: {
readonly amount: { readonly column: 'amount' };
readonly cartId: { readonly column: 'cartId' };
readonly createdAt: { readonly column: 'createdAt' };
readonly id: { readonly column: 'id' };
readonly orderId: { readonly column: 'orderId' };
readonly paid: { readonly column: 'paid' };
readonly paidAt: { readonly column: 'paidAt' };
readonly paymentMethod: { readonly column: 'paymentMethod' };
readonly status: { readonly column: 'status' };
readonly terminalId: { readonly column: 'terminalId' };
readonly userId: { readonly column: 'userId' };
};
};
};
readonly Product: {
readonly fields: {
readonly barcode: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly description: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly imageUrl: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly minStock: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly name: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly sku: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly status: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly supplierId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly unit: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly updatedAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
};
readonly relations: {
readonly categories: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ProductCategory';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['productId'];
};
};
readonly history: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ProductHistory';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['productId'];
};
};
readonly movements: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'InventoryMovement';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['productId'];
};
};
readonly supplier: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Supplier';
};
readonly cardinality: 'N:1';
readonly nullable: true;
readonly on: {
readonly localFields: readonly ['supplierId'];
readonly targetFields: readonly ['id'];
};
};
readonly warehouses: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Warehouse';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['productId'];
};
};
};
readonly storage: {
readonly table: 'product';
readonly namespaceId: 'public';
readonly fields: {
readonly barcode: { readonly column: 'barcode' };
readonly createdAt: { readonly column: 'createdAt' };
readonly description: { readonly column: 'description' };
readonly id: { readonly column: 'id' };
readonly imageUrl: { readonly column: 'imageUrl' };
readonly minStock: { readonly column: 'minStock' };
readonly name: { readonly column: 'name' };
readonly sku: { readonly column: 'sku' };
readonly status: { readonly column: 'status' };
readonly supplierId: { readonly column: 'supplierId' };
readonly unit: { readonly column: 'unit' };
readonly updatedAt: { readonly column: 'updatedAt' };
};
};
};
readonly ProductCategory: {
readonly fields: {
readonly categoryId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly productId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
};
readonly relations: {
readonly category: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Category';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['categoryId'];
readonly targetFields: readonly ['id'];
};
};
readonly product: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Product';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['productId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'product_category';
readonly namespaceId: 'public';
readonly fields: {
readonly categoryId: { readonly column: 'categoryId' };
readonly productId: { readonly column: 'productId' };
};
};
};
readonly ProductHistory: {
readonly fields: {
readonly costUnit: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly productId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly soldAt: {
readonly nullable: true;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly status: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly unitPrice: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
};
readonly relations: {
readonly cartProducts: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CartProduct';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['historyId'];
};
};
readonly product: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Product';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['productId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'product_history';
readonly namespaceId: 'public';
readonly fields: {
readonly costUnit: { readonly column: 'costUnit' };
readonly createdAt: { readonly column: 'createdAt' };
readonly id: { readonly column: 'id' };
readonly productId: { readonly column: 'productId' };
readonly soldAt: { readonly column: 'soldAt' };
readonly status: { readonly column: 'status' };
readonly unitPrice: { readonly column: 'unitPrice' };
};
};
};
readonly ShopCart: {
readonly fields: {
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly customerId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly status: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly totalPrice: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/numeric@1' };
};
readonly userId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
};
readonly relations: {
readonly customer: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Customer';
};
readonly cardinality: 'N:1';
readonly nullable: true;
readonly on: {
readonly localFields: readonly ['customerId'];
readonly targetFields: readonly ['id'];
};
};
readonly items: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CartProduct';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['cartId'];
};
};
readonly payments: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Payment';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['cartId'];
};
};
readonly user: {
readonly to: { readonly namespace: 'public' & NamespaceId; readonly model: 'User' };
readonly cardinality: 'N:1';
readonly nullable: true;
readonly on: {
readonly localFields: readonly ['userId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'shop_cart';
readonly namespaceId: 'public';
readonly fields: {
readonly createdAt: { readonly column: 'createdAt' };
readonly customerId: { readonly column: 'customerId' };
readonly id: { readonly column: 'id' };
readonly status: { readonly column: 'status' };
readonly totalPrice: { readonly column: 'totalPrice' };
readonly userId: { readonly column: 'userId' };
};
};
};
readonly Supplier: {
readonly fields: {
readonly address: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly email: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly lastSupply: {
readonly nullable: true;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly name: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly phone: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly taxId: {
readonly nullable: true;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
};
readonly relations: {
readonly products: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Product';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['supplierId'];
};
};
};
readonly storage: {
readonly table: 'supplier';
readonly namespaceId: 'public';
readonly fields: {
readonly address: { readonly column: 'address' };
readonly createdAt: { readonly column: 'createdAt' };
readonly email: { readonly column: 'email' };
readonly id: { readonly column: 'id' };
readonly lastSupply: { readonly column: 'lastSupply' };
readonly name: { readonly column: 'name' };
readonly phone: { readonly column: 'phone' };
readonly taxId: { readonly column: 'taxId' };
};
};
};
readonly User: {
readonly fields: {
readonly createdAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
readonly email: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly id: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly name: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly password: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly role: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/text@1' };
};
readonly updatedAt: {
readonly nullable: false;
readonly type: {
readonly kind: 'scalar';
readonly codecId: 'pg/timestamptz-string@1';
};
};
};
readonly relations: {
readonly carts: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'ShopCart';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['userId'];
};
};
readonly closedSessions: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CashRegisterSession';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['closedById'];
};
};
readonly inventoryMovements: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'InventoryMovement';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['userId'];
};
};
readonly openedSessions: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'CashRegisterSession';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['openedById'];
};
};
readonly payments: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Payment';
};
readonly cardinality: '1:N';
readonly on: {
readonly localFields: readonly ['id'];
readonly targetFields: readonly ['userId'];
};
};
};
readonly storage: {
readonly table: 'user';
readonly namespaceId: 'public';
readonly fields: {
readonly createdAt: { readonly column: 'createdAt' };
readonly email: { readonly column: 'email' };
readonly id: { readonly column: 'id' };
readonly name: { readonly column: 'name' };
readonly password: { readonly column: 'password' };
readonly role: { readonly column: 'role' };
readonly updatedAt: { readonly column: 'updatedAt' };
};
};
};
readonly Warehouse: {
readonly fields: {
readonly inventoryId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly productId: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
readonly stock: {
readonly nullable: false;
readonly type: { readonly kind: 'scalar'; readonly codecId: 'pg/int4@1' };
};
};
readonly relations: {
readonly inventory: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Inventory';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['inventoryId'];
readonly targetFields: readonly ['id'];
};
};
readonly product: {
readonly to: {
readonly namespace: 'public' & NamespaceId;
readonly model: 'Product';
};
readonly cardinality: 'N:1';
readonly nullable: false;
readonly on: {
readonly localFields: readonly ['productId'];
readonly targetFields: readonly ['id'];
};
};
};
readonly storage: {
readonly table: 'warehouse';
readonly namespaceId: 'public';
readonly fields: {
readonly inventoryId: { readonly column: 'inventoryId' };
readonly productId: { readonly column: 'productId' };
readonly stock: { readonly column: 'stock' };
};
};
};
};
};
};
};
readonly capabilities: {
readonly postgres: {
readonly distinctOn: true;
readonly jsonAgg: true;
readonly lateral: true;
readonly limit: true;
readonly orderBy: true;
readonly returning: true;
};
readonly sql: {
readonly checkConstraint: true;
readonly defaultInInsert: true;
readonly enums: true;
readonly insertOnConflictSkip: true;
readonly insertOnConflictWithoutTarget: true;
readonly lateral: true;
readonly returning: true;
readonly scalarList: true;
};
};
readonly extensions: {};
readonly execution: {
readonly executionHash: ExecutionHash;
readonly mutations: {
readonly defaults: readonly [
{
readonly onCreate: { readonly id: 'timestampNow'; readonly kind: 'generator' };
readonly onUpdate: { readonly id: 'timestampNow'; readonly kind: 'generator' };
readonly ref: {
readonly entry: 'product';
readonly field: 'updatedAt';
readonly namespace: 'public';
};
},
{
readonly onCreate: { readonly id: 'timestampNow'; readonly kind: 'generator' };
readonly onUpdate: { readonly id: 'timestampNow'; readonly kind: 'generator' };
readonly ref: {
readonly entry: 'user';
readonly field: 'updatedAt';
readonly namespace: 'public';
};
},
];
};
};
readonly meta: {};
readonly profileHash: ProfileHash;
};
export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
export type Namespaces = Contract['storage']['namespaces'];