feat: add config module with controller and service

- Implemented ConfigController for handling config-related requests.
- Created ConfigService for business logic related to configurations.
- Added CreateConfigDto for validating configuration data.

feat: add good categories module with controller and service

- Implemented GoodCategoriesController for managing good categories.
- Created GoodCategoriesService for business logic related to good categories.
- Added CreateGoodCategoryDto for validating good category data.

feat: add goods module with controller and service

- Implemented GoodsController for managing goods.
- Created GoodsService for business logic related to goods.
- Added CreateGoodDto for validating good data.

feat: add profile module with controller and service

- Implemented ProfileController for managing user profiles.
- Created ProfileService for business logic related to profiles.
- Added CreateProfileDto for profile data structure.

feat: add sales invoice payments module with controller and service

- Implemented SalesInvoicePaymentsController for managing invoice payments.
- Created SalesInvoicePaymentsService for business logic related to payments.
- Added CreateSalesInvoicePaymentDto for validating payment data.

feat: add service categories module with controller and service

- Implemented ServiceCategoriesController for managing service categories.
- Created ServiceCategoriesService for business logic related to service categories.
- Added CreateServiceCategoryDto for validating service category data.

feat: add services module with controller and service

- Implemented ServicesController for managing services.
- Created ServicesService for business logic related to services.
- Added CreateServiceDto for validating service data.

feat: add trigger logs module with controller and service

- Implemented TriggerLogsController for managing trigger logs.
- Created TriggerLogsService for business logic related to trigger logs.
- Added CreateTriggerLogDto for validating trigger log data.

feat: add uploaders module for handling file uploads

