diff --git a/.vscode/settings.json b/.vscode/settings.json index ef38a3e..549b465 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,7 +5,7 @@ }, // Prisma formatting "[prisma]": { - "editor.defaultFormatter": "Prisma.prisma", + "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true }, "[typescript]": { diff --git a/package.json b/package.json index 20bfdad..dfe7a3e 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "@nestjs/platform-express": "^11.0.1", "@nestjs/swagger": "^11.2.3", "@prisma/adapter-mariadb": "^7.1.0", + "@types/multer": "^2.0.0", "class-transformer": "^0.5.1", "class-validator": "^0.14.3", + "cookie-parser": "^1.4.7", "dayjs": "^1.11.19", "dotenv": "^17.2.3", "jalaliday": "^3.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d25525b..dfcc6e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,12 +26,18 @@ importers: '@prisma/adapter-mariadb': specifier: ^7.1.0 version: 7.1.0 + '@types/multer': + specifier: ^2.0.0 + version: 2.0.0 class-transformer: specifier: ^0.5.1 version: 0.5.1 class-validator: specifier: ^0.14.3 version: 0.14.3 + cookie-parser: + specifier: ^1.4.7 + version: 1.4.7 dayjs: specifier: ^1.11.19 version: 1.11.19 @@ -1173,6 +1179,9 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/multer@2.0.0': + resolution: {integrity: sha512-C3Z9v9Evij2yST3RSBktxP9STm6OdMc5uR1xF1SGr98uv8dUlAL2hqwrZ3GVB3uyMyiegnscEK6PGtYvNrjTjw==} + '@types/node@22.19.1': resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==} @@ -1768,6 +1777,13 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie-parser@1.4.7: + resolution: {integrity: sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==} + engines: {node: '>= 0.8.0'} + + cookie-signature@1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + cookie-signature@1.2.2: resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} engines: {node: '>=6.6.0'} @@ -4795,6 +4811,10 @@ snapshots: '@types/ms@2.1.0': {} + '@types/multer@2.0.0': + dependencies: + '@types/express': 5.0.6 + '@types/node@22.19.1': dependencies: undici-types: 6.21.0 @@ -5430,6 +5450,13 @@ snapshots: convert-source-map@2.0.0: {} + cookie-parser@1.4.7: + dependencies: + cookie: 0.7.2 + cookie-signature: 1.0.6 + + cookie-signature@1.0.6: {} + cookie-signature@1.2.2: {} cookie@0.7.2: {} diff --git a/prisma/migrations/20260210161825_init/migration.sql b/prisma/migrations/20260210161825_init/migration.sql new file mode 100644 index 0000000..cd2cbf1 --- /dev/null +++ b/prisma/migrations/20260210161825_init/migration.sql @@ -0,0 +1,245 @@ +/* + Warnings: + + - The primary key for the `Sales_Invoice_Payments` table will be changed. If it partially fails, the table could be left without primary key constraint. + - You are about to drop the column `createdAt` on the `Sales_Invoice_Payments` table. All the data in the column will be lost. + - You are about to drop the column `invoiceId` on the `Sales_Invoice_Payments` table. All the data in the column will be lost. + - You are about to drop the column `paidAt` on the `Sales_Invoice_Payments` table. All the data in the column will be lost. + - You are about to drop the column `paymentMethod` on the `Sales_Invoice_Payments` table. All the data in the column will be lost. + - You are about to drop the `Customers` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Good_categories` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Goods` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Sales_Invoice_Items` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Sales_Invoices` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Service_categories` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Services` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Trigger_Logs` table. If the table is not empty, all the data it contains will be lost. + - Added the required column `invoice_id` to the `Sales_Invoice_Payments` table without a default value. This is not possible if the table is not empty. + - Added the required column `paid_at` to the `Sales_Invoice_Payments` table without a default value. This is not possible if the table is not empty. + - Added the required column `payment_method` to the `Sales_Invoice_Payments` table without a default value. This is not possible if the table is not empty. + +*/ +-- DropForeignKey +ALTER TABLE `Goods` DROP FOREIGN KEY `Goods_categoryId_fkey`; + +-- DropForeignKey +ALTER TABLE `Sales_Invoice_Items` DROP FOREIGN KEY `Sales_Invoice_Items_goodId_fkey`; + +-- DropForeignKey +ALTER TABLE `Sales_Invoice_Items` DROP FOREIGN KEY `Sales_Invoice_Items_invoiceId_fkey`; + +-- DropForeignKey +ALTER TABLE `Sales_Invoice_Items` DROP FOREIGN KEY `Sales_Invoice_Items_serviceId_fkey`; + +-- DropForeignKey +ALTER TABLE `Sales_Invoice_Payments` DROP FOREIGN KEY `Sales_Invoice_Payments_invoiceId_fkey`; + +-- DropForeignKey +ALTER TABLE `Sales_Invoices` DROP FOREIGN KEY `Sales_Invoices_customerId_fkey`; + +-- DropForeignKey +ALTER TABLE `Services` DROP FOREIGN KEY `Services_categoryId_fkey`; + +-- DropIndex +DROP INDEX `Sales_Invoice_Payments_invoiceId_idx` ON `Sales_Invoice_Payments`; + +-- AlterTable +ALTER TABLE `Sales_Invoice_Payments` DROP PRIMARY KEY, + DROP COLUMN `createdAt`, + DROP COLUMN `invoiceId`, + DROP COLUMN `paidAt`, + DROP COLUMN `paymentMethod`, + ADD COLUMN `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + ADD COLUMN `invoice_id` VARCHAR(191) NOT NULL, + ADD COLUMN `paid_at` DATETIME(3) NOT NULL, + ADD COLUMN `payment_method` ENUM('CASH', 'CARD', 'BANK', 'CHECK', 'OTHER') NOT NULL, + MODIFY `id` VARCHAR(191) NOT NULL, + ADD PRIMARY KEY (`id`); + +-- DropTable +DROP TABLE `Customers`; + +-- DropTable +DROP TABLE `Good_categories`; + +-- DropTable +DROP TABLE `Goods`; + +-- DropTable +DROP TABLE `Sales_Invoice_Items`; + +-- DropTable +DROP TABLE `Sales_Invoices`; + +-- DropTable +DROP TABLE `Service_categories`; + +-- DropTable +DROP TABLE `Services`; + +-- DropTable +DROP TABLE `Trigger_Logs`; + +-- CreateTable +CREATE TABLE `customers` ( + `id` VARCHAR(191) NOT NULL, + `first_name` VARCHAR(255) NOT NULL, + `last_name` VARCHAR(255) NOT NULL, + `email` VARCHAR(255) NULL, + `mobile_number` CHAR(11) NOT NULL, + `address` TEXT NULL, + `is_active` BOOLEAN NOT NULL DEFAULT true, + `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updated_at` TIMESTAMP(0) NOT NULL, + `deleted_at` TIMESTAMP(0) NULL, + + UNIQUE INDEX `customers_mobile_number_key`(`mobile_number`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `devices` ( + `account_id` VARCHAR(255) NULL, + `app_version` VARCHAR(20) NOT NULL, + `build_number` VARCHAR(20) NOT NULL, + `device_id` VARCHAR(255) NOT NULL, + `platform` VARCHAR(100) NOT NULL, + `brand` VARCHAR(100) NOT NULL, + `model` VARCHAR(100) NOT NULL, + `device` VARCHAR(100) NOT NULL, + `os_version` VARCHAR(20) NOT NULL, + `sdk_version` VARCHAR(20) NOT NULL, + `release_number` VARCHAR(20) NOT NULL, + `browser_name` VARCHAR(100) NULL, + + PRIMARY KEY (`device_id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `goods` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(255) NOT NULL, + `description` TEXT NULL, + `sku` VARCHAR(100) NOT NULL, + `local_sku` VARCHAR(100) NOT NULL, + `barcode` VARCHAR(100) NULL, + `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updated_at` TIMESTAMP(0) NOT NULL, + `deleted_at` TIMESTAMP(0) NULL, + `category_id` VARCHAR(191) NULL, + `base_sale_price` DECIMAL(15, 0) NOT NULL DEFAULT 0.00, + + UNIQUE INDEX `goods_local_sku_key`(`local_sku`), + UNIQUE INDEX `goods_barcode_key`(`barcode`), + INDEX `goods_category_id_idx`(`category_id`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `good_categories` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(100) NOT NULL, + `description` TEXT NULL, + `image_url` VARCHAR(255) NULL, + `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updated_at` TIMESTAMP(0) NOT NULL, + `deleted_at` TIMESTAMP(0) NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `trigger_logs` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `message` TEXT NOT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `name` TEXT NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `sales_invoices` ( + `id` VARCHAR(191) NOT NULL, + `code` VARCHAR(100) NOT NULL, + `total_amount` DECIMAL(15, 2) NOT NULL, + `description` TEXT NULL, + `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updated_at` TIMESTAMP(0) NOT NULL, + `customer_id` VARCHAR(191) NULL, + + UNIQUE INDEX `sales_invoices_code_key`(`code`), + INDEX `sales_invoices_customer_id_idx`(`customer_id`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `sales_invoice_items` ( + `id` VARCHAR(191) NOT NULL, + `count` DECIMAL(10, 0) NOT NULL, + `unit_price` DECIMAL(15, 2) NOT NULL DEFAULT 0.00, + `total_amount` DECIMAL(15, 2) NOT NULL DEFAULT 0.00, + `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `invoice_id` VARCHAR(191) NOT NULL, + `good_id` VARCHAR(191) NOT NULL, + `service_id` VARCHAR(191) NOT NULL, + + INDEX `sales_invoice_items_invoice_id_good_id_idx`(`invoice_id`, `good_id`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `services` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(255) NOT NULL, + `description` TEXT NULL, + `sku` VARCHAR(100) NOT NULL, + `barcode` VARCHAR(100) NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updatedAt` TIMESTAMP(0) NOT NULL, + `deletedAt` TIMESTAMP(0) NULL, + `categoryId` VARCHAR(191) NULL, + `baseSalePrice` DECIMAL(15, 0) NOT NULL DEFAULT 0.00, + + UNIQUE INDEX `services_sku_key`(`sku`), + UNIQUE INDEX `services_barcode_key`(`barcode`), + INDEX `services_categoryId_idx`(`categoryId`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `service_categories` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(100) NOT NULL, + `description` TEXT NULL, + `imageUrl` VARCHAR(255) NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updatedAt` TIMESTAMP(0) NOT NULL, + `deletedAt` TIMESTAMP(0) NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateIndex +CREATE INDEX `Sales_Invoice_Payments_invoice_id_idx` ON `Sales_Invoice_Payments`(`invoice_id`); + +-- AddForeignKey +ALTER TABLE `goods` ADD CONSTRAINT `goods_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `good_categories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `sales_invoices` ADD CONSTRAINT `sales_invoices_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_good_id_fkey` FOREIGN KEY (`good_id`) REFERENCES `goods`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `sales_invoice_items` ADD CONSTRAINT `sales_invoice_items_service_id_fkey` FOREIGN KEY (`service_id`) REFERENCES `services`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Sales_Invoice_Payments` ADD CONSTRAINT `Sales_Invoice_Payments_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `services` ADD CONSTRAINT `services_categoryId_fkey` FOREIGN KEY (`categoryId`) REFERENCES `service_categories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20260211102339_init/migration.sql b/prisma/migrations/20260211102339_init/migration.sql new file mode 100644 index 0000000..38c2476 --- /dev/null +++ b/prisma/migrations/20260211102339_init/migration.sql @@ -0,0 +1,13 @@ +/* + Warnings: + + - The primary key for the `devices` table will be changed. If it partially fails, the table could be left without primary key constraint. + - You are about to drop the column `device_id` on the `devices` table. All the data in the column will be lost. + - Added the required column `uuid` to the `devices` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `devices` DROP PRIMARY KEY, + DROP COLUMN `device_id`, + ADD COLUMN `uuid` VARCHAR(255) NOT NULL, + ADD PRIMARY KEY (`uuid`); diff --git a/prisma/migrations/20260211104648_init/migration.sql b/prisma/migrations/20260211104648_init/migration.sql new file mode 100644 index 0000000..437c6d4 --- /dev/null +++ b/prisma/migrations/20260211104648_init/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - A unique constraint covering the columns `[uuid]` on the table `devices` will be added. If there are existing duplicate values, this will fail. + +*/ +-- CreateIndex +CREATE UNIQUE INDEX `devices_uuid_key` ON `devices`(`uuid`); diff --git a/prisma/migrations/20260211105559_init/migration.sql b/prisma/migrations/20260211105559_init/migration.sql new file mode 100644 index 0000000..580ecda --- /dev/null +++ b/prisma/migrations/20260211105559_init/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `devices` ADD COLUMN `fcm_token` VARCHAR(100) NULL; diff --git a/prisma/migrations/20260211214040_init/migration.sql b/prisma/migrations/20260211214040_init/migration.sql new file mode 100644 index 0000000..a836b26 --- /dev/null +++ b/prisma/migrations/20260211214040_init/migration.sql @@ -0,0 +1,87 @@ +/* + Warnings: + + - You are about to drop the column `createdAt` on the `service_categories` table. All the data in the column will be lost. + - You are about to drop the column `deletedAt` on the `service_categories` table. All the data in the column will be lost. + - You are about to drop the column `imageUrl` on the `service_categories` table. All the data in the column will be lost. + - You are about to drop the column `updatedAt` on the `service_categories` table. All the data in the column will be lost. + - You are about to drop the column `baseSalePrice` on the `services` table. All the data in the column will be lost. + - You are about to drop the column `categoryId` on the `services` table. All the data in the column will be lost. + - You are about to drop the column `createdAt` on the `services` table. All the data in the column will be lost. + - You are about to drop the column `deletedAt` on the `services` table. All the data in the column will be lost. + - You are about to drop the column `updatedAt` on the `services` table. All the data in the column will be lost. + - A unique constraint covering the columns `[local_sku]` on the table `services` will be added. If there are existing duplicate values, this will fail. + - Added the required column `account_id` to the `customers` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `customers` table without a default value. This is not possible if the table is not empty. + - Added the required column `account_id` to the `good_categories` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `good_categories` table without a default value. This is not possible if the table is not empty. + - Added the required column `account_id` to the `goods` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `goods` table without a default value. This is not possible if the table is not empty. + - Added the required column `account_id` to the `sales_invoices` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `sales_invoices` table without a default value. This is not possible if the table is not empty. + - Added the required column `account_id` to the `service_categories` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `service_categories` table without a default value. This is not possible if the table is not empty. + - Added the required column `updated_at` to the `service_categories` table without a default value. This is not possible if the table is not empty. + - Added the required column `account_id` to the `services` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `services` table without a default value. This is not possible if the table is not empty. + - Added the required column `updated_at` to the `services` table without a default value. This is not possible if the table is not empty. + +*/ +-- DropForeignKey +ALTER TABLE `services` DROP FOREIGN KEY `services_categoryId_fkey`; + +-- DropIndex +DROP INDEX `services_categoryId_idx` ON `services`; + +-- AlterTable +ALTER TABLE `customers` ADD COLUMN `account_id` VARCHAR(191) NOT NULL, + ADD COLUMN `complex_id` VARCHAR(191) NOT NULL; + +-- AlterTable +ALTER TABLE `good_categories` ADD COLUMN `account_id` VARCHAR(191) NOT NULL, + ADD COLUMN `complex_id` VARCHAR(191) NOT NULL; + +-- AlterTable +ALTER TABLE `goods` ADD COLUMN `account_id` VARCHAR(191) NOT NULL, + ADD COLUMN `complex_id` VARCHAR(191) NOT NULL, + MODIFY `local_sku` VARCHAR(100) NULL; + +-- AlterTable +ALTER TABLE `sales_invoices` ADD COLUMN `account_id` VARCHAR(191) NOT NULL, + ADD COLUMN `complex_id` VARCHAR(191) NOT NULL; + +-- AlterTable +ALTER TABLE `service_categories` DROP COLUMN `createdAt`, + DROP COLUMN `deletedAt`, + DROP COLUMN `imageUrl`, + DROP COLUMN `updatedAt`, + ADD COLUMN `account_id` VARCHAR(191) NOT NULL, + ADD COLUMN `complex_id` VARCHAR(191) NOT NULL, + ADD COLUMN `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + ADD COLUMN `deleted_at` TIMESTAMP(0) NULL, + ADD COLUMN `image_url` VARCHAR(255) NULL, + ADD COLUMN `updated_at` TIMESTAMP(0) NOT NULL; + +-- AlterTable +ALTER TABLE `services` DROP COLUMN `baseSalePrice`, + DROP COLUMN `categoryId`, + DROP COLUMN `createdAt`, + DROP COLUMN `deletedAt`, + DROP COLUMN `updatedAt`, + ADD COLUMN `account_id` VARCHAR(191) NOT NULL, + ADD COLUMN `base_sale_price` DECIMAL(15, 0) NOT NULL DEFAULT 0.00, + ADD COLUMN `category_id` VARCHAR(191) NULL, + ADD COLUMN `complex_id` VARCHAR(191) NOT NULL, + ADD COLUMN `created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + ADD COLUMN `deleted_at` TIMESTAMP(0) NULL, + ADD COLUMN `local_sku` VARCHAR(100) NULL, + ADD COLUMN `updated_at` TIMESTAMP(0) NOT NULL; + +-- CreateIndex +CREATE UNIQUE INDEX `services_local_sku_key` ON `services`(`local_sku`); + +-- CreateIndex +CREATE INDEX `services_category_id_idx` ON `services`(`category_id`); + +-- AddForeignKey +ALTER TABLE `services` ADD CONSTRAINT `services_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `service_categories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20260211222557_init/migration.sql b/prisma/migrations/20260211222557_init/migration.sql new file mode 100644 index 0000000..71eb1d4 --- /dev/null +++ b/prisma/migrations/20260211222557_init/migration.sql @@ -0,0 +1,27 @@ +/* + Warnings: + + - You are about to drop the `Sales_Invoice_Payments` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE `Sales_Invoice_Payments` DROP FOREIGN KEY `Sales_Invoice_Payments_invoice_id_fkey`; + +-- DropTable +DROP TABLE `Sales_Invoice_Payments`; + +-- CreateTable +CREATE TABLE `sales_invoice_payments` ( + `id` VARCHAR(191) NOT NULL, + `invoice_id` VARCHAR(191) NOT NULL, + `amount` DECIMAL(15, 2) NOT NULL, + `payment_method` ENUM('CASH', 'CARD', 'BANK', 'CHECK', 'OTHER') NOT NULL, + `paid_at` DATETIME(3) NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + + INDEX `sales_invoice_payments_invoice_id_idx`(`invoice_id`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `sales_invoice_payments` ADD CONSTRAINT `sales_invoice_payments_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema/customers.prisma b/prisma/schema/customers.prisma new file mode 100644 index 0000000..7f7a7dc --- /dev/null +++ b/prisma/schema/customers.prisma @@ -0,0 +1,19 @@ +model Customer { + id String @id @default(uuid()) + first_name String @db.VarChar(255) + last_name String @db.VarChar(255) + email String? @db.VarChar(255) + mobile_number String @unique @db.Char(11) + address String? @db.Text + is_active Boolean @default(true) + account_id String + complex_id String + + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) + + sales_invoices SalesInvoice[] + + @@map("customers") +} diff --git a/prisma/schema/devices.prisma b/prisma/schema/devices.prisma new file mode 100644 index 0000000..858f35d --- /dev/null +++ b/prisma/schema/devices.prisma @@ -0,0 +1,18 @@ +model Device { + account_id String? @db.VarChar(255) + app_version String @db.VarChar(20) + build_number String @db.VarChar(20) + + uuid String @id @unique() @db.VarChar(255) + platform String @db.VarChar(100) + brand String @db.VarChar(100) + model String @db.VarChar(100) + device String @db.VarChar(100) + os_version String @db.VarChar(20) + sdk_version String @db.VarChar(20) + release_number String @db.VarChar(20) + browser_name String? @db.VarChar(100) + fcm_token String? @db.VarChar(100) + + @@map("devices") +} diff --git a/prisma/schema/good.prisma b/prisma/schema/good.prisma index 18f4f0f..cb6060d 100644 --- a/prisma/schema/good.prisma +++ b/prisma/schema/good.prisma @@ -1,31 +1,37 @@ model Good { - id Int @id @default(autoincrement()) - name String @db.VarChar(255) - description String? @db.Text - sku String @db.VarChar(100) - localSku String @unique() @db.VarChar(100) - barcode String? @unique() @db.VarChar(100) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - categoryId Int? - baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0) - category GoodCategory? @relation(fields: [categoryId], references: [id]) - salesInvoiceItems SalesInvoiceItem[] + id String @id @default(uuid()) + name String @db.VarChar(255) + description String? @db.Text + sku String @db.VarChar(100) + local_sku String? @unique() @db.VarChar(100) + barcode String? @unique() @db.VarChar(100) + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) + category_id String? + base_sale_price Decimal @default(0.00) @db.Decimal(15, 0) + account_id String + complex_id String - @@index([categoryId]) - @@map("Goods") + category GoodCategory? @relation(fields: [category_id], references: [id]) + sales_invoice_items SalesInvoiceItem[] + + @@index([category_id]) + @@map("goods") } model GoodCategory { - id Int @id @default(autoincrement()) + id String @id @default(uuid()) name String @db.VarChar(100) description String? @db.Text - imageUrl String? @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - goods Good[] + image_url String? @db.VarChar(255) + account_id String + complex_id String + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) - @@map("Good_categories") + goods Good[] + + @@map("good_categories") } diff --git a/prisma/schema/others.prisma b/prisma/schema/others.prisma index 5f8bb33..6f58745 100644 --- a/prisma/schema/others.prisma +++ b/prisma/schema/others.prisma @@ -1,24 +1,8 @@ -model Customer { - id Int @id @default(autoincrement()) - firstName String @db.VarChar(255) - lastName String @db.VarChar(255) - email String? @db.VarChar(255) - mobileNumber String @unique @db.Char(11) - address String? @db.Text - isActive Boolean @default(true) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - salesInvoices SalesInvoice[] - - @@map("Customers") -} - model TriggerLog { id Int @id @default(autoincrement()) message String @db.Text createdAt DateTime @default(now()) @db.Timestamp(0) name String @db.Text - @@map("Trigger_Logs") + @@map("trigger_logs") } diff --git a/prisma/schema/sales.prisma b/prisma/schema/sales.prisma index f547e3f..57b215f 100644 --- a/prisma/schema/sales.prisma +++ b/prisma/schema/sales.prisma @@ -1,46 +1,50 @@ model SalesInvoice { - id Int @id @default(autoincrement()) - code String @unique @db.VarChar(100) - totalAmount Decimal @db.Decimal(15, 2) - description String? @db.Text - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - customerId Int? - customer Customer? @relation(fields: [customerId], references: [id]) - items SalesInvoiceItem[] - salesInvoicePayments SalesInvoicePayment[] + id String @id @default(uuid()) + code String @unique @db.VarChar(100) + total_amount Decimal @db.Decimal(15, 2) + description String? @db.Text + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + customer_id String? + account_id String + complex_id String - @@index([customerId]) - @@map("Sales_Invoices") + customer Customer? @relation(fields: [customer_id], references: [id]) + items SalesInvoiceItem[] + sales_invoice_payments SalesInvoicePayment[] + + @@index([customer_id]) + @@map("sales_invoices") } model SalesInvoiceItem { - id Int @id @default(autoincrement()) - count Decimal @db.Decimal(10, 0) - unitPrice Decimal @default(0.00) @db.Decimal(15, 2) - totalAmount Decimal @default(0.00) @db.Decimal(15, 2) - createdAt DateTime @default(now()) @db.Timestamp(0) - invoiceId Int - goodId Int - serviceId Int - invoice SalesInvoice @relation(fields: [invoiceId], references: [id]) - good Good? @relation(fields: [goodId], references: [id]) - service Service? @relation(fields: [serviceId], references: [id]) + id String @id @default(uuid()) + count Decimal @db.Decimal(10, 0) + unit_price Decimal @default(0.00) @db.Decimal(15, 2) + total_amount Decimal @default(0.00) @db.Decimal(15, 2) + created_at DateTime @default(now()) @db.Timestamp(0) + invoice_id String + good_id String + service_id String - @@index([invoiceId, goodId]) - @@map("Sales_Invoice_Items") + invoice SalesInvoice @relation(fields: [invoice_id], references: [id]) + good Good? @relation(fields: [good_id], references: [id]) + service Service? @relation(fields: [service_id], references: [id]) + + @@index([invoice_id, good_id]) + @@map("sales_invoice_items") } model SalesInvoicePayment { - id Int @id @default(autoincrement()) - invoiceId Int - amount Decimal @db.Decimal(15, 2) - paymentMethod PaymentMethodType - paidAt DateTime - createdAt DateTime @default(now()) + id String @id @default(uuid()) + invoice_id String + amount Decimal @db.Decimal(15, 2) + payment_method PaymentMethodType + paid_at DateTime + created_at DateTime @default(now()) - invoice SalesInvoice @relation(fields: [invoiceId], references: [id]) + invoice SalesInvoice @relation(fields: [invoice_id], references: [id]) - @@index([invoiceId]) - @@map("Sales_Invoice_Payments") + @@index([invoice_id]) + @@map("sales_invoice_payments") } diff --git a/prisma/schema/service.prisma b/prisma/schema/service.prisma index 54dba81..6915c34 100644 --- a/prisma/schema/service.prisma +++ b/prisma/schema/service.prisma @@ -1,30 +1,37 @@ model Service { - id Int @id @default(autoincrement()) - name String @db.VarChar(255) - description String? @db.Text - sku String @unique() @db.VarChar(100) - barcode String? @unique() @db.VarChar(100) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - categoryId Int? - baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0) - category ServiceCategory? @relation(fields: [categoryId], references: [id]) - salesInvoiceItems SalesInvoiceItem[] + id String @id @default(uuid()) + name String @db.VarChar(255) + description String? @db.Text + sku String @unique() @db.VarChar(100) + local_sku String? @unique() @db.VarChar(100) + barcode String? @unique() @db.VarChar(100) + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) + category_id String? + base_sale_price Decimal @default(0.00) @db.Decimal(15, 0) + account_id String + complex_id String - @@index([categoryId]) - @@map("Services") + category ServiceCategory? @relation(fields: [category_id], references: [id]) + sales_invoice_items SalesInvoiceItem[] + + @@index([category_id]) + @@map("services") } model ServiceCategory { - id Int @id @default(autoincrement()) + id String @id @default(uuid()) name String @db.VarChar(100) description String? @db.Text - imageUrl String? @db.VarChar(255) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - services Service[] + image_url String? @db.VarChar(255) + account_id String + complex_id String + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) - @@map("Service_categories") + services Service[] + + @@map("service_categories") } diff --git a/prisma/seed.ts b/prisma/seed.ts index 96b8f0a..773225f 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -1,321 +1,320 @@ import { prisma } from '../src/lib/prisma' async function main() { - if ((await prisma.role.count()) === 0) { - await prisma.role.upsert({ - where: { id: 0, name: 'Admin' }, - update: {}, - create: { - name: 'Admin', - }, - }) - } - if ((await prisma.user.count()) === 0) { - const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } }) - if (!adminRole) { - return - } - await prisma.user.upsert({ - where: { id: 1, firstName: 'عباس', lastName: 'حسنی' }, - update: {}, - create: { - firstName: 'عباس', - lastName: 'حسنی', - roleId: adminRole.id, - mobileNumber: '09120258156', - password: '12345678', - }, - }) - } - if ((await prisma.inventory.count()) === 0) { - await prisma.inventory.createMany({ - data: [ - { name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true }, - { - name: 'فروشگاه حضوری', - location: 'مرکز شهر', - isPointOfSale: true, - isActive: true, - }, - { - name: 'فروشگاه اینترنتی', - location: 'مرکز شهر', - isPointOfSale: true, - isActive: true, - }, - ], - }) - } - if ((await prisma.productCategory.count()) === 0) { - await prisma.productCategory.createMany({ - data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })), - }) - } - if ((await prisma.productBrand.count()) === 0) { - await prisma.productBrand.createMany({ - data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })), - }) - } - if ((await prisma.supplier.count()) === 0) { - await prisma.supplier.createMany({ - data: Array.from({ length: 9 }, (_, i) => ({ - firstName: 'تامین‌', - lastName: `کننده ${i + 1}`, - mobileNumber: `0912000000${i + 1}`, - email: `supplier${i + 1}@example.com`, - })), - }) - } - if ((await prisma.customer.count()) === 0) { - await prisma.customer.createMany({ - data: Array.from({ length: 5 }, (_, i) => ({ - firstName: 'مشتری', - lastName: `${i + 1}`, - mobileNumber: `0913000000${i + 1}`, - email: `customer${i + 1}@example.com`, - })), - }) - } - if ((await prisma.product.count()) === 0) { - const categories = await prisma.productCategory.findMany() - const brands = await prisma.productBrand.findMany() - await prisma.product.createMany({ - data: Array.from({ length: 20 }, (_, i) => ({ - name: `کالای ${i + 1}`, - sku: `SKU-${1000 + i + 1}`, - salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000, - categoryId: categories[i % categories.length].id, - brandId: brands[i % brands.length].id, - })), - }) - } - if ((await prisma.bank.count()) === 0) { - await prisma.bank.createMany({ - data: [ - { - name: 'آینده', - shortName: 'ain', - }, - { - name: 'ایران زمین', - shortName: 'irz', - }, - { - name: 'اقتصاد نوین', - shortName: 'eqn', - }, - { - name: 'انصار', - shortName: 'ans', - }, - { - name: 'پاسارگاد', - shortName: 'pas', - }, - { - name: 'پارسیان', - shortName: 'prs', - }, - { - name: 'پست‌ بانک ایران', - shortName: 'pbi', - }, - { - name: 'تجارت', - shortName: 'tej', - }, - { - name: 'توسعه تعاون', - shortName: 'tav', - }, - { - name: 'توسعه صادرات', - shortName: 'tes', - }, - { - name: 'حکمت ایرانیان', - shortName: 'hek', - }, - { - name: 'رفاه کارگران', - shortName: 'ref', - }, - { - name: 'قرض‌الحسنه رسالت', - shortName: 'res', - }, - { - name: 'قرض‌الحسنه مهر ایران', - shortName: 'meh', - }, - { - name: 'قوامین', - shortName: 'qva', - }, - { - name: 'کشاورزی', - shortName: 'kes', - }, - { - name: 'کوثر', - shortName: 'kos', - }, - { - name: 'دی', - shortName: 'diy', - }, - { - name: 'صنعت و معدن', - shortName: 'san', - }, - { - name: 'سینا', - shortName: 'sin', - }, - { - name: 'سرمایه', - shortName: 'sar', - }, - { - name: 'سپه', - shortName: 'sep', - }, - { - name: 'شهر', - shortName: 'shr', - }, - { - name: 'صادرات ایران', - shortName: 'sir', - }, - { - name: 'سامان', - shortName: 'sam', - }, - { - name: 'مرکزی', - shortName: 'mar', - }, - { - name: 'مسکن', - shortName: 'mas', - }, - { - name: 'ملت', - shortName: 'mel', - }, - { - name: 'ملی ایران', - shortName: 'mli', - }, - { - name: 'مهر اقتصاد', - shortName: 'meg', - }, - { - name: 'کارآفرین', - shortName: 'kar', - }, - { - name: 'تات', - shortName: 'tat', - }, - ], - }) - } - if ((await prisma.bankBranch.count()) === 0) { - await prisma.bankBranch.createMany({ - data: [ - { - bankId: 1, - name: 'شعبه مرکزی', - code: '001', - }, - { - bankId: 2, - name: 'شعبه مرکزی', - code: '002', - }, - { - bankId: 1, - name: 'شعبه ونک', - code: '003', - }, - ], - }) - } - if ((await prisma.bankAccount.count()) === 0) { - await prisma.bankAccount.createMany({ - data: [ - { - branchId: 1, - accountNumber: '1234567890', - name: 'حساب اصلی آینده', - iban: 'IR000123456789012345678901', - }, - { - branchId: 2, - accountNumber: '0987654321', - name: 'حساب اصلی ایران زمین', - iban: 'IR000987654321098765432109', - }, - { - branchId: 3, - accountNumber: '1122334455', - name: 'حساب ونک آینده', - iban: 'IR000112233445566778899001', - }, - ], - }) - } - if ((await prisma.inventoryBankAccount.count()) === 0) { - const inventories = await prisma.inventory.findMany() - const bankAccounts = await prisma.bankAccount.findMany() - if (inventories.length || bankAccounts.length) { - // Assign bank accounts to inventories - const inventoryBankAccounts = [] - for (let i = 0; i < inventories.length; i++) { - const inventory = inventories[i] - const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts - // @ts-ignore - inventoryBankAccounts.push({ - inventoryId: inventory.id, - bankAccountId: bankAccount.id, - }) - } - await prisma.inventoryBankAccount.createMany({ - data: inventoryBankAccounts, - }) - } - } - if ((await prisma.posAccount.count()) === 0) { - const inventories = await prisma.inventory.findMany({ - where: { isPointOfSale: true }, - }) - const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany() - const posAccounts = [] - for (let i = 0; i < inventories.length; i++) { - const inventory = inventories[i] - // Find a bank account assigned to this inventory - const inventoryBankAccount = inventoryBankAccounts.find( - iba => iba.inventoryId === inventory.id, - ) - if (inventoryBankAccount) { - // @ts-ignore - - posAccounts.push({ - name: `پوز ${inventory.name}`, - code: `POS${(i + 1).toString().padStart(3, '0')}`, - description: `پوز فروشگاه ${inventory.name}`, - inventoryId: inventory.id, - bankAccountId: inventoryBankAccount.bankAccountId, - }) - } - } - await prisma.posAccount.createMany({ - data: posAccounts, - }) - } + // if ((await prisma.role.count()) === 0) { + // await prisma.role.upsert({ + // where: { id: 0, name: 'Admin' }, + // update: {}, + // create: { + // name: 'Admin', + // }, + // }) + // } + // if ((await prisma.user.count()) === 0) { + // const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } }) + // if (!adminRole) { + // return + // } + // await prisma.user.upsert({ + // where: { id: 1, firstName: 'عباس', lastName: 'حسنی' }, + // update: {}, + // create: { + // firstName: 'عباس', + // lastName: 'حسنی', + // roleId: adminRole.id, + // mobileNumber: '09120258156', + // password: '12345678', + // }, + // }) + // } + // if ((await prisma.inventory.count()) === 0) { + // await prisma.inventory.createMany({ + // data: [ + // { name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true }, + // { + // name: 'فروشگاه حضوری', + // location: 'مرکز شهر', + // isPointOfSale: true, + // isActive: true, + // }, + // { + // name: 'فروشگاه اینترنتی', + // location: 'مرکز شهر', + // isPointOfSale: true, + // isActive: true, + // }, + // ], + // }) + // } + // if ((await prisma.productCategory.count()) === 0) { + // await prisma.productCategory.createMany({ + // data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })), + // }) + // } + // if ((await prisma.productBrand.count()) === 0) { + // await prisma.productBrand.createMany({ + // data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })), + // }) + // } + // if ((await prisma.supplier.count()) === 0) { + // await prisma.supplier.createMany({ + // data: Array.from({ length: 9 }, (_, i) => ({ + // firstName: 'تامین‌', + // lastName: `کننده ${i + 1}`, + // mobileNumber: `0912000000${i + 1}`, + // email: `supplier${i + 1}@example.com`, + // })), + // }) + // } + // if ((await prisma.customer.count()) === 0) { + // await prisma.customer.createMany({ + // data: Array.from({ length: 5 }, (_, i) => ({ + // firstName: 'مشتری', + // lastName: `${i + 1}`, + // mobileNumber: `0913000000${i + 1}`, + // email: `customer${i + 1}@example.com`, + // })), + // }) + // } + // if ((await prisma.product.count()) === 0) { + // const categories = await prisma.productCategory.findMany() + // const brands = await prisma.productBrand.findMany() + // await prisma.product.createMany({ + // data: Array.from({ length: 20 }, (_, i) => ({ + // name: `کالای ${i + 1}`, + // sku: `SKU-${1000 + i + 1}`, + // salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000, + // categoryId: categories[i % categories.length].id, + // brandId: brands[i % brands.length].id, + // })), + // }) + // } + // if ((await prisma.bank.count()) === 0) { + // await prisma.bank.createMany({ + // data: [ + // { + // name: 'آینده', + // shortName: 'ain', + // }, + // { + // name: 'ایران زمین', + // shortName: 'irz', + // }, + // { + // name: 'اقتصاد نوین', + // shortName: 'eqn', + // }, + // { + // name: 'انصار', + // shortName: 'ans', + // }, + // { + // name: 'پاسارگاد', + // shortName: 'pas', + // }, + // { + // name: 'پارسیان', + // shortName: 'prs', + // }, + // { + // name: 'پست‌ بانک ایران', + // shortName: 'pbi', + // }, + // { + // name: 'تجارت', + // shortName: 'tej', + // }, + // { + // name: 'توسعه تعاون', + // shortName: 'tav', + // }, + // { + // name: 'توسعه صادرات', + // shortName: 'tes', + // }, + // { + // name: 'حکمت ایرانیان', + // shortName: 'hek', + // }, + // { + // name: 'رفاه کارگران', + // shortName: 'ref', + // }, + // { + // name: 'قرض‌الحسنه رسالت', + // shortName: 'res', + // }, + // { + // name: 'قرض‌الحسنه مهر ایران', + // shortName: 'meh', + // }, + // { + // name: 'قوامین', + // shortName: 'qva', + // }, + // { + // name: 'کشاورزی', + // shortName: 'kes', + // }, + // { + // name: 'کوثر', + // shortName: 'kos', + // }, + // { + // name: 'دی', + // shortName: 'diy', + // }, + // { + // name: 'صنعت و معدن', + // shortName: 'san', + // }, + // { + // name: 'سینا', + // shortName: 'sin', + // }, + // { + // name: 'سرمایه', + // shortName: 'sar', + // }, + // { + // name: 'سپه', + // shortName: 'sep', + // }, + // { + // name: 'شهر', + // shortName: 'shr', + // }, + // { + // name: 'صادرات ایران', + // shortName: 'sir', + // }, + // { + // name: 'سامان', + // shortName: 'sam', + // }, + // { + // name: 'مرکزی', + // shortName: 'mar', + // }, + // { + // name: 'مسکن', + // shortName: 'mas', + // }, + // { + // name: 'ملت', + // shortName: 'mel', + // }, + // { + // name: 'ملی ایران', + // shortName: 'mli', + // }, + // { + // name: 'مهر اقتصاد', + // shortName: 'meg', + // }, + // { + // name: 'کارآفرین', + // shortName: 'kar', + // }, + // { + // name: 'تات', + // shortName: 'tat', + // }, + // ], + // }) + // } + // if ((await prisma.bankBranch.count()) === 0) { + // await prisma.bankBranch.createMany({ + // data: [ + // { + // bankId: 1, + // name: 'شعبه مرکزی', + // code: '001', + // }, + // { + // bankId: 2, + // name: 'شعبه مرکزی', + // code: '002', + // }, + // { + // bankId: 1, + // name: 'شعبه ونک', + // code: '003', + // }, + // ], + // }) + // } + // if ((await prisma.bankAccount.count()) === 0) { + // await prisma.bankAccount.createMany({ + // data: [ + // { + // branchId: 1, + // accountNumber: '1234567890', + // name: 'حساب اصلی آینده', + // iban: 'IR000123456789012345678901', + // }, + // { + // branchId: 2, + // accountNumber: '0987654321', + // name: 'حساب اصلی ایران زمین', + // iban: 'IR000987654321098765432109', + // }, + // { + // branchId: 3, + // accountNumber: '1122334455', + // name: 'حساب ونک آینده', + // iban: 'IR000112233445566778899001', + // }, + // ], + // }) + // } + // if ((await prisma.inventoryBankAccount.count()) === 0) { + // const inventories = await prisma.inventory.findMany() + // const bankAccounts = await prisma.bankAccount.findMany() + // if (inventories.length || bankAccounts.length) { + // // Assign bank accounts to inventories + // const inventoryBankAccounts = [] + // for (let i = 0; i < inventories.length; i++) { + // const inventory = inventories[i] + // const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts + // // @ts-ignore + // inventoryBankAccounts.push({ + // inventoryId: inventory.id, + // bankAccountId: bankAccount.id, + // }) + // } + // await prisma.inventoryBankAccount.createMany({ + // data: inventoryBankAccounts, + // }) + // } + // } + // if ((await prisma.posAccount.count()) === 0) { + // const inventories = await prisma.inventory.findMany({ + // where: { isPointOfSale: true }, + // }) + // const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany() + // const posAccounts = [] + // for (let i = 0; i < inventories.length; i++) { + // const inventory = inventories[i] + // // Find a bank account assigned to this inventory + // const inventoryBankAccount = inventoryBankAccounts.find( + // iba => iba.inventoryId === inventory.id, + // ) + // if (inventoryBankAccount) { + // // @ts-ignore + // posAccounts.push({ + // name: `پوز ${inventory.name}`, + // code: `POS${(i + 1).toString().padStart(3, '0')}`, + // description: `پوز فروشگاه ${inventory.name}`, + // inventoryId: inventory.id, + // bankAccountId: inventoryBankAccount.bankAccountId, + // }) + // } + // } + // await prisma.posAccount.createMany({ + // data: posAccounts, + // }) + // } // Seed purchase, transfer, and sales transactions // const inventories = await prisma.inventory.findMany() // const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo diff --git a/scripts/generate-permissions.ts b/scripts/generate-permissions.ts index 1b729e1..76b6b06 100644 --- a/scripts/generate-permissions.ts +++ b/scripts/generate-permissions.ts @@ -28,34 +28,34 @@ function makePermissionsFor(moduleName: string) { } async function main() { - const srcDir = path.resolve(__dirname, '..', 'src') - const moduleFiles = findModules(srcDir) - const modules = moduleFiles.map(moduleNameFromFile) + // const srcDir = path.resolve(__dirname, '..', 'src') + // const moduleFiles = findModules(srcDir) + // const modules = moduleFiles.map(moduleNameFromFile) - const permsMap: Record = {} - for (const m of modules) { - for (const p of makePermissionsFor(m)) permsMap[p] = false - } + // const permsMap: Record = {} + // for (const m of modules) { + // for (const p of makePermissionsFor(m)) permsMap[p] = false + // } - // Upsert roles: ensure admin has full permissions, others get entries added - const roles = await prisma.role.findMany() - for (const r of roles) { - const current: Record = (r.permissions as any) || {} - const merged = { ...permsMap, ...current } + // // Upsert roles: ensure admin has full permissions, others get entries added + // const roles = await prisma.role.findMany() + // for (const r of roles) { + // const current: Record = (r.permissions as any) || {} + // const merged = { ...permsMap, ...current } - // If role name is admin (case-insensitive), set all permissions to true - if (r.name && r.name.toLowerCase() === 'admin') { - for (const key of Object.keys(merged)) merged[key] = true - } else { - // keep existing truthy values, otherwise false - for (const key of Object.keys(merged)) merged[key] = merged[key] || false - } + // // If role name is admin (case-insensitive), set all permissions to true + // if (r.name && r.name.toLowerCase() === 'admin') { + // for (const key of Object.keys(merged)) merged[key] = true + // } else { + // // keep existing truthy values, otherwise false + // for (const key of Object.keys(merged)) merged[key] = merged[key] || false + // } - await prisma.role.update({ where: { id: r.id }, data: { permissions: merged } }) - console.log( - `Updated role ${r.name} (id=${r.id}) with ${Object.keys(merged).length} permissions`, - ) - } + // await prisma.role.update({ where: { id: r.id }, data: { permissions: merged } }) + // console.log( + // `Updated role ${r.name} (id=${r.id}) with ${Object.keys(merged).length} permissions`, + // ) + // } await prisma.$disconnect() } diff --git a/src/app.module.ts b/src/app.module.ts index af6bd20..2b48b7e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -2,24 +2,36 @@ import { Module } from '@nestjs/common' import { AppController } from './app.controller' import { AppService } from './app.service' import { AuthModule } from './modules/auth/auth.module' +import { ConfigModule } from './modules/config/config.module' import { CustomersModule } from './modules/customers/customers.module' -import { ProductCategoriesModule } from './modules/product-categories/product-categories.module' -import { ProductsModule } from './modules/products/products.module' +import { GoodCategoriesModule } from './modules/good-categories/good-categories.module' +import { GoodsModule } from './modules/goods/goods.module' +import { ProfileModule } from './modules/profile/profile.module' +import { SalesInvoiceItemsModule } from './modules/sales-invoice-items/sales-invoice-items.module' +import { SalesInvoicePaymentsModule } from './modules/sales-invoice-payments/sales-invoice-payments.module' import { SalesInvoicesModule } from './modules/sales-invoices/sales-invoices.module' -import { StatisticsModule } from './modules/statistics/statistics.module' -import { UploadsModule } from './modules/uploads/uploads.module' +import { ServiceCategoriesModule } from './modules/service-categories/service-categories.module' +import { ServicesModule } from './modules/services/services.module' +import { TriggerLogsModule } from './modules/trigger-logs/trigger-logs.module' +import { UploadersModule } from './modules/uploaders/uploaders.module' import { PrismaModule } from './prisma/prisma.module' @Module({ imports: [ PrismaModule, AuthModule, - ProductsModule, - ProductCategoriesModule, CustomersModule, + GoodCategoriesModule, + GoodsModule, + SalesInvoiceItemsModule, + SalesInvoicePaymentsModule, SalesInvoicesModule, - StatisticsModule, - UploadsModule, + ServiceCategoriesModule, + ServicesModule, + TriggerLogsModule, + UploadersModule, + ConfigModule, + ProfileModule, ], controllers: [AppController], providers: [AppService], diff --git a/src/common/decorators/public.decorator.ts b/src/common/decorators/public.decorator.ts new file mode 100644 index 0000000..91c2399 --- /dev/null +++ b/src/common/decorators/public.decorator.ts @@ -0,0 +1,4 @@ +import { SetMetadata } from '@nestjs/common' + +export const IS_PUBLIC_KEY = 'isPublic' +export const Public = () => SetMetadata(IS_PUBLIC_KEY, true) diff --git a/src/common/enums/enums.ts b/src/common/enums/enums.ts new file mode 100644 index 0000000..122728c --- /dev/null +++ b/src/common/enums/enums.ts @@ -0,0 +1,12 @@ +export enum TokenType { + ACCESS, + REFRESH, +} + +export enum AccountType { + PARTNER, + BUSINESS, + ADMIN, + PROVIDER, + POS, +} diff --git a/src/common/models/token-model.ts b/src/common/models/token-model.ts new file mode 100644 index 0000000..0eb17e6 --- /dev/null +++ b/src/common/models/token-model.ts @@ -0,0 +1,29 @@ +import { Request as ExpressRequest } from 'express' +import { AccountType } from '../enums/enums' + +export interface IWithJWTPayloadRequest extends ExpressRequest { + dataPayload?: AccessTokenPayload +} + +export interface AccessTokenPayload { + userId: string + mobile_number: string + type: AccountType + username: string + pos_id: number + pos_name: string + + complex_id: string + license_id: string + license_expired_at: string + // complex: { + // id: string + // name: string + // } + // license: { + // id: string + // starts_at: string + // expires_at: string + // status: string + // } +} diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index e3dd5a1..fcc41e4 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -17,6 +17,16 @@ import * as Prisma from './internal/prismaNamespaceBrowser.js' export { Prisma } export * as $Enums from './enums.js' export * from './enums.js'; +/** + * Model Customer + * + */ +export type Customer = Prisma.CustomerModel +/** + * Model Device + * + */ +export type Device = Prisma.DeviceModel /** * Model Good * @@ -27,11 +37,6 @@ export type Good = Prisma.GoodModel * */ export type GoodCategory = Prisma.GoodCategoryModel -/** - * Model Customer - * - */ -export type Customer = Prisma.CustomerModel /** * Model TriggerLog * diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index 6c3eb6e..4624c03 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -27,8 +27,8 @@ export * from "./enums.js" * @example * ``` * const prisma = new PrismaClient() - * // Fetch zero or more Goods - * const goods = await prisma.good.findMany() + * // Fetch zero or more Customers + * const customers = await prisma.customer.findMany() * ``` * * Read more in our [docs](https://pris.ly/d/client). @@ -37,6 +37,16 @@ export const PrismaClient = $Class.getPrismaClientClass() export type PrismaClient = $Class.PrismaClient export { Prisma } +/** + * Model Customer + * + */ +export type Customer = Prisma.CustomerModel +/** + * Model Device + * + */ +export type Device = Prisma.DeviceModel /** * Model Good * @@ -47,11 +57,6 @@ export type Good = Prisma.GoodModel * */ export type GoodCategory = Prisma.GoodCategoryModel -/** - * Model Customer - * - */ -export type Customer = Prisma.CustomerModel /** * Model TriggerLog * diff --git a/src/generated/prisma/commonInputTypes.ts b/src/generated/prisma/commonInputTypes.ts index a8cde4d..6dfd860 100644 --- a/src/generated/prisma/commonInputTypes.ts +++ b/src/generated/prisma/commonInputTypes.ts @@ -14,17 +14,6 @@ import * as $Enums from "./enums.js" import type * as Prisma from "./internal/prismaNamespace.js" -export type IntFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntFilter<$PrismaModel> | number -} - export type StringFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> in?: string[] @@ -55,6 +44,11 @@ export type StringNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null } +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + export type DateTimeFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -77,49 +71,11 @@ export type DateTimeNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } -export type IntNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null -} - -export type DecimalFilter<$PrismaModel = never> = { - equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string -} - export type SortOrderInput = { sort: Prisma.SortOrder nulls?: Prisma.NullsOrder } -export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedFloatFilter<$PrismaModel> - _sum?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedIntFilter<$PrismaModel> - _max?: Prisma.NestedIntFilter<$PrismaModel> -} - export type StringWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> in?: string[] @@ -156,6 +112,14 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedStringNullableFilter<$PrismaModel> } +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -184,20 +148,15 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> } -export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> - _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedIntNullableFilter<$PrismaModel> - _max?: Prisma.NestedIntNullableFilter<$PrismaModel> +export type DecimalFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string } export type DecimalWithAggregatesFilter<$PrismaModel = never> = { @@ -216,17 +175,31 @@ export type DecimalWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDecimalFilter<$PrismaModel> } -export type BoolFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number } -export type BoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedBoolFilter<$PrismaModel> - _max?: Prisma.NestedBoolFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> } export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = { @@ -246,17 +219,6 @@ export type EnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> } -export type NestedIntFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntFilter<$PrismaModel> | number -} - export type NestedStringFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> in?: string[] @@ -287,6 +249,11 @@ export type NestedStringNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null } +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + export type NestedDateTimeFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -309,55 +276,6 @@ export type NestedDateTimeNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } -export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null -} - -export type NestedDecimalFilter<$PrismaModel = never> = { - equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string -} - -export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedFloatFilter<$PrismaModel> - _sum?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedIntFilter<$PrismaModel> - _max?: Prisma.NestedIntFilter<$PrismaModel> -} - -export type NestedFloatFilter<$PrismaModel = never> = { - equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - not?: Prisma.NestedFloatFilter<$PrismaModel> | number -} - export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> in?: string[] @@ -376,6 +294,17 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedStringFilter<$PrismaModel> } +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null in?: string[] | null @@ -394,6 +323,25 @@ export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedStringNullableFilter<$PrismaModel> } +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -422,31 +370,15 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> } -export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> - _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedIntNullableFilter<$PrismaModel> - _max?: Prisma.NestedIntNullableFilter<$PrismaModel> -} - -export type NestedFloatNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null +export type NestedDecimalFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string } export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { @@ -465,17 +397,31 @@ export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDecimalFilter<$PrismaModel> } -export type NestedBoolFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> } -export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedBoolFilter<$PrismaModel> - _max?: Prisma.NestedBoolFilter<$PrismaModel> +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatFilter<$PrismaModel> | number } export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = { diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index b942944..aa257fb 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -22,7 +22,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.2.0", "engineVersion": "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3", "activeProvider": "mysql", - "inlineSchema": "enum PaymentMethodType {\n CASH\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum PurchaseReceiptStatus {\n UNPAID\n PARTIALLY_PAID\n PAID\n}\n\nmodel Good {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @db.VarChar(100)\n localSku String @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n categoryId Int?\n baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0)\n category GoodCategory? @relation(fields: [categoryId], references: [id])\n salesInvoiceItems SalesInvoiceItem[]\n\n @@index([categoryId])\n @@map(\"Goods\")\n}\n\nmodel GoodCategory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n goods Good[]\n\n @@map(\"Good_categories\")\n}\n\nmodel Customer {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n salesInvoices SalesInvoice[]\n\n @@map(\"Customers\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"Trigger_Logs\")\n}\n\nmodel SalesInvoice {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n totalAmount Decimal @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n customerId Int?\n customer Customer? @relation(fields: [customerId], references: [id])\n items SalesInvoiceItem[]\n salesInvoicePayments SalesInvoicePayment[]\n\n @@index([customerId])\n @@map(\"Sales_Invoices\")\n}\n\nmodel SalesInvoiceItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n unitPrice Decimal @default(0.00) @db.Decimal(15, 2)\n totalAmount Decimal @default(0.00) @db.Decimal(15, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n invoiceId Int\n goodId Int\n serviceId Int\n invoice SalesInvoice @relation(fields: [invoiceId], references: [id])\n good Good? @relation(fields: [goodId], references: [id])\n service Service? @relation(fields: [serviceId], references: [id])\n\n @@index([invoiceId, goodId])\n @@map(\"Sales_Invoice_Items\")\n}\n\nmodel SalesInvoicePayment {\n id Int @id @default(autoincrement())\n invoiceId Int\n amount Decimal @db.Decimal(15, 2)\n paymentMethod PaymentMethodType\n paidAt DateTime\n createdAt DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoiceId], references: [id])\n\n @@index([invoiceId])\n @@map(\"Sales_Invoice_Payments\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel Service {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n categoryId Int?\n baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0)\n category ServiceCategory? @relation(fields: [categoryId], references: [id])\n salesInvoiceItems SalesInvoiceItem[]\n\n @@index([categoryId])\n @@map(\"Services\")\n}\n\nmodel ServiceCategory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n services Service[]\n\n @@map(\"Service_categories\")\n}\n", + "inlineSchema": "model Customer {\n id String @id @default(uuid())\n first_name String @db.VarChar(255)\n last_name String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobile_number String @unique @db.Char(11)\n address String? @db.Text\n is_active Boolean @default(true)\n account_id String\n complex_id String\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n sales_invoices SalesInvoice[]\n\n @@map(\"customers\")\n}\n\nmodel Device {\n account_id String? @db.VarChar(255)\n app_version String @db.VarChar(20)\n build_number String @db.VarChar(20)\n\n uuid String @id @unique() @db.VarChar(255)\n platform String @db.VarChar(100)\n brand String @db.VarChar(100)\n model String @db.VarChar(100)\n device String @db.VarChar(100)\n os_version String @db.VarChar(20)\n sdk_version String @db.VarChar(20)\n release_number String @db.VarChar(20)\n browser_name String? @db.VarChar(100)\n fcm_token String? @db.VarChar(100)\n\n @@map(\"devices\")\n}\n\nenum PaymentMethodType {\n CASH\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum PurchaseReceiptStatus {\n UNPAID\n PARTIALLY_PAID\n PAID\n}\n\nmodel Good {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category GoodCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"goods\")\n}\n\nmodel GoodCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n goods Good[]\n\n @@map(\"good_categories\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"trigger_logs\")\n}\n\nmodel SalesInvoice {\n id String @id @default(uuid())\n code String @unique @db.VarChar(100)\n total_amount Decimal @db.Decimal(15, 2)\n description String? @db.Text\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n customer_id String?\n account_id String\n complex_id String\n\n customer Customer? @relation(fields: [customer_id], references: [id])\n items SalesInvoiceItem[]\n sales_invoice_payments SalesInvoicePayment[]\n\n @@index([customer_id])\n @@map(\"sales_invoices\")\n}\n\nmodel SalesInvoiceItem {\n id String @id @default(uuid())\n count Decimal @db.Decimal(10, 0)\n unit_price Decimal @default(0.00) @db.Decimal(15, 2)\n total_amount Decimal @default(0.00) @db.Decimal(15, 2)\n created_at DateTime @default(now()) @db.Timestamp(0)\n invoice_id String\n good_id String\n service_id String\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n good Good? @relation(fields: [good_id], references: [id])\n service Service? @relation(fields: [service_id], references: [id])\n\n @@index([invoice_id, good_id])\n @@map(\"sales_invoice_items\")\n}\n\nmodel SalesInvoicePayment {\n id String @id @default(uuid())\n invoice_id String\n amount Decimal @db.Decimal(15, 2)\n payment_method PaymentMethodType\n paid_at DateTime\n created_at DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n\n @@index([invoice_id])\n @@map(\"Sales_Invoice_Payments\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel Service {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @unique() @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category ServiceCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"services\")\n}\n\nmodel ServiceCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n services Service[]\n\n @@map(\"service_categories\")\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -30,7 +30,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"Good\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"localSku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"baseSalePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"salesInvoiceItems\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"GoodToSalesInvoiceItem\"}],\"dbName\":\"Goods\"},\"GoodCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGoodCategory\"}],\"dbName\":\"Good_categories\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"}],\"dbName\":\"Customers\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"Trigger_Logs\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"salesInvoicePayments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoiceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"goodId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"serviceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"good\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToSalesInvoiceItem\"},{\"name\":\"service\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"Sales_Invoice_Items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"invoiceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paidAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoice_Payments\"},\"Service\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"baseSalePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ServiceCategory\",\"relationName\":\"ServiceToServiceCategory\"},{\"name\":\"salesInvoiceItems\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"Services\"},\"ServiceCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"services\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"ServiceToServiceCategory\"}],\"dbName\":\"Service_categories\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobile_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_active\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sales_invoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"}],\"dbName\":\"customers\"},\"Device\":{\"fields\":[{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"app_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"build_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"uuid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"platform\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sdk_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"release_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"browser_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fcm_token\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"devices\"},\"Good\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"GoodToSalesInvoiceItem\"}],\"dbName\":\"goods\"},\"GoodCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGoodCategory\"}],\"dbName\":\"good_categories\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"trigger_logs\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"sales_invoice_payments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unit_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"good_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"service_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"good\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToSalesInvoiceItem\"},{\"name\":\"service\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"sales_invoice_items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"payment_method\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paid_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoice_Payments\"},\"Service\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ServiceCategory\",\"relationName\":\"ServiceToServiceCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"services\"},\"ServiceCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"services\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"ServiceToServiceCategory\"}],\"dbName\":\"service_categories\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -60,8 +60,8 @@ export interface PrismaClientConstructor { * @example * ``` * const prisma = new PrismaClient() - * // Fetch zero or more Goods - * const goods = await prisma.good.findMany() + * // Fetch zero or more Customers + * const customers = await prisma.customer.findMany() * ``` * * Read more in our [docs](https://pris.ly/d/client). @@ -82,8 +82,8 @@ export interface PrismaClientConstructor { * @example * ``` * const prisma = new PrismaClient() - * // Fetch zero or more Goods - * const goods = await prisma.good.findMany() + * // Fetch zero or more Customers + * const customers = await prisma.customer.findMany() * ``` * * Read more in our [docs](https://pris.ly/d/client). @@ -177,6 +177,26 @@ export interface PrismaClient< }>> /** + * `prisma.customer`: Exposes CRUD operations for the **Customer** model. + * Example usage: + * ```ts + * // Fetch zero or more Customers + * const customers = await prisma.customer.findMany() + * ``` + */ + get customer(): Prisma.CustomerDelegate; + + /** + * `prisma.device`: Exposes CRUD operations for the **Device** model. + * Example usage: + * ```ts + * // Fetch zero or more Devices + * const devices = await prisma.device.findMany() + * ``` + */ + get device(): Prisma.DeviceDelegate; + + /** * `prisma.good`: Exposes CRUD operations for the **Good** model. * Example usage: * ```ts @@ -196,16 +216,6 @@ export interface PrismaClient< */ get goodCategory(): Prisma.GoodCategoryDelegate; - /** - * `prisma.customer`: Exposes CRUD operations for the **Customer** model. - * Example usage: - * ```ts - * // Fetch zero or more Customers - * const customers = await prisma.customer.findMany() - * ``` - */ - get customer(): Prisma.CustomerDelegate; - /** * `prisma.triggerLog`: Exposes CRUD operations for the **TriggerLog** model. * Example usage: diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index f05a271..0d90b04 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -384,9 +384,10 @@ type FieldRefInputType = Model extends never ? never : FieldRe export const ModelName = { + Customer: 'Customer', + Device: 'Device', Good: 'Good', GoodCategory: 'GoodCategory', - Customer: 'Customer', TriggerLog: 'TriggerLog', SalesInvoice: 'SalesInvoice', SalesInvoiceItem: 'SalesInvoiceItem', @@ -408,10 +409,142 @@ export type TypeMap + fields: Prisma.CustomerFieldRefs + operations: { + findUnique: { + args: Prisma.CustomerFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.CustomerFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.CustomerFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.CustomerFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.CustomerFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.CustomerCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.CustomerCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.CustomerDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.CustomerUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.CustomerDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.CustomerUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.CustomerUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.CustomerAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.CustomerGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.CustomerCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Device: { + payload: Prisma.$DevicePayload + fields: Prisma.DeviceFieldRefs + operations: { + findUnique: { + args: Prisma.DeviceFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.DeviceFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.DeviceFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.DeviceFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.DeviceFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.DeviceCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.DeviceCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.DeviceDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.DeviceUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.DeviceDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.DeviceUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.DeviceUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.DeviceAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.DeviceGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.DeviceCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } Good: { payload: Prisma.$GoodPayload fields: Prisma.GoodFieldRefs @@ -544,72 +677,6 @@ export type TypeMap - fields: Prisma.CustomerFieldRefs - operations: { - findUnique: { - args: Prisma.CustomerFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.CustomerFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.CustomerFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.CustomerFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.CustomerFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.CustomerCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.CustomerCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.CustomerDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.CustomerUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.CustomerDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.CustomerUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.CustomerUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.CustomerAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.CustomerGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.CustomerCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } TriggerLog: { payload: Prisma.$TriggerLogPayload fields: Prisma.TriggerLogFieldRefs @@ -1045,18 +1112,57 @@ export const TransactionIsolationLevel = runtime.makeStrictEnum({ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] +export const CustomerScalarFieldEnum = { + id: 'id', + first_name: 'first_name', + last_name: 'last_name', + email: 'email', + mobile_number: 'mobile_number', + address: 'address', + is_active: 'is_active', + account_id: 'account_id', + complex_id: 'complex_id', + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at' +} as const + +export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum] + + +export const DeviceScalarFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type DeviceScalarFieldEnum = (typeof DeviceScalarFieldEnum)[keyof typeof DeviceScalarFieldEnum] + + export const GoodScalarFieldEnum = { id: 'id', name: 'name', description: 'description', sku: 'sku', - localSku: 'localSku', + local_sku: 'local_sku', barcode: 'barcode', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt', - categoryId: 'categoryId', - baseSalePrice: 'baseSalePrice' + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at', + category_id: 'category_id', + base_sale_price: 'base_sale_price', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum] @@ -1066,31 +1172,17 @@ export const GoodCategoryScalarFieldEnum = { id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id', + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at' } as const export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum] -export const CustomerScalarFieldEnum = { - id: 'id', - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address', - isActive: 'isActive', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' -} as const - -export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum] - - export const TriggerLogScalarFieldEnum = { id: 'id', message: 'message', @@ -1104,11 +1196,13 @@ export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof export const SalesInvoiceScalarFieldEnum = { id: 'id', code: 'code', - totalAmount: 'totalAmount', + total_amount: 'total_amount', description: 'description', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - customerId: 'customerId' + created_at: 'created_at', + updated_at: 'updated_at', + customer_id: 'customer_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] @@ -1117,12 +1211,12 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k export const SalesInvoiceItemScalarFieldEnum = { id: 'id', count: 'count', - unitPrice: 'unitPrice', - totalAmount: 'totalAmount', - createdAt: 'createdAt', - invoiceId: 'invoiceId', - goodId: 'goodId', - serviceId: 'serviceId' + unit_price: 'unit_price', + total_amount: 'total_amount', + created_at: 'created_at', + invoice_id: 'invoice_id', + good_id: 'good_id', + service_id: 'service_id' } as const export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum] @@ -1130,11 +1224,11 @@ export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFiel export const SalesInvoicePaymentScalarFieldEnum = { id: 'id', - invoiceId: 'invoiceId', + invoice_id: 'invoice_id', amount: 'amount', - paymentMethod: 'paymentMethod', - paidAt: 'paidAt', - createdAt: 'createdAt' + payment_method: 'payment_method', + paid_at: 'paid_at', + created_at: 'created_at' } as const export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum] @@ -1145,12 +1239,15 @@ export const ServiceScalarFieldEnum = { name: 'name', description: 'description', sku: 'sku', + local_sku: 'local_sku', barcode: 'barcode', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt', - categoryId: 'categoryId', - baseSalePrice: 'baseSalePrice' + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at', + category_id: 'category_id', + base_sale_price: 'base_sale_price', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type ServiceScalarFieldEnum = (typeof ServiceScalarFieldEnum)[keyof typeof ServiceScalarFieldEnum] @@ -1160,10 +1257,12 @@ export const ServiceCategoryScalarFieldEnum = { id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id', + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at' } as const export type ServiceCategoryScalarFieldEnum = (typeof ServiceCategoryScalarFieldEnum)[keyof typeof ServiceCategoryScalarFieldEnum] @@ -1185,37 +1284,66 @@ export const NullsOrder = { export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] +export const CustomerOrderByRelevanceFieldEnum = { + id: 'id', + first_name: 'first_name', + last_name: 'last_name', + email: 'email', + mobile_number: 'mobile_number', + address: 'address', + account_id: 'account_id', + complex_id: 'complex_id' +} as const + +export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum] + + +export const DeviceOrderByRelevanceFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFieldEnum)[keyof typeof DeviceOrderByRelevanceFieldEnum] + + export const GoodOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', sku: 'sku', - localSku: 'localSku', - barcode: 'barcode' + local_sku: 'local_sku', + barcode: 'barcode', + category_id: 'category_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum] export const GoodCategoryOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum] -export const CustomerOrderByRelevanceFieldEnum = { - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address' -} as const - -export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum] - - export const TriggerLogOrderByRelevanceFieldEnum = { message: 'message', name: 'name' @@ -1225,27 +1353,57 @@ export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelev export const SalesInvoiceOrderByRelevanceFieldEnum = { + id: 'id', code: 'code', - description: 'description' + description: 'description', + customer_id: 'customer_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] +export const SalesInvoiceItemOrderByRelevanceFieldEnum = { + id: 'id', + invoice_id: 'invoice_id', + good_id: 'good_id', + service_id: 'service_id' +} as const + +export type SalesInvoiceItemOrderByRelevanceFieldEnum = (typeof SalesInvoiceItemOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceItemOrderByRelevanceFieldEnum] + + +export const SalesInvoicePaymentOrderByRelevanceFieldEnum = { + id: 'id', + invoice_id: 'invoice_id' +} as const + +export type SalesInvoicePaymentOrderByRelevanceFieldEnum = (typeof SalesInvoicePaymentOrderByRelevanceFieldEnum)[keyof typeof SalesInvoicePaymentOrderByRelevanceFieldEnum] + + export const ServiceOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', sku: 'sku', - barcode: 'barcode' + local_sku: 'local_sku', + barcode: 'barcode', + category_id: 'category_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type ServiceOrderByRelevanceFieldEnum = (typeof ServiceOrderByRelevanceFieldEnum)[keyof typeof ServiceOrderByRelevanceFieldEnum] export const ServiceCategoryOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type ServiceCategoryOrderByRelevanceFieldEnum = (typeof ServiceCategoryOrderByRelevanceFieldEnum)[keyof typeof ServiceCategoryOrderByRelevanceFieldEnum] @@ -1258,16 +1416,16 @@ export type ServiceCategoryOrderByRelevanceFieldEnum = (typeof ServiceCategoryOr /** - * Reference to a field of type 'Int' + * Reference to a field of type 'String' */ -export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> /** - * Reference to a field of type 'String' + * Reference to a field of type 'Boolean' */ -export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> @@ -1286,9 +1444,9 @@ export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, /** - * Reference to a field of type 'Boolean' + * Reference to a field of type 'Int' */ -export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> @@ -1400,9 +1558,10 @@ export type PrismaClientOptions = ({ comments?: runtime.SqlCommenterPlugin[] } export type GlobalOmitConfig = { + customer?: Prisma.CustomerOmit + device?: Prisma.DeviceOmit good?: Prisma.GoodOmit goodCategory?: Prisma.GoodCategoryOmit - customer?: Prisma.CustomerOmit triggerLog?: Prisma.TriggerLogOmit salesInvoice?: Prisma.SalesInvoiceOmit salesInvoiceItem?: Prisma.SalesInvoiceItemOmit diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index 3335cfa..1cca3b3 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -51,9 +51,10 @@ export const AnyNull = runtime.AnyNull export const ModelName = { + Customer: 'Customer', + Device: 'Device', Good: 'Good', GoodCategory: 'GoodCategory', - Customer: 'Customer', TriggerLog: 'TriggerLog', SalesInvoice: 'SalesInvoice', SalesInvoiceItem: 'SalesInvoiceItem', @@ -78,18 +79,57 @@ export const TransactionIsolationLevel = { export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] +export const CustomerScalarFieldEnum = { + id: 'id', + first_name: 'first_name', + last_name: 'last_name', + email: 'email', + mobile_number: 'mobile_number', + address: 'address', + is_active: 'is_active', + account_id: 'account_id', + complex_id: 'complex_id', + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at' +} as const + +export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum] + + +export const DeviceScalarFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type DeviceScalarFieldEnum = (typeof DeviceScalarFieldEnum)[keyof typeof DeviceScalarFieldEnum] + + export const GoodScalarFieldEnum = { id: 'id', name: 'name', description: 'description', sku: 'sku', - localSku: 'localSku', + local_sku: 'local_sku', barcode: 'barcode', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt', - categoryId: 'categoryId', - baseSalePrice: 'baseSalePrice' + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at', + category_id: 'category_id', + base_sale_price: 'base_sale_price', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum] @@ -99,31 +139,17 @@ export const GoodCategoryScalarFieldEnum = { id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id', + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at' } as const export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum] -export const CustomerScalarFieldEnum = { - id: 'id', - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address', - isActive: 'isActive', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' -} as const - -export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum] - - export const TriggerLogScalarFieldEnum = { id: 'id', message: 'message', @@ -137,11 +163,13 @@ export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof export const SalesInvoiceScalarFieldEnum = { id: 'id', code: 'code', - totalAmount: 'totalAmount', + total_amount: 'total_amount', description: 'description', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - customerId: 'customerId' + created_at: 'created_at', + updated_at: 'updated_at', + customer_id: 'customer_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] @@ -150,12 +178,12 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k export const SalesInvoiceItemScalarFieldEnum = { id: 'id', count: 'count', - unitPrice: 'unitPrice', - totalAmount: 'totalAmount', - createdAt: 'createdAt', - invoiceId: 'invoiceId', - goodId: 'goodId', - serviceId: 'serviceId' + unit_price: 'unit_price', + total_amount: 'total_amount', + created_at: 'created_at', + invoice_id: 'invoice_id', + good_id: 'good_id', + service_id: 'service_id' } as const export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum] @@ -163,11 +191,11 @@ export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFiel export const SalesInvoicePaymentScalarFieldEnum = { id: 'id', - invoiceId: 'invoiceId', + invoice_id: 'invoice_id', amount: 'amount', - paymentMethod: 'paymentMethod', - paidAt: 'paidAt', - createdAt: 'createdAt' + payment_method: 'payment_method', + paid_at: 'paid_at', + created_at: 'created_at' } as const export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum] @@ -178,12 +206,15 @@ export const ServiceScalarFieldEnum = { name: 'name', description: 'description', sku: 'sku', + local_sku: 'local_sku', barcode: 'barcode', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt', - categoryId: 'categoryId', - baseSalePrice: 'baseSalePrice' + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at', + category_id: 'category_id', + base_sale_price: 'base_sale_price', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type ServiceScalarFieldEnum = (typeof ServiceScalarFieldEnum)[keyof typeof ServiceScalarFieldEnum] @@ -193,10 +224,12 @@ export const ServiceCategoryScalarFieldEnum = { id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id', + created_at: 'created_at', + updated_at: 'updated_at', + deleted_at: 'deleted_at' } as const export type ServiceCategoryScalarFieldEnum = (typeof ServiceCategoryScalarFieldEnum)[keyof typeof ServiceCategoryScalarFieldEnum] @@ -218,37 +251,66 @@ export const NullsOrder = { export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] +export const CustomerOrderByRelevanceFieldEnum = { + id: 'id', + first_name: 'first_name', + last_name: 'last_name', + email: 'email', + mobile_number: 'mobile_number', + address: 'address', + account_id: 'account_id', + complex_id: 'complex_id' +} as const + +export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum] + + +export const DeviceOrderByRelevanceFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFieldEnum)[keyof typeof DeviceOrderByRelevanceFieldEnum] + + export const GoodOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', sku: 'sku', - localSku: 'localSku', - barcode: 'barcode' + local_sku: 'local_sku', + barcode: 'barcode', + category_id: 'category_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum] export const GoodCategoryOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum] -export const CustomerOrderByRelevanceFieldEnum = { - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address' -} as const - -export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum] - - export const TriggerLogOrderByRelevanceFieldEnum = { message: 'message', name: 'name' @@ -258,27 +320,57 @@ export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelev export const SalesInvoiceOrderByRelevanceFieldEnum = { + id: 'id', code: 'code', - description: 'description' + description: 'description', + customer_id: 'customer_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] +export const SalesInvoiceItemOrderByRelevanceFieldEnum = { + id: 'id', + invoice_id: 'invoice_id', + good_id: 'good_id', + service_id: 'service_id' +} as const + +export type SalesInvoiceItemOrderByRelevanceFieldEnum = (typeof SalesInvoiceItemOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceItemOrderByRelevanceFieldEnum] + + +export const SalesInvoicePaymentOrderByRelevanceFieldEnum = { + id: 'id', + invoice_id: 'invoice_id' +} as const + +export type SalesInvoicePaymentOrderByRelevanceFieldEnum = (typeof SalesInvoicePaymentOrderByRelevanceFieldEnum)[keyof typeof SalesInvoicePaymentOrderByRelevanceFieldEnum] + + export const ServiceOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', sku: 'sku', - barcode: 'barcode' + local_sku: 'local_sku', + barcode: 'barcode', + category_id: 'category_id', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type ServiceOrderByRelevanceFieldEnum = (typeof ServiceOrderByRelevanceFieldEnum)[keyof typeof ServiceOrderByRelevanceFieldEnum] export const ServiceCategoryOrderByRelevanceFieldEnum = { + id: 'id', name: 'name', description: 'description', - imageUrl: 'imageUrl' + image_url: 'image_url', + account_id: 'account_id', + complex_id: 'complex_id' } as const export type ServiceCategoryOrderByRelevanceFieldEnum = (typeof ServiceCategoryOrderByRelevanceFieldEnum)[keyof typeof ServiceCategoryOrderByRelevanceFieldEnum] diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index 9268e0f..43db37b 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -8,9 +8,10 @@ * * 🟢 You can import this file directly. */ +export type * from './models/Customer.js' +export type * from './models/Device.js' export type * from './models/Good.js' export type * from './models/GoodCategory.js' -export type * from './models/Customer.js' export type * from './models/TriggerLog.js' export type * from './models/SalesInvoice.js' export type * from './models/SalesInvoiceItem.js' diff --git a/src/generated/prisma/models/Customer.ts b/src/generated/prisma/models/Customer.ts index 01d1faa..26ee875 100644 --- a/src/generated/prisma/models/Customer.ts +++ b/src/generated/prisma/models/Customer.ts @@ -20,106 +20,100 @@ export type CustomerModel = runtime.Types.Result.DefaultSelection | number - firstName?: Prisma.StringFilter<"Customer"> | string - lastName?: Prisma.StringFilter<"Customer"> | string + id?: Prisma.StringFilter<"Customer"> | string + first_name?: Prisma.StringFilter<"Customer"> | string + last_name?: Prisma.StringFilter<"Customer"> | string email?: Prisma.StringNullableFilter<"Customer"> | string | null - mobileNumber?: Prisma.StringFilter<"Customer"> | string + mobile_number?: Prisma.StringFilter<"Customer"> | string address?: Prisma.StringNullableFilter<"Customer"> | string | null - isActive?: Prisma.BoolFilter<"Customer"> | boolean - createdAt?: Prisma.DateTimeFilter<"Customer"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Customer"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null - salesInvoices?: Prisma.SalesInvoiceListRelationFilter + is_active?: Prisma.BoolFilter<"Customer"> | boolean + account_id?: Prisma.StringFilter<"Customer"> | string + complex_id?: Prisma.StringFilter<"Customer"> | string + created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null + sales_invoices?: Prisma.SalesInvoiceListRelationFilter } export type CustomerOrderByWithRelationInput = { id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder email?: Prisma.SortOrderInput | Prisma.SortOrder - mobileNumber?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder address?: Prisma.SortOrderInput | Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput + is_active?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput _relevance?: Prisma.CustomerOrderByRelevanceInput } export type CustomerWhereUniqueInput = Prisma.AtLeast<{ - id?: number - mobileNumber?: string + id?: string + mobile_number?: string AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] OR?: Prisma.CustomerWhereInput[] NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] - firstName?: Prisma.StringFilter<"Customer"> | string - lastName?: Prisma.StringFilter<"Customer"> | string + first_name?: Prisma.StringFilter<"Customer"> | string + last_name?: Prisma.StringFilter<"Customer"> | string email?: Prisma.StringNullableFilter<"Customer"> | string | null address?: Prisma.StringNullableFilter<"Customer"> | string | null - isActive?: Prisma.BoolFilter<"Customer"> | boolean - createdAt?: Prisma.DateTimeFilter<"Customer"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Customer"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null - salesInvoices?: Prisma.SalesInvoiceListRelationFilter -}, "id" | "mobileNumber"> + is_active?: Prisma.BoolFilter<"Customer"> | boolean + account_id?: Prisma.StringFilter<"Customer"> | string + complex_id?: Prisma.StringFilter<"Customer"> | string + created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null + sales_invoices?: Prisma.SalesInvoiceListRelationFilter +}, "id" | "mobile_number"> export type CustomerOrderByWithAggregationInput = { id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder email?: Prisma.SortOrderInput | Prisma.SortOrder - mobileNumber?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder address?: Prisma.SortOrderInput | Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + is_active?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.CustomerCountOrderByAggregateInput - _avg?: Prisma.CustomerAvgOrderByAggregateInput _max?: Prisma.CustomerMaxOrderByAggregateInput _min?: Prisma.CustomerMinOrderByAggregateInput - _sum?: Prisma.CustomerSumOrderByAggregateInput } export type CustomerScalarWhereWithAggregatesInput = { AND?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[] OR?: Prisma.CustomerScalarWhereWithAggregatesInput[] NOT?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"Customer"> | number - firstName?: Prisma.StringWithAggregatesFilter<"Customer"> | string - lastName?: Prisma.StringWithAggregatesFilter<"Customer"> | string + id?: Prisma.StringWithAggregatesFilter<"Customer"> | string + first_name?: Prisma.StringWithAggregatesFilter<"Customer"> | string + last_name?: Prisma.StringWithAggregatesFilter<"Customer"> | string email?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null - mobileNumber?: Prisma.StringWithAggregatesFilter<"Customer"> | string + mobile_number?: Prisma.StringWithAggregatesFilter<"Customer"> | string address?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null - isActive?: Prisma.BoolWithAggregatesFilter<"Customer"> | boolean - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string - deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null + is_active?: Prisma.BoolWithAggregatesFilter<"Customer"> | boolean + account_id?: Prisma.StringWithAggregatesFilter<"Customer"> | string + complex_id?: Prisma.StringWithAggregatesFilter<"Customer"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string + deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null } export type CustomerCreateInput = { - firstName: string - lastName: string + id?: string + first_name: string + last_name: string email?: string | null - mobileNumber: string + mobile_number: string address?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput + is_active?: boolean + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateInput = { - id?: number - firstName: string - lastName: string + id?: string + first_name: string + last_name: string email?: string | null - mobileNumber: string + mobile_number: string address?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput + is_active?: boolean + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerUpdateInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput + is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput + is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput } export type CustomerCreateManyInput = { - id?: number - firstName: string - lastName: string + id?: string + first_name: string + last_name: string email?: string | null - mobileNumber: string + mobile_number: string address?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + is_active?: boolean + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type CustomerUpdateManyMutationInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type CustomerUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type CustomerOrderByRelevanceInput = { @@ -425,49 +430,47 @@ export type CustomerOrderByRelevanceInput = { export type CustomerCountOrderByAggregateInput = { id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder email?: Prisma.SortOrder - mobileNumber?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder address?: Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type CustomerAvgOrderByAggregateInput = { - id?: Prisma.SortOrder + is_active?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type CustomerMaxOrderByAggregateInput = { id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder email?: Prisma.SortOrder - mobileNumber?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder address?: Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder + is_active?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type CustomerMinOrderByAggregateInput = { id?: Prisma.SortOrder - firstName?: Prisma.SortOrder - lastName?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder email?: Prisma.SortOrder - mobileNumber?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder address?: Prisma.SortOrder - isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type CustomerSumOrderByAggregateInput = { - id?: Prisma.SortOrder + is_active?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type CustomerNullableScalarRelationFilter = { @@ -475,90 +478,116 @@ export type CustomerNullableScalarRelationFilter = { isNot?: Prisma.CustomerWhereInput | null } +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + export type BoolFieldUpdateOperationsInput = { set?: boolean } -export type CustomerCreateNestedOneWithoutSalesInvoicesInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSalesInvoicesInput +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null +} + +export type CustomerCreateNestedOneWithoutSales_invoicesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSales_invoicesInput connect?: Prisma.CustomerWhereUniqueInput } -export type CustomerUpdateOneWithoutSalesInvoicesNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSalesInvoicesInput - upsert?: Prisma.CustomerUpsertWithoutSalesInvoicesInput +export type CustomerUpdateOneWithoutSales_invoicesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSales_invoicesInput + upsert?: Prisma.CustomerUpsertWithoutSales_invoicesInput disconnect?: Prisma.CustomerWhereInput | boolean delete?: Prisma.CustomerWhereInput | boolean connect?: Prisma.CustomerWhereUniqueInput - update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput> + update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutSales_invoicesInput> } -export type CustomerCreateWithoutSalesInvoicesInput = { - firstName: string - lastName: string +export type CustomerCreateWithoutSales_invoicesInput = { + id?: string + first_name: string + last_name: string email?: string | null - mobileNumber: string + mobile_number: string address?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + is_active?: boolean + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } -export type CustomerUncheckedCreateWithoutSalesInvoicesInput = { - id?: number - firstName: string - lastName: string +export type CustomerUncheckedCreateWithoutSales_invoicesInput = { + id?: string + first_name: string + last_name: string email?: string | null - mobileNumber: string + mobile_number: string address?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + is_active?: boolean + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } -export type CustomerCreateOrConnectWithoutSalesInvoicesInput = { +export type CustomerCreateOrConnectWithoutSales_invoicesInput = { where: Prisma.CustomerWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type CustomerUpsertWithoutSalesInvoicesInput = { - update: Prisma.XOR - create: Prisma.XOR +export type CustomerUpsertWithoutSales_invoicesInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.CustomerWhereInput } -export type CustomerUpdateToOneWithWhereWithoutSalesInvoicesInput = { +export type CustomerUpdateToOneWithWhereWithoutSales_invoicesInput = { where?: Prisma.CustomerWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type CustomerUpdateWithoutSalesInvoicesInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string +export type CustomerUpdateWithoutSales_invoicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } -export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string +export type CustomerUncheckedUpdateWithoutSales_invoicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -567,11 +596,11 @@ export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = { */ export type CustomerCountOutputType = { - salesInvoices: number + sales_invoices: number } export type CustomerCountOutputTypeSelect = { - salesInvoices?: boolean | CustomerCountOutputTypeCountSalesInvoicesArgs + sales_invoices?: boolean | CustomerCountOutputTypeCountSales_invoicesArgs } /** @@ -587,23 +616,25 @@ export type CustomerCountOutputTypeDefaultArgs = { +export type CustomerCountOutputTypeCountSales_invoicesArgs = { where?: Prisma.SalesInvoiceWhereInput } export type CustomerSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean - firstName?: boolean - lastName?: boolean + first_name?: boolean + last_name?: boolean email?: boolean - mobileNumber?: boolean + mobile_number?: boolean address?: boolean - isActive?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean - salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs + is_active?: boolean + account_id?: boolean + complex_id?: boolean + created_at?: boolean + updated_at?: boolean + deleted_at?: boolean + sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs }, ExtArgs["result"]["customer"]> @@ -611,39 +642,43 @@ export type CustomerSelect = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["customer"]> +export type CustomerOmit = runtime.Types.Extensions.GetOmit<"id" | "first_name" | "last_name" | "email" | "mobile_number" | "address" | "is_active" | "account_id" | "complex_id" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["customer"]> export type CustomerInclude = { - salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs + sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs } export type $CustomerPayload = { name: "Customer" objects: { - salesInvoices: Prisma.$SalesInvoicePayload[] + sales_invoices: Prisma.$SalesInvoicePayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number - firstName: string - lastName: string + id: string + first_name: string + last_name: string email: string | null - mobileNumber: string + mobile_number: string address: string | null - isActive: boolean - createdAt: Date - updatedAt: Date - deletedAt: Date | null + is_active: boolean + account_id: string + complex_id: string + created_at: Date + updated_at: Date + deleted_at: Date | null }, ExtArgs["result"]["customer"]> composites: {} } @@ -984,7 +1019,7 @@ readonly fields: CustomerFieldRefs; */ export interface Prisma__CustomerClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - salesInvoices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + sales_invoices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1014,16 +1049,18 @@ export interface Prisma__CustomerClient - readonly firstName: Prisma.FieldRef<"Customer", 'String'> - readonly lastName: Prisma.FieldRef<"Customer", 'String'> + readonly id: Prisma.FieldRef<"Customer", 'String'> + readonly first_name: Prisma.FieldRef<"Customer", 'String'> + readonly last_name: Prisma.FieldRef<"Customer", 'String'> readonly email: Prisma.FieldRef<"Customer", 'String'> - readonly mobileNumber: Prisma.FieldRef<"Customer", 'String'> + readonly mobile_number: Prisma.FieldRef<"Customer", 'String'> readonly address: Prisma.FieldRef<"Customer", 'String'> - readonly isActive: Prisma.FieldRef<"Customer", 'Boolean'> - readonly createdAt: Prisma.FieldRef<"Customer", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Customer", 'DateTime'> - readonly deletedAt: Prisma.FieldRef<"Customer", 'DateTime'> + readonly is_active: Prisma.FieldRef<"Customer", 'Boolean'> + readonly account_id: Prisma.FieldRef<"Customer", 'String'> + readonly complex_id: Prisma.FieldRef<"Customer", 'String'> + readonly created_at: Prisma.FieldRef<"Customer", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"Customer", 'DateTime'> + readonly deleted_at: Prisma.FieldRef<"Customer", 'DateTime'> } @@ -1367,9 +1404,9 @@ export type CustomerDeleteManyArgs = { +export type Customer$sales_invoicesArgs = { /** * Select specific fields to fetch from the SalesInvoice */ diff --git a/src/generated/prisma/models/Device.ts b/src/generated/prisma/models/Device.ts new file mode 100644 index 0000000..b343d73 --- /dev/null +++ b/src/generated/prisma/models/Device.ts @@ -0,0 +1,1246 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Device` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Device + * + */ +export type DeviceModel = runtime.Types.Result.DefaultSelection + +export type AggregateDevice = { + _count: DeviceCountAggregateOutputType | null + _min: DeviceMinAggregateOutputType | null + _max: DeviceMaxAggregateOutputType | null +} + +export type DeviceMinAggregateOutputType = { + account_id: string | null + app_version: string | null + build_number: string | null + uuid: string | null + platform: string | null + brand: string | null + model: string | null + device: string | null + os_version: string | null + sdk_version: string | null + release_number: string | null + browser_name: string | null + fcm_token: string | null +} + +export type DeviceMaxAggregateOutputType = { + account_id: string | null + app_version: string | null + build_number: string | null + uuid: string | null + platform: string | null + brand: string | null + model: string | null + device: string | null + os_version: string | null + sdk_version: string | null + release_number: string | null + browser_name: string | null + fcm_token: string | null +} + +export type DeviceCountAggregateOutputType = { + account_id: number + app_version: number + build_number: number + uuid: number + platform: number + brand: number + model: number + device: number + os_version: number + sdk_version: number + release_number: number + browser_name: number + fcm_token: number + _all: number +} + + +export type DeviceMinAggregateInputType = { + account_id?: true + app_version?: true + build_number?: true + uuid?: true + platform?: true + brand?: true + model?: true + device?: true + os_version?: true + sdk_version?: true + release_number?: true + browser_name?: true + fcm_token?: true +} + +export type DeviceMaxAggregateInputType = { + account_id?: true + app_version?: true + build_number?: true + uuid?: true + platform?: true + brand?: true + model?: true + device?: true + os_version?: true + sdk_version?: true + release_number?: true + browser_name?: true + fcm_token?: true +} + +export type DeviceCountAggregateInputType = { + account_id?: true + app_version?: true + build_number?: true + uuid?: true + platform?: true + brand?: true + model?: true + device?: true + os_version?: true + sdk_version?: true + release_number?: true + browser_name?: true + fcm_token?: true + _all?: true +} + +export type DeviceAggregateArgs = { + /** + * Filter which Device to aggregate. + */ + where?: Prisma.DeviceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Devices to fetch. + */ + orderBy?: Prisma.DeviceOrderByWithRelationInput | Prisma.DeviceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.DeviceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Devices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Devices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Devices + **/ + _count?: true | DeviceCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DeviceMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DeviceMaxAggregateInputType +} + +export type GetDeviceAggregateType = { + [P in keyof T & keyof AggregateDevice]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type DeviceGroupByArgs = { + where?: Prisma.DeviceWhereInput + orderBy?: Prisma.DeviceOrderByWithAggregationInput | Prisma.DeviceOrderByWithAggregationInput[] + by: Prisma.DeviceScalarFieldEnum[] | Prisma.DeviceScalarFieldEnum + having?: Prisma.DeviceScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DeviceCountAggregateInputType | true + _min?: DeviceMinAggregateInputType + _max?: DeviceMaxAggregateInputType +} + +export type DeviceGroupByOutputType = { + account_id: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name: string | null + fcm_token: string | null + _count: DeviceCountAggregateOutputType | null + _min: DeviceMinAggregateOutputType | null + _max: DeviceMaxAggregateOutputType | null +} + +type GetDeviceGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof DeviceGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type DeviceWhereInput = { + AND?: Prisma.DeviceWhereInput | Prisma.DeviceWhereInput[] + OR?: Prisma.DeviceWhereInput[] + NOT?: Prisma.DeviceWhereInput | Prisma.DeviceWhereInput[] + account_id?: Prisma.StringNullableFilter<"Device"> | string | null + app_version?: Prisma.StringFilter<"Device"> | string + build_number?: Prisma.StringFilter<"Device"> | string + uuid?: Prisma.StringFilter<"Device"> | string + platform?: Prisma.StringFilter<"Device"> | string + brand?: Prisma.StringFilter<"Device"> | string + model?: Prisma.StringFilter<"Device"> | string + device?: Prisma.StringFilter<"Device"> | string + os_version?: Prisma.StringFilter<"Device"> | string + sdk_version?: Prisma.StringFilter<"Device"> | string + release_number?: Prisma.StringFilter<"Device"> | string + browser_name?: Prisma.StringNullableFilter<"Device"> | string | null + fcm_token?: Prisma.StringNullableFilter<"Device"> | string | null +} + +export type DeviceOrderByWithRelationInput = { + account_id?: Prisma.SortOrderInput | Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrderInput | Prisma.SortOrder + fcm_token?: Prisma.SortOrderInput | Prisma.SortOrder + _relevance?: Prisma.DeviceOrderByRelevanceInput +} + +export type DeviceWhereUniqueInput = Prisma.AtLeast<{ + uuid?: string + AND?: Prisma.DeviceWhereInput | Prisma.DeviceWhereInput[] + OR?: Prisma.DeviceWhereInput[] + NOT?: Prisma.DeviceWhereInput | Prisma.DeviceWhereInput[] + account_id?: Prisma.StringNullableFilter<"Device"> | string | null + app_version?: Prisma.StringFilter<"Device"> | string + build_number?: Prisma.StringFilter<"Device"> | string + platform?: Prisma.StringFilter<"Device"> | string + brand?: Prisma.StringFilter<"Device"> | string + model?: Prisma.StringFilter<"Device"> | string + device?: Prisma.StringFilter<"Device"> | string + os_version?: Prisma.StringFilter<"Device"> | string + sdk_version?: Prisma.StringFilter<"Device"> | string + release_number?: Prisma.StringFilter<"Device"> | string + browser_name?: Prisma.StringNullableFilter<"Device"> | string | null + fcm_token?: Prisma.StringNullableFilter<"Device"> | string | null +}, "uuid" | "uuid"> + +export type DeviceOrderByWithAggregationInput = { + account_id?: Prisma.SortOrderInput | Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrderInput | Prisma.SortOrder + fcm_token?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.DeviceCountOrderByAggregateInput + _max?: Prisma.DeviceMaxOrderByAggregateInput + _min?: Prisma.DeviceMinOrderByAggregateInput +} + +export type DeviceScalarWhereWithAggregatesInput = { + AND?: Prisma.DeviceScalarWhereWithAggregatesInput | Prisma.DeviceScalarWhereWithAggregatesInput[] + OR?: Prisma.DeviceScalarWhereWithAggregatesInput[] + NOT?: Prisma.DeviceScalarWhereWithAggregatesInput | Prisma.DeviceScalarWhereWithAggregatesInput[] + account_id?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null + app_version?: Prisma.StringWithAggregatesFilter<"Device"> | string + build_number?: Prisma.StringWithAggregatesFilter<"Device"> | string + uuid?: Prisma.StringWithAggregatesFilter<"Device"> | string + platform?: Prisma.StringWithAggregatesFilter<"Device"> | string + brand?: Prisma.StringWithAggregatesFilter<"Device"> | string + model?: Prisma.StringWithAggregatesFilter<"Device"> | string + device?: Prisma.StringWithAggregatesFilter<"Device"> | string + os_version?: Prisma.StringWithAggregatesFilter<"Device"> | string + sdk_version?: Prisma.StringWithAggregatesFilter<"Device"> | string + release_number?: Prisma.StringWithAggregatesFilter<"Device"> | string + browser_name?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null + fcm_token?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null +} + +export type DeviceCreateInput = { + account_id?: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name?: string | null + fcm_token?: string | null +} + +export type DeviceUncheckedCreateInput = { + account_id?: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name?: string | null + fcm_token?: string | null +} + +export type DeviceUpdateInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type DeviceUncheckedUpdateInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type DeviceCreateManyInput = { + account_id?: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name?: string | null + fcm_token?: string | null +} + +export type DeviceUpdateManyMutationInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type DeviceUncheckedUpdateManyInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type DeviceOrderByRelevanceInput = { + fields: Prisma.DeviceOrderByRelevanceFieldEnum | Prisma.DeviceOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type DeviceCountOrderByAggregateInput = { + account_id?: Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrder + fcm_token?: Prisma.SortOrder +} + +export type DeviceMaxOrderByAggregateInput = { + account_id?: Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrder + fcm_token?: Prisma.SortOrder +} + +export type DeviceMinOrderByAggregateInput = { + account_id?: Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrder + fcm_token?: Prisma.SortOrder +} + + + +export type DeviceSelect = runtime.Types.Extensions.GetSelect<{ + account_id?: boolean + app_version?: boolean + build_number?: boolean + uuid?: boolean + platform?: boolean + brand?: boolean + model?: boolean + device?: boolean + os_version?: boolean + sdk_version?: boolean + release_number?: boolean + browser_name?: boolean + fcm_token?: boolean +}, ExtArgs["result"]["device"]> + + + +export type DeviceSelectScalar = { + account_id?: boolean + app_version?: boolean + build_number?: boolean + uuid?: boolean + platform?: boolean + brand?: boolean + model?: boolean + device?: boolean + os_version?: boolean + sdk_version?: boolean + release_number?: boolean + browser_name?: boolean + fcm_token?: boolean +} + +export type DeviceOmit = runtime.Types.Extensions.GetOmit<"account_id" | "app_version" | "build_number" | "uuid" | "platform" | "brand" | "model" | "device" | "os_version" | "sdk_version" | "release_number" | "browser_name" | "fcm_token", ExtArgs["result"]["device"]> + +export type $DevicePayload = { + name: "Device" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + account_id: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name: string | null + fcm_token: string | null + }, ExtArgs["result"]["device"]> + composites: {} +} + +export type DeviceGetPayload = runtime.Types.Result.GetResult + +export type DeviceCountArgs = + Omit & { + select?: DeviceCountAggregateInputType | true + } + +export interface DeviceDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Device'], meta: { name: 'Device' } } + /** + * Find zero or one Device that matches the filter. + * @param {DeviceFindUniqueArgs} args - Arguments to find a Device + * @example + * // Get one Device + * const device = await prisma.device.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Device that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DeviceFindUniqueOrThrowArgs} args - Arguments to find a Device + * @example + * // Get one Device + * const device = await prisma.device.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Device that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceFindFirstArgs} args - Arguments to find a Device + * @example + * // Get one Device + * const device = await prisma.device.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Device that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceFindFirstOrThrowArgs} args - Arguments to find a Device + * @example + * // Get one Device + * const device = await prisma.device.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Devices that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Devices + * const devices = await prisma.device.findMany() + * + * // Get first 10 Devices + * const devices = await prisma.device.findMany({ take: 10 }) + * + * // Only select the `account_id` + * const deviceWithAccount_idOnly = await prisma.device.findMany({ select: { account_id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Device. + * @param {DeviceCreateArgs} args - Arguments to create a Device. + * @example + * // Create one Device + * const Device = await prisma.device.create({ + * data: { + * // ... data to create a Device + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Devices. + * @param {DeviceCreateManyArgs} args - Arguments to create many Devices. + * @example + * // Create many Devices + * const device = await prisma.device.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Device. + * @param {DeviceDeleteArgs} args - Arguments to delete one Device. + * @example + * // Delete one Device + * const Device = await prisma.device.delete({ + * where: { + * // ... filter to delete one Device + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Device. + * @param {DeviceUpdateArgs} args - Arguments to update one Device. + * @example + * // Update one Device + * const device = await prisma.device.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Devices. + * @param {DeviceDeleteManyArgs} args - Arguments to filter Devices to delete. + * @example + * // Delete a few Devices + * const { count } = await prisma.device.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Devices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Devices + * const device = await prisma.device.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Device. + * @param {DeviceUpsertArgs} args - Arguments to update or create a Device. + * @example + * // Update or create a Device + * const device = await prisma.device.upsert({ + * create: { + * // ... data to create a Device + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Device we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Devices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceCountArgs} args - Arguments to filter Devices to count. + * @example + * // Count the number of Devices + * const count = await prisma.device.count({ + * where: { + * // ... the filter for the Devices we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Device. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Device. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends DeviceGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: DeviceGroupByArgs['orderBy'] } + : { orderBy?: DeviceGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetDeviceGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Device model + */ +readonly fields: DeviceFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Device. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__DeviceClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Device model + */ +export interface DeviceFieldRefs { + readonly account_id: Prisma.FieldRef<"Device", 'String'> + readonly app_version: Prisma.FieldRef<"Device", 'String'> + readonly build_number: Prisma.FieldRef<"Device", 'String'> + readonly uuid: Prisma.FieldRef<"Device", 'String'> + readonly platform: Prisma.FieldRef<"Device", 'String'> + readonly brand: Prisma.FieldRef<"Device", 'String'> + readonly model: Prisma.FieldRef<"Device", 'String'> + readonly device: Prisma.FieldRef<"Device", 'String'> + readonly os_version: Prisma.FieldRef<"Device", 'String'> + readonly sdk_version: Prisma.FieldRef<"Device", 'String'> + readonly release_number: Prisma.FieldRef<"Device", 'String'> + readonly browser_name: Prisma.FieldRef<"Device", 'String'> + readonly fcm_token: Prisma.FieldRef<"Device", 'String'> +} + + +// Custom InputTypes +/** + * Device findUnique + */ +export type DeviceFindUniqueArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Filter, which Device to fetch. + */ + where: Prisma.DeviceWhereUniqueInput +} + +/** + * Device findUniqueOrThrow + */ +export type DeviceFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Filter, which Device to fetch. + */ + where: Prisma.DeviceWhereUniqueInput +} + +/** + * Device findFirst + */ +export type DeviceFindFirstArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Filter, which Device to fetch. + */ + where?: Prisma.DeviceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Devices to fetch. + */ + orderBy?: Prisma.DeviceOrderByWithRelationInput | Prisma.DeviceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Devices. + */ + cursor?: Prisma.DeviceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Devices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Devices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Devices. + */ + distinct?: Prisma.DeviceScalarFieldEnum | Prisma.DeviceScalarFieldEnum[] +} + +/** + * Device findFirstOrThrow + */ +export type DeviceFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Filter, which Device to fetch. + */ + where?: Prisma.DeviceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Devices to fetch. + */ + orderBy?: Prisma.DeviceOrderByWithRelationInput | Prisma.DeviceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Devices. + */ + cursor?: Prisma.DeviceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Devices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Devices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Devices. + */ + distinct?: Prisma.DeviceScalarFieldEnum | Prisma.DeviceScalarFieldEnum[] +} + +/** + * Device findMany + */ +export type DeviceFindManyArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Filter, which Devices to fetch. + */ + where?: Prisma.DeviceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Devices to fetch. + */ + orderBy?: Prisma.DeviceOrderByWithRelationInput | Prisma.DeviceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Devices. + */ + cursor?: Prisma.DeviceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Devices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Devices. + */ + skip?: number + distinct?: Prisma.DeviceScalarFieldEnum | Prisma.DeviceScalarFieldEnum[] +} + +/** + * Device create + */ +export type DeviceCreateArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * The data needed to create a Device. + */ + data: Prisma.XOR +} + +/** + * Device createMany + */ +export type DeviceCreateManyArgs = { + /** + * The data used to create many Devices. + */ + data: Prisma.DeviceCreateManyInput | Prisma.DeviceCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Device update + */ +export type DeviceUpdateArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * The data needed to update a Device. + */ + data: Prisma.XOR + /** + * Choose, which Device to update. + */ + where: Prisma.DeviceWhereUniqueInput +} + +/** + * Device updateMany + */ +export type DeviceUpdateManyArgs = { + /** + * The data used to update Devices. + */ + data: Prisma.XOR + /** + * Filter which Devices to update + */ + where?: Prisma.DeviceWhereInput + /** + * Limit how many Devices to update. + */ + limit?: number +} + +/** + * Device upsert + */ +export type DeviceUpsertArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * The filter to search for the Device to update in case it exists. + */ + where: Prisma.DeviceWhereUniqueInput + /** + * In case the Device found by the `where` argument doesn't exist, create a new Device with this data. + */ + create: Prisma.XOR + /** + * In case the Device was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Device delete + */ +export type DeviceDeleteArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Filter which Device to delete. + */ + where: Prisma.DeviceWhereUniqueInput +} + +/** + * Device deleteMany + */ +export type DeviceDeleteManyArgs = { + /** + * Filter which Devices to delete + */ + where?: Prisma.DeviceWhereInput + /** + * Limit how many Devices to delete. + */ + limit?: number +} + +/** + * Device without action + */ +export type DeviceDefaultArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null +} diff --git a/src/generated/prisma/models/Good.ts b/src/generated/prisma/models/Good.ts index 9b3d58b..a6c12fd 100644 --- a/src/generated/prisma/models/Good.ts +++ b/src/generated/prisma/models/Good.ts @@ -27,43 +27,43 @@ export type AggregateGood = { } export type GoodAvgAggregateOutputType = { - id: number | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + base_sale_price: runtime.Decimal | null } export type GoodSumAggregateOutputType = { - id: number | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + base_sale_price: runtime.Decimal | null } export type GoodMinAggregateOutputType = { - id: number | null + id: string | null name: string | null description: string | null sku: string | null - localSku: string | null + local_sku: string | null barcode: string | null - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + created_at: Date | null + updated_at: Date | null + deleted_at: Date | null + category_id: string | null + base_sale_price: runtime.Decimal | null + account_id: string | null + complex_id: string | null } export type GoodMaxAggregateOutputType = { - id: number | null + id: string | null name: string | null description: string | null sku: string | null - localSku: string | null + local_sku: string | null barcode: string | null - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + created_at: Date | null + updated_at: Date | null + deleted_at: Date | null + category_id: string | null + base_sale_price: runtime.Decimal | null + account_id: string | null + complex_id: string | null } export type GoodCountAggregateOutputType = { @@ -71,27 +71,25 @@ export type GoodCountAggregateOutputType = { name: number description: number sku: number - localSku: number + local_sku: number barcode: number - createdAt: number - updatedAt: number - deletedAt: number - categoryId: number - baseSalePrice: number + created_at: number + updated_at: number + deleted_at: number + category_id: number + base_sale_price: number + account_id: number + complex_id: number _all: number } export type GoodAvgAggregateInputType = { - id?: true - categoryId?: true - baseSalePrice?: true + base_sale_price?: true } export type GoodSumAggregateInputType = { - id?: true - categoryId?: true - baseSalePrice?: true + base_sale_price?: true } export type GoodMinAggregateInputType = { @@ -99,13 +97,15 @@ export type GoodMinAggregateInputType = { name?: true description?: true sku?: true - localSku?: true + local_sku?: true barcode?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - categoryId?: true - baseSalePrice?: true + created_at?: true + updated_at?: true + deleted_at?: true + category_id?: true + base_sale_price?: true + account_id?: true + complex_id?: true } export type GoodMaxAggregateInputType = { @@ -113,13 +113,15 @@ export type GoodMaxAggregateInputType = { name?: true description?: true sku?: true - localSku?: true + local_sku?: true barcode?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - categoryId?: true - baseSalePrice?: true + created_at?: true + updated_at?: true + deleted_at?: true + category_id?: true + base_sale_price?: true + account_id?: true + complex_id?: true } export type GoodCountAggregateInputType = { @@ -127,13 +129,15 @@ export type GoodCountAggregateInputType = { name?: true description?: true sku?: true - localSku?: true + local_sku?: true barcode?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - categoryId?: true - baseSalePrice?: true + created_at?: true + updated_at?: true + deleted_at?: true + category_id?: true + base_sale_price?: true + account_id?: true + complex_id?: true _all?: true } @@ -224,17 +228,19 @@ export type GoodGroupByArgs | number + id?: Prisma.StringFilter<"Good"> | string name?: Prisma.StringFilter<"Good"> | string description?: Prisma.StringNullableFilter<"Good"> | string | null sku?: Prisma.StringFilter<"Good"> | string - localSku?: Prisma.StringFilter<"Good"> | string + local_sku?: Prisma.StringNullableFilter<"Good"> | string | null barcode?: Prisma.StringNullableFilter<"Good"> | string | null - createdAt?: Prisma.DateTimeFilter<"Good"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Good"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null - categoryId?: Prisma.IntNullableFilter<"Good"> | number | null - baseSalePrice?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"Good"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null + category_id?: Prisma.StringNullableFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFilter<"Good"> | string + complex_id?: Prisma.StringFilter<"Good"> | string category?: Prisma.XOR | null - salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter + sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter } export type GoodOrderByWithRelationInput = { @@ -281,21 +289,23 @@ export type GoodOrderByWithRelationInput = { name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder sku?: Prisma.SortOrder - localSku?: Prisma.SortOrder + local_sku?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - categoryId?: Prisma.SortOrderInput | Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + category_id?: Prisma.SortOrderInput | Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder category?: Prisma.GoodCategoryOrderByWithRelationInput - salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput + sales_invoice_items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput _relevance?: Prisma.GoodOrderByRelevanceInput } export type GoodWhereUniqueInput = Prisma.AtLeast<{ - id?: number - localSku?: string + id?: string + local_sku?: string barcode?: string AND?: Prisma.GoodWhereInput | Prisma.GoodWhereInput[] OR?: Prisma.GoodWhereInput[] @@ -303,27 +313,31 @@ export type GoodWhereUniqueInput = Prisma.AtLeast<{ name?: Prisma.StringFilter<"Good"> | string description?: Prisma.StringNullableFilter<"Good"> | string | null sku?: Prisma.StringFilter<"Good"> | string - createdAt?: Prisma.DateTimeFilter<"Good"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Good"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null - categoryId?: Prisma.IntNullableFilter<"Good"> | number | null - baseSalePrice?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"Good"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null + category_id?: Prisma.StringNullableFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFilter<"Good"> | string + complex_id?: Prisma.StringFilter<"Good"> | string category?: Prisma.XOR | null - salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter -}, "id" | "localSku" | "barcode"> + sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter +}, "id" | "local_sku" | "barcode"> export type GoodOrderByWithAggregationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder sku?: Prisma.SortOrder - localSku?: Prisma.SortOrder + local_sku?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - categoryId?: Prisma.SortOrderInput | Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + category_id?: Prisma.SortOrderInput | Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder _count?: Prisma.GoodCountOrderByAggregateInput _avg?: Prisma.GoodAvgOrderByAggregateInput _max?: Prisma.GoodMaxOrderByAggregateInput @@ -335,115 +349,134 @@ export type GoodScalarWhereWithAggregatesInput = { AND?: Prisma.GoodScalarWhereWithAggregatesInput | Prisma.GoodScalarWhereWithAggregatesInput[] OR?: Prisma.GoodScalarWhereWithAggregatesInput[] NOT?: Prisma.GoodScalarWhereWithAggregatesInput | Prisma.GoodScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"Good"> | number + id?: Prisma.StringWithAggregatesFilter<"Good"> | string name?: Prisma.StringWithAggregatesFilter<"Good"> | string description?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null sku?: Prisma.StringWithAggregatesFilter<"Good"> | string - localSku?: Prisma.StringWithAggregatesFilter<"Good"> | string + local_sku?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null barcode?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Good"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Good"> | Date | string - deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Good"> | Date | string | null - categoryId?: Prisma.IntNullableWithAggregatesFilter<"Good"> | number | null - baseSalePrice?: Prisma.DecimalWithAggregatesFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"Good"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"Good"> | Date | string + deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Good"> | Date | string | null + category_id?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalWithAggregatesFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringWithAggregatesFilter<"Good"> | string + complex_id?: Prisma.StringWithAggregatesFilter<"Good"> | string } export type GoodCreateInput = { + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput - salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput + sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput } export type GoodUncheckedCreateInput = { - id?: number + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - categoryId?: number | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput } export type GoodUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput - salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput + sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput } export type GoodUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput } export type GoodCreateManyInput = { - id?: number + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - categoryId?: number | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string } export type GoodUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type GoodUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type GoodOrderByRelevanceInput = { @@ -457,19 +490,19 @@ export type GoodCountOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder sku?: Prisma.SortOrder - localSku?: Prisma.SortOrder + local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder + category_id?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type GoodAvgOrderByAggregateInput = { - id?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder } export type GoodMaxOrderByAggregateInput = { @@ -477,13 +510,15 @@ export type GoodMaxOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder sku?: Prisma.SortOrder - localSku?: Prisma.SortOrder + local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder + category_id?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type GoodMinOrderByAggregateInput = { @@ -491,19 +526,19 @@ export type GoodMinOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder sku?: Prisma.SortOrder - localSku?: Prisma.SortOrder + local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder + category_id?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type GoodSumOrderByAggregateInput = { - id?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder } export type GoodListRelationFilter = { @@ -521,22 +556,6 @@ export type GoodNullableScalarRelationFilter = { isNot?: Prisma.GoodWhereInput | null } -export type StringFieldUpdateOperationsInput = { - set?: string -} - -export type NullableStringFieldUpdateOperationsInput = { - set?: string | null -} - -export type DateTimeFieldUpdateOperationsInput = { - set?: Date | string -} - -export type NullableDateTimeFieldUpdateOperationsInput = { - set?: Date | string | null -} - export type DecimalFieldUpdateOperationsInput = { set?: runtime.Decimal | runtime.DecimalJsLike | number | string increment?: runtime.Decimal | runtime.DecimalJsLike | number | string @@ -545,22 +564,6 @@ export type DecimalFieldUpdateOperationsInput = { divide?: runtime.Decimal | runtime.DecimalJsLike | number | string } -export type IntFieldUpdateOperationsInput = { - set?: number - increment?: number - decrement?: number - multiply?: number - divide?: number -} - -export type NullableIntFieldUpdateOperationsInput = { - set?: number | null - increment?: number - decrement?: number - multiply?: number - divide?: number -} - export type GoodCreateNestedManyWithoutCategoryInput = { create?: Prisma.XOR | Prisma.GoodCreateWithoutCategoryInput[] | Prisma.GoodUncheckedCreateWithoutCategoryInput[] connectOrCreate?: Prisma.GoodCreateOrConnectWithoutCategoryInput | Prisma.GoodCreateOrConnectWithoutCategoryInput[] @@ -603,47 +606,52 @@ export type GoodUncheckedUpdateManyWithoutCategoryNestedInput = { deleteMany?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] } -export type GoodCreateNestedOneWithoutSalesInvoiceItemsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.GoodCreateOrConnectWithoutSalesInvoiceItemsInput +export type GoodCreateNestedOneWithoutSales_invoice_itemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutSales_invoice_itemsInput connect?: Prisma.GoodWhereUniqueInput } -export type GoodUpdateOneWithoutSalesInvoiceItemsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.GoodCreateOrConnectWithoutSalesInvoiceItemsInput - upsert?: Prisma.GoodUpsertWithoutSalesInvoiceItemsInput +export type GoodUpdateOneWithoutSales_invoice_itemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutSales_invoice_itemsInput + upsert?: Prisma.GoodUpsertWithoutSales_invoice_itemsInput disconnect?: Prisma.GoodWhereInput | boolean delete?: Prisma.GoodWhereInput | boolean connect?: Prisma.GoodWhereUniqueInput - update?: Prisma.XOR, Prisma.GoodUncheckedUpdateWithoutSalesInvoiceItemsInput> + update?: Prisma.XOR, Prisma.GoodUncheckedUpdateWithoutSales_invoice_itemsInput> } export type GoodCreateWithoutCategoryInput = { + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string + sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput } export type GoodUncheckedCreateWithoutCategoryInput = { - id?: number + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput } export type GoodCreateOrConnectWithoutCategoryInput = { @@ -676,140 +684,161 @@ export type GoodScalarWhereInput = { AND?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] OR?: Prisma.GoodScalarWhereInput[] NOT?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] - id?: Prisma.IntFilter<"Good"> | number + id?: Prisma.StringFilter<"Good"> | string name?: Prisma.StringFilter<"Good"> | string description?: Prisma.StringNullableFilter<"Good"> | string | null sku?: Prisma.StringFilter<"Good"> | string - localSku?: Prisma.StringFilter<"Good"> | string + local_sku?: Prisma.StringNullableFilter<"Good"> | string | null barcode?: Prisma.StringNullableFilter<"Good"> | string | null - createdAt?: Prisma.DateTimeFilter<"Good"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Good"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null - categoryId?: Prisma.IntNullableFilter<"Good"> | number | null - baseSalePrice?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"Good"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null + category_id?: Prisma.StringNullableFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFilter<"Good"> | string + complex_id?: Prisma.StringFilter<"Good"> | string } -export type GoodCreateWithoutSalesInvoiceItemsInput = { +export type GoodCreateWithoutSales_invoice_itemsInput = { + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput } -export type GoodUncheckedCreateWithoutSalesInvoiceItemsInput = { - id?: number +export type GoodUncheckedCreateWithoutSales_invoice_itemsInput = { + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - categoryId?: number | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string } -export type GoodCreateOrConnectWithoutSalesInvoiceItemsInput = { +export type GoodCreateOrConnectWithoutSales_invoice_itemsInput = { where: Prisma.GoodWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type GoodUpsertWithoutSalesInvoiceItemsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type GoodUpsertWithoutSales_invoice_itemsInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.GoodWhereInput } -export type GoodUpdateToOneWithWhereWithoutSalesInvoiceItemsInput = { +export type GoodUpdateToOneWithWhereWithoutSales_invoice_itemsInput = { where?: Prisma.GoodWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type GoodUpdateWithoutSalesInvoiceItemsInput = { +export type GoodUpdateWithoutSales_invoice_itemsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput } -export type GoodUncheckedUpdateWithoutSalesInvoiceItemsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number +export type GoodUncheckedUpdateWithoutSales_invoice_itemsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type GoodCreateManyCategoryInput = { - id?: number + id?: string name: string description?: string | null sku: string - localSku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string } export type GoodUpdateWithoutCategoryInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput } export type GoodUncheckedUpdateWithoutCategoryInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput } export type GoodUncheckedUpdateManyWithoutCategoryInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string - localSku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } @@ -818,11 +847,11 @@ export type GoodUncheckedUpdateManyWithoutCategoryInput = { */ export type GoodCountOutputType = { - salesInvoiceItems: number + sales_invoice_items: number } export type GoodCountOutputTypeSelect = { - salesInvoiceItems?: boolean | GoodCountOutputTypeCountSalesInvoiceItemsArgs + sales_invoice_items?: boolean | GoodCountOutputTypeCountSales_invoice_itemsArgs } /** @@ -838,7 +867,7 @@ export type GoodCountOutputTypeDefaultArgs = { +export type GoodCountOutputTypeCountSales_invoice_itemsArgs = { where?: Prisma.SalesInvoiceItemWhereInput } @@ -848,15 +877,17 @@ export type GoodSelect - salesInvoiceItems?: boolean | Prisma.Good$salesInvoiceItemsArgs + sales_invoice_items?: boolean | Prisma.Good$sales_invoice_itemsArgs _count?: boolean | Prisma.GoodCountOutputTypeDefaultArgs }, ExtArgs["result"]["good"]> @@ -867,19 +898,21 @@ export type GoodSelectScalar = { name?: boolean description?: boolean sku?: boolean - localSku?: boolean + local_sku?: boolean barcode?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean - categoryId?: boolean - baseSalePrice?: boolean + created_at?: boolean + updated_at?: boolean + deleted_at?: boolean + category_id?: boolean + base_sale_price?: boolean + account_id?: boolean + complex_id?: boolean } -export type GoodOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "localSku" | "barcode" | "createdAt" | "updatedAt" | "deletedAt" | "categoryId" | "baseSalePrice", ExtArgs["result"]["good"]> +export type GoodOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "local_sku" | "barcode" | "created_at" | "updated_at" | "deleted_at" | "category_id" | "base_sale_price" | "account_id" | "complex_id", ExtArgs["result"]["good"]> export type GoodInclude = { category?: boolean | Prisma.Good$categoryArgs - salesInvoiceItems?: boolean | Prisma.Good$salesInvoiceItemsArgs + sales_invoice_items?: boolean | Prisma.Good$sales_invoice_itemsArgs _count?: boolean | Prisma.GoodCountOutputTypeDefaultArgs } @@ -887,20 +920,22 @@ export type $GoodPayload | null - salesInvoiceItems: Prisma.$SalesInvoiceItemPayload[] + sales_invoice_items: Prisma.$SalesInvoiceItemPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number + id: string name: string description: string | null sku: string - localSku: string + local_sku: string | null barcode: string | null - createdAt: Date - updatedAt: Date - deletedAt: Date | null - categoryId: number | null - baseSalePrice: runtime.Decimal + created_at: Date + updated_at: Date + deleted_at: Date | null + category_id: string | null + base_sale_price: runtime.Decimal + account_id: string + complex_id: string }, ExtArgs["result"]["good"]> composites: {} } @@ -1242,7 +1277,7 @@ readonly fields: GoodFieldRefs; export interface Prisma__GoodClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" category = {}>(args?: Prisma.Subset>): Prisma.Prisma__GoodCategoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - salesInvoiceItems = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + sales_invoice_items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1272,17 +1307,19 @@ export interface Prisma__GoodClient + readonly id: Prisma.FieldRef<"Good", 'String'> readonly name: Prisma.FieldRef<"Good", 'String'> readonly description: Prisma.FieldRef<"Good", 'String'> readonly sku: Prisma.FieldRef<"Good", 'String'> - readonly localSku: Prisma.FieldRef<"Good", 'String'> + readonly local_sku: Prisma.FieldRef<"Good", 'String'> readonly barcode: Prisma.FieldRef<"Good", 'String'> - readonly createdAt: Prisma.FieldRef<"Good", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Good", 'DateTime'> - readonly deletedAt: Prisma.FieldRef<"Good", 'DateTime'> - readonly categoryId: Prisma.FieldRef<"Good", 'Int'> - readonly baseSalePrice: Prisma.FieldRef<"Good", 'Decimal'> + readonly created_at: Prisma.FieldRef<"Good", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"Good", 'DateTime'> + readonly deleted_at: Prisma.FieldRef<"Good", 'DateTime'> + readonly category_id: Prisma.FieldRef<"Good", 'String'> + readonly base_sale_price: Prisma.FieldRef<"Good", 'Decimal'> + readonly account_id: Prisma.FieldRef<"Good", 'String'> + readonly complex_id: Prisma.FieldRef<"Good", 'String'> } @@ -1645,9 +1682,9 @@ export type Good$categoryArgs = { +export type Good$sales_invoice_itemsArgs = { /** * Select specific fields to fetch from the SalesInvoiceItem */ diff --git a/src/generated/prisma/models/GoodCategory.ts b/src/generated/prisma/models/GoodCategory.ts index b0531f9..e89b208 100644 --- a/src/generated/prisma/models/GoodCategory.ts +++ b/src/generated/prisma/models/GoodCategory.ts @@ -20,88 +20,82 @@ export type GoodCategoryModel = runtime.Types.Result.DefaultSelection | number + id?: Prisma.StringFilter<"GoodCategory"> | string name?: Prisma.StringFilter<"GoodCategory"> | string description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null - imageUrl?: Prisma.StringNullableFilter<"GoodCategory"> | string | null - createdAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null + image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + account_id?: Prisma.StringFilter<"GoodCategory"> | string + complex_id?: Prisma.StringFilter<"GoodCategory"> | string + created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string + updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null goods?: Prisma.GoodListRelationFilter } @@ -239,25 +221,29 @@ export type GoodCategoryOrderByWithRelationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + image_url?: Prisma.SortOrderInput | Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder goods?: Prisma.GoodOrderByRelationAggregateInput _relevance?: Prisma.GoodCategoryOrderByRelevanceInput } export type GoodCategoryWhereUniqueInput = Prisma.AtLeast<{ - id?: number + id?: string AND?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[] OR?: Prisma.GoodCategoryWhereInput[] NOT?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[] name?: Prisma.StringFilter<"GoodCategory"> | string description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null - imageUrl?: Prisma.StringNullableFilter<"GoodCategory"> | string | null - createdAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null + image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + account_id?: Prisma.StringFilter<"GoodCategory"> | string + complex_id?: Prisma.StringFilter<"GoodCategory"> | string + created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string + updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null goods?: Prisma.GoodListRelationFilter }, "id"> @@ -265,99 +251,118 @@ export type GoodCategoryOrderByWithAggregationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + image_url?: Prisma.SortOrderInput | Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.GoodCategoryCountOrderByAggregateInput - _avg?: Prisma.GoodCategoryAvgOrderByAggregateInput _max?: Prisma.GoodCategoryMaxOrderByAggregateInput _min?: Prisma.GoodCategoryMinOrderByAggregateInput - _sum?: Prisma.GoodCategorySumOrderByAggregateInput } export type GoodCategoryScalarWhereWithAggregatesInput = { AND?: Prisma.GoodCategoryScalarWhereWithAggregatesInput | Prisma.GoodCategoryScalarWhereWithAggregatesInput[] OR?: Prisma.GoodCategoryScalarWhereWithAggregatesInput[] NOT?: Prisma.GoodCategoryScalarWhereWithAggregatesInput | Prisma.GoodCategoryScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"GoodCategory"> | number + id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string name?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string description?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null - imageUrl?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string - deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"GoodCategory"> | Date | string | null + image_url?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null + account_id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string + complex_id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"GoodCategory"> | Date | string | null } export type GoodCategoryCreateInput = { + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput } export type GoodCategoryUncheckedCreateInput = { - id?: number + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null goods?: Prisma.GoodUncheckedCreateNestedManyWithoutCategoryInput } export type GoodCategoryUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput } export type GoodCategoryUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null goods?: Prisma.GoodUncheckedUpdateManyWithoutCategoryNestedInput } export type GoodCategoryCreateManyInput = { - id?: number + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type GoodCategoryUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type GoodCategoryUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type GoodCategoryNullableScalarRelationFilter = { @@ -375,38 +380,36 @@ export type GoodCategoryCountOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrder - imageUrl?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type GoodCategoryAvgOrderByAggregateInput = { - id?: Prisma.SortOrder + image_url?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type GoodCategoryMaxOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrder - imageUrl?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder + image_url?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type GoodCategoryMinOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrder - imageUrl?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type GoodCategorySumOrderByAggregateInput = { - id?: Prisma.SortOrder + image_url?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type GoodCategoryCreateNestedOneWithoutGoodsInput = { @@ -426,22 +429,27 @@ export type GoodCategoryUpdateOneWithoutGoodsNestedInput = { } export type GoodCategoryCreateWithoutGoodsInput = { + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type GoodCategoryUncheckedCreateWithoutGoodsInput = { - id?: number + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type GoodCategoryCreateOrConnectWithoutGoodsInput = { @@ -461,22 +469,27 @@ export type GoodCategoryUpdateToOneWithWhereWithoutGoodsInput = { } export type GoodCategoryUpdateWithoutGoodsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type GoodCategoryUncheckedUpdateWithoutGoodsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -514,10 +527,12 @@ export type GoodCategorySelect _count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs }, ExtArgs["result"]["goodCategory"]> @@ -528,13 +543,15 @@ export type GoodCategorySelectScalar = { id?: boolean name?: boolean description?: boolean - imageUrl?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean + image_url?: boolean + account_id?: boolean + complex_id?: boolean + created_at?: boolean + updated_at?: boolean + deleted_at?: boolean } -export type GoodCategoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "imageUrl" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["goodCategory"]> +export type GoodCategoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "image_url" | "account_id" | "complex_id" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["goodCategory"]> export type GoodCategoryInclude = { goods?: boolean | Prisma.GoodCategory$goodsArgs _count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs @@ -546,13 +563,15 @@ export type $GoodCategoryPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number + id: string name: string description: string | null - imageUrl: string | null - createdAt: Date - updatedAt: Date - deletedAt: Date | null + image_url: string | null + account_id: string + complex_id: string + created_at: Date + updated_at: Date + deleted_at: Date | null }, ExtArgs["result"]["goodCategory"]> composites: {} } @@ -923,13 +942,15 @@ export interface Prisma__GoodCategoryClient + readonly id: Prisma.FieldRef<"GoodCategory", 'String'> readonly name: Prisma.FieldRef<"GoodCategory", 'String'> readonly description: Prisma.FieldRef<"GoodCategory", 'String'> - readonly imageUrl: Prisma.FieldRef<"GoodCategory", 'String'> - readonly createdAt: Prisma.FieldRef<"GoodCategory", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"GoodCategory", 'DateTime'> - readonly deletedAt: Prisma.FieldRef<"GoodCategory", 'DateTime'> + readonly image_url: Prisma.FieldRef<"GoodCategory", 'String'> + readonly account_id: Prisma.FieldRef<"GoodCategory", 'String'> + readonly complex_id: Prisma.FieldRef<"GoodCategory", 'String'> + readonly created_at: Prisma.FieldRef<"GoodCategory", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"GoodCategory", 'DateTime'> + readonly deleted_at: Prisma.FieldRef<"GoodCategory", 'DateTime'> } diff --git a/src/generated/prisma/models/SalesInvoice.ts b/src/generated/prisma/models/SalesInvoice.ts index 259728a..38934be 100644 --- a/src/generated/prisma/models/SalesInvoice.ts +++ b/src/generated/prisma/models/SalesInvoice.ts @@ -27,89 +27,93 @@ export type AggregateSalesInvoice = { } export type SalesInvoiceAvgAggregateOutputType = { - id: number | null - totalAmount: runtime.Decimal | null - customerId: number | null + total_amount: runtime.Decimal | null } export type SalesInvoiceSumAggregateOutputType = { - id: number | null - totalAmount: runtime.Decimal | null - customerId: number | null + total_amount: runtime.Decimal | null } export type SalesInvoiceMinAggregateOutputType = { - id: number | null + id: string | null code: string | null - totalAmount: runtime.Decimal | null + total_amount: runtime.Decimal | null description: string | null - createdAt: Date | null - updatedAt: Date | null - customerId: number | null + created_at: Date | null + updated_at: Date | null + customer_id: string | null + account_id: string | null + complex_id: string | null } export type SalesInvoiceMaxAggregateOutputType = { - id: number | null + id: string | null code: string | null - totalAmount: runtime.Decimal | null + total_amount: runtime.Decimal | null description: string | null - createdAt: Date | null - updatedAt: Date | null - customerId: number | null + created_at: Date | null + updated_at: Date | null + customer_id: string | null + account_id: string | null + complex_id: string | null } export type SalesInvoiceCountAggregateOutputType = { id: number code: number - totalAmount: number + total_amount: number description: number - createdAt: number - updatedAt: number - customerId: number + created_at: number + updated_at: number + customer_id: number + account_id: number + complex_id: number _all: number } export type SalesInvoiceAvgAggregateInputType = { - id?: true - totalAmount?: true - customerId?: true + total_amount?: true } export type SalesInvoiceSumAggregateInputType = { - id?: true - totalAmount?: true - customerId?: true + total_amount?: true } export type SalesInvoiceMinAggregateInputType = { id?: true code?: true - totalAmount?: true + total_amount?: true description?: true - createdAt?: true - updatedAt?: true - customerId?: true + created_at?: true + updated_at?: true + customer_id?: true + account_id?: true + complex_id?: true } export type SalesInvoiceMaxAggregateInputType = { id?: true code?: true - totalAmount?: true + total_amount?: true description?: true - createdAt?: true - updatedAt?: true - customerId?: true + created_at?: true + updated_at?: true + customer_id?: true + account_id?: true + complex_id?: true } export type SalesInvoiceCountAggregateInputType = { id?: true code?: true - totalAmount?: true + total_amount?: true description?: true - createdAt?: true - updatedAt?: true - customerId?: true + created_at?: true + updated_at?: true + customer_id?: true + account_id?: true + complex_id?: true _all?: true } @@ -200,13 +204,15 @@ export type SalesInvoiceGroupByArgs | number + id?: Prisma.StringFilter<"SalesInvoice"> | string code?: Prisma.StringFilter<"SalesInvoice"> | string - totalAmount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null - createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null + created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + account_id?: Prisma.StringFilter<"SalesInvoice"> | string + complex_id?: Prisma.StringFilter<"SalesInvoice"> | string customer?: Prisma.XOR | null items?: Prisma.SalesInvoiceItemListRelationFilter - salesInvoicePayments?: Prisma.SalesInvoicePaymentListRelationFilter + sales_invoice_payments?: Prisma.SalesInvoicePaymentListRelationFilter } export type SalesInvoiceOrderByWithRelationInput = { id?: Prisma.SortOrder code?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder + total_amount?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - customerId?: Prisma.SortOrderInput | Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + customer_id?: Prisma.SortOrderInput | Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder customer?: Prisma.CustomerOrderByWithRelationInput items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput _relevance?: Prisma.SalesInvoiceOrderByRelevanceInput } export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{ - id?: number + id?: string code?: string AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] OR?: Prisma.SalesInvoiceWhereInput[] NOT?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] - totalAmount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null - createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null + created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + account_id?: Prisma.StringFilter<"SalesInvoice"> | string + complex_id?: Prisma.StringFilter<"SalesInvoice"> | string customer?: Prisma.XOR | null items?: Prisma.SalesInvoiceItemListRelationFilter - salesInvoicePayments?: Prisma.SalesInvoicePaymentListRelationFilter + sales_invoice_payments?: Prisma.SalesInvoicePaymentListRelationFilter }, "id" | "code"> export type SalesInvoiceOrderByWithAggregationInput = { id?: Prisma.SortOrder code?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder + total_amount?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - customerId?: Prisma.SortOrderInput | Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + customer_id?: Prisma.SortOrderInput | Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder _count?: Prisma.SalesInvoiceCountOrderByAggregateInput _avg?: Prisma.SalesInvoiceAvgOrderByAggregateInput _max?: Prisma.SalesInvoiceMaxOrderByAggregateInput @@ -294,87 +308,106 @@ export type SalesInvoiceScalarWhereWithAggregatesInput = { AND?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] OR?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] NOT?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"SalesInvoice"> | number + id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string code?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string - totalAmount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoice"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string - customerId?: Prisma.IntNullableWithAggregatesFilter<"SalesInvoice"> | number | null + created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string + customer_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoice"> | string | null + account_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string + complex_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string } export type SalesInvoiceCreateInput = { + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput + created_at?: Date | string + updated_at?: Date | string + account_id: string + complex_id: string + customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput } export type SalesInvoiceUncheckedCreateInput = { - id?: number + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customerId?: number | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + account_id: string + complex_id: string items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput } export type SalesInvoiceUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput } export type SalesInvoiceUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput } export type SalesInvoiceCreateManyInput = { - id?: number + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customerId?: number | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + account_id: string + complex_id: string } export type SalesInvoiceUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceListRelationFilter = { @@ -396,43 +429,45 @@ export type SalesInvoiceOrderByRelevanceInput = { export type SalesInvoiceCountOrderByAggregateInput = { id?: Prisma.SortOrder code?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder + total_amount?: Prisma.SortOrder description?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - customerId?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + customer_id?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type SalesInvoiceAvgOrderByAggregateInput = { - id?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - customerId?: Prisma.SortOrder + total_amount?: Prisma.SortOrder } export type SalesInvoiceMaxOrderByAggregateInput = { id?: Prisma.SortOrder code?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder + total_amount?: Prisma.SortOrder description?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - customerId?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + customer_id?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type SalesInvoiceMinOrderByAggregateInput = { id?: Prisma.SortOrder code?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder + total_amount?: Prisma.SortOrder description?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - customerId?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + customer_id?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type SalesInvoiceSumOrderByAggregateInput = { - id?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - customerId?: Prisma.SortOrder + total_amount?: Prisma.SortOrder } export type SalesInvoiceScalarRelationFilter = { @@ -496,39 +531,44 @@ export type SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput = { update?: Prisma.XOR, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput> } -export type SalesInvoiceCreateNestedOneWithoutSalesInvoicePaymentsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput +export type SalesInvoiceCreateNestedOneWithoutSales_invoice_paymentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSales_invoice_paymentsInput connect?: Prisma.SalesInvoiceWhereUniqueInput } -export type SalesInvoiceUpdateOneRequiredWithoutSalesInvoicePaymentsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput - upsert?: Prisma.SalesInvoiceUpsertWithoutSalesInvoicePaymentsInput +export type SalesInvoiceUpdateOneRequiredWithoutSales_invoice_paymentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSales_invoice_paymentsInput + upsert?: Prisma.SalesInvoiceUpsertWithoutSales_invoice_paymentsInput connect?: Prisma.SalesInvoiceWhereUniqueInput - update?: Prisma.XOR, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput> + update?: Prisma.XOR, Prisma.SalesInvoiceUncheckedUpdateWithoutSales_invoice_paymentsInput> } export type SalesInvoiceCreateWithoutCustomerInput = { + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string + created_at?: Date | string + updated_at?: Date | string + account_id: string + complex_id: string items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput } export type SalesInvoiceUncheckedCreateWithoutCustomerInput = { - id?: number + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string + created_at?: Date | string + updated_at?: Date | string + account_id: string + complex_id: string items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput } export type SalesInvoiceCreateOrConnectWithoutCustomerInput = { @@ -561,34 +601,41 @@ export type SalesInvoiceScalarWhereInput = { AND?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] OR?: Prisma.SalesInvoiceScalarWhereInput[] NOT?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] - id?: Prisma.IntFilter<"SalesInvoice"> | number + id?: Prisma.StringFilter<"SalesInvoice"> | string code?: Prisma.StringFilter<"SalesInvoice"> | string - totalAmount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null - createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string - customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null + created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + account_id?: Prisma.StringFilter<"SalesInvoice"> | string + complex_id?: Prisma.StringFilter<"SalesInvoice"> | string } export type SalesInvoiceCreateWithoutItemsInput = { + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput + created_at?: Date | string + updated_at?: Date | string + account_id: string + complex_id: string + customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput } export type SalesInvoiceUncheckedCreateWithoutItemsInput = { - id?: number + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customerId?: number | null - salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + account_id: string + complex_id: string + sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput } export type SalesInvoiceCreateOrConnectWithoutItemsInput = { @@ -608,121 +655,145 @@ export type SalesInvoiceUpdateToOneWithWhereWithoutItemsInput = { } export type SalesInvoiceUpdateWithoutItemsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput } export type SalesInvoiceUncheckedUpdateWithoutItemsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput } -export type SalesInvoiceCreateWithoutSalesInvoicePaymentsInput = { +export type SalesInvoiceCreateWithoutSales_invoice_paymentsInput = { + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput + created_at?: Date | string + updated_at?: Date | string + account_id: string + complex_id: string + customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput } -export type SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput = { - id?: number +export type SalesInvoiceUncheckedCreateWithoutSales_invoice_paymentsInput = { + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - customerId?: number | null + created_at?: Date | string + updated_at?: Date | string + customer_id?: string | null + account_id: string + complex_id: string items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput } -export type SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput = { +export type SalesInvoiceCreateOrConnectWithoutSales_invoice_paymentsInput = { where: Prisma.SalesInvoiceWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type SalesInvoiceUpsertWithoutSalesInvoicePaymentsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type SalesInvoiceUpsertWithoutSales_invoice_paymentsInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.SalesInvoiceWhereInput } -export type SalesInvoiceUpdateToOneWithWhereWithoutSalesInvoicePaymentsInput = { +export type SalesInvoiceUpdateToOneWithWhereWithoutSales_invoice_paymentsInput = { where?: Prisma.SalesInvoiceWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput = { +export type SalesInvoiceUpdateWithoutSales_invoice_paymentsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput } -export type SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number +export type SalesInvoiceUncheckedUpdateWithoutSales_invoice_paymentsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput } export type SalesInvoiceCreateManyCustomerInput = { - id?: number + id?: string code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null - createdAt?: Date | string - updatedAt?: Date | string + created_at?: Date | string + updated_at?: Date | string + account_id: string + complex_id: string } export type SalesInvoiceUpdateWithoutCustomerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput } export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput - salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput + sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput } export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } @@ -732,12 +803,12 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = { export type SalesInvoiceCountOutputType = { items: number - salesInvoicePayments: number + sales_invoice_payments: number } export type SalesInvoiceCountOutputTypeSelect = { items?: boolean | SalesInvoiceCountOutputTypeCountItemsArgs - salesInvoicePayments?: boolean | SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs + sales_invoice_payments?: boolean | SalesInvoiceCountOutputTypeCountSales_invoice_paymentsArgs } /** @@ -760,7 +831,7 @@ export type SalesInvoiceCountOutputTypeCountItemsArgs = { +export type SalesInvoiceCountOutputTypeCountSales_invoice_paymentsArgs = { where?: Prisma.SalesInvoicePaymentWhereInput } @@ -768,14 +839,16 @@ export type SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs = runtime.Types.Extensions.GetSelect<{ id?: boolean code?: boolean - totalAmount?: boolean + total_amount?: boolean description?: boolean - createdAt?: boolean - updatedAt?: boolean - customerId?: boolean + created_at?: boolean + updated_at?: boolean + customer_id?: boolean + account_id?: boolean + complex_id?: boolean customer?: boolean | Prisma.SalesInvoice$customerArgs items?: boolean | Prisma.SalesInvoice$itemsArgs - salesInvoicePayments?: boolean | Prisma.SalesInvoice$salesInvoicePaymentsArgs + sales_invoice_payments?: boolean | Prisma.SalesInvoice$sales_invoice_paymentsArgs _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs }, ExtArgs["result"]["salesInvoice"]> @@ -784,18 +857,20 @@ export type SalesInvoiceSelect = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "customerId", ExtArgs["result"]["salesInvoice"]> +export type SalesInvoiceOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "total_amount" | "description" | "created_at" | "updated_at" | "customer_id" | "account_id" | "complex_id", ExtArgs["result"]["salesInvoice"]> export type SalesInvoiceInclude = { customer?: boolean | Prisma.SalesInvoice$customerArgs items?: boolean | Prisma.SalesInvoice$itemsArgs - salesInvoicePayments?: boolean | Prisma.SalesInvoice$salesInvoicePaymentsArgs + sales_invoice_payments?: boolean | Prisma.SalesInvoice$sales_invoice_paymentsArgs _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs } @@ -804,16 +879,18 @@ export type $SalesInvoicePayload | null items: Prisma.$SalesInvoiceItemPayload[] - salesInvoicePayments: Prisma.$SalesInvoicePaymentPayload[] + sales_invoice_payments: Prisma.$SalesInvoicePaymentPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number + id: string code: string - totalAmount: runtime.Decimal + total_amount: runtime.Decimal description: string | null - createdAt: Date - updatedAt: Date - customerId: number | null + created_at: Date + updated_at: Date + customer_id: string | null + account_id: string + complex_id: string }, ExtArgs["result"]["salesInvoice"]> composites: {} } @@ -1156,7 +1233,7 @@ export interface Prisma__SalesInvoiceClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - salesInvoicePayments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + sales_invoice_payments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1186,13 +1263,15 @@ export interface Prisma__SalesInvoiceClient + readonly id: Prisma.FieldRef<"SalesInvoice", 'String'> readonly code: Prisma.FieldRef<"SalesInvoice", 'String'> - readonly totalAmount: Prisma.FieldRef<"SalesInvoice", 'Decimal'> + readonly total_amount: Prisma.FieldRef<"SalesInvoice", 'Decimal'> readonly description: Prisma.FieldRef<"SalesInvoice", 'String'> - readonly createdAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'> - readonly customerId: Prisma.FieldRef<"SalesInvoice", 'Int'> + readonly created_at: Prisma.FieldRef<"SalesInvoice", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"SalesInvoice", 'DateTime'> + readonly customer_id: Prisma.FieldRef<"SalesInvoice", 'String'> + readonly account_id: Prisma.FieldRef<"SalesInvoice", 'String'> + readonly complex_id: Prisma.FieldRef<"SalesInvoice", 'String'> } @@ -1579,9 +1658,9 @@ export type SalesInvoice$itemsArgs = { +export type SalesInvoice$sales_invoice_paymentsArgs = { /** * Select specific fields to fetch from the SalesInvoicePayment */ diff --git a/src/generated/prisma/models/SalesInvoiceItem.ts b/src/generated/prisma/models/SalesInvoiceItem.ts index e11e04b..2ec2912 100644 --- a/src/generated/prisma/models/SalesInvoiceItem.ts +++ b/src/generated/prisma/models/SalesInvoiceItem.ts @@ -27,111 +27,95 @@ export type AggregateSalesInvoiceItem = { } export type SalesInvoiceItemAvgAggregateOutputType = { - id: number | null count: runtime.Decimal | null - unitPrice: runtime.Decimal | null - totalAmount: runtime.Decimal | null - invoiceId: number | null - goodId: number | null - serviceId: number | null + unit_price: runtime.Decimal | null + total_amount: runtime.Decimal | null } export type SalesInvoiceItemSumAggregateOutputType = { - id: number | null count: runtime.Decimal | null - unitPrice: runtime.Decimal | null - totalAmount: runtime.Decimal | null - invoiceId: number | null - goodId: number | null - serviceId: number | null + unit_price: runtime.Decimal | null + total_amount: runtime.Decimal | null } export type SalesInvoiceItemMinAggregateOutputType = { - id: number | null + id: string | null count: runtime.Decimal | null - unitPrice: runtime.Decimal | null - totalAmount: runtime.Decimal | null - createdAt: Date | null - invoiceId: number | null - goodId: number | null - serviceId: number | null + unit_price: runtime.Decimal | null + total_amount: runtime.Decimal | null + created_at: Date | null + invoice_id: string | null + good_id: string | null + service_id: string | null } export type SalesInvoiceItemMaxAggregateOutputType = { - id: number | null + id: string | null count: runtime.Decimal | null - unitPrice: runtime.Decimal | null - totalAmount: runtime.Decimal | null - createdAt: Date | null - invoiceId: number | null - goodId: number | null - serviceId: number | null + unit_price: runtime.Decimal | null + total_amount: runtime.Decimal | null + created_at: Date | null + invoice_id: string | null + good_id: string | null + service_id: string | null } export type SalesInvoiceItemCountAggregateOutputType = { id: number count: number - unitPrice: number - totalAmount: number - createdAt: number - invoiceId: number - goodId: number - serviceId: number + unit_price: number + total_amount: number + created_at: number + invoice_id: number + good_id: number + service_id: number _all: number } export type SalesInvoiceItemAvgAggregateInputType = { - id?: true count?: true - unitPrice?: true - totalAmount?: true - invoiceId?: true - goodId?: true - serviceId?: true + unit_price?: true + total_amount?: true } export type SalesInvoiceItemSumAggregateInputType = { - id?: true count?: true - unitPrice?: true - totalAmount?: true - invoiceId?: true - goodId?: true - serviceId?: true + unit_price?: true + total_amount?: true } export type SalesInvoiceItemMinAggregateInputType = { id?: true count?: true - unitPrice?: true - totalAmount?: true - createdAt?: true - invoiceId?: true - goodId?: true - serviceId?: true + unit_price?: true + total_amount?: true + created_at?: true + invoice_id?: true + good_id?: true + service_id?: true } export type SalesInvoiceItemMaxAggregateInputType = { id?: true count?: true - unitPrice?: true - totalAmount?: true - createdAt?: true - invoiceId?: true - goodId?: true - serviceId?: true + unit_price?: true + total_amount?: true + created_at?: true + invoice_id?: true + good_id?: true + service_id?: true } export type SalesInvoiceItemCountAggregateInputType = { id?: true count?: true - unitPrice?: true - totalAmount?: true - createdAt?: true - invoiceId?: true - goodId?: true - serviceId?: true + unit_price?: true + total_amount?: true + created_at?: true + invoice_id?: true + good_id?: true + service_id?: true _all?: true } @@ -222,14 +206,14 @@ export type SalesInvoiceItemGroupByArgs | number + id?: Prisma.StringFilter<"SalesInvoiceItem"> | string count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string - invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number - goodId?: Prisma.IntFilter<"SalesInvoiceItem"> | number - serviceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string + invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string + good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string + service_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string invoice?: Prisma.XOR good?: Prisma.XOR | null service?: Prisma.XOR | null @@ -272,29 +256,30 @@ export type SalesInvoiceItemWhereInput = { export type SalesInvoiceItemOrderByWithRelationInput = { id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder + created_at?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder + good_id?: Prisma.SortOrder + service_id?: Prisma.SortOrder invoice?: Prisma.SalesInvoiceOrderByWithRelationInput good?: Prisma.GoodOrderByWithRelationInput service?: Prisma.ServiceOrderByWithRelationInput + _relevance?: Prisma.SalesInvoiceItemOrderByRelevanceInput } export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{ - id?: number + id?: string AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] OR?: Prisma.SalesInvoiceItemWhereInput[] NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string - invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number - goodId?: Prisma.IntFilter<"SalesInvoiceItem"> | number - serviceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string + invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string + good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string + service_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string invoice?: Prisma.XOR good?: Prisma.XOR | null service?: Prisma.XOR | null @@ -303,12 +288,12 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{ export type SalesInvoiceItemOrderByWithAggregationInput = { id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder + created_at?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder + good_id?: Prisma.SortOrder + service_id?: Prisma.SortOrder _count?: Prisma.SalesInvoiceItemCountOrderByAggregateInput _avg?: Prisma.SalesInvoiceItemAvgOrderByAggregateInput _max?: Prisma.SalesInvoiceItemMaxOrderByAggregateInput @@ -320,85 +305,88 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = { AND?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] OR?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] NOT?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number + id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string count?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string - invoiceId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number - goodId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number - serviceId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number + unit_price?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string + invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string + good_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string + service_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string } export type SalesInvoiceItemCreateInput = { + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput - good?: Prisma.GoodCreateNestedOneWithoutSalesInvoiceItemsInput - service?: Prisma.ServiceCreateNestedOneWithoutSalesInvoiceItemsInput + good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput + service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput } export type SalesInvoiceItemUncheckedCreateInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - invoiceId: number - goodId: number - serviceId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + invoice_id: string + good_id: string + service_id: string } export type SalesInvoiceItemUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput - good?: Prisma.GoodUpdateOneWithoutSalesInvoiceItemsNestedInput - service?: Prisma.ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput + good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput + service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput } export type SalesInvoiceItemUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number - goodId?: Prisma.IntFieldUpdateOperationsInput | number - serviceId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string + good_id?: Prisma.StringFieldUpdateOperationsInput | string + service_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemCreateManyInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - invoiceId: number - goodId: number - serviceId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + invoice_id: string + good_id: string + service_id: string } export type SalesInvoiceItemUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoiceItemUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number - goodId?: Prisma.IntFieldUpdateOperationsInput | number - serviceId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string + good_id?: Prisma.StringFieldUpdateOperationsInput | string + service_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemListRelationFilter = { @@ -411,57 +399,55 @@ export type SalesInvoiceItemOrderByRelationAggregateInput = { _count?: Prisma.SortOrder } +export type SalesInvoiceItemOrderByRelevanceInput = { + fields: Prisma.SalesInvoiceItemOrderByRelevanceFieldEnum | Prisma.SalesInvoiceItemOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + export type SalesInvoiceItemCountOrderByAggregateInput = { id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder + created_at?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder + good_id?: Prisma.SortOrder + service_id?: Prisma.SortOrder } export type SalesInvoiceItemAvgOrderByAggregateInput = { - id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder } export type SalesInvoiceItemMaxOrderByAggregateInput = { id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder + created_at?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder + good_id?: Prisma.SortOrder + service_id?: Prisma.SortOrder } export type SalesInvoiceItemMinOrderByAggregateInput = { id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder + created_at?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder + good_id?: Prisma.SortOrder + service_id?: Prisma.SortOrder } export type SalesInvoiceItemSumOrderByAggregateInput = { - id?: Prisma.SortOrder count?: Prisma.SortOrder - unitPrice?: Prisma.SortOrder - totalAmount?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder - goodId?: Prisma.SortOrder - serviceId?: Prisma.SortOrder + unit_price?: Prisma.SortOrder + total_amount?: Prisma.SortOrder } export type SalesInvoiceItemCreateNestedManyWithoutGoodInput = { @@ -591,22 +577,23 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput = { } export type SalesInvoiceItemCreateWithoutGoodInput = { + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput - service?: Prisma.ServiceCreateNestedOneWithoutSalesInvoiceItemsInput + service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput } export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - invoiceId: number - serviceId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + invoice_id: string + service_id: string } export type SalesInvoiceItemCreateOrConnectWithoutGoodInput = { @@ -639,33 +626,34 @@ export type SalesInvoiceItemScalarWhereInput = { AND?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] OR?: Prisma.SalesInvoiceItemScalarWhereInput[] NOT?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] - id?: Prisma.IntFilter<"SalesInvoiceItem"> | number + id?: Prisma.StringFilter<"SalesInvoiceItem"> | string count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string - invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number - goodId?: Prisma.IntFilter<"SalesInvoiceItem"> | number - serviceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string + invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string + good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string + service_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string } export type SalesInvoiceItemCreateWithoutInvoiceInput = { + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - good?: Prisma.GoodCreateNestedOneWithoutSalesInvoiceItemsInput - service?: Prisma.ServiceCreateNestedOneWithoutSalesInvoiceItemsInput + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput + service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput } export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - goodId: number - serviceId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + good_id: string + service_id: string } export type SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = { @@ -695,22 +683,23 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput = { } export type SalesInvoiceItemCreateWithoutServiceInput = { + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput - good?: Prisma.GoodCreateNestedOneWithoutSalesInvoiceItemsInput + good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput } export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - invoiceId: number - goodId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + invoice_id: string + good_id: string } export type SalesInvoiceItemCreateOrConnectWithoutServiceInput = { @@ -740,120 +729,123 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutServiceInput = { } export type SalesInvoiceItemCreateManyGoodInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - invoiceId: number - serviceId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + invoice_id: string + service_id: string } export type SalesInvoiceItemUpdateWithoutGoodInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput - service?: Prisma.ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput + service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput } export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number - serviceId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string + service_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number - serviceId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string + service_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemCreateManyInvoiceInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - goodId: number - serviceId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + good_id: string + service_id: string } export type SalesInvoiceItemUpdateWithoutInvoiceInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - good?: Prisma.GoodUpdateOneWithoutSalesInvoiceItemsNestedInput - service?: Prisma.ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput + service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput } export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - goodId?: Prisma.IntFieldUpdateOperationsInput | number - serviceId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + good_id?: Prisma.StringFieldUpdateOperationsInput | string + service_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - goodId?: Prisma.IntFieldUpdateOperationsInput | number - serviceId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + good_id?: Prisma.StringFieldUpdateOperationsInput | string + service_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemCreateManyServiceInput = { - id?: number + id?: string count: runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Date | string - invoiceId: number - goodId: number + unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + invoice_id: string + good_id: string } export type SalesInvoiceItemUpdateWithoutServiceInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput - good?: Prisma.GoodUpdateOneWithoutSalesInvoiceItemsNestedInput + good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput } export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number - goodId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string + good_id?: Prisma.StringFieldUpdateOperationsInput | string } export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number - goodId?: Prisma.IntFieldUpdateOperationsInput | number + unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string + good_id?: Prisma.StringFieldUpdateOperationsInput | string } @@ -861,12 +853,12 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = { export type SalesInvoiceItemSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean count?: boolean - unitPrice?: boolean - totalAmount?: boolean - createdAt?: boolean - invoiceId?: boolean - goodId?: boolean - serviceId?: boolean + unit_price?: boolean + total_amount?: boolean + created_at?: boolean + invoice_id?: boolean + good_id?: boolean + service_id?: boolean invoice?: boolean | Prisma.SalesInvoiceDefaultArgs good?: boolean | Prisma.SalesInvoiceItem$goodArgs service?: boolean | Prisma.SalesInvoiceItem$serviceArgs @@ -877,15 +869,15 @@ export type SalesInvoiceItemSelect = runtime.Types.Extensions.GetOmit<"id" | "count" | "unitPrice" | "totalAmount" | "createdAt" | "invoiceId" | "goodId" | "serviceId", ExtArgs["result"]["salesInvoiceItem"]> +export type SalesInvoiceItemOmit = runtime.Types.Extensions.GetOmit<"id" | "count" | "unit_price" | "total_amount" | "created_at" | "invoice_id" | "good_id" | "service_id", ExtArgs["result"]["salesInvoiceItem"]> export type SalesInvoiceItemInclude = { invoice?: boolean | Prisma.SalesInvoiceDefaultArgs good?: boolean | Prisma.SalesInvoiceItem$goodArgs @@ -900,14 +892,14 @@ export type $SalesInvoiceItemPayload | null } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number + id: string count: runtime.Decimal - unitPrice: runtime.Decimal - totalAmount: runtime.Decimal - createdAt: Date - invoiceId: number - goodId: number - serviceId: number + unit_price: runtime.Decimal + total_amount: runtime.Decimal + created_at: Date + invoice_id: string + good_id: string + service_id: string }, ExtArgs["result"]["salesInvoiceItem"]> composites: {} } @@ -1280,14 +1272,14 @@ export interface Prisma__SalesInvoiceItemClient + readonly id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> readonly count: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> - readonly unitPrice: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> - readonly totalAmount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> - readonly createdAt: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'> - readonly invoiceId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> - readonly goodId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> - readonly serviceId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> + readonly unit_price: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> + readonly total_amount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> + readonly created_at: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'> + readonly invoice_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> + readonly good_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> + readonly service_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> } diff --git a/src/generated/prisma/models/SalesInvoicePayment.ts b/src/generated/prisma/models/SalesInvoicePayment.ts index 7f304a9..3657a65 100644 --- a/src/generated/prisma/models/SalesInvoicePayment.ts +++ b/src/generated/prisma/models/SalesInvoicePayment.ts @@ -27,83 +27,75 @@ export type AggregateSalesInvoicePayment = { } export type SalesInvoicePaymentAvgAggregateOutputType = { - id: number | null - invoiceId: number | null amount: runtime.Decimal | null } export type SalesInvoicePaymentSumAggregateOutputType = { - id: number | null - invoiceId: number | null amount: runtime.Decimal | null } export type SalesInvoicePaymentMinAggregateOutputType = { - id: number | null - invoiceId: number | null + id: string | null + invoice_id: string | null amount: runtime.Decimal | null - paymentMethod: $Enums.PaymentMethodType | null - paidAt: Date | null - createdAt: Date | null + payment_method: $Enums.PaymentMethodType | null + paid_at: Date | null + created_at: Date | null } export type SalesInvoicePaymentMaxAggregateOutputType = { - id: number | null - invoiceId: number | null + id: string | null + invoice_id: string | null amount: runtime.Decimal | null - paymentMethod: $Enums.PaymentMethodType | null - paidAt: Date | null - createdAt: Date | null + payment_method: $Enums.PaymentMethodType | null + paid_at: Date | null + created_at: Date | null } export type SalesInvoicePaymentCountAggregateOutputType = { id: number - invoiceId: number + invoice_id: number amount: number - paymentMethod: number - paidAt: number - createdAt: number + payment_method: number + paid_at: number + created_at: number _all: number } export type SalesInvoicePaymentAvgAggregateInputType = { - id?: true - invoiceId?: true amount?: true } export type SalesInvoicePaymentSumAggregateInputType = { - id?: true - invoiceId?: true amount?: true } export type SalesInvoicePaymentMinAggregateInputType = { id?: true - invoiceId?: true + invoice_id?: true amount?: true - paymentMethod?: true - paidAt?: true - createdAt?: true + payment_method?: true + paid_at?: true + created_at?: true } export type SalesInvoicePaymentMaxAggregateInputType = { id?: true - invoiceId?: true + invoice_id?: true amount?: true - paymentMethod?: true - paidAt?: true - createdAt?: true + payment_method?: true + paid_at?: true + created_at?: true } export type SalesInvoicePaymentCountAggregateInputType = { id?: true - invoiceId?: true + invoice_id?: true amount?: true - paymentMethod?: true - paidAt?: true - createdAt?: true + payment_method?: true + paid_at?: true + created_at?: true _all?: true } @@ -194,12 +186,12 @@ export type SalesInvoicePaymentGroupByArgs | number - invoiceId?: Prisma.IntFilter<"SalesInvoicePayment"> | number + id?: Prisma.StringFilter<"SalesInvoicePayment"> | string + invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string - createdAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string + created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string invoice?: Prisma.XOR } export type SalesInvoicePaymentOrderByWithRelationInput = { id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder amount?: Prisma.SortOrder - paymentMethod?: Prisma.SortOrder - paidAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder + payment_method?: Prisma.SortOrder + paid_at?: Prisma.SortOrder + created_at?: Prisma.SortOrder invoice?: Prisma.SalesInvoiceOrderByWithRelationInput + _relevance?: Prisma.SalesInvoicePaymentOrderByRelevanceInput } export type SalesInvoicePaymentWhereUniqueInput = Prisma.AtLeast<{ - id?: number + id?: string AND?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[] OR?: Prisma.SalesInvoicePaymentWhereInput[] NOT?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[] - invoiceId?: Prisma.IntFilter<"SalesInvoicePayment"> | number + invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string - createdAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string + created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string invoice?: Prisma.XOR }, "id"> export type SalesInvoicePaymentOrderByWithAggregationInput = { id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder amount?: Prisma.SortOrder - paymentMethod?: Prisma.SortOrder - paidAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder + payment_method?: Prisma.SortOrder + paid_at?: Prisma.SortOrder + created_at?: Prisma.SortOrder _count?: Prisma.SalesInvoicePaymentCountOrderByAggregateInput _avg?: Prisma.SalesInvoicePaymentAvgOrderByAggregateInput _max?: Prisma.SalesInvoicePaymentMaxOrderByAggregateInput @@ -276,71 +269,74 @@ export type SalesInvoicePaymentScalarWhereWithAggregatesInput = { AND?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput | Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[] OR?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[] NOT?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput | Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"SalesInvoicePayment"> | number - invoiceId?: Prisma.IntWithAggregatesFilter<"SalesInvoicePayment"> | number + id?: Prisma.StringWithAggregatesFilter<"SalesInvoicePayment"> | string + invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoicePayment"> | string amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string - createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string } export type SalesInvoicePaymentCreateInput = { + id?: string amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.PaymentMethodType - paidAt: Date | string - createdAt?: Date | string - invoice: Prisma.SalesInvoiceCreateNestedOneWithoutSalesInvoicePaymentsInput + payment_method: $Enums.PaymentMethodType + paid_at: Date | string + created_at?: Date | string + invoice: Prisma.SalesInvoiceCreateNestedOneWithoutSales_invoice_paymentsInput } export type SalesInvoicePaymentUncheckedCreateInput = { - id?: number - invoiceId: number + id?: string + invoice_id: string amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.PaymentMethodType - paidAt: Date | string - createdAt?: Date | string + payment_method: $Enums.PaymentMethodType + paid_at: Date | string + created_at?: Date | string } export type SalesInvoicePaymentUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutSalesInvoicePaymentsNestedInput + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutSales_invoice_paymentsNestedInput } export type SalesInvoicePaymentUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoicePaymentCreateManyInput = { - id?: number - invoiceId: number + id?: string + invoice_id: string amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.PaymentMethodType - paidAt: Date | string - createdAt?: Date | string + payment_method: $Enums.PaymentMethodType + paid_at: Date | string + created_at?: Date | string } export type SalesInvoicePaymentUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoicePaymentUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - invoiceId?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string + invoice_id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoicePaymentListRelationFilter = { @@ -353,42 +349,44 @@ export type SalesInvoicePaymentOrderByRelationAggregateInput = { _count?: Prisma.SortOrder } +export type SalesInvoicePaymentOrderByRelevanceInput = { + fields: Prisma.SalesInvoicePaymentOrderByRelevanceFieldEnum | Prisma.SalesInvoicePaymentOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + export type SalesInvoicePaymentCountOrderByAggregateInput = { id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder amount?: Prisma.SortOrder - paymentMethod?: Prisma.SortOrder - paidAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder + payment_method?: Prisma.SortOrder + paid_at?: Prisma.SortOrder + created_at?: Prisma.SortOrder } export type SalesInvoicePaymentAvgOrderByAggregateInput = { - id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder amount?: Prisma.SortOrder } export type SalesInvoicePaymentMaxOrderByAggregateInput = { id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder amount?: Prisma.SortOrder - paymentMethod?: Prisma.SortOrder - paidAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder + payment_method?: Prisma.SortOrder + paid_at?: Prisma.SortOrder + created_at?: Prisma.SortOrder } export type SalesInvoicePaymentMinOrderByAggregateInput = { id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder + invoice_id?: Prisma.SortOrder amount?: Prisma.SortOrder - paymentMethod?: Prisma.SortOrder - paidAt?: Prisma.SortOrder - createdAt?: Prisma.SortOrder + payment_method?: Prisma.SortOrder + paid_at?: Prisma.SortOrder + created_at?: Prisma.SortOrder } export type SalesInvoicePaymentSumOrderByAggregateInput = { - id?: Prisma.SortOrder - invoiceId?: Prisma.SortOrder amount?: Prisma.SortOrder } @@ -439,18 +437,19 @@ export type EnumPaymentMethodTypeFieldUpdateOperationsInput = { } export type SalesInvoicePaymentCreateWithoutInvoiceInput = { + id?: string amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.PaymentMethodType - paidAt: Date | string - createdAt?: Date | string + payment_method: $Enums.PaymentMethodType + paid_at: Date | string + created_at?: Date | string } export type SalesInvoicePaymentUncheckedCreateWithoutInvoiceInput = { - id?: number + id?: string amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.PaymentMethodType - paidAt: Date | string - createdAt?: Date | string + payment_method: $Enums.PaymentMethodType + paid_at: Date | string + created_at?: Date | string } export type SalesInvoicePaymentCreateOrConnectWithoutInvoiceInput = { @@ -483,54 +482,55 @@ export type SalesInvoicePaymentScalarWhereInput = { AND?: Prisma.SalesInvoicePaymentScalarWhereInput | Prisma.SalesInvoicePaymentScalarWhereInput[] OR?: Prisma.SalesInvoicePaymentScalarWhereInput[] NOT?: Prisma.SalesInvoicePaymentScalarWhereInput | Prisma.SalesInvoicePaymentScalarWhereInput[] - id?: Prisma.IntFilter<"SalesInvoicePayment"> | number - invoiceId?: Prisma.IntFilter<"SalesInvoicePayment"> | number + id?: Prisma.StringFilter<"SalesInvoicePayment"> | string + invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string - createdAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string + created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string } export type SalesInvoicePaymentCreateManyInvoiceInput = { - id?: number + id?: string amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.PaymentMethodType - paidAt: Date | string - createdAt?: Date | string + payment_method: $Enums.PaymentMethodType + paid_at: Date | string + created_at?: Date | string } export type SalesInvoicePaymentUpdateWithoutInvoiceInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoicePaymentUncheckedUpdateWithoutInvoiceInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType - paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type SalesInvoicePaymentSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean - invoiceId?: boolean + invoice_id?: boolean amount?: boolean - paymentMethod?: boolean - paidAt?: boolean - createdAt?: boolean + payment_method?: boolean + paid_at?: boolean + created_at?: boolean invoice?: boolean | Prisma.SalesInvoiceDefaultArgs }, ExtArgs["result"]["salesInvoicePayment"]> @@ -538,14 +538,14 @@ export type SalesInvoicePaymentSelect = runtime.Types.Extensions.GetOmit<"id" | "invoiceId" | "amount" | "paymentMethod" | "paidAt" | "createdAt", ExtArgs["result"]["salesInvoicePayment"]> +export type SalesInvoicePaymentOmit = runtime.Types.Extensions.GetOmit<"id" | "invoice_id" | "amount" | "payment_method" | "paid_at" | "created_at", ExtArgs["result"]["salesInvoicePayment"]> export type SalesInvoicePaymentInclude = { invoice?: boolean | Prisma.SalesInvoiceDefaultArgs } @@ -556,12 +556,12 @@ export type $SalesInvoicePaymentPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number - invoiceId: number + id: string + invoice_id: string amount: runtime.Decimal - paymentMethod: $Enums.PaymentMethodType - paidAt: Date - createdAt: Date + payment_method: $Enums.PaymentMethodType + paid_at: Date + created_at: Date }, ExtArgs["result"]["salesInvoicePayment"]> composites: {} } @@ -932,12 +932,12 @@ export interface Prisma__SalesInvoicePaymentClient - readonly invoiceId: Prisma.FieldRef<"SalesInvoicePayment", 'Int'> + readonly id: Prisma.FieldRef<"SalesInvoicePayment", 'String'> + readonly invoice_id: Prisma.FieldRef<"SalesInvoicePayment", 'String'> readonly amount: Prisma.FieldRef<"SalesInvoicePayment", 'Decimal'> - readonly paymentMethod: Prisma.FieldRef<"SalesInvoicePayment", 'PaymentMethodType'> - readonly paidAt: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'> - readonly createdAt: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'> + readonly payment_method: Prisma.FieldRef<"SalesInvoicePayment", 'PaymentMethodType'> + readonly paid_at: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'> + readonly created_at: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'> } diff --git a/src/generated/prisma/models/Service.ts b/src/generated/prisma/models/Service.ts index 340daba..e3c0f03 100644 --- a/src/generated/prisma/models/Service.ts +++ b/src/generated/prisma/models/Service.ts @@ -27,41 +27,43 @@ export type AggregateService = { } export type ServiceAvgAggregateOutputType = { - id: number | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + base_sale_price: runtime.Decimal | null } export type ServiceSumAggregateOutputType = { - id: number | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + base_sale_price: runtime.Decimal | null } export type ServiceMinAggregateOutputType = { - id: number | null + id: string | null name: string | null description: string | null sku: string | null + local_sku: string | null barcode: string | null - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + created_at: Date | null + updated_at: Date | null + deleted_at: Date | null + category_id: string | null + base_sale_price: runtime.Decimal | null + account_id: string | null + complex_id: string | null } export type ServiceMaxAggregateOutputType = { - id: number | null + id: string | null name: string | null description: string | null sku: string | null + local_sku: string | null barcode: string | null - createdAt: Date | null - updatedAt: Date | null - deletedAt: Date | null - categoryId: number | null - baseSalePrice: runtime.Decimal | null + created_at: Date | null + updated_at: Date | null + deleted_at: Date | null + category_id: string | null + base_sale_price: runtime.Decimal | null + account_id: string | null + complex_id: string | null } export type ServiceCountAggregateOutputType = { @@ -69,26 +71,25 @@ export type ServiceCountAggregateOutputType = { name: number description: number sku: number + local_sku: number barcode: number - createdAt: number - updatedAt: number - deletedAt: number - categoryId: number - baseSalePrice: number + created_at: number + updated_at: number + deleted_at: number + category_id: number + base_sale_price: number + account_id: number + complex_id: number _all: number } export type ServiceAvgAggregateInputType = { - id?: true - categoryId?: true - baseSalePrice?: true + base_sale_price?: true } export type ServiceSumAggregateInputType = { - id?: true - categoryId?: true - baseSalePrice?: true + base_sale_price?: true } export type ServiceMinAggregateInputType = { @@ -96,12 +97,15 @@ export type ServiceMinAggregateInputType = { name?: true description?: true sku?: true + local_sku?: true barcode?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - categoryId?: true - baseSalePrice?: true + created_at?: true + updated_at?: true + deleted_at?: true + category_id?: true + base_sale_price?: true + account_id?: true + complex_id?: true } export type ServiceMaxAggregateInputType = { @@ -109,12 +113,15 @@ export type ServiceMaxAggregateInputType = { name?: true description?: true sku?: true + local_sku?: true barcode?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - categoryId?: true - baseSalePrice?: true + created_at?: true + updated_at?: true + deleted_at?: true + category_id?: true + base_sale_price?: true + account_id?: true + complex_id?: true } export type ServiceCountAggregateInputType = { @@ -122,12 +129,15 @@ export type ServiceCountAggregateInputType = { name?: true description?: true sku?: true + local_sku?: true barcode?: true - createdAt?: true - updatedAt?: true - deletedAt?: true - categoryId?: true - baseSalePrice?: true + created_at?: true + updated_at?: true + deleted_at?: true + category_id?: true + base_sale_price?: true + account_id?: true + complex_id?: true _all?: true } @@ -218,16 +228,19 @@ export type ServiceGroupByArgs | number + id?: Prisma.StringFilter<"Service"> | string name?: Prisma.StringFilter<"Service"> | string description?: Prisma.StringNullableFilter<"Service"> | string | null sku?: Prisma.StringFilter<"Service"> | string + local_sku?: Prisma.StringNullableFilter<"Service"> | string | null barcode?: Prisma.StringNullableFilter<"Service"> | string | null - createdAt?: Prisma.DateTimeFilter<"Service"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Service"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null - categoryId?: Prisma.IntNullableFilter<"Service"> | number | null - baseSalePrice?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"Service"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Service"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null + category_id?: Prisma.StringNullableFilter<"Service"> | string | null + base_sale_price?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFilter<"Service"> | string + complex_id?: Prisma.StringFilter<"Service"> | string category?: Prisma.XOR | null - salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter + sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter } export type ServiceOrderByWithRelationInput = { @@ -273,46 +289,55 @@ export type ServiceOrderByWithRelationInput = { name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder sku?: Prisma.SortOrder + local_sku?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - categoryId?: Prisma.SortOrderInput | Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + category_id?: Prisma.SortOrderInput | Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder category?: Prisma.ServiceCategoryOrderByWithRelationInput - salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput + sales_invoice_items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput _relevance?: Prisma.ServiceOrderByRelevanceInput } export type ServiceWhereUniqueInput = Prisma.AtLeast<{ - id?: number + id?: string sku?: string + local_sku?: string barcode?: string AND?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[] OR?: Prisma.ServiceWhereInput[] NOT?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[] name?: Prisma.StringFilter<"Service"> | string description?: Prisma.StringNullableFilter<"Service"> | string | null - createdAt?: Prisma.DateTimeFilter<"Service"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Service"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null - categoryId?: Prisma.IntNullableFilter<"Service"> | number | null - baseSalePrice?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"Service"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Service"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null + category_id?: Prisma.StringNullableFilter<"Service"> | string | null + base_sale_price?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFilter<"Service"> | string + complex_id?: Prisma.StringFilter<"Service"> | string category?: Prisma.XOR | null - salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter -}, "id" | "sku" | "barcode"> + sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter +}, "id" | "sku" | "local_sku" | "barcode"> export type ServiceOrderByWithAggregationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder sku?: Prisma.SortOrder + local_sku?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - categoryId?: Prisma.SortOrderInput | Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + category_id?: Prisma.SortOrderInput | Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder _count?: Prisma.ServiceCountOrderByAggregateInput _avg?: Prisma.ServiceAvgOrderByAggregateInput _max?: Prisma.ServiceMaxOrderByAggregateInput @@ -324,107 +349,134 @@ export type ServiceScalarWhereWithAggregatesInput = { AND?: Prisma.ServiceScalarWhereWithAggregatesInput | Prisma.ServiceScalarWhereWithAggregatesInput[] OR?: Prisma.ServiceScalarWhereWithAggregatesInput[] NOT?: Prisma.ServiceScalarWhereWithAggregatesInput | Prisma.ServiceScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"Service"> | number + id?: Prisma.StringWithAggregatesFilter<"Service"> | string name?: Prisma.StringWithAggregatesFilter<"Service"> | string description?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null sku?: Prisma.StringWithAggregatesFilter<"Service"> | string + local_sku?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null barcode?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string - deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Service"> | Date | string | null - categoryId?: Prisma.IntNullableWithAggregatesFilter<"Service"> | number | null - baseSalePrice?: Prisma.DecimalWithAggregatesFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string + deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Service"> | Date | string | null + category_id?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null + base_sale_price?: Prisma.DecimalWithAggregatesFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringWithAggregatesFilter<"Service"> | string + complex_id?: Prisma.StringWithAggregatesFilter<"Service"> | string } export type ServiceCreateInput = { + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput - salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput + sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput } export type ServiceUncheckedCreateInput = { - id?: number + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - categoryId?: number | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput } export type ServiceUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput - salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput + sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput } export type ServiceUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput } export type ServiceCreateManyInput = { - id?: number + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - categoryId?: number | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string } export type ServiceUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type ServiceUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type ServiceNullableScalarRelationFilter = { @@ -443,18 +495,19 @@ export type ServiceCountOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder sku?: Prisma.SortOrder + local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder + category_id?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type ServiceAvgOrderByAggregateInput = { - id?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder } export type ServiceMaxOrderByAggregateInput = { @@ -462,12 +515,15 @@ export type ServiceMaxOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder sku?: Prisma.SortOrder + local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder + category_id?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type ServiceMinOrderByAggregateInput = { @@ -475,18 +531,19 @@ export type ServiceMinOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder sku?: Prisma.SortOrder + local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder + category_id?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder } export type ServiceSumOrderByAggregateInput = { - id?: Prisma.SortOrder - categoryId?: Prisma.SortOrder - baseSalePrice?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder } export type ServiceListRelationFilter = { @@ -499,20 +556,20 @@ export type ServiceOrderByRelationAggregateInput = { _count?: Prisma.SortOrder } -export type ServiceCreateNestedOneWithoutSalesInvoiceItemsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSalesInvoiceItemsInput +export type ServiceCreateNestedOneWithoutSales_invoice_itemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSales_invoice_itemsInput connect?: Prisma.ServiceWhereUniqueInput } -export type ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSalesInvoiceItemsInput - upsert?: Prisma.ServiceUpsertWithoutSalesInvoiceItemsInput +export type ServiceUpdateOneWithoutSales_invoice_itemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSales_invoice_itemsInput + upsert?: Prisma.ServiceUpsertWithoutSales_invoice_itemsInput disconnect?: Prisma.ServiceWhereInput | boolean delete?: Prisma.ServiceWhereInput | boolean connect?: Prisma.ServiceWhereUniqueInput - update?: Prisma.XOR, Prisma.ServiceUncheckedUpdateWithoutSalesInvoiceItemsInput> + update?: Prisma.XOR, Prisma.ServiceUncheckedUpdateWithoutSales_invoice_itemsInput> } export type ServiceCreateNestedManyWithoutCategoryInput = { @@ -557,95 +614,116 @@ export type ServiceUncheckedUpdateManyWithoutCategoryNestedInput = { deleteMany?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[] } -export type ServiceCreateWithoutSalesInvoiceItemsInput = { +export type ServiceCreateWithoutSales_invoice_itemsInput = { + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput } -export type ServiceUncheckedCreateWithoutSalesInvoiceItemsInput = { - id?: number +export type ServiceUncheckedCreateWithoutSales_invoice_itemsInput = { + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - categoryId?: number | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string } -export type ServiceCreateOrConnectWithoutSalesInvoiceItemsInput = { +export type ServiceCreateOrConnectWithoutSales_invoice_itemsInput = { where: Prisma.ServiceWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type ServiceUpsertWithoutSalesInvoiceItemsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type ServiceUpsertWithoutSales_invoice_itemsInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.ServiceWhereInput } -export type ServiceUpdateToOneWithWhereWithoutSalesInvoiceItemsInput = { +export type ServiceUpdateToOneWithWhereWithoutSales_invoice_itemsInput = { where?: Prisma.ServiceWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type ServiceUpdateWithoutSalesInvoiceItemsInput = { +export type ServiceUpdateWithoutSales_invoice_itemsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput } -export type ServiceUncheckedUpdateWithoutSalesInvoiceItemsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number +export type ServiceUncheckedUpdateWithoutSales_invoice_itemsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type ServiceCreateWithoutCategoryInput = { + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string + sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput } export type ServiceUncheckedCreateWithoutCategoryInput = { - id?: number + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput } export type ServiceCreateOrConnectWithoutCategoryInput = { @@ -678,65 +756,81 @@ export type ServiceScalarWhereInput = { AND?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[] OR?: Prisma.ServiceScalarWhereInput[] NOT?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[] - id?: Prisma.IntFilter<"Service"> | number + id?: Prisma.StringFilter<"Service"> | string name?: Prisma.StringFilter<"Service"> | string description?: Prisma.StringNullableFilter<"Service"> | string | null sku?: Prisma.StringFilter<"Service"> | string + local_sku?: Prisma.StringNullableFilter<"Service"> | string | null barcode?: Prisma.StringNullableFilter<"Service"> | string | null - createdAt?: Prisma.DateTimeFilter<"Service"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Service"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null - categoryId?: Prisma.IntNullableFilter<"Service"> | number | null - baseSalePrice?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFilter<"Service"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Service"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null + category_id?: Prisma.StringNullableFilter<"Service"> | string | null + base_sale_price?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFilter<"Service"> | string + complex_id?: Prisma.StringFilter<"Service"> | string } export type ServiceCreateManyCategoryInput = { - id?: number + id?: string name: string description?: string | null sku: string + local_sku?: string | null barcode?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string + account_id: string + complex_id: string } export type ServiceUpdateWithoutCategoryInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput } export type ServiceUncheckedUpdateWithoutCategoryInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput } export type ServiceUncheckedUpdateManyWithoutCategoryInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string } @@ -745,11 +839,11 @@ export type ServiceUncheckedUpdateManyWithoutCategoryInput = { */ export type ServiceCountOutputType = { - salesInvoiceItems: number + sales_invoice_items: number } export type ServiceCountOutputTypeSelect = { - salesInvoiceItems?: boolean | ServiceCountOutputTypeCountSalesInvoiceItemsArgs + sales_invoice_items?: boolean | ServiceCountOutputTypeCountSales_invoice_itemsArgs } /** @@ -765,7 +859,7 @@ export type ServiceCountOutputTypeDefaultArgs = { +export type ServiceCountOutputTypeCountSales_invoice_itemsArgs = { where?: Prisma.SalesInvoiceItemWhereInput } @@ -775,14 +869,17 @@ export type ServiceSelect - salesInvoiceItems?: boolean | Prisma.Service$salesInvoiceItemsArgs + sales_invoice_items?: boolean | Prisma.Service$sales_invoice_itemsArgs _count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs }, ExtArgs["result"]["service"]> @@ -793,18 +890,21 @@ export type ServiceSelectScalar = { name?: boolean description?: boolean sku?: boolean + local_sku?: boolean barcode?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean - categoryId?: boolean - baseSalePrice?: boolean + created_at?: boolean + updated_at?: boolean + deleted_at?: boolean + category_id?: boolean + base_sale_price?: boolean + account_id?: boolean + complex_id?: boolean } -export type ServiceOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "barcode" | "createdAt" | "updatedAt" | "deletedAt" | "categoryId" | "baseSalePrice", ExtArgs["result"]["service"]> +export type ServiceOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "local_sku" | "barcode" | "created_at" | "updated_at" | "deleted_at" | "category_id" | "base_sale_price" | "account_id" | "complex_id", ExtArgs["result"]["service"]> export type ServiceInclude = { category?: boolean | Prisma.Service$categoryArgs - salesInvoiceItems?: boolean | Prisma.Service$salesInvoiceItemsArgs + sales_invoice_items?: boolean | Prisma.Service$sales_invoice_itemsArgs _count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs } @@ -812,19 +912,22 @@ export type $ServicePayload | null - salesInvoiceItems: Prisma.$SalesInvoiceItemPayload[] + sales_invoice_items: Prisma.$SalesInvoiceItemPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number + id: string name: string description: string | null sku: string + local_sku: string | null barcode: string | null - createdAt: Date - updatedAt: Date - deletedAt: Date | null - categoryId: number | null - baseSalePrice: runtime.Decimal + created_at: Date + updated_at: Date + deleted_at: Date | null + category_id: string | null + base_sale_price: runtime.Decimal + account_id: string + complex_id: string }, ExtArgs["result"]["service"]> composites: {} } @@ -1166,7 +1269,7 @@ readonly fields: ServiceFieldRefs; export interface Prisma__ServiceClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" category = {}>(args?: Prisma.Subset>): Prisma.Prisma__ServiceCategoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - salesInvoiceItems = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + sales_invoice_items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1196,16 +1299,19 @@ export interface Prisma__ServiceClient + readonly id: Prisma.FieldRef<"Service", 'String'> readonly name: Prisma.FieldRef<"Service", 'String'> readonly description: Prisma.FieldRef<"Service", 'String'> readonly sku: Prisma.FieldRef<"Service", 'String'> + readonly local_sku: Prisma.FieldRef<"Service", 'String'> readonly barcode: Prisma.FieldRef<"Service", 'String'> - readonly createdAt: Prisma.FieldRef<"Service", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"Service", 'DateTime'> - readonly deletedAt: Prisma.FieldRef<"Service", 'DateTime'> - readonly categoryId: Prisma.FieldRef<"Service", 'Int'> - readonly baseSalePrice: Prisma.FieldRef<"Service", 'Decimal'> + readonly created_at: Prisma.FieldRef<"Service", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"Service", 'DateTime'> + readonly deleted_at: Prisma.FieldRef<"Service", 'DateTime'> + readonly category_id: Prisma.FieldRef<"Service", 'String'> + readonly base_sale_price: Prisma.FieldRef<"Service", 'Decimal'> + readonly account_id: Prisma.FieldRef<"Service", 'String'> + readonly complex_id: Prisma.FieldRef<"Service", 'String'> } @@ -1568,9 +1674,9 @@ export type Service$categoryArgs = { +export type Service$sales_invoice_itemsArgs = { /** * Select specific fields to fetch from the SalesInvoiceItem */ diff --git a/src/generated/prisma/models/ServiceCategory.ts b/src/generated/prisma/models/ServiceCategory.ts index b6b3908..3e57aff 100644 --- a/src/generated/prisma/models/ServiceCategory.ts +++ b/src/generated/prisma/models/ServiceCategory.ts @@ -20,88 +20,82 @@ export type ServiceCategoryModel = runtime.Types.Result.DefaultSelection | number + id?: Prisma.StringFilter<"ServiceCategory"> | string name?: Prisma.StringFilter<"ServiceCategory"> | string description?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null - imageUrl?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null - createdAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"ServiceCategory"> | Date | string | null + image_url?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null + account_id?: Prisma.StringFilter<"ServiceCategory"> | string + complex_id?: Prisma.StringFilter<"ServiceCategory"> | string + created_at?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string + updated_at?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"ServiceCategory"> | Date | string | null services?: Prisma.ServiceListRelationFilter } @@ -239,25 +221,29 @@ export type ServiceCategoryOrderByWithRelationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + image_url?: Prisma.SortOrderInput | Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder services?: Prisma.ServiceOrderByRelationAggregateInput _relevance?: Prisma.ServiceCategoryOrderByRelevanceInput } export type ServiceCategoryWhereUniqueInput = Prisma.AtLeast<{ - id?: number + id?: string AND?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[] OR?: Prisma.ServiceCategoryWhereInput[] NOT?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[] name?: Prisma.StringFilter<"ServiceCategory"> | string description?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null - imageUrl?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null - createdAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"ServiceCategory"> | Date | string | null + image_url?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null + account_id?: Prisma.StringFilter<"ServiceCategory"> | string + complex_id?: Prisma.StringFilter<"ServiceCategory"> | string + created_at?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string + updated_at?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"ServiceCategory"> | Date | string | null services?: Prisma.ServiceListRelationFilter }, "id"> @@ -265,99 +251,118 @@ export type ServiceCategoryOrderByWithAggregationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + image_url?: Prisma.SortOrderInput | Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.ServiceCategoryCountOrderByAggregateInput - _avg?: Prisma.ServiceCategoryAvgOrderByAggregateInput _max?: Prisma.ServiceCategoryMaxOrderByAggregateInput _min?: Prisma.ServiceCategoryMinOrderByAggregateInput - _sum?: Prisma.ServiceCategorySumOrderByAggregateInput } export type ServiceCategoryScalarWhereWithAggregatesInput = { AND?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput | Prisma.ServiceCategoryScalarWhereWithAggregatesInput[] OR?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput[] NOT?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput | Prisma.ServiceCategoryScalarWhereWithAggregatesInput[] - id?: Prisma.IntWithAggregatesFilter<"ServiceCategory"> | number + id?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string name?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string description?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null - imageUrl?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null - createdAt?: Prisma.DateTimeWithAggregatesFilter<"ServiceCategory"> | Date | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"ServiceCategory"> | Date | string - deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ServiceCategory"> | Date | string | null + image_url?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null + account_id?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string + complex_id?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"ServiceCategory"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"ServiceCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"ServiceCategory"> | Date | string | null } export type ServiceCategoryCreateInput = { + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null services?: Prisma.ServiceCreateNestedManyWithoutCategoryInput } export type ServiceCategoryUncheckedCreateInput = { - id?: number + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null services?: Prisma.ServiceUncheckedCreateNestedManyWithoutCategoryInput } export type ServiceCategoryUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null services?: Prisma.ServiceUpdateManyWithoutCategoryNestedInput } export type ServiceCategoryUncheckedUpdateInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null services?: Prisma.ServiceUncheckedUpdateManyWithoutCategoryNestedInput } export type ServiceCategoryCreateManyInput = { - id?: number + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type ServiceCategoryUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type ServiceCategoryUncheckedUpdateManyInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type ServiceCategoryNullableScalarRelationFilter = { @@ -375,38 +380,36 @@ export type ServiceCategoryCountOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrder - imageUrl?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type ServiceCategoryAvgOrderByAggregateInput = { - id?: Prisma.SortOrder + image_url?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type ServiceCategoryMaxOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrder - imageUrl?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder + image_url?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type ServiceCategoryMinOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder description?: Prisma.SortOrder - imageUrl?: Prisma.SortOrder - createdAt?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - deletedAt?: Prisma.SortOrder -} - -export type ServiceCategorySumOrderByAggregateInput = { - id?: Prisma.SortOrder + image_url?: Prisma.SortOrder + account_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + deleted_at?: Prisma.SortOrder } export type ServiceCategoryCreateNestedOneWithoutServicesInput = { @@ -426,22 +429,27 @@ export type ServiceCategoryUpdateOneWithoutServicesNestedInput = { } export type ServiceCategoryCreateWithoutServicesInput = { + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type ServiceCategoryUncheckedCreateWithoutServicesInput = { - id?: number + id?: string name: string description?: string | null - imageUrl?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null + image_url?: string | null + account_id: string + complex_id: string + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null } export type ServiceCategoryCreateOrConnectWithoutServicesInput = { @@ -461,22 +469,27 @@ export type ServiceCategoryUpdateToOneWithWhereWithoutServicesInput = { } export type ServiceCategoryUpdateWithoutServicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type ServiceCategoryUncheckedUpdateWithoutServicesInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number + id?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -514,10 +527,12 @@ export type ServiceCategorySelect _count?: boolean | Prisma.ServiceCategoryCountOutputTypeDefaultArgs }, ExtArgs["result"]["serviceCategory"]> @@ -528,13 +543,15 @@ export type ServiceCategorySelectScalar = { id?: boolean name?: boolean description?: boolean - imageUrl?: boolean - createdAt?: boolean - updatedAt?: boolean - deletedAt?: boolean + image_url?: boolean + account_id?: boolean + complex_id?: boolean + created_at?: boolean + updated_at?: boolean + deleted_at?: boolean } -export type ServiceCategoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "imageUrl" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["serviceCategory"]> +export type ServiceCategoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "image_url" | "account_id" | "complex_id" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["serviceCategory"]> export type ServiceCategoryInclude = { services?: boolean | Prisma.ServiceCategory$servicesArgs _count?: boolean | Prisma.ServiceCategoryCountOutputTypeDefaultArgs @@ -546,13 +563,15 @@ export type $ServiceCategoryPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ - id: number + id: string name: string description: string | null - imageUrl: string | null - createdAt: Date - updatedAt: Date - deletedAt: Date | null + image_url: string | null + account_id: string + complex_id: string + created_at: Date + updated_at: Date + deleted_at: Date | null }, ExtArgs["result"]["serviceCategory"]> composites: {} } @@ -923,13 +942,15 @@ export interface Prisma__ServiceCategoryClient + readonly id: Prisma.FieldRef<"ServiceCategory", 'String'> readonly name: Prisma.FieldRef<"ServiceCategory", 'String'> readonly description: Prisma.FieldRef<"ServiceCategory", 'String'> - readonly imageUrl: Prisma.FieldRef<"ServiceCategory", 'String'> - readonly createdAt: Prisma.FieldRef<"ServiceCategory", 'DateTime'> - readonly updatedAt: Prisma.FieldRef<"ServiceCategory", 'DateTime'> - readonly deletedAt: Prisma.FieldRef<"ServiceCategory", 'DateTime'> + readonly image_url: Prisma.FieldRef<"ServiceCategory", 'String'> + readonly account_id: Prisma.FieldRef<"ServiceCategory", 'String'> + readonly complex_id: Prisma.FieldRef<"ServiceCategory", 'String'> + readonly created_at: Prisma.FieldRef<"ServiceCategory", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"ServiceCategory", 'DateTime'> + readonly deleted_at: Prisma.FieldRef<"ServiceCategory", 'DateTime'> } diff --git a/src/generated/prisma/models/TriggerLog.ts b/src/generated/prisma/models/TriggerLog.ts index b8cbf17..7985e60 100644 --- a/src/generated/prisma/models/TriggerLog.ts +++ b/src/generated/prisma/models/TriggerLog.ts @@ -331,6 +331,14 @@ export type TriggerLogSumOrderByAggregateInput = { id?: Prisma.SortOrder } +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + export type TriggerLogSelect = runtime.Types.Extensions.GetSelect<{ diff --git a/src/main.ts b/src/main.ts index dc54161..71b197e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,24 +1,37 @@ import { ValidationPipe, VersioningType } from '@nestjs/common' -import { NestFactory } from '@nestjs/core' +import { NestFactory, Reflector } from '@nestjs/core' +import { JwtService } from '@nestjs/jwt' import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger' import { AppModule } from './app.module' import { PrismaExceptionFilter } from './common/filters/prisma-exception.filter' import { LoggingInterceptor } from './common/interceptors/logging.interceptor' import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor' +import { JwtAuthGuard } from './modules/auth/jwt-auth.guard' async function bootstrap() { const app = await NestFactory.create(AppModule) + const cookieParser = (await import('cookie-parser')).default + app.use(cookieParser()) + const config = new DocumentBuilder() .setTitle('Pos') .setDescription('The Pos API description') .setVersion('1.0') .addTag('pos') + .addBearerAuth({ + type: 'http', + scheme: 'bearer', + bearerFormat: 'JWT', + name: 'Authorization', + description: 'Enter JWT token', + in: 'header', + }) .build() const documentFactory = () => SwaggerModule.createDocument(app, config) SwaggerModule.setup('swagger', app, documentFactory) - // Set API prefix and enable URI versioning so all routes live under /api/v1/* + // Set API prefix and enable URI versioning so alls routes live under /api/v1/* app.setGlobalPrefix('api') app.enableVersioning({ type: VersioningType.URI, @@ -27,7 +40,7 @@ async function bootstrap() { // Enable CORS. You can set `CORS_ORIGINS` to a comma-separated list of allowed origins. // Defaults include common localhost origins used by front-end dev servers. - const defaultOrigins = ['http://localhost:3001'] + const defaultOrigins = ['*', 'http://localhost:3001'] const envOrigins = process.env.CORS_ORIGINS ? process.env.CORS_ORIGINS.split(',') .map(s => s.trim()) @@ -50,6 +63,8 @@ async function bootstrap() { // Register global exception filter to map Prisma and validation errors to proper HTTP codes app.useGlobalFilters(new PrismaExceptionFilter()) - await app.listen(process.env.PORT ?? 3000) + app.useGlobalGuards(new JwtAuthGuard(app.get(JwtService), app.get(Reflector))) + + await app.listen(process.env.PORT ?? 5002) } bootstrap() diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 1ce7f8e..08a586c 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -1,41 +1,49 @@ -import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common' +import { Controller, Get } from '@nestjs/common' import { ApiTags } from '@nestjs/swagger' -import { ResponseMapper } from '../common/response/response-mapper' import { AuthService } from './auth.service' -import { CurrentUser } from './current-user.decorator' -import { RefreshTokenDto } from './dto/refresh-token.dto' -import { SendCodeDto } from './dto/send-code.dto' -import { VerifyCodeDto } from './dto/verify-code.dto' -import { JwtAuthGuard } from './jwt-auth.guard' +import { reqTokenPayload } from './current-user.decorator' @ApiTags('auth') @Controller('auth') export class AuthController { constructor(private readonly auth: AuthService) {} - @Post('send-code') - async sendCode(@Body() dto: SendCodeDto) { - return this.auth.sendCode(dto) - } + // @Public() + // @Post('send_code') + // async sendCode(@Body() dto: SendCodeDto) { + // return this.auth.sendCode(dto) + // } - @Post('login') - async login(@Body() dto: VerifyCodeDto) { - return this.auth.loginWithCode(dto) - } + // @Public() + // @Post('login') + // async login(@Body() dto: VerifyCodeDto, @Res({ passthrough: true }) res) { + // const result = await this.auth.loginWithCode(dto) + // // Set accessToken as httpOnly cookie + // // @ts-ignore + // if (result?.data?.accessToken) { + // // @ts-ignore + // res.cookie('accessToken', result.data.accessToken, { + // httpOnly: true, + // secure: process.env.NODE_ENV === 'production', + // sameSite: 'lax', + // maxAge: 1000 * 60 * 60 * 24 * 7, // 7 days + // }) + // } + // return result + // } - @Post('refresh') - async refresh(@Body() dto: RefreshTokenDto) { - return this.auth.refreshToken(dto) - } + // @Post('refresh') + // async refresh(@Body() dto: RefreshTokenDto) { + // return this.auth.refreshToken(dto) + // } - @Post('logout') - async logout(@Body() dto: RefreshTokenDto) { - return this.auth.logout(dto.refreshToken) - } + // @Post('logout') + // async logout(@Body() dto: RefreshTokenDto) { + // return this.auth.logout(dto.refreshToken) + // } @Get('me') - @UseGuards(JwtAuthGuard) - async me(@CurrentUser() user: any) { - return ResponseMapper.single(user) + async me(@reqTokenPayload() user: any) { + return this.auth.me(user.username) } } diff --git a/src/modules/auth/auth.module.ts b/src/modules/auth/auth.module.ts index 5d7c56a..ef7a5d9 100644 --- a/src/modules/auth/auth.module.ts +++ b/src/modules/auth/auth.module.ts @@ -2,10 +2,9 @@ import { Module } from '@nestjs/common' import { JwtModule } from '@nestjs/jwt' import 'dotenv/config' import { env } from 'prisma/config' -import { PrismaModule } from '../prisma/prisma.module' +import { PrismaModule } from '../../prisma/prisma.module' import { AuthController } from './auth.controller' import { AuthService } from './auth.service' -import { JwtAuthGuard } from './jwt-auth.guard' @Module({ imports: [ @@ -15,8 +14,8 @@ import { JwtAuthGuard } from './jwt-auth.guard' signOptions: { expiresIn: Number(env('JWT_EXPIRES_IN')) || '15m' }, }), ], - providers: [AuthService, JwtAuthGuard], + providers: [AuthService], controllers: [AuthController], - exports: [AuthService, JwtAuthGuard], + exports: [AuthService, JwtModule], }) export class AuthModule {} diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts index b065c55..ee5fbf6 100644 --- a/src/modules/auth/auth.service.ts +++ b/src/modules/auth/auth.service.ts @@ -1,126 +1,167 @@ -import { - BadRequestException, - Injectable, - NotFoundException, - UnauthorizedException, -} from '@nestjs/common' +import { Injectable } from '@nestjs/common' import { JwtService } from '@nestjs/jwt' -import { createHash, randomBytes } from 'crypto' import 'dotenv/config' -import { env } from 'prisma/config' -import { ResponseMapper } from '../common/response/response-mapper' -import { PrismaService } from '../prisma/prisma.service' -import { RefreshTokenDto } from './dto/refresh-token.dto' -import { SendCodeDto } from './dto/send-code.dto' -import { VerifyCodeDto } from './dto/verify-code.dto' +import { ResponseMapper } from '../../common/response/response-mapper' +import { PrismaService } from '../../prisma/prisma.service' @Injectable() export class AuthService { - private readonly OTP_TTL_MINUTES = 2 - private readonly ACCESS_TOKEN_EXP = Number(env('JWT_EXPIRES_IN')) || '15m' - private readonly REFRESH_TOKEN_EXP_DAYS = 30 + // private readonly OTP_TTL_MINUTES = 2 + // private readonly ACCESS_TOKEN_EXP = Number(env('JWT_EXPIRES_IN')) || '150m' + // private readonly REFRESH_TOKEN_EXP_DAYS = 30 constructor( private prisma: PrismaService, private jwt: JwtService, ) {} - private generateCode() { - // For development you may want fixed code via env, otherwise random 5-digit - const staticCode = process.env.OTP_STATIC_CODE - if (staticCode) return staticCode - return Math.floor(10000 + Math.random() * 90000).toString() - } + // private generateCode() { + // // For development you may want fixed code via env, otherwise random 5-digit + // const staticCode = process.env.OTP_STATIC_CODE + // if (staticCode) return staticCode + // return Math.floor(10000 + Math.random() * 90000).toString() + // } - async sendCode(dto: SendCodeDto) { - const { mobileNumber } = dto - const user = await this.prisma.user.findFirst({ where: { mobileNumber } }) - if (!user) { - throw new NotFoundException('کاربری با این شماره تماس یافت نشد') - } - const code = this.generateCode() - const expiresAt = new Date(Date.now() + this.OTP_TTL_MINUTES * 60 * 1000) + // // @TODO: we must detect context of request to verify user need to logged in as which role (admin, user, etc) and generate token with that role. + // async sendCode(dto: SendCodeDto) { + // const { mobile_number } = dto + // const account = await this.prisma.account.findFirst({ + // where: { + // user: { + // mobile_number, + // }, + // }, + // }) + // console.log(mobile_number) - await this.prisma.otpCode.create({ - data: { - mobileNumber, - code, - expiresAt, - }, + // if (!account) { + // throw new NotFoundException('کاربری با این شماره تماس یافت نشد') + // } + + // const existingCode = await this.prisma.verificationCode.findFirst({ + // where: { account_id: account.id, expires_at: { gt: new Date() } }, + // }) + // if (existingCode) { + // throw new BadRequestException('کد برای شما ارسال شده است') + // } + + // const code = this.generateCode() + // const expires_at = new Date(Date.now() + this.OTP_TTL_MINUTES * 60 * 1000) + + // await this.prisma.verificationCode.create({ + // data: { + // account_id: account.id, + // code, + // expires_at, + // }, + // }) + + // // TODO: integrate SMS provider. For now return the code for dev. + // return { + // ok: true, + // } + // } + + // async loginWithCode(dto: VerifyCodeDto) { + // const { mobile_number, code } = dto + // const account = await this.prisma.account.findFirst({ + // where: { user: { mobile_number } }, + // include: { + // user: true, + // }, + // }) + // if (!account) { + // throw new NotFoundException('کاربری با این شماره تماس یافت نشد') + // } + // const otp = await this.prisma.verificationCode.findFirst({ + // where: { account_id: account.id }, + // }) + // if (!otp) throw new BadRequestException('اطلاعات ورودی درست نیست') + // // if (otp.expires_at) throw new BadRequestException('کد قبلن استفاده شده است') + // if (otp.expires_at.getTime() < Date.now()) + // throw new BadRequestException('کد وارد شده منقضی شده است') + // if (otp.code !== code) throw new BadRequestException('کد وارد شده اشتباه است') + // // mark used + + // const signTokenData = { + // sub: account.user.id, + // mobile_number: account.user.mobile_number, + // type: account.type, + // username: account.username, + // } + + // if (account.pos_id) { + // const pos = await this.prisma.pos.findUnique({ + // where: { id: account.pos_id }, + // include: { + // complex: true, + // licenses: true, + // }, + // }) + // if (!pos) { + // throw new NotFoundException('متاسفانه کاربر شما یافت نشد') + // } + // Object.assign(signTokenData, { + // pos_id: pos.id, + // pos_name: pos.serial, + // complex: pos.complex, + // license: pos.licenses[0], + // }) + // } + // console.log(signTokenData) + + // const accessToken = this.jwt.sign(signTokenData, { expiresIn: this.ACCESS_TOKEN_EXP }) + // const refreshTokenPlain = randomBytes(48).toString('hex') + // const tokenHash = createHash('sha256').update(refreshTokenPlain).digest('hex') + // const expires_at = new Date( + // Date.now() + this.REFRESH_TOKEN_EXP_DAYS * 24 * 60 * 60 * 1000, + // ) + // await this.prisma.token.upsert({ + // where: { type_account_id: { type: TokenType.ACCESS, account_id: account.id } }, + // update: { token: tokenHash, expires_at }, + // create: { + // token: tokenHash, + // account_id: account.id, + // expires_at, + // type: TokenType.ACCESS, + // }, + // }) + // await this.prisma.verificationCode.delete({ where: { id: otp.id } }) + + // return ResponseMapper.single({ + // accessToken, + // refreshToken: refreshTokenPlain, + // account, + // }) + // } + + // // async refreshToken(dto: RefreshTokenDto) { + // // const { refreshToken } = dto + // // const tokenHash = createHash('sha256').update(refreshToken).digest('hex') + // // const record = await this.prisma.refreshToken.findFirst({ where: { tokenHash } }) + // // if (!record || record.revoked || record.expiresAt.getTime() < Date.now()) { + // // throw new UnauthorizedException('Invalid refresh token') + // // } + // // const user = await this.prisma.user.findUnique({ where: { id: record.userId } }) + // // if (!user) throw new UnauthorizedException('User not found') + // // const accessToken = this.jwt.sign( + // // { sub: user.id, mobileNumber: user.mobileNumber }, + // // { expiresIn: this.ACCESS_TOKEN_EXP }, + // // ) + // // return { accessToken } + // // } + + // // async logout() { + // // await this.prisma.token.deleteMany({ + // // where: { tokenHash }, + // // data: { revoked: true }, + // // }) + // // return { ok: true } + // // } + + async me(username: string) { + return ResponseMapper.single({ + username, }) - - // TODO: integrate SMS provider. For now return the code for dev. - return { - ok: true, - } - } - - async loginWithCode(dto: VerifyCodeDto) { - const { mobileNumber, code } = dto - const user = await this.prisma.user.findFirst({ - where: { mobileNumber }, - include: { - role: true, - }, - }) - if (!user) { - throw new NotFoundException('کاربری با این شماره تماس یافت نشد') - } - - const otp = await this.prisma.otpCode.findFirst({ - where: { mobileNumber, used: false }, - }) - - if (!otp) throw new BadRequestException('اطلاعات ورودی درست نیست') - if (otp.used) throw new BadRequestException('کد قبلن استفاده شده است') - if (otp.expiresAt.getTime() < Date.now()) - throw new BadRequestException('کد وارد شده منقضی شده است') - if (otp.code !== code) throw new BadRequestException('کد وارد شده اشتباه است') - - // mark used - await this.prisma.otpCode.update({ where: { id: otp.id }, data: { used: true } }) - - const accessToken = this.jwt.sign( - { sub: user.id, mobileNumber }, - { expiresIn: this.ACCESS_TOKEN_EXP }, - ) - const refreshTokenPlain = randomBytes(48).toString('hex') - const tokenHash = createHash('sha256').update(refreshTokenPlain).digest('hex') - const expiresAt = new Date( - Date.now() + this.REFRESH_TOKEN_EXP_DAYS * 24 * 60 * 60 * 1000, - ) - - await this.prisma.refreshToken.create({ - data: { tokenHash, userId: user.id, expiresAt }, - }) - - return ResponseMapper.single({ accessToken, refreshToken: refreshTokenPlain, user }) - } - - async refreshToken(dto: RefreshTokenDto) { - const { refreshToken } = dto - const tokenHash = createHash('sha256').update(refreshToken).digest('hex') - const record = await this.prisma.refreshToken.findFirst({ where: { tokenHash } }) - if (!record || record.revoked || record.expiresAt.getTime() < Date.now()) { - throw new UnauthorizedException('Invalid refresh token') - } - - const user = await this.prisma.user.findUnique({ where: { id: record.userId } }) - if (!user) throw new UnauthorizedException('User not found') - - const accessToken = this.jwt.sign( - { sub: user.id, mobileNumber: user.mobileNumber }, - { expiresIn: this.ACCESS_TOKEN_EXP }, - ) - return { accessToken } - } - - async logout(refreshToken: string) { - const tokenHash = createHash('sha256').update(refreshToken).digest('hex') - await this.prisma.refreshToken.updateMany({ - where: { tokenHash }, - data: { revoked: true }, - }) - return { ok: true } } } diff --git a/src/modules/auth/current-user.decorator.ts b/src/modules/auth/current-user.decorator.ts index 8d9b532..3ddd75f 100644 --- a/src/modules/auth/current-user.decorator.ts +++ b/src/modules/auth/current-user.decorator.ts @@ -1,8 +1,9 @@ import { createParamDecorator, ExecutionContext } from '@nestjs/common' +import { AccessTokenPayload } from '../../common/models/token-model' -export const CurrentUser = createParamDecorator( +export const reqTokenPayload = createParamDecorator( (data: unknown, ctx: ExecutionContext) => { const req = ctx.switchToHttp().getRequest() - return req.user + return req.dataPayload as AccessTokenPayload }, ) diff --git a/src/modules/auth/dto/login.dto.ts b/src/modules/auth/dto/login.dto.ts index 5dad18a..716b332 100644 --- a/src/modules/auth/dto/login.dto.ts +++ b/src/modules/auth/dto/login.dto.ts @@ -2,11 +2,11 @@ import { ApiProperty } from '@nestjs/swagger' import { IsString } from 'class-validator' export class LoginDto { - @ApiProperty({ description: 'Mobile number used as username', example: '09123456789' }) + @ApiProperty({ description: 'Mobile number used as username', example: '09120258156' }) @IsString() mobileNumber: string - @ApiProperty({ description: 'OTP password (one-time password)', example: '12345' }) + @ApiProperty({ description: 'OTP password (one-time password)', example: '11111' }) @IsString() password: string } diff --git a/src/modules/auth/dto/send-code.dto.ts b/src/modules/auth/dto/send-code.dto.ts index f58bbb2..568a161 100644 --- a/src/modules/auth/dto/send-code.dto.ts +++ b/src/modules/auth/dto/send-code.dto.ts @@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger' import { IsString } from 'class-validator' export class SendCodeDto { - @ApiProperty({ example: '09123456789' }) + @ApiProperty({ example: '09120258156' }) @IsString() - mobileNumber: string + mobile_number: string } diff --git a/src/modules/auth/dto/verify-code.dto.ts b/src/modules/auth/dto/verify-code.dto.ts index 6dcf55b..b494868 100644 --- a/src/modules/auth/dto/verify-code.dto.ts +++ b/src/modules/auth/dto/verify-code.dto.ts @@ -2,11 +2,11 @@ import { ApiProperty } from '@nestjs/swagger' import { IsString } from 'class-validator' export class VerifyCodeDto { - @ApiProperty({ example: '09123456789' }) + @ApiProperty({ example: '09120258156' }) @IsString() - mobileNumber: string + mobile_number: string - @ApiProperty({ example: '12345' }) + @ApiProperty({ example: '11111' }) @IsString() code: string } diff --git a/src/modules/auth/jwt-auth.guard.ts b/src/modules/auth/jwt-auth.guard.ts index 64e64a6..79c0697 100644 --- a/src/modules/auth/jwt-auth.guard.ts +++ b/src/modules/auth/jwt-auth.guard.ts @@ -4,31 +4,58 @@ import { Injectable, UnauthorizedException, } from '@nestjs/common' +import { Reflector } from '@nestjs/core' import { JwtService } from '@nestjs/jwt' -import { Request } from 'express' +import { IS_PUBLIC_KEY } from '../../common/decorators/public.decorator' +import { IWithJWTPayloadRequest } from '../../common/models/token-model' @Injectable() export class JwtAuthGuard implements CanActivate { - constructor(private jwt: JwtService) {} + constructor( + private jwt: JwtService, + private reflector: Reflector, + ) {} async canActivate(context: ExecutionContext): Promise { - const req = context.switchToHttp().getRequest() - const auth = req.headers.authorization - if (!auth) throw new UnauthorizedException('Missing Authorization header') + const isPublic = this.reflector.getAllAndOverride(IS_PUBLIC_KEY, [ + context.getHandler(), + context.getClass(), + ]) + if (isPublic) return true - const parts = auth.split(' ') - if (parts.length !== 2 || parts[0] !== 'Bearer') { - throw new UnauthorizedException('Invalid Authorization header format') + const req = context.switchToHttp().getRequest() + + // Log headers to inspect whether Authorization is present + + // Try token from cookie first, then from Authorization header (Bearer) + let token: string | undefined = req.cookies?.accessToken + if (!token) { + const authHeader = (req.headers.authorization || req.headers.Authorization) as + | string + | undefined + if (authHeader && authHeader.startsWith('Bearer ')) { + token = authHeader.slice(7) + } } - const token = parts[1] + if (!token) throw new UnauthorizedException('Missing access token') + try { const payload = this.jwt.verify(token, { secret: process.env.JWT_SECRET || 'secret', }) - ;(req as any).user = payload + + console.log(payload) + + if (payload.type !== 'POS') + throw new UnauthorizedException('Invalid or expired token') + + // Set the typed dataPayload to the request + req.dataPayload = payload + return true } catch (err) { + console.log(err) throw new UnauthorizedException('Invalid or expired token') } } diff --git a/src/modules/config/config.controller.ts b/src/modules/config/config.controller.ts new file mode 100644 index 0000000..b16168b --- /dev/null +++ b/src/modules/config/config.controller.ts @@ -0,0 +1,18 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { ConfigService } from './config.service' +import { CreateConfigDto } from './dto/create-config.dto' + +@Controller('config') +export class ConfigController { + constructor(private readonly configService: ConfigService) {} + + @Get(':id') + findOne(@Param('id') uuid: string) { + return this.configService.findOne(uuid) + } + + @Post() + create(@Body() data: CreateConfigDto) { + return this.configService.create(data) + } +} diff --git a/src/modules/config/config.module.ts b/src/modules/config/config.module.ts new file mode 100644 index 0000000..2f82c29 --- /dev/null +++ b/src/modules/config/config.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { ConfigController } from './config.controller' +import { ConfigService } from './config.service' + +@Module({ + controllers: [ConfigController], + providers: [ConfigService], +}) +export class ConfigModule {} diff --git a/src/modules/config/config.service.ts b/src/modules/config/config.service.ts new file mode 100644 index 0000000..f9186b3 --- /dev/null +++ b/src/modules/config/config.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@nestjs/common' +import { Public } from '../../common/decorators/public.decorator' +import { ResponseMapper } from '../../common/response/response-mapper' +import { PrismaService } from '../../prisma/prisma.service' +import { CreateConfigDto } from './dto/create-config.dto' + +@Injectable() +export class ConfigService { + constructor(private prisma: PrismaService) {} + + @Public() + async findOne(uuid: string) { + const config = await this.prisma.device.findUnique({ + where: { + uuid, + }, + }) + + return ResponseMapper.single(config) + } + + @Public() + async create(data: CreateConfigDto) { + const config = await this.prisma.device.upsert({ + where: { + uuid: data.uuid, + }, + update: { + ...data, + }, + create: { + ...data, + }, + }) + + return ResponseMapper.create(config) + } +} diff --git a/src/modules/config/dto/create-config.dto.ts b/src/modules/config/dto/create-config.dto.ts new file mode 100644 index 0000000..bd55790 --- /dev/null +++ b/src/modules/config/dto/create-config.dto.ts @@ -0,0 +1,56 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsOptional, IsString } from 'class-validator' + +export class CreateConfigDto { + @ApiProperty() + @IsString() + app_version: string + + @ApiProperty() + @IsString() + build_number: string + + @ApiProperty() + @IsString() + uuid: string + + @ApiProperty({ required: false }) + @IsString() + @IsOptional() + fcm_token?: string + + @ApiProperty() + @IsString() + platform: string + + @ApiProperty() + @IsString() + brand: string + + @ApiProperty() + @IsString() + model: string + + @ApiProperty() + @IsString() + device: string + + @ApiProperty() + @IsString() + os_version: string + + @ApiProperty() + @IsString() + sdk_version: string + + @ApiProperty() + @IsString() + release_number: string + + @ApiProperty({ required: false }) + @IsString() + @IsOptional() + browser_name: string +} + +export class UpdateConfigDto extends PartialType(CreateConfigDto) {} diff --git a/src/modules/customers/customers.controller.ts b/src/modules/customers/customers.controller.ts index 22d42db..7d45093 100644 --- a/src/modules/customers/customers.controller.ts +++ b/src/modules/customers/customers.controller.ts @@ -1,34 +1,22 @@ -import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { Body, Controller, Get, Param, Post } from '@nestjs/common' import { CustomersService } from './customers.service' -import { CreateCustomerDto } from './dto/create-customer.dto' -import { UpdateCustomerDto } from './dto/update-customer.dto' @Controller('customers') export class CustomersController { - constructor(private readonly customersService: CustomersService) {} - - @Post() - create(@Body() dto: CreateCustomerDto) { - return this.customersService.create(dto) - } + constructor(private readonly customerService: CustomersService) {} @Get() findAll() { - return this.customersService.findAll() + return this.customerService.findAll() } @Get(':id') findOne(@Param('id') id: string) { - return this.customersService.findOne(Number(id)) + return this.customerService.findOne(+id) } - @Patch(':id') - update(@Param('id') id: string, @Body() dto: UpdateCustomerDto) { - return this.customersService.update(Number(id), dto) - } - - @Delete(':id') - remove(@Param('id') id: string) { - return this.customersService.remove(Number(id)) + @Post() + create(@Body() data: any) { + return this.customerService.create(data) } } diff --git a/src/modules/customers/customers.module.ts b/src/modules/customers/customers.module.ts index 0e521ea..a89355b 100644 --- a/src/modules/customers/customers.module.ts +++ b/src/modules/customers/customers.module.ts @@ -1,10 +1,8 @@ import { Module } from '@nestjs/common' -import { PrismaModule } from '../../prisma/prisma.module' import { CustomersController } from './customers.controller' import { CustomersService } from './customers.service' @Module({ - imports: [PrismaModule], controllers: [CustomersController], providers: [CustomersService], }) diff --git a/src/modules/customers/customers.service.ts b/src/modules/customers/customers.service.ts index eba19bc..c72d8d7 100644 --- a/src/modules/customers/customers.service.ts +++ b/src/modules/customers/customers.service.ts @@ -1,33 +1,19 @@ import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' @Injectable() export class CustomersService { - constructor(private prisma: PrismaService) {} - async create(data: any) { - const item = await this.prisma.customer.create({ data }) - return ResponseMapper.create(item) + findAll() { + // TODO: Implement fetching all customers + return [] } - async findAll() { - const items = await this.prisma.customer.findMany() - return ResponseMapper.list(items) + findOne(id: number) { + // TODO: Implement fetching a single customer + return {} } - async findOne(id: number) { - const item = await this.prisma.customer.findUnique({ where: { id } }) - if (!item) return null - return ResponseMapper.single(item) - } - - async update(id: number, data: any) { - const item = await this.prisma.customer.update({ where: { id }, data }) - return ResponseMapper.update(item) - } - - async remove(id: number) { - const item = await this.prisma.customer.delete({ where: { id } }) - return ResponseMapper.single(item) + create(data: any) { + // TODO: Implement customer creation + return data } } diff --git a/src/modules/customers/dto/create-customer.dto.ts b/src/modules/customers/dto/create-customer.dto.ts index fa7fa02..6894f99 100644 --- a/src/modules/customers/dto/create-customer.dto.ts +++ b/src/modules/customers/dto/create-customer.dto.ts @@ -1,33 +1,33 @@ -import { IsEmail, IsOptional, IsString } from 'class-validator' +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsBoolean, IsEmail, IsOptional, IsString } from 'class-validator' export class CreateCustomerDto { @IsString() - firstName: string + @ApiProperty() + first_name: string @IsString() - lastName: string + @ApiProperty() + last_name: string @IsOptional() @IsEmail() + @ApiProperty({ required: false }) email?: string - @IsOptional() @IsString() - mobileNumber?: string + @ApiProperty() + mobile_number: string @IsOptional() @IsString() + @ApiProperty({ required: false }) address?: string @IsOptional() - @IsString() - city?: string - - @IsOptional() - @IsString() - state?: string - - @IsOptional() - @IsString() - country?: string + @IsBoolean() + @ApiProperty({ required: false }) + is_active?: boolean } + +export class UpdateCustomerDto extends PartialType(CreateCustomerDto) {} diff --git a/src/modules/customers/dto/update-customer.dto.ts b/src/modules/customers/dto/update-customer.dto.ts deleted file mode 100644 index c779936..0000000 --- a/src/modules/customers/dto/update-customer.dto.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Type } from 'class-transformer' -import { IsBoolean, IsEmail, IsOptional, IsString } from 'class-validator' - -export class UpdateCustomerDto { - @IsOptional() - @IsString() - firstName?: string - - @IsOptional() - @IsString() - lastName?: string - - @IsOptional() - @IsEmail() - email?: string - - @IsOptional() - @IsString() - mobileNumber?: string - - @IsOptional() - @IsString() - address?: string - - @IsOptional() - @IsString() - city?: string - - @IsOptional() - @IsString() - state?: string - - @IsOptional() - @IsString() - country?: string - - @IsOptional() - @Type(() => Boolean) - @IsBoolean() - isActive?: boolean -} diff --git a/src/modules/good-categories/dto/create-good-category.dto.ts b/src/modules/good-categories/dto/create-good-category.dto.ts new file mode 100644 index 0000000..93ab19b --- /dev/null +++ b/src/modules/good-categories/dto/create-good-category.dto.ts @@ -0,0 +1,20 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsOptional, IsString } from 'class-validator' + +export class CreateGoodCategoryDto { + @IsString() + @ApiProperty() + name: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + description?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + image_url?: string +} + +export class UpdateGoodCategoryDto extends PartialType(CreateGoodCategoryDto) {} diff --git a/src/modules/good-categories/good-categories.controller.ts b/src/modules/good-categories/good-categories.controller.ts new file mode 100644 index 0000000..fd42350 --- /dev/null +++ b/src/modules/good-categories/good-categories.controller.ts @@ -0,0 +1,24 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { reqTokenPayload } from '../auth/current-user.decorator' +import { CreateGoodCategoryDto } from './dto/create-good-category.dto' +import { GoodCategoriesService } from './good-categories.service' + +@Controller('good-categories') +export class GoodCategoriesController { + constructor(private readonly goodCategoriesService: GoodCategoriesService) {} + + @Get() + findAll(@reqTokenPayload() account) { + return this.goodCategoriesService.findAll(account.complex_id) + } + + @Get(':id') + findOne(@Param('id') id: string, @reqTokenPayload() account) { + return this.goodCategoriesService.findOne(id, account.complex_id) + } + + @Post() + create(@Body() data: CreateGoodCategoryDto, @reqTokenPayload() account) { + return this.goodCategoriesService.create(data, account.complex_id) + } +} diff --git a/src/modules/good-categories/good-categories.module.ts b/src/modules/good-categories/good-categories.module.ts new file mode 100644 index 0000000..deed3f0 --- /dev/null +++ b/src/modules/good-categories/good-categories.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { GoodCategoriesController } from './good-categories.controller' +import { GoodCategoriesService } from './good-categories.service' + +@Module({ + controllers: [GoodCategoriesController], + providers: [GoodCategoriesService], +}) +export class GoodCategoriesModule {} diff --git a/src/modules/good-categories/good-categories.service.ts b/src/modules/good-categories/good-categories.service.ts new file mode 100644 index 0000000..ae24e0e --- /dev/null +++ b/src/modules/good-categories/good-categories.service.ts @@ -0,0 +1,42 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../../common/response/response-mapper' +import { PrismaService } from '../../prisma/prisma.service' +import { CreateGoodCategoryDto } from './dto/create-good-category.dto' + +@Injectable() +export class GoodCategoriesService { + constructor(private prisma: PrismaService) {} + async findAll(complex_id: string) { + // console.log(account) + + const categories = await this.prisma.goodCategory.findMany({ + where: { + complex_id, + }, + include: { + goods: { + include: { + _count: true, + }, + }, + }, + }) + + return ResponseMapper.list(categories) + } + + findOne(categoryId: string, complex_id: string) { + return {} + } + + create(data: CreateGoodCategoryDto, complex_id: string) { + const category = this.prisma.goodCategory.create({ + data: { + ...data, + complex_id, + account_id: '', + }, + }) + return ResponseMapper.create(category) + } +} diff --git a/src/modules/goods/dto/create-good.dto.ts b/src/modules/goods/dto/create-good.dto.ts new file mode 100644 index 0000000..a4d0c78 --- /dev/null +++ b/src/modules/goods/dto/create-good.dto.ts @@ -0,0 +1,38 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsNumber, IsOptional, IsString } from 'class-validator' + +export class CreateGoodDto { + @IsString() + @ApiProperty() + name: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + description?: string + + @IsString() + @ApiProperty() + sku: string + + @IsString() + @ApiProperty() + local_sku: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + barcode?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + category_id?: string + + @IsOptional() + @IsNumber() + @ApiProperty({ required: false }) + base_sale_price?: number +} + +export class UpdateGoodDto extends PartialType(CreateGoodDto) {} diff --git a/src/modules/goods/goods.controller.ts b/src/modules/goods/goods.controller.ts new file mode 100644 index 0000000..040ac86 --- /dev/null +++ b/src/modules/goods/goods.controller.ts @@ -0,0 +1,24 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { reqTokenPayload } from '../auth/current-user.decorator' +import { CreateGoodDto } from './dto/create-good.dto' +import { GoodsService } from './goods.service' + +@Controller('goods') +export class GoodsController { + constructor(private readonly goodsService: GoodsService) {} + + @Get() + findAll(@reqTokenPayload() account) { + return this.goodsService.findAll(account.complex_id) + } + + @Get(':id') + findOne(@Param('id') goodId: string, @reqTokenPayload() account) { + return this.goodsService.findOne(goodId, account.complex_id) + } + + @Post() + create(@Body() data: CreateGoodDto, @reqTokenPayload() account) { + return this.goodsService.create(data, account.complex_id) + } +} diff --git a/src/modules/goods/goods.module.ts b/src/modules/goods/goods.module.ts new file mode 100644 index 0000000..4e88bbc --- /dev/null +++ b/src/modules/goods/goods.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { GoodsController } from './goods.controller' +import { GoodsService } from './goods.service' + +@Module({ + controllers: [GoodsController], + providers: [GoodsService], +}) +export class GoodsModule {} diff --git a/src/modules/goods/goods.service.ts b/src/modules/goods/goods.service.ts new file mode 100644 index 0000000..cb39898 --- /dev/null +++ b/src/modules/goods/goods.service.ts @@ -0,0 +1,66 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../../common/response/response-mapper' +import { PrismaService } from '../../prisma/prisma.service' +import { CreateGoodDto } from './dto/create-good.dto' + +@Injectable() +export class GoodsService { + constructor(private prisma: PrismaService) {} + + async findAll(complex_id: string) { + const goods = await this.prisma.good.findMany({ + where: { + complex_id, + }, + omit: { + account_id: true, + complex_id: true, + deleted_at: true, + }, + }) + + return ResponseMapper.list(goods) + } + + async findOne(good_id: string, complex_id: string) { + const good = await this.prisma.good.findUnique({ + where: { + complex_id, + id: good_id, + }, + + omit: { + account_id: true, + complex_id: true, + deleted_at: true, + }, + }) + + return ResponseMapper.single(good) + } + + async create(data: CreateGoodDto, complex_id: string) { + const { category_id, ...rest } = data + + const dataToCreate = { + ...rest, + complex_id, + account_id: '', + category: { + connect: { + id: category_id, + }, + }, + } + + const good = await this.prisma.good.create({ + data: dataToCreate, + omit: { + account_id: true, + complex_id: true, + deleted_at: true, + }, + }) + return ResponseMapper.create(good) + } +} diff --git a/src/modules/product-categories/dto/create-product-category.dto.ts b/src/modules/product-categories/dto/create-product-category.dto.ts deleted file mode 100644 index 306ef91..0000000 --- a/src/modules/product-categories/dto/create-product-category.dto.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IsOptional, IsString } from 'class-validator' - -export class CreateProductCategoryDto { - @IsString() - name: string - - @IsOptional() - @IsString() - description?: string - - @IsOptional() - @IsString() - imageUrl?: string -} diff --git a/src/modules/product-categories/dto/update-product-category.dto.ts b/src/modules/product-categories/dto/update-product-category.dto.ts deleted file mode 100644 index c479034..0000000 --- a/src/modules/product-categories/dto/update-product-category.dto.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { IsOptional, IsString } from 'class-validator' - -export class UpdateProductCategoryDto { - @IsOptional() - @IsString() - name?: string - - @IsOptional() - @IsString() - description?: string - - @IsOptional() - @IsString() - imageUrl?: string -} diff --git a/src/modules/product-categories/product-categories.controller.ts b/src/modules/product-categories/product-categories.controller.ts deleted file mode 100644 index d6e0d69..0000000 --- a/src/modules/product-categories/product-categories.controller.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' -import { CreateProductCategoryDto } from './dto/create-product-category.dto' -import { UpdateProductCategoryDto } from './dto/update-product-category.dto' -import { ProductCategoriesService } from './product-categories.service' - -@Controller('product-categories') -export class ProductCategoriesController { - constructor(private readonly productCategoriesService: ProductCategoriesService) {} - - @Post() - create(@Body() dto: CreateProductCategoryDto) { - return this.productCategoriesService.create(dto) - } - - @Get() - findAll() { - return this.productCategoriesService.findAll() - } - - @Get(':id') - findOne(@Param('id') id: string) { - return this.productCategoriesService.findOne(Number(id)) - } - - @Patch(':id') - update(@Param('id') id: string, @Body() dto: UpdateProductCategoryDto) { - return this.productCategoriesService.update(Number(id), dto) - } - - @Delete(':id') - remove(@Param('id') id: string) { - return this.productCategoriesService.remove(Number(id)) - } -} diff --git a/src/modules/product-categories/product-categories.module.ts b/src/modules/product-categories/product-categories.module.ts deleted file mode 100644 index f6eeb0f..0000000 --- a/src/modules/product-categories/product-categories.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common' -import { PrismaModule } from '../../prisma/prisma.module' -import { ProductCategoriesController } from './product-categories.controller' -import { ProductCategoriesService } from './product-categories.service' - -@Module({ - imports: [PrismaModule], - controllers: [ProductCategoriesController], - providers: [ProductCategoriesService], -}) -export class ProductCategoriesModule {} diff --git a/src/modules/product-categories/product-categories.service.ts b/src/modules/product-categories/product-categories.service.ts deleted file mode 100644 index ef25fc7..0000000 --- a/src/modules/product-categories/product-categories.service.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' - -@Injectable() -export class ProductCategoriesService { - constructor(private prisma: PrismaService) {} - async create(data: any) { - const item = await this.prisma.goodCategory.create({ data }) - return ResponseMapper.create(item) - } - - async findAll() { - const items = await this.prisma.goodCategory.findMany() - return ResponseMapper.list(items) - } - - async findOne(id: number) { - const item = await this.prisma.goodCategory.findUnique({ where: { id } }) - if (!item) return null - return ResponseMapper.single(item) - } - - async update(id: number, data: any) { - const item = await this.prisma.goodCategory.update({ where: { id }, data }) - return ResponseMapper.update(item) - } - - async remove(id: number) { - const item = await this.prisma.goodCategory.delete({ where: { id } }) - return ResponseMapper.single(item) - } -} diff --git a/src/modules/products/dto/create-product.dto.ts b/src/modules/products/dto/create-product.dto.ts deleted file mode 100644 index c276e1e..0000000 --- a/src/modules/products/dto/create-product.dto.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Type } from 'class-transformer' -import { IsInt, IsOptional, IsString } from 'class-validator' - -export class CreateProductDto { - @IsString() - name: string - - @IsOptional() - @IsString() - sku?: string - - @IsOptional() - @IsString() - barcode?: string - - @IsOptional() - @IsString() - description?: string - - @IsOptional() - @Type(() => Number) - @IsInt() - brandId?: number - - @IsOptional() - @Type(() => Number) - @IsInt() - categoryId?: number - - @IsOptional() - @Type(() => Number) - minimumStockAlertLevel?: number -} diff --git a/src/modules/products/dto/update-product.dto.ts b/src/modules/products/dto/update-product.dto.ts deleted file mode 100644 index 33d4ce3..0000000 --- a/src/modules/products/dto/update-product.dto.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Type } from 'class-transformer' -import { IsInt, IsOptional, IsString } from 'class-validator' - -export class UpdateProductDto { - @IsOptional() - @IsString() - name?: string - - @IsOptional() - @IsString() - sku?: string - - @IsOptional() - @IsString() - barcode?: string - - @IsOptional() - @IsString() - description?: string - - @IsOptional() - @Type(() => Number) - @IsInt() - brandId?: number - - @IsOptional() - @Type(() => Number) - @IsInt() - categoryId?: number - - @IsOptional() - @Type(() => Number) - @IsInt() - minimumStockAlertLevel?: number -} diff --git a/src/modules/products/products.controller.ts b/src/modules/products/products.controller.ts deleted file mode 100644 index 0a5ee07..0000000 --- a/src/modules/products/products.controller.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Body, Controller, Delete, Get, Param, Patch, Post, Query } from '@nestjs/common' -import { ApiQuery } from '@nestjs/swagger' -import { CreateProductDto } from './dto/create-product.dto' -import { UpdateProductDto } from './dto/update-product.dto' -import { ProductsService } from './products.service' - -@Controller('products') -export class ProductsController { - constructor(private readonly productsService: ProductsService) {} - - @Post() - create(@Body() dto: CreateProductDto) { - return this.productsService.create(dto) - } - - @Get() - @ApiQuery({ name: 'page', required: false, type: Number, default: 1 }) - @ApiQuery({ name: 'pageSize', required: false, type: Number, default: 30 }) - findAll(@Query('page') page: number = 1, @Query('pageSize') pageSize: number = 30) { - return this.productsService.findAll(page, pageSize) - } - - @Get(':id') - findOne(@Param('id') id: string) { - return this.productsService.findOne(Number(id)) - } - - @Patch(':id') - update(@Param('id') id: string, @Body() dto: UpdateProductDto) { - return this.productsService.update(Number(id), dto) - } - - @Delete(':id') - remove(@Param('id') id: string) { - return this.productsService.remove(Number(id)) - } -} diff --git a/src/modules/products/products.module.ts b/src/modules/products/products.module.ts deleted file mode 100644 index 18404ce..0000000 --- a/src/modules/products/products.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common' -import { PrismaModule } from '../../prisma/prisma.module' -import { ProductsController } from './products.controller' -import { ProductsService } from './products.service' - -@Module({ - imports: [PrismaModule], - controllers: [ProductsController], - providers: [ProductsService], -}) -export class ProductsModule {} diff --git a/src/modules/products/products.service.ts b/src/modules/products/products.service.ts deleted file mode 100644 index 72b9014..0000000 --- a/src/modules/products/products.service.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { Injectable } from '@nestjs/common' -import { ShortEntity } from '../../common/interfaces/response-models' -import { ResponseMapper } from '../../common/response/response-mapper' -import { Prisma } from '../../generated/prisma/client' -import { PrismaService } from '../../prisma/prisma.service' -import { CreateProductDto } from './dto/create-product.dto' -import { UpdateProductDto } from './dto/update-product.dto' - -@Injectable() -export class ProductsService { - constructor(private prisma: PrismaService) {} - - async create(data: CreateProductDto) { - const { brandId, categoryId, ...rest } = data - - const dataToCreate = { - ...rest, - brand: brandId ? { connect: { id: Number(brandId) } } : undefined, - category: categoryId ? { connect: { id: Number(categoryId) } } : undefined, - } - - const item = await this.prisma.product.create({ data: dataToCreate }) - return ResponseMapper.create(item) - } - - async findAll(page = 1, pageSize = 20) { - const query: Prisma.ProductFindManyArgs = {} - - const [items, count] = await this.prisma.$transaction([ - this.prisma.product.findMany({ - include: { brand: true, category: true, stockBalances: true }, - skip: (page - 1) * pageSize, - take: pageSize, - }), - this.prisma.product.count(), - ]) - - const mapped = items.map(p => { - const { brandId, categoryId, ...rest } = p as any - const brand: ShortEntity | null = p.brand - ? { id: p.brand.id, name: p.brand.name } - : null - const category: ShortEntity | null = p.category - ? { id: p.category.id, name: p.category.name } - : null - const stock = - p.stockBalances && p.stockBalances.length > 0 - ? p.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0) - : 0 - - return { - ...rest, - salePrice: Number(p.salePrice), - minimumStockAlertLevel: Number(p.minimumStockAlertLevel), - brand, - category, - stock, - } - }) - return ResponseMapper.paginate(mapped, count, page, pageSize) - } - - async findOne(id: number) { - const product = await this.prisma.product.findUniqueOrThrow({ - where: { id }, - include: { - brand: { - select: { id: true, name: true }, - }, - category: { - select: { id: true, name: true }, - }, - stockBalances: { - select: { - quantity: true, - avgCost: true, - inventory: { select: { id: true, name: true } }, - }, - }, - salesInvoiceItems: { - select: { id: true }, - }, - }, - omit: { - brandId: true, - categoryId: true, - }, - }) - - const { salesInvoiceItems, ...rest } = product - - return ResponseMapper.single({ - ...rest, - salePrice: Number(product.salePrice), - minimumStockAlertLevel: Number(product.minimumStockAlertLevel), - stock: product.stockBalances?.reduce((acc, sb) => acc + Number(sb.quantity), 0), - avgCost: - product.stockBalances?.reduce((acc, sb) => acc + Number(sb.avgCost), 0) / - product.stockBalances.length, - salesCount: product.salesInvoiceItems.length, - }) - } - - async update(id: number, data: UpdateProductDto) { - const { brandId, categoryId, ...rest } = data - - const dataToUpdate = { - ...rest, - brand: - brandId === null - ? { disconnect: true } - : brandId - ? { connect: { id: Number(brandId) } } - : undefined, - category: - categoryId === null - ? { disconnect: true } - : categoryId - ? { connect: { id: Number(categoryId) } } - : undefined, - } - - const item = await this.prisma.product.update({ where: { id }, data: dataToUpdate }) - return ResponseMapper.update(item) - } - - async remove(id: number) { - const item = await this.prisma.product.delete({ where: { id } }) - return ResponseMapper.single(item) - } -} diff --git a/src/modules/profile/dto/create-profile.dto.ts b/src/modules/profile/dto/create-profile.dto.ts new file mode 100644 index 0000000..5992521 --- /dev/null +++ b/src/modules/profile/dto/create-profile.dto.ts @@ -0,0 +1,5 @@ +import { PartialType } from '@nestjs/swagger' + +export class CreateProfileDto {} + +export class UpdateProfileDto extends PartialType(CreateProfileDto) {} diff --git a/src/modules/profile/profile.controller.ts b/src/modules/profile/profile.controller.ts new file mode 100644 index 0000000..46ff8e6 --- /dev/null +++ b/src/modules/profile/profile.controller.ts @@ -0,0 +1,13 @@ +import { Controller, Get } from '@nestjs/common' +import { reqTokenPayload } from '../auth/current-user.decorator' +import { ProfileService } from './profile.service' + +@Controller('profile') +export class ProfileController { + constructor(private readonly profileService: ProfileService) {} + + @Get('me') + findOne(@reqTokenPayload() account) { + return this.profileService.findOne(account) + } +} diff --git a/src/modules/profile/profile.module.ts b/src/modules/profile/profile.module.ts new file mode 100644 index 0000000..3ad1c8c --- /dev/null +++ b/src/modules/profile/profile.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { ProfileController } from './profile.controller' +import { ProfileService } from './profile.service' + +@Module({ + controllers: [ProfileController], + providers: [ProfileService], +}) +export class ProfileModule {} diff --git a/src/modules/profile/profile.service.ts b/src/modules/profile/profile.service.ts new file mode 100644 index 0000000..84822b6 --- /dev/null +++ b/src/modules/profile/profile.service.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@nestjs/common' +import { Public } from '../../common/decorators/public.decorator' +import type { AccessTokenPayload } from '../../common/models/token-model' +import { ResponseMapper } from '../../common/response/response-mapper' +import { PrismaService } from '../../prisma/prisma.service' + +@Injectable() +export class ProfileService { + constructor(private prisma: PrismaService) {} + + @Public() + async findOne(account: AccessTokenPayload) { + return ResponseMapper.single(account) + } +} diff --git a/src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts b/src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts index eb7ea49..6af9e20 100644 --- a/src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts +++ b/src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts @@ -1,24 +1,32 @@ -import { Type } from 'class-transformer' -import { IsInt, IsNumber } from 'class-validator' +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsNumber, IsOptional, IsString } from 'class-validator' export class CreateSalesInvoiceItemDto { - @Type(() => Number) @IsNumber() + @ApiProperty() count: number - @Type(() => Number) @IsNumber() - unitPrice: number + @ApiProperty() + unit_price: number - @Type(() => Number) @IsNumber() - totalAmount: number + @ApiProperty() + total_amount: number - @Type(() => Number) - @IsInt() - invoiceId: number + @IsString() + @ApiProperty() + invoice_id: string - @Type(() => Number) - @IsInt() - productId: number + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + good_id?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + service_id?: string } + +export class UpdateSalesInvoiceItemDto extends PartialType(CreateSalesInvoiceItemDto) {} diff --git a/src/modules/sales-invoice-items/dto/update-sales-invoice-item.dto.ts b/src/modules/sales-invoice-items/dto/update-sales-invoice-item.dto.ts deleted file mode 100644 index 7d5fb36..0000000 --- a/src/modules/sales-invoice-items/dto/update-sales-invoice-item.dto.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Type } from 'class-transformer' -import { IsInt, IsNumber, IsOptional } from 'class-validator' - -export class UpdateSalesInvoiceItemDto { - @IsOptional() - @Type(() => Number) - @IsNumber() - count?: number - - @IsOptional() - @Type(() => Number) - @IsNumber() - unitPrice?: number - - @IsOptional() - @Type(() => Number) - @IsNumber() - totalAmount?: number - - @IsOptional() - @Type(() => Number) - @IsInt() - invoiceId?: number - - @IsOptional() - @Type(() => Number) - @IsInt() - productId?: number -} diff --git a/src/modules/sales-invoice-items/sales-invoice-items.controller.ts b/src/modules/sales-invoice-items/sales-invoice-items.controller.ts index e3679b0..ea27090 100644 --- a/src/modules/sales-invoice-items/sales-invoice-items.controller.ts +++ b/src/modules/sales-invoice-items/sales-invoice-items.controller.ts @@ -1,38 +1,22 @@ -import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' -import { CreateSalesInvoiceItemDto } from './dto/create-sales-invoice-item.dto' -import { UpdateSalesInvoiceItemDto } from './dto/update-sales-invoice-item.dto' +import { Body, Controller, Get, Param, Post } from '@nestjs/common' import { SalesInvoiceItemsService } from './sales-invoice-items.service' -@Controller('sales-invoices/:invoiceId/items') +@Controller('sales-invoice-items') export class SalesInvoiceItemsController { - constructor(private readonly service: SalesInvoiceItemsService) {} - - @Post() - create(@Param('invoiceId') invoiceId: string, @Body() dto: CreateSalesInvoiceItemDto) { - return this.service.createForInvoice(Number(invoiceId), dto) - } + constructor(private readonly salesInvoiceItemsService: SalesInvoiceItemsService) {} @Get() - findAll(@Param('invoiceId') invoiceId: string) { - return this.service.findAllForInvoice(Number(invoiceId)) + findAll() { + return this.salesInvoiceItemsService.findAll() } @Get(':id') - findOne(@Param('invoiceId') invoiceId: string, @Param('id') id: string) { - return this.service.findOneForInvoice(Number(invoiceId), Number(id)) + findOne(@Param('id') id: string) { + return this.salesInvoiceItemsService.findOne(+id) } - @Patch(':id') - update( - @Param('invoiceId') invoiceId: string, - @Param('id') id: string, - @Body() dto: UpdateSalesInvoiceItemDto, - ) { - return this.service.updateForInvoice(Number(invoiceId), Number(id), dto) - } - - @Delete(':id') - remove(@Param('invoiceId') invoiceId: string, @Param('id') id: string) { - return this.service.removeForInvoice(Number(invoiceId), Number(id)) + @Post() + create(@Body() data: any) { + return this.salesInvoiceItemsService.create(data) } } diff --git a/src/modules/sales-invoice-items/sales-invoice-items.module.ts b/src/modules/sales-invoice-items/sales-invoice-items.module.ts index ab4ec21..f444199 100644 --- a/src/modules/sales-invoice-items/sales-invoice-items.module.ts +++ b/src/modules/sales-invoice-items/sales-invoice-items.module.ts @@ -1,10 +1,8 @@ import { Module } from '@nestjs/common' -import { PrismaModule } from '../../prisma/prisma.module' import { SalesInvoiceItemsController } from './sales-invoice-items.controller' import { SalesInvoiceItemsService } from './sales-invoice-items.service' @Module({ - imports: [PrismaModule], controllers: [SalesInvoiceItemsController], providers: [SalesInvoiceItemsService], }) diff --git a/src/modules/sales-invoice-items/sales-invoice-items.service.ts b/src/modules/sales-invoice-items/sales-invoice-items.service.ts index c5147a8..45655b4 100644 --- a/src/modules/sales-invoice-items/sales-invoice-items.service.ts +++ b/src/modules/sales-invoice-items/sales-invoice-items.service.ts @@ -1,98 +1,19 @@ import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' -import { CreateSalesInvoiceItemDto } from './dto/create-sales-invoice-item.dto' @Injectable() export class SalesInvoiceItemsService { - constructor(private prisma: PrismaService) {} - - async create(dto: CreateSalesInvoiceItemDto) { - const payload: any = { ...dto } - if (Object.prototype.hasOwnProperty.call(payload, 'invoiceId')) { - payload.invoice = { connect: { id: Number(payload.invoiceId) } } - delete payload.invoiceId - } - if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { - payload.product = { connect: { id: Number(payload.productId) } } - delete payload.productId - } - - const item = await this.prisma.salesInvoiceItem.create({ data: payload }) - return ResponseMapper.create(item) - } - async findAll(invoiceId?: number) { - const where = invoiceId ? { invoiceId: Number(invoiceId) } : undefined - const items = await this.prisma.salesInvoiceItem.findMany({ - where, - include: { product: true }, - }) - return ResponseMapper.list(items) + findAll() { + // TODO: Implement fetching all sales invoice items + return [] } - async findOne(id: number) { - const item = await this.prisma.salesInvoiceItem.findUnique({ - where: { id }, - include: { product: true, invoice: true }, - }) - if (!item) return null - return ResponseMapper.single(item) + findOne(id: number) { + // TODO: Implement fetching a single sales invoice item + return {} } - async createForInvoice(invoiceId: number, dto: CreateSalesInvoiceItemDto) { - const payload: any = { ...dto, invoiceId } - return this.create(payload) - } - - async findAllForInvoice(invoiceId: number) { - return this.findAll(invoiceId) - } - - async findOneForInvoice(invoiceId: number, id: number) { - const item = await this.prisma.salesInvoiceItem.findFirst({ - where: { id, invoiceId }, - include: { product: true, invoice: true }, - }) - if (!item) return null - return ResponseMapper.single(item) - } - - async update(id: number, data: any) { - const payload: any = { ...data } - if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { - payload.product = { connect: { id: Number(payload.productId) } } - delete payload.productId - } - if (Object.prototype.hasOwnProperty.call(payload, 'invoiceId')) { - payload.invoice = { connect: { id: Number(payload.invoiceId) } } - delete payload.invoiceId - } - - const item = await this.prisma.salesInvoiceItem.update({ - where: { id }, - data: payload, - }) - return ResponseMapper.update(item) - } - - async updateForInvoice(invoiceId: number, id: number, data: any) { - const existing = await this.prisma.salesInvoiceItem.findFirst({ - where: { id, invoiceId }, - }) - if (!existing) return null - return this.update(id, data) - } - - async remove(id: number) { - const item = await this.prisma.salesInvoiceItem.delete({ where: { id } }) - return ResponseMapper.single(item) - } - - async removeForInvoice(invoiceId: number, id: number) { - const existing = await this.prisma.salesInvoiceItem.findFirst({ - where: { id, invoiceId }, - }) - if (!existing) return null - return this.remove(id) + create(data: any) { + // TODO: Implement sales invoice item creation + return data } } diff --git a/src/modules/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts b/src/modules/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts new file mode 100644 index 0000000..71b7549 --- /dev/null +++ b/src/modules/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts @@ -0,0 +1,32 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsDateString, IsEnum, IsNumber, IsString } from 'class-validator' + +enum PaymentMethodType { + CASH = 'CASH', + CARD = 'CARD', + BANK = 'BANK', + CHECK = 'CHECK', + OTHER = 'OTHER', +} + +export class CreateSalesInvoicePaymentDto { + @ApiProperty() + @IsString() + invoice_id: string + + @ApiProperty() + @IsNumber() + amount: number + + @ApiProperty({ enum: PaymentMethodType }) + @IsEnum(PaymentMethodType) + payment_method: PaymentMethodType + + @ApiProperty() + @IsDateString() + paid_at: string +} + +export class UpdateSalesInvoicePaymentDto extends PartialType( + CreateSalesInvoicePaymentDto, +) {} diff --git a/src/modules/sales-invoice-payments/sales-invoice-payments.controller.ts b/src/modules/sales-invoice-payments/sales-invoice-payments.controller.ts new file mode 100644 index 0000000..ad4d9e8 --- /dev/null +++ b/src/modules/sales-invoice-payments/sales-invoice-payments.controller.ts @@ -0,0 +1,24 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { SalesInvoicePaymentsService } from './sales-invoice-payments.service' + +@Controller('sales-invoice-payments') +export class SalesInvoicePaymentsController { + constructor( + private readonly salesInvoicePaymentsService: SalesInvoicePaymentsService, + ) {} + + @Get() + findAll() { + return this.salesInvoicePaymentsService.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.salesInvoicePaymentsService.findOne(+id) + } + + @Post() + create(@Body() data: any) { + return this.salesInvoicePaymentsService.create(data) + } +} diff --git a/src/modules/sales-invoice-payments/sales-invoice-payments.module.ts b/src/modules/sales-invoice-payments/sales-invoice-payments.module.ts new file mode 100644 index 0000000..35803e1 --- /dev/null +++ b/src/modules/sales-invoice-payments/sales-invoice-payments.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { SalesInvoicePaymentsController } from './sales-invoice-payments.controller' +import { SalesInvoicePaymentsService } from './sales-invoice-payments.service' + +@Module({ + controllers: [SalesInvoicePaymentsController], + providers: [SalesInvoicePaymentsService], +}) +export class SalesInvoicePaymentsModule {} diff --git a/src/modules/sales-invoice-payments/sales-invoice-payments.service.ts b/src/modules/sales-invoice-payments/sales-invoice-payments.service.ts new file mode 100644 index 0000000..3f783f7 --- /dev/null +++ b/src/modules/sales-invoice-payments/sales-invoice-payments.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@nestjs/common' + +@Injectable() +export class SalesInvoicePaymentsService { + findAll() { + // TODO: Implement fetching all sales invoice payments + return [] + } + + findOne(id: number) { + // TODO: Implement fetching a single sales invoice payment + return {} + } + + create(data: any) { + // TODO: Implement sales invoice payment creation + return data + } +} diff --git a/src/modules/sales-invoices/dto/create-sales-invoice.dto.ts b/src/modules/sales-invoices/dto/create-sales-invoice.dto.ts index 1b09ae5..45f98cb 100644 --- a/src/modules/sales-invoices/dto/create-sales-invoice.dto.ts +++ b/src/modules/sales-invoices/dto/create-sales-invoice.dto.ts @@ -1,20 +1,24 @@ -import { Type } from 'class-transformer' -import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsNumber, IsOptional, IsString } from 'class-validator' export class CreateSalesInvoiceDto { @IsString() + @ApiProperty() code: string - @Type(() => Number) @IsNumber() - totalAmount: number + @ApiProperty() + total_amount: number @IsOptional() @IsString() + @ApiProperty({ required: false }) description?: string @IsOptional() - @Type(() => Number) - @IsInt() - customerId?: number + @IsString() + @ApiProperty({ required: false }) + customer_id?: string } + +export class UpdateSalesInvoiceDto extends PartialType(CreateSalesInvoiceDto) {} diff --git a/src/modules/sales-invoices/dto/update-sales-invoice.dto.ts b/src/modules/sales-invoices/dto/update-sales-invoice.dto.ts deleted file mode 100644 index 0e99d68..0000000 --- a/src/modules/sales-invoices/dto/update-sales-invoice.dto.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Type } from 'class-transformer' -import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' - -export class UpdateSalesInvoiceDto { - @IsOptional() - @IsString() - code?: string - - @IsOptional() - @Type(() => Number) - @IsNumber() - totalAmount?: number - - @IsOptional() - @IsString() - description?: string - - @IsOptional() - @Type(() => Number) - @IsInt() - customerId?: number | null -} diff --git a/src/modules/sales-invoices/sales-invoices.controller.ts b/src/modules/sales-invoices/sales-invoices.controller.ts index 06d402d..d49190c 100644 --- a/src/modules/sales-invoices/sales-invoices.controller.ts +++ b/src/modules/sales-invoices/sales-invoices.controller.ts @@ -1,32 +1,22 @@ -import { Controller, Delete, Get, Param } from '@nestjs/common' +import { Body, Controller, Get, Param, Post } from '@nestjs/common' import { SalesInvoicesService } from './sales-invoices.service' @Controller('sales-invoices') export class SalesInvoicesController { - constructor(private readonly service: SalesInvoicesService) {} - - // @Post() - // create(@Body() dto: CreateSalesInvoiceDto) { - // return this.service.create(dto) - // } + constructor(private readonly salesInvoicesService: SalesInvoicesService) {} @Get() findAll() { - return this.service.findAll() + return this.salesInvoicesService.findAll() } @Get(':id') findOne(@Param('id') id: string) { - return this.service.findOne(Number(id)) + return this.salesInvoicesService.findOne(+id) } - // @Patch(':id') - // update(@Param('id') id: string, @Body() dto: UpdateSalesInvoiceDto) { - // return this.service.update(Number(id), dto) - // } - - @Delete(':id') - remove(@Param('id') id: string) { - return this.service.remove(Number(id)) + @Post() + create(@Body() data: any) { + return this.salesInvoicesService.create(data) } } diff --git a/src/modules/sales-invoices/sales-invoices.module.ts b/src/modules/sales-invoices/sales-invoices.module.ts index 76fdced..7098764 100644 --- a/src/modules/sales-invoices/sales-invoices.module.ts +++ b/src/modules/sales-invoices/sales-invoices.module.ts @@ -1,13 +1,9 @@ import { Module } from '@nestjs/common' -import { PrismaModule } from '../../prisma/prisma.module' import { SalesInvoicesController } from './sales-invoices.controller' import { SalesInvoicesService } from './sales-invoices.service' -import { SalesInvoicesWorkflow } from './sales-invoices.workflow' @Module({ - imports: [PrismaModule], controllers: [SalesInvoicesController], - providers: [SalesInvoicesService, SalesInvoicesWorkflow], - exports: [SalesInvoicesWorkflow], + providers: [SalesInvoicesService], }) export class SalesInvoicesModule {} diff --git a/src/modules/sales-invoices/sales-invoices.service.ts b/src/modules/sales-invoices/sales-invoices.service.ts index 278304b..4b54b25 100644 --- a/src/modules/sales-invoices/sales-invoices.service.ts +++ b/src/modules/sales-invoices/sales-invoices.service.ts @@ -1,49 +1,19 @@ import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' @Injectable() export class SalesInvoicesService { - constructor(private prisma: PrismaService) {} - - // async create(dto: CreateSalesInvoiceDto) { - // const payload: any = { ...dto } - // if (Object.prototype.hasOwnProperty.call(payload, 'customerId')) { - // payload.customer = { connect: { id: Number(payload.customerId) } } - // delete payload.customerId - // } - - // const item = await this.prisma.salesInvoice.create({ data: payload }) - // return ResponseMapper.create(item) - // } - - async findAll() { - const items = await this.prisma.salesInvoice.findMany({ include: { customer: true } }) - return ResponseMapper.list(items) + findAll() { + // TODO: Implement fetching all sales invoices + return [] } - async findOne(id: number) { - const item = await this.prisma.salesInvoice.findUnique({ - where: { id }, - include: { items: true, customer: true }, - }) - if (!item) return null - return ResponseMapper.single(item) + findOne(id: number) { + // TODO: Implement fetching a single sales invoice + return {} } - // async update(id: number, data: any) { - // const payload: any = { ...data } - // if (Object.prototype.hasOwnProperty.call(payload, 'customerId')) { - // if (payload.customerId === null) payload.customer = { disconnect: true } - // else payload.customer = { connect: { id: Number(payload.customerId) } } - // delete payload.customerId - // } - // const item = await this.prisma.salesInvoice.update({ where: { id }, data: payload }) - // return ResponseMapper.update(item) - // } - - async remove(id: number) { - const item = await this.prisma.salesInvoice.delete({ where: { id } }) - return ResponseMapper.single(item) + create(data: any) { + // TODO: Implement sales invoice creation + return data } } diff --git a/src/modules/sales-invoices/sales-invoices.workflow.ts b/src/modules/sales-invoices/sales-invoices.workflow.ts deleted file mode 100644 index 26dcaa8..0000000 --- a/src/modules/sales-invoices/sales-invoices.workflow.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { - MovementReferenceType, - MovementType, - Prisma, -} from '../../generated/prisma/client' - -export class SalesInvoicesWorkflow { - constructor() {} - - async onCreateByOrder(tx: Prisma.TransactionClient, orderId: number) { - const { posAccount } = await tx.order.findUniqueOrThrow({ - where: { id: orderId }, - select: { posAccount: { select: { inventoryId: true, id: true } } }, - }) - - const posInventoryId = posAccount.inventoryId - const orderItems = await tx.orderItem.findMany({ - where: { - orderId, - }, - }) - - await tx.stockMovement.createMany({ - data: orderItems.map(item => ({ - productId: item.productId, - orderId, - type: MovementType.OUT, - referenceType: MovementReferenceType.SALES, - referenceId: String(orderId), - quantity: item.quantity, - inventoryId: posInventoryId, - unitPrice: item.unitPrice, - totalCost: item.totalAmount, - avgCost: item.unitPrice, - })), - }) - } -} diff --git a/src/modules/service-categories/dto/create-service-category.dto.ts b/src/modules/service-categories/dto/create-service-category.dto.ts new file mode 100644 index 0000000..7443113 --- /dev/null +++ b/src/modules/service-categories/dto/create-service-category.dto.ts @@ -0,0 +1,20 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsOptional, IsString } from 'class-validator' + +export class CreateServiceCategoryDto { + @IsString() + @ApiProperty() + name: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + description?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + imageUrl?: string +} + +export class UpdateServiceCategoryDto extends PartialType(CreateServiceCategoryDto) {} diff --git a/src/modules/service-categories/service-categories.controller.ts b/src/modules/service-categories/service-categories.controller.ts new file mode 100644 index 0000000..c532392 --- /dev/null +++ b/src/modules/service-categories/service-categories.controller.ts @@ -0,0 +1,22 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { ServiceCategoriesService } from './service-categories.service' + +@Controller('service-categories') +export class ServiceCategoriesController { + constructor(private readonly serviceCategoriesService: ServiceCategoriesService) {} + + @Get() + findAll() { + return this.serviceCategoriesService.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.serviceCategoriesService.findOne(+id) + } + + @Post() + create(@Body() data: any) { + return this.serviceCategoriesService.create(data) + } +} diff --git a/src/modules/service-categories/service-categories.module.ts b/src/modules/service-categories/service-categories.module.ts new file mode 100644 index 0000000..69081dd --- /dev/null +++ b/src/modules/service-categories/service-categories.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { ServiceCategoriesController } from './service-categories.controller' +import { ServiceCategoriesService } from './service-categories.service' + +@Module({ + controllers: [ServiceCategoriesController], + providers: [ServiceCategoriesService], +}) +export class ServiceCategoriesModule {} diff --git a/src/modules/service-categories/service-categories.service.ts b/src/modules/service-categories/service-categories.service.ts new file mode 100644 index 0000000..b69d729 --- /dev/null +++ b/src/modules/service-categories/service-categories.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@nestjs/common' + +@Injectable() +export class ServiceCategoriesService { + findAll() { + // TODO: Implement fetching all service categories + return [] + } + + findOne(id: number) { + // TODO: Implement fetching a single service category + return {} + } + + create(data: any) { + // TODO: Implement service category creation + return data + } +} diff --git a/src/modules/services/dto/create-service.dto.ts b/src/modules/services/dto/create-service.dto.ts new file mode 100644 index 0000000..b1e0568 --- /dev/null +++ b/src/modules/services/dto/create-service.dto.ts @@ -0,0 +1,34 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsNumber, IsOptional, IsString } from 'class-validator' + +export class CreateServiceDto { + @IsString() + @ApiProperty() + name: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + description?: string + + @IsString() + @ApiProperty() + sku: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + barcode?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + categoryId?: string + + @IsOptional() + @IsNumber() + @ApiProperty({ required: false }) + baseSalePrice?: number +} + +export class UpdateServiceDto extends PartialType(CreateServiceDto) {} diff --git a/src/modules/services/services.controller.ts b/src/modules/services/services.controller.ts new file mode 100644 index 0000000..0e7295d --- /dev/null +++ b/src/modules/services/services.controller.ts @@ -0,0 +1,22 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { ServicesService } from './services.service' + +@Controller('services') +export class ServicesController { + constructor(private readonly servicesService: ServicesService) {} + + @Get() + findAll() { + return this.servicesService.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.servicesService.findOne(+id) + } + + @Post() + create(@Body() data: any) { + return this.servicesService.create(data) + } +} diff --git a/src/modules/services/services.module.ts b/src/modules/services/services.module.ts new file mode 100644 index 0000000..f9efa0a --- /dev/null +++ b/src/modules/services/services.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { ServicesController } from './services.controller' +import { ServicesService } from './services.service' + +@Module({ + controllers: [ServicesController], + providers: [ServicesService], +}) +export class ServicesModule {} diff --git a/src/modules/services/services.service.ts b/src/modules/services/services.service.ts new file mode 100644 index 0000000..586785b --- /dev/null +++ b/src/modules/services/services.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@nestjs/common' + +@Injectable() +export class ServicesService { + findAll() { + // TODO: Implement fetching all services + return [] + } + + findOne(id: number) { + // TODO: Implement fetching a single service + return {} + } + + create(data: any) { + // TODO: Implement service creation + return data + } +} diff --git a/src/modules/statistics/queries/top-alert-stocks.sql b/src/modules/statistics/queries/top-alert-stocks.sql deleted file mode 100644 index 200b363..0000000 --- a/src/modules/statistics/queries/top-alert-stocks.sql +++ /dev/null @@ -1,17 +0,0 @@ -SELECT p.id -FROM Products p -WHERE ( - SELECT COALESCE(SUM(sb.quantity), 0) - FROM Stock_Balance sb - WHERE - sb.productId = p.id - ) < p.minimumStockAlertLevel -ORDER BY ( - p.minimumStockAlertLevel - ( - SELECT COALESCE(SUM(sb.quantity), 0) - FROM Stock_Balance sb - WHERE - sb.productId = p.id - ) - ) DESC -LIMIT 10 diff --git a/src/modules/statistics/statistics.controller.ts b/src/modules/statistics/statistics.controller.ts deleted file mode 100644 index 3418b42..0000000 --- a/src/modules/statistics/statistics.controller.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Controller, Get } from '@nestjs/common' -import { StatisticsService } from './statistics.service' - -@Controller('statistics') -export class StatisticsController { - constructor(private readonly statisticsService: StatisticsService) {} - - @Get('top-last-sales') - getTopLastSales() { - return this.statisticsService.getTopLastSales() - } - - @Get('top-alert-stocks') - getTopAlertStocks() { - return this.statisticsService.getTopAlertStocks() - } - - @Get('top-supplier-debts') - getTopSupplierDebts() { - return this.statisticsService.getTopSupplierDebts() - } - - @Get('top-sales') - getTopSellProducts() { - return this.statisticsService.getTopSellProducts() - } -} diff --git a/src/modules/statistics/statistics.module.ts b/src/modules/statistics/statistics.module.ts deleted file mode 100644 index 4ce07cb..0000000 --- a/src/modules/statistics/statistics.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Module } from '@nestjs/common' -import { PrismaService } from '../../prisma/prisma.service' -import { StatisticsController } from './statistics.controller' -import { StatisticsService } from './statistics.service' - -@Module({ - controllers: [StatisticsController], - providers: [StatisticsService, PrismaService], -}) -export class StatisticsModule {} diff --git a/src/modules/statistics/statistics.service.ts b/src/modules/statistics/statistics.service.ts deleted file mode 100644 index 1f3eb90..0000000 --- a/src/modules/statistics/statistics.service.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { Injectable } from '@nestjs/common' -import * as fs from 'fs' -import * as path from 'path' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' - -@Injectable() -export class StatisticsService { - constructor(private prisma: PrismaService) {} - - private readSqlFile(filename: string): string { - const filePath = path.join(__dirname, 'queries', filename) - return fs.readFileSync(filePath, 'utf8') - } - - async getTopLastSales() { - const sales = await this.prisma.salesInvoice.findMany({ - take: 10, - orderBy: { createdAt: 'desc' }, - include: { - customer: { select: { id: true, firstName: true, lastName: true } }, - posAccount: { select: { id: true, name: true } }, - items: { - include: { - product: { select: { id: true, name: true } }, - }, - }, - }, - }) - - const mapped = sales.map(sale => ({ - ...sale, - totalAmount: Number(sale.totalAmount), - itemsCount: sale.items.length, - })) - - return ResponseMapper.list(mapped) - } - - async getTopAlertStocks() { - const productIds = await this.prisma.$queryRaw<{ id: number }[]>` - SELECT p.id - FROM Products p - WHERE (SELECT COALESCE(SUM(sb.quantity), 0) FROM Stock_Balance sb WHERE sb.productId = p.id) < p.minimumStockAlertLevel - -- ORDER BY (p.minimumStockAlertLevel - (SELECT COALESCE(SUM(sb.quantity), 0) FROM stock_balance sb WHERE sb.productId = p.id)) DESC - LIMIT 10 - ` - - const ids = productIds.map(p => p.id) - - if (ids.length === 0) { - return ResponseMapper.list([]) - } - - const products = await this.prisma.product.findMany({ - where: { id: { in: ids } }, - select: { - id: true, - name: true, - sku: true, - minimumStockAlertLevel: true, - stockBalances: { - select: { - quantity: true, - inventory: { select: { id: true, name: true } }, - }, - }, - category: { select: { id: true, name: true } }, - brand: { select: { id: true, name: true } }, - }, - }) - - const mappedData = products.map(product => ({ - ...product, - stock: product.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0), - deficit: - Number(product.minimumStockAlertLevel) - - product.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0), - })) - - return ResponseMapper.list(mappedData) - } - - async getTopSupplierDebts() { - // Get unpaid receipts - const receipts = await this.prisma.purchaseReceipt.findMany({ - where: { - status: { not: 'PAID' }, - }, - select: { - id: true, - totalAmount: true, - paidAmount: true, - supplierId: true, - }, - }) - - const debtMap = new Map< - number, - { supplierId: number; totalDebt: number; unpaidReceipts: number } - >() - - for (const receipt of receipts) { - const debt = Number(receipt.totalAmount) - Number(receipt.paidAmount) - if (debt > 0) { - const existing = debtMap.get(receipt.supplierId) - if (existing) { - existing.totalDebt += debt - existing.unpaidReceipts += 1 - } else { - debtMap.set(receipt.supplierId, { - supplierId: receipt.supplierId, - totalDebt: debt, - unpaidReceipts: 1, - }) - } - } - } - - const supplierIds = Array.from(debtMap.keys()) - const suppliers = await this.prisma.supplier.findMany({ - where: { id: { in: supplierIds } }, - select: { id: true, firstName: true, lastName: true }, - }) - - const supplierMap = new Map( - suppliers.map(s => [s.id, `${s.firstName} ${s.lastName}`.trim()]), - ) - - const mapped = Array.from(debtMap.values()) - .map(item => ({ - id: item.supplierId, - name: supplierMap.get(item.supplierId) || 'Unknown', - totalDebt: item.totalDebt, - unpaidReceipts: item.unpaidReceipts, - })) - .sort((a, b) => b.totalDebt - a.totalDebt) - .slice(0, 10) - - return ResponseMapper.list(mapped) - } - - async getTopSellProducts() { - const productData = await this.prisma.$queryRaw` - SELECT p.id, p.name, p.sku, COALESCE(SUM(sii.count), 0) as totalSold - FROM Products p - LEFT JOIN Sales_Invoice_Items sii ON p.id = sii.productId - GROUP BY p.id - HAVING totalSold > 0 - ORDER BY totalSold DESC - LIMIT 10 - ` - - const ids = productData.map(p => p.id) - - if (ids.length === 0) { - return ResponseMapper.list([]) - } - - const products = await this.prisma.product.findMany({ - where: { id: { in: ids } }, - select: { - id: true, - category: { select: { id: true, name: true } }, - brand: { select: { id: true, name: true } }, - }, - }) - - const productMap = new Map( - products.map(p => [p.id, { category: p.category, brand: p.brand }]), - ) - - const mapped = productData.map(product => ({ - id: product.id, - name: product.name, - sku: product.sku, - totalSold: Number(product.totalSold), - category: productMap.get(product.id)?.category, - brand: productMap.get(product.id)?.brand, - })) - - return ResponseMapper.list(mapped) - } -} diff --git a/src/modules/stock-balance/stock-balance.controller.ts b/src/modules/stock-balance/stock-balance.controller.ts deleted file mode 100644 index 414b59b..0000000 --- a/src/modules/stock-balance/stock-balance.controller.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Controller, Get } from '@nestjs/common' -import { StockBalanceService } from './stock-balance.service' - -@Controller('stock-balance') -export class StockBalanceController { - constructor(private readonly service: StockBalanceService) {} - - @Get() - findAll() { - return this.service.findAll() - } - - // @Get(':itemId') - // findOne(@Param('itemId') itemId: string) { - // return this.service.findOne(Number(itemId)) - // } -} diff --git a/src/modules/stock-balance/stock-balance.module.ts b/src/modules/stock-balance/stock-balance.module.ts deleted file mode 100644 index 61de72f..0000000 --- a/src/modules/stock-balance/stock-balance.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common' -import { PrismaModule } from '../../prisma/prisma.module' -import { StockBalanceController } from './stock-balance.controller' -import { StockBalanceService } from './stock-balance.service' - -@Module({ - imports: [PrismaModule], - controllers: [StockBalanceController], - providers: [StockBalanceService], -}) -export class StockBalanceModule {} diff --git a/src/modules/stock-balance/stock-balance.service.ts b/src/modules/stock-balance/stock-balance.service.ts deleted file mode 100644 index 68c0439..0000000 --- a/src/modules/stock-balance/stock-balance.service.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' - -@Injectable() -export class StockBalanceService { - constructor(private prisma: PrismaService) {} - - async findAll() { - const items = await this.prisma.stockBalance.findMany() - return ResponseMapper.list(items) - } - - // async findOne(productId: number) { - // const item = await this.prisma.stockBalance.findUnique({ where: { productId: productId } }) - // if (!item) return null - // return ResponseMapper.single(item) - // } -} diff --git a/src/modules/trigger-logs/dto/create-trigger-log.dto.ts b/src/modules/trigger-logs/dto/create-trigger-log.dto.ts new file mode 100644 index 0000000..340230f --- /dev/null +++ b/src/modules/trigger-logs/dto/create-trigger-log.dto.ts @@ -0,0 +1,14 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsString } from 'class-validator' + +export class CreateTriggerLogDto { + @ApiProperty() + @IsString() + message: string + + @ApiProperty() + @IsString() + name: string +} + +export class UpdateTriggerLogDto extends PartialType(CreateTriggerLogDto) {} diff --git a/src/modules/trigger-logs/trigger-logs.controller.ts b/src/modules/trigger-logs/trigger-logs.controller.ts new file mode 100644 index 0000000..1731658 --- /dev/null +++ b/src/modules/trigger-logs/trigger-logs.controller.ts @@ -0,0 +1,22 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { TriggerLogsService } from './trigger-logs.service' + +@Controller('trigger-logs') +export class TriggerLogsController { + constructor(private readonly triggerLogsService: TriggerLogsService) {} + + @Get() + findAll() { + return this.triggerLogsService.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.triggerLogsService.findOne(+id) + } + + @Post() + create(@Body() data: any) { + return this.triggerLogsService.create(data) + } +} diff --git a/src/modules/trigger-logs/trigger-logs.module.ts b/src/modules/trigger-logs/trigger-logs.module.ts new file mode 100644 index 0000000..8b27087 --- /dev/null +++ b/src/modules/trigger-logs/trigger-logs.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { TriggerLogsController } from './trigger-logs.controller' +import { TriggerLogsService } from './trigger-logs.service' + +@Module({ + controllers: [TriggerLogsController], + providers: [TriggerLogsService], +}) +export class TriggerLogsModule {} diff --git a/src/modules/trigger-logs/trigger-logs.service.ts b/src/modules/trigger-logs/trigger-logs.service.ts new file mode 100644 index 0000000..579ab51 --- /dev/null +++ b/src/modules/trigger-logs/trigger-logs.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@nestjs/common' + +@Injectable() +export class TriggerLogsService { + findAll() { + // TODO: Implement fetching all trigger logs + return [] + } + + findOne(id: number) { + // TODO: Implement fetching a single trigger log + return {} + } + + create(data: any) { + // TODO: Implement trigger log creation + return data + } +} diff --git a/src/modules/uploads/image-uploader.service.ts b/src/modules/uploaders/image-uploader.service.ts similarity index 81% rename from src/modules/uploads/image-uploader.service.ts rename to src/modules/uploaders/image-uploader.service.ts index d63b8d3..b63b764 100644 --- a/src/modules/uploads/image-uploader.service.ts +++ b/src/modules/uploaders/image-uploader.service.ts @@ -1,5 +1,4 @@ import { Injectable } from '@nestjs/common' -import { File } from 'multer' import { UploaderService } from './uploader.service' @Injectable() @@ -7,14 +6,14 @@ export class ImageUploaderService { constructor(private readonly uploaderService: UploaderService) {} async uploadImage( - file: File, - accountId: string, + file: Express.Multer.File, + account_id: string, type: string, ): Promise { return this.uploaderService.uploadFile( file.buffer, file.originalname, - accountId, + account_id, type, ) } diff --git a/src/modules/uploads/uploader.service.ts b/src/modules/uploaders/uploader.service.ts similarity index 100% rename from src/modules/uploads/uploader.service.ts rename to src/modules/uploaders/uploader.service.ts diff --git a/src/modules/uploads/uploads.controller.ts b/src/modules/uploaders/uploaders.controller.ts similarity index 91% rename from src/modules/uploads/uploads.controller.ts rename to src/modules/uploaders/uploaders.controller.ts index f30cf67..7d7edcc 100644 --- a/src/modules/uploads/uploads.controller.ts +++ b/src/modules/uploaders/uploaders.controller.ts @@ -2,8 +2,8 @@ import { Body, Controller, Post, UploadedFile, UseInterceptors } from '@nestjs/c import { FileInterceptor } from '@nestjs/platform-express' import { ImageUploaderService } from './image-uploader.service' -@Controller('uploads') -export class UploadsController { +@Controller('uploaders') +export class UploadersController { constructor(private readonly imageUploaderService: ImageUploaderService) {} @Post('image') diff --git a/src/modules/uploads/uploads.module.ts b/src/modules/uploaders/uploaders.module.ts similarity index 67% rename from src/modules/uploads/uploads.module.ts rename to src/modules/uploaders/uploaders.module.ts index 333a1ae..5593063 100644 --- a/src/modules/uploads/uploads.module.ts +++ b/src/modules/uploaders/uploaders.module.ts @@ -1,11 +1,11 @@ import { Module } from '@nestjs/common' import { ImageUploaderService } from './image-uploader.service' import { UploaderService } from './uploader.service' -import { UploadsController } from './uploads.controller' +import { UploadersController } from './uploaders.controller' @Module({ providers: [UploaderService, ImageUploaderService], - controllers: [UploadsController], + controllers: [UploadersController], exports: [UploaderService, ImageUploaderService], }) -export class UploadsModule {} +export class UploadersModule {}