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