- Implemented UploadersController for managing file uploads.
- Created ImageUploaderService for image upload logic.
- Created UploaderService for file handling and storage.
This commit is contained in:
2026-02-12 20:31:04 +03:30
parent de14d531e1
commit a073af76fe
116 changed files with 6108 additions and 3977 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
}, },
// Prisma formatting // Prisma formatting
"[prisma]": { "[prisma]": {
"editor.defaultFormatter": "Prisma.prisma", "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true "editor.formatOnSave": true
}, },
"[typescript]": { "[typescript]": {
+2
View File
@@ -7,8 +7,10 @@
"@nestjs/platform-express": "^11.0.1", "@nestjs/platform-express": "^11.0.1",
"@nestjs/swagger": "^11.2.3", "@nestjs/swagger": "^11.2.3",
"@prisma/adapter-mariadb": "^7.1.0", "@prisma/adapter-mariadb": "^7.1.0",
"@types/multer": "^2.0.0",
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"class-validator": "^0.14.3", "class-validator": "^0.14.3",
"cookie-parser": "^1.4.7",
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"jalaliday": "^3.1.1", "jalaliday": "^3.1.1",
+27
View File
@@ -26,12 +26,18 @@ importers:
'@prisma/adapter-mariadb': '@prisma/adapter-mariadb':
specifier: ^7.1.0 specifier: ^7.1.0
version: 7.1.0 version: 7.1.0
'@types/multer':
specifier: ^2.0.0
version: 2.0.0
class-transformer: class-transformer:
specifier: ^0.5.1 specifier: ^0.5.1
version: 0.5.1 version: 0.5.1
class-validator: class-validator:
specifier: ^0.14.3 specifier: ^0.14.3
version: 0.14.3 version: 0.14.3
cookie-parser:
specifier: ^1.4.7
version: 1.4.7
dayjs: dayjs:
specifier: ^1.11.19 specifier: ^1.11.19
version: 1.11.19 version: 1.11.19
@@ -1173,6 +1179,9 @@ packages:
'@types/ms@2.1.0': '@types/ms@2.1.0':
resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}
'@types/multer@2.0.0':
resolution: {integrity: sha512-C3Z9v9Evij2yST3RSBktxP9STm6OdMc5uR1xF1SGr98uv8dUlAL2hqwrZ3GVB3uyMyiegnscEK6PGtYvNrjTjw==}
'@types/node@22.19.1': '@types/node@22.19.1':
resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==} resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==}
@@ -1768,6 +1777,13 @@ packages:
convert-source-map@2.0.0: convert-source-map@2.0.0:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} 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: cookie-signature@1.2.2:
resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==}
engines: {node: '>=6.6.0'} engines: {node: '>=6.6.0'}
@@ -4795,6 +4811,10 @@ snapshots:
'@types/ms@2.1.0': {} '@types/ms@2.1.0': {}
'@types/multer@2.0.0':
dependencies:
'@types/express': 5.0.6
'@types/node@22.19.1': '@types/node@22.19.1':
dependencies: dependencies:
undici-types: 6.21.0 undici-types: 6.21.0
@@ -5430,6 +5450,13 @@ snapshots:
convert-source-map@2.0.0: {} 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-signature@1.2.2: {}
cookie@0.7.2: {} cookie@0.7.2: {}
@@ -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;
@@ -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`);
@@ -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`);
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `devices` ADD COLUMN `fcm_token` VARCHAR(100) NULL;
@@ -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;
@@ -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;
+19
View File
@@ -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")
}
+18
View File
@@ -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")
}
+23 -17
View File
@@ -1,31 +1,37 @@
model Good { model Good {
id Int @id @default(autoincrement()) id String @id @default(uuid())
name String @db.VarChar(255) name String @db.VarChar(255)
description String? @db.Text description String? @db.Text
sku String @db.VarChar(100) sku String @db.VarChar(100)
localSku String @unique() @db.VarChar(100) local_sku String? @unique() @db.VarChar(100)
barcode String? @unique() @db.VarChar(100) barcode String? @unique() @db.VarChar(100)
createdAt DateTime @default(now()) @db.Timestamp(0) created_at DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0) updated_at DateTime @updatedAt @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0) deleted_at DateTime? @db.Timestamp(0)
categoryId Int? category_id String?
baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0) base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)
category GoodCategory? @relation(fields: [categoryId], references: [id]) account_id String
salesInvoiceItems SalesInvoiceItem[] complex_id String
@@index([categoryId]) category GoodCategory? @relation(fields: [category_id], references: [id])
@@map("Goods") sales_invoice_items SalesInvoiceItem[]
@@index([category_id])
@@map("goods")
} }
model GoodCategory { model GoodCategory {
id Int @id @default(autoincrement()) id String @id @default(uuid())
name String @db.VarChar(100) name String @db.VarChar(100)
description String? @db.Text description String? @db.Text
imageUrl String? @db.VarChar(255) image_url String? @db.VarChar(255)
createdAt DateTime @default(now()) @db.Timestamp(0) account_id String
updatedAt DateTime @updatedAt @db.Timestamp(0) complex_id String
deletedAt DateTime? @db.Timestamp(0) created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @updatedAt @db.Timestamp(0)
deleted_at DateTime? @db.Timestamp(0)
goods Good[] goods Good[]
@@map("Good_categories") @@map("good_categories")
} }
+1 -17
View File
@@ -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 { model TriggerLog {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
message String @db.Text message String @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0) createdAt DateTime @default(now()) @db.Timestamp(0)
name String @db.Text name String @db.Text
@@map("Trigger_Logs") @@map("trigger_logs")
} }
+34 -30
View File
@@ -1,46 +1,50 @@
model SalesInvoice { model SalesInvoice {
id Int @id @default(autoincrement()) id String @id @default(uuid())
code String @unique @db.VarChar(100) code String @unique @db.VarChar(100)
totalAmount Decimal @db.Decimal(15, 2) total_amount Decimal @db.Decimal(15, 2)
description String? @db.Text description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0) created_at DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0) updated_at DateTime @updatedAt @db.Timestamp(0)
customerId Int? customer_id String?
customer Customer? @relation(fields: [customerId], references: [id]) account_id String
items SalesInvoiceItem[] complex_id String
salesInvoicePayments SalesInvoicePayment[]
@@index([customerId]) customer Customer? @relation(fields: [customer_id], references: [id])
@@map("Sales_Invoices") items SalesInvoiceItem[]
sales_invoice_payments SalesInvoicePayment[]
@@index([customer_id])
@@map("sales_invoices")
} }
model SalesInvoiceItem { model SalesInvoiceItem {
id Int @id @default(autoincrement()) id String @id @default(uuid())
count Decimal @db.Decimal(10, 0) count Decimal @db.Decimal(10, 0)
unitPrice Decimal @default(0.00) @db.Decimal(15, 2) unit_price Decimal @default(0.00) @db.Decimal(15, 2)
totalAmount Decimal @default(0.00) @db.Decimal(15, 2) total_amount Decimal @default(0.00) @db.Decimal(15, 2)
createdAt DateTime @default(now()) @db.Timestamp(0) created_at DateTime @default(now()) @db.Timestamp(0)
invoiceId Int invoice_id String
goodId Int good_id String
serviceId Int service_id String
invoice SalesInvoice @relation(fields: [invoiceId], references: [id])
good Good? @relation(fields: [goodId], references: [id])
service Service? @relation(fields: [serviceId], references: [id])
@@index([invoiceId, goodId]) invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
@@map("Sales_Invoice_Items") 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 { model SalesInvoicePayment {
id Int @id @default(autoincrement()) id String @id @default(uuid())
invoiceId Int invoice_id String
amount Decimal @db.Decimal(15, 2) amount Decimal @db.Decimal(15, 2)
paymentMethod PaymentMethodType payment_method PaymentMethodType
paidAt DateTime paid_at DateTime
createdAt DateTime @default(now()) created_at DateTime @default(now())
invoice SalesInvoice @relation(fields: [invoiceId], references: [id]) invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
@@index([invoiceId]) @@index([invoice_id])
@@map("Sales_Invoice_Payments") @@map("sales_invoice_payments")
} }
+23 -16
View File
@@ -1,30 +1,37 @@
model Service { model Service {
id Int @id @default(autoincrement()) id String @id @default(uuid())
name String @db.VarChar(255) name String @db.VarChar(255)
description String? @db.Text description String? @db.Text
sku String @unique() @db.VarChar(100) sku String @unique() @db.VarChar(100)
local_sku String? @unique() @db.VarChar(100)
barcode String? @unique() @db.VarChar(100) barcode String? @unique() @db.VarChar(100)
createdAt DateTime @default(now()) @db.Timestamp(0) created_at DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0) updated_at DateTime @updatedAt @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0) deleted_at DateTime? @db.Timestamp(0)
categoryId Int? category_id String?
baseSalePrice Decimal @default(0.00) @db.Decimal(15, 0) base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)
category ServiceCategory? @relation(fields: [categoryId], references: [id]) account_id String
salesInvoiceItems SalesInvoiceItem[] complex_id String
@@index([categoryId]) category ServiceCategory? @relation(fields: [category_id], references: [id])
@@map("Services") sales_invoice_items SalesInvoiceItem[]
@@index([category_id])
@@map("services")
} }
model ServiceCategory { model ServiceCategory {
id Int @id @default(autoincrement()) id String @id @default(uuid())
name String @db.VarChar(100) name String @db.VarChar(100)
description String? @db.Text description String? @db.Text
imageUrl String? @db.VarChar(255) image_url String? @db.VarChar(255)
createdAt DateTime @default(now()) @db.Timestamp(0) account_id String
updatedAt DateTime @updatedAt @db.Timestamp(0) complex_id String
deletedAt DateTime? @db.Timestamp(0) created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @updatedAt @db.Timestamp(0)
deleted_at DateTime? @db.Timestamp(0)
services Service[] services Service[]
@@map("Service_categories") @@map("service_categories")
} }
+314 -315
View File
@@ -1,321 +1,320 @@
import { prisma } from '../src/lib/prisma' import { prisma } from '../src/lib/prisma'
async function main() { async function main() {
if ((await prisma.role.count()) === 0) { // if ((await prisma.role.count()) === 0) {
await prisma.role.upsert({ // await prisma.role.upsert({
where: { id: 0, name: 'Admin' }, // where: { id: 0, name: 'Admin' },
update: {}, // update: {},
create: { // create: {
name: 'Admin', // name: 'Admin',
}, // },
}) // })
} // }
if ((await prisma.user.count()) === 0) { // if ((await prisma.user.count()) === 0) {
const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } }) // const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } })
if (!adminRole) { // if (!adminRole) {
return // return
} // }
await prisma.user.upsert({ // await prisma.user.upsert({
where: { id: 1, firstName: 'عباس', lastName: 'حسنی' }, // where: { id: 1, firstName: 'عباس', lastName: 'حسنی' },
update: {}, // update: {},
create: { // create: {
firstName: 'عباس', // firstName: 'عباس',
lastName: 'حسنی', // lastName: 'حسنی',
roleId: adminRole.id, // roleId: adminRole.id,
mobileNumber: '09120258156', // mobileNumber: '09120258156',
password: '12345678', // password: '12345678',
}, // },
}) // })
} // }
if ((await prisma.inventory.count()) === 0) { // if ((await prisma.inventory.count()) === 0) {
await prisma.inventory.createMany({ // await prisma.inventory.createMany({
data: [ // data: [
{ name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true }, // { name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true },
{ // {
name: 'فروشگاه حضوری', // name: 'فروشگاه حضوری',
location: 'مرکز شهر', // location: 'مرکز شهر',
isPointOfSale: true, // isPointOfSale: true,
isActive: true, // isActive: true,
}, // },
{ // {
name: 'فروشگاه اینترنتی', // name: 'فروشگاه اینترنتی',
location: 'مرکز شهر', // location: 'مرکز شهر',
isPointOfSale: true, // isPointOfSale: true,
isActive: true, // isActive: true,
}, // },
], // ],
}) // })
} // }
if ((await prisma.productCategory.count()) === 0) { // if ((await prisma.productCategory.count()) === 0) {
await prisma.productCategory.createMany({ // await prisma.productCategory.createMany({
data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })), // data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })),
}) // })
} // }
if ((await prisma.productBrand.count()) === 0) { // if ((await prisma.productBrand.count()) === 0) {
await prisma.productBrand.createMany({ // await prisma.productBrand.createMany({
data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })), // data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })),
}) // })
} // }
if ((await prisma.supplier.count()) === 0) { // if ((await prisma.supplier.count()) === 0) {
await prisma.supplier.createMany({ // await prisma.supplier.createMany({
data: Array.from({ length: 9 }, (_, i) => ({ // data: Array.from({ length: 9 }, (_, i) => ({
firstName: 'تامین‌', // firstName: 'تامین‌',
lastName: `کننده ${i + 1}`, // lastName: `کننده ${i + 1}`,
mobileNumber: `0912000000${i + 1}`, // mobileNumber: `0912000000${i + 1}`,
email: `supplier${i + 1}@example.com`, // email: `supplier${i + 1}@example.com`,
})), // })),
}) // })
} // }
if ((await prisma.customer.count()) === 0) { // if ((await prisma.customer.count()) === 0) {
await prisma.customer.createMany({ // await prisma.customer.createMany({
data: Array.from({ length: 5 }, (_, i) => ({ // data: Array.from({ length: 5 }, (_, i) => ({
firstName: 'مشتری', // firstName: 'مشتری',
lastName: `${i + 1}`, // lastName: `${i + 1}`,
mobileNumber: `0913000000${i + 1}`, // mobileNumber: `0913000000${i + 1}`,
email: `customer${i + 1}@example.com`, // email: `customer${i + 1}@example.com`,
})), // })),
}) // })
} // }
if ((await prisma.product.count()) === 0) { // if ((await prisma.product.count()) === 0) {
const categories = await prisma.productCategory.findMany() // const categories = await prisma.productCategory.findMany()
const brands = await prisma.productBrand.findMany() // const brands = await prisma.productBrand.findMany()
await prisma.product.createMany({ // await prisma.product.createMany({
data: Array.from({ length: 20 }, (_, i) => ({ // data: Array.from({ length: 20 }, (_, i) => ({
name: `کالای ${i + 1}`, // name: `کالای ${i + 1}`,
sku: `SKU-${1000 + i + 1}`, // sku: `SKU-${1000 + i + 1}`,
salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000, // salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000,
categoryId: categories[i % categories.length].id, // categoryId: categories[i % categories.length].id,
brandId: brands[i % brands.length].id, // brandId: brands[i % brands.length].id,
})), // })),
}) // })
} // }
if ((await prisma.bank.count()) === 0) { // if ((await prisma.bank.count()) === 0) {
await prisma.bank.createMany({ // await prisma.bank.createMany({
data: [ // data: [
{ // {
name: 'آینده', // name: 'آینده',
shortName: 'ain', // shortName: 'ain',
}, // },
{ // {
name: 'ایران زمین', // name: 'ایران زمین',
shortName: 'irz', // shortName: 'irz',
}, // },
{ // {
name: 'اقتصاد نوین', // name: 'اقتصاد نوین',
shortName: 'eqn', // shortName: 'eqn',
}, // },
{ // {
name: 'انصار', // name: 'انصار',
shortName: 'ans', // shortName: 'ans',
}, // },
{ // {
name: 'پاسارگاد', // name: 'پاسارگاد',
shortName: 'pas', // shortName: 'pas',
}, // },
{ // {
name: 'پارسیان', // name: 'پارسیان',
shortName: 'prs', // shortName: 'prs',
}, // },
{ // {
name: 'پست‌ بانک ایران', // name: 'پست‌ بانک ایران',
shortName: 'pbi', // shortName: 'pbi',
}, // },
{ // {
name: 'تجارت', // name: 'تجارت',
shortName: 'tej', // shortName: 'tej',
}, // },
{ // {
name: 'توسعه تعاون', // name: 'توسعه تعاون',
shortName: 'tav', // shortName: 'tav',
}, // },
{ // {
name: 'توسعه صادرات', // name: 'توسعه صادرات',
shortName: 'tes', // shortName: 'tes',
}, // },
{ // {
name: 'حکمت ایرانیان', // name: 'حکمت ایرانیان',
shortName: 'hek', // shortName: 'hek',
}, // },
{ // {
name: 'رفاه کارگران', // name: 'رفاه کارگران',
shortName: 'ref', // shortName: 'ref',
}, // },
{ // {
name: 'قرض‌الحسنه رسالت', // name: 'قرض‌الحسنه رسالت',
shortName: 'res', // shortName: 'res',
}, // },
{ // {
name: 'قرض‌الحسنه مهر ایران', // name: 'قرض‌الحسنه مهر ایران',
shortName: 'meh', // shortName: 'meh',
}, // },
{ // {
name: 'قوامین', // name: 'قوامین',
shortName: 'qva', // shortName: 'qva',
}, // },
{ // {
name: 'کشاورزی', // name: 'کشاورزی',
shortName: 'kes', // shortName: 'kes',
}, // },
{ // {
name: 'کوثر', // name: 'کوثر',
shortName: 'kos', // shortName: 'kos',
}, // },
{ // {
name: 'دی', // name: 'دی',
shortName: 'diy', // shortName: 'diy',
}, // },
{ // {
name: 'صنعت و معدن', // name: 'صنعت و معدن',
shortName: 'san', // shortName: 'san',
}, // },
{ // {
name: 'سینا', // name: 'سینا',
shortName: 'sin', // shortName: 'sin',
}, // },
{ // {
name: 'سرمایه', // name: 'سرمایه',
shortName: 'sar', // shortName: 'sar',
}, // },
{ // {
name: 'سپه', // name: 'سپه',
shortName: 'sep', // shortName: 'sep',
}, // },
{ // {
name: 'شهر', // name: 'شهر',
shortName: 'shr', // shortName: 'shr',
}, // },
{ // {
name: 'صادرات ایران', // name: 'صادرات ایران',
shortName: 'sir', // shortName: 'sir',
}, // },
{ // {
name: 'سامان', // name: 'سامان',
shortName: 'sam', // shortName: 'sam',
}, // },
{ // {
name: 'مرکزی', // name: 'مرکزی',
shortName: 'mar', // shortName: 'mar',
}, // },
{ // {
name: 'مسکن', // name: 'مسکن',
shortName: 'mas', // shortName: 'mas',
}, // },
{ // {
name: 'ملت', // name: 'ملت',
shortName: 'mel', // shortName: 'mel',
}, // },
{ // {
name: 'ملی ایران', // name: 'ملی ایران',
shortName: 'mli', // shortName: 'mli',
}, // },
{ // {
name: 'مهر اقتصاد', // name: 'مهر اقتصاد',
shortName: 'meg', // shortName: 'meg',
}, // },
{ // {
name: 'کارآفرین', // name: 'کارآفرین',
shortName: 'kar', // shortName: 'kar',
}, // },
{ // {
name: 'تات', // name: 'تات',
shortName: 'tat', // shortName: 'tat',
}, // },
], // ],
}) // })
} // }
if ((await prisma.bankBranch.count()) === 0) { // if ((await prisma.bankBranch.count()) === 0) {
await prisma.bankBranch.createMany({ // await prisma.bankBranch.createMany({
data: [ // data: [
{ // {
bankId: 1, // bankId: 1,
name: 'شعبه مرکزی', // name: 'شعبه مرکزی',
code: '001', // code: '001',
}, // },
{ // {
bankId: 2, // bankId: 2,
name: 'شعبه مرکزی', // name: 'شعبه مرکزی',
code: '002', // code: '002',
}, // },
{ // {
bankId: 1, // bankId: 1,
name: 'شعبه ونک', // name: 'شعبه ونک',
code: '003', // code: '003',
}, // },
], // ],
}) // })
} // }
if ((await prisma.bankAccount.count()) === 0) { // if ((await prisma.bankAccount.count()) === 0) {
await prisma.bankAccount.createMany({ // await prisma.bankAccount.createMany({
data: [ // data: [
{ // {
branchId: 1, // branchId: 1,
accountNumber: '1234567890', // accountNumber: '1234567890',
name: 'حساب اصلی آینده', // name: 'حساب اصلی آینده',
iban: 'IR000123456789012345678901', // iban: 'IR000123456789012345678901',
}, // },
{ // {
branchId: 2, // branchId: 2,
accountNumber: '0987654321', // accountNumber: '0987654321',
name: 'حساب اصلی ایران زمین', // name: 'حساب اصلی ایران زمین',
iban: 'IR000987654321098765432109', // iban: 'IR000987654321098765432109',
}, // },
{ // {
branchId: 3, // branchId: 3,
accountNumber: '1122334455', // accountNumber: '1122334455',
name: 'حساب ونک آینده', // name: 'حساب ونک آینده',
iban: 'IR000112233445566778899001', // iban: 'IR000112233445566778899001',
}, // },
], // ],
}) // })
} // }
if ((await prisma.inventoryBankAccount.count()) === 0) { // if ((await prisma.inventoryBankAccount.count()) === 0) {
const inventories = await prisma.inventory.findMany() // const inventories = await prisma.inventory.findMany()
const bankAccounts = await prisma.bankAccount.findMany() // const bankAccounts = await prisma.bankAccount.findMany()
if (inventories.length || bankAccounts.length) { // if (inventories.length || bankAccounts.length) {
// Assign bank accounts to inventories // // Assign bank accounts to inventories
const inventoryBankAccounts = [] // const inventoryBankAccounts = []
for (let i = 0; i < inventories.length; i++) { // for (let i = 0; i < inventories.length; i++) {
const inventory = inventories[i] // const inventory = inventories[i]
const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts // const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts
// @ts-ignore // // @ts-ignore
inventoryBankAccounts.push({ // inventoryBankAccounts.push({
inventoryId: inventory.id, // inventoryId: inventory.id,
bankAccountId: bankAccount.id, // bankAccountId: bankAccount.id,
}) // })
} // }
await prisma.inventoryBankAccount.createMany({ // await prisma.inventoryBankAccount.createMany({
data: inventoryBankAccounts, // data: inventoryBankAccounts,
}) // })
} // }
} // }
if ((await prisma.posAccount.count()) === 0) { // if ((await prisma.posAccount.count()) === 0) {
const inventories = await prisma.inventory.findMany({ // const inventories = await prisma.inventory.findMany({
where: { isPointOfSale: true }, // where: { isPointOfSale: true },
}) // })
const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany() // const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany()
const posAccounts = [] // const posAccounts = []
for (let i = 0; i < inventories.length; i++) { // for (let i = 0; i < inventories.length; i++) {
const inventory = inventories[i] // const inventory = inventories[i]
// Find a bank account assigned to this inventory // // Find a bank account assigned to this inventory
const inventoryBankAccount = inventoryBankAccounts.find( // const inventoryBankAccount = inventoryBankAccounts.find(
iba => iba.inventoryId === inventory.id, // iba => iba.inventoryId === inventory.id,
) // )
if (inventoryBankAccount) { // if (inventoryBankAccount) {
// @ts-ignore // // @ts-ignore
// posAccounts.push({
posAccounts.push({ // name: `پوز ${inventory.name}`,
name: `پوز ${inventory.name}`, // code: `POS${(i + 1).toString().padStart(3, '0')}`,
code: `POS${(i + 1).toString().padStart(3, '0')}`, // description: `پوز فروشگاه ${inventory.name}`,
description: `پوز فروشگاه ${inventory.name}`, // inventoryId: inventory.id,
inventoryId: inventory.id, // bankAccountId: inventoryBankAccount.bankAccountId,
bankAccountId: inventoryBankAccount.bankAccountId, // })
}) // }
} // }
} // await prisma.posAccount.createMany({
await prisma.posAccount.createMany({ // data: posAccounts,
data: posAccounts, // })
}) // }
}
// Seed purchase, transfer, and sales transactions // Seed purchase, transfer, and sales transactions
// const inventories = await prisma.inventory.findMany() // const inventories = await prisma.inventory.findMany()
// const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo // const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo
+24 -24
View File
@@ -28,34 +28,34 @@ function makePermissionsFor(moduleName: string) {
} }
async function main() { async function main() {
const srcDir = path.resolve(__dirname, '..', 'src') // const srcDir = path.resolve(__dirname, '..', 'src')
const moduleFiles = findModules(srcDir) // const moduleFiles = findModules(srcDir)
const modules = moduleFiles.map(moduleNameFromFile) // const modules = moduleFiles.map(moduleNameFromFile)
const permsMap: Record<string, boolean> = {} // const permsMap: Record<string, boolean> = {}
for (const m of modules) { // for (const m of modules) {
for (const p of makePermissionsFor(m)) permsMap[p] = false // for (const p of makePermissionsFor(m)) permsMap[p] = false
} // }
// Upsert roles: ensure admin has full permissions, others get entries added // // Upsert roles: ensure admin has full permissions, others get entries added
const roles = await prisma.role.findMany() // const roles = await prisma.role.findMany()
for (const r of roles) { // for (const r of roles) {
const current: Record<string, any> = (r.permissions as any) || {} // const current: Record<string, any> = (r.permissions as any) || {}
const merged = { ...permsMap, ...current } // const merged = { ...permsMap, ...current }
// If role name is admin (case-insensitive), set all permissions to true // // If role name is admin (case-insensitive), set all permissions to true
if (r.name && r.name.toLowerCase() === 'admin') { // if (r.name && r.name.toLowerCase() === 'admin') {
for (const key of Object.keys(merged)) merged[key] = true // for (const key of Object.keys(merged)) merged[key] = true
} else { // } else {
// keep existing truthy values, otherwise false // // keep existing truthy values, otherwise false
for (const key of Object.keys(merged)) merged[key] = merged[key] || false // for (const key of Object.keys(merged)) merged[key] = merged[key] || false
} // }
await prisma.role.update({ where: { id: r.id }, data: { permissions: merged } }) // await prisma.role.update({ where: { id: r.id }, data: { permissions: merged } })
console.log( // console.log(
`Updated role ${r.name} (id=${r.id}) with ${Object.keys(merged).length} permissions`, // `Updated role ${r.name} (id=${r.id}) with ${Object.keys(merged).length} permissions`,
) // )
} // }
await prisma.$disconnect() await prisma.$disconnect()
} }
+20 -8
View File
@@ -2,24 +2,36 @@ import { Module } from '@nestjs/common'
import { AppController } from './app.controller' import { AppController } from './app.controller'
import { AppService } from './app.service' import { AppService } from './app.service'
import { AuthModule } from './modules/auth/auth.module' import { AuthModule } from './modules/auth/auth.module'
import { ConfigModule } from './modules/config/config.module'
import { CustomersModule } from './modules/customers/customers.module' import { CustomersModule } from './modules/customers/customers.module'
import { ProductCategoriesModule } from './modules/product-categories/product-categories.module' import { GoodCategoriesModule } from './modules/good-categories/good-categories.module'
import { ProductsModule } from './modules/products/products.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 { SalesInvoicesModule } from './modules/sales-invoices/sales-invoices.module'
import { StatisticsModule } from './modules/statistics/statistics.module' import { ServiceCategoriesModule } from './modules/service-categories/service-categories.module'
import { UploadsModule } from './modules/uploads/uploads.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' import { PrismaModule } from './prisma/prisma.module'
@Module({ @Module({
imports: [ imports: [
PrismaModule, PrismaModule,
AuthModule, AuthModule,
ProductsModule,
ProductCategoriesModule,
CustomersModule, CustomersModule,
GoodCategoriesModule,
GoodsModule,
SalesInvoiceItemsModule,
SalesInvoicePaymentsModule,
SalesInvoicesModule, SalesInvoicesModule,
StatisticsModule, ServiceCategoriesModule,
UploadsModule, ServicesModule,
TriggerLogsModule,
UploadersModule,
ConfigModule,
ProfileModule,
], ],
controllers: [AppController], controllers: [AppController],
providers: [AppService], providers: [AppService],
@@ -0,0 +1,4 @@
import { SetMetadata } from '@nestjs/common'
export const IS_PUBLIC_KEY = 'isPublic'
export const Public = () => SetMetadata(IS_PUBLIC_KEY, true)
+12
View File
@@ -0,0 +1,12 @@
export enum TokenType {
ACCESS,
REFRESH,
}
export enum AccountType {
PARTNER,
BUSINESS,
ADMIN,
PROVIDER,
POS,
}
+29
View File
@@ -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
// }
}
+10 -5
View File
@@ -17,6 +17,16 @@ import * as Prisma from './internal/prismaNamespaceBrowser.js'
export { Prisma } export { Prisma }
export * as $Enums from './enums.js' export * as $Enums from './enums.js'
export * from './enums.js'; export * from './enums.js';
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/**
* Model Device
*
*/
export type Device = Prisma.DeviceModel
/** /**
* Model Good * Model Good
* *
@@ -27,11 +37,6 @@ export type Good = Prisma.GoodModel
* *
*/ */
export type GoodCategory = Prisma.GoodCategoryModel export type GoodCategory = Prisma.GoodCategoryModel
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/** /**
* Model TriggerLog * Model TriggerLog
* *
+12 -7
View File
@@ -27,8 +27,8 @@ export * from "./enums.js"
* @example * @example
* ``` * ```
* const prisma = new PrismaClient() * const prisma = new PrismaClient()
* // Fetch zero or more Goods * // Fetch zero or more Customers
* const goods = await prisma.good.findMany() * const customers = await prisma.customer.findMany()
* ``` * ```
* *
* Read more in our [docs](https://pris.ly/d/client). * Read more in our [docs](https://pris.ly/d/client).
@@ -37,6 +37,16 @@ export const PrismaClient = $Class.getPrismaClientClass()
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs> export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
export { Prisma } export { Prisma }
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/**
* Model Device
*
*/
export type Device = Prisma.DeviceModel
/** /**
* Model Good * Model Good
* *
@@ -47,11 +57,6 @@ export type Good = Prisma.GoodModel
* *
*/ */
export type GoodCategory = Prisma.GoodCategoryModel export type GoodCategory = Prisma.GoodCategoryModel
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/** /**
* Model TriggerLog * Model TriggerLog
* *
+111 -165
View File
@@ -14,17 +14,6 @@ import * as $Enums from "./enums.js"
import type * as Prisma from "./internal/prismaNamespace.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> = { export type StringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[] in?: string[]
@@ -55,6 +44,11 @@ export type StringNullableFilter<$PrismaModel = never> = {
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null 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> = { export type DateTimeFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[] in?: Date[] | string[]
@@ -77,49 +71,11 @@ export type DateTimeNullableFilter<$PrismaModel = never> = {
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null 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 = { export type SortOrderInput = {
sort: Prisma.SortOrder sort: Prisma.SortOrder
nulls?: Prisma.NullsOrder 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> = { export type StringWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[] in?: string[]
@@ -156,6 +112,14 @@ export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedStringNullableFilter<$PrismaModel> _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> = { export type DateTimeWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[] in?: Date[] | string[]
@@ -184,20 +148,15 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
} }
export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { export type DecimalFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: number[] | null in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
notIn?: number[] | null notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel> gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
_count?: Prisma.NestedIntNullableFilter<$PrismaModel>
_avg?: Prisma.NestedFloatNullableFilter<$PrismaModel>
_sum?: Prisma.NestedIntNullableFilter<$PrismaModel>
_min?: Prisma.NestedIntNullableFilter<$PrismaModel>
_max?: Prisma.NestedIntNullableFilter<$PrismaModel>
} }
export type DecimalWithAggregatesFilter<$PrismaModel = never> = { export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
@@ -216,17 +175,31 @@ export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedDecimalFilter<$PrismaModel> _max?: Prisma.NestedDecimalFilter<$PrismaModel>
} }
export type BoolFilter<$PrismaModel = never> = { export type IntFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean 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> = { export type IntWithAggregatesFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean 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> _count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedBoolFilter<$PrismaModel> _avg?: Prisma.NestedFloatFilter<$PrismaModel>
_max?: Prisma.NestedBoolFilter<$PrismaModel> _sum?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedIntFilter<$PrismaModel>
_max?: Prisma.NestedIntFilter<$PrismaModel>
} }
export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = { export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = {
@@ -246,17 +219,6 @@ export type EnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> _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> = { export type NestedStringFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[] in?: string[]
@@ -287,6 +249,11 @@ export type NestedStringNullableFilter<$PrismaModel = never> = {
not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null 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> = { export type NestedDateTimeFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[] in?: Date[] | string[]
@@ -309,55 +276,6 @@ export type NestedDateTimeNullableFilter<$PrismaModel = never> = {
not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null 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> = { export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> equals?: string | Prisma.StringFieldRefInput<$PrismaModel>
in?: string[] in?: string[]
@@ -376,6 +294,17 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedStringFilter<$PrismaModel> _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> = { export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null
in?: string[] | null in?: string[] | null
@@ -394,6 +323,25 @@ export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedStringNullableFilter<$PrismaModel> _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> = { export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = {
equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel>
in?: Date[] | string[] in?: Date[] | string[]
@@ -422,31 +370,15 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
} }
export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { export type NestedDecimalFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: number[] | null in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
notIn?: number[] | null notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
lte?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gt?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
gte?: number | Prisma.IntFieldRefInput<$PrismaModel> gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
_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 NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
@@ -465,17 +397,31 @@ export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedDecimalFilter<$PrismaModel> _max?: Prisma.NestedDecimalFilter<$PrismaModel>
} }
export type NestedBoolFilter<$PrismaModel = never> = { export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean 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> = { export type NestedFloatFilter<$PrismaModel = never> = {
equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> equals?: number | Prisma.FloatFieldRefInput<$PrismaModel>
not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean in?: number[]
_count?: Prisma.NestedIntFilter<$PrismaModel> notIn?: number[]
_min?: Prisma.NestedBoolFilter<$PrismaModel> lt?: number | Prisma.FloatFieldRefInput<$PrismaModel>
_max?: Prisma.NestedBoolFilter<$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> = { export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = {
File diff suppressed because one or more lines are too long
+300 -141
View File
@@ -384,9 +384,10 @@ type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRe
export const ModelName = { export const ModelName = {
Customer: 'Customer',
Device: 'Device',
Good: 'Good', Good: 'Good',
GoodCategory: 'GoodCategory', GoodCategory: 'GoodCategory',
Customer: 'Customer',
TriggerLog: 'TriggerLog', TriggerLog: 'TriggerLog',
SalesInvoice: 'SalesInvoice', SalesInvoice: 'SalesInvoice',
SalesInvoiceItem: 'SalesInvoiceItem', SalesInvoiceItem: 'SalesInvoiceItem',
@@ -408,10 +409,142 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
omit: GlobalOmitOptions omit: GlobalOmitOptions
} }
meta: { meta: {
modelProps: "good" | "goodCategory" | "customer" | "triggerLog" | "salesInvoice" | "salesInvoiceItem" | "salesInvoicePayment" | "service" | "serviceCategory" modelProps: "customer" | "device" | "good" | "goodCategory" | "triggerLog" | "salesInvoice" | "salesInvoiceItem" | "salesInvoicePayment" | "service" | "serviceCategory"
txIsolationLevel: TransactionIsolationLevel txIsolationLevel: TransactionIsolationLevel
} }
model: { model: {
Customer: {
payload: Prisma.$CustomerPayload<ExtArgs>
fields: Prisma.CustomerFieldRefs
operations: {
findUnique: {
args: Prisma.CustomerFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload> | null
}
findUniqueOrThrow: {
args: Prisma.CustomerFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
findFirst: {
args: Prisma.CustomerFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload> | null
}
findFirstOrThrow: {
args: Prisma.CustomerFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
findMany: {
args: Prisma.CustomerFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>[]
}
create: {
args: Prisma.CustomerCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
createMany: {
args: Prisma.CustomerCreateManyArgs<ExtArgs>
result: BatchPayload
}
delete: {
args: Prisma.CustomerDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
update: {
args: Prisma.CustomerUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
deleteMany: {
args: Prisma.CustomerDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.CustomerUpdateManyArgs<ExtArgs>
result: BatchPayload
}
upsert: {
args: Prisma.CustomerUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
aggregate: {
args: Prisma.CustomerAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateCustomer>
}
groupBy: {
args: Prisma.CustomerGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.CustomerGroupByOutputType>[]
}
count: {
args: Prisma.CustomerCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.CustomerCountAggregateOutputType> | number
}
}
}
Device: {
payload: Prisma.$DevicePayload<ExtArgs>
fields: Prisma.DeviceFieldRefs
operations: {
findUnique: {
args: Prisma.DeviceFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload> | null
}
findUniqueOrThrow: {
args: Prisma.DeviceFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>
}
findFirst: {
args: Prisma.DeviceFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload> | null
}
findFirstOrThrow: {
args: Prisma.DeviceFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>
}
findMany: {
args: Prisma.DeviceFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>[]
}
create: {
args: Prisma.DeviceCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>
}
createMany: {
args: Prisma.DeviceCreateManyArgs<ExtArgs>
result: BatchPayload
}
delete: {
args: Prisma.DeviceDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>
}
update: {
args: Prisma.DeviceUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>
}
deleteMany: {
args: Prisma.DeviceDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.DeviceUpdateManyArgs<ExtArgs>
result: BatchPayload
}
upsert: {
args: Prisma.DeviceUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$DevicePayload>
}
aggregate: {
args: Prisma.DeviceAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateDevice>
}
groupBy: {
args: Prisma.DeviceGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.DeviceGroupByOutputType>[]
}
count: {
args: Prisma.DeviceCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.DeviceCountAggregateOutputType> | number
}
}
}
Good: { Good: {
payload: Prisma.$GoodPayload<ExtArgs> payload: Prisma.$GoodPayload<ExtArgs>
fields: Prisma.GoodFieldRefs fields: Prisma.GoodFieldRefs
@@ -544,72 +677,6 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
} }
} }
} }
Customer: {
payload: Prisma.$CustomerPayload<ExtArgs>
fields: Prisma.CustomerFieldRefs
operations: {
findUnique: {
args: Prisma.CustomerFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload> | null
}
findUniqueOrThrow: {
args: Prisma.CustomerFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
findFirst: {
args: Prisma.CustomerFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload> | null
}
findFirstOrThrow: {
args: Prisma.CustomerFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
findMany: {
args: Prisma.CustomerFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>[]
}
create: {
args: Prisma.CustomerCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
createMany: {
args: Prisma.CustomerCreateManyArgs<ExtArgs>
result: BatchPayload
}
delete: {
args: Prisma.CustomerDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
update: {
args: Prisma.CustomerUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
deleteMany: {
args: Prisma.CustomerDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.CustomerUpdateManyArgs<ExtArgs>
result: BatchPayload
}
upsert: {
args: Prisma.CustomerUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$CustomerPayload>
}
aggregate: {
args: Prisma.CustomerAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateCustomer>
}
groupBy: {
args: Prisma.CustomerGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.CustomerGroupByOutputType>[]
}
count: {
args: Prisma.CustomerCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.CustomerCountAggregateOutputType> | number
}
}
}
TriggerLog: { TriggerLog: {
payload: Prisma.$TriggerLogPayload<ExtArgs> payload: Prisma.$TriggerLogPayload<ExtArgs>
fields: Prisma.TriggerLogFieldRefs fields: Prisma.TriggerLogFieldRefs
@@ -1045,18 +1112,57 @@ export const TransactionIsolationLevel = runtime.makeStrictEnum({
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof 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 = { export const GoodScalarFieldEnum = {
id: 'id', id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
localSku: 'localSku', local_sku: 'local_sku',
barcode: 'barcode', barcode: 'barcode',
createdAt: 'createdAt', created_at: 'created_at',
updatedAt: 'updatedAt', updated_at: 'updated_at',
deletedAt: 'deletedAt', deleted_at: 'deleted_at',
categoryId: 'categoryId', category_id: 'category_id',
baseSalePrice: 'baseSalePrice' base_sale_price: 'base_sale_price',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum] export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum]
@@ -1066,31 +1172,17 @@ export const GoodCategoryScalarFieldEnum = {
id: 'id', id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl', image_url: 'image_url',
createdAt: 'createdAt', account_id: 'account_id',
updatedAt: 'updatedAt', complex_id: 'complex_id',
deletedAt: 'deletedAt' created_at: 'created_at',
updated_at: 'updated_at',
deleted_at: 'deleted_at'
} as const } as const
export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum] 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 = { export const TriggerLogScalarFieldEnum = {
id: 'id', id: 'id',
message: 'message', message: 'message',
@@ -1104,11 +1196,13 @@ export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof
export const SalesInvoiceScalarFieldEnum = { export const SalesInvoiceScalarFieldEnum = {
id: 'id', id: 'id',
code: 'code', code: 'code',
totalAmount: 'totalAmount', total_amount: 'total_amount',
description: 'description', description: 'description',
createdAt: 'createdAt', created_at: 'created_at',
updatedAt: 'updatedAt', updated_at: 'updated_at',
customerId: 'customerId' customer_id: 'customer_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum]
@@ -1117,12 +1211,12 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k
export const SalesInvoiceItemScalarFieldEnum = { export const SalesInvoiceItemScalarFieldEnum = {
id: 'id', id: 'id',
count: 'count', count: 'count',
unitPrice: 'unitPrice', unit_price: 'unit_price',
totalAmount: 'totalAmount', total_amount: 'total_amount',
createdAt: 'createdAt', created_at: 'created_at',
invoiceId: 'invoiceId', invoice_id: 'invoice_id',
goodId: 'goodId', good_id: 'good_id',
serviceId: 'serviceId' service_id: 'service_id'
} as const } as const
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum] export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
@@ -1130,11 +1224,11 @@ export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFiel
export const SalesInvoicePaymentScalarFieldEnum = { export const SalesInvoicePaymentScalarFieldEnum = {
id: 'id', id: 'id',
invoiceId: 'invoiceId', invoice_id: 'invoice_id',
amount: 'amount', amount: 'amount',
paymentMethod: 'paymentMethod', payment_method: 'payment_method',
paidAt: 'paidAt', paid_at: 'paid_at',
createdAt: 'createdAt' created_at: 'created_at'
} as const } as const
export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum] export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum]
@@ -1145,12 +1239,15 @@ export const ServiceScalarFieldEnum = {
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
local_sku: 'local_sku',
barcode: 'barcode', barcode: 'barcode',
createdAt: 'createdAt', created_at: 'created_at',
updatedAt: 'updatedAt', updated_at: 'updated_at',
deletedAt: 'deletedAt', deleted_at: 'deleted_at',
categoryId: 'categoryId', category_id: 'category_id',
baseSalePrice: 'baseSalePrice' base_sale_price: 'base_sale_price',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type ServiceScalarFieldEnum = (typeof ServiceScalarFieldEnum)[keyof typeof ServiceScalarFieldEnum] export type ServiceScalarFieldEnum = (typeof ServiceScalarFieldEnum)[keyof typeof ServiceScalarFieldEnum]
@@ -1160,10 +1257,12 @@ export const ServiceCategoryScalarFieldEnum = {
id: 'id', id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl', image_url: 'image_url',
createdAt: 'createdAt', account_id: 'account_id',
updatedAt: 'updatedAt', complex_id: 'complex_id',
deletedAt: 'deletedAt' created_at: 'created_at',
updated_at: 'updated_at',
deleted_at: 'deleted_at'
} as const } as const
export type ServiceCategoryScalarFieldEnum = (typeof ServiceCategoryScalarFieldEnum)[keyof typeof ServiceCategoryScalarFieldEnum] export type ServiceCategoryScalarFieldEnum = (typeof ServiceCategoryScalarFieldEnum)[keyof typeof ServiceCategoryScalarFieldEnum]
@@ -1185,37 +1284,66 @@ export const NullsOrder = {
export type NullsOrder = (typeof NullsOrder)[keyof typeof 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 = { export const GoodOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
localSku: 'localSku', local_sku: 'local_sku',
barcode: 'barcode' barcode: 'barcode',
category_id: 'category_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum] export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum]
export const GoodCategoryOrderByRelevanceFieldEnum = { export const GoodCategoryOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl' image_url: 'image_url',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum] 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 = { export const TriggerLogOrderByRelevanceFieldEnum = {
message: 'message', message: 'message',
name: 'name' name: 'name'
@@ -1225,27 +1353,57 @@ export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelev
export const SalesInvoiceOrderByRelevanceFieldEnum = { export const SalesInvoiceOrderByRelevanceFieldEnum = {
id: 'id',
code: 'code', code: 'code',
description: 'description' description: 'description',
customer_id: 'customer_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] 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 = { export const ServiceOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
barcode: 'barcode' local_sku: 'local_sku',
barcode: 'barcode',
category_id: 'category_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type ServiceOrderByRelevanceFieldEnum = (typeof ServiceOrderByRelevanceFieldEnum)[keyof typeof ServiceOrderByRelevanceFieldEnum] export type ServiceOrderByRelevanceFieldEnum = (typeof ServiceOrderByRelevanceFieldEnum)[keyof typeof ServiceOrderByRelevanceFieldEnum]
export const ServiceCategoryOrderByRelevanceFieldEnum = { export const ServiceCategoryOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl' image_url: 'image_url',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type ServiceCategoryOrderByRelevanceFieldEnum = (typeof ServiceCategoryOrderByRelevanceFieldEnum)[keyof typeof ServiceCategoryOrderByRelevanceFieldEnum] 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[] comments?: runtime.SqlCommenterPlugin[]
} }
export type GlobalOmitConfig = { export type GlobalOmitConfig = {
customer?: Prisma.CustomerOmit
device?: Prisma.DeviceOmit
good?: Prisma.GoodOmit good?: Prisma.GoodOmit
goodCategory?: Prisma.GoodCategoryOmit goodCategory?: Prisma.GoodCategoryOmit
customer?: Prisma.CustomerOmit
triggerLog?: Prisma.TriggerLogOmit triggerLog?: Prisma.TriggerLogOmit
salesInvoice?: Prisma.SalesInvoiceOmit salesInvoice?: Prisma.SalesInvoiceOmit
salesInvoiceItem?: Prisma.SalesInvoiceItemOmit salesInvoiceItem?: Prisma.SalesInvoiceItemOmit
@@ -51,9 +51,10 @@ export const AnyNull = runtime.AnyNull
export const ModelName = { export const ModelName = {
Customer: 'Customer',
Device: 'Device',
Good: 'Good', Good: 'Good',
GoodCategory: 'GoodCategory', GoodCategory: 'GoodCategory',
Customer: 'Customer',
TriggerLog: 'TriggerLog', TriggerLog: 'TriggerLog',
SalesInvoice: 'SalesInvoice', SalesInvoice: 'SalesInvoice',
SalesInvoiceItem: 'SalesInvoiceItem', SalesInvoiceItem: 'SalesInvoiceItem',
@@ -78,18 +79,57 @@ export const TransactionIsolationLevel = {
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof 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 = { export const GoodScalarFieldEnum = {
id: 'id', id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
localSku: 'localSku', local_sku: 'local_sku',
barcode: 'barcode', barcode: 'barcode',
createdAt: 'createdAt', created_at: 'created_at',
updatedAt: 'updatedAt', updated_at: 'updated_at',
deletedAt: 'deletedAt', deleted_at: 'deleted_at',
categoryId: 'categoryId', category_id: 'category_id',
baseSalePrice: 'baseSalePrice' base_sale_price: 'base_sale_price',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum] export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum]
@@ -99,31 +139,17 @@ export const GoodCategoryScalarFieldEnum = {
id: 'id', id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl', image_url: 'image_url',
createdAt: 'createdAt', account_id: 'account_id',
updatedAt: 'updatedAt', complex_id: 'complex_id',
deletedAt: 'deletedAt' created_at: 'created_at',
updated_at: 'updated_at',
deleted_at: 'deleted_at'
} as const } as const
export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum] 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 = { export const TriggerLogScalarFieldEnum = {
id: 'id', id: 'id',
message: 'message', message: 'message',
@@ -137,11 +163,13 @@ export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof
export const SalesInvoiceScalarFieldEnum = { export const SalesInvoiceScalarFieldEnum = {
id: 'id', id: 'id',
code: 'code', code: 'code',
totalAmount: 'totalAmount', total_amount: 'total_amount',
description: 'description', description: 'description',
createdAt: 'createdAt', created_at: 'created_at',
updatedAt: 'updatedAt', updated_at: 'updated_at',
customerId: 'customerId' customer_id: 'customer_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum]
@@ -150,12 +178,12 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k
export const SalesInvoiceItemScalarFieldEnum = { export const SalesInvoiceItemScalarFieldEnum = {
id: 'id', id: 'id',
count: 'count', count: 'count',
unitPrice: 'unitPrice', unit_price: 'unit_price',
totalAmount: 'totalAmount', total_amount: 'total_amount',
createdAt: 'createdAt', created_at: 'created_at',
invoiceId: 'invoiceId', invoice_id: 'invoice_id',
goodId: 'goodId', good_id: 'good_id',
serviceId: 'serviceId' service_id: 'service_id'
} as const } as const
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum] export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
@@ -163,11 +191,11 @@ export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFiel
export const SalesInvoicePaymentScalarFieldEnum = { export const SalesInvoicePaymentScalarFieldEnum = {
id: 'id', id: 'id',
invoiceId: 'invoiceId', invoice_id: 'invoice_id',
amount: 'amount', amount: 'amount',
paymentMethod: 'paymentMethod', payment_method: 'payment_method',
paidAt: 'paidAt', paid_at: 'paid_at',
createdAt: 'createdAt' created_at: 'created_at'
} as const } as const
export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum] export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum]
@@ -178,12 +206,15 @@ export const ServiceScalarFieldEnum = {
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
local_sku: 'local_sku',
barcode: 'barcode', barcode: 'barcode',
createdAt: 'createdAt', created_at: 'created_at',
updatedAt: 'updatedAt', updated_at: 'updated_at',
deletedAt: 'deletedAt', deleted_at: 'deleted_at',
categoryId: 'categoryId', category_id: 'category_id',
baseSalePrice: 'baseSalePrice' base_sale_price: 'base_sale_price',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type ServiceScalarFieldEnum = (typeof ServiceScalarFieldEnum)[keyof typeof ServiceScalarFieldEnum] export type ServiceScalarFieldEnum = (typeof ServiceScalarFieldEnum)[keyof typeof ServiceScalarFieldEnum]
@@ -193,10 +224,12 @@ export const ServiceCategoryScalarFieldEnum = {
id: 'id', id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl', image_url: 'image_url',
createdAt: 'createdAt', account_id: 'account_id',
updatedAt: 'updatedAt', complex_id: 'complex_id',
deletedAt: 'deletedAt' created_at: 'created_at',
updated_at: 'updated_at',
deleted_at: 'deleted_at'
} as const } as const
export type ServiceCategoryScalarFieldEnum = (typeof ServiceCategoryScalarFieldEnum)[keyof typeof ServiceCategoryScalarFieldEnum] export type ServiceCategoryScalarFieldEnum = (typeof ServiceCategoryScalarFieldEnum)[keyof typeof ServiceCategoryScalarFieldEnum]
@@ -218,37 +251,66 @@ export const NullsOrder = {
export type NullsOrder = (typeof NullsOrder)[keyof typeof 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 = { export const GoodOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
localSku: 'localSku', local_sku: 'local_sku',
barcode: 'barcode' barcode: 'barcode',
category_id: 'category_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum] export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum]
export const GoodCategoryOrderByRelevanceFieldEnum = { export const GoodCategoryOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl' image_url: 'image_url',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum] 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 = { export const TriggerLogOrderByRelevanceFieldEnum = {
message: 'message', message: 'message',
name: 'name' name: 'name'
@@ -258,27 +320,57 @@ export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelev
export const SalesInvoiceOrderByRelevanceFieldEnum = { export const SalesInvoiceOrderByRelevanceFieldEnum = {
id: 'id',
code: 'code', code: 'code',
description: 'description' description: 'description',
customer_id: 'customer_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] 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 = { export const ServiceOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
sku: 'sku', sku: 'sku',
barcode: 'barcode' local_sku: 'local_sku',
barcode: 'barcode',
category_id: 'category_id',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type ServiceOrderByRelevanceFieldEnum = (typeof ServiceOrderByRelevanceFieldEnum)[keyof typeof ServiceOrderByRelevanceFieldEnum] export type ServiceOrderByRelevanceFieldEnum = (typeof ServiceOrderByRelevanceFieldEnum)[keyof typeof ServiceOrderByRelevanceFieldEnum]
export const ServiceCategoryOrderByRelevanceFieldEnum = { export const ServiceCategoryOrderByRelevanceFieldEnum = {
id: 'id',
name: 'name', name: 'name',
description: 'description', description: 'description',
imageUrl: 'imageUrl' image_url: 'image_url',
account_id: 'account_id',
complex_id: 'complex_id'
} as const } as const
export type ServiceCategoryOrderByRelevanceFieldEnum = (typeof ServiceCategoryOrderByRelevanceFieldEnum)[keyof typeof ServiceCategoryOrderByRelevanceFieldEnum] export type ServiceCategoryOrderByRelevanceFieldEnum = (typeof ServiceCategoryOrderByRelevanceFieldEnum)[keyof typeof ServiceCategoryOrderByRelevanceFieldEnum]
+2 -1
View File
@@ -8,9 +8,10 @@
* *
* 🟢 You can import this file directly. * 🟢 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/Good.js'
export type * from './models/GoodCategory.js' export type * from './models/GoodCategory.js'
export type * from './models/Customer.js'
export type * from './models/TriggerLog.js' export type * from './models/TriggerLog.js'
export type * from './models/SalesInvoice.js' export type * from './models/SalesInvoice.js'
export type * from './models/SalesInvoiceItem.js' export type * from './models/SalesInvoiceItem.js'
+342 -305
View File
@@ -20,106 +20,100 @@ export type CustomerModel = runtime.Types.Result.DefaultSelection<Prisma.$Custom
export type AggregateCustomer = { export type AggregateCustomer = {
_count: CustomerCountAggregateOutputType | null _count: CustomerCountAggregateOutputType | null
_avg: CustomerAvgAggregateOutputType | null
_sum: CustomerSumAggregateOutputType | null
_min: CustomerMinAggregateOutputType | null _min: CustomerMinAggregateOutputType | null
_max: CustomerMaxAggregateOutputType | null _max: CustomerMaxAggregateOutputType | null
} }
export type CustomerAvgAggregateOutputType = {
id: number | null
}
export type CustomerSumAggregateOutputType = {
id: number | null
}
export type CustomerMinAggregateOutputType = { export type CustomerMinAggregateOutputType = {
id: number | null id: string | null
firstName: string | null first_name: string | null
lastName: string | null last_name: string | null
email: string | null email: string | null
mobileNumber: string | null mobile_number: string | null
address: string | null address: string | null
isActive: boolean | null is_active: boolean | null
createdAt: Date | null account_id: string | null
updatedAt: Date | null complex_id: string | null
deletedAt: Date | null created_at: Date | null
updated_at: Date | null
deleted_at: Date | null
} }
export type CustomerMaxAggregateOutputType = { export type CustomerMaxAggregateOutputType = {
id: number | null id: string | null
firstName: string | null first_name: string | null
lastName: string | null last_name: string | null
email: string | null email: string | null
mobileNumber: string | null mobile_number: string | null
address: string | null address: string | null
isActive: boolean | null is_active: boolean | null
createdAt: Date | null account_id: string | null
updatedAt: Date | null complex_id: string | null
deletedAt: Date | null created_at: Date | null
updated_at: Date | null
deleted_at: Date | null
} }
export type CustomerCountAggregateOutputType = { export type CustomerCountAggregateOutputType = {
id: number id: number
firstName: number first_name: number
lastName: number last_name: number
email: number email: number
mobileNumber: number mobile_number: number
address: number address: number
isActive: number is_active: number
createdAt: number account_id: number
updatedAt: number complex_id: number
deletedAt: number created_at: number
updated_at: number
deleted_at: number
_all: number _all: number
} }
export type CustomerAvgAggregateInputType = {
id?: true
}
export type CustomerSumAggregateInputType = {
id?: true
}
export type CustomerMinAggregateInputType = { export type CustomerMinAggregateInputType = {
id?: true id?: true
firstName?: true first_name?: true
lastName?: true last_name?: true
email?: true email?: true
mobileNumber?: true mobile_number?: true
address?: true address?: true
isActive?: true is_active?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
} }
export type CustomerMaxAggregateInputType = { export type CustomerMaxAggregateInputType = {
id?: true id?: true
firstName?: true first_name?: true
lastName?: true last_name?: true
email?: true email?: true
mobileNumber?: true mobile_number?: true
address?: true address?: true
isActive?: true is_active?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
} }
export type CustomerCountAggregateInputType = { export type CustomerCountAggregateInputType = {
id?: true id?: true
firstName?: true first_name?: true
lastName?: true last_name?: true
email?: true email?: true
mobileNumber?: true mobile_number?: true
address?: true address?: true
isActive?: true is_active?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
_all?: true _all?: true
} }
@@ -158,18 +152,6 @@ export type CustomerAggregateArgs<ExtArgs extends runtime.Types.Extensions.Inter
* Count returned Customers * Count returned Customers
**/ **/
_count?: true | CustomerCountAggregateInputType _count?: true | CustomerCountAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
**/
_avg?: CustomerAvgAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
**/
_sum?: CustomerSumAggregateInputType
/** /**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
* *
@@ -203,26 +185,24 @@ export type CustomerGroupByArgs<ExtArgs extends runtime.Types.Extensions.Interna
take?: number take?: number
skip?: number skip?: number
_count?: CustomerCountAggregateInputType | true _count?: CustomerCountAggregateInputType | true
_avg?: CustomerAvgAggregateInputType
_sum?: CustomerSumAggregateInputType
_min?: CustomerMinAggregateInputType _min?: CustomerMinAggregateInputType
_max?: CustomerMaxAggregateInputType _max?: CustomerMaxAggregateInputType
} }
export type CustomerGroupByOutputType = { export type CustomerGroupByOutputType = {
id: number id: string
firstName: string first_name: string
lastName: string last_name: string
email: string | null email: string | null
mobileNumber: string mobile_number: string
address: string | null address: string | null
isActive: boolean is_active: boolean
createdAt: Date account_id: string
updatedAt: Date complex_id: string
deletedAt: Date | null created_at: Date
updated_at: Date
deleted_at: Date | null
_count: CustomerCountAggregateOutputType | null _count: CustomerCountAggregateOutputType | null
_avg: CustomerAvgAggregateOutputType | null
_sum: CustomerSumAggregateOutputType | null
_min: CustomerMinAggregateOutputType | null _min: CustomerMinAggregateOutputType | null
_max: CustomerMaxAggregateOutputType | null _max: CustomerMaxAggregateOutputType | null
} }
@@ -246,175 +226,200 @@ export type CustomerWhereInput = {
AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
OR?: Prisma.CustomerWhereInput[] OR?: Prisma.CustomerWhereInput[]
NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
id?: Prisma.IntFilter<"Customer"> | number id?: Prisma.StringFilter<"Customer"> | string
firstName?: Prisma.StringFilter<"Customer"> | string first_name?: Prisma.StringFilter<"Customer"> | string
lastName?: Prisma.StringFilter<"Customer"> | string last_name?: Prisma.StringFilter<"Customer"> | string
email?: Prisma.StringNullableFilter<"Customer"> | string | null email?: Prisma.StringNullableFilter<"Customer"> | string | null
mobileNumber?: Prisma.StringFilter<"Customer"> | string mobile_number?: Prisma.StringFilter<"Customer"> | string
address?: Prisma.StringNullableFilter<"Customer"> | string | null address?: Prisma.StringNullableFilter<"Customer"> | string | null
isActive?: Prisma.BoolFilter<"Customer"> | boolean is_active?: Prisma.BoolFilter<"Customer"> | boolean
createdAt?: Prisma.DateTimeFilter<"Customer"> | Date | string account_id?: Prisma.StringFilter<"Customer"> | string
updatedAt?: Prisma.DateTimeFilter<"Customer"> | Date | string complex_id?: Prisma.StringFilter<"Customer"> | string
deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
salesInvoices?: Prisma.SalesInvoiceListRelationFilter updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
} }
export type CustomerOrderByWithRelationInput = { export type CustomerOrderByWithRelationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
firstName?: Prisma.SortOrder first_name?: Prisma.SortOrder
lastName?: Prisma.SortOrder last_name?: Prisma.SortOrder
email?: Prisma.SortOrderInput | Prisma.SortOrder email?: Prisma.SortOrderInput | Prisma.SortOrder
mobileNumber?: Prisma.SortOrder mobile_number?: Prisma.SortOrder
address?: Prisma.SortOrderInput | Prisma.SortOrder address?: Prisma.SortOrderInput | Prisma.SortOrder
isActive?: Prisma.SortOrder is_active?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder
salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
sales_invoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
_relevance?: Prisma.CustomerOrderByRelevanceInput _relevance?: Prisma.CustomerOrderByRelevanceInput
} }
export type CustomerWhereUniqueInput = Prisma.AtLeast<{ export type CustomerWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
mobileNumber?: string mobile_number?: string
AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] AND?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
OR?: Prisma.CustomerWhereInput[] OR?: Prisma.CustomerWhereInput[]
NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[] NOT?: Prisma.CustomerWhereInput | Prisma.CustomerWhereInput[]
firstName?: Prisma.StringFilter<"Customer"> | string first_name?: Prisma.StringFilter<"Customer"> | string
lastName?: Prisma.StringFilter<"Customer"> | string last_name?: Prisma.StringFilter<"Customer"> | string
email?: Prisma.StringNullableFilter<"Customer"> | string | null email?: Prisma.StringNullableFilter<"Customer"> | string | null
address?: Prisma.StringNullableFilter<"Customer"> | string | null address?: Prisma.StringNullableFilter<"Customer"> | string | null
isActive?: Prisma.BoolFilter<"Customer"> | boolean is_active?: Prisma.BoolFilter<"Customer"> | boolean
createdAt?: Prisma.DateTimeFilter<"Customer"> | Date | string account_id?: Prisma.StringFilter<"Customer"> | string
updatedAt?: Prisma.DateTimeFilter<"Customer"> | Date | string complex_id?: Prisma.StringFilter<"Customer"> | string
deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null created_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
salesInvoices?: Prisma.SalesInvoiceListRelationFilter updated_at?: Prisma.DateTimeFilter<"Customer"> | Date | string
}, "id" | "mobileNumber"> deleted_at?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null
sales_invoices?: Prisma.SalesInvoiceListRelationFilter
}, "id" | "mobile_number">
export type CustomerOrderByWithAggregationInput = { export type CustomerOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
firstName?: Prisma.SortOrder first_name?: Prisma.SortOrder
lastName?: Prisma.SortOrder last_name?: Prisma.SortOrder
email?: Prisma.SortOrderInput | Prisma.SortOrder email?: Prisma.SortOrderInput | Prisma.SortOrder
mobileNumber?: Prisma.SortOrder mobile_number?: Prisma.SortOrder
address?: Prisma.SortOrderInput | Prisma.SortOrder address?: Prisma.SortOrderInput | Prisma.SortOrder
isActive?: Prisma.SortOrder is_active?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.CustomerCountOrderByAggregateInput _count?: Prisma.CustomerCountOrderByAggregateInput
_avg?: Prisma.CustomerAvgOrderByAggregateInput
_max?: Prisma.CustomerMaxOrderByAggregateInput _max?: Prisma.CustomerMaxOrderByAggregateInput
_min?: Prisma.CustomerMinOrderByAggregateInput _min?: Prisma.CustomerMinOrderByAggregateInput
_sum?: Prisma.CustomerSumOrderByAggregateInput
} }
export type CustomerScalarWhereWithAggregatesInput = { export type CustomerScalarWhereWithAggregatesInput = {
AND?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[] AND?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[]
OR?: Prisma.CustomerScalarWhereWithAggregatesInput[] OR?: Prisma.CustomerScalarWhereWithAggregatesInput[]
NOT?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[] NOT?: Prisma.CustomerScalarWhereWithAggregatesInput | Prisma.CustomerScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"Customer"> | number id?: Prisma.StringWithAggregatesFilter<"Customer"> | string
firstName?: Prisma.StringWithAggregatesFilter<"Customer"> | string first_name?: Prisma.StringWithAggregatesFilter<"Customer"> | string
lastName?: Prisma.StringWithAggregatesFilter<"Customer"> | string last_name?: Prisma.StringWithAggregatesFilter<"Customer"> | string
email?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null email?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null
mobileNumber?: Prisma.StringWithAggregatesFilter<"Customer"> | string mobile_number?: Prisma.StringWithAggregatesFilter<"Customer"> | string
address?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null address?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null
isActive?: Prisma.BoolWithAggregatesFilter<"Customer"> | boolean is_active?: Prisma.BoolWithAggregatesFilter<"Customer"> | boolean
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string account_id?: Prisma.StringWithAggregatesFilter<"Customer"> | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string complex_id?: Prisma.StringWithAggregatesFilter<"Customer"> | string
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null 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 = { export type CustomerCreateInput = {
firstName: string id?: string
lastName: string first_name: string
last_name: string
email?: string | null email?: string | null
mobileNumber: string mobile_number: string
address?: string | null address?: string | null
isActive?: boolean is_active?: boolean
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput updated_at?: Date | string
deleted_at?: Date | string | null
sales_invoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
} }
export type CustomerUncheckedCreateInput = { export type CustomerUncheckedCreateInput = {
id?: number id?: string
firstName: string first_name: string
lastName: string last_name: string
email?: string | null email?: string | null
mobileNumber: string mobile_number: string
address?: string | null address?: string | null
isActive?: boolean is_active?: boolean
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput updated_at?: Date | string
deleted_at?: Date | string | null
sales_invoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
} }
export type CustomerUpdateInput = { export type CustomerUpdateInput = {
firstName?: Prisma.StringFieldUpdateOperationsInput | string id?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string first_name?: Prisma.StringFieldUpdateOperationsInput | string
last_name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
sales_invoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
} }
export type CustomerUncheckedUpdateInput = { export type CustomerUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
firstName?: Prisma.StringFieldUpdateOperationsInput | string first_name?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string last_name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
sales_invoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
} }
export type CustomerCreateManyInput = { export type CustomerCreateManyInput = {
id?: number id?: string
firstName: string first_name: string
lastName: string last_name: string
email?: string | null email?: string | null
mobileNumber: string mobile_number: string
address?: string | null address?: string | null
isActive?: boolean is_active?: boolean
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type CustomerUpdateManyMutationInput = { export type CustomerUpdateManyMutationInput = {
firstName?: Prisma.StringFieldUpdateOperationsInput | string id?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string first_name?: Prisma.StringFieldUpdateOperationsInput | string
last_name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type CustomerUncheckedUpdateManyInput = { export type CustomerUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
firstName?: Prisma.StringFieldUpdateOperationsInput | string first_name?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string last_name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type CustomerOrderByRelevanceInput = { export type CustomerOrderByRelevanceInput = {
@@ -425,49 +430,47 @@ export type CustomerOrderByRelevanceInput = {
export type CustomerCountOrderByAggregateInput = { export type CustomerCountOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
firstName?: Prisma.SortOrder first_name?: Prisma.SortOrder
lastName?: Prisma.SortOrder last_name?: Prisma.SortOrder
email?: Prisma.SortOrder email?: Prisma.SortOrder
mobileNumber?: Prisma.SortOrder mobile_number?: Prisma.SortOrder
address?: Prisma.SortOrder address?: Prisma.SortOrder
isActive?: Prisma.SortOrder is_active?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
export type CustomerAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
} }
export type CustomerMaxOrderByAggregateInput = { export type CustomerMaxOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
firstName?: Prisma.SortOrder first_name?: Prisma.SortOrder
lastName?: Prisma.SortOrder last_name?: Prisma.SortOrder
email?: Prisma.SortOrder email?: Prisma.SortOrder
mobileNumber?: Prisma.SortOrder mobile_number?: Prisma.SortOrder
address?: Prisma.SortOrder address?: Prisma.SortOrder
isActive?: Prisma.SortOrder is_active?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
} }
export type CustomerMinOrderByAggregateInput = { export type CustomerMinOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
firstName?: Prisma.SortOrder first_name?: Prisma.SortOrder
lastName?: Prisma.SortOrder last_name?: Prisma.SortOrder
email?: Prisma.SortOrder email?: Prisma.SortOrder
mobileNumber?: Prisma.SortOrder mobile_number?: Prisma.SortOrder
address?: Prisma.SortOrder address?: Prisma.SortOrder
isActive?: Prisma.SortOrder is_active?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
export type CustomerSumOrderByAggregateInput = {
id?: Prisma.SortOrder
} }
export type CustomerNullableScalarRelationFilter = { export type CustomerNullableScalarRelationFilter = {
@@ -475,90 +478,116 @@ export type CustomerNullableScalarRelationFilter = {
isNot?: Prisma.CustomerWhereInput | null isNot?: Prisma.CustomerWhereInput | null
} }
export type StringFieldUpdateOperationsInput = {
set?: string
}
export type NullableStringFieldUpdateOperationsInput = {
set?: string | null
}
export type BoolFieldUpdateOperationsInput = { export type BoolFieldUpdateOperationsInput = {
set?: boolean set?: boolean
} }
export type CustomerCreateNestedOneWithoutSalesInvoicesInput = { export type DateTimeFieldUpdateOperationsInput = {
create?: Prisma.XOR<Prisma.CustomerCreateWithoutSalesInvoicesInput, Prisma.CustomerUncheckedCreateWithoutSalesInvoicesInput> set?: Date | string
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSalesInvoicesInput }
export type NullableDateTimeFieldUpdateOperationsInput = {
set?: Date | string | null
}
export type CustomerCreateNestedOneWithoutSales_invoicesInput = {
create?: Prisma.XOR<Prisma.CustomerCreateWithoutSales_invoicesInput, Prisma.CustomerUncheckedCreateWithoutSales_invoicesInput>
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSales_invoicesInput
connect?: Prisma.CustomerWhereUniqueInput connect?: Prisma.CustomerWhereUniqueInput
} }
export type CustomerUpdateOneWithoutSalesInvoicesNestedInput = { export type CustomerUpdateOneWithoutSales_invoicesNestedInput = {
create?: Prisma.XOR<Prisma.CustomerCreateWithoutSalesInvoicesInput, Prisma.CustomerUncheckedCreateWithoutSalesInvoicesInput> create?: Prisma.XOR<Prisma.CustomerCreateWithoutSales_invoicesInput, Prisma.CustomerUncheckedCreateWithoutSales_invoicesInput>
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSalesInvoicesInput connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSales_invoicesInput
upsert?: Prisma.CustomerUpsertWithoutSalesInvoicesInput upsert?: Prisma.CustomerUpsertWithoutSales_invoicesInput
disconnect?: Prisma.CustomerWhereInput | boolean disconnect?: Prisma.CustomerWhereInput | boolean
delete?: Prisma.CustomerWhereInput | boolean delete?: Prisma.CustomerWhereInput | boolean
connect?: Prisma.CustomerWhereUniqueInput connect?: Prisma.CustomerWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutSalesInvoicesInput, Prisma.CustomerUpdateWithoutSalesInvoicesInput>, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput> update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutSales_invoicesInput, Prisma.CustomerUpdateWithoutSales_invoicesInput>, Prisma.CustomerUncheckedUpdateWithoutSales_invoicesInput>
} }
export type CustomerCreateWithoutSalesInvoicesInput = { export type CustomerCreateWithoutSales_invoicesInput = {
firstName: string id?: string
lastName: string first_name: string
last_name: string
email?: string | null email?: string | null
mobileNumber: string mobile_number: string
address?: string | null address?: string | null
isActive?: boolean is_active?: boolean
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type CustomerUncheckedCreateWithoutSalesInvoicesInput = { export type CustomerUncheckedCreateWithoutSales_invoicesInput = {
id?: number id?: string
firstName: string first_name: string
lastName: string last_name: string
email?: string | null email?: string | null
mobileNumber: string mobile_number: string
address?: string | null address?: string | null
isActive?: boolean is_active?: boolean
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type CustomerCreateOrConnectWithoutSalesInvoicesInput = { export type CustomerCreateOrConnectWithoutSales_invoicesInput = {
where: Prisma.CustomerWhereUniqueInput where: Prisma.CustomerWhereUniqueInput
create: Prisma.XOR<Prisma.CustomerCreateWithoutSalesInvoicesInput, Prisma.CustomerUncheckedCreateWithoutSalesInvoicesInput> create: Prisma.XOR<Prisma.CustomerCreateWithoutSales_invoicesInput, Prisma.CustomerUncheckedCreateWithoutSales_invoicesInput>
} }
export type CustomerUpsertWithoutSalesInvoicesInput = { export type CustomerUpsertWithoutSales_invoicesInput = {
update: Prisma.XOR<Prisma.CustomerUpdateWithoutSalesInvoicesInput, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput> update: Prisma.XOR<Prisma.CustomerUpdateWithoutSales_invoicesInput, Prisma.CustomerUncheckedUpdateWithoutSales_invoicesInput>
create: Prisma.XOR<Prisma.CustomerCreateWithoutSalesInvoicesInput, Prisma.CustomerUncheckedCreateWithoutSalesInvoicesInput> create: Prisma.XOR<Prisma.CustomerCreateWithoutSales_invoicesInput, Prisma.CustomerUncheckedCreateWithoutSales_invoicesInput>
where?: Prisma.CustomerWhereInput where?: Prisma.CustomerWhereInput
} }
export type CustomerUpdateToOneWithWhereWithoutSalesInvoicesInput = { export type CustomerUpdateToOneWithWhereWithoutSales_invoicesInput = {
where?: Prisma.CustomerWhereInput where?: Prisma.CustomerWhereInput
data: Prisma.XOR<Prisma.CustomerUpdateWithoutSalesInvoicesInput, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput> data: Prisma.XOR<Prisma.CustomerUpdateWithoutSales_invoicesInput, Prisma.CustomerUncheckedUpdateWithoutSales_invoicesInput>
} }
export type CustomerUpdateWithoutSalesInvoicesInput = { export type CustomerUpdateWithoutSales_invoicesInput = {
firstName?: Prisma.StringFieldUpdateOperationsInput | string id?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string first_name?: Prisma.StringFieldUpdateOperationsInput | string
last_name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = { export type CustomerUncheckedUpdateWithoutSales_invoicesInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
firstName?: Prisma.StringFieldUpdateOperationsInput | string first_name?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string last_name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean is_active?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null 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 = { export type CustomerCountOutputType = {
salesInvoices: number sales_invoices: number
} }
export type CustomerCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type CustomerCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
salesInvoices?: boolean | CustomerCountOutputTypeCountSalesInvoicesArgs sales_invoices?: boolean | CustomerCountOutputTypeCountSales_invoicesArgs
} }
/** /**
@@ -587,23 +616,25 @@ export type CustomerCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Ext
/** /**
* CustomerCountOutputType without action * CustomerCountOutputType without action
*/ */
export type CustomerCountOutputTypeCountSalesInvoicesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type CustomerCountOutputTypeCountSales_invoicesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.SalesInvoiceWhereInput where?: Prisma.SalesInvoiceWhereInput
} }
export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean id?: boolean
firstName?: boolean first_name?: boolean
lastName?: boolean last_name?: boolean
email?: boolean email?: boolean
mobileNumber?: boolean mobile_number?: boolean
address?: boolean address?: boolean
isActive?: boolean is_active?: boolean
createdAt?: boolean account_id?: boolean
updatedAt?: boolean complex_id?: boolean
deletedAt?: boolean created_at?: boolean
salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs<ExtArgs> updated_at?: boolean
deleted_at?: boolean
sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs<ExtArgs>
_count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["customer"]> }, ExtArgs["result"]["customer"]>
@@ -611,39 +642,43 @@ export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
export type CustomerSelectScalar = { export type CustomerSelectScalar = {
id?: boolean id?: boolean
firstName?: boolean first_name?: boolean
lastName?: boolean last_name?: boolean
email?: boolean email?: boolean
mobileNumber?: boolean mobile_number?: boolean
address?: boolean address?: boolean
isActive?: boolean is_active?: boolean
createdAt?: boolean account_id?: boolean
updatedAt?: boolean complex_id?: boolean
deletedAt?: boolean created_at?: boolean
updated_at?: boolean
deleted_at?: boolean
} }
export type CustomerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["customer"]> export type CustomerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = 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<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type CustomerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs<ExtArgs> sales_invoices?: boolean | Prisma.Customer$sales_invoicesArgs<ExtArgs>
_count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs>
} }
export type $CustomerPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type $CustomerPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
name: "Customer" name: "Customer"
objects: { objects: {
salesInvoices: Prisma.$SalesInvoicePayload<ExtArgs>[] sales_invoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
firstName: string first_name: string
lastName: string last_name: string
email: string | null email: string | null
mobileNumber: string mobile_number: string
address: string | null address: string | null
isActive: boolean is_active: boolean
createdAt: Date account_id: string
updatedAt: Date complex_id: string
deletedAt: Date | null created_at: Date
updated_at: Date
deleted_at: Date | null
}, ExtArgs["result"]["customer"]> }, ExtArgs["result"]["customer"]>
composites: {} composites: {}
} }
@@ -984,7 +1019,7 @@ readonly fields: CustomerFieldRefs;
*/ */
export interface Prisma__CustomerClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> { export interface Prisma__CustomerClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: "PrismaPromise" readonly [Symbol.toStringTag]: "PrismaPromise"
salesInvoices<T extends Prisma.Customer$salesInvoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$salesInvoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> sales_invoices<T extends Prisma.Customer$sales_invoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$sales_invoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1014,16 +1049,18 @@ export interface Prisma__CustomerClient<T, Null = never, ExtArgs extends runtime
* Fields of the Customer model * Fields of the Customer model
*/ */
export interface CustomerFieldRefs { export interface CustomerFieldRefs {
readonly id: Prisma.FieldRef<"Customer", 'Int'> readonly id: Prisma.FieldRef<"Customer", 'String'>
readonly firstName: Prisma.FieldRef<"Customer", 'String'> readonly first_name: Prisma.FieldRef<"Customer", 'String'>
readonly lastName: Prisma.FieldRef<"Customer", 'String'> readonly last_name: Prisma.FieldRef<"Customer", 'String'>
readonly email: 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 address: Prisma.FieldRef<"Customer", 'String'>
readonly isActive: Prisma.FieldRef<"Customer", 'Boolean'> readonly is_active: Prisma.FieldRef<"Customer", 'Boolean'>
readonly createdAt: Prisma.FieldRef<"Customer", 'DateTime'> readonly account_id: Prisma.FieldRef<"Customer", 'String'>
readonly updatedAt: Prisma.FieldRef<"Customer", 'DateTime'> readonly complex_id: Prisma.FieldRef<"Customer", 'String'>
readonly deletedAt: Prisma.FieldRef<"Customer", 'DateTime'> 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<ExtArgs extends runtime.Types.Extensions.Inte
} }
/** /**
* Customer.salesInvoices * Customer.sales_invoices
*/ */
export type Customer$salesInvoicesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type Customer$sales_invoicesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/** /**
* Select specific fields to fetch from the SalesInvoice * Select specific fields to fetch from the SalesInvoice
*/ */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+200 -179
View File
@@ -20,88 +20,82 @@ export type GoodCategoryModel = runtime.Types.Result.DefaultSelection<Prisma.$Go
export type AggregateGoodCategory = { export type AggregateGoodCategory = {
_count: GoodCategoryCountAggregateOutputType | null _count: GoodCategoryCountAggregateOutputType | null
_avg: GoodCategoryAvgAggregateOutputType | null
_sum: GoodCategorySumAggregateOutputType | null
_min: GoodCategoryMinAggregateOutputType | null _min: GoodCategoryMinAggregateOutputType | null
_max: GoodCategoryMaxAggregateOutputType | null _max: GoodCategoryMaxAggregateOutputType | null
} }
export type GoodCategoryAvgAggregateOutputType = {
id: number | null
}
export type GoodCategorySumAggregateOutputType = {
id: number | null
}
export type GoodCategoryMinAggregateOutputType = { export type GoodCategoryMinAggregateOutputType = {
id: number | null id: string | null
name: string | null name: string | null
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date | null account_id: string | null
updatedAt: Date | null complex_id: string | null
deletedAt: Date | null created_at: Date | null
updated_at: Date | null
deleted_at: Date | null
} }
export type GoodCategoryMaxAggregateOutputType = { export type GoodCategoryMaxAggregateOutputType = {
id: number | null id: string | null
name: string | null name: string | null
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date | null account_id: string | null
updatedAt: Date | null complex_id: string | null
deletedAt: Date | null created_at: Date | null
updated_at: Date | null
deleted_at: Date | null
} }
export type GoodCategoryCountAggregateOutputType = { export type GoodCategoryCountAggregateOutputType = {
id: number id: number
name: number name: number
description: number description: number
imageUrl: number image_url: number
createdAt: number account_id: number
updatedAt: number complex_id: number
deletedAt: number created_at: number
updated_at: number
deleted_at: number
_all: number _all: number
} }
export type GoodCategoryAvgAggregateInputType = {
id?: true
}
export type GoodCategorySumAggregateInputType = {
id?: true
}
export type GoodCategoryMinAggregateInputType = { export type GoodCategoryMinAggregateInputType = {
id?: true id?: true
name?: true name?: true
description?: true description?: true
imageUrl?: true image_url?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
} }
export type GoodCategoryMaxAggregateInputType = { export type GoodCategoryMaxAggregateInputType = {
id?: true id?: true
name?: true name?: true
description?: true description?: true
imageUrl?: true image_url?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
} }
export type GoodCategoryCountAggregateInputType = { export type GoodCategoryCountAggregateInputType = {
id?: true id?: true
name?: true name?: true
description?: true description?: true
imageUrl?: true image_url?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
_all?: true _all?: true
} }
@@ -140,18 +134,6 @@ export type GoodCategoryAggregateArgs<ExtArgs extends runtime.Types.Extensions.I
* Count returned GoodCategories * Count returned GoodCategories
**/ **/
_count?: true | GoodCategoryCountAggregateInputType _count?: true | GoodCategoryCountAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
**/
_avg?: GoodCategoryAvgAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
**/
_sum?: GoodCategorySumAggregateInputType
/** /**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
* *
@@ -185,23 +167,21 @@ export type GoodCategoryGroupByArgs<ExtArgs extends runtime.Types.Extensions.Int
take?: number take?: number
skip?: number skip?: number
_count?: GoodCategoryCountAggregateInputType | true _count?: GoodCategoryCountAggregateInputType | true
_avg?: GoodCategoryAvgAggregateInputType
_sum?: GoodCategorySumAggregateInputType
_min?: GoodCategoryMinAggregateInputType _min?: GoodCategoryMinAggregateInputType
_max?: GoodCategoryMaxAggregateInputType _max?: GoodCategoryMaxAggregateInputType
} }
export type GoodCategoryGroupByOutputType = { export type GoodCategoryGroupByOutputType = {
id: number id: string
name: string name: string
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date account_id: string
updatedAt: Date complex_id: string
deletedAt: Date | null created_at: Date
updated_at: Date
deleted_at: Date | null
_count: GoodCategoryCountAggregateOutputType | null _count: GoodCategoryCountAggregateOutputType | null
_avg: GoodCategoryAvgAggregateOutputType | null
_sum: GoodCategorySumAggregateOutputType | null
_min: GoodCategoryMinAggregateOutputType | null _min: GoodCategoryMinAggregateOutputType | null
_max: GoodCategoryMaxAggregateOutputType | null _max: GoodCategoryMaxAggregateOutputType | null
} }
@@ -225,13 +205,15 @@ export type GoodCategoryWhereInput = {
AND?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[] AND?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[]
OR?: Prisma.GoodCategoryWhereInput[] OR?: Prisma.GoodCategoryWhereInput[]
NOT?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[] NOT?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[]
id?: Prisma.IntFilter<"GoodCategory"> | number id?: Prisma.StringFilter<"GoodCategory"> | string
name?: Prisma.StringFilter<"GoodCategory"> | string name?: Prisma.StringFilter<"GoodCategory"> | string
description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null
imageUrl?: Prisma.StringNullableFilter<"GoodCategory"> | string | null image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null
createdAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string account_id?: Prisma.StringFilter<"GoodCategory"> | string
updatedAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string complex_id?: Prisma.StringFilter<"GoodCategory"> | string
deletedAt?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null 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 goods?: Prisma.GoodListRelationFilter
} }
@@ -239,25 +221,29 @@ export type GoodCategoryOrderByWithRelationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder image_url?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
goods?: Prisma.GoodOrderByRelationAggregateInput goods?: Prisma.GoodOrderByRelationAggregateInput
_relevance?: Prisma.GoodCategoryOrderByRelevanceInput _relevance?: Prisma.GoodCategoryOrderByRelevanceInput
} }
export type GoodCategoryWhereUniqueInput = Prisma.AtLeast<{ export type GoodCategoryWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
AND?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[] AND?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[]
OR?: Prisma.GoodCategoryWhereInput[] OR?: Prisma.GoodCategoryWhereInput[]
NOT?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[] NOT?: Prisma.GoodCategoryWhereInput | Prisma.GoodCategoryWhereInput[]
name?: Prisma.StringFilter<"GoodCategory"> | string name?: Prisma.StringFilter<"GoodCategory"> | string
description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null
imageUrl?: Prisma.StringNullableFilter<"GoodCategory"> | string | null image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null
createdAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string account_id?: Prisma.StringFilter<"GoodCategory"> | string
updatedAt?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string complex_id?: Prisma.StringFilter<"GoodCategory"> | string
deletedAt?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null 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 goods?: Prisma.GoodListRelationFilter
}, "id"> }, "id">
@@ -265,99 +251,118 @@ export type GoodCategoryOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder image_url?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.GoodCategoryCountOrderByAggregateInput _count?: Prisma.GoodCategoryCountOrderByAggregateInput
_avg?: Prisma.GoodCategoryAvgOrderByAggregateInput
_max?: Prisma.GoodCategoryMaxOrderByAggregateInput _max?: Prisma.GoodCategoryMaxOrderByAggregateInput
_min?: Prisma.GoodCategoryMinOrderByAggregateInput _min?: Prisma.GoodCategoryMinOrderByAggregateInput
_sum?: Prisma.GoodCategorySumOrderByAggregateInput
} }
export type GoodCategoryScalarWhereWithAggregatesInput = { export type GoodCategoryScalarWhereWithAggregatesInput = {
AND?: Prisma.GoodCategoryScalarWhereWithAggregatesInput | Prisma.GoodCategoryScalarWhereWithAggregatesInput[] AND?: Prisma.GoodCategoryScalarWhereWithAggregatesInput | Prisma.GoodCategoryScalarWhereWithAggregatesInput[]
OR?: Prisma.GoodCategoryScalarWhereWithAggregatesInput[] OR?: Prisma.GoodCategoryScalarWhereWithAggregatesInput[]
NOT?: Prisma.GoodCategoryScalarWhereWithAggregatesInput | Prisma.GoodCategoryScalarWhereWithAggregatesInput[] NOT?: Prisma.GoodCategoryScalarWhereWithAggregatesInput | Prisma.GoodCategoryScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"GoodCategory"> | number id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string
name?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string name?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string
description?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null description?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null
imageUrl?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null image_url?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string account_id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string complex_id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"GoodCategory"> | Date | string | null 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 = { export type GoodCategoryCreateInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput
} }
export type GoodCategoryUncheckedCreateInput = { export type GoodCategoryUncheckedCreateInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
goods?: Prisma.GoodUncheckedCreateNestedManyWithoutCategoryInput goods?: Prisma.GoodUncheckedCreateNestedManyWithoutCategoryInput
} }
export type GoodCategoryUpdateInput = { export type GoodCategoryUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput
} }
export type GoodCategoryUncheckedUpdateInput = { export type GoodCategoryUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
goods?: Prisma.GoodUncheckedUpdateManyWithoutCategoryNestedInput goods?: Prisma.GoodUncheckedUpdateManyWithoutCategoryNestedInput
} }
export type GoodCategoryCreateManyInput = { export type GoodCategoryCreateManyInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type GoodCategoryUpdateManyMutationInput = { export type GoodCategoryUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type GoodCategoryUncheckedUpdateManyInput = { export type GoodCategoryUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type GoodCategoryNullableScalarRelationFilter = { export type GoodCategoryNullableScalarRelationFilter = {
@@ -375,38 +380,36 @@ export type GoodCategoryCountOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
imageUrl?: Prisma.SortOrder image_url?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
export type GoodCategoryAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
} }
export type GoodCategoryMaxOrderByAggregateInput = { export type GoodCategoryMaxOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
imageUrl?: Prisma.SortOrder image_url?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
} }
export type GoodCategoryMinOrderByAggregateInput = { export type GoodCategoryMinOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
imageUrl?: Prisma.SortOrder image_url?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
export type GoodCategorySumOrderByAggregateInput = {
id?: Prisma.SortOrder
} }
export type GoodCategoryCreateNestedOneWithoutGoodsInput = { export type GoodCategoryCreateNestedOneWithoutGoodsInput = {
@@ -426,22 +429,27 @@ export type GoodCategoryUpdateOneWithoutGoodsNestedInput = {
} }
export type GoodCategoryCreateWithoutGoodsInput = { export type GoodCategoryCreateWithoutGoodsInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type GoodCategoryUncheckedCreateWithoutGoodsInput = { export type GoodCategoryUncheckedCreateWithoutGoodsInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type GoodCategoryCreateOrConnectWithoutGoodsInput = { export type GoodCategoryCreateOrConnectWithoutGoodsInput = {
@@ -461,22 +469,27 @@ export type GoodCategoryUpdateToOneWithWhereWithoutGoodsInput = {
} }
export type GoodCategoryUpdateWithoutGoodsInput = { export type GoodCategoryUpdateWithoutGoodsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type GoodCategoryUncheckedUpdateWithoutGoodsInput = { export type GoodCategoryUncheckedUpdateWithoutGoodsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null 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<ExtArgs extends runtime.Types.Extensions.Internal
id?: boolean id?: boolean
name?: boolean name?: boolean
description?: boolean description?: boolean
imageUrl?: boolean image_url?: boolean
createdAt?: boolean account_id?: boolean
updatedAt?: boolean complex_id?: boolean
deletedAt?: boolean created_at?: boolean
updated_at?: boolean
deleted_at?: boolean
goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs> goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs>
_count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["goodCategory"]> }, ExtArgs["result"]["goodCategory"]>
@@ -528,13 +543,15 @@ export type GoodCategorySelectScalar = {
id?: boolean id?: boolean
name?: boolean name?: boolean
description?: boolean description?: boolean
imageUrl?: boolean image_url?: boolean
createdAt?: boolean account_id?: boolean
updatedAt?: boolean complex_id?: boolean
deletedAt?: boolean created_at?: boolean
updated_at?: boolean
deleted_at?: boolean
} }
export type GoodCategoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "imageUrl" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["goodCategory"]> export type GoodCategoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = 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<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type GoodCategoryInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs> goods?: boolean | Prisma.GoodCategory$goodsArgs<ExtArgs>
_count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs<ExtArgs>
@@ -546,13 +563,15 @@ export type $GoodCategoryPayload<ExtArgs extends runtime.Types.Extensions.Intern
goods: Prisma.$GoodPayload<ExtArgs>[] goods: Prisma.$GoodPayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
name: string name: string
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date account_id: string
updatedAt: Date complex_id: string
deletedAt: Date | null created_at: Date
updated_at: Date
deleted_at: Date | null
}, ExtArgs["result"]["goodCategory"]> }, ExtArgs["result"]["goodCategory"]>
composites: {} composites: {}
} }
@@ -923,13 +942,15 @@ export interface Prisma__GoodCategoryClient<T, Null = never, ExtArgs extends run
* Fields of the GoodCategory model * Fields of the GoodCategory model
*/ */
export interface GoodCategoryFieldRefs { export interface GoodCategoryFieldRefs {
readonly id: Prisma.FieldRef<"GoodCategory", 'Int'> readonly id: Prisma.FieldRef<"GoodCategory", 'String'>
readonly name: Prisma.FieldRef<"GoodCategory", 'String'> readonly name: Prisma.FieldRef<"GoodCategory", 'String'>
readonly description: Prisma.FieldRef<"GoodCategory", 'String'> readonly description: Prisma.FieldRef<"GoodCategory", 'String'>
readonly imageUrl: Prisma.FieldRef<"GoodCategory", 'String'> readonly image_url: Prisma.FieldRef<"GoodCategory", 'String'>
readonly createdAt: Prisma.FieldRef<"GoodCategory", 'DateTime'> readonly account_id: Prisma.FieldRef<"GoodCategory", 'String'>
readonly updatedAt: Prisma.FieldRef<"GoodCategory", 'DateTime'> readonly complex_id: Prisma.FieldRef<"GoodCategory", 'String'>
readonly deletedAt: Prisma.FieldRef<"GoodCategory", 'DateTime'> readonly created_at: Prisma.FieldRef<"GoodCategory", 'DateTime'>
readonly updated_at: Prisma.FieldRef<"GoodCategory", 'DateTime'>
readonly deleted_at: Prisma.FieldRef<"GoodCategory", 'DateTime'>
} }
+319 -240
View File
@@ -27,89 +27,93 @@ export type AggregateSalesInvoice = {
} }
export type SalesInvoiceAvgAggregateOutputType = { export type SalesInvoiceAvgAggregateOutputType = {
id: number | null total_amount: runtime.Decimal | null
totalAmount: runtime.Decimal | null
customerId: number | null
} }
export type SalesInvoiceSumAggregateOutputType = { export type SalesInvoiceSumAggregateOutputType = {
id: number | null total_amount: runtime.Decimal | null
totalAmount: runtime.Decimal | null
customerId: number | null
} }
export type SalesInvoiceMinAggregateOutputType = { export type SalesInvoiceMinAggregateOutputType = {
id: number | null id: string | null
code: string | null code: string | null
totalAmount: runtime.Decimal | null total_amount: runtime.Decimal | null
description: string | null description: string | null
createdAt: Date | null created_at: Date | null
updatedAt: Date | null updated_at: Date | null
customerId: number | null customer_id: string | null
account_id: string | null
complex_id: string | null
} }
export type SalesInvoiceMaxAggregateOutputType = { export type SalesInvoiceMaxAggregateOutputType = {
id: number | null id: string | null
code: string | null code: string | null
totalAmount: runtime.Decimal | null total_amount: runtime.Decimal | null
description: string | null description: string | null
createdAt: Date | null created_at: Date | null
updatedAt: Date | null updated_at: Date | null
customerId: number | null customer_id: string | null
account_id: string | null
complex_id: string | null
} }
export type SalesInvoiceCountAggregateOutputType = { export type SalesInvoiceCountAggregateOutputType = {
id: number id: number
code: number code: number
totalAmount: number total_amount: number
description: number description: number
createdAt: number created_at: number
updatedAt: number updated_at: number
customerId: number customer_id: number
account_id: number
complex_id: number
_all: number _all: number
} }
export type SalesInvoiceAvgAggregateInputType = { export type SalesInvoiceAvgAggregateInputType = {
id?: true total_amount?: true
totalAmount?: true
customerId?: true
} }
export type SalesInvoiceSumAggregateInputType = { export type SalesInvoiceSumAggregateInputType = {
id?: true total_amount?: true
totalAmount?: true
customerId?: true
} }
export type SalesInvoiceMinAggregateInputType = { export type SalesInvoiceMinAggregateInputType = {
id?: true id?: true
code?: true code?: true
totalAmount?: true total_amount?: true
description?: true description?: true
createdAt?: true created_at?: true
updatedAt?: true updated_at?: true
customerId?: true customer_id?: true
account_id?: true
complex_id?: true
} }
export type SalesInvoiceMaxAggregateInputType = { export type SalesInvoiceMaxAggregateInputType = {
id?: true id?: true
code?: true code?: true
totalAmount?: true total_amount?: true
description?: true description?: true
createdAt?: true created_at?: true
updatedAt?: true updated_at?: true
customerId?: true customer_id?: true
account_id?: true
complex_id?: true
} }
export type SalesInvoiceCountAggregateInputType = { export type SalesInvoiceCountAggregateInputType = {
id?: true id?: true
code?: true code?: true
totalAmount?: true total_amount?: true
description?: true description?: true
createdAt?: true created_at?: true
updatedAt?: true updated_at?: true
customerId?: true customer_id?: true
account_id?: true
complex_id?: true
_all?: true _all?: true
} }
@@ -200,13 +204,15 @@ export type SalesInvoiceGroupByArgs<ExtArgs extends runtime.Types.Extensions.Int
} }
export type SalesInvoiceGroupByOutputType = { export type SalesInvoiceGroupByOutputType = {
id: number id: string
code: string code: string
totalAmount: runtime.Decimal total_amount: runtime.Decimal
description: string | null description: string | null
createdAt: Date created_at: Date
updatedAt: Date updated_at: Date
customerId: number | null customer_id: string | null
account_id: string
complex_id: string
_count: SalesInvoiceCountAggregateOutputType | null _count: SalesInvoiceCountAggregateOutputType | null
_avg: SalesInvoiceAvgAggregateOutputType | null _avg: SalesInvoiceAvgAggregateOutputType | null
_sum: SalesInvoiceSumAggregateOutputType | null _sum: SalesInvoiceSumAggregateOutputType | null
@@ -233,56 +239,64 @@ export type SalesInvoiceWhereInput = {
AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[]
OR?: Prisma.SalesInvoiceWhereInput[] OR?: Prisma.SalesInvoiceWhereInput[]
NOT?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] NOT?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[]
id?: Prisma.IntFilter<"SalesInvoice"> | number id?: Prisma.StringFilter<"SalesInvoice"> | string
code?: 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 description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null
createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null
account_id?: Prisma.StringFilter<"SalesInvoice"> | string
complex_id?: Prisma.StringFilter<"SalesInvoice"> | string
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
items?: Prisma.SalesInvoiceItemListRelationFilter items?: Prisma.SalesInvoiceItemListRelationFilter
salesInvoicePayments?: Prisma.SalesInvoicePaymentListRelationFilter sales_invoice_payments?: Prisma.SalesInvoicePaymentListRelationFilter
} }
export type SalesInvoiceOrderByWithRelationInput = { export type SalesInvoiceOrderByWithRelationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
code?: Prisma.SortOrder code?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder customer_id?: Prisma.SortOrderInput | Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
customer?: Prisma.CustomerOrderByWithRelationInput customer?: Prisma.CustomerOrderByWithRelationInput
items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput sales_invoice_payments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput
_relevance?: Prisma.SalesInvoiceOrderByRelevanceInput _relevance?: Prisma.SalesInvoiceOrderByRelevanceInput
} }
export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{ export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
code?: string code?: string
AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[]
OR?: Prisma.SalesInvoiceWhereInput[] OR?: Prisma.SalesInvoiceWhereInput[]
NOT?: Prisma.SalesInvoiceWhereInput | 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 description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null
createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null
account_id?: Prisma.StringFilter<"SalesInvoice"> | string
complex_id?: Prisma.StringFilter<"SalesInvoice"> | string
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
items?: Prisma.SalesInvoiceItemListRelationFilter items?: Prisma.SalesInvoiceItemListRelationFilter
salesInvoicePayments?: Prisma.SalesInvoicePaymentListRelationFilter sales_invoice_payments?: Prisma.SalesInvoicePaymentListRelationFilter
}, "id" | "code"> }, "id" | "code">
export type SalesInvoiceOrderByWithAggregationInput = { export type SalesInvoiceOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
code?: Prisma.SortOrder code?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder customer_id?: Prisma.SortOrderInput | Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
_count?: Prisma.SalesInvoiceCountOrderByAggregateInput _count?: Prisma.SalesInvoiceCountOrderByAggregateInput
_avg?: Prisma.SalesInvoiceAvgOrderByAggregateInput _avg?: Prisma.SalesInvoiceAvgOrderByAggregateInput
_max?: Prisma.SalesInvoiceMaxOrderByAggregateInput _max?: Prisma.SalesInvoiceMaxOrderByAggregateInput
@@ -294,87 +308,106 @@ export type SalesInvoiceScalarWhereWithAggregatesInput = {
AND?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] AND?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[]
OR?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] OR?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput[]
NOT?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] NOT?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"SalesInvoice"> | number id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string
code?: 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 description?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoice"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string updated_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableWithAggregatesFilter<"SalesInvoice"> | number | null customer_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoice"> | string | null
account_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string
complex_id?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string
} }
export type SalesInvoiceCreateInput = { export type SalesInvoiceCreateInput = {
id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput account_id: string
complex_id: string
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput sales_invoice_payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceUncheckedCreateInput = { export type SalesInvoiceUncheckedCreateInput = {
id?: number id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customerId?: number | null customer_id?: string | null
account_id: string
complex_id: string
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceUpdateInput = { export type SalesInvoiceUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput sales_invoice_payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceUncheckedUpdateInput = { export type SalesInvoiceUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceCreateManyInput = { export type SalesInvoiceCreateManyInput = {
id?: number id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customerId?: number | null customer_id?: string | null
account_id: string
complex_id: string
} }
export type SalesInvoiceUpdateManyMutationInput = { export type SalesInvoiceUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceUncheckedUpdateManyInput = { export type SalesInvoiceUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceListRelationFilter = { export type SalesInvoiceListRelationFilter = {
@@ -396,43 +429,45 @@ export type SalesInvoiceOrderByRelevanceInput = {
export type SalesInvoiceCountOrderByAggregateInput = { export type SalesInvoiceCountOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
code?: Prisma.SortOrder code?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
customerId?: Prisma.SortOrder customer_id?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
} }
export type SalesInvoiceAvgOrderByAggregateInput = { export type SalesInvoiceAvgOrderByAggregateInput = {
id?: Prisma.SortOrder total_amount?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
customerId?: Prisma.SortOrder
} }
export type SalesInvoiceMaxOrderByAggregateInput = { export type SalesInvoiceMaxOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
code?: Prisma.SortOrder code?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
customerId?: Prisma.SortOrder customer_id?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
} }
export type SalesInvoiceMinOrderByAggregateInput = { export type SalesInvoiceMinOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
code?: Prisma.SortOrder code?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
customerId?: Prisma.SortOrder customer_id?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
} }
export type SalesInvoiceSumOrderByAggregateInput = { export type SalesInvoiceSumOrderByAggregateInput = {
id?: Prisma.SortOrder total_amount?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
customerId?: Prisma.SortOrder
} }
export type SalesInvoiceScalarRelationFilter = { export type SalesInvoiceScalarRelationFilter = {
@@ -496,39 +531,44 @@ export type SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutItemsInput, Prisma.SalesInvoiceUpdateWithoutItemsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput> update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutItemsInput, Prisma.SalesInvoiceUpdateWithoutItemsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput>
} }
export type SalesInvoiceCreateNestedOneWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceCreateNestedOneWithoutSales_invoice_paymentsInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput> create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSales_invoice_paymentsInput>
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSales_invoice_paymentsInput
connect?: Prisma.SalesInvoiceWhereUniqueInput connect?: Prisma.SalesInvoiceWhereUniqueInput
} }
export type SalesInvoiceUpdateOneRequiredWithoutSalesInvoicePaymentsNestedInput = { export type SalesInvoiceUpdateOneRequiredWithoutSales_invoice_paymentsNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput> create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSales_invoice_paymentsInput>
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSales_invoice_paymentsInput
upsert?: Prisma.SalesInvoiceUpsertWithoutSalesInvoicePaymentsInput upsert?: Prisma.SalesInvoiceUpsertWithoutSales_invoice_paymentsInput
connect?: Prisma.SalesInvoiceWhereUniqueInput connect?: Prisma.SalesInvoiceWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput> update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUpdateWithoutSales_invoice_paymentsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutSales_invoice_paymentsInput>
} }
export type SalesInvoiceCreateWithoutCustomerInput = { export type SalesInvoiceCreateWithoutCustomerInput = {
id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
account_id: string
complex_id: string
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput sales_invoice_payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceUncheckedCreateWithoutCustomerInput = { export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
id?: number id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
account_id: string
complex_id: string
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceCreateOrConnectWithoutCustomerInput = { export type SalesInvoiceCreateOrConnectWithoutCustomerInput = {
@@ -561,34 +601,41 @@ export type SalesInvoiceScalarWhereInput = {
AND?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] AND?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[]
OR?: Prisma.SalesInvoiceScalarWhereInput[] OR?: Prisma.SalesInvoiceScalarWhereInput[]
NOT?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] NOT?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[]
id?: Prisma.IntFilter<"SalesInvoice"> | number id?: Prisma.StringFilter<"SalesInvoice"> | string
code?: 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 description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null
createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string updated_at?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null customer_id?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null
account_id?: Prisma.StringFilter<"SalesInvoice"> | string
complex_id?: Prisma.StringFilter<"SalesInvoice"> | string
} }
export type SalesInvoiceCreateWithoutItemsInput = { export type SalesInvoiceCreateWithoutItemsInput = {
id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput account_id: string
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput complex_id: string
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
sales_invoice_payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceUncheckedCreateWithoutItemsInput = { export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
id?: number id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customerId?: number | null customer_id?: string | null
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput account_id: string
complex_id: string
sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceCreateOrConnectWithoutItemsInput = { export type SalesInvoiceCreateOrConnectWithoutItemsInput = {
@@ -608,121 +655,145 @@ export type SalesInvoiceUpdateToOneWithWhereWithoutItemsInput = {
} }
export type SalesInvoiceUpdateWithoutItemsInput = { export type SalesInvoiceUpdateWithoutItemsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput account_id?: Prisma.StringFieldUpdateOperationsInput | string
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput complex_id?: Prisma.StringFieldUpdateOperationsInput | string
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
sales_invoice_payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceUncheckedUpdateWithoutItemsInput = { export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput 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 code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput account_id: string
complex_id: string
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceUncheckedCreateWithoutSales_invoice_paymentsInput = {
id?: number id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
customerId?: number | null customer_id?: string | null
account_id: string
complex_id: string
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
} }
export type SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceCreateOrConnectWithoutSales_invoice_paymentsInput = {
where: Prisma.SalesInvoiceWhereUniqueInput where: Prisma.SalesInvoiceWhereUniqueInput
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput> create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSales_invoice_paymentsInput>
} }
export type SalesInvoiceUpsertWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceUpsertWithoutSales_invoice_paymentsInput = {
update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput> update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutSales_invoice_paymentsInput>
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput> create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSales_invoice_paymentsInput>
where?: Prisma.SalesInvoiceWhereInput where?: Prisma.SalesInvoiceWhereInput
} }
export type SalesInvoiceUpdateToOneWithWhereWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceUpdateToOneWithWhereWithoutSales_invoice_paymentsInput = {
where?: Prisma.SalesInvoiceWhereInput where?: Prisma.SalesInvoiceWhereInput
data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput> data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutSales_invoice_paymentsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutSales_invoice_paymentsInput>
} }
export type SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceUpdateWithoutSales_invoice_paymentsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput = { export type SalesInvoiceUncheckedUpdateWithoutSales_invoice_paymentsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceCreateManyCustomerInput = { export type SalesInvoiceCreateManyCustomerInput = {
id?: number id?: string
code: string code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null description?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
account_id: string
complex_id: string
} }
export type SalesInvoiceUpdateWithoutCustomerInput = { export type SalesInvoiceUpdateWithoutCustomerInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput sales_invoice_payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = { export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput sales_invoice_payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
} }
export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = { export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
code?: 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 description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: 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 = { export type SalesInvoiceCountOutputType = {
items: number items: number
salesInvoicePayments: number sales_invoice_payments: number
} }
export type SalesInvoiceCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type SalesInvoiceCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
items?: boolean | SalesInvoiceCountOutputTypeCountItemsArgs items?: boolean | SalesInvoiceCountOutputTypeCountItemsArgs
salesInvoicePayments?: boolean | SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs sales_invoice_payments?: boolean | SalesInvoiceCountOutputTypeCountSales_invoice_paymentsArgs
} }
/** /**
@@ -760,7 +831,7 @@ export type SalesInvoiceCountOutputTypeCountItemsArgs<ExtArgs extends runtime.Ty
/** /**
* SalesInvoiceCountOutputType without action * SalesInvoiceCountOutputType without action
*/ */
export type SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type SalesInvoiceCountOutputTypeCountSales_invoice_paymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.SalesInvoicePaymentWhereInput where?: Prisma.SalesInvoicePaymentWhereInput
} }
@@ -768,14 +839,16 @@ export type SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs<ExtArgs ext
export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean id?: boolean
code?: boolean code?: boolean
totalAmount?: boolean total_amount?: boolean
description?: boolean description?: boolean
createdAt?: boolean created_at?: boolean
updatedAt?: boolean updated_at?: boolean
customerId?: boolean customer_id?: boolean
account_id?: boolean
complex_id?: boolean
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs> customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs> items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
salesInvoicePayments?: boolean | Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs> sales_invoice_payments?: boolean | Prisma.SalesInvoice$sales_invoice_paymentsArgs<ExtArgs>
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["salesInvoice"]> }, ExtArgs["result"]["salesInvoice"]>
@@ -784,18 +857,20 @@ export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.Internal
export type SalesInvoiceSelectScalar = { export type SalesInvoiceSelectScalar = {
id?: boolean id?: boolean
code?: boolean code?: boolean
totalAmount?: boolean total_amount?: boolean
description?: boolean description?: boolean
createdAt?: boolean created_at?: boolean
updatedAt?: boolean updated_at?: boolean
customerId?: boolean customer_id?: boolean
account_id?: boolean
complex_id?: boolean
} }
export type SalesInvoiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "customerId", ExtArgs["result"]["salesInvoice"]> export type SalesInvoiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = 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<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type SalesInvoiceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs> customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs> items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
salesInvoicePayments?: boolean | Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs> sales_invoice_payments?: boolean | Prisma.SalesInvoice$sales_invoice_paymentsArgs<ExtArgs>
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
} }
@@ -804,16 +879,18 @@ export type $SalesInvoicePayload<ExtArgs extends runtime.Types.Extensions.Intern
objects: { objects: {
customer: Prisma.$CustomerPayload<ExtArgs> | null customer: Prisma.$CustomerPayload<ExtArgs> | null
items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[] items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
salesInvoicePayments: Prisma.$SalesInvoicePaymentPayload<ExtArgs>[] sales_invoice_payments: Prisma.$SalesInvoicePaymentPayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
code: string code: string
totalAmount: runtime.Decimal total_amount: runtime.Decimal
description: string | null description: string | null
createdAt: Date created_at: Date
updatedAt: Date updated_at: Date
customerId: number | null customer_id: string | null
account_id: string
complex_id: string
}, ExtArgs["result"]["salesInvoice"]> }, ExtArgs["result"]["salesInvoice"]>
composites: {} composites: {}
} }
@@ -1156,7 +1233,7 @@ export interface Prisma__SalesInvoiceClient<T, Null = never, ExtArgs extends run
readonly [Symbol.toStringTag]: "PrismaPromise" readonly [Symbol.toStringTag]: "PrismaPromise"
customer<T extends Prisma.SalesInvoice$customerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$customerArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> customer<T extends Prisma.SalesInvoice$customerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$customerArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
items<T extends Prisma.SalesInvoice$itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> items<T extends Prisma.SalesInvoice$itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
salesInvoicePayments<T extends Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePaymentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> sales_invoice_payments<T extends Prisma.SalesInvoice$sales_invoice_paymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$sales_invoice_paymentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePaymentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1186,13 +1263,15 @@ export interface Prisma__SalesInvoiceClient<T, Null = never, ExtArgs extends run
* Fields of the SalesInvoice model * Fields of the SalesInvoice model
*/ */
export interface SalesInvoiceFieldRefs { export interface SalesInvoiceFieldRefs {
readonly id: Prisma.FieldRef<"SalesInvoice", 'Int'> readonly id: Prisma.FieldRef<"SalesInvoice", 'String'>
readonly code: 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 description: Prisma.FieldRef<"SalesInvoice", 'String'>
readonly createdAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'> readonly created_at: Prisma.FieldRef<"SalesInvoice", 'DateTime'>
readonly updatedAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'> readonly updated_at: Prisma.FieldRef<"SalesInvoice", 'DateTime'>
readonly customerId: Prisma.FieldRef<"SalesInvoice", 'Int'> 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<ExtArgs extends runtime.Types.Extensions.Inte
} }
/** /**
* SalesInvoice.salesInvoicePayments * SalesInvoice.sales_invoice_payments
*/ */
export type SalesInvoice$salesInvoicePaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type SalesInvoice$sales_invoice_paymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/** /**
* Select specific fields to fetch from the SalesInvoicePayment * Select specific fields to fetch from the SalesInvoicePayment
*/ */
+297 -305
View File
@@ -27,111 +27,95 @@ export type AggregateSalesInvoiceItem = {
} }
export type SalesInvoiceItemAvgAggregateOutputType = { export type SalesInvoiceItemAvgAggregateOutputType = {
id: number | null
count: runtime.Decimal | null count: runtime.Decimal | null
unitPrice: runtime.Decimal | null unit_price: runtime.Decimal | null
totalAmount: runtime.Decimal | null total_amount: runtime.Decimal | null
invoiceId: number | null
goodId: number | null
serviceId: number | null
} }
export type SalesInvoiceItemSumAggregateOutputType = { export type SalesInvoiceItemSumAggregateOutputType = {
id: number | null
count: runtime.Decimal | null count: runtime.Decimal | null
unitPrice: runtime.Decimal | null unit_price: runtime.Decimal | null
totalAmount: runtime.Decimal | null total_amount: runtime.Decimal | null
invoiceId: number | null
goodId: number | null
serviceId: number | null
} }
export type SalesInvoiceItemMinAggregateOutputType = { export type SalesInvoiceItemMinAggregateOutputType = {
id: number | null id: string | null
count: runtime.Decimal | null count: runtime.Decimal | null
unitPrice: runtime.Decimal | null unit_price: runtime.Decimal | null
totalAmount: runtime.Decimal | null total_amount: runtime.Decimal | null
createdAt: Date | null created_at: Date | null
invoiceId: number | null invoice_id: string | null
goodId: number | null good_id: string | null
serviceId: number | null service_id: string | null
} }
export type SalesInvoiceItemMaxAggregateOutputType = { export type SalesInvoiceItemMaxAggregateOutputType = {
id: number | null id: string | null
count: runtime.Decimal | null count: runtime.Decimal | null
unitPrice: runtime.Decimal | null unit_price: runtime.Decimal | null
totalAmount: runtime.Decimal | null total_amount: runtime.Decimal | null
createdAt: Date | null created_at: Date | null
invoiceId: number | null invoice_id: string | null
goodId: number | null good_id: string | null
serviceId: number | null service_id: string | null
} }
export type SalesInvoiceItemCountAggregateOutputType = { export type SalesInvoiceItemCountAggregateOutputType = {
id: number id: number
count: number count: number
unitPrice: number unit_price: number
totalAmount: number total_amount: number
createdAt: number created_at: number
invoiceId: number invoice_id: number
goodId: number good_id: number
serviceId: number service_id: number
_all: number _all: number
} }
export type SalesInvoiceItemAvgAggregateInputType = { export type SalesInvoiceItemAvgAggregateInputType = {
id?: true
count?: true count?: true
unitPrice?: true unit_price?: true
totalAmount?: true total_amount?: true
invoiceId?: true
goodId?: true
serviceId?: true
} }
export type SalesInvoiceItemSumAggregateInputType = { export type SalesInvoiceItemSumAggregateInputType = {
id?: true
count?: true count?: true
unitPrice?: true unit_price?: true
totalAmount?: true total_amount?: true
invoiceId?: true
goodId?: true
serviceId?: true
} }
export type SalesInvoiceItemMinAggregateInputType = { export type SalesInvoiceItemMinAggregateInputType = {
id?: true id?: true
count?: true count?: true
unitPrice?: true unit_price?: true
totalAmount?: true total_amount?: true
createdAt?: true created_at?: true
invoiceId?: true invoice_id?: true
goodId?: true good_id?: true
serviceId?: true service_id?: true
} }
export type SalesInvoiceItemMaxAggregateInputType = { export type SalesInvoiceItemMaxAggregateInputType = {
id?: true id?: true
count?: true count?: true
unitPrice?: true unit_price?: true
totalAmount?: true total_amount?: true
createdAt?: true created_at?: true
invoiceId?: true invoice_id?: true
goodId?: true good_id?: true
serviceId?: true service_id?: true
} }
export type SalesInvoiceItemCountAggregateInputType = { export type SalesInvoiceItemCountAggregateInputType = {
id?: true id?: true
count?: true count?: true
unitPrice?: true unit_price?: true
totalAmount?: true total_amount?: true
createdAt?: true created_at?: true
invoiceId?: true invoice_id?: true
goodId?: true good_id?: true
serviceId?: true service_id?: true
_all?: true _all?: true
} }
@@ -222,14 +206,14 @@ export type SalesInvoiceItemGroupByArgs<ExtArgs extends runtime.Types.Extensions
} }
export type SalesInvoiceItemGroupByOutputType = { export type SalesInvoiceItemGroupByOutputType = {
id: number id: string
count: runtime.Decimal count: runtime.Decimal
unitPrice: runtime.Decimal unit_price: runtime.Decimal
totalAmount: runtime.Decimal total_amount: runtime.Decimal
createdAt: Date created_at: Date
invoiceId: number invoice_id: string
goodId: number good_id: string
serviceId: number service_id: string
_count: SalesInvoiceItemCountAggregateOutputType | null _count: SalesInvoiceItemCountAggregateOutputType | null
_avg: SalesInvoiceItemAvgAggregateOutputType | null _avg: SalesInvoiceItemAvgAggregateOutputType | null
_sum: SalesInvoiceItemSumAggregateOutputType | null _sum: SalesInvoiceItemSumAggregateOutputType | null
@@ -256,14 +240,14 @@ export type SalesInvoiceItemWhereInput = {
AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[]
OR?: Prisma.SalesInvoiceItemWhereInput[] OR?: Prisma.SalesInvoiceItemWhereInput[]
NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[]
id?: Prisma.IntFilter<"SalesInvoiceItem"> | number id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string
invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
goodId?: Prisma.IntFilter<"SalesInvoiceItem"> | number good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
serviceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number service_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput> invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
good?: Prisma.XOR<Prisma.GoodNullableScalarRelationFilter, Prisma.GoodWhereInput> | null good?: Prisma.XOR<Prisma.GoodNullableScalarRelationFilter, Prisma.GoodWhereInput> | null
service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null
@@ -272,29 +256,30 @@ export type SalesInvoiceItemWhereInput = {
export type SalesInvoiceItemOrderByWithRelationInput = { export type SalesInvoiceItemOrderByWithRelationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
goodId?: Prisma.SortOrder good_id?: Prisma.SortOrder
serviceId?: Prisma.SortOrder service_id?: Prisma.SortOrder
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
good?: Prisma.GoodOrderByWithRelationInput good?: Prisma.GoodOrderByWithRelationInput
service?: Prisma.ServiceOrderByWithRelationInput service?: Prisma.ServiceOrderByWithRelationInput
_relevance?: Prisma.SalesInvoiceItemOrderByRelevanceInput
} }
export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[]
OR?: Prisma.SalesInvoiceItemWhereInput[] OR?: Prisma.SalesInvoiceItemWhereInput[]
NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[]
count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string
invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
goodId?: Prisma.IntFilter<"SalesInvoiceItem"> | number good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
serviceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number service_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput> invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
good?: Prisma.XOR<Prisma.GoodNullableScalarRelationFilter, Prisma.GoodWhereInput> | null good?: Prisma.XOR<Prisma.GoodNullableScalarRelationFilter, Prisma.GoodWhereInput> | null
service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null
@@ -303,12 +288,12 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
export type SalesInvoiceItemOrderByWithAggregationInput = { export type SalesInvoiceItemOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
goodId?: Prisma.SortOrder good_id?: Prisma.SortOrder
serviceId?: Prisma.SortOrder service_id?: Prisma.SortOrder
_count?: Prisma.SalesInvoiceItemCountOrderByAggregateInput _count?: Prisma.SalesInvoiceItemCountOrderByAggregateInput
_avg?: Prisma.SalesInvoiceItemAvgOrderByAggregateInput _avg?: Prisma.SalesInvoiceItemAvgOrderByAggregateInput
_max?: Prisma.SalesInvoiceItemMaxOrderByAggregateInput _max?: Prisma.SalesInvoiceItemMaxOrderByAggregateInput
@@ -320,85 +305,88 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = {
AND?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] AND?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[]
OR?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] OR?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[]
NOT?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | 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 count?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string
invoiceId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
goodId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number good_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
serviceId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number service_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
} }
export type SalesInvoiceItemCreateInput = { export type SalesInvoiceItemCreateInput = {
id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
good?: Prisma.GoodCreateNestedOneWithoutSalesInvoiceItemsInput good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
service?: Prisma.ServiceCreateNestedOneWithoutSalesInvoiceItemsInput service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
} }
export type SalesInvoiceItemUncheckedCreateInput = { export type SalesInvoiceItemUncheckedCreateInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoiceId: number invoice_id: string
goodId: number good_id: string
serviceId: number service_id: string
} }
export type SalesInvoiceItemUpdateInput = { export type SalesInvoiceItemUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
good?: Prisma.GoodUpdateOneWithoutSalesInvoiceItemsNestedInput good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput
service?: Prisma.ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
} }
export type SalesInvoiceItemUncheckedUpdateInput = { export type SalesInvoiceItemUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
goodId?: Prisma.IntFieldUpdateOperationsInput | number good_id?: Prisma.StringFieldUpdateOperationsInput | string
serviceId?: Prisma.IntFieldUpdateOperationsInput | number service_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemCreateManyInput = { export type SalesInvoiceItemCreateManyInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoiceId: number invoice_id: string
goodId: number good_id: string
serviceId: number service_id: string
} }
export type SalesInvoiceItemUpdateManyMutationInput = { export type SalesInvoiceItemUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoiceItemUncheckedUpdateManyInput = { export type SalesInvoiceItemUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
goodId?: Prisma.IntFieldUpdateOperationsInput | number good_id?: Prisma.StringFieldUpdateOperationsInput | string
serviceId?: Prisma.IntFieldUpdateOperationsInput | number service_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemListRelationFilter = { export type SalesInvoiceItemListRelationFilter = {
@@ -411,57 +399,55 @@ export type SalesInvoiceItemOrderByRelationAggregateInput = {
_count?: Prisma.SortOrder _count?: Prisma.SortOrder
} }
export type SalesInvoiceItemOrderByRelevanceInput = {
fields: Prisma.SalesInvoiceItemOrderByRelevanceFieldEnum | Prisma.SalesInvoiceItemOrderByRelevanceFieldEnum[]
sort: Prisma.SortOrder
search: string
}
export type SalesInvoiceItemCountOrderByAggregateInput = { export type SalesInvoiceItemCountOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
goodId?: Prisma.SortOrder good_id?: Prisma.SortOrder
serviceId?: Prisma.SortOrder service_id?: Prisma.SortOrder
} }
export type SalesInvoiceItemAvgOrderByAggregateInput = { export type SalesInvoiceItemAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
goodId?: Prisma.SortOrder
serviceId?: Prisma.SortOrder
} }
export type SalesInvoiceItemMaxOrderByAggregateInput = { export type SalesInvoiceItemMaxOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
goodId?: Prisma.SortOrder good_id?: Prisma.SortOrder
serviceId?: Prisma.SortOrder service_id?: Prisma.SortOrder
} }
export type SalesInvoiceItemMinOrderByAggregateInput = { export type SalesInvoiceItemMinOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
goodId?: Prisma.SortOrder good_id?: Prisma.SortOrder
serviceId?: Prisma.SortOrder service_id?: Prisma.SortOrder
} }
export type SalesInvoiceItemSumOrderByAggregateInput = { export type SalesInvoiceItemSumOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder count?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder unit_price?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder total_amount?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
goodId?: Prisma.SortOrder
serviceId?: Prisma.SortOrder
} }
export type SalesInvoiceItemCreateNestedManyWithoutGoodInput = { export type SalesInvoiceItemCreateNestedManyWithoutGoodInput = {
@@ -591,22 +577,23 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput = {
} }
export type SalesInvoiceItemCreateWithoutGoodInput = { export type SalesInvoiceItemCreateWithoutGoodInput = {
id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
service?: Prisma.ServiceCreateNestedOneWithoutSalesInvoiceItemsInput service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
} }
export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = { export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoiceId: number invoice_id: string
serviceId: number service_id: string
} }
export type SalesInvoiceItemCreateOrConnectWithoutGoodInput = { export type SalesInvoiceItemCreateOrConnectWithoutGoodInput = {
@@ -639,33 +626,34 @@ export type SalesInvoiceItemScalarWhereInput = {
AND?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] AND?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[]
OR?: Prisma.SalesInvoiceItemScalarWhereInput[] OR?: Prisma.SalesInvoiceItemScalarWhereInput[]
NOT?: Prisma.SalesInvoiceItemScalarWhereInput | 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 count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string
invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
goodId?: Prisma.IntFilter<"SalesInvoiceItem"> | number good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
serviceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number service_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
} }
export type SalesInvoiceItemCreateWithoutInvoiceInput = { export type SalesInvoiceItemCreateWithoutInvoiceInput = {
id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
good?: Prisma.GoodCreateNestedOneWithoutSalesInvoiceItemsInput good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
service?: Prisma.ServiceCreateNestedOneWithoutSalesInvoiceItemsInput service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
} }
export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = { export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
goodId: number good_id: string
serviceId: number service_id: string
} }
export type SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = { export type SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = {
@@ -695,22 +683,23 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput = {
} }
export type SalesInvoiceItemCreateWithoutServiceInput = { export type SalesInvoiceItemCreateWithoutServiceInput = {
id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
good?: Prisma.GoodCreateNestedOneWithoutSalesInvoiceItemsInput good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
} }
export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = { export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoiceId: number invoice_id: string
goodId: number good_id: string
} }
export type SalesInvoiceItemCreateOrConnectWithoutServiceInput = { export type SalesInvoiceItemCreateOrConnectWithoutServiceInput = {
@@ -740,120 +729,123 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutServiceInput = {
} }
export type SalesInvoiceItemCreateManyGoodInput = { export type SalesInvoiceItemCreateManyGoodInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoiceId: number invoice_id: string
serviceId: number service_id: string
} }
export type SalesInvoiceItemUpdateWithoutGoodInput = { export type SalesInvoiceItemUpdateWithoutGoodInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
service?: Prisma.ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
} }
export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = { export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
serviceId?: Prisma.IntFieldUpdateOperationsInput | number service_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = { export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
serviceId?: Prisma.IntFieldUpdateOperationsInput | number service_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemCreateManyInvoiceInput = { export type SalesInvoiceItemCreateManyInvoiceInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
goodId: number good_id: string
serviceId: number service_id: string
} }
export type SalesInvoiceItemUpdateWithoutInvoiceInput = { export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
good?: Prisma.GoodUpdateOneWithoutSalesInvoiceItemsNestedInput good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput
service?: Prisma.ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
} }
export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = { export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
goodId?: Prisma.IntFieldUpdateOperationsInput | number good_id?: Prisma.StringFieldUpdateOperationsInput | string
serviceId?: Prisma.IntFieldUpdateOperationsInput | number service_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = { export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
goodId?: Prisma.IntFieldUpdateOperationsInput | number good_id?: Prisma.StringFieldUpdateOperationsInput | string
serviceId?: Prisma.IntFieldUpdateOperationsInput | number service_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemCreateManyServiceInput = { export type SalesInvoiceItemCreateManyServiceInput = {
id?: number id?: string
count: runtime.Decimal | runtime.DecimalJsLike | number | string count: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string created_at?: Date | string
invoiceId: number invoice_id: string
goodId: number good_id: string
} }
export type SalesInvoiceItemUpdateWithoutServiceInput = { export type SalesInvoiceItemUpdateWithoutServiceInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
good?: Prisma.GoodUpdateOneWithoutSalesInvoiceItemsNestedInput good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput
} }
export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = { export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
goodId?: Prisma.IntFieldUpdateOperationsInput | number good_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = { export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string unit_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
goodId?: Prisma.IntFieldUpdateOperationsInput | number good_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
@@ -861,12 +853,12 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean id?: boolean
count?: boolean count?: boolean
unitPrice?: boolean unit_price?: boolean
totalAmount?: boolean total_amount?: boolean
createdAt?: boolean created_at?: boolean
invoiceId?: boolean invoice_id?: boolean
goodId?: boolean good_id?: boolean
serviceId?: boolean service_id?: boolean
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs> invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
good?: boolean | Prisma.SalesInvoiceItem$goodArgs<ExtArgs> good?: boolean | Prisma.SalesInvoiceItem$goodArgs<ExtArgs>
service?: boolean | Prisma.SalesInvoiceItem$serviceArgs<ExtArgs> service?: boolean | Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>
@@ -877,15 +869,15 @@ export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.Inte
export type SalesInvoiceItemSelectScalar = { export type SalesInvoiceItemSelectScalar = {
id?: boolean id?: boolean
count?: boolean count?: boolean
unitPrice?: boolean unit_price?: boolean
totalAmount?: boolean total_amount?: boolean
createdAt?: boolean created_at?: boolean
invoiceId?: boolean invoice_id?: boolean
goodId?: boolean good_id?: boolean
serviceId?: boolean service_id?: boolean
} }
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "unitPrice" | "totalAmount" | "createdAt" | "invoiceId" | "goodId" | "serviceId", ExtArgs["result"]["salesInvoiceItem"]> export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "unit_price" | "total_amount" | "created_at" | "invoice_id" | "good_id" | "service_id", ExtArgs["result"]["salesInvoiceItem"]>
export type SalesInvoiceItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type SalesInvoiceItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs> invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
good?: boolean | Prisma.SalesInvoiceItem$goodArgs<ExtArgs> good?: boolean | Prisma.SalesInvoiceItem$goodArgs<ExtArgs>
@@ -900,14 +892,14 @@ export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.In
service: Prisma.$ServicePayload<ExtArgs> | null service: Prisma.$ServicePayload<ExtArgs> | null
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
count: runtime.Decimal count: runtime.Decimal
unitPrice: runtime.Decimal unit_price: runtime.Decimal
totalAmount: runtime.Decimal total_amount: runtime.Decimal
createdAt: Date created_at: Date
invoiceId: number invoice_id: string
goodId: number good_id: string
serviceId: number service_id: string
}, ExtArgs["result"]["salesInvoiceItem"]> }, ExtArgs["result"]["salesInvoiceItem"]>
composites: {} composites: {}
} }
@@ -1280,14 +1272,14 @@ export interface Prisma__SalesInvoiceItemClient<T, Null = never, ExtArgs extends
* Fields of the SalesInvoiceItem model * Fields of the SalesInvoiceItem model
*/ */
export interface SalesInvoiceItemFieldRefs { export interface SalesInvoiceItemFieldRefs {
readonly id: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> readonly id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
readonly count: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> readonly count: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
readonly unitPrice: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> readonly unit_price: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
readonly totalAmount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> readonly total_amount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
readonly createdAt: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'> readonly created_at: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'>
readonly invoiceId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> readonly invoice_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
readonly goodId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> readonly good_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
readonly serviceId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> readonly service_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'>
} }
+155 -155
View File
@@ -27,83 +27,75 @@ export type AggregateSalesInvoicePayment = {
} }
export type SalesInvoicePaymentAvgAggregateOutputType = { export type SalesInvoicePaymentAvgAggregateOutputType = {
id: number | null
invoiceId: number | null
amount: runtime.Decimal | null amount: runtime.Decimal | null
} }
export type SalesInvoicePaymentSumAggregateOutputType = { export type SalesInvoicePaymentSumAggregateOutputType = {
id: number | null
invoiceId: number | null
amount: runtime.Decimal | null amount: runtime.Decimal | null
} }
export type SalesInvoicePaymentMinAggregateOutputType = { export type SalesInvoicePaymentMinAggregateOutputType = {
id: number | null id: string | null
invoiceId: number | null invoice_id: string | null
amount: runtime.Decimal | null amount: runtime.Decimal | null
paymentMethod: $Enums.PaymentMethodType | null payment_method: $Enums.PaymentMethodType | null
paidAt: Date | null paid_at: Date | null
createdAt: Date | null created_at: Date | null
} }
export type SalesInvoicePaymentMaxAggregateOutputType = { export type SalesInvoicePaymentMaxAggregateOutputType = {
id: number | null id: string | null
invoiceId: number | null invoice_id: string | null
amount: runtime.Decimal | null amount: runtime.Decimal | null
paymentMethod: $Enums.PaymentMethodType | null payment_method: $Enums.PaymentMethodType | null
paidAt: Date | null paid_at: Date | null
createdAt: Date | null created_at: Date | null
} }
export type SalesInvoicePaymentCountAggregateOutputType = { export type SalesInvoicePaymentCountAggregateOutputType = {
id: number id: number
invoiceId: number invoice_id: number
amount: number amount: number
paymentMethod: number payment_method: number
paidAt: number paid_at: number
createdAt: number created_at: number
_all: number _all: number
} }
export type SalesInvoicePaymentAvgAggregateInputType = { export type SalesInvoicePaymentAvgAggregateInputType = {
id?: true
invoiceId?: true
amount?: true amount?: true
} }
export type SalesInvoicePaymentSumAggregateInputType = { export type SalesInvoicePaymentSumAggregateInputType = {
id?: true
invoiceId?: true
amount?: true amount?: true
} }
export type SalesInvoicePaymentMinAggregateInputType = { export type SalesInvoicePaymentMinAggregateInputType = {
id?: true id?: true
invoiceId?: true invoice_id?: true
amount?: true amount?: true
paymentMethod?: true payment_method?: true
paidAt?: true paid_at?: true
createdAt?: true created_at?: true
} }
export type SalesInvoicePaymentMaxAggregateInputType = { export type SalesInvoicePaymentMaxAggregateInputType = {
id?: true id?: true
invoiceId?: true invoice_id?: true
amount?: true amount?: true
paymentMethod?: true payment_method?: true
paidAt?: true paid_at?: true
createdAt?: true created_at?: true
} }
export type SalesInvoicePaymentCountAggregateInputType = { export type SalesInvoicePaymentCountAggregateInputType = {
id?: true id?: true
invoiceId?: true invoice_id?: true
amount?: true amount?: true
paymentMethod?: true payment_method?: true
paidAt?: true paid_at?: true
createdAt?: true created_at?: true
_all?: true _all?: true
} }
@@ -194,12 +186,12 @@ export type SalesInvoicePaymentGroupByArgs<ExtArgs extends runtime.Types.Extensi
} }
export type SalesInvoicePaymentGroupByOutputType = { export type SalesInvoicePaymentGroupByOutputType = {
id: number id: string
invoiceId: number invoice_id: string
amount: runtime.Decimal amount: runtime.Decimal
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date paid_at: Date
createdAt: Date created_at: Date
_count: SalesInvoicePaymentCountAggregateOutputType | null _count: SalesInvoicePaymentCountAggregateOutputType | null
_avg: SalesInvoicePaymentAvgAggregateOutputType | null _avg: SalesInvoicePaymentAvgAggregateOutputType | null
_sum: SalesInvoicePaymentSumAggregateOutputType | null _sum: SalesInvoicePaymentSumAggregateOutputType | null
@@ -226,45 +218,46 @@ export type SalesInvoicePaymentWhereInput = {
AND?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[] AND?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[]
OR?: Prisma.SalesInvoicePaymentWhereInput[] OR?: Prisma.SalesInvoicePaymentWhereInput[]
NOT?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[] NOT?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[]
id?: Prisma.IntFilter<"SalesInvoicePayment"> | number id?: Prisma.StringFilter<"SalesInvoicePayment"> | string
invoiceId?: Prisma.IntFilter<"SalesInvoicePayment"> | number invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string
amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
createdAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput> invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
} }
export type SalesInvoicePaymentOrderByWithRelationInput = { export type SalesInvoicePaymentOrderByWithRelationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder payment_method?: Prisma.SortOrder
paidAt?: Prisma.SortOrder paid_at?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
_relevance?: Prisma.SalesInvoicePaymentOrderByRelevanceInput
} }
export type SalesInvoicePaymentWhereUniqueInput = Prisma.AtLeast<{ export type SalesInvoicePaymentWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
AND?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[] AND?: Prisma.SalesInvoicePaymentWhereInput | Prisma.SalesInvoicePaymentWhereInput[]
OR?: Prisma.SalesInvoicePaymentWhereInput[] OR?: Prisma.SalesInvoicePaymentWhereInput[]
NOT?: Prisma.SalesInvoicePaymentWhereInput | 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 amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
createdAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput> invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
}, "id"> }, "id">
export type SalesInvoicePaymentOrderByWithAggregationInput = { export type SalesInvoicePaymentOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder payment_method?: Prisma.SortOrder
paidAt?: Prisma.SortOrder paid_at?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
_count?: Prisma.SalesInvoicePaymentCountOrderByAggregateInput _count?: Prisma.SalesInvoicePaymentCountOrderByAggregateInput
_avg?: Prisma.SalesInvoicePaymentAvgOrderByAggregateInput _avg?: Prisma.SalesInvoicePaymentAvgOrderByAggregateInput
_max?: Prisma.SalesInvoicePaymentMaxOrderByAggregateInput _max?: Prisma.SalesInvoicePaymentMaxOrderByAggregateInput
@@ -276,71 +269,74 @@ export type SalesInvoicePaymentScalarWhereWithAggregatesInput = {
AND?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput | Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[] AND?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput | Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[]
OR?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[] OR?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[]
NOT?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput | Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[] NOT?: Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput | Prisma.SalesInvoicePaymentScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"SalesInvoicePayment"> | number id?: Prisma.StringWithAggregatesFilter<"SalesInvoicePayment"> | string
invoiceId?: Prisma.IntWithAggregatesFilter<"SalesInvoicePayment"> | number invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoicePayment"> | string
amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string paid_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string
createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoicePayment"> | Date | string
} }
export type SalesInvoicePaymentCreateInput = { export type SalesInvoicePaymentCreateInput = {
id?: string
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date | string paid_at: Date | string
createdAt?: Date | string created_at?: Date | string
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutSalesInvoicePaymentsInput invoice: Prisma.SalesInvoiceCreateNestedOneWithoutSales_invoice_paymentsInput
} }
export type SalesInvoicePaymentUncheckedCreateInput = { export type SalesInvoicePaymentUncheckedCreateInput = {
id?: number id?: string
invoiceId: number invoice_id: string
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date | string paid_at: Date | string
createdAt?: Date | string created_at?: Date | string
} }
export type SalesInvoicePaymentUpdateInput = { export type SalesInvoicePaymentUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutSalesInvoicePaymentsNestedInput invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutSales_invoice_paymentsNestedInput
} }
export type SalesInvoicePaymentUncheckedUpdateInput = { export type SalesInvoicePaymentUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoicePaymentCreateManyInput = { export type SalesInvoicePaymentCreateManyInput = {
id?: number id?: string
invoiceId: number invoice_id: string
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date | string paid_at: Date | string
createdAt?: Date | string created_at?: Date | string
} }
export type SalesInvoicePaymentUpdateManyMutationInput = { export type SalesInvoicePaymentUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoicePaymentUncheckedUpdateManyInput = { export type SalesInvoicePaymentUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoicePaymentListRelationFilter = { export type SalesInvoicePaymentListRelationFilter = {
@@ -353,42 +349,44 @@ export type SalesInvoicePaymentOrderByRelationAggregateInput = {
_count?: Prisma.SortOrder _count?: Prisma.SortOrder
} }
export type SalesInvoicePaymentOrderByRelevanceInput = {
fields: Prisma.SalesInvoicePaymentOrderByRelevanceFieldEnum | Prisma.SalesInvoicePaymentOrderByRelevanceFieldEnum[]
sort: Prisma.SortOrder
search: string
}
export type SalesInvoicePaymentCountOrderByAggregateInput = { export type SalesInvoicePaymentCountOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder payment_method?: Prisma.SortOrder
paidAt?: Prisma.SortOrder paid_at?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} }
export type SalesInvoicePaymentAvgOrderByAggregateInput = { export type SalesInvoicePaymentAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
} }
export type SalesInvoicePaymentMaxOrderByAggregateInput = { export type SalesInvoicePaymentMaxOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder payment_method?: Prisma.SortOrder
paidAt?: Prisma.SortOrder paid_at?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} }
export type SalesInvoicePaymentMinOrderByAggregateInput = { export type SalesInvoicePaymentMinOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder invoice_id?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder payment_method?: Prisma.SortOrder
paidAt?: Prisma.SortOrder paid_at?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} }
export type SalesInvoicePaymentSumOrderByAggregateInput = { export type SalesInvoicePaymentSumOrderByAggregateInput = {
id?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
amount?: Prisma.SortOrder amount?: Prisma.SortOrder
} }
@@ -439,18 +437,19 @@ export type EnumPaymentMethodTypeFieldUpdateOperationsInput = {
} }
export type SalesInvoicePaymentCreateWithoutInvoiceInput = { export type SalesInvoicePaymentCreateWithoutInvoiceInput = {
id?: string
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date | string paid_at: Date | string
createdAt?: Date | string created_at?: Date | string
} }
export type SalesInvoicePaymentUncheckedCreateWithoutInvoiceInput = { export type SalesInvoicePaymentUncheckedCreateWithoutInvoiceInput = {
id?: number id?: string
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date | string paid_at: Date | string
createdAt?: Date | string created_at?: Date | string
} }
export type SalesInvoicePaymentCreateOrConnectWithoutInvoiceInput = { export type SalesInvoicePaymentCreateOrConnectWithoutInvoiceInput = {
@@ -483,54 +482,55 @@ export type SalesInvoicePaymentScalarWhereInput = {
AND?: Prisma.SalesInvoicePaymentScalarWhereInput | Prisma.SalesInvoicePaymentScalarWhereInput[] AND?: Prisma.SalesInvoicePaymentScalarWhereInput | Prisma.SalesInvoicePaymentScalarWhereInput[]
OR?: Prisma.SalesInvoicePaymentScalarWhereInput[] OR?: Prisma.SalesInvoicePaymentScalarWhereInput[]
NOT?: Prisma.SalesInvoicePaymentScalarWhereInput | Prisma.SalesInvoicePaymentScalarWhereInput[] NOT?: Prisma.SalesInvoicePaymentScalarWhereInput | Prisma.SalesInvoicePaymentScalarWhereInput[]
id?: Prisma.IntFilter<"SalesInvoicePayment"> | number id?: Prisma.StringFilter<"SalesInvoicePayment"> | string
invoiceId?: Prisma.IntFilter<"SalesInvoicePayment"> | number invoice_id?: Prisma.StringFilter<"SalesInvoicePayment"> | string
amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFilter<"SalesInvoicePayment"> | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFilter<"SalesInvoicePayment"> | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string paid_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
createdAt?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string created_at?: Prisma.DateTimeFilter<"SalesInvoicePayment"> | Date | string
} }
export type SalesInvoicePaymentCreateManyInvoiceInput = { export type SalesInvoicePaymentCreateManyInvoiceInput = {
id?: number id?: string
amount: runtime.Decimal | runtime.DecimalJsLike | number | string amount: runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date | string paid_at: Date | string
createdAt?: Date | string created_at?: Date | string
} }
export type SalesInvoicePaymentUpdateWithoutInvoiceInput = { export type SalesInvoicePaymentUpdateWithoutInvoiceInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoicePaymentUncheckedUpdateWithoutInvoiceInput = { export type SalesInvoicePaymentUncheckedUpdateWithoutInvoiceInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceInput = { export type SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType payment_method?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
paidAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string paid_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
} }
export type SalesInvoicePaymentSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type SalesInvoicePaymentSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean id?: boolean
invoiceId?: boolean invoice_id?: boolean
amount?: boolean amount?: boolean
paymentMethod?: boolean payment_method?: boolean
paidAt?: boolean paid_at?: boolean
createdAt?: boolean created_at?: boolean
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs> invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
}, ExtArgs["result"]["salesInvoicePayment"]> }, ExtArgs["result"]["salesInvoicePayment"]>
@@ -538,14 +538,14 @@ export type SalesInvoicePaymentSelect<ExtArgs extends runtime.Types.Extensions.I
export type SalesInvoicePaymentSelectScalar = { export type SalesInvoicePaymentSelectScalar = {
id?: boolean id?: boolean
invoiceId?: boolean invoice_id?: boolean
amount?: boolean amount?: boolean
paymentMethod?: boolean payment_method?: boolean
paidAt?: boolean paid_at?: boolean
createdAt?: boolean created_at?: boolean
} }
export type SalesInvoicePaymentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "invoiceId" | "amount" | "paymentMethod" | "paidAt" | "createdAt", ExtArgs["result"]["salesInvoicePayment"]> export type SalesInvoicePaymentOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "invoice_id" | "amount" | "payment_method" | "paid_at" | "created_at", ExtArgs["result"]["salesInvoicePayment"]>
export type SalesInvoicePaymentInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type SalesInvoicePaymentInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs> invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
} }
@@ -556,12 +556,12 @@ export type $SalesInvoicePaymentPayload<ExtArgs extends runtime.Types.Extensions
invoice: Prisma.$SalesInvoicePayload<ExtArgs> invoice: Prisma.$SalesInvoicePayload<ExtArgs>
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
invoiceId: number invoice_id: string
amount: runtime.Decimal amount: runtime.Decimal
paymentMethod: $Enums.PaymentMethodType payment_method: $Enums.PaymentMethodType
paidAt: Date paid_at: Date
createdAt: Date created_at: Date
}, ExtArgs["result"]["salesInvoicePayment"]> }, ExtArgs["result"]["salesInvoicePayment"]>
composites: {} composites: {}
} }
@@ -932,12 +932,12 @@ export interface Prisma__SalesInvoicePaymentClient<T, Null = never, ExtArgs exte
* Fields of the SalesInvoicePayment model * Fields of the SalesInvoicePayment model
*/ */
export interface SalesInvoicePaymentFieldRefs { export interface SalesInvoicePaymentFieldRefs {
readonly id: Prisma.FieldRef<"SalesInvoicePayment", 'Int'> readonly id: Prisma.FieldRef<"SalesInvoicePayment", 'String'>
readonly invoiceId: Prisma.FieldRef<"SalesInvoicePayment", 'Int'> readonly invoice_id: Prisma.FieldRef<"SalesInvoicePayment", 'String'>
readonly amount: Prisma.FieldRef<"SalesInvoicePayment", 'Decimal'> readonly amount: Prisma.FieldRef<"SalesInvoicePayment", 'Decimal'>
readonly paymentMethod: Prisma.FieldRef<"SalesInvoicePayment", 'PaymentMethodType'> readonly payment_method: Prisma.FieldRef<"SalesInvoicePayment", 'PaymentMethodType'>
readonly paidAt: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'> readonly paid_at: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'>
readonly createdAt: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'> readonly created_at: Prisma.FieldRef<"SalesInvoicePayment", 'DateTime'>
} }
+358 -252
View File
@@ -27,41 +27,43 @@ export type AggregateService = {
} }
export type ServiceAvgAggregateOutputType = { export type ServiceAvgAggregateOutputType = {
id: number | null base_sale_price: runtime.Decimal | null
categoryId: number | null
baseSalePrice: runtime.Decimal | null
} }
export type ServiceSumAggregateOutputType = { export type ServiceSumAggregateOutputType = {
id: number | null base_sale_price: runtime.Decimal | null
categoryId: number | null
baseSalePrice: runtime.Decimal | null
} }
export type ServiceMinAggregateOutputType = { export type ServiceMinAggregateOutputType = {
id: number | null id: string | null
name: string | null name: string | null
description: string | null description: string | null
sku: string | null sku: string | null
local_sku: string | null
barcode: string | null barcode: string | null
createdAt: Date | null created_at: Date | null
updatedAt: Date | null updated_at: Date | null
deletedAt: Date | null deleted_at: Date | null
categoryId: number | null category_id: string | null
baseSalePrice: runtime.Decimal | null base_sale_price: runtime.Decimal | null
account_id: string | null
complex_id: string | null
} }
export type ServiceMaxAggregateOutputType = { export type ServiceMaxAggregateOutputType = {
id: number | null id: string | null
name: string | null name: string | null
description: string | null description: string | null
sku: string | null sku: string | null
local_sku: string | null
barcode: string | null barcode: string | null
createdAt: Date | null created_at: Date | null
updatedAt: Date | null updated_at: Date | null
deletedAt: Date | null deleted_at: Date | null
categoryId: number | null category_id: string | null
baseSalePrice: runtime.Decimal | null base_sale_price: runtime.Decimal | null
account_id: string | null
complex_id: string | null
} }
export type ServiceCountAggregateOutputType = { export type ServiceCountAggregateOutputType = {
@@ -69,26 +71,25 @@ export type ServiceCountAggregateOutputType = {
name: number name: number
description: number description: number
sku: number sku: number
local_sku: number
barcode: number barcode: number
createdAt: number created_at: number
updatedAt: number updated_at: number
deletedAt: number deleted_at: number
categoryId: number category_id: number
baseSalePrice: number base_sale_price: number
account_id: number
complex_id: number
_all: number _all: number
} }
export type ServiceAvgAggregateInputType = { export type ServiceAvgAggregateInputType = {
id?: true base_sale_price?: true
categoryId?: true
baseSalePrice?: true
} }
export type ServiceSumAggregateInputType = { export type ServiceSumAggregateInputType = {
id?: true base_sale_price?: true
categoryId?: true
baseSalePrice?: true
} }
export type ServiceMinAggregateInputType = { export type ServiceMinAggregateInputType = {
@@ -96,12 +97,15 @@ export type ServiceMinAggregateInputType = {
name?: true name?: true
description?: true description?: true
sku?: true sku?: true
local_sku?: true
barcode?: true barcode?: true
createdAt?: true created_at?: true
updatedAt?: true updated_at?: true
deletedAt?: true deleted_at?: true
categoryId?: true category_id?: true
baseSalePrice?: true base_sale_price?: true
account_id?: true
complex_id?: true
} }
export type ServiceMaxAggregateInputType = { export type ServiceMaxAggregateInputType = {
@@ -109,12 +113,15 @@ export type ServiceMaxAggregateInputType = {
name?: true name?: true
description?: true description?: true
sku?: true sku?: true
local_sku?: true
barcode?: true barcode?: true
createdAt?: true created_at?: true
updatedAt?: true updated_at?: true
deletedAt?: true deleted_at?: true
categoryId?: true category_id?: true
baseSalePrice?: true base_sale_price?: true
account_id?: true
complex_id?: true
} }
export type ServiceCountAggregateInputType = { export type ServiceCountAggregateInputType = {
@@ -122,12 +129,15 @@ export type ServiceCountAggregateInputType = {
name?: true name?: true
description?: true description?: true
sku?: true sku?: true
local_sku?: true
barcode?: true barcode?: true
createdAt?: true created_at?: true
updatedAt?: true updated_at?: true
deletedAt?: true deleted_at?: true
categoryId?: true category_id?: true
baseSalePrice?: true base_sale_price?: true
account_id?: true
complex_id?: true
_all?: true _all?: true
} }
@@ -218,16 +228,19 @@ export type ServiceGroupByArgs<ExtArgs extends runtime.Types.Extensions.Internal
} }
export type ServiceGroupByOutputType = { export type ServiceGroupByOutputType = {
id: number id: string
name: string name: string
description: string | null description: string | null
sku: string sku: string
local_sku: string | null
barcode: string | null barcode: string | null
createdAt: Date created_at: Date
updatedAt: Date updated_at: Date
deletedAt: Date | null deleted_at: Date | null
categoryId: number | null category_id: string | null
baseSalePrice: runtime.Decimal base_sale_price: runtime.Decimal
account_id: string
complex_id: string
_count: ServiceCountAggregateOutputType | null _count: ServiceCountAggregateOutputType | null
_avg: ServiceAvgAggregateOutputType | null _avg: ServiceAvgAggregateOutputType | null
_sum: ServiceSumAggregateOutputType | null _sum: ServiceSumAggregateOutputType | null
@@ -254,18 +267,21 @@ export type ServiceWhereInput = {
AND?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[] AND?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[]
OR?: Prisma.ServiceWhereInput[] OR?: Prisma.ServiceWhereInput[]
NOT?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[] NOT?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[]
id?: Prisma.IntFilter<"Service"> | number id?: Prisma.StringFilter<"Service"> | string
name?: Prisma.StringFilter<"Service"> | string name?: Prisma.StringFilter<"Service"> | string
description?: Prisma.StringNullableFilter<"Service"> | string | null description?: Prisma.StringNullableFilter<"Service"> | string | null
sku?: Prisma.StringFilter<"Service"> | string sku?: Prisma.StringFilter<"Service"> | string
local_sku?: Prisma.StringNullableFilter<"Service"> | string | null
barcode?: Prisma.StringNullableFilter<"Service"> | string | null barcode?: Prisma.StringNullableFilter<"Service"> | string | null
createdAt?: Prisma.DateTimeFilter<"Service"> | Date | string created_at?: Prisma.DateTimeFilter<"Service"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Service"> | Date | string updated_at?: Prisma.DateTimeFilter<"Service"> | Date | string
deletedAt?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null deleted_at?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null
categoryId?: Prisma.IntNullableFilter<"Service"> | number | null category_id?: Prisma.StringNullableFilter<"Service"> | string | null
baseSalePrice?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string 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<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null category?: Prisma.XOR<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter
} }
export type ServiceOrderByWithRelationInput = { export type ServiceOrderByWithRelationInput = {
@@ -273,46 +289,55 @@ export type ServiceOrderByWithRelationInput = {
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
sku?: Prisma.SortOrder sku?: Prisma.SortOrder
local_sku?: Prisma.SortOrderInput | Prisma.SortOrder
barcode?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
categoryId?: Prisma.SortOrderInput | Prisma.SortOrder category_id?: Prisma.SortOrderInput | Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
category?: Prisma.ServiceCategoryOrderByWithRelationInput category?: Prisma.ServiceCategoryOrderByWithRelationInput
salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput sales_invoice_items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
_relevance?: Prisma.ServiceOrderByRelevanceInput _relevance?: Prisma.ServiceOrderByRelevanceInput
} }
export type ServiceWhereUniqueInput = Prisma.AtLeast<{ export type ServiceWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
sku?: string sku?: string
local_sku?: string
barcode?: string barcode?: string
AND?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[] AND?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[]
OR?: Prisma.ServiceWhereInput[] OR?: Prisma.ServiceWhereInput[]
NOT?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[] NOT?: Prisma.ServiceWhereInput | Prisma.ServiceWhereInput[]
name?: Prisma.StringFilter<"Service"> | string name?: Prisma.StringFilter<"Service"> | string
description?: Prisma.StringNullableFilter<"Service"> | string | null description?: Prisma.StringNullableFilter<"Service"> | string | null
createdAt?: Prisma.DateTimeFilter<"Service"> | Date | string created_at?: Prisma.DateTimeFilter<"Service"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Service"> | Date | string updated_at?: Prisma.DateTimeFilter<"Service"> | Date | string
deletedAt?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null deleted_at?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null
categoryId?: Prisma.IntNullableFilter<"Service"> | number | null category_id?: Prisma.StringNullableFilter<"Service"> | string | null
baseSalePrice?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string 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<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null category?: Prisma.XOR<Prisma.ServiceCategoryNullableScalarRelationFilter, Prisma.ServiceCategoryWhereInput> | null
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter
}, "id" | "sku" | "barcode"> }, "id" | "sku" | "local_sku" | "barcode">
export type ServiceOrderByWithAggregationInput = { export type ServiceOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
sku?: Prisma.SortOrder sku?: Prisma.SortOrder
local_sku?: Prisma.SortOrderInput | Prisma.SortOrder
barcode?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
categoryId?: Prisma.SortOrderInput | Prisma.SortOrder category_id?: Prisma.SortOrderInput | Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
_count?: Prisma.ServiceCountOrderByAggregateInput _count?: Prisma.ServiceCountOrderByAggregateInput
_avg?: Prisma.ServiceAvgOrderByAggregateInput _avg?: Prisma.ServiceAvgOrderByAggregateInput
_max?: Prisma.ServiceMaxOrderByAggregateInput _max?: Prisma.ServiceMaxOrderByAggregateInput
@@ -324,107 +349,134 @@ export type ServiceScalarWhereWithAggregatesInput = {
AND?: Prisma.ServiceScalarWhereWithAggregatesInput | Prisma.ServiceScalarWhereWithAggregatesInput[] AND?: Prisma.ServiceScalarWhereWithAggregatesInput | Prisma.ServiceScalarWhereWithAggregatesInput[]
OR?: Prisma.ServiceScalarWhereWithAggregatesInput[] OR?: Prisma.ServiceScalarWhereWithAggregatesInput[]
NOT?: Prisma.ServiceScalarWhereWithAggregatesInput | Prisma.ServiceScalarWhereWithAggregatesInput[] NOT?: Prisma.ServiceScalarWhereWithAggregatesInput | Prisma.ServiceScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"Service"> | number id?: Prisma.StringWithAggregatesFilter<"Service"> | string
name?: Prisma.StringWithAggregatesFilter<"Service"> | string name?: Prisma.StringWithAggregatesFilter<"Service"> | string
description?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null description?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null
sku?: Prisma.StringWithAggregatesFilter<"Service"> | string sku?: Prisma.StringWithAggregatesFilter<"Service"> | string
local_sku?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null
barcode?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null barcode?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string created_at?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string updated_at?: Prisma.DateTimeWithAggregatesFilter<"Service"> | Date | string
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Service"> | Date | string | null deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Service"> | Date | string | null
categoryId?: Prisma.IntNullableWithAggregatesFilter<"Service"> | number | null category_id?: Prisma.StringNullableWithAggregatesFilter<"Service"> | string | null
baseSalePrice?: Prisma.DecimalWithAggregatesFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string 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 = { export type ServiceCreateInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
account_id: string
complex_id: string
category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput
} }
export type ServiceUncheckedCreateInput = { export type ServiceUncheckedCreateInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
categoryId?: number | null category_id?: string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput account_id: string
complex_id: string
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput
} }
export type ServiceUpdateInput = { export type ServiceUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput
} }
export type ServiceUncheckedUpdateInput = { export type ServiceUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput
} }
export type ServiceCreateManyInput = { export type ServiceCreateManyInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
categoryId?: number | null category_id?: string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
account_id: string
complex_id: string
} }
export type ServiceUpdateManyMutationInput = { export type ServiceUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type ServiceUncheckedUpdateManyInput = { export type ServiceUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type ServiceNullableScalarRelationFilter = { export type ServiceNullableScalarRelationFilter = {
@@ -443,18 +495,19 @@ export type ServiceCountOrderByAggregateInput = {
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
sku?: Prisma.SortOrder sku?: Prisma.SortOrder
local_sku?: Prisma.SortOrder
barcode?: Prisma.SortOrder barcode?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder deleted_at?: Prisma.SortOrder
categoryId?: Prisma.SortOrder category_id?: Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
} }
export type ServiceAvgOrderByAggregateInput = { export type ServiceAvgOrderByAggregateInput = {
id?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
categoryId?: Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder
} }
export type ServiceMaxOrderByAggregateInput = { export type ServiceMaxOrderByAggregateInput = {
@@ -462,12 +515,15 @@ export type ServiceMaxOrderByAggregateInput = {
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
sku?: Prisma.SortOrder sku?: Prisma.SortOrder
local_sku?: Prisma.SortOrder
barcode?: Prisma.SortOrder barcode?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder deleted_at?: Prisma.SortOrder
categoryId?: Prisma.SortOrder category_id?: Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
} }
export type ServiceMinOrderByAggregateInput = { export type ServiceMinOrderByAggregateInput = {
@@ -475,18 +531,19 @@ export type ServiceMinOrderByAggregateInput = {
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
sku?: Prisma.SortOrder sku?: Prisma.SortOrder
local_sku?: Prisma.SortOrder
barcode?: Prisma.SortOrder barcode?: Prisma.SortOrder
createdAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder updated_at?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder deleted_at?: Prisma.SortOrder
categoryId?: Prisma.SortOrder category_id?: Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
account_id?: Prisma.SortOrder
complex_id?: Prisma.SortOrder
} }
export type ServiceSumOrderByAggregateInput = { export type ServiceSumOrderByAggregateInput = {
id?: Prisma.SortOrder base_sale_price?: Prisma.SortOrder
categoryId?: Prisma.SortOrder
baseSalePrice?: Prisma.SortOrder
} }
export type ServiceListRelationFilter = { export type ServiceListRelationFilter = {
@@ -499,20 +556,20 @@ export type ServiceOrderByRelationAggregateInput = {
_count?: Prisma.SortOrder _count?: Prisma.SortOrder
} }
export type ServiceCreateNestedOneWithoutSalesInvoiceItemsInput = { export type ServiceCreateNestedOneWithoutSales_invoice_itemsInput = {
create?: Prisma.XOR<Prisma.ServiceCreateWithoutSalesInvoiceItemsInput, Prisma.ServiceUncheckedCreateWithoutSalesInvoiceItemsInput> create?: Prisma.XOR<Prisma.ServiceCreateWithoutSales_invoice_itemsInput, Prisma.ServiceUncheckedCreateWithoutSales_invoice_itemsInput>
connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSalesInvoiceItemsInput connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSales_invoice_itemsInput
connect?: Prisma.ServiceWhereUniqueInput connect?: Prisma.ServiceWhereUniqueInput
} }
export type ServiceUpdateOneWithoutSalesInvoiceItemsNestedInput = { export type ServiceUpdateOneWithoutSales_invoice_itemsNestedInput = {
create?: Prisma.XOR<Prisma.ServiceCreateWithoutSalesInvoiceItemsInput, Prisma.ServiceUncheckedCreateWithoutSalesInvoiceItemsInput> create?: Prisma.XOR<Prisma.ServiceCreateWithoutSales_invoice_itemsInput, Prisma.ServiceUncheckedCreateWithoutSales_invoice_itemsInput>
connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSalesInvoiceItemsInput connectOrCreate?: Prisma.ServiceCreateOrConnectWithoutSales_invoice_itemsInput
upsert?: Prisma.ServiceUpsertWithoutSalesInvoiceItemsInput upsert?: Prisma.ServiceUpsertWithoutSales_invoice_itemsInput
disconnect?: Prisma.ServiceWhereInput | boolean disconnect?: Prisma.ServiceWhereInput | boolean
delete?: Prisma.ServiceWhereInput | boolean delete?: Prisma.ServiceWhereInput | boolean
connect?: Prisma.ServiceWhereUniqueInput connect?: Prisma.ServiceWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ServiceUpdateToOneWithWhereWithoutSalesInvoiceItemsInput, Prisma.ServiceUpdateWithoutSalesInvoiceItemsInput>, Prisma.ServiceUncheckedUpdateWithoutSalesInvoiceItemsInput> update?: Prisma.XOR<Prisma.XOR<Prisma.ServiceUpdateToOneWithWhereWithoutSales_invoice_itemsInput, Prisma.ServiceUpdateWithoutSales_invoice_itemsInput>, Prisma.ServiceUncheckedUpdateWithoutSales_invoice_itemsInput>
} }
export type ServiceCreateNestedManyWithoutCategoryInput = { export type ServiceCreateNestedManyWithoutCategoryInput = {
@@ -557,95 +614,116 @@ export type ServiceUncheckedUpdateManyWithoutCategoryNestedInput = {
deleteMany?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[] deleteMany?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[]
} }
export type ServiceCreateWithoutSalesInvoiceItemsInput = { export type ServiceCreateWithoutSales_invoice_itemsInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
account_id: string
complex_id: string
category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput category?: Prisma.ServiceCategoryCreateNestedOneWithoutServicesInput
} }
export type ServiceUncheckedCreateWithoutSalesInvoiceItemsInput = { export type ServiceUncheckedCreateWithoutSales_invoice_itemsInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
categoryId?: number | null category_id?: string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string 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 where: Prisma.ServiceWhereUniqueInput
create: Prisma.XOR<Prisma.ServiceCreateWithoutSalesInvoiceItemsInput, Prisma.ServiceUncheckedCreateWithoutSalesInvoiceItemsInput> create: Prisma.XOR<Prisma.ServiceCreateWithoutSales_invoice_itemsInput, Prisma.ServiceUncheckedCreateWithoutSales_invoice_itemsInput>
} }
export type ServiceUpsertWithoutSalesInvoiceItemsInput = { export type ServiceUpsertWithoutSales_invoice_itemsInput = {
update: Prisma.XOR<Prisma.ServiceUpdateWithoutSalesInvoiceItemsInput, Prisma.ServiceUncheckedUpdateWithoutSalesInvoiceItemsInput> update: Prisma.XOR<Prisma.ServiceUpdateWithoutSales_invoice_itemsInput, Prisma.ServiceUncheckedUpdateWithoutSales_invoice_itemsInput>
create: Prisma.XOR<Prisma.ServiceCreateWithoutSalesInvoiceItemsInput, Prisma.ServiceUncheckedCreateWithoutSalesInvoiceItemsInput> create: Prisma.XOR<Prisma.ServiceCreateWithoutSales_invoice_itemsInput, Prisma.ServiceUncheckedCreateWithoutSales_invoice_itemsInput>
where?: Prisma.ServiceWhereInput where?: Prisma.ServiceWhereInput
} }
export type ServiceUpdateToOneWithWhereWithoutSalesInvoiceItemsInput = { export type ServiceUpdateToOneWithWhereWithoutSales_invoice_itemsInput = {
where?: Prisma.ServiceWhereInput where?: Prisma.ServiceWhereInput
data: Prisma.XOR<Prisma.ServiceUpdateWithoutSalesInvoiceItemsInput, Prisma.ServiceUncheckedUpdateWithoutSalesInvoiceItemsInput> data: Prisma.XOR<Prisma.ServiceUpdateWithoutSales_invoice_itemsInput, Prisma.ServiceUncheckedUpdateWithoutSales_invoice_itemsInput>
} }
export type ServiceUpdateWithoutSalesInvoiceItemsInput = { export type ServiceUpdateWithoutSales_invoice_itemsInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput category?: Prisma.ServiceCategoryUpdateOneWithoutServicesNestedInput
} }
export type ServiceUncheckedUpdateWithoutSalesInvoiceItemsInput = { export type ServiceUncheckedUpdateWithoutSales_invoice_itemsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
} }
export type ServiceCreateWithoutCategoryInput = { export type ServiceCreateWithoutCategoryInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput account_id: string
complex_id: string
sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutServiceInput
} }
export type ServiceUncheckedCreateWithoutCategoryInput = { export type ServiceUncheckedCreateWithoutCategoryInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput account_id: string
complex_id: string
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutServiceInput
} }
export type ServiceCreateOrConnectWithoutCategoryInput = { export type ServiceCreateOrConnectWithoutCategoryInput = {
@@ -678,65 +756,81 @@ export type ServiceScalarWhereInput = {
AND?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[] AND?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[]
OR?: Prisma.ServiceScalarWhereInput[] OR?: Prisma.ServiceScalarWhereInput[]
NOT?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[] NOT?: Prisma.ServiceScalarWhereInput | Prisma.ServiceScalarWhereInput[]
id?: Prisma.IntFilter<"Service"> | number id?: Prisma.StringFilter<"Service"> | string
name?: Prisma.StringFilter<"Service"> | string name?: Prisma.StringFilter<"Service"> | string
description?: Prisma.StringNullableFilter<"Service"> | string | null description?: Prisma.StringNullableFilter<"Service"> | string | null
sku?: Prisma.StringFilter<"Service"> | string sku?: Prisma.StringFilter<"Service"> | string
local_sku?: Prisma.StringNullableFilter<"Service"> | string | null
barcode?: Prisma.StringNullableFilter<"Service"> | string | null barcode?: Prisma.StringNullableFilter<"Service"> | string | null
createdAt?: Prisma.DateTimeFilter<"Service"> | Date | string created_at?: Prisma.DateTimeFilter<"Service"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Service"> | Date | string updated_at?: Prisma.DateTimeFilter<"Service"> | Date | string
deletedAt?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null deleted_at?: Prisma.DateTimeNullableFilter<"Service"> | Date | string | null
categoryId?: Prisma.IntNullableFilter<"Service"> | number | null category_id?: Prisma.StringNullableFilter<"Service"> | string | null
baseSalePrice?: Prisma.DecimalFilter<"Service"> | runtime.Decimal | runtime.DecimalJsLike | number | string 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 = { export type ServiceCreateManyCategoryInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
sku: string sku: string
local_sku?: string | null
barcode?: string | null barcode?: string | null
createdAt?: Date | string created_at?: Date | string
updatedAt?: Date | string updated_at?: Date | string
deletedAt?: Date | string | null deleted_at?: Date | string | null
baseSalePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string
account_id: string
complex_id: string
} }
export type ServiceUpdateWithoutCategoryInput = { export type ServiceUpdateWithoutCategoryInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutServiceNestedInput
} }
export type ServiceUncheckedUpdateWithoutCategoryInput = { export type ServiceUncheckedUpdateWithoutCategoryInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput account_id?: Prisma.StringFieldUpdateOperationsInput | string
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutServiceNestedInput
} }
export type ServiceUncheckedUpdateManyWithoutCategoryInput = { export type ServiceUncheckedUpdateManyWithoutCategoryInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.StringFieldUpdateOperationsInput | string sku?: Prisma.StringFieldUpdateOperationsInput | string
local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
baseSalePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string 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 = { export type ServiceCountOutputType = {
salesInvoiceItems: number sales_invoice_items: number
} }
export type ServiceCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type ServiceCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
salesInvoiceItems?: boolean | ServiceCountOutputTypeCountSalesInvoiceItemsArgs sales_invoice_items?: boolean | ServiceCountOutputTypeCountSales_invoice_itemsArgs
} }
/** /**
@@ -765,7 +859,7 @@ export type ServiceCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Exte
/** /**
* ServiceCountOutputType without action * ServiceCountOutputType without action
*/ */
export type ServiceCountOutputTypeCountSalesInvoiceItemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type ServiceCountOutputTypeCountSales_invoice_itemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.SalesInvoiceItemWhereInput where?: Prisma.SalesInvoiceItemWhereInput
} }
@@ -775,14 +869,17 @@ export type ServiceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
name?: boolean name?: boolean
description?: boolean description?: boolean
sku?: boolean sku?: boolean
local_sku?: boolean
barcode?: boolean barcode?: boolean
createdAt?: boolean created_at?: boolean
updatedAt?: boolean updated_at?: boolean
deletedAt?: boolean deleted_at?: boolean
categoryId?: boolean category_id?: boolean
baseSalePrice?: boolean base_sale_price?: boolean
account_id?: boolean
complex_id?: boolean
category?: boolean | Prisma.Service$categoryArgs<ExtArgs> category?: boolean | Prisma.Service$categoryArgs<ExtArgs>
salesInvoiceItems?: boolean | Prisma.Service$salesInvoiceItemsArgs<ExtArgs> sales_invoice_items?: boolean | Prisma.Service$sales_invoice_itemsArgs<ExtArgs>
_count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["service"]> }, ExtArgs["result"]["service"]>
@@ -793,18 +890,21 @@ export type ServiceSelectScalar = {
name?: boolean name?: boolean
description?: boolean description?: boolean
sku?: boolean sku?: boolean
local_sku?: boolean
barcode?: boolean barcode?: boolean
createdAt?: boolean created_at?: boolean
updatedAt?: boolean updated_at?: boolean
deletedAt?: boolean deleted_at?: boolean
categoryId?: boolean category_id?: boolean
baseSalePrice?: boolean base_sale_price?: boolean
account_id?: boolean
complex_id?: boolean
} }
export type ServiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "barcode" | "createdAt" | "updatedAt" | "deletedAt" | "categoryId" | "baseSalePrice", ExtArgs["result"]["service"]> export type ServiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = 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<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type ServiceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
category?: boolean | Prisma.Service$categoryArgs<ExtArgs> category?: boolean | Prisma.Service$categoryArgs<ExtArgs>
salesInvoiceItems?: boolean | Prisma.Service$salesInvoiceItemsArgs<ExtArgs> sales_invoice_items?: boolean | Prisma.Service$sales_invoice_itemsArgs<ExtArgs>
_count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.ServiceCountOutputTypeDefaultArgs<ExtArgs>
} }
@@ -812,19 +912,22 @@ export type $ServicePayload<ExtArgs extends runtime.Types.Extensions.InternalArg
name: "Service" name: "Service"
objects: { objects: {
category: Prisma.$ServiceCategoryPayload<ExtArgs> | null category: Prisma.$ServiceCategoryPayload<ExtArgs> | null
salesInvoiceItems: Prisma.$SalesInvoiceItemPayload<ExtArgs>[] sales_invoice_items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
name: string name: string
description: string | null description: string | null
sku: string sku: string
local_sku: string | null
barcode: string | null barcode: string | null
createdAt: Date created_at: Date
updatedAt: Date updated_at: Date
deletedAt: Date | null deleted_at: Date | null
categoryId: number | null category_id: string | null
baseSalePrice: runtime.Decimal base_sale_price: runtime.Decimal
account_id: string
complex_id: string
}, ExtArgs["result"]["service"]> }, ExtArgs["result"]["service"]>
composites: {} composites: {}
} }
@@ -1166,7 +1269,7 @@ readonly fields: ServiceFieldRefs;
export interface Prisma__ServiceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> { export interface Prisma__ServiceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: "PrismaPromise" readonly [Symbol.toStringTag]: "PrismaPromise"
category<T extends Prisma.Service$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$categoryArgs<ExtArgs>>): Prisma.Prisma__ServiceCategoryClient<runtime.Types.Result.GetResult<Prisma.$ServiceCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> category<T extends Prisma.Service$categoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$categoryArgs<ExtArgs>>): Prisma.Prisma__ServiceCategoryClient<runtime.Types.Result.GetResult<Prisma.$ServiceCategoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
salesInvoiceItems<T extends Prisma.Service$salesInvoiceItemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$salesInvoiceItemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> sales_invoice_items<T extends Prisma.Service$sales_invoice_itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Service$sales_invoice_itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1196,16 +1299,19 @@ export interface Prisma__ServiceClient<T, Null = never, ExtArgs extends runtime.
* Fields of the Service model * Fields of the Service model
*/ */
export interface ServiceFieldRefs { export interface ServiceFieldRefs {
readonly id: Prisma.FieldRef<"Service", 'Int'> readonly id: Prisma.FieldRef<"Service", 'String'>
readonly name: Prisma.FieldRef<"Service", 'String'> readonly name: Prisma.FieldRef<"Service", 'String'>
readonly description: Prisma.FieldRef<"Service", 'String'> readonly description: Prisma.FieldRef<"Service", 'String'>
readonly sku: Prisma.FieldRef<"Service", 'String'> readonly sku: Prisma.FieldRef<"Service", 'String'>
readonly local_sku: Prisma.FieldRef<"Service", 'String'>
readonly barcode: Prisma.FieldRef<"Service", 'String'> readonly barcode: Prisma.FieldRef<"Service", 'String'>
readonly createdAt: Prisma.FieldRef<"Service", 'DateTime'> readonly created_at: Prisma.FieldRef<"Service", 'DateTime'>
readonly updatedAt: Prisma.FieldRef<"Service", 'DateTime'> readonly updated_at: Prisma.FieldRef<"Service", 'DateTime'>
readonly deletedAt: Prisma.FieldRef<"Service", 'DateTime'> readonly deleted_at: Prisma.FieldRef<"Service", 'DateTime'>
readonly categoryId: Prisma.FieldRef<"Service", 'Int'> readonly category_id: Prisma.FieldRef<"Service", 'String'>
readonly baseSalePrice: Prisma.FieldRef<"Service", 'Decimal'> 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<ExtArgs extends runtime.Types.Extensions.Intern
} }
/** /**
* Service.salesInvoiceItems * Service.sales_invoice_items
*/ */
export type Service$salesInvoiceItemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type Service$sales_invoice_itemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/** /**
* Select specific fields to fetch from the SalesInvoiceItem * Select specific fields to fetch from the SalesInvoiceItem
*/ */
+200 -179
View File
@@ -20,88 +20,82 @@ export type ServiceCategoryModel = runtime.Types.Result.DefaultSelection<Prisma.
export type AggregateServiceCategory = { export type AggregateServiceCategory = {
_count: ServiceCategoryCountAggregateOutputType | null _count: ServiceCategoryCountAggregateOutputType | null
_avg: ServiceCategoryAvgAggregateOutputType | null
_sum: ServiceCategorySumAggregateOutputType | null
_min: ServiceCategoryMinAggregateOutputType | null _min: ServiceCategoryMinAggregateOutputType | null
_max: ServiceCategoryMaxAggregateOutputType | null _max: ServiceCategoryMaxAggregateOutputType | null
} }
export type ServiceCategoryAvgAggregateOutputType = {
id: number | null
}
export type ServiceCategorySumAggregateOutputType = {
id: number | null
}
export type ServiceCategoryMinAggregateOutputType = { export type ServiceCategoryMinAggregateOutputType = {
id: number | null id: string | null
name: string | null name: string | null
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date | null account_id: string | null
updatedAt: Date | null complex_id: string | null
deletedAt: Date | null created_at: Date | null
updated_at: Date | null
deleted_at: Date | null
} }
export type ServiceCategoryMaxAggregateOutputType = { export type ServiceCategoryMaxAggregateOutputType = {
id: number | null id: string | null
name: string | null name: string | null
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date | null account_id: string | null
updatedAt: Date | null complex_id: string | null
deletedAt: Date | null created_at: Date | null
updated_at: Date | null
deleted_at: Date | null
} }
export type ServiceCategoryCountAggregateOutputType = { export type ServiceCategoryCountAggregateOutputType = {
id: number id: number
name: number name: number
description: number description: number
imageUrl: number image_url: number
createdAt: number account_id: number
updatedAt: number complex_id: number
deletedAt: number created_at: number
updated_at: number
deleted_at: number
_all: number _all: number
} }
export type ServiceCategoryAvgAggregateInputType = {
id?: true
}
export type ServiceCategorySumAggregateInputType = {
id?: true
}
export type ServiceCategoryMinAggregateInputType = { export type ServiceCategoryMinAggregateInputType = {
id?: true id?: true
name?: true name?: true
description?: true description?: true
imageUrl?: true image_url?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
} }
export type ServiceCategoryMaxAggregateInputType = { export type ServiceCategoryMaxAggregateInputType = {
id?: true id?: true
name?: true name?: true
description?: true description?: true
imageUrl?: true image_url?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
} }
export type ServiceCategoryCountAggregateInputType = { export type ServiceCategoryCountAggregateInputType = {
id?: true id?: true
name?: true name?: true
description?: true description?: true
imageUrl?: true image_url?: true
createdAt?: true account_id?: true
updatedAt?: true complex_id?: true
deletedAt?: true created_at?: true
updated_at?: true
deleted_at?: true
_all?: true _all?: true
} }
@@ -140,18 +134,6 @@ export type ServiceCategoryAggregateArgs<ExtArgs extends runtime.Types.Extension
* Count returned ServiceCategories * Count returned ServiceCategories
**/ **/
_count?: true | ServiceCategoryCountAggregateInputType _count?: true | ServiceCategoryCountAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
**/
_avg?: ServiceCategoryAvgAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
**/
_sum?: ServiceCategorySumAggregateInputType
/** /**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
* *
@@ -185,23 +167,21 @@ export type ServiceCategoryGroupByArgs<ExtArgs extends runtime.Types.Extensions.
take?: number take?: number
skip?: number skip?: number
_count?: ServiceCategoryCountAggregateInputType | true _count?: ServiceCategoryCountAggregateInputType | true
_avg?: ServiceCategoryAvgAggregateInputType
_sum?: ServiceCategorySumAggregateInputType
_min?: ServiceCategoryMinAggregateInputType _min?: ServiceCategoryMinAggregateInputType
_max?: ServiceCategoryMaxAggregateInputType _max?: ServiceCategoryMaxAggregateInputType
} }
export type ServiceCategoryGroupByOutputType = { export type ServiceCategoryGroupByOutputType = {
id: number id: string
name: string name: string
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date account_id: string
updatedAt: Date complex_id: string
deletedAt: Date | null created_at: Date
updated_at: Date
deleted_at: Date | null
_count: ServiceCategoryCountAggregateOutputType | null _count: ServiceCategoryCountAggregateOutputType | null
_avg: ServiceCategoryAvgAggregateOutputType | null
_sum: ServiceCategorySumAggregateOutputType | null
_min: ServiceCategoryMinAggregateOutputType | null _min: ServiceCategoryMinAggregateOutputType | null
_max: ServiceCategoryMaxAggregateOutputType | null _max: ServiceCategoryMaxAggregateOutputType | null
} }
@@ -225,13 +205,15 @@ export type ServiceCategoryWhereInput = {
AND?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[] AND?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[]
OR?: Prisma.ServiceCategoryWhereInput[] OR?: Prisma.ServiceCategoryWhereInput[]
NOT?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[] NOT?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[]
id?: Prisma.IntFilter<"ServiceCategory"> | number id?: Prisma.StringFilter<"ServiceCategory"> | string
name?: Prisma.StringFilter<"ServiceCategory"> | string name?: Prisma.StringFilter<"ServiceCategory"> | string
description?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null description?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null
imageUrl?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null image_url?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null
createdAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string account_id?: Prisma.StringFilter<"ServiceCategory"> | string
updatedAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string complex_id?: Prisma.StringFilter<"ServiceCategory"> | string
deletedAt?: Prisma.DateTimeNullableFilter<"ServiceCategory"> | Date | string | null 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 services?: Prisma.ServiceListRelationFilter
} }
@@ -239,25 +221,29 @@ export type ServiceCategoryOrderByWithRelationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder image_url?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
services?: Prisma.ServiceOrderByRelationAggregateInput services?: Prisma.ServiceOrderByRelationAggregateInput
_relevance?: Prisma.ServiceCategoryOrderByRelevanceInput _relevance?: Prisma.ServiceCategoryOrderByRelevanceInput
} }
export type ServiceCategoryWhereUniqueInput = Prisma.AtLeast<{ export type ServiceCategoryWhereUniqueInput = Prisma.AtLeast<{
id?: number id?: string
AND?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[] AND?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[]
OR?: Prisma.ServiceCategoryWhereInput[] OR?: Prisma.ServiceCategoryWhereInput[]
NOT?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[] NOT?: Prisma.ServiceCategoryWhereInput | Prisma.ServiceCategoryWhereInput[]
name?: Prisma.StringFilter<"ServiceCategory"> | string name?: Prisma.StringFilter<"ServiceCategory"> | string
description?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null description?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null
imageUrl?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null image_url?: Prisma.StringNullableFilter<"ServiceCategory"> | string | null
createdAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string account_id?: Prisma.StringFilter<"ServiceCategory"> | string
updatedAt?: Prisma.DateTimeFilter<"ServiceCategory"> | Date | string complex_id?: Prisma.StringFilter<"ServiceCategory"> | string
deletedAt?: Prisma.DateTimeNullableFilter<"ServiceCategory"> | Date | string | null 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 services?: Prisma.ServiceListRelationFilter
}, "id"> }, "id">
@@ -265,99 +251,118 @@ export type ServiceCategoryOrderByWithAggregationInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder
imageUrl?: Prisma.SortOrderInput | Prisma.SortOrder image_url?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.ServiceCategoryCountOrderByAggregateInput _count?: Prisma.ServiceCategoryCountOrderByAggregateInput
_avg?: Prisma.ServiceCategoryAvgOrderByAggregateInput
_max?: Prisma.ServiceCategoryMaxOrderByAggregateInput _max?: Prisma.ServiceCategoryMaxOrderByAggregateInput
_min?: Prisma.ServiceCategoryMinOrderByAggregateInput _min?: Prisma.ServiceCategoryMinOrderByAggregateInput
_sum?: Prisma.ServiceCategorySumOrderByAggregateInput
} }
export type ServiceCategoryScalarWhereWithAggregatesInput = { export type ServiceCategoryScalarWhereWithAggregatesInput = {
AND?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput | Prisma.ServiceCategoryScalarWhereWithAggregatesInput[] AND?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput | Prisma.ServiceCategoryScalarWhereWithAggregatesInput[]
OR?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput[] OR?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput[]
NOT?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput | Prisma.ServiceCategoryScalarWhereWithAggregatesInput[] NOT?: Prisma.ServiceCategoryScalarWhereWithAggregatesInput | Prisma.ServiceCategoryScalarWhereWithAggregatesInput[]
id?: Prisma.IntWithAggregatesFilter<"ServiceCategory"> | number id?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string
name?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string name?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string
description?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null description?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null
imageUrl?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null image_url?: Prisma.StringNullableWithAggregatesFilter<"ServiceCategory"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"ServiceCategory"> | Date | string account_id?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"ServiceCategory"> | Date | string complex_id?: Prisma.StringWithAggregatesFilter<"ServiceCategory"> | string
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ServiceCategory"> | Date | string | null 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 = { export type ServiceCategoryCreateInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
services?: Prisma.ServiceCreateNestedManyWithoutCategoryInput services?: Prisma.ServiceCreateNestedManyWithoutCategoryInput
} }
export type ServiceCategoryUncheckedCreateInput = { export type ServiceCategoryUncheckedCreateInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
services?: Prisma.ServiceUncheckedCreateNestedManyWithoutCategoryInput services?: Prisma.ServiceUncheckedCreateNestedManyWithoutCategoryInput
} }
export type ServiceCategoryUpdateInput = { export type ServiceCategoryUpdateInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
services?: Prisma.ServiceUpdateManyWithoutCategoryNestedInput services?: Prisma.ServiceUpdateManyWithoutCategoryNestedInput
} }
export type ServiceCategoryUncheckedUpdateInput = { export type ServiceCategoryUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
services?: Prisma.ServiceUncheckedUpdateManyWithoutCategoryNestedInput services?: Prisma.ServiceUncheckedUpdateManyWithoutCategoryNestedInput
} }
export type ServiceCategoryCreateManyInput = { export type ServiceCategoryCreateManyInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type ServiceCategoryUpdateManyMutationInput = { export type ServiceCategoryUpdateManyMutationInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type ServiceCategoryUncheckedUpdateManyInput = { export type ServiceCategoryUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type ServiceCategoryNullableScalarRelationFilter = { export type ServiceCategoryNullableScalarRelationFilter = {
@@ -375,38 +380,36 @@ export type ServiceCategoryCountOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
imageUrl?: Prisma.SortOrder image_url?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
export type ServiceCategoryAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
} }
export type ServiceCategoryMaxOrderByAggregateInput = { export type ServiceCategoryMaxOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
imageUrl?: Prisma.SortOrder image_url?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
} }
export type ServiceCategoryMinOrderByAggregateInput = { export type ServiceCategoryMinOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
name?: Prisma.SortOrder name?: Prisma.SortOrder
description?: Prisma.SortOrder description?: Prisma.SortOrder
imageUrl?: Prisma.SortOrder image_url?: Prisma.SortOrder
createdAt?: Prisma.SortOrder account_id?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder complex_id?: Prisma.SortOrder
deletedAt?: Prisma.SortOrder created_at?: Prisma.SortOrder
} updated_at?: Prisma.SortOrder
deleted_at?: Prisma.SortOrder
export type ServiceCategorySumOrderByAggregateInput = {
id?: Prisma.SortOrder
} }
export type ServiceCategoryCreateNestedOneWithoutServicesInput = { export type ServiceCategoryCreateNestedOneWithoutServicesInput = {
@@ -426,22 +429,27 @@ export type ServiceCategoryUpdateOneWithoutServicesNestedInput = {
} }
export type ServiceCategoryCreateWithoutServicesInput = { export type ServiceCategoryCreateWithoutServicesInput = {
id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type ServiceCategoryUncheckedCreateWithoutServicesInput = { export type ServiceCategoryUncheckedCreateWithoutServicesInput = {
id?: number id?: string
name: string name: string
description?: string | null description?: string | null
imageUrl?: string | null image_url?: string | null
createdAt?: Date | string account_id: string
updatedAt?: Date | string complex_id: string
deletedAt?: Date | string | null created_at?: Date | string
updated_at?: Date | string
deleted_at?: Date | string | null
} }
export type ServiceCategoryCreateOrConnectWithoutServicesInput = { export type ServiceCategoryCreateOrConnectWithoutServicesInput = {
@@ -461,22 +469,27 @@ export type ServiceCategoryUpdateToOneWithWhereWithoutServicesInput = {
} }
export type ServiceCategoryUpdateWithoutServicesInput = { export type ServiceCategoryUpdateWithoutServicesInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
} }
export type ServiceCategoryUncheckedUpdateWithoutServicesInput = { export type ServiceCategoryUncheckedUpdateWithoutServicesInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
imageUrl?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string account_id?: Prisma.StringFieldUpdateOperationsInput | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string complex_id?: Prisma.StringFieldUpdateOperationsInput | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null 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<ExtArgs extends runtime.Types.Extensions.Inter
id?: boolean id?: boolean
name?: boolean name?: boolean
description?: boolean description?: boolean
imageUrl?: boolean image_url?: boolean
createdAt?: boolean account_id?: boolean
updatedAt?: boolean complex_id?: boolean
deletedAt?: boolean created_at?: boolean
updated_at?: boolean
deleted_at?: boolean
services?: boolean | Prisma.ServiceCategory$servicesArgs<ExtArgs> services?: boolean | Prisma.ServiceCategory$servicesArgs<ExtArgs>
_count?: boolean | Prisma.ServiceCategoryCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.ServiceCategoryCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["serviceCategory"]> }, ExtArgs["result"]["serviceCategory"]>
@@ -528,13 +543,15 @@ export type ServiceCategorySelectScalar = {
id?: boolean id?: boolean
name?: boolean name?: boolean
description?: boolean description?: boolean
imageUrl?: boolean image_url?: boolean
createdAt?: boolean account_id?: boolean
updatedAt?: boolean complex_id?: boolean
deletedAt?: boolean created_at?: boolean
updated_at?: boolean
deleted_at?: boolean
} }
export type ServiceCategoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "imageUrl" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["serviceCategory"]> export type ServiceCategoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = 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<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type ServiceCategoryInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
services?: boolean | Prisma.ServiceCategory$servicesArgs<ExtArgs> services?: boolean | Prisma.ServiceCategory$servicesArgs<ExtArgs>
_count?: boolean | Prisma.ServiceCategoryCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.ServiceCategoryCountOutputTypeDefaultArgs<ExtArgs>
@@ -546,13 +563,15 @@ export type $ServiceCategoryPayload<ExtArgs extends runtime.Types.Extensions.Int
services: Prisma.$ServicePayload<ExtArgs>[] services: Prisma.$ServicePayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: string
name: string name: string
description: string | null description: string | null
imageUrl: string | null image_url: string | null
createdAt: Date account_id: string
updatedAt: Date complex_id: string
deletedAt: Date | null created_at: Date
updated_at: Date
deleted_at: Date | null
}, ExtArgs["result"]["serviceCategory"]> }, ExtArgs["result"]["serviceCategory"]>
composites: {} composites: {}
} }
@@ -923,13 +942,15 @@ export interface Prisma__ServiceCategoryClient<T, Null = never, ExtArgs extends
* Fields of the ServiceCategory model * Fields of the ServiceCategory model
*/ */
export interface ServiceCategoryFieldRefs { export interface ServiceCategoryFieldRefs {
readonly id: Prisma.FieldRef<"ServiceCategory", 'Int'> readonly id: Prisma.FieldRef<"ServiceCategory", 'String'>
readonly name: Prisma.FieldRef<"ServiceCategory", 'String'> readonly name: Prisma.FieldRef<"ServiceCategory", 'String'>
readonly description: Prisma.FieldRef<"ServiceCategory", 'String'> readonly description: Prisma.FieldRef<"ServiceCategory", 'String'>
readonly imageUrl: Prisma.FieldRef<"ServiceCategory", 'String'> readonly image_url: Prisma.FieldRef<"ServiceCategory", 'String'>
readonly createdAt: Prisma.FieldRef<"ServiceCategory", 'DateTime'> readonly account_id: Prisma.FieldRef<"ServiceCategory", 'String'>
readonly updatedAt: Prisma.FieldRef<"ServiceCategory", 'DateTime'> readonly complex_id: Prisma.FieldRef<"ServiceCategory", 'String'>
readonly deletedAt: Prisma.FieldRef<"ServiceCategory", 'DateTime'> readonly created_at: Prisma.FieldRef<"ServiceCategory", 'DateTime'>
readonly updated_at: Prisma.FieldRef<"ServiceCategory", 'DateTime'>
readonly deleted_at: Prisma.FieldRef<"ServiceCategory", 'DateTime'>
} }
@@ -331,6 +331,14 @@ export type TriggerLogSumOrderByAggregateInput = {
id?: Prisma.SortOrder id?: Prisma.SortOrder
} }
export type IntFieldUpdateOperationsInput = {
set?: number
increment?: number
decrement?: number
multiply?: number
divide?: number
}
export type TriggerLogSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type TriggerLogSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
+19 -4
View File
@@ -1,24 +1,37 @@
import { ValidationPipe, VersioningType } from '@nestjs/common' 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 { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { AppModule } from './app.module' import { AppModule } from './app.module'
import { PrismaExceptionFilter } from './common/filters/prisma-exception.filter' import { PrismaExceptionFilter } from './common/filters/prisma-exception.filter'
import { LoggingInterceptor } from './common/interceptors/logging.interceptor' import { LoggingInterceptor } from './common/interceptors/logging.interceptor'
import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor' import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor'
import { JwtAuthGuard } from './modules/auth/jwt-auth.guard'
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create(AppModule) const app = await NestFactory.create(AppModule)
const cookieParser = (await import('cookie-parser')).default
app.use(cookieParser())
const config = new DocumentBuilder() const config = new DocumentBuilder()
.setTitle('Pos') .setTitle('Pos')
.setDescription('The Pos API description') .setDescription('The Pos API description')
.setVersion('1.0') .setVersion('1.0')
.addTag('pos') .addTag('pos')
.addBearerAuth({
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
name: 'Authorization',
description: 'Enter JWT token',
in: 'header',
})
.build() .build()
const documentFactory = () => SwaggerModule.createDocument(app, config) const documentFactory = () => SwaggerModule.createDocument(app, config)
SwaggerModule.setup('swagger', app, documentFactory) 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.setGlobalPrefix('api')
app.enableVersioning({ app.enableVersioning({
type: VersioningType.URI, 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. // 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. // 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 const envOrigins = process.env.CORS_ORIGINS
? process.env.CORS_ORIGINS.split(',') ? process.env.CORS_ORIGINS.split(',')
.map(s => s.trim()) .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 // Register global exception filter to map Prisma and validation errors to proper HTTP codes
app.useGlobalFilters(new PrismaExceptionFilter()) 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() bootstrap()
+34 -26
View File
@@ -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 { ApiTags } from '@nestjs/swagger'
import { ResponseMapper } from '../common/response/response-mapper'
import { AuthService } from './auth.service' import { AuthService } from './auth.service'
import { CurrentUser } from './current-user.decorator' import { reqTokenPayload } 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'
@ApiTags('auth') @ApiTags('auth')
@Controller('auth') @Controller('auth')
export class AuthController { export class AuthController {
constructor(private readonly auth: AuthService) {} constructor(private readonly auth: AuthService) {}
@Post('send-code') // @Public()
async sendCode(@Body() dto: SendCodeDto) { // @Post('send_code')
return this.auth.sendCode(dto) // async sendCode(@Body() dto: SendCodeDto) {
} // return this.auth.sendCode(dto)
// }
@Post('login') // @Public()
async login(@Body() dto: VerifyCodeDto) { // @Post('login')
return this.auth.loginWithCode(dto) // 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') // @Post('refresh')
async refresh(@Body() dto: RefreshTokenDto) { // async refresh(@Body() dto: RefreshTokenDto) {
return this.auth.refreshToken(dto) // return this.auth.refreshToken(dto)
} // }
@Post('logout') // @Post('logout')
async logout(@Body() dto: RefreshTokenDto) { // async logout(@Body() dto: RefreshTokenDto) {
return this.auth.logout(dto.refreshToken) // return this.auth.logout(dto.refreshToken)
} // }
@Get('me') @Get('me')
@UseGuards(JwtAuthGuard) async me(@reqTokenPayload() user: any) {
async me(@CurrentUser() user: any) { return this.auth.me(user.username)
return ResponseMapper.single(user)
} }
} }
+3 -4
View File
@@ -2,10 +2,9 @@ import { Module } from '@nestjs/common'
import { JwtModule } from '@nestjs/jwt' import { JwtModule } from '@nestjs/jwt'
import 'dotenv/config' import 'dotenv/config'
import { env } from 'prisma/config' import { env } from 'prisma/config'
import { PrismaModule } from '../prisma/prisma.module' import { PrismaModule } from '../../prisma/prisma.module'
import { AuthController } from './auth.controller' import { AuthController } from './auth.controller'
import { AuthService } from './auth.service' import { AuthService } from './auth.service'
import { JwtAuthGuard } from './jwt-auth.guard'
@Module({ @Module({
imports: [ imports: [
@@ -15,8 +14,8 @@ import { JwtAuthGuard } from './jwt-auth.guard'
signOptions: { expiresIn: Number(env('JWT_EXPIRES_IN')) || '15m' }, signOptions: { expiresIn: Number(env('JWT_EXPIRES_IN')) || '15m' },
}), }),
], ],
providers: [AuthService, JwtAuthGuard], providers: [AuthService],
controllers: [AuthController], controllers: [AuthController],
exports: [AuthService, JwtAuthGuard], exports: [AuthService, JwtModule],
}) })
export class AuthModule {} export class AuthModule {}
+151 -110
View File
@@ -1,126 +1,167 @@
import { import { Injectable } from '@nestjs/common'
BadRequestException,
Injectable,
NotFoundException,
UnauthorizedException,
} from '@nestjs/common'
import { JwtService } from '@nestjs/jwt' import { JwtService } from '@nestjs/jwt'
import { createHash, randomBytes } from 'crypto'
import 'dotenv/config' import 'dotenv/config'
import { env } from 'prisma/config' import { ResponseMapper } from '../../common/response/response-mapper'
import { ResponseMapper } from '../common/response/response-mapper' import { PrismaService } from '../../prisma/prisma.service'
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'
@Injectable() @Injectable()
export class AuthService { export class AuthService {
private readonly OTP_TTL_MINUTES = 2 // private readonly OTP_TTL_MINUTES = 2
private readonly ACCESS_TOKEN_EXP = Number(env('JWT_EXPIRES_IN')) || '15m' // private readonly ACCESS_TOKEN_EXP = Number(env('JWT_EXPIRES_IN')) || '150m'
private readonly REFRESH_TOKEN_EXP_DAYS = 30 // private readonly REFRESH_TOKEN_EXP_DAYS = 30
constructor( constructor(
private prisma: PrismaService, private prisma: PrismaService,
private jwt: JwtService, private jwt: JwtService,
) {} ) {}
private generateCode() { // private generateCode() {
// For development you may want fixed code via env, otherwise random 5-digit // // For development you may want fixed code via env, otherwise random 5-digit
const staticCode = process.env.OTP_STATIC_CODE // const staticCode = process.env.OTP_STATIC_CODE
if (staticCode) return staticCode // if (staticCode) return staticCode
return Math.floor(10000 + Math.random() * 90000).toString() // return Math.floor(10000 + Math.random() * 90000).toString()
} // }
async sendCode(dto: SendCodeDto) { // // @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.
const { mobileNumber } = dto // async sendCode(dto: SendCodeDto) {
const user = await this.prisma.user.findFirst({ where: { mobileNumber } }) // const { mobile_number } = dto
if (!user) { // const account = await this.prisma.account.findFirst({
throw new NotFoundException('کاربری با این شماره تماس یافت نشد') // where: {
} // user: {
const code = this.generateCode() // mobile_number,
const expiresAt = new Date(Date.now() + this.OTP_TTL_MINUTES * 60 * 1000) // },
// },
// })
// console.log(mobile_number)
await this.prisma.otpCode.create({ // if (!account) {
data: { // throw new NotFoundException('کاربری با این شماره تماس یافت نشد')
mobileNumber, // }
code,
expiresAt, // 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 }
} }
} }
+3 -2
View File
@@ -1,8 +1,9 @@
import { createParamDecorator, ExecutionContext } from '@nestjs/common' 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) => { (data: unknown, ctx: ExecutionContext) => {
const req = ctx.switchToHttp().getRequest() const req = ctx.switchToHttp().getRequest()
return req.user return req.dataPayload as AccessTokenPayload
}, },
) )
+2 -2
View File
@@ -2,11 +2,11 @@ import { ApiProperty } from '@nestjs/swagger'
import { IsString } from 'class-validator' import { IsString } from 'class-validator'
export class LoginDto { export class LoginDto {
@ApiProperty({ description: 'Mobile number used as username', example: '09123456789' }) @ApiProperty({ description: 'Mobile number used as username', example: '09120258156' })
@IsString() @IsString()
mobileNumber: string mobileNumber: string
@ApiProperty({ description: 'OTP password (one-time password)', example: '12345' }) @ApiProperty({ description: 'OTP password (one-time password)', example: '11111' })
@IsString() @IsString()
password: string password: string
} }
+2 -2
View File
@@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger'
import { IsString } from 'class-validator' import { IsString } from 'class-validator'
export class SendCodeDto { export class SendCodeDto {
@ApiProperty({ example: '09123456789' }) @ApiProperty({ example: '09120258156' })
@IsString() @IsString()
mobileNumber: string mobile_number: string
} }
+3 -3
View File
@@ -2,11 +2,11 @@ import { ApiProperty } from '@nestjs/swagger'
import { IsString } from 'class-validator' import { IsString } from 'class-validator'
export class VerifyCodeDto { export class VerifyCodeDto {
@ApiProperty({ example: '09123456789' }) @ApiProperty({ example: '09120258156' })
@IsString() @IsString()
mobileNumber: string mobile_number: string
@ApiProperty({ example: '12345' }) @ApiProperty({ example: '11111' })
@IsString() @IsString()
code: string code: string
} }
+37 -10
View File
@@ -4,31 +4,58 @@ import {
Injectable, Injectable,
UnauthorizedException, UnauthorizedException,
} from '@nestjs/common' } from '@nestjs/common'
import { Reflector } from '@nestjs/core'
import { JwtService } from '@nestjs/jwt' 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() @Injectable()
export class JwtAuthGuard implements CanActivate { export class JwtAuthGuard implements CanActivate {
constructor(private jwt: JwtService) {} constructor(
private jwt: JwtService,
private reflector: Reflector,
) {}
async canActivate(context: ExecutionContext): Promise<boolean> { async canActivate(context: ExecutionContext): Promise<boolean> {
const req = context.switchToHttp().getRequest<Request>() const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [
const auth = req.headers.authorization context.getHandler(),
if (!auth) throw new UnauthorizedException('Missing Authorization header') context.getClass(),
])
if (isPublic) return true
const parts = auth.split(' ') const req = context.switchToHttp().getRequest<IWithJWTPayloadRequest>()
if (parts.length !== 2 || parts[0] !== 'Bearer') {
throw new UnauthorizedException('Invalid Authorization header format') // 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 { try {
const payload = this.jwt.verify(token, { const payload = this.jwt.verify(token, {
secret: process.env.JWT_SECRET || 'secret', 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 return true
} catch (err) { } catch (err) {
console.log(err)
throw new UnauthorizedException('Invalid or expired token') throw new UnauthorizedException('Invalid or expired token')
} }
} }
+18
View File
@@ -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)
}
}
+9
View File
@@ -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 {}
+38
View File
@@ -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)
}
}
@@ -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) {}
+7 -19
View File
@@ -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 { CustomersService } from './customers.service'
import { CreateCustomerDto } from './dto/create-customer.dto'
import { UpdateCustomerDto } from './dto/update-customer.dto'
@Controller('customers') @Controller('customers')
export class CustomersController { export class CustomersController {
constructor(private readonly customersService: CustomersService) {} constructor(private readonly customerService: CustomersService) {}
@Post()
create(@Body() dto: CreateCustomerDto) {
return this.customersService.create(dto)
}
@Get() @Get()
findAll() { findAll() {
return this.customersService.findAll() return this.customerService.findAll()
} }
@Get(':id') @Get(':id')
findOne(@Param('id') id: string) { findOne(@Param('id') id: string) {
return this.customersService.findOne(Number(id)) return this.customerService.findOne(+id)
} }
@Patch(':id') @Post()
update(@Param('id') id: string, @Body() dto: UpdateCustomerDto) { create(@Body() data: any) {
return this.customersService.update(Number(id), dto) return this.customerService.create(data)
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.customersService.remove(Number(id))
} }
} }
@@ -1,10 +1,8 @@
import { Module } from '@nestjs/common' import { Module } from '@nestjs/common'
import { PrismaModule } from '../../prisma/prisma.module'
import { CustomersController } from './customers.controller' import { CustomersController } from './customers.controller'
import { CustomersService } from './customers.service' import { CustomersService } from './customers.service'
@Module({ @Module({
imports: [PrismaModule],
controllers: [CustomersController], controllers: [CustomersController],
providers: [CustomersService], providers: [CustomersService],
}) })
+9 -23
View File
@@ -1,33 +1,19 @@
import { Injectable } from '@nestjs/common' import { Injectable } from '@nestjs/common'
import { ResponseMapper } from '../../common/response/response-mapper'
import { PrismaService } from '../../prisma/prisma.service'
@Injectable() @Injectable()
export class CustomersService { export class CustomersService {
constructor(private prisma: PrismaService) {} findAll() {
async create(data: any) { // TODO: Implement fetching all customers
const item = await this.prisma.customer.create({ data }) return []
return ResponseMapper.create(item)
} }
async findAll() { findOne(id: number) {
const items = await this.prisma.customer.findMany() // TODO: Implement fetching a single customer
return ResponseMapper.list(items) return {}
} }
async findOne(id: number) { create(data: any) {
const item = await this.prisma.customer.findUnique({ where: { id } }) // TODO: Implement customer creation
if (!item) return null return data
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)
} }
} }
@@ -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 { export class CreateCustomerDto {
@IsString() @IsString()
firstName: string @ApiProperty()
first_name: string
@IsString() @IsString()
lastName: string @ApiProperty()
last_name: string
@IsOptional() @IsOptional()
@IsEmail() @IsEmail()
@ApiProperty({ required: false })
email?: string email?: string
@IsOptional()
@IsString() @IsString()
mobileNumber?: string @ApiProperty()
mobile_number: string
@IsOptional() @IsOptional()
@IsString() @IsString()
@ApiProperty({ required: false })
address?: string address?: string
@IsOptional() @IsOptional()
@IsString() @IsBoolean()
city?: string @ApiProperty({ required: false })
is_active?: boolean
@IsOptional()
@IsString()
state?: string
@IsOptional()
@IsString()
country?: string
} }
export class UpdateCustomerDto extends PartialType(CreateCustomerDto) {}
@@ -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
}
@@ -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) {}
@@ -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)
}
}
@@ -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 {}
@@ -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)
}
}
+38
View File
@@ -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) {}
+24
View File
@@ -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)
}
}
+9
View File
@@ -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 {}
+66
View File
@@ -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)
}
}
@@ -1,14 +0,0 @@
import { IsOptional, IsString } from 'class-validator'
export class CreateProductCategoryDto {
@IsString()
name: string
@IsOptional()
@IsString()
description?: string
@IsOptional()
@IsString()
imageUrl?: string
}
@@ -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
}
@@ -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))
}
}
@@ -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 {}
@@ -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)
}
}
@@ -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
}
@@ -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
}
@@ -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))
}
}
-11
View File
@@ -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 {}
-131
View File
@@ -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)
}
}
@@ -0,0 +1,5 @@
import { PartialType } from '@nestjs/swagger'
export class CreateProfileDto {}
export class UpdateProfileDto extends PartialType(CreateProfileDto) {}
+13
View File
@@ -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)
}
}
+9
View File
@@ -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 {}
+15
View File
@@ -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)
}
}
@@ -1,24 +1,32 @@
import { Type } from 'class-transformer' import { ApiProperty, PartialType } from '@nestjs/swagger'
import { IsInt, IsNumber } from 'class-validator' import { IsNumber, IsOptional, IsString } from 'class-validator'
export class CreateSalesInvoiceItemDto { export class CreateSalesInvoiceItemDto {
@Type(() => Number)
@IsNumber() @IsNumber()
@ApiProperty()
count: number count: number
@Type(() => Number)
@IsNumber() @IsNumber()
unitPrice: number @ApiProperty()
unit_price: number
@Type(() => Number)
@IsNumber() @IsNumber()
totalAmount: number @ApiProperty()
total_amount: number
@Type(() => Number) @IsString()
@IsInt() @ApiProperty()
invoiceId: number invoice_id: string
@Type(() => Number) @IsOptional()
@IsInt() @IsString()
productId: number @ApiProperty({ required: false })
good_id?: string
@IsOptional()
@IsString()
@ApiProperty({ required: false })
service_id?: string
} }
export class UpdateSalesInvoiceItemDto extends PartialType(CreateSalesInvoiceItemDto) {}
@@ -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
}
@@ -1,38 +1,22 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' import { Body, Controller, Get, Param, Post } from '@nestjs/common'
import { CreateSalesInvoiceItemDto } from './dto/create-sales-invoice-item.dto'
import { UpdateSalesInvoiceItemDto } from './dto/update-sales-invoice-item.dto'
import { SalesInvoiceItemsService } from './sales-invoice-items.service' import { SalesInvoiceItemsService } from './sales-invoice-items.service'
@Controller('sales-invoices/:invoiceId/items') @Controller('sales-invoice-items')
export class SalesInvoiceItemsController { export class SalesInvoiceItemsController {
constructor(private readonly service: SalesInvoiceItemsService) {} constructor(private readonly salesInvoiceItemsService: SalesInvoiceItemsService) {}
@Post()
create(@Param('invoiceId') invoiceId: string, @Body() dto: CreateSalesInvoiceItemDto) {
return this.service.createForInvoice(Number(invoiceId), dto)
}
@Get() @Get()
findAll(@Param('invoiceId') invoiceId: string) { findAll() {
return this.service.findAllForInvoice(Number(invoiceId)) return this.salesInvoiceItemsService.findAll()
} }
@Get(':id') @Get(':id')
findOne(@Param('invoiceId') invoiceId: string, @Param('id') id: string) { findOne(@Param('id') id: string) {
return this.service.findOneForInvoice(Number(invoiceId), Number(id)) return this.salesInvoiceItemsService.findOne(+id)
} }
@Patch(':id') @Post()
update( create(@Body() data: any) {
@Param('invoiceId') invoiceId: string, return this.salesInvoiceItemsService.create(data)
@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))
} }
} }
@@ -1,10 +1,8 @@
import { Module } from '@nestjs/common' import { Module } from '@nestjs/common'
import { PrismaModule } from '../../prisma/prisma.module'
import { SalesInvoiceItemsController } from './sales-invoice-items.controller' import { SalesInvoiceItemsController } from './sales-invoice-items.controller'
import { SalesInvoiceItemsService } from './sales-invoice-items.service' import { SalesInvoiceItemsService } from './sales-invoice-items.service'
@Module({ @Module({
imports: [PrismaModule],
controllers: [SalesInvoiceItemsController], controllers: [SalesInvoiceItemsController],
providers: [SalesInvoiceItemsService], providers: [SalesInvoiceItemsService],
}) })
@@ -1,98 +1,19 @@
import { Injectable } from '@nestjs/common' 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() @Injectable()
export class SalesInvoiceItemsService { export class SalesInvoiceItemsService {
constructor(private prisma: PrismaService) {} findAll() {
// TODO: Implement fetching all sales invoice items
async create(dto: CreateSalesInvoiceItemDto) { return []
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 }) findOne(id: number) {
return ResponseMapper.create(item) // TODO: Implement fetching a single sales invoice item
} return {}
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)
} }
async findOne(id: number) { create(data: any) {
const item = await this.prisma.salesInvoiceItem.findUnique({ // TODO: Implement sales invoice item creation
where: { id }, return data
include: { product: true, invoice: true },
})
if (!item) return null
return ResponseMapper.single(item)
}
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)
} }
} }
@@ -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,
) {}
@@ -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)
}
}
@@ -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 {}
@@ -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
}
}
@@ -1,20 +1,24 @@
import { Type } from 'class-transformer' import { ApiProperty, PartialType } from '@nestjs/swagger'
import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' import { IsNumber, IsOptional, IsString } from 'class-validator'
export class CreateSalesInvoiceDto { export class CreateSalesInvoiceDto {
@IsString() @IsString()
@ApiProperty()
code: string code: string
@Type(() => Number)
@IsNumber() @IsNumber()
totalAmount: number @ApiProperty()
total_amount: number
@IsOptional() @IsOptional()
@IsString() @IsString()
@ApiProperty({ required: false })
description?: string description?: string
@IsOptional() @IsOptional()
@Type(() => Number) @IsString()
@IsInt() @ApiProperty({ required: false })
customerId?: number customer_id?: string
} }
export class UpdateSalesInvoiceDto extends PartialType(CreateSalesInvoiceDto) {}
@@ -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
}
@@ -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' import { SalesInvoicesService } from './sales-invoices.service'
@Controller('sales-invoices') @Controller('sales-invoices')
export class SalesInvoicesController { export class SalesInvoicesController {
constructor(private readonly service: SalesInvoicesService) {} constructor(private readonly salesInvoicesService: SalesInvoicesService) {}
// @Post()
// create(@Body() dto: CreateSalesInvoiceDto) {
// return this.service.create(dto)
// }
@Get() @Get()
findAll() { findAll() {
return this.service.findAll() return this.salesInvoicesService.findAll()
} }
@Get(':id') @Get(':id')
findOne(@Param('id') id: string) { findOne(@Param('id') id: string) {
return this.service.findOne(Number(id)) return this.salesInvoicesService.findOne(+id)
} }
// @Patch(':id') @Post()
// update(@Param('id') id: string, @Body() dto: UpdateSalesInvoiceDto) { create(@Body() data: any) {
// return this.service.update(Number(id), dto) return this.salesInvoicesService.create(data)
// }
@Delete(':id')
remove(@Param('id') id: string) {
return this.service.remove(Number(id))
} }
} }
@@ -1,13 +1,9 @@
import { Module } from '@nestjs/common' import { Module } from '@nestjs/common'
import { PrismaModule } from '../../prisma/prisma.module'
import { SalesInvoicesController } from './sales-invoices.controller' import { SalesInvoicesController } from './sales-invoices.controller'
import { SalesInvoicesService } from './sales-invoices.service' import { SalesInvoicesService } from './sales-invoices.service'
import { SalesInvoicesWorkflow } from './sales-invoices.workflow'
@Module({ @Module({
imports: [PrismaModule],
controllers: [SalesInvoicesController], controllers: [SalesInvoicesController],
providers: [SalesInvoicesService, SalesInvoicesWorkflow], providers: [SalesInvoicesService],
exports: [SalesInvoicesWorkflow],
}) })
export class SalesInvoicesModule {} export class SalesInvoicesModule {}
@@ -1,49 +1,19 @@
import { Injectable } from '@nestjs/common' import { Injectable } from '@nestjs/common'
import { ResponseMapper } from '../../common/response/response-mapper'
import { PrismaService } from '../../prisma/prisma.service'
@Injectable() @Injectable()
export class SalesInvoicesService { export class SalesInvoicesService {
constructor(private prisma: PrismaService) {} findAll() {
// TODO: Implement fetching all sales invoices
// async create(dto: CreateSalesInvoiceDto) { return []
// 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)
} }
async findOne(id: number) { findOne(id: number) {
const item = await this.prisma.salesInvoice.findUnique({ // TODO: Implement fetching a single sales invoice
where: { id }, return {}
include: { items: true, customer: true },
})
if (!item) return null
return ResponseMapper.single(item)
} }
// async update(id: number, data: any) { create(data: any) {
// const payload: any = { ...data } // TODO: Implement sales invoice creation
// if (Object.prototype.hasOwnProperty.call(payload, 'customerId')) { return data
// 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)
} }
} }
@@ -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,
})),
})
}
}
@@ -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) {}
@@ -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)
}
}
@@ -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 {}
@@ -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
}
}
@@ -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) {}
@@ -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)
}
}
+9
View File
@@ -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 {}

Some files were not shown because too many files have changed in this diff Show More