feat: implement SalesInvoiceTspSwitchService and SalesInvoiceTspService for handling TSP provider interactions
- Add SalesInvoiceTspSwitchService to manage TSP provider selection and sending invoices. - Introduce SalesInvoiceTspService for creating, sending, and retrieving sales invoices. - Implement NamaProviderSwitchAdapter for communication with the NAMA TSP provider API. - Define DTOs for request and response structures specific to the NAMA provider. - Enhance error handling and logging for TSP provider interactions.
This commit is contained in:
Vendored
+1
@@ -18,6 +18,7 @@
|
||||
"Cardex",
|
||||
"fkey",
|
||||
"iban",
|
||||
"inno",
|
||||
"MAYKET"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `admin_accounts` DROP FOREIGN KEY `admin_accounts_account_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `partner_accounts` DROP FOREIGN KEY `partner_accounts_account_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `provider_accounts` DROP FOREIGN KEY `provider_accounts_account_id_fkey`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `guilds` ADD COLUMN `invoice_template` ENUM('SALE', 'FX_SALE', 'GOLD_JEWELRY', 'CONTRACT', 'UTILITY', 'AIR_TICKET', 'EXPORT', 'BILL_OF_LADING', 'PETROCHEMICAL', 'COMMODITY_EXCHANGE', 'INSURANCE') NOT NULL DEFAULT 'GOLD_JEWELRY';
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `admin_accounts` ADD CONSTRAINT `admin_accounts_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `partner_accounts` ADD CONSTRAINT `partner_accounts_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `provider_accounts` ADD CONSTRAINT `provider_accounts_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `fiscal_switch_type` on the `partners` table. All the data in the column will be lost.
|
||||
- The values [CHECK] on the enum `sales_invoice_payments_payment_method` will be removed. If these variants are still used in the database, this will fail.
|
||||
- You are about to drop the `sale_invoice_fiscal_attempts` table. If the table is not empty, all the data it contains will be lost.
|
||||
- You are about to drop the `sale_invoice_fiscals` table. If the table is not empty, all the data it contains will be lost.
|
||||
- Made the column `good_snapshot` on table `sales_invoice_items` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `good_id` on table `sales_invoice_items` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `sale_invoice_fiscal_attempts` DROP FOREIGN KEY `sale_invoice_fiscal_attempts_fiscal_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `sale_invoice_fiscals` DROP FOREIGN KEY `sale_invoice_fiscals_invoice_id_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `sales_invoice_items` DROP FOREIGN KEY `sales_invoice_items_good_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `sales_invoice_items_good_id_fkey` ON `sales_invoice_items`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `business_activities` ADD COLUMN `invoice_number_sequence` VARCHAR(191) NOT NULL DEFAULT '1';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `partners` DROP COLUMN `fiscal_switch_type`,
|
||||
ADD COLUMN `tsp_provider` ENUM('NAMA', 'SUN') NOT NULL DEFAULT 'NAMA';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `sales_invoice_items` MODIFY `good_snapshot` JSON NOT NULL,
|
||||
MODIFY `good_id` VARCHAR(191) NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `sales_invoice_payments` MODIFY `payment_method` ENUM('CHEQUE', 'SET_OFF', 'CASH', 'TERMINAL', 'PAYMENT_GATEWAY', 'CARD', 'BANK', 'OTHER') NOT NULL;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE `sale_invoice_fiscal_attempts`;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE `sale_invoice_fiscals`;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `sale_invoice_tsp_attempts` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
`attempt_no` INTEGER NOT NULL,
|
||||
`status` ENUM('SUCCESS', 'FAILURE', 'NOT_SEND', 'QUEUED') NOT NULL,
|
||||
`tax_id` VARCHAR(191) NULL,
|
||||
`type` ENUM('MAIN', 'UPDATE', 'REVOKE', 'REMOVE') NOT NULL,
|
||||
`request_payload` JSON NULL,
|
||||
`response_payload` JSON NULL,
|
||||
`error_message` TEXT NULL,
|
||||
`sent_at` TIMESTAMP(0) NULL,
|
||||
`received_at` TIMESTAMP(0) NULL,
|
||||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`invoice_id` VARCHAR(191) NOT NULL,
|
||||
|
||||
UNIQUE INDEX `sale_invoice_tsp_attempts_tax_id_key`(`tax_id`),
|
||||
UNIQUE INDEX `sale_invoice_tsp_attempts_invoice_id_key`(`invoice_id`),
|
||||
INDEX `sale_invoice_tsp_attempts_status_idx`(`status`),
|
||||
INDEX `sale_invoice_tsp_attempts_tax_id_idx`(`tax_id`),
|
||||
INDEX `sale_invoice_tsp_attempts_invoice_id_idx`(`invoice_id`),
|
||||
UNIQUE INDEX `sale_invoice_tsp_attempts_invoice_id_attempt_no_key`(`invoice_id`, `attempt_no`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- 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 `sale_invoice_tsp_attempts` ADD CONSTRAINT `sale_invoice_tsp_attempts_invoice_id_fkey` FOREIGN KEY (`invoice_id`) REFERENCES `sales_invoices`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to alter the column `invoice_number_sequence` on the `business_activities` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Decimal(20,0)`.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE `business_activities` MODIFY `invoice_number_sequence` DECIMAL(20, 0) NOT NULL DEFAULT 1;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `guilds` ALTER COLUMN `invoice_template` DROP DEFAULT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `stock_keeping_units` ALTER COLUMN `type` DROP DEFAULT;
|
||||
@@ -19,7 +19,7 @@ model Partner {
|
||||
name String
|
||||
code String @unique()
|
||||
status PartnerStatus @default(ACTIVE)
|
||||
fiscal_switch_type PartnerFiscalSwitchType
|
||||
tsp_provider TspProviderType @default(NAMA)
|
||||
logo_url String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
@@ -79,6 +79,7 @@ model BusinessActivity {
|
||||
name String
|
||||
fiscal_id String
|
||||
partner_token String
|
||||
invoice_number_sequence Decimal @default(1) @db.Decimal(20, 0)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
@@ -3,7 +3,7 @@ model StockKeepingUnits {
|
||||
code String @unique
|
||||
name String
|
||||
VAT Decimal @db.Decimal(5, 2)
|
||||
type SKUGuildType @default(GOLD)
|
||||
type SKUGuildType
|
||||
is_public Boolean @default(true)
|
||||
is_domestic Boolean @default(false)
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
enum PaymentMethodType {
|
||||
TERMINAL
|
||||
CASH
|
||||
CHEQUE
|
||||
SET_OFF
|
||||
CASH
|
||||
TERMINAL
|
||||
PAYMENT_GATEWAY
|
||||
CARD
|
||||
BANK
|
||||
CHECK
|
||||
OTHER
|
||||
}
|
||||
|
||||
@@ -156,26 +157,26 @@ enum ConsumerType {
|
||||
LEGAL
|
||||
}
|
||||
|
||||
enum PartnerFiscalSwitchType {
|
||||
enum TspProviderType {
|
||||
NAMA
|
||||
SUN
|
||||
}
|
||||
|
||||
enum FiscalResponseStatus {
|
||||
enum TspProviderResponseStatus {
|
||||
SUCCESS
|
||||
FAILURE
|
||||
NOT_SEND
|
||||
QUEUED
|
||||
}
|
||||
|
||||
enum FiscalRequestType {
|
||||
enum TspProviderRequestType {
|
||||
MAIN
|
||||
UPDATE
|
||||
REVOKE
|
||||
REMOVE
|
||||
}
|
||||
|
||||
enum FiscalInvoiceCustomerType {
|
||||
enum TspProviderCustomerType {
|
||||
Unknown
|
||||
Known
|
||||
}
|
||||
@@ -183,3 +184,17 @@ enum FiscalInvoiceCustomerType {
|
||||
enum SKUGuildType {
|
||||
GOLD
|
||||
}
|
||||
|
||||
enum InvoiceTemplateType {
|
||||
SALE
|
||||
FX_SALE
|
||||
GOLD_JEWELRY
|
||||
CONTRACT
|
||||
UTILITY
|
||||
AIR_TICKET
|
||||
EXPORT
|
||||
BILL_OF_LADING
|
||||
PETROCHEMICAL
|
||||
COMMODITY_EXCHANGE
|
||||
INSURANCE
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
model Guild {
|
||||
id String @id @default(ulid())
|
||||
name String
|
||||
invoice_template InvoiceTemplateType
|
||||
code String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
@@ -20,10 +20,9 @@ model SalesInvoice {
|
||||
pos_id String
|
||||
pos Pos @relation(fields: [pos_id], references: [id])
|
||||
|
||||
fiscal SaleInvoiceFiscals?
|
||||
|
||||
items SalesInvoiceItem[]
|
||||
payments SalesInvoicePayment[]
|
||||
tsp_attempts SaleInvoiceTspAttempts[]
|
||||
|
||||
@@unique([invoice_number, pos_id])
|
||||
@@map("sales_invoices")
|
||||
@@ -43,13 +42,13 @@ model SalesInvoiceItem {
|
||||
notes String? @db.Text
|
||||
|
||||
payload Json?
|
||||
good_snapshot Json?
|
||||
good_snapshot Json
|
||||
|
||||
invoice_id String
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id])
|
||||
|
||||
good_id String?
|
||||
good Good? @relation(fields: [good_id], references: [id])
|
||||
good_id String
|
||||
good Good @relation(fields: [good_id], references: [id])
|
||||
|
||||
service_id String?
|
||||
service Service? @relation(fields: [service_id], references: [id])
|
||||
@@ -58,30 +57,13 @@ model SalesInvoiceItem {
|
||||
@@map("sales_invoice_items")
|
||||
}
|
||||
|
||||
model SaleInvoiceFiscals {
|
||||
id String @id @default(ulid())
|
||||
|
||||
retry_count Int @default(0)
|
||||
last_attempt_at DateTime? @db.Timestamp(0)
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
invoice_id String @unique
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id], onDelete: Cascade)
|
||||
|
||||
attempts SaleInvoiceFiscalAttempts[]
|
||||
|
||||
@@map("sale_invoice_fiscals")
|
||||
}
|
||||
|
||||
model SaleInvoiceFiscalAttempts {
|
||||
model SaleInvoiceTspAttempts {
|
||||
id String @id @default(ulid())
|
||||
|
||||
attempt_no Int
|
||||
status FiscalResponseStatus
|
||||
status TspProviderResponseStatus
|
||||
tax_id String? @unique @db.VarChar(191)
|
||||
type FiscalRequestType
|
||||
type TspProviderRequestType
|
||||
|
||||
request_payload Json?
|
||||
response_payload Json?
|
||||
@@ -91,13 +73,14 @@ model SaleInvoiceFiscalAttempts {
|
||||
received_at DateTime? @db.Timestamp(0)
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
|
||||
fiscal_id String
|
||||
fiscal SaleInvoiceFiscals @relation(fields: [fiscal_id], references: [id], onDelete: Cascade)
|
||||
invoice_id String @unique
|
||||
invoice SalesInvoice @relation(fields: [invoice_id], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([fiscal_id, attempt_no])
|
||||
@@unique([invoice_id, attempt_no])
|
||||
@@index([status])
|
||||
@@index([tax_id])
|
||||
@@map("sale_invoice_fiscal_attempts")
|
||||
@@index([invoice_id])
|
||||
@@map("sale_invoice_tsp_attempts")
|
||||
}
|
||||
|
||||
model SalesInvoicePayment {
|
||||
|
||||
+4
-6
@@ -1,10 +1,6 @@
|
||||
import { PasswordUtil } from '@/common/utils/password.util'
|
||||
import { generateTrackingCode } from '@/common/utils/tracking-code-generator.util'
|
||||
import {
|
||||
ConsumerType,
|
||||
GoodPricingModel,
|
||||
PartnerFiscalSwitchType,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { ConsumerType, GoodPricingModel, TspProviderType } from '@/generated/prisma/enums'
|
||||
import { GoodCreateManyInput } from '@/generated/prisma/models'
|
||||
import { prisma } from '../src/lib/prisma'
|
||||
|
||||
@@ -135,10 +131,12 @@ async function main() {
|
||||
{
|
||||
name: 'طلا',
|
||||
code: 'Gold',
|
||||
invoice_template: 'GOLD_JEWELRY',
|
||||
},
|
||||
{
|
||||
name: 'میوه و ترهبار',
|
||||
code: 'Fruit',
|
||||
invoice_template: 'SALE',
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -405,7 +403,7 @@ async function main() {
|
||||
name: 'تیس',
|
||||
code: 'TIS',
|
||||
status: 'ACTIVE',
|
||||
fiscal_switch_type: PartnerFiscalSwitchType.NAMA,
|
||||
tsp_provider: TspProviderType.NAMA,
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FiscalResponseStatus } from '@/generated/prisma/enums'
|
||||
import { TspProviderResponseStatus } from '@/generated/prisma/enums'
|
||||
|
||||
export default {
|
||||
PaymentMethodType: {
|
||||
@@ -132,23 +132,23 @@ export default {
|
||||
CAFE_BAZAR: 'کافه بازار',
|
||||
MAYKET: 'مایکت',
|
||||
},
|
||||
PartnerFiscalSwitchType: {
|
||||
TspProviderType: {
|
||||
NAMA: 'نما',
|
||||
SUN: 'سان',
|
||||
},
|
||||
FiscalResponseStatus: {
|
||||
TspProviderResponseStatus: {
|
||||
SUCCESS: 'موفق',
|
||||
FAILURE: 'ناموفق',
|
||||
NOT_SEND: 'ارسال نشده',
|
||||
[FiscalResponseStatus.QUEUED]: 'در صف ارسال',
|
||||
[TspProviderResponseStatus.QUEUED]: 'در صف ارسال',
|
||||
},
|
||||
FiscalRequestType: {
|
||||
TspProviderRequestType: {
|
||||
MAIN: 'اصلی',
|
||||
UPDATE: 'اصلاح',
|
||||
REVOKE: 'ابطال',
|
||||
REMOVE: 'حذف',
|
||||
},
|
||||
FiscalInvoiceCustomerType: {
|
||||
TspProviderCustomerType: {
|
||||
Unknown: 'ناشناس',
|
||||
Known: 'شناسایی شده',
|
||||
},
|
||||
|
||||
@@ -4,14 +4,14 @@ export enum GoldKarat {
|
||||
KARAT_24 = '24',
|
||||
}
|
||||
|
||||
export enum FiscalRequestType {
|
||||
export enum TspProviderRequestType {
|
||||
MAIN = 'MAIN',
|
||||
UPDATE = 'UPDATE',
|
||||
REVOKE = 'REVOKE',
|
||||
REMOVE = 'REMOVE',
|
||||
}
|
||||
|
||||
export enum FiscalInvoiceCustomerType {
|
||||
export enum TspProviderCustomerType {
|
||||
Unknown = 'Unknown',
|
||||
Known = 'Known',
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
export interface FetchRequestContext {
|
||||
url: string
|
||||
init: RequestInit
|
||||
}
|
||||
|
||||
export interface FetchRequestInterceptor {
|
||||
onRequest?(
|
||||
context: FetchRequestContext,
|
||||
): Promise<FetchRequestContext> | FetchRequestContext
|
||||
onResponse?(
|
||||
context: FetchRequestContext,
|
||||
response: Response,
|
||||
): Promise<Response> | Response
|
||||
onError?(context: FetchRequestContext, error: unknown): Promise<void> | void
|
||||
}
|
||||
|
||||
function mergeHeaders(
|
||||
currentHeaders: HeadersInit | undefined,
|
||||
newHeaders: HeadersInit,
|
||||
): Headers {
|
||||
const mergedHeaders = new Headers(currentHeaders)
|
||||
const incomingHeaders = new Headers(newHeaders)
|
||||
|
||||
incomingHeaders.forEach((value, key) => {
|
||||
mergedHeaders.set(key, value)
|
||||
})
|
||||
|
||||
return mergedHeaders
|
||||
}
|
||||
|
||||
export function createHeaderRequestInterceptor(
|
||||
headers: HeadersInit,
|
||||
): FetchRequestInterceptor {
|
||||
return {
|
||||
onRequest(context) {
|
||||
return {
|
||||
...context,
|
||||
init: {
|
||||
...context.init,
|
||||
headers: mergeHeaders(context.init.headers, headers),
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export function createEnsureSuccessResponseInterceptor(): FetchRequestInterceptor {
|
||||
return {
|
||||
async onResponse(_, response) {
|
||||
if (response.ok) {
|
||||
return response
|
||||
}
|
||||
|
||||
const errorBody = await response.text().catch(() => '')
|
||||
const normalizedBody = errorBody
|
||||
return Promise.reject({
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
body: normalizedBody,
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ export interface SaleInvoiceGoldTypePayload {
|
||||
karat: keyof typeof GoldKarat
|
||||
wages: number
|
||||
profit: number
|
||||
commission: number
|
||||
}
|
||||
export interface SaleInvoiceStandardPayload {}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
FetchRequestContext,
|
||||
FetchRequestInterceptor,
|
||||
} from '@/common/interceptors/fetch-request.interceptor'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class HttpClientUtil {
|
||||
async request(
|
||||
url: string,
|
||||
init: RequestInit = {},
|
||||
interceptors: FetchRequestInterceptor[] = [],
|
||||
): Promise<Response> {
|
||||
let context: FetchRequestContext = { url, init }
|
||||
|
||||
for (const interceptor of interceptors) {
|
||||
if (!interceptor.onRequest) {
|
||||
continue
|
||||
}
|
||||
|
||||
context = await interceptor.onRequest(context)
|
||||
}
|
||||
|
||||
try {
|
||||
let response = await fetch(context.url, context.init)
|
||||
|
||||
for (const interceptor of interceptors) {
|
||||
if (!interceptor.onResponse) {
|
||||
continue
|
||||
}
|
||||
response = await interceptor.onResponse(context, response)
|
||||
console.log('response')
|
||||
console.log(response)
|
||||
}
|
||||
|
||||
return response
|
||||
} catch (error: any) {
|
||||
for (const interceptor of interceptors) {
|
||||
if (!interceptor.onError) {
|
||||
continue
|
||||
}
|
||||
await interceptor.onError(context, error)
|
||||
}
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,3 +3,4 @@ export * from './enum-translator.util'
|
||||
export * from './mappers/consumer_mappers.util'
|
||||
export * from './password.util'
|
||||
export * from './tracking-code-generator.util'
|
||||
export * from './http-client.util'
|
||||
|
||||
@@ -223,15 +223,10 @@ export type SalesInvoice = Prisma.SalesInvoiceModel
|
||||
*/
|
||||
export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel
|
||||
/**
|
||||
* Model SaleInvoiceFiscals
|
||||
* Model SaleInvoiceTspAttempts
|
||||
*
|
||||
*/
|
||||
export type SaleInvoiceFiscals = Prisma.SaleInvoiceFiscalsModel
|
||||
/**
|
||||
* Model SaleInvoiceFiscalAttempts
|
||||
*
|
||||
*/
|
||||
export type SaleInvoiceFiscalAttempts = Prisma.SaleInvoiceFiscalAttemptsModel
|
||||
export type SaleInvoiceTspAttempts = Prisma.SaleInvoiceTspAttemptsModel
|
||||
/**
|
||||
* Model SalesInvoicePayment
|
||||
*
|
||||
|
||||
@@ -245,15 +245,10 @@ export type SalesInvoice = Prisma.SalesInvoiceModel
|
||||
*/
|
||||
export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel
|
||||
/**
|
||||
* Model SaleInvoiceFiscals
|
||||
* Model SaleInvoiceTspAttempts
|
||||
*
|
||||
*/
|
||||
export type SaleInvoiceFiscals = Prisma.SaleInvoiceFiscalsModel
|
||||
/**
|
||||
* Model SaleInvoiceFiscalAttempts
|
||||
*
|
||||
*/
|
||||
export type SaleInvoiceFiscalAttempts = Prisma.SaleInvoiceFiscalAttemptsModel
|
||||
export type SaleInvoiceTspAttempts = Prisma.SaleInvoiceTspAttemptsModel
|
||||
/**
|
||||
* Model SalesInvoicePayment
|
||||
*
|
||||
|
||||
@@ -195,11 +195,11 @@ export type EnumPartnerStatusFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumPartnerStatusFilter<$PrismaModel> | $Enums.PartnerStatus
|
||||
}
|
||||
|
||||
export type EnumPartnerFiscalSwitchTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PartnerFiscalSwitchType | Prisma.EnumPartnerFiscalSwitchTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PartnerFiscalSwitchType[]
|
||||
notIn?: $Enums.PartnerFiscalSwitchType[]
|
||||
not?: Prisma.NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel> | $Enums.PartnerFiscalSwitchType
|
||||
export type EnumTspProviderTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderType | Prisma.EnumTspProviderTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderType[]
|
||||
notIn?: $Enums.TspProviderType[]
|
||||
not?: Prisma.NestedEnumTspProviderTypeFilter<$PrismaModel> | $Enums.TspProviderType
|
||||
}
|
||||
|
||||
export type EnumPartnerStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -212,14 +212,14 @@ export type EnumPartnerStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumPartnerStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumPartnerFiscalSwitchTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PartnerFiscalSwitchType | Prisma.EnumPartnerFiscalSwitchTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PartnerFiscalSwitchType[]
|
||||
notIn?: $Enums.PartnerFiscalSwitchType[]
|
||||
not?: Prisma.NestedEnumPartnerFiscalSwitchTypeWithAggregatesFilter<$PrismaModel> | $Enums.PartnerFiscalSwitchType
|
||||
export type EnumTspProviderTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderType | Prisma.EnumTspProviderTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderType[]
|
||||
notIn?: $Enums.TspProviderType[]
|
||||
not?: Prisma.NestedEnumTspProviderTypeWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumPOSRoleFilter<$PrismaModel = never> = {
|
||||
@@ -456,6 +456,33 @@ export type EnumConsumerStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumConsumerStatusFilter<$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> = {
|
||||
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.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumPOSStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.POSStatus | Prisma.EnumPOSStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.POSStatus[]
|
||||
@@ -559,17 +586,6 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$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 EnumSKUGuildTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
@@ -577,22 +593,6 @@ export type EnumSKUGuildTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel> | $Enums.SKUGuildType
|
||||
}
|
||||
|
||||
export type DecimalWithAggregatesFilter<$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.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumSKUGuildTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
@@ -633,38 +633,106 @@ export type EnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumFiscalResponseStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
export type EnumInvoiceTemplateTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceTemplateType | Prisma.EnumInvoiceTemplateTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceTemplateType[]
|
||||
notIn?: $Enums.InvoiceTemplateType[]
|
||||
not?: Prisma.NestedEnumInvoiceTemplateTypeFilter<$PrismaModel> | $Enums.InvoiceTemplateType
|
||||
}
|
||||
|
||||
export type EnumFiscalRequestTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
}
|
||||
|
||||
export type EnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
export type EnumInvoiceTemplateTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceTemplateType | Prisma.EnumInvoiceTemplateTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceTemplateType[]
|
||||
notIn?: $Enums.InvoiceTemplateType[]
|
||||
not?: Prisma.NestedEnumInvoiceTemplateTypeWithAggregatesFilter<$PrismaModel> | $Enums.InvoiceTemplateType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumInvoiceTemplateTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumInvoiceTemplateTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
export type JsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type JsonWithAggregatesFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, Exclude<keyof Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<JsonWithAggregatesFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<JsonWithAggregatesFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type JsonWithAggregatesFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedJsonFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumTspProviderResponseStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderResponseStatus[]
|
||||
notIn?: $Enums.TspProviderResponseStatus[]
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusFilter<$PrismaModel> | $Enums.TspProviderResponseStatus
|
||||
}
|
||||
|
||||
export type EnumTspProviderRequestTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderRequestType | Prisma.EnumTspProviderRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderRequestType[]
|
||||
notIn?: $Enums.TspProviderRequestType[]
|
||||
not?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel> | $Enums.TspProviderRequestType
|
||||
}
|
||||
|
||||
export type EnumTspProviderResponseStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderResponseStatus[]
|
||||
notIn?: $Enums.TspProviderResponseStatus[]
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderResponseStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderResponseStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderResponseStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderRequestType | Prisma.EnumTspProviderRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderRequestType[]
|
||||
notIn?: $Enums.TspProviderRequestType[]
|
||||
not?: Prisma.NestedEnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderRequestType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = {
|
||||
@@ -882,11 +950,11 @@ export type NestedEnumPartnerStatusFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumPartnerStatusFilter<$PrismaModel> | $Enums.PartnerStatus
|
||||
}
|
||||
|
||||
export type NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PartnerFiscalSwitchType | Prisma.EnumPartnerFiscalSwitchTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PartnerFiscalSwitchType[]
|
||||
notIn?: $Enums.PartnerFiscalSwitchType[]
|
||||
not?: Prisma.NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel> | $Enums.PartnerFiscalSwitchType
|
||||
export type NestedEnumTspProviderTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderType | Prisma.EnumTspProviderTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderType[]
|
||||
notIn?: $Enums.TspProviderType[]
|
||||
not?: Prisma.NestedEnumTspProviderTypeFilter<$PrismaModel> | $Enums.TspProviderType
|
||||
}
|
||||
|
||||
export type NestedEnumPartnerStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
@@ -899,14 +967,14 @@ export type NestedEnumPartnerStatusWithAggregatesFilter<$PrismaModel = never> =
|
||||
_max?: Prisma.NestedEnumPartnerStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumPartnerFiscalSwitchTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.PartnerFiscalSwitchType | Prisma.EnumPartnerFiscalSwitchTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.PartnerFiscalSwitchType[]
|
||||
notIn?: $Enums.PartnerFiscalSwitchType[]
|
||||
not?: Prisma.NestedEnumPartnerFiscalSwitchTypeWithAggregatesFilter<$PrismaModel> | $Enums.PartnerFiscalSwitchType
|
||||
export type NestedEnumTspProviderTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderType | Prisma.EnumTspProviderTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderType[]
|
||||
notIn?: $Enums.TspProviderType[]
|
||||
not?: Prisma.NestedEnumTspProviderTypeWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumPartnerFiscalSwitchTypeFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumPOSRoleFilter<$PrismaModel = never> = {
|
||||
@@ -1116,6 +1184,33 @@ export type NestedEnumConsumerStatusWithAggregatesFilter<$PrismaModel = never> =
|
||||
_max?: Prisma.NestedEnumConsumerStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
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> = {
|
||||
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.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumPOSStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.POSStatus | Prisma.EnumPOSStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.POSStatus[]
|
||||
@@ -1219,17 +1314,6 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
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 NestedEnumSKUGuildTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
@@ -1237,22 +1321,6 @@ export type NestedEnumSKUGuildTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumSKUGuildTypeFilter<$PrismaModel> | $Enums.SKUGuildType
|
||||
}
|
||||
|
||||
export type NestedDecimalWithAggregatesFilter<$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.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumSKUGuildTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.SKUGuildType | Prisma.EnumSKUGuildTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.SKUGuildType[]
|
||||
@@ -1293,38 +1361,79 @@ export type NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalResponseStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
export type NestedEnumInvoiceTemplateTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceTemplateType | Prisma.EnumInvoiceTemplateTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceTemplateType[]
|
||||
notIn?: $Enums.InvoiceTemplateType[]
|
||||
not?: Prisma.NestedEnumInvoiceTemplateTypeFilter<$PrismaModel> | $Enums.InvoiceTemplateType
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalRequestTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalResponseStatus | Prisma.EnumFiscalResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalResponseStatus[]
|
||||
notIn?: $Enums.FiscalResponseStatus[]
|
||||
not?: Prisma.NestedEnumFiscalResponseStatusWithAggregatesFilter<$PrismaModel> | $Enums.FiscalResponseStatus
|
||||
export type NestedEnumInvoiceTemplateTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.InvoiceTemplateType | Prisma.EnumInvoiceTemplateTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.InvoiceTemplateType[]
|
||||
notIn?: $Enums.InvoiceTemplateType[]
|
||||
not?: Prisma.NestedEnumInvoiceTemplateTypeWithAggregatesFilter<$PrismaModel> | $Enums.InvoiceTemplateType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalResponseStatusFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumInvoiceTemplateTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumInvoiceTemplateTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.FiscalRequestType | Prisma.EnumFiscalRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.FiscalRequestType[]
|
||||
notIn?: $Enums.FiscalRequestType[]
|
||||
not?: Prisma.NestedEnumFiscalRequestTypeWithAggregatesFilter<$PrismaModel> | $Enums.FiscalRequestType
|
||||
export type NestedJsonFilter<$PrismaModel = never> =
|
||||
| Prisma.PatchUndefined<
|
||||
Prisma.Either<Required<NestedJsonFilterBase<$PrismaModel>>, Exclude<keyof Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>,
|
||||
Required<NestedJsonFilterBase<$PrismaModel>>
|
||||
>
|
||||
| Prisma.OptionalFlat<Omit<Required<NestedJsonFilterBase<$PrismaModel>>, 'path'>>
|
||||
|
||||
export type NestedJsonFilterBase<$PrismaModel = never> = {
|
||||
equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
path?: string
|
||||
mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel>
|
||||
string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel>
|
||||
array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null
|
||||
lt?: runtime.InputJsonValue
|
||||
lte?: runtime.InputJsonValue
|
||||
gt?: runtime.InputJsonValue
|
||||
gte?: runtime.InputJsonValue
|
||||
not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderResponseStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderResponseStatus[]
|
||||
notIn?: $Enums.TspProviderResponseStatus[]
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusFilter<$PrismaModel> | $Enums.TspProviderResponseStatus
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderRequestTypeFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderRequestType | Prisma.EnumTspProviderRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderRequestType[]
|
||||
notIn?: $Enums.TspProviderRequestType[]
|
||||
not?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel> | $Enums.TspProviderRequestType
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderResponseStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderResponseStatus | Prisma.EnumTspProviderResponseStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderResponseStatus[]
|
||||
notIn?: $Enums.TspProviderResponseStatus[]
|
||||
not?: Prisma.NestedEnumTspProviderResponseStatusWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderResponseStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumFiscalRequestTypeFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderResponseStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderResponseStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.TspProviderRequestType | Prisma.EnumTspProviderRequestTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.TspProviderRequestType[]
|
||||
notIn?: $Enums.TspProviderRequestType[]
|
||||
not?: Prisma.NestedEnumTspProviderRequestTypeWithAggregatesFilter<$PrismaModel> | $Enums.TspProviderRequestType
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumTspProviderRequestTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = {
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
*/
|
||||
|
||||
export const PaymentMethodType = {
|
||||
TERMINAL: 'TERMINAL',
|
||||
CASH: 'CASH',
|
||||
CHEQUE: 'CHEQUE',
|
||||
SET_OFF: 'SET_OFF',
|
||||
CASH: 'CASH',
|
||||
TERMINAL: 'TERMINAL',
|
||||
PAYMENT_GATEWAY: 'PAYMENT_GATEWAY',
|
||||
CARD: 'CARD',
|
||||
BANK: 'BANK',
|
||||
CHECK: 'CHECK',
|
||||
OTHER: 'OTHER'
|
||||
} as const
|
||||
|
||||
@@ -248,40 +249,40 @@ export const ConsumerType = {
|
||||
export type ConsumerType = (typeof ConsumerType)[keyof typeof ConsumerType]
|
||||
|
||||
|
||||
export const PartnerFiscalSwitchType = {
|
||||
export const TspProviderType = {
|
||||
NAMA: 'NAMA',
|
||||
SUN: 'SUN'
|
||||
} as const
|
||||
|
||||
export type PartnerFiscalSwitchType = (typeof PartnerFiscalSwitchType)[keyof typeof PartnerFiscalSwitchType]
|
||||
export type TspProviderType = (typeof TspProviderType)[keyof typeof TspProviderType]
|
||||
|
||||
|
||||
export const FiscalResponseStatus = {
|
||||
export const TspProviderResponseStatus = {
|
||||
SUCCESS: 'SUCCESS',
|
||||
FAILURE: 'FAILURE',
|
||||
NOT_SEND: 'NOT_SEND',
|
||||
QUEUED: 'QUEUED'
|
||||
} as const
|
||||
|
||||
export type FiscalResponseStatus = (typeof FiscalResponseStatus)[keyof typeof FiscalResponseStatus]
|
||||
export type TspProviderResponseStatus = (typeof TspProviderResponseStatus)[keyof typeof TspProviderResponseStatus]
|
||||
|
||||
|
||||
export const FiscalRequestType = {
|
||||
export const TspProviderRequestType = {
|
||||
MAIN: 'MAIN',
|
||||
UPDATE: 'UPDATE',
|
||||
REVOKE: 'REVOKE',
|
||||
REMOVE: 'REMOVE'
|
||||
} as const
|
||||
|
||||
export type FiscalRequestType = (typeof FiscalRequestType)[keyof typeof FiscalRequestType]
|
||||
export type TspProviderRequestType = (typeof TspProviderRequestType)[keyof typeof TspProviderRequestType]
|
||||
|
||||
|
||||
export const FiscalInvoiceCustomerType = {
|
||||
export const TspProviderCustomerType = {
|
||||
Unknown: 'Unknown',
|
||||
Known: 'Known'
|
||||
} as const
|
||||
|
||||
export type FiscalInvoiceCustomerType = (typeof FiscalInvoiceCustomerType)[keyof typeof FiscalInvoiceCustomerType]
|
||||
export type TspProviderCustomerType = (typeof TspProviderCustomerType)[keyof typeof TspProviderCustomerType]
|
||||
|
||||
|
||||
export const SKUGuildType = {
|
||||
@@ -289,3 +290,20 @@ export const SKUGuildType = {
|
||||
} as const
|
||||
|
||||
export type SKUGuildType = (typeof SKUGuildType)[keyof typeof SKUGuildType]
|
||||
|
||||
|
||||
export const InvoiceTemplateType = {
|
||||
SALE: 'SALE',
|
||||
FX_SALE: 'FX_SALE',
|
||||
GOLD_JEWELRY: 'GOLD_JEWELRY',
|
||||
CONTRACT: 'CONTRACT',
|
||||
UTILITY: 'UTILITY',
|
||||
AIR_TICKET: 'AIR_TICKET',
|
||||
EXPORT: 'EXPORT',
|
||||
BILL_OF_LADING: 'BILL_OF_LADING',
|
||||
PETROCHEMICAL: 'PETROCHEMICAL',
|
||||
COMMODITY_EXCHANGE: 'COMMODITY_EXCHANGE',
|
||||
INSURANCE: 'INSURANCE'
|
||||
} as const
|
||||
|
||||
export type InvoiceTemplateType = (typeof InvoiceTemplateType)[keyof typeof InvoiceTemplateType]
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -425,8 +425,7 @@ export const ModelName = {
|
||||
Guild: 'Guild',
|
||||
SalesInvoice: 'SalesInvoice',
|
||||
SalesInvoiceItem: 'SalesInvoiceItem',
|
||||
SaleInvoiceFiscals: 'SaleInvoiceFiscals',
|
||||
SaleInvoiceFiscalAttempts: 'SaleInvoiceFiscalAttempts',
|
||||
SaleInvoiceTspAttempts: 'SaleInvoiceTspAttempts',
|
||||
SalesInvoicePayment: 'SalesInvoicePayment',
|
||||
SalesInvoicePaymentTerminalInfo: 'SalesInvoicePaymentTerminalInfo',
|
||||
Service: 'Service',
|
||||
@@ -446,7 +445,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
omit: GlobalOmitOptions
|
||||
}
|
||||
meta: {
|
||||
modelProps: "adminAccount" | "admin" | "account" | "deviceBrand" | "device" | "licenseChargeTransaction" | "license" | "licenseActivation" | "licenseRenewChargeTransaction" | "licenseRenew" | "partnerAccountQuotaChargeTransaction" | "partnerAccountQuotaCredit" | "licenseAccountAllocation" | "partnerAccount" | "partner" | "permissionConsumer" | "permissionPos" | "permissionComplex" | "permissionBusiness" | "providerAccount" | "provider" | "consumerDevices" | "applicationReleasedInfo" | "consumerAccount" | "consumer" | "consumerIndividual" | "consumerLegal" | "businessActivity" | "complex" | "pos" | "good" | "goodCategory" | "measureUnits" | "stockKeepingUnits" | "triggerLog" | "customer" | "customerIndividual" | "customerLegal" | "guild" | "salesInvoice" | "salesInvoiceItem" | "saleInvoiceFiscals" | "saleInvoiceFiscalAttempts" | "salesInvoicePayment" | "salesInvoicePaymentTerminalInfo" | "service" | "serviceCategory"
|
||||
modelProps: "adminAccount" | "admin" | "account" | "deviceBrand" | "device" | "licenseChargeTransaction" | "license" | "licenseActivation" | "licenseRenewChargeTransaction" | "licenseRenew" | "partnerAccountQuotaChargeTransaction" | "partnerAccountQuotaCredit" | "licenseAccountAllocation" | "partnerAccount" | "partner" | "permissionConsumer" | "permissionPos" | "permissionComplex" | "permissionBusiness" | "providerAccount" | "provider" | "consumerDevices" | "applicationReleasedInfo" | "consumerAccount" | "consumer" | "consumerIndividual" | "consumerLegal" | "businessActivity" | "complex" | "pos" | "good" | "goodCategory" | "measureUnits" | "stockKeepingUnits" | "triggerLog" | "customer" | "customerIndividual" | "customerLegal" | "guild" | "salesInvoice" | "salesInvoiceItem" | "saleInvoiceTspAttempts" | "salesInvoicePayment" | "salesInvoicePaymentTerminalInfo" | "service" | "serviceCategory"
|
||||
txIsolationLevel: TransactionIsolationLevel
|
||||
}
|
||||
model: {
|
||||
@@ -3156,135 +3155,69 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
||||
}
|
||||
}
|
||||
}
|
||||
SaleInvoiceFiscals: {
|
||||
payload: Prisma.$SaleInvoiceFiscalsPayload<ExtArgs>
|
||||
fields: Prisma.SaleInvoiceFiscalsFieldRefs
|
||||
SaleInvoiceTspAttempts: {
|
||||
payload: Prisma.$SaleInvoiceTspAttemptsPayload<ExtArgs>
|
||||
fields: Prisma.SaleInvoiceTspAttemptsFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.SaleInvoiceFiscalsFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload> | null
|
||||
args: Prisma.SaleInvoiceTspAttemptsFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.SaleInvoiceFiscalsFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>
|
||||
args: Prisma.SaleInvoiceTspAttemptsFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.SaleInvoiceFiscalsFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload> | null
|
||||
args: Prisma.SaleInvoiceTspAttemptsFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.SaleInvoiceFiscalsFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>
|
||||
args: Prisma.SaleInvoiceTspAttemptsFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.SaleInvoiceFiscalsFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>[]
|
||||
args: Prisma.SaleInvoiceTspAttemptsFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.SaleInvoiceFiscalsCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>
|
||||
args: Prisma.SaleInvoiceTspAttemptsCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.SaleInvoiceFiscalsCreateManyArgs<ExtArgs>
|
||||
args: Prisma.SaleInvoiceTspAttemptsCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.SaleInvoiceFiscalsDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>
|
||||
args: Prisma.SaleInvoiceTspAttemptsDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.SaleInvoiceFiscalsUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>
|
||||
args: Prisma.SaleInvoiceTspAttemptsUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.SaleInvoiceFiscalsDeleteManyArgs<ExtArgs>
|
||||
args: Prisma.SaleInvoiceTspAttemptsDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.SaleInvoiceFiscalsUpdateManyArgs<ExtArgs>
|
||||
args: Prisma.SaleInvoiceTspAttemptsUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.SaleInvoiceFiscalsUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalsPayload>
|
||||
args: Prisma.SaleInvoiceTspAttemptsUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceTspAttemptsPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.SaleInvoiceFiscalsAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateSaleInvoiceFiscals>
|
||||
args: Prisma.SaleInvoiceTspAttemptsAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateSaleInvoiceTspAttempts>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.SaleInvoiceFiscalsGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SaleInvoiceFiscalsGroupByOutputType>[]
|
||||
args: Prisma.SaleInvoiceTspAttemptsGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SaleInvoiceTspAttemptsGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.SaleInvoiceFiscalsCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SaleInvoiceFiscalsCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
SaleInvoiceFiscalAttempts: {
|
||||
payload: Prisma.$SaleInvoiceFiscalAttemptsPayload<ExtArgs>
|
||||
fields: Prisma.SaleInvoiceFiscalAttemptsFieldRefs
|
||||
operations: {
|
||||
findUnique: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsFindUniqueArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload> | null
|
||||
}
|
||||
findUniqueOrThrow: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsFindUniqueOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>
|
||||
}
|
||||
findFirst: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsFindFirstArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload> | null
|
||||
}
|
||||
findFirstOrThrow: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsFindFirstOrThrowArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>
|
||||
}
|
||||
findMany: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsFindManyArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>[]
|
||||
}
|
||||
create: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsCreateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>
|
||||
}
|
||||
createMany: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsCreateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
delete: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsDeleteArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>
|
||||
}
|
||||
update: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsUpdateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>
|
||||
}
|
||||
deleteMany: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsDeleteManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
updateMany: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsUpdateManyArgs<ExtArgs>
|
||||
result: BatchPayload
|
||||
}
|
||||
upsert: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsUpsertArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.PayloadToResult<Prisma.$SaleInvoiceFiscalAttemptsPayload>
|
||||
}
|
||||
aggregate: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsAggregateArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.AggregateSaleInvoiceFiscalAttempts>
|
||||
}
|
||||
groupBy: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsGroupByArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SaleInvoiceFiscalAttemptsGroupByOutputType>[]
|
||||
}
|
||||
count: {
|
||||
args: Prisma.SaleInvoiceFiscalAttemptsCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SaleInvoiceFiscalAttemptsCountAggregateOutputType> | number
|
||||
args: Prisma.SaleInvoiceTspAttemptsCountArgs<ExtArgs>
|
||||
result: runtime.Types.Utils.Optional<Prisma.SaleInvoiceTspAttemptsCountAggregateOutputType> | number
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3762,7 +3695,7 @@ export const PartnerScalarFieldEnum = {
|
||||
name: 'name',
|
||||
code: 'code',
|
||||
status: 'status',
|
||||
fiscal_switch_type: 'fiscal_switch_type',
|
||||
tsp_provider: 'tsp_provider',
|
||||
logo_url: 'logo_url',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
@@ -3927,6 +3860,7 @@ export const BusinessActivityScalarFieldEnum = {
|
||||
name: 'name',
|
||||
fiscal_id: 'fiscal_id',
|
||||
partner_token: 'partner_token',
|
||||
invoice_number_sequence: 'invoice_number_sequence',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
guild_id: 'guild_id',
|
||||
@@ -4082,6 +4016,7 @@ export type CustomerLegalScalarFieldEnum = (typeof CustomerLegalScalarFieldEnum)
|
||||
export const GuildScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
invoice_template: 'invoice_template',
|
||||
code: 'code',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
@@ -4130,19 +4065,7 @@ export const SalesInvoiceItemScalarFieldEnum = {
|
||||
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
retry_count: 'retry_count',
|
||||
last_attempt_at: 'last_attempt_at',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalsScalarFieldEnum = (typeof SaleInvoiceFiscalsScalarFieldEnum)[keyof typeof SaleInvoiceFiscalsScalarFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalAttemptsScalarFieldEnum = {
|
||||
export const SaleInvoiceTspAttemptsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
attempt_no: 'attempt_no',
|
||||
status: 'status',
|
||||
@@ -4154,10 +4077,10 @@ export const SaleInvoiceFiscalAttemptsScalarFieldEnum = {
|
||||
sent_at: 'sent_at',
|
||||
received_at: 'received_at',
|
||||
created_at: 'created_at',
|
||||
fiscal_id: 'fiscal_id'
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalAttemptsScalarFieldEnum = (typeof SaleInvoiceFiscalAttemptsScalarFieldEnum)[keyof typeof SaleInvoiceFiscalAttemptsScalarFieldEnum]
|
||||
export type SaleInvoiceTspAttemptsScalarFieldEnum = (typeof SaleInvoiceTspAttemptsScalarFieldEnum)[keyof typeof SaleInvoiceTspAttemptsScalarFieldEnum]
|
||||
|
||||
|
||||
export const SalesInvoicePaymentScalarFieldEnum = {
|
||||
@@ -4237,6 +4160,13 @@ export const NullableJsonNullValueInput = {
|
||||
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
||||
|
||||
|
||||
export const JsonNullValueInput = {
|
||||
JsonNull: JsonNull
|
||||
} as const
|
||||
|
||||
export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput]
|
||||
|
||||
|
||||
export const AdminAccountOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
admin_id: 'admin_id',
|
||||
@@ -4679,22 +4609,14 @@ export const SalesInvoiceItemOrderByRelevanceFieldEnum = {
|
||||
export type SalesInvoiceItemOrderByRelevanceFieldEnum = (typeof SalesInvoiceItemOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceItemOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalsOrderByRelevanceFieldEnum = (typeof SaleInvoiceFiscalsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceFiscalsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum = {
|
||||
export const SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
tax_id: 'tax_id',
|
||||
error_message: 'error_message',
|
||||
fiscal_id: 'fiscal_id'
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum = (typeof SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum]
|
||||
export type SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = (typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const SalesInvoicePaymentOrderByRelevanceFieldEnum = {
|
||||
@@ -4801,9 +4723,9 @@ export type EnumPartnerStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$Pr
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'PartnerFiscalSwitchType'
|
||||
* Reference to a field of type 'TspProviderType'
|
||||
*/
|
||||
export type EnumPartnerFiscalSwitchTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PartnerFiscalSwitchType'>
|
||||
export type EnumTspProviderTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'TspProviderType'>
|
||||
|
||||
|
||||
|
||||
@@ -4898,6 +4820,13 @@ export type EnumConsumerStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$P
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Decimal'
|
||||
*/
|
||||
export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'POSStatus'
|
||||
*/
|
||||
@@ -4919,13 +4848,6 @@ export type EnumGoodPricingModelFieldRefInput<$PrismaModel> = FieldRefInputType<
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Decimal'
|
||||
*/
|
||||
export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'SKUGuildType'
|
||||
*/
|
||||
@@ -4941,16 +4863,23 @@ export type EnumCustomerTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$Pri
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'FiscalResponseStatus'
|
||||
* Reference to a field of type 'InvoiceTemplateType'
|
||||
*/
|
||||
export type EnumFiscalResponseStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'FiscalResponseStatus'>
|
||||
export type EnumInvoiceTemplateTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'InvoiceTemplateType'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'FiscalRequestType'
|
||||
* Reference to a field of type 'TspProviderResponseStatus'
|
||||
*/
|
||||
export type EnumFiscalRequestTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'FiscalRequestType'>
|
||||
export type EnumTspProviderResponseStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'TspProviderResponseStatus'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'TspProviderRequestType'
|
||||
*/
|
||||
export type EnumTspProviderRequestTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'TspProviderRequestType'>
|
||||
|
||||
|
||||
|
||||
@@ -5103,8 +5032,7 @@ export type GlobalOmitConfig = {
|
||||
guild?: Prisma.GuildOmit
|
||||
salesInvoice?: Prisma.SalesInvoiceOmit
|
||||
salesInvoiceItem?: Prisma.SalesInvoiceItemOmit
|
||||
saleInvoiceFiscals?: Prisma.SaleInvoiceFiscalsOmit
|
||||
saleInvoiceFiscalAttempts?: Prisma.SaleInvoiceFiscalAttemptsOmit
|
||||
saleInvoiceTspAttempts?: Prisma.SaleInvoiceTspAttemptsOmit
|
||||
salesInvoicePayment?: Prisma.SalesInvoicePaymentOmit
|
||||
salesInvoicePaymentTerminalInfo?: Prisma.SalesInvoicePaymentTerminalInfoOmit
|
||||
service?: Prisma.ServiceOmit
|
||||
|
||||
@@ -92,8 +92,7 @@ export const ModelName = {
|
||||
Guild: 'Guild',
|
||||
SalesInvoice: 'SalesInvoice',
|
||||
SalesInvoiceItem: 'SalesInvoiceItem',
|
||||
SaleInvoiceFiscals: 'SaleInvoiceFiscals',
|
||||
SaleInvoiceFiscalAttempts: 'SaleInvoiceFiscalAttempts',
|
||||
SaleInvoiceTspAttempts: 'SaleInvoiceTspAttempts',
|
||||
SalesInvoicePayment: 'SalesInvoicePayment',
|
||||
SalesInvoicePaymentTerminalInfo: 'SalesInvoicePaymentTerminalInfo',
|
||||
Service: 'Service',
|
||||
@@ -287,7 +286,7 @@ export const PartnerScalarFieldEnum = {
|
||||
name: 'name',
|
||||
code: 'code',
|
||||
status: 'status',
|
||||
fiscal_switch_type: 'fiscal_switch_type',
|
||||
tsp_provider: 'tsp_provider',
|
||||
logo_url: 'logo_url',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
@@ -452,6 +451,7 @@ export const BusinessActivityScalarFieldEnum = {
|
||||
name: 'name',
|
||||
fiscal_id: 'fiscal_id',
|
||||
partner_token: 'partner_token',
|
||||
invoice_number_sequence: 'invoice_number_sequence',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
guild_id: 'guild_id',
|
||||
@@ -607,6 +607,7 @@ export type CustomerLegalScalarFieldEnum = (typeof CustomerLegalScalarFieldEnum)
|
||||
export const GuildScalarFieldEnum = {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
invoice_template: 'invoice_template',
|
||||
code: 'code',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
@@ -655,19 +656,7 @@ export const SalesInvoiceItemScalarFieldEnum = {
|
||||
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
retry_count: 'retry_count',
|
||||
last_attempt_at: 'last_attempt_at',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalsScalarFieldEnum = (typeof SaleInvoiceFiscalsScalarFieldEnum)[keyof typeof SaleInvoiceFiscalsScalarFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalAttemptsScalarFieldEnum = {
|
||||
export const SaleInvoiceTspAttemptsScalarFieldEnum = {
|
||||
id: 'id',
|
||||
attempt_no: 'attempt_no',
|
||||
status: 'status',
|
||||
@@ -679,10 +668,10 @@ export const SaleInvoiceFiscalAttemptsScalarFieldEnum = {
|
||||
sent_at: 'sent_at',
|
||||
received_at: 'received_at',
|
||||
created_at: 'created_at',
|
||||
fiscal_id: 'fiscal_id'
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalAttemptsScalarFieldEnum = (typeof SaleInvoiceFiscalAttemptsScalarFieldEnum)[keyof typeof SaleInvoiceFiscalAttemptsScalarFieldEnum]
|
||||
export type SaleInvoiceTspAttemptsScalarFieldEnum = (typeof SaleInvoiceTspAttemptsScalarFieldEnum)[keyof typeof SaleInvoiceTspAttemptsScalarFieldEnum]
|
||||
|
||||
|
||||
export const SalesInvoicePaymentScalarFieldEnum = {
|
||||
@@ -762,6 +751,13 @@ export const NullableJsonNullValueInput = {
|
||||
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
|
||||
|
||||
|
||||
export const JsonNullValueInput = {
|
||||
JsonNull: JsonNull
|
||||
} as const
|
||||
|
||||
export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput]
|
||||
|
||||
|
||||
export const AdminAccountOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
admin_id: 'admin_id',
|
||||
@@ -1204,22 +1200,14 @@ export const SalesInvoiceItemOrderByRelevanceFieldEnum = {
|
||||
export type SalesInvoiceItemOrderByRelevanceFieldEnum = (typeof SalesInvoiceItemOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceItemOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalsOrderByRelevanceFieldEnum = (typeof SaleInvoiceFiscalsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceFiscalsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum = {
|
||||
export const SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
tax_id: 'tax_id',
|
||||
error_message: 'error_message',
|
||||
fiscal_id: 'fiscal_id'
|
||||
invoice_id: 'invoice_id'
|
||||
} as const
|
||||
|
||||
export type SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum = (typeof SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceFiscalAttemptsOrderByRelevanceFieldEnum]
|
||||
export type SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum = (typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum)[keyof typeof SaleInvoiceTspAttemptsOrderByRelevanceFieldEnum]
|
||||
|
||||
|
||||
export const SalesInvoicePaymentOrderByRelevanceFieldEnum = {
|
||||
|
||||
@@ -49,8 +49,7 @@ export type * from './models/CustomerLegal.js'
|
||||
export type * from './models/Guild.js'
|
||||
export type * from './models/SalesInvoice.js'
|
||||
export type * from './models/SalesInvoiceItem.js'
|
||||
export type * from './models/SaleInvoiceFiscals.js'
|
||||
export type * from './models/SaleInvoiceFiscalAttempts.js'
|
||||
export type * from './models/SaleInvoiceTspAttempts.js'
|
||||
export type * from './models/SalesInvoicePayment.js'
|
||||
export type * from './models/SalesInvoicePaymentTerminalInfo.js'
|
||||
export type * from './models/Service.js'
|
||||
|
||||
@@ -20,16 +20,27 @@ export type BusinessActivityModel = runtime.Types.Result.DefaultSelection<Prisma
|
||||
|
||||
export type AggregateBusinessActivity = {
|
||||
_count: BusinessActivityCountAggregateOutputType | null
|
||||
_avg: BusinessActivityAvgAggregateOutputType | null
|
||||
_sum: BusinessActivitySumAggregateOutputType | null
|
||||
_min: BusinessActivityMinAggregateOutputType | null
|
||||
_max: BusinessActivityMaxAggregateOutputType | null
|
||||
}
|
||||
|
||||
export type BusinessActivityAvgAggregateOutputType = {
|
||||
invoice_number_sequence: runtime.Decimal | null
|
||||
}
|
||||
|
||||
export type BusinessActivitySumAggregateOutputType = {
|
||||
invoice_number_sequence: runtime.Decimal | null
|
||||
}
|
||||
|
||||
export type BusinessActivityMinAggregateOutputType = {
|
||||
id: string | null
|
||||
economic_code: string | null
|
||||
name: string | null
|
||||
fiscal_id: string | null
|
||||
partner_token: string | null
|
||||
invoice_number_sequence: runtime.Decimal | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
guild_id: string | null
|
||||
@@ -42,6 +53,7 @@ export type BusinessActivityMaxAggregateOutputType = {
|
||||
name: string | null
|
||||
fiscal_id: string | null
|
||||
partner_token: string | null
|
||||
invoice_number_sequence: runtime.Decimal | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
guild_id: string | null
|
||||
@@ -54,6 +66,7 @@ export type BusinessActivityCountAggregateOutputType = {
|
||||
name: number
|
||||
fiscal_id: number
|
||||
partner_token: number
|
||||
invoice_number_sequence: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
guild_id: number
|
||||
@@ -62,12 +75,21 @@ export type BusinessActivityCountAggregateOutputType = {
|
||||
}
|
||||
|
||||
|
||||
export type BusinessActivityAvgAggregateInputType = {
|
||||
invoice_number_sequence?: true
|
||||
}
|
||||
|
||||
export type BusinessActivitySumAggregateInputType = {
|
||||
invoice_number_sequence?: true
|
||||
}
|
||||
|
||||
export type BusinessActivityMinAggregateInputType = {
|
||||
id?: true
|
||||
economic_code?: true
|
||||
name?: true
|
||||
fiscal_id?: true
|
||||
partner_token?: true
|
||||
invoice_number_sequence?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
guild_id?: true
|
||||
@@ -80,6 +102,7 @@ export type BusinessActivityMaxAggregateInputType = {
|
||||
name?: true
|
||||
fiscal_id?: true
|
||||
partner_token?: true
|
||||
invoice_number_sequence?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
guild_id?: true
|
||||
@@ -92,6 +115,7 @@ export type BusinessActivityCountAggregateInputType = {
|
||||
name?: true
|
||||
fiscal_id?: true
|
||||
partner_token?: true
|
||||
invoice_number_sequence?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
guild_id?: true
|
||||
@@ -134,6 +158,18 @@ export type BusinessActivityAggregateArgs<ExtArgs extends runtime.Types.Extensio
|
||||
* Count returned BusinessActivities
|
||||
**/
|
||||
_count?: true | BusinessActivityCountAggregateInputType
|
||||
/**
|
||||
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
|
||||
*
|
||||
* Select which fields to average
|
||||
**/
|
||||
_avg?: BusinessActivityAvgAggregateInputType
|
||||
/**
|
||||
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
|
||||
*
|
||||
* Select which fields to sum
|
||||
**/
|
||||
_sum?: BusinessActivitySumAggregateInputType
|
||||
/**
|
||||
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
|
||||
*
|
||||
@@ -167,6 +203,8 @@ export type BusinessActivityGroupByArgs<ExtArgs extends runtime.Types.Extensions
|
||||
take?: number
|
||||
skip?: number
|
||||
_count?: BusinessActivityCountAggregateInputType | true
|
||||
_avg?: BusinessActivityAvgAggregateInputType
|
||||
_sum?: BusinessActivitySumAggregateInputType
|
||||
_min?: BusinessActivityMinAggregateInputType
|
||||
_max?: BusinessActivityMaxAggregateInputType
|
||||
}
|
||||
@@ -177,11 +215,14 @@ export type BusinessActivityGroupByOutputType = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence: runtime.Decimal
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
guild_id: string
|
||||
consumer_id: string
|
||||
_count: BusinessActivityCountAggregateOutputType | null
|
||||
_avg: BusinessActivityAvgAggregateOutputType | null
|
||||
_sum: BusinessActivitySumAggregateOutputType | null
|
||||
_min: BusinessActivityMinAggregateOutputType | null
|
||||
_max: BusinessActivityMaxAggregateOutputType | null
|
||||
}
|
||||
@@ -210,6 +251,7 @@ export type BusinessActivityWhereInput = {
|
||||
name?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
fiscal_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
partner_token?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
invoice_number_sequence?: Prisma.DecimalFilter<"BusinessActivity"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
guild_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
@@ -230,6 +272,7 @@ export type BusinessActivityOrderByWithRelationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
fiscal_id?: Prisma.SortOrder
|
||||
partner_token?: Prisma.SortOrder
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild_id?: Prisma.SortOrder
|
||||
@@ -255,6 +298,7 @@ export type BusinessActivityWhereUniqueInput = Prisma.AtLeast<{
|
||||
name?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
fiscal_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
partner_token?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
invoice_number_sequence?: Prisma.DecimalFilter<"BusinessActivity"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
guild_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
@@ -275,13 +319,16 @@ export type BusinessActivityOrderByWithAggregationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
fiscal_id?: Prisma.SortOrder
|
||||
partner_token?: Prisma.SortOrder
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild_id?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
_count?: Prisma.BusinessActivityCountOrderByAggregateInput
|
||||
_avg?: Prisma.BusinessActivityAvgOrderByAggregateInput
|
||||
_max?: Prisma.BusinessActivityMaxOrderByAggregateInput
|
||||
_min?: Prisma.BusinessActivityMinOrderByAggregateInput
|
||||
_sum?: Prisma.BusinessActivitySumOrderByAggregateInput
|
||||
}
|
||||
|
||||
export type BusinessActivityScalarWhereWithAggregatesInput = {
|
||||
@@ -293,6 +340,7 @@ export type BusinessActivityScalarWhereWithAggregatesInput = {
|
||||
name?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string
|
||||
fiscal_id?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string
|
||||
partner_token?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string
|
||||
invoice_number_sequence?: Prisma.DecimalWithAggregatesFilter<"BusinessActivity"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"BusinessActivity"> | Date | string
|
||||
updated_at?: Prisma.DateTimeWithAggregatesFilter<"BusinessActivity"> | Date | string
|
||||
guild_id?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string
|
||||
@@ -305,6 +353,7 @@ export type BusinessActivityCreateInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -323,6 +372,7 @@ export type BusinessActivityUncheckedCreateInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -341,6 +391,7 @@ export type BusinessActivityUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -359,6 +410,7 @@ export type BusinessActivityUncheckedUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -377,6 +429,7 @@ export type BusinessActivityCreateManyInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -389,6 +442,7 @@ export type BusinessActivityUpdateManyMutationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -399,6 +453,7 @@ export type BusinessActivityUncheckedUpdateManyInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -437,18 +492,24 @@ export type BusinessActivityCountOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
fiscal_id?: Prisma.SortOrder
|
||||
partner_token?: Prisma.SortOrder
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild_id?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type BusinessActivityAvgOrderByAggregateInput = {
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type BusinessActivityMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
economic_code?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
fiscal_id?: Prisma.SortOrder
|
||||
partner_token?: Prisma.SortOrder
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild_id?: Prisma.SortOrder
|
||||
@@ -461,12 +522,17 @@ export type BusinessActivityMinOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
fiscal_id?: Prisma.SortOrder
|
||||
partner_token?: Prisma.SortOrder
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
guild_id?: Prisma.SortOrder
|
||||
consumer_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type BusinessActivitySumOrderByAggregateInput = {
|
||||
invoice_number_sequence?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type BusinessActivityNullableScalarRelationFilter = {
|
||||
is?: Prisma.BusinessActivityWhereInput | null
|
||||
isNot?: Prisma.BusinessActivityWhereInput | null
|
||||
@@ -542,6 +608,14 @@ export type BusinessActivityUncheckedUpdateManyWithoutConsumerNestedInput = {
|
||||
deleteMany?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type DecimalFieldUpdateOperationsInput = {
|
||||
set?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
increment?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
divide?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type BusinessActivityCreateNestedOneWithoutComplexesInput = {
|
||||
create?: Prisma.XOR<Prisma.BusinessActivityCreateWithoutComplexesInput, Prisma.BusinessActivityUncheckedCreateWithoutComplexesInput>
|
||||
connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutComplexesInput
|
||||
@@ -648,6 +722,7 @@ export type BusinessActivityCreateWithoutLicense_activationInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -665,6 +740,7 @@ export type BusinessActivityUncheckedCreateWithoutLicense_activationInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -698,6 +774,7 @@ export type BusinessActivityUpdateWithoutLicense_activationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -715,6 +792,7 @@ export type BusinessActivityUncheckedUpdateWithoutLicense_activationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -732,6 +810,7 @@ export type BusinessActivityCreateWithoutPermission_businessesInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -749,6 +828,7 @@ export type BusinessActivityUncheckedCreateWithoutPermission_businessesInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -782,6 +862,7 @@ export type BusinessActivityUpdateWithoutPermission_businessesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -799,6 +880,7 @@ export type BusinessActivityUncheckedUpdateWithoutPermission_businessesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -816,6 +898,7 @@ export type BusinessActivityCreateWithoutConsumerInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -833,6 +916,7 @@ export type BusinessActivityUncheckedCreateWithoutConsumerInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -879,6 +963,7 @@ export type BusinessActivityScalarWhereInput = {
|
||||
name?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
fiscal_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
partner_token?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
invoice_number_sequence?: Prisma.DecimalFilter<"BusinessActivity"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string
|
||||
guild_id?: Prisma.StringFilter<"BusinessActivity"> | string
|
||||
@@ -891,6 +976,7 @@ export type BusinessActivityCreateWithoutComplexesInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -908,6 +994,7 @@ export type BusinessActivityUncheckedCreateWithoutComplexesInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -941,6 +1028,7 @@ export type BusinessActivityUpdateWithoutComplexesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -958,6 +1046,7 @@ export type BusinessActivityUncheckedUpdateWithoutComplexesInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -975,6 +1064,7 @@ export type BusinessActivityCreateWithoutGoodsInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -992,6 +1082,7 @@ export type BusinessActivityUncheckedCreateWithoutGoodsInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -1025,6 +1116,7 @@ export type BusinessActivityUpdateWithoutGoodsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -1042,6 +1134,7 @@ export type BusinessActivityUncheckedUpdateWithoutGoodsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1059,6 +1152,7 @@ export type BusinessActivityCreateWithoutCustomer_individualsInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -1076,6 +1170,7 @@ export type BusinessActivityUncheckedCreateWithoutCustomer_individualsInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -1109,6 +1204,7 @@ export type BusinessActivityUpdateWithoutCustomer_individualsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -1126,6 +1222,7 @@ export type BusinessActivityUncheckedUpdateWithoutCustomer_individualsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1143,6 +1240,7 @@ export type BusinessActivityCreateWithoutCustomer_legalsInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -1160,6 +1258,7 @@ export type BusinessActivityUncheckedCreateWithoutCustomer_legalsInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -1193,6 +1292,7 @@ export type BusinessActivityUpdateWithoutCustomer_legalsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -1210,6 +1310,7 @@ export type BusinessActivityUncheckedUpdateWithoutCustomer_legalsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1227,6 +1328,7 @@ export type BusinessActivityCreateWithoutGuildInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer: Prisma.ConsumerCreateNestedOneWithoutBusiness_activitiesInput
|
||||
@@ -1244,6 +1346,7 @@ export type BusinessActivityUncheckedCreateWithoutGuildInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
@@ -1287,6 +1390,7 @@ export type BusinessActivityCreateManyConsumerInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
guild_id: string
|
||||
@@ -1298,6 +1402,7 @@ export type BusinessActivityUpdateWithoutConsumerInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -1315,6 +1420,7 @@ export type BusinessActivityUncheckedUpdateWithoutConsumerInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1332,6 +1438,7 @@ export type BusinessActivityUncheckedUpdateManyWithoutConsumerInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
guild_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1343,6 +1450,7 @@ export type BusinessActivityCreateManyGuildInput = {
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
consumer_id: string
|
||||
@@ -1354,6 +1462,7 @@ export type BusinessActivityUpdateWithoutGuildInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer?: Prisma.ConsumerUpdateOneRequiredWithoutBusiness_activitiesNestedInput
|
||||
@@ -1371,6 +1480,7 @@ export type BusinessActivityUncheckedUpdateWithoutGuildInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1388,6 +1498,7 @@ export type BusinessActivityUncheckedUpdateManyWithoutGuildInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_token?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_number_sequence?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
@@ -1466,6 +1577,7 @@ export type BusinessActivitySelect<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
name?: boolean
|
||||
fiscal_id?: boolean
|
||||
partner_token?: boolean
|
||||
invoice_number_sequence?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
guild_id?: boolean
|
||||
@@ -1489,13 +1601,14 @@ export type BusinessActivitySelectScalar = {
|
||||
name?: boolean
|
||||
fiscal_id?: boolean
|
||||
partner_token?: boolean
|
||||
invoice_number_sequence?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
guild_id?: boolean
|
||||
consumer_id?: boolean
|
||||
}
|
||||
|
||||
export type BusinessActivityOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "economic_code" | "name" | "fiscal_id" | "partner_token" | "created_at" | "updated_at" | "guild_id" | "consumer_id", ExtArgs["result"]["businessActivity"]>
|
||||
export type BusinessActivityOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "economic_code" | "name" | "fiscal_id" | "partner_token" | "invoice_number_sequence" | "created_at" | "updated_at" | "guild_id" | "consumer_id", ExtArgs["result"]["businessActivity"]>
|
||||
export type BusinessActivityInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
guild?: boolean | Prisma.GuildDefaultArgs<ExtArgs>
|
||||
consumer?: boolean | Prisma.ConsumerDefaultArgs<ExtArgs>
|
||||
@@ -1526,6 +1639,7 @@ export type $BusinessActivityPayload<ExtArgs extends runtime.Types.Extensions.In
|
||||
name: string
|
||||
fiscal_id: string
|
||||
partner_token: string
|
||||
invoice_number_sequence: runtime.Decimal
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
guild_id: string
|
||||
@@ -1912,6 +2026,7 @@ export interface BusinessActivityFieldRefs {
|
||||
readonly name: Prisma.FieldRef<"BusinessActivity", 'String'>
|
||||
readonly fiscal_id: Prisma.FieldRef<"BusinessActivity", 'String'>
|
||||
readonly partner_token: Prisma.FieldRef<"BusinessActivity", 'String'>
|
||||
readonly invoice_number_sequence: Prisma.FieldRef<"BusinessActivity", 'Decimal'>
|
||||
readonly created_at: Prisma.FieldRef<"BusinessActivity", 'DateTime'>
|
||||
readonly updated_at: Prisma.FieldRef<"BusinessActivity", 'DateTime'>
|
||||
readonly guild_id: Prisma.FieldRef<"BusinessActivity", 'String'>
|
||||
|
||||
@@ -623,9 +623,9 @@ export type GoodSumOrderByAggregateInput = {
|
||||
base_sale_price?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type GoodNullableScalarRelationFilter = {
|
||||
is?: Prisma.GoodWhereInput | null
|
||||
isNot?: Prisma.GoodWhereInput | null
|
||||
export type GoodScalarRelationFilter = {
|
||||
is?: Prisma.GoodWhereInput
|
||||
isNot?: Prisma.GoodWhereInput
|
||||
}
|
||||
|
||||
export type GoodCreateNestedManyWithoutBusiness_activityInput = {
|
||||
@@ -818,12 +818,10 @@ export type GoodCreateNestedOneWithoutSales_invoice_itemsInput = {
|
||||
connect?: Prisma.GoodWhereUniqueInput
|
||||
}
|
||||
|
||||
export type GoodUpdateOneWithoutSales_invoice_itemsNestedInput = {
|
||||
export type GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.GoodCreateWithoutSales_invoice_itemsInput, Prisma.GoodUncheckedCreateWithoutSales_invoice_itemsInput>
|
||||
connectOrCreate?: Prisma.GoodCreateOrConnectWithoutSales_invoice_itemsInput
|
||||
upsert?: Prisma.GoodUpsertWithoutSales_invoice_itemsInput
|
||||
disconnect?: Prisma.GoodWhereInput | boolean
|
||||
delete?: Prisma.GoodWhereInput | boolean
|
||||
connect?: Prisma.GoodWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.GoodUpdateToOneWithWhereWithoutSales_invoice_itemsInput, Prisma.GoodUpdateWithoutSales_invoice_itemsInput>, Prisma.GoodUncheckedUpdateWithoutSales_invoice_itemsInput>
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ export type AggregateGuild = {
|
||||
export type GuildMinAggregateOutputType = {
|
||||
id: string | null
|
||||
name: string | null
|
||||
invoice_template: $Enums.InvoiceTemplateType | null
|
||||
code: string | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
@@ -35,6 +36,7 @@ export type GuildMinAggregateOutputType = {
|
||||
export type GuildMaxAggregateOutputType = {
|
||||
id: string | null
|
||||
name: string | null
|
||||
invoice_template: $Enums.InvoiceTemplateType | null
|
||||
code: string | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
@@ -43,6 +45,7 @@ export type GuildMaxAggregateOutputType = {
|
||||
export type GuildCountAggregateOutputType = {
|
||||
id: number
|
||||
name: number
|
||||
invoice_template: number
|
||||
code: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
@@ -53,6 +56,7 @@ export type GuildCountAggregateOutputType = {
|
||||
export type GuildMinAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
invoice_template?: true
|
||||
code?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
@@ -61,6 +65,7 @@ export type GuildMinAggregateInputType = {
|
||||
export type GuildMaxAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
invoice_template?: true
|
||||
code?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
@@ -69,6 +74,7 @@ export type GuildMaxAggregateInputType = {
|
||||
export type GuildCountAggregateInputType = {
|
||||
id?: true
|
||||
name?: true
|
||||
invoice_template?: true
|
||||
code?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
@@ -150,6 +156,7 @@ export type GuildGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalAr
|
||||
export type GuildGroupByOutputType = {
|
||||
id: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code: string | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
@@ -179,6 +186,7 @@ export type GuildWhereInput = {
|
||||
NOT?: Prisma.GuildWhereInput | Prisma.GuildWhereInput[]
|
||||
id?: Prisma.StringFilter<"Guild"> | string
|
||||
name?: Prisma.StringFilter<"Guild"> | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFilter<"Guild"> | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.StringNullableFilter<"Guild"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Guild"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Guild"> | Date | string
|
||||
@@ -189,6 +197,7 @@ export type GuildWhereInput = {
|
||||
export type GuildOrderByWithRelationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
invoice_template?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -203,6 +212,7 @@ export type GuildWhereUniqueInput = Prisma.AtLeast<{
|
||||
OR?: Prisma.GuildWhereInput[]
|
||||
NOT?: Prisma.GuildWhereInput | Prisma.GuildWhereInput[]
|
||||
name?: Prisma.StringFilter<"Guild"> | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFilter<"Guild"> | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.StringNullableFilter<"Guild"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Guild"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Guild"> | Date | string
|
||||
@@ -213,6 +223,7 @@ export type GuildWhereUniqueInput = Prisma.AtLeast<{
|
||||
export type GuildOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
invoice_template?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -227,6 +238,7 @@ export type GuildScalarWhereWithAggregatesInput = {
|
||||
NOT?: Prisma.GuildScalarWhereWithAggregatesInput | Prisma.GuildScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.StringWithAggregatesFilter<"Guild"> | string
|
||||
name?: Prisma.StringWithAggregatesFilter<"Guild"> | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeWithAggregatesFilter<"Guild"> | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.StringNullableWithAggregatesFilter<"Guild"> | string | null
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"Guild"> | Date | string
|
||||
updated_at?: Prisma.DateTimeWithAggregatesFilter<"Guild"> | Date | string
|
||||
@@ -235,6 +247,7 @@ export type GuildScalarWhereWithAggregatesInput = {
|
||||
export type GuildCreateInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -245,6 +258,7 @@ export type GuildCreateInput = {
|
||||
export type GuildUncheckedCreateInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -255,6 +269,7 @@ export type GuildUncheckedCreateInput = {
|
||||
export type GuildUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -265,6 +280,7 @@ export type GuildUpdateInput = {
|
||||
export type GuildUncheckedUpdateInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -275,6 +291,7 @@ export type GuildUncheckedUpdateInput = {
|
||||
export type GuildCreateManyInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -283,6 +300,7 @@ export type GuildCreateManyInput = {
|
||||
export type GuildUpdateManyMutationInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -291,6 +309,7 @@ export type GuildUpdateManyMutationInput = {
|
||||
export type GuildUncheckedUpdateManyInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -315,6 +334,7 @@ export type GuildOrderByRelevanceInput = {
|
||||
export type GuildCountOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
invoice_template?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -323,6 +343,7 @@ export type GuildCountOrderByAggregateInput = {
|
||||
export type GuildMaxOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
invoice_template?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -331,6 +352,7 @@ export type GuildMaxOrderByAggregateInput = {
|
||||
export type GuildMinOrderByAggregateInput = {
|
||||
id?: Prisma.SortOrder
|
||||
name?: Prisma.SortOrder
|
||||
invoice_template?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -366,9 +388,14 @@ export type GuildUpdateOneWithoutGood_categoriesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.GuildUpdateToOneWithWhereWithoutGood_categoriesInput, Prisma.GuildUpdateWithoutGood_categoriesInput>, Prisma.GuildUncheckedUpdateWithoutGood_categoriesInput>
|
||||
}
|
||||
|
||||
export type EnumInvoiceTemplateTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.InvoiceTemplateType
|
||||
}
|
||||
|
||||
export type GuildCreateWithoutBusiness_activitiesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -378,6 +405,7 @@ export type GuildCreateWithoutBusiness_activitiesInput = {
|
||||
export type GuildUncheckedCreateWithoutBusiness_activitiesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -403,6 +431,7 @@ export type GuildUpdateToOneWithWhereWithoutBusiness_activitiesInput = {
|
||||
export type GuildUpdateWithoutBusiness_activitiesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -412,6 +441,7 @@ export type GuildUpdateWithoutBusiness_activitiesInput = {
|
||||
export type GuildUncheckedUpdateWithoutBusiness_activitiesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -421,6 +451,7 @@ export type GuildUncheckedUpdateWithoutBusiness_activitiesInput = {
|
||||
export type GuildCreateWithoutGood_categoriesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -430,6 +461,7 @@ export type GuildCreateWithoutGood_categoriesInput = {
|
||||
export type GuildUncheckedCreateWithoutGood_categoriesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -455,6 +487,7 @@ export type GuildUpdateToOneWithWhereWithoutGood_categoriesInput = {
|
||||
export type GuildUpdateWithoutGood_categoriesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -464,6 +497,7 @@ export type GuildUpdateWithoutGood_categoriesInput = {
|
||||
export type GuildUncheckedUpdateWithoutGood_categoriesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
invoice_template?: Prisma.EnumInvoiceTemplateTypeFieldUpdateOperationsInput | $Enums.InvoiceTemplateType
|
||||
code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -513,6 +547,7 @@ export type GuildCountOutputTypeCountGood_categoriesArgs<ExtArgs extends runtime
|
||||
export type GuildSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
invoice_template?: boolean
|
||||
code?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
@@ -526,12 +561,13 @@ export type GuildSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
export type GuildSelectScalar = {
|
||||
id?: boolean
|
||||
name?: boolean
|
||||
invoice_template?: boolean
|
||||
code?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
}
|
||||
|
||||
export type GuildOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "code" | "created_at" | "updated_at", ExtArgs["result"]["guild"]>
|
||||
export type GuildOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "invoice_template" | "code" | "created_at" | "updated_at", ExtArgs["result"]["guild"]>
|
||||
export type GuildInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
business_activities?: boolean | Prisma.Guild$business_activitiesArgs<ExtArgs>
|
||||
good_categories?: boolean | Prisma.Guild$good_categoriesArgs<ExtArgs>
|
||||
@@ -547,6 +583,7 @@ export type $GuildPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
name: string
|
||||
invoice_template: $Enums.InvoiceTemplateType
|
||||
code: string | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
@@ -923,6 +960,7 @@ export interface Prisma__GuildClient<T, Null = never, ExtArgs extends runtime.Ty
|
||||
export interface GuildFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"Guild", 'String'>
|
||||
readonly name: Prisma.FieldRef<"Guild", 'String'>
|
||||
readonly invoice_template: Prisma.FieldRef<"Guild", 'InvoiceTemplateType'>
|
||||
readonly code: Prisma.FieldRef<"Guild", 'String'>
|
||||
readonly created_at: Prisma.FieldRef<"Guild", 'DateTime'>
|
||||
readonly updated_at: Prisma.FieldRef<"Guild", 'DateTime'>
|
||||
|
||||
@@ -29,7 +29,7 @@ export type PartnerMinAggregateOutputType = {
|
||||
name: string | null
|
||||
code: string | null
|
||||
status: $Enums.PartnerStatus | null
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType | null
|
||||
tsp_provider: $Enums.TspProviderType | null
|
||||
logo_url: string | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
@@ -40,7 +40,7 @@ export type PartnerMaxAggregateOutputType = {
|
||||
name: string | null
|
||||
code: string | null
|
||||
status: $Enums.PartnerStatus | null
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType | null
|
||||
tsp_provider: $Enums.TspProviderType | null
|
||||
logo_url: string | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
@@ -51,7 +51,7 @@ export type PartnerCountAggregateOutputType = {
|
||||
name: number
|
||||
code: number
|
||||
status: number
|
||||
fiscal_switch_type: number
|
||||
tsp_provider: number
|
||||
logo_url: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
@@ -64,7 +64,7 @@ export type PartnerMinAggregateInputType = {
|
||||
name?: true
|
||||
code?: true
|
||||
status?: true
|
||||
fiscal_switch_type?: true
|
||||
tsp_provider?: true
|
||||
logo_url?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
@@ -75,7 +75,7 @@ export type PartnerMaxAggregateInputType = {
|
||||
name?: true
|
||||
code?: true
|
||||
status?: true
|
||||
fiscal_switch_type?: true
|
||||
tsp_provider?: true
|
||||
logo_url?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
@@ -86,7 +86,7 @@ export type PartnerCountAggregateInputType = {
|
||||
name?: true
|
||||
code?: true
|
||||
status?: true
|
||||
fiscal_switch_type?: true
|
||||
tsp_provider?: true
|
||||
logo_url?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
@@ -170,7 +170,7 @@ export type PartnerGroupByOutputType = {
|
||||
name: string
|
||||
code: string
|
||||
status: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider: $Enums.TspProviderType
|
||||
logo_url: string | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
@@ -202,7 +202,7 @@ export type PartnerWhereInput = {
|
||||
name?: Prisma.StringFilter<"Partner"> | string
|
||||
code?: Prisma.StringFilter<"Partner"> | string
|
||||
status?: Prisma.EnumPartnerStatusFilter<"Partner"> | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFilter<"Partner"> | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFilter<"Partner"> | $Enums.TspProviderType
|
||||
logo_url?: Prisma.StringNullableFilter<"Partner"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Partner"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Partner"> | Date | string
|
||||
@@ -219,7 +219,7 @@ export type PartnerOrderByWithRelationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
fiscal_switch_type?: Prisma.SortOrder
|
||||
tsp_provider?: Prisma.SortOrder
|
||||
logo_url?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -240,7 +240,7 @@ export type PartnerWhereUniqueInput = Prisma.AtLeast<{
|
||||
NOT?: Prisma.PartnerWhereInput | Prisma.PartnerWhereInput[]
|
||||
name?: Prisma.StringFilter<"Partner"> | string
|
||||
status?: Prisma.EnumPartnerStatusFilter<"Partner"> | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFilter<"Partner"> | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFilter<"Partner"> | $Enums.TspProviderType
|
||||
logo_url?: Prisma.StringNullableFilter<"Partner"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Partner"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Partner"> | Date | string
|
||||
@@ -257,7 +257,7 @@ export type PartnerOrderByWithAggregationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
fiscal_switch_type?: Prisma.SortOrder
|
||||
tsp_provider?: Prisma.SortOrder
|
||||
logo_url?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -274,7 +274,7 @@ export type PartnerScalarWhereWithAggregatesInput = {
|
||||
name?: Prisma.StringWithAggregatesFilter<"Partner"> | string
|
||||
code?: Prisma.StringWithAggregatesFilter<"Partner"> | string
|
||||
status?: Prisma.EnumPartnerStatusWithAggregatesFilter<"Partner"> | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeWithAggregatesFilter<"Partner"> | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeWithAggregatesFilter<"Partner"> | $Enums.TspProviderType
|
||||
logo_url?: Prisma.StringNullableWithAggregatesFilter<"Partner"> | string | null
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"Partner"> | Date | string
|
||||
updated_at?: Prisma.DateTimeWithAggregatesFilter<"Partner"> | Date | string
|
||||
@@ -285,7 +285,7 @@ export type PartnerCreateInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -302,7 +302,7 @@ export type PartnerUncheckedCreateInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -319,7 +319,7 @@ export type PartnerUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -336,7 +336,7 @@ export type PartnerUncheckedUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -353,7 +353,7 @@ export type PartnerCreateManyInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -364,7 +364,7 @@ export type PartnerUpdateManyMutationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -375,7 +375,7 @@ export type PartnerUncheckedUpdateManyInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -397,7 +397,7 @@ export type PartnerCountOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
fiscal_switch_type?: Prisma.SortOrder
|
||||
tsp_provider?: Prisma.SortOrder
|
||||
logo_url?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -408,7 +408,7 @@ export type PartnerMaxOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
fiscal_switch_type?: Prisma.SortOrder
|
||||
tsp_provider?: Prisma.SortOrder
|
||||
logo_url?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -419,7 +419,7 @@ export type PartnerMinOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
code?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
fiscal_switch_type?: Prisma.SortOrder
|
||||
tsp_provider?: Prisma.SortOrder
|
||||
logo_url?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
@@ -485,8 +485,8 @@ export type EnumPartnerStatusFieldUpdateOperationsInput = {
|
||||
set?: $Enums.PartnerStatus
|
||||
}
|
||||
|
||||
export type EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.PartnerFiscalSwitchType
|
||||
export type EnumTspProviderTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.TspProviderType
|
||||
}
|
||||
|
||||
export type PartnerCreateNestedOneWithoutConsumers_individualInput = {
|
||||
@@ -522,7 +522,7 @@ export type PartnerCreateWithoutLicense_charge_transactionsInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -538,7 +538,7 @@ export type PartnerUncheckedCreateWithoutLicense_charge_transactionsInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -570,7 +570,7 @@ export type PartnerUpdateWithoutLicense_charge_transactionsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -586,7 +586,7 @@ export type PartnerUncheckedUpdateWithoutLicense_charge_transactionsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -602,7 +602,7 @@ export type PartnerCreateWithoutLicense_renew_charge_transactionsInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -618,7 +618,7 @@ export type PartnerUncheckedCreateWithoutLicense_renew_charge_transactionsInput
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -650,7 +650,7 @@ export type PartnerUpdateWithoutLicense_renew_charge_transactionsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -666,7 +666,7 @@ export type PartnerUncheckedUpdateWithoutLicense_renew_charge_transactionsInput
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -682,7 +682,7 @@ export type PartnerCreateWithoutAccount_quota_charge_transactionsInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -698,7 +698,7 @@ export type PartnerUncheckedCreateWithoutAccount_quota_charge_transactionsInput
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -730,7 +730,7 @@ export type PartnerUpdateWithoutAccount_quota_charge_transactionsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -746,7 +746,7 @@ export type PartnerUncheckedUpdateWithoutAccount_quota_charge_transactionsInput
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -762,7 +762,7 @@ export type PartnerCreateWithoutAccountsInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -778,7 +778,7 @@ export type PartnerUncheckedCreateWithoutAccountsInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -810,7 +810,7 @@ export type PartnerUpdateWithoutAccountsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -826,7 +826,7 @@ export type PartnerUncheckedUpdateWithoutAccountsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -842,7 +842,7 @@ export type PartnerCreateWithoutConsumers_individualInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -858,7 +858,7 @@ export type PartnerUncheckedCreateWithoutConsumers_individualInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -890,7 +890,7 @@ export type PartnerUpdateWithoutConsumers_individualInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -906,7 +906,7 @@ export type PartnerUncheckedUpdateWithoutConsumers_individualInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -922,7 +922,7 @@ export type PartnerCreateWithoutConsumers_legalInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -938,7 +938,7 @@ export type PartnerUncheckedCreateWithoutConsumers_legalInput = {
|
||||
name: string
|
||||
code: string
|
||||
status?: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: $Enums.TspProviderType
|
||||
logo_url?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
@@ -970,7 +970,7 @@ export type PartnerUpdateWithoutConsumers_legalInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -986,7 +986,7 @@ export type PartnerUncheckedUpdateWithoutConsumers_legalInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumPartnerStatusFieldUpdateOperationsInput | $Enums.PartnerStatus
|
||||
fiscal_switch_type?: Prisma.EnumPartnerFiscalSwitchTypeFieldUpdateOperationsInput | $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider?: Prisma.EnumTspProviderTypeFieldUpdateOperationsInput | $Enums.TspProviderType
|
||||
logo_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
@@ -1078,7 +1078,7 @@ export type PartnerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
name?: boolean
|
||||
code?: boolean
|
||||
status?: boolean
|
||||
fiscal_switch_type?: boolean
|
||||
tsp_provider?: boolean
|
||||
logo_url?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
@@ -1098,13 +1098,13 @@ export type PartnerSelectScalar = {
|
||||
name?: boolean
|
||||
code?: boolean
|
||||
status?: boolean
|
||||
fiscal_switch_type?: boolean
|
||||
tsp_provider?: boolean
|
||||
logo_url?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
}
|
||||
|
||||
export type PartnerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "code" | "status" | "fiscal_switch_type" | "logo_url" | "created_at" | "updated_at", ExtArgs["result"]["partner"]>
|
||||
export type PartnerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "code" | "status" | "tsp_provider" | "logo_url" | "created_at" | "updated_at", ExtArgs["result"]["partner"]>
|
||||
export type PartnerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
accounts?: boolean | Prisma.Partner$accountsArgs<ExtArgs>
|
||||
consumers_individual?: boolean | Prisma.Partner$consumers_individualArgs<ExtArgs>
|
||||
@@ -1130,7 +1130,7 @@ export type $PartnerPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
name: string
|
||||
code: string
|
||||
status: $Enums.PartnerStatus
|
||||
fiscal_switch_type: $Enums.PartnerFiscalSwitchType
|
||||
tsp_provider: $Enums.TspProviderType
|
||||
logo_url: string | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
@@ -1513,7 +1513,7 @@ export interface PartnerFieldRefs {
|
||||
readonly name: Prisma.FieldRef<"Partner", 'String'>
|
||||
readonly code: Prisma.FieldRef<"Partner", 'String'>
|
||||
readonly status: Prisma.FieldRef<"Partner", 'PartnerStatus'>
|
||||
readonly fiscal_switch_type: Prisma.FieldRef<"Partner", 'PartnerFiscalSwitchType'>
|
||||
readonly tsp_provider: Prisma.FieldRef<"Partner", 'TspProviderType'>
|
||||
readonly logo_url: Prisma.FieldRef<"Partner", 'String'>
|
||||
readonly created_at: Prisma.FieldRef<"Partner", 'DateTime'>
|
||||
readonly updated_at: Prisma.FieldRef<"Partner", 'DateTime'>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -275,9 +275,9 @@ export type SalesInvoiceWhereInput = {
|
||||
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
|
||||
consumer_account?: Prisma.XOR<Prisma.ConsumerAccountScalarRelationFilter, Prisma.ConsumerAccountWhereInput>
|
||||
pos?: Prisma.XOR<Prisma.PosScalarRelationFilter, Prisma.PosWhereInput>
|
||||
fiscal?: Prisma.XOR<Prisma.SaleInvoiceFiscalsNullableScalarRelationFilter, Prisma.SaleInvoiceFiscalsWhereInput> | null
|
||||
items?: Prisma.SalesInvoiceItemListRelationFilter
|
||||
payments?: Prisma.SalesInvoicePaymentListRelationFilter
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsListRelationFilter
|
||||
}
|
||||
|
||||
export type SalesInvoiceOrderByWithRelationInput = {
|
||||
@@ -296,9 +296,9 @@ export type SalesInvoiceOrderByWithRelationInput = {
|
||||
customer?: Prisma.CustomerOrderByWithRelationInput
|
||||
consumer_account?: Prisma.ConsumerAccountOrderByWithRelationInput
|
||||
pos?: Prisma.PosOrderByWithRelationInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsOrderByWithRelationInput
|
||||
items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
|
||||
payments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.SalesInvoiceOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -322,9 +322,9 @@ export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{
|
||||
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
|
||||
consumer_account?: Prisma.XOR<Prisma.ConsumerAccountScalarRelationFilter, Prisma.ConsumerAccountWhereInput>
|
||||
pos?: Prisma.XOR<Prisma.PosScalarRelationFilter, Prisma.PosWhereInput>
|
||||
fiscal?: Prisma.XOR<Prisma.SaleInvoiceFiscalsNullableScalarRelationFilter, Prisma.SaleInvoiceFiscalsWhereInput> | null
|
||||
items?: Prisma.SalesInvoiceItemListRelationFilter
|
||||
payments?: Prisma.SalesInvoicePaymentListRelationFilter
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsListRelationFilter
|
||||
}, "id" | "code" | "invoice_number_pos_id">
|
||||
|
||||
export type SalesInvoiceOrderByWithAggregationInput = {
|
||||
@@ -378,9 +378,9 @@ export type SalesInvoiceCreateInput = {
|
||||
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
|
||||
consumer_account: Prisma.ConsumerAccountCreateNestedOneWithoutSales_invoicesInput
|
||||
pos: Prisma.PosCreateNestedOneWithoutSales_invoicesInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateInput = {
|
||||
@@ -396,9 +396,9 @@ export type SalesInvoiceUncheckedCreateInput = {
|
||||
customer_id?: string | null
|
||||
consumer_account_id: string
|
||||
pos_id: string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUpdateInput = {
|
||||
@@ -414,9 +414,9 @@ export type SalesInvoiceUpdateInput = {
|
||||
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
|
||||
consumer_account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateInput = {
|
||||
@@ -432,9 +432,9 @@ export type SalesInvoiceUncheckedUpdateInput = {
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateManyInput = {
|
||||
@@ -698,18 +698,18 @@ export type SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutItemsInput, Prisma.SalesInvoiceUpdateWithoutItemsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput>
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateNestedOneWithoutFiscalInput = {
|
||||
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutFiscalInput, Prisma.SalesInvoiceUncheckedCreateWithoutFiscalInput>
|
||||
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutFiscalInput
|
||||
export type SalesInvoiceCreateNestedOneWithoutTsp_attemptsInput = {
|
||||
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutTsp_attemptsInput, Prisma.SalesInvoiceUncheckedCreateWithoutTsp_attemptsInput>
|
||||
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutTsp_attemptsInput
|
||||
connect?: Prisma.SalesInvoiceWhereUniqueInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUpdateOneRequiredWithoutFiscalNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutFiscalInput, Prisma.SalesInvoiceUncheckedCreateWithoutFiscalInput>
|
||||
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutFiscalInput
|
||||
upsert?: Prisma.SalesInvoiceUpsertWithoutFiscalInput
|
||||
export type SalesInvoiceUpdateOneRequiredWithoutTsp_attemptsNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutTsp_attemptsInput, Prisma.SalesInvoiceUncheckedCreateWithoutTsp_attemptsInput>
|
||||
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutTsp_attemptsInput
|
||||
upsert?: Prisma.SalesInvoiceUpsertWithoutTsp_attemptsInput
|
||||
connect?: Prisma.SalesInvoiceWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutFiscalInput, Prisma.SalesInvoiceUpdateWithoutFiscalInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutFiscalInput>
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutTsp_attemptsInput, Prisma.SalesInvoiceUpdateWithoutTsp_attemptsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutTsp_attemptsInput>
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateNestedOneWithoutPaymentsInput = {
|
||||
@@ -738,9 +738,9 @@ export type SalesInvoiceCreateWithoutConsumer_accountInput = {
|
||||
updated_at?: Date | string
|
||||
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
|
||||
pos: Prisma.PosCreateNestedOneWithoutSales_invoicesInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateWithoutConsumer_accountInput = {
|
||||
@@ -755,9 +755,9 @@ export type SalesInvoiceUncheckedCreateWithoutConsumer_accountInput = {
|
||||
updated_at?: Date | string
|
||||
customer_id?: string | null
|
||||
pos_id: string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateOrConnectWithoutConsumer_accountInput = {
|
||||
@@ -816,9 +816,9 @@ export type SalesInvoiceCreateWithoutPosInput = {
|
||||
updated_at?: Date | string
|
||||
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
|
||||
consumer_account: Prisma.ConsumerAccountCreateNestedOneWithoutSales_invoicesInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateWithoutPosInput = {
|
||||
@@ -833,9 +833,9 @@ export type SalesInvoiceUncheckedCreateWithoutPosInput = {
|
||||
updated_at?: Date | string
|
||||
customer_id?: string | null
|
||||
consumer_account_id: string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateOrConnectWithoutPosInput = {
|
||||
@@ -876,9 +876,9 @@ export type SalesInvoiceCreateWithoutCustomerInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_account: Prisma.ConsumerAccountCreateNestedOneWithoutSales_invoicesInput
|
||||
pos: Prisma.PosCreateNestedOneWithoutSales_invoicesInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
|
||||
@@ -893,9 +893,9 @@ export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
|
||||
updated_at?: Date | string
|
||||
consumer_account_id: string
|
||||
pos_id: string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateOrConnectWithoutCustomerInput = {
|
||||
@@ -937,8 +937,8 @@ export type SalesInvoiceCreateWithoutItemsInput = {
|
||||
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
|
||||
consumer_account: Prisma.ConsumerAccountCreateNestedOneWithoutSales_invoicesInput
|
||||
pos: Prisma.PosCreateNestedOneWithoutSales_invoicesInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsCreateNestedOneWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
|
||||
@@ -954,8 +954,8 @@ export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
|
||||
customer_id?: string | null
|
||||
consumer_account_id: string
|
||||
pos_id: string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedCreateNestedOneWithoutInvoiceInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateOrConnectWithoutItemsInput = {
|
||||
@@ -987,8 +987,8 @@ export type SalesInvoiceUpdateWithoutItemsInput = {
|
||||
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
|
||||
consumer_account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUpdateOneWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
|
||||
@@ -1004,11 +1004,11 @@ export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedUpdateOneWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateWithoutFiscalInput = {
|
||||
export type SalesInvoiceCreateWithoutTsp_attemptsInput = {
|
||||
id?: string
|
||||
code: string
|
||||
total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
@@ -1025,7 +1025,7 @@ export type SalesInvoiceCreateWithoutFiscalInput = {
|
||||
payments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateWithoutFiscalInput = {
|
||||
export type SalesInvoiceUncheckedCreateWithoutTsp_attemptsInput = {
|
||||
id?: string
|
||||
code: string
|
||||
total_amount: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
@@ -1042,23 +1042,23 @@ export type SalesInvoiceUncheckedCreateWithoutFiscalInput = {
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateOrConnectWithoutFiscalInput = {
|
||||
export type SalesInvoiceCreateOrConnectWithoutTsp_attemptsInput = {
|
||||
where: Prisma.SalesInvoiceWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutFiscalInput, Prisma.SalesInvoiceUncheckedCreateWithoutFiscalInput>
|
||||
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutTsp_attemptsInput, Prisma.SalesInvoiceUncheckedCreateWithoutTsp_attemptsInput>
|
||||
}
|
||||
|
||||
export type SalesInvoiceUpsertWithoutFiscalInput = {
|
||||
update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutFiscalInput, Prisma.SalesInvoiceUncheckedUpdateWithoutFiscalInput>
|
||||
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutFiscalInput, Prisma.SalesInvoiceUncheckedCreateWithoutFiscalInput>
|
||||
export type SalesInvoiceUpsertWithoutTsp_attemptsInput = {
|
||||
update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutTsp_attemptsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutTsp_attemptsInput>
|
||||
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutTsp_attemptsInput, Prisma.SalesInvoiceUncheckedCreateWithoutTsp_attemptsInput>
|
||||
where?: Prisma.SalesInvoiceWhereInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUpdateToOneWithWhereWithoutFiscalInput = {
|
||||
export type SalesInvoiceUpdateToOneWithWhereWithoutTsp_attemptsInput = {
|
||||
where?: Prisma.SalesInvoiceWhereInput
|
||||
data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutFiscalInput, Prisma.SalesInvoiceUncheckedUpdateWithoutFiscalInput>
|
||||
data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutTsp_attemptsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutTsp_attemptsInput>
|
||||
}
|
||||
|
||||
export type SalesInvoiceUpdateWithoutFiscalInput = {
|
||||
export type SalesInvoiceUpdateWithoutTsp_attemptsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
@@ -1075,7 +1075,7 @@ export type SalesInvoiceUpdateWithoutFiscalInput = {
|
||||
payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateWithoutFiscalInput = {
|
||||
export type SalesInvoiceUncheckedUpdateWithoutTsp_attemptsInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
code?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
total_amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
@@ -1105,8 +1105,8 @@ export type SalesInvoiceCreateWithoutPaymentsInput = {
|
||||
customer?: Prisma.CustomerCreateNestedOneWithoutSales_invoicesInput
|
||||
consumer_account: Prisma.ConsumerAccountCreateNestedOneWithoutSales_invoicesInput
|
||||
pos: Prisma.PosCreateNestedOneWithoutSales_invoicesInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedCreateWithoutPaymentsInput = {
|
||||
@@ -1122,8 +1122,8 @@ export type SalesInvoiceUncheckedCreateWithoutPaymentsInput = {
|
||||
customer_id?: string | null
|
||||
consumer_account_id: string
|
||||
pos_id: string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedCreateNestedOneWithoutInvoiceInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedCreateNestedManyWithoutInvoiceInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateOrConnectWithoutPaymentsInput = {
|
||||
@@ -1155,8 +1155,8 @@ export type SalesInvoiceUpdateWithoutPaymentsInput = {
|
||||
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
|
||||
consumer_account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateWithoutPaymentsInput = {
|
||||
@@ -1172,8 +1172,8 @@ export type SalesInvoiceUncheckedUpdateWithoutPaymentsInput = {
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceCreateManyConsumer_accountInput = {
|
||||
@@ -1202,9 +1202,9 @@ export type SalesInvoiceUpdateWithoutConsumer_accountInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateWithoutConsumer_accountInput = {
|
||||
@@ -1219,9 +1219,9 @@ export type SalesInvoiceUncheckedUpdateWithoutConsumer_accountInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateManyWithoutConsumer_accountInput = {
|
||||
@@ -1264,9 +1264,9 @@ export type SalesInvoiceUpdateWithoutPosInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
customer?: Prisma.CustomerUpdateOneWithoutSales_invoicesNestedInput
|
||||
consumer_account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateWithoutPosInput = {
|
||||
@@ -1281,9 +1281,9 @@ export type SalesInvoiceUncheckedUpdateWithoutPosInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumer_account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateManyWithoutPosInput = {
|
||||
@@ -1326,9 +1326,9 @@ export type SalesInvoiceUpdateWithoutCustomerInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_account?: Prisma.ConsumerAccountUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutSales_invoicesNestedInput
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
|
||||
@@ -1343,9 +1343,9 @@ export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
consumer_account_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
fiscal?: Prisma.SaleInvoiceFiscalsUncheckedUpdateOneWithoutInvoiceNestedInput
|
||||
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
payments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
tsp_attempts?: Prisma.SaleInvoiceTspAttemptsUncheckedUpdateManyWithoutInvoiceNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = {
|
||||
@@ -1370,11 +1370,13 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = {
|
||||
export type SalesInvoiceCountOutputType = {
|
||||
items: number
|
||||
payments: number
|
||||
tsp_attempts: number
|
||||
}
|
||||
|
||||
export type SalesInvoiceCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
items?: boolean | SalesInvoiceCountOutputTypeCountItemsArgs
|
||||
payments?: boolean | SalesInvoiceCountOutputTypeCountPaymentsArgs
|
||||
tsp_attempts?: boolean | SalesInvoiceCountOutputTypeCountTsp_attemptsArgs
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1401,6 +1403,13 @@ export type SalesInvoiceCountOutputTypeCountPaymentsArgs<ExtArgs extends runtime
|
||||
where?: Prisma.SalesInvoicePaymentWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoiceCountOutputType without action
|
||||
*/
|
||||
export type SalesInvoiceCountOutputTypeCountTsp_attemptsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.SaleInvoiceTspAttemptsWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -1418,9 +1427,9 @@ export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.Internal
|
||||
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
|
||||
consumer_account?: boolean | Prisma.ConsumerAccountDefaultArgs<ExtArgs>
|
||||
pos?: boolean | Prisma.PosDefaultArgs<ExtArgs>
|
||||
fiscal?: boolean | Prisma.SalesInvoice$fiscalArgs<ExtArgs>
|
||||
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
|
||||
payments?: boolean | Prisma.SalesInvoice$paymentsArgs<ExtArgs>
|
||||
tsp_attempts?: boolean | Prisma.SalesInvoice$tsp_attemptsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["salesInvoice"]>
|
||||
|
||||
@@ -1446,9 +1455,9 @@ export type SalesInvoiceInclude<ExtArgs extends runtime.Types.Extensions.Interna
|
||||
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
|
||||
consumer_account?: boolean | Prisma.ConsumerAccountDefaultArgs<ExtArgs>
|
||||
pos?: boolean | Prisma.PosDefaultArgs<ExtArgs>
|
||||
fiscal?: boolean | Prisma.SalesInvoice$fiscalArgs<ExtArgs>
|
||||
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
|
||||
payments?: boolean | Prisma.SalesInvoice$paymentsArgs<ExtArgs>
|
||||
tsp_attempts?: boolean | Prisma.SalesInvoice$tsp_attemptsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
@@ -1458,9 +1467,9 @@ export type $SalesInvoicePayload<ExtArgs extends runtime.Types.Extensions.Intern
|
||||
customer: Prisma.$CustomerPayload<ExtArgs> | null
|
||||
consumer_account: Prisma.$ConsumerAccountPayload<ExtArgs>
|
||||
pos: Prisma.$PosPayload<ExtArgs>
|
||||
fiscal: Prisma.$SaleInvoiceFiscalsPayload<ExtArgs> | null
|
||||
items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
|
||||
payments: Prisma.$SalesInvoicePaymentPayload<ExtArgs>[]
|
||||
tsp_attempts: Prisma.$SaleInvoiceTspAttemptsPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -1818,9 +1827,9 @@ export interface Prisma__SalesInvoiceClient<T, Null = never, ExtArgs extends run
|
||||
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>
|
||||
consumer_account<T extends Prisma.ConsumerAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ConsumerAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__ConsumerAccountClient<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
pos<T extends Prisma.PosDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PosDefaultArgs<ExtArgs>>): Prisma.Prisma__PosClient<runtime.Types.Result.GetResult<Prisma.$PosPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
fiscal<T extends Prisma.SalesInvoice$fiscalArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$fiscalArgs<ExtArgs>>): Prisma.Prisma__SaleInvoiceFiscalsClient<runtime.Types.Result.GetResult<Prisma.$SaleInvoiceFiscalsPayload<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>
|
||||
payments<T extends Prisma.SalesInvoice$paymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$paymentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePaymentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
tsp_attempts<T extends Prisma.SalesInvoice$tsp_attemptsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$tsp_attemptsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SaleInvoiceTspAttemptsPayload<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.
|
||||
@@ -2228,25 +2237,6 @@ export type SalesInvoice$customerArgs<ExtArgs extends runtime.Types.Extensions.I
|
||||
where?: Prisma.CustomerWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoice.fiscal
|
||||
*/
|
||||
export type SalesInvoice$fiscalArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the SaleInvoiceFiscals
|
||||
*/
|
||||
select?: Prisma.SaleInvoiceFiscalsSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the SaleInvoiceFiscals
|
||||
*/
|
||||
omit?: Prisma.SaleInvoiceFiscalsOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.SaleInvoiceFiscalsInclude<ExtArgs> | null
|
||||
where?: Prisma.SaleInvoiceFiscalsWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoice.items
|
||||
*/
|
||||
@@ -2295,6 +2285,30 @@ export type SalesInvoice$paymentsArgs<ExtArgs extends runtime.Types.Extensions.I
|
||||
distinct?: Prisma.SalesInvoicePaymentScalarFieldEnum | Prisma.SalesInvoicePaymentScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoice.tsp_attempts
|
||||
*/
|
||||
export type SalesInvoice$tsp_attemptsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the SaleInvoiceTspAttempts
|
||||
*/
|
||||
select?: Prisma.SaleInvoiceTspAttemptsSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the SaleInvoiceTspAttempts
|
||||
*/
|
||||
omit?: Prisma.SaleInvoiceTspAttemptsOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.SaleInvoiceTspAttemptsInclude<ExtArgs> | null
|
||||
where?: Prisma.SaleInvoiceTspAttemptsWhereInput
|
||||
orderBy?: Prisma.SaleInvoiceTspAttemptsOrderByWithRelationInput | Prisma.SaleInvoiceTspAttemptsOrderByWithRelationInput[]
|
||||
cursor?: Prisma.SaleInvoiceTspAttemptsWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.SaleInvoiceTspAttemptsScalarFieldEnum | Prisma.SaleInvoiceTspAttemptsScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoice without action
|
||||
*/
|
||||
|
||||
@@ -266,9 +266,9 @@ export type SalesInvoiceItemGroupByOutputType = {
|
||||
discount: runtime.Decimal
|
||||
notes: string | null
|
||||
payload: runtime.JsonValue | null
|
||||
good_snapshot: runtime.JsonValue | null
|
||||
good_snapshot: runtime.JsonValue
|
||||
invoice_id: string
|
||||
good_id: string | null
|
||||
good_id: string
|
||||
service_id: string | null
|
||||
_count: SalesInvoiceItemCountAggregateOutputType | null
|
||||
_avg: SalesInvoiceItemAvgAggregateOutputType | null
|
||||
@@ -308,12 +308,12 @@ export type SalesInvoiceItemWhereInput = {
|
||||
discount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
payload?: Prisma.JsonNullableFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonNullableFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonFilter<"SalesInvoiceItem">
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
good?: Prisma.XOR<Prisma.GoodNullableScalarRelationFilter, Prisma.GoodWhereInput> | null
|
||||
good?: Prisma.XOR<Prisma.GoodScalarRelationFilter, Prisma.GoodWhereInput>
|
||||
service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null
|
||||
}
|
||||
|
||||
@@ -330,9 +330,9 @@ export type SalesInvoiceItemOrderByWithRelationInput = {
|
||||
discount?: Prisma.SortOrder
|
||||
notes?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good_snapshot?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good_snapshot?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
invoice?: Prisma.SalesInvoiceOrderByWithRelationInput
|
||||
good?: Prisma.GoodOrderByWithRelationInput
|
||||
@@ -356,12 +356,12 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
|
||||
discount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
payload?: Prisma.JsonNullableFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonNullableFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonFilter<"SalesInvoiceItem">
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
invoice?: Prisma.XOR<Prisma.SalesInvoiceScalarRelationFilter, Prisma.SalesInvoiceWhereInput>
|
||||
good?: Prisma.XOR<Prisma.GoodNullableScalarRelationFilter, Prisma.GoodWhereInput> | null
|
||||
good?: Prisma.XOR<Prisma.GoodScalarRelationFilter, Prisma.GoodWhereInput>
|
||||
service?: Prisma.XOR<Prisma.ServiceNullableScalarRelationFilter, Prisma.ServiceWhereInput> | null
|
||||
}, "id">
|
||||
|
||||
@@ -378,9 +378,9 @@ export type SalesInvoiceItemOrderByWithAggregationInput = {
|
||||
discount?: Prisma.SortOrder
|
||||
notes?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
payload?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good_snapshot?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good_snapshot?: Prisma.SortOrder
|
||||
invoice_id?: Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
good_id?: Prisma.SortOrder
|
||||
service_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
_count?: Prisma.SalesInvoiceItemCountOrderByAggregateInput
|
||||
_avg?: Prisma.SalesInvoiceItemAvgOrderByAggregateInput
|
||||
@@ -405,9 +405,9 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = {
|
||||
discount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null
|
||||
payload?: Prisma.JsonNullableWithAggregatesFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonNullableWithAggregatesFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonWithAggregatesFilter<"SalesInvoiceItem">
|
||||
invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null
|
||||
good_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null
|
||||
}
|
||||
|
||||
@@ -424,9 +424,9 @@ export type SalesInvoiceItemCreateInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
good: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
|
||||
@@ -443,9 +443,9 @@ export type SalesInvoiceItemUncheckedCreateInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
good_id?: string | null
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
}
|
||||
|
||||
@@ -462,9 +462,9 @@ export type SalesInvoiceItemUpdateInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
good?: Prisma.GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput
|
||||
service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
|
||||
@@ -481,9 +481,9 @@ export type SalesInvoiceItemUncheckedUpdateInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
@@ -500,9 +500,9 @@ export type SalesInvoiceItemCreateManyInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
good_id?: string | null
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ export type SalesInvoiceItemUpdateManyMutationInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateManyInput = {
|
||||
@@ -535,9 +535,9 @@ export type SalesInvoiceItemUncheckedUpdateManyInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
@@ -765,7 +765,7 @@ export type SalesInvoiceItemCreateWithoutGoodInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
@@ -783,7 +783,7 @@ export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
service_id?: string | null
|
||||
}
|
||||
@@ -830,9 +830,9 @@ export type SalesInvoiceItemScalarWhereInput = {
|
||||
discount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
payload?: Prisma.JsonNullableFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonNullableFilter<"SalesInvoiceItem">
|
||||
good_snapshot?: Prisma.JsonFilter<"SalesInvoiceItem">
|
||||
invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
good_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
good_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string
|
||||
service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null
|
||||
}
|
||||
|
||||
@@ -849,8 +849,8 @@ export type SalesInvoiceItemCreateWithoutInvoiceInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
|
||||
@@ -867,8 +867,8 @@ export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: string | null
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
}
|
||||
|
||||
@@ -911,9 +911,9 @@ export type SalesInvoiceItemCreateWithoutServiceInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
|
||||
good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
good: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = {
|
||||
@@ -929,9 +929,9 @@ export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
good_id?: string | null
|
||||
good_id: string
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemCreateOrConnectWithoutServiceInput = {
|
||||
@@ -973,7 +973,7 @@ export type SalesInvoiceItemCreateManyGoodInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
service_id?: string | null
|
||||
}
|
||||
@@ -991,7 +991,7 @@ export type SalesInvoiceItemUpdateWithoutGoodInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
@@ -1009,7 +1009,7 @@ export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
@@ -1045,8 +1045,8 @@ export type SalesInvoiceItemCreateManyInvoiceInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: string | null
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id: string
|
||||
service_id?: string | null
|
||||
}
|
||||
|
||||
@@ -1063,8 +1063,8 @@ export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good?: Prisma.GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput
|
||||
service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
|
||||
@@ -1081,8 +1081,8 @@ export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
@@ -1099,8 +1099,8 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
@@ -1117,9 +1117,9 @@ export type SalesInvoiceItemCreateManyServiceInput = {
|
||||
discount?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id: string
|
||||
good_id?: string | null
|
||||
good_id: string
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUpdateWithoutServiceInput = {
|
||||
@@ -1135,9 +1135,9 @@ export type SalesInvoiceItemUpdateWithoutServiceInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
|
||||
good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput
|
||||
good?: Prisma.GoodUpdateOneRequiredWithoutSales_invoice_itemsNestedInput
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
|
||||
@@ -1153,9 +1153,9 @@ export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
|
||||
@@ -1171,9 +1171,9 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = {
|
||||
discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue
|
||||
good_snapshot?: Prisma.JsonNullValueInput | runtime.InputJsonValue
|
||||
invoice_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
good_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
|
||||
@@ -1196,7 +1196,7 @@ export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
good_id?: boolean
|
||||
service_id?: boolean
|
||||
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
|
||||
good?: boolean | Prisma.SalesInvoiceItem$goodArgs<ExtArgs>
|
||||
good?: boolean | Prisma.GoodDefaultArgs<ExtArgs>
|
||||
service?: boolean | Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["salesInvoiceItem"]>
|
||||
|
||||
@@ -1224,7 +1224,7 @@ export type SalesInvoiceItemSelectScalar = {
|
||||
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "measure_unit_text" | "measure_unit_code" | "sku_code" | "sku_vat" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "payload" | "good_snapshot" | "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>
|
||||
good?: boolean | Prisma.GoodDefaultArgs<ExtArgs>
|
||||
service?: boolean | Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>
|
||||
}
|
||||
|
||||
@@ -1232,7 +1232,7 @@ export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.In
|
||||
name: "SalesInvoiceItem"
|
||||
objects: {
|
||||
invoice: Prisma.$SalesInvoicePayload<ExtArgs>
|
||||
good: Prisma.$GoodPayload<ExtArgs> | null
|
||||
good: Prisma.$GoodPayload<ExtArgs>
|
||||
service: Prisma.$ServicePayload<ExtArgs> | null
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
@@ -1248,9 +1248,9 @@ export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.In
|
||||
discount: runtime.Decimal
|
||||
notes: string | null
|
||||
payload: runtime.JsonValue | null
|
||||
good_snapshot: runtime.JsonValue | null
|
||||
good_snapshot: runtime.JsonValue
|
||||
invoice_id: string
|
||||
good_id: string | null
|
||||
good_id: string
|
||||
service_id: string | null
|
||||
}, ExtArgs["result"]["salesInvoiceItem"]>
|
||||
composites: {}
|
||||
@@ -1593,7 +1593,7 @@ readonly fields: SalesInvoiceItemFieldRefs;
|
||||
export interface Prisma__SalesInvoiceItemClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
invoice<T extends Prisma.SalesInvoiceDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceDefaultArgs<ExtArgs>>): Prisma.Prisma__SalesInvoiceClient<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
good<T extends Prisma.SalesInvoiceItem$goodArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceItem$goodArgs<ExtArgs>>): Prisma.Prisma__GoodClient<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
good<T extends Prisma.GoodDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.GoodDefaultArgs<ExtArgs>>): Prisma.Prisma__GoodClient<runtime.Types.Result.GetResult<Prisma.$GoodPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
service<T extends Prisma.SalesInvoiceItem$serviceArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoiceItem$serviceArgs<ExtArgs>>): Prisma.Prisma__ServiceClient<runtime.Types.Result.GetResult<Prisma.$ServicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
@@ -1987,25 +1987,6 @@ export type SalesInvoiceItemDeleteManyArgs<ExtArgs extends runtime.Types.Extensi
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoiceItem.good
|
||||
*/
|
||||
export type SalesInvoiceItem$goodArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Good
|
||||
*/
|
||||
select?: Prisma.GoodSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Good
|
||||
*/
|
||||
omit?: Prisma.GoodOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.GoodInclude<ExtArgs> | null
|
||||
where?: Prisma.GoodWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* SalesInvoiceItem.service
|
||||
*/
|
||||
|
||||
@@ -318,7 +318,7 @@ export type StockKeepingUnitsCreateInput = {
|
||||
code: string
|
||||
name: string
|
||||
VAT: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
type?: $Enums.SKUGuildType
|
||||
type: $Enums.SKUGuildType
|
||||
is_public?: boolean
|
||||
is_domestic?: boolean
|
||||
created_at?: Date | string
|
||||
@@ -331,7 +331,7 @@ export type StockKeepingUnitsUncheckedCreateInput = {
|
||||
code: string
|
||||
name: string
|
||||
VAT: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
type?: $Enums.SKUGuildType
|
||||
type: $Enums.SKUGuildType
|
||||
is_public?: boolean
|
||||
is_domestic?: boolean
|
||||
created_at?: Date | string
|
||||
@@ -370,7 +370,7 @@ export type StockKeepingUnitsCreateManyInput = {
|
||||
code: string
|
||||
name: string
|
||||
VAT: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
type?: $Enums.SKUGuildType
|
||||
type: $Enums.SKUGuildType
|
||||
is_public?: boolean
|
||||
is_domestic?: boolean
|
||||
created_at?: Date | string
|
||||
@@ -470,14 +470,6 @@ export type StockKeepingUnitsUpdateOneRequiredWithoutGoodsNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.StockKeepingUnitsUpdateToOneWithWhereWithoutGoodsInput, Prisma.StockKeepingUnitsUpdateWithoutGoodsInput>, Prisma.StockKeepingUnitsUncheckedUpdateWithoutGoodsInput>
|
||||
}
|
||||
|
||||
export type DecimalFieldUpdateOperationsInput = {
|
||||
set?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
increment?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
divide?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
}
|
||||
|
||||
export type EnumSKUGuildTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.SKUGuildType
|
||||
}
|
||||
@@ -487,7 +479,7 @@ export type StockKeepingUnitsCreateWithoutGoodsInput = {
|
||||
code: string
|
||||
name: string
|
||||
VAT: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
type?: $Enums.SKUGuildType
|
||||
type: $Enums.SKUGuildType
|
||||
is_public?: boolean
|
||||
is_domestic?: boolean
|
||||
created_at?: Date | string
|
||||
@@ -499,7 +491,7 @@ export type StockKeepingUnitsUncheckedCreateWithoutGoodsInput = {
|
||||
code: string
|
||||
name: string
|
||||
VAT: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||
type?: $Enums.SKUGuildType
|
||||
type: $Enums.SKUGuildType
|
||||
is_public?: boolean
|
||||
is_domestic?: boolean
|
||||
created_at?: Date | string
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
import { IsOptional, IsString } from 'class-validator'
|
||||
import { InvoiceTemplateType } from '@/generated/prisma/enums'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { IsEnum, IsString } from 'class-validator'
|
||||
|
||||
export class CreateGuildDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
code?: string
|
||||
code: string
|
||||
|
||||
@ApiProperty({ required: true, enum: InvoiceTemplateType })
|
||||
@IsEnum(InvoiceTemplateType)
|
||||
invoice_template: InvoiceTemplateType
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PartnerFiscalSwitchType, PartnerStatus } from '@/generated/prisma/enums'
|
||||
import { PartnerStatus, TspProviderType } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsNumber, IsOptional, IsString } from 'class-validator'
|
||||
|
||||
@@ -11,9 +11,9 @@ export class CreatePartnerDto {
|
||||
@ApiProperty({ required: true })
|
||||
code: string
|
||||
|
||||
@IsEnum(PartnerFiscalSwitchType)
|
||||
@ApiProperty({ required: true })
|
||||
fiscal_switch_type: PartnerFiscalSwitchType
|
||||
@IsEnum(TspProviderType)
|
||||
@ApiProperty({ required: true, enum: TspProviderType })
|
||||
tsp_provider: TspProviderType
|
||||
|
||||
// @IsOptional()
|
||||
// @IsNumber()
|
||||
|
||||
@@ -27,7 +27,7 @@ export class PartnersService {
|
||||
code: true,
|
||||
status: true,
|
||||
logo_url: true,
|
||||
fiscal_switch_type: true,
|
||||
tsp_provider: true,
|
||||
created_at: true,
|
||||
license_charge_transactions: {
|
||||
select: {
|
||||
|
||||
@@ -12,6 +12,9 @@ export class BusinessActivitiesService {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
created_at: true,
|
||||
partner_token: true,
|
||||
fiscal_id: true,
|
||||
invoice_number_sequence: true,
|
||||
guild: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsString } from 'class-validator'
|
||||
import { IsNumber, IsString, Max, Min } from 'class-validator'
|
||||
|
||||
export class CreateBusinessActivityDto {
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
name: string
|
||||
|
||||
@ApiProperty({ required: false, default: '1' })
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
@Max(1_000_000_000)
|
||||
invoice_number_sequence: number
|
||||
}
|
||||
|
||||
export class UpdateBusinessActivityDto extends PartialType(CreateBusinessActivityDto) {}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import {
|
||||
TaxSwitchBulkSendResultDto as FiscalSwitchBulkSendResultDto,
|
||||
TaxSwitchSendItemResultDto as FiscalSwitchSendItemResultDto,
|
||||
TaxSwitchSendPayloadDto as FiscalSwitchSendPayloadDto,
|
||||
TaxSwitchGetResultDto,
|
||||
} from './dto/tax-switch.dto'
|
||||
import { NamaTaxSwitchAdapter } from './switch/nama/nama-fiscal-switch.adapter'
|
||||
|
||||
@Injectable()
|
||||
export class SalesInvoiceFiscalSwitchService {
|
||||
constructor(private readonly namaAdapter: NamaTaxSwitchAdapter) {}
|
||||
|
||||
private resolveSwitch(providerCode?: string | null) {
|
||||
const normalizedCode = providerCode?.trim().toUpperCase() || ''
|
||||
|
||||
switch (normalizedCode) {
|
||||
case 'NAMA':
|
||||
default:
|
||||
return this.namaAdapter
|
||||
}
|
||||
}
|
||||
|
||||
async send(
|
||||
payload: FiscalSwitchSendPayloadDto,
|
||||
): Promise<FiscalSwitchSendItemResultDto[]> {
|
||||
const adapter = this.resolveSwitch(payload.provider_code)
|
||||
return adapter.send(payload)
|
||||
}
|
||||
|
||||
async sendBulk(
|
||||
payloads: FiscalSwitchSendPayloadDto[],
|
||||
): Promise<FiscalSwitchBulkSendResultDto[]> {
|
||||
const groupedByProvider = new Map<string, FiscalSwitchSendPayloadDto[]>()
|
||||
|
||||
for (const payload of payloads) {
|
||||
const key = payload.provider_code?.trim().toUpperCase() || 'NAMA'
|
||||
const currentGroup = groupedByProvider.get(key) || []
|
||||
currentGroup.push(payload)
|
||||
groupedByProvider.set(key, currentGroup)
|
||||
}
|
||||
|
||||
const result: FiscalSwitchBulkSendResultDto[] = []
|
||||
for (const [providerCode, groupedPayloads] of groupedByProvider.entries()) {
|
||||
const adapter = this.resolveSwitch(providerCode)
|
||||
const providerResult = await adapter.sendBulk(groupedPayloads)
|
||||
result.push(...providerResult)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
async get(
|
||||
providerCode: string | null | undefined,
|
||||
taxId: string,
|
||||
): Promise<TaxSwitchGetResultDto> {
|
||||
const adapter = this.resolveSwitch(providerCode)
|
||||
return adapter.get(taxId)
|
||||
}
|
||||
}
|
||||
@@ -1,372 +0,0 @@
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable, NotFoundException } from '@nestjs/common'
|
||||
import {
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
Prisma,
|
||||
} from 'generated/prisma/client'
|
||||
import {
|
||||
TaxSendStatus,
|
||||
TaxSwitchGetResultDto,
|
||||
TaxSwitchSendItemResultDto,
|
||||
TaxSwitchSendPayloadDto,
|
||||
} from './dto/tax-switch.dto'
|
||||
import { SalesInvoiceFiscalSwitchService } from './sales-invoice-fiscal-switch.service'
|
||||
|
||||
type TaxRow = {
|
||||
id: string
|
||||
retry_count: number
|
||||
}
|
||||
|
||||
type ItemTaxProviderRow = {
|
||||
provider_code: string | null
|
||||
tax_id: string | null
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class SalesInvoiceFiscalService {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly taxSwitchService: SalesInvoiceFiscalSwitchService,
|
||||
) {}
|
||||
|
||||
async send(consumer_id: string, invoice_id: string): Promise<void> {
|
||||
const posId = await this.getPosId(consumer_id, invoice_id)
|
||||
const payload = await this.buildPayload(invoice_id, posId)
|
||||
|
||||
const itemResults = await this.trySend(payload)
|
||||
await this.persistAttemptResults(itemResults)
|
||||
}
|
||||
|
||||
async sendBulk(consumer_id: string, invoice_ids: string[]): Promise<void> {
|
||||
if (!invoice_ids.length) return
|
||||
|
||||
const payloads: TaxSwitchSendPayloadDto[] = []
|
||||
for (const invoiceId of invoice_ids) {
|
||||
const posId = await this.getPosId(consumer_id, invoiceId)
|
||||
payloads.push(await this.buildPayload(invoiceId, posId))
|
||||
}
|
||||
|
||||
const bulkResult = await this.taxSwitchService.sendBulk(payloads)
|
||||
const allItemResults = bulkResult.flatMap(result => result.items)
|
||||
await this.persistAttemptResults(allItemResults)
|
||||
}
|
||||
|
||||
async get(invoiceItemId: string, posId: string): Promise<TaxSwitchGetResultDto> {
|
||||
const rows = await this.prisma.$queryRaw<ItemTaxProviderRow[]>(Prisma.sql`
|
||||
SELECT p.code AS provider_code, t.tax_id AS tax_id
|
||||
FROM sales_invoice_item_taxes t
|
||||
INNER JOIN sales_invoice_items si ON si.id = t.invoice_item_id
|
||||
INNER JOIN sales_invoices s ON s.id = si.invoice_id
|
||||
INNER JOIN poses pz ON pz.id = s.pos_id
|
||||
LEFT JOIN providers p ON p.id = pz.provider_id
|
||||
WHERE t.invoice_item_id = ${invoiceItemId} AND s.pos_id = ${posId}
|
||||
LIMIT 1
|
||||
`)
|
||||
|
||||
if (!rows.length || !rows[0].tax_id) {
|
||||
throw new NotFoundException('Tax id for this invoice item was not found.')
|
||||
}
|
||||
|
||||
return this.taxSwitchService.get(rows[0].provider_code, rows[0].tax_id)
|
||||
}
|
||||
|
||||
private async getPosId(consumer_id: string, invoice_id: string): Promise<string> {
|
||||
const now = new Date()
|
||||
const saleInvoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoice_id,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
pos: {
|
||||
select: {
|
||||
id: true,
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
name: true,
|
||||
license_activation: {
|
||||
select: {
|
||||
expires_at: true,
|
||||
license_renews: {
|
||||
select: {
|
||||
expires_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!saleInvoice) {
|
||||
throw new NotFoundException('متاسفانه فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { license_activation, name: businessName } =
|
||||
saleInvoice.pos.complex.business_activity
|
||||
let expired = !license_activation || false
|
||||
if (license_activation) {
|
||||
const { expires_at, license_renews } = license_activation
|
||||
if (expires_at < now) {
|
||||
for (const renew of license_renews) {
|
||||
if (renew.expires_at > now) {
|
||||
expired = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (expired) {
|
||||
throw new NotFoundException(`متاسفانه مجوز ${businessName} منقضی شده است.`)
|
||||
}
|
||||
|
||||
return saleInvoice.pos.id
|
||||
}
|
||||
|
||||
private async buildPayload(
|
||||
invoiceId: string,
|
||||
posId: string,
|
||||
): Promise<TaxSwitchSendPayloadDto> {
|
||||
const invoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos_id: posId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
total_amount: true,
|
||||
invoice_date: true,
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
measure_unit_code: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
sku_vat: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
payload: true,
|
||||
good_snapshot: true,
|
||||
},
|
||||
},
|
||||
pos: {
|
||||
select: {
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
fiscal_id: true,
|
||||
economic_code: true,
|
||||
consumer: {
|
||||
select: {
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
national_id: true,
|
||||
mobile_number: true,
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!invoice) {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { partner } = (invoice.pos.complex.business_activity.consumer.legal ||
|
||||
invoice.pos.complex.business_activity.consumer.individual)!
|
||||
|
||||
return {
|
||||
invoice_id: invoice.id,
|
||||
invoice_code: invoice.code,
|
||||
invoice_date: invoice.invoice_date,
|
||||
total_amount: Number(invoice.total_amount),
|
||||
// provider_code: invoice.pos.provider?.code || null,
|
||||
type: FiscalRequestType.MAIN,
|
||||
provider_code: partner.fiscal_switch_type!,
|
||||
customer_type: invoice.customer?.type
|
||||
? FiscalInvoiceCustomerType.Known
|
||||
: FiscalInvoiceCustomerType.Unknown,
|
||||
customer: invoice.customer?.type
|
||||
? {
|
||||
type: invoice.customer.type,
|
||||
legal_info: invoice.customer.legal ?? undefined,
|
||||
individual_info: invoice.customer.individual ?? undefined,
|
||||
}
|
||||
: undefined,
|
||||
items: invoice.items.map(item => ({
|
||||
invoice_item_id: item.id,
|
||||
quantity: Number(item.quantity),
|
||||
unit_price: Number(item.unit_price),
|
||||
total_amount: Number(item.total_amount),
|
||||
measure_unit: item.measure_unit_code,
|
||||
sku: item.sku_code,
|
||||
sku_vat: String(item.sku_vat),
|
||||
discount: String((item.payload as Record<string, any>)?.discount || '0'),
|
||||
good_id: item.good_id,
|
||||
service_id: item.service_id,
|
||||
payload: item.payload,
|
||||
good_snapshot: item.good_snapshot,
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
private async trySend(
|
||||
payload: TaxSwitchSendPayloadDto,
|
||||
): Promise<TaxSwitchSendItemResultDto[]> {
|
||||
try {
|
||||
return await this.taxSwitchService.send(payload)
|
||||
} catch (error: any) {
|
||||
const message = error?.message || 'Unexpected tax switch error.'
|
||||
const now = new Date()
|
||||
return payload.items.map(item => ({
|
||||
invoice_item_id: item.invoice_item_id,
|
||||
status: TaxSendStatus.FAILED,
|
||||
error_message: message,
|
||||
sent_at: now.toISOString(),
|
||||
received_at: now.toISOString(),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
private async persistAttemptResults(
|
||||
itemResults: TaxSwitchSendItemResultDto[],
|
||||
): Promise<void> {
|
||||
if (!itemResults.length) return
|
||||
|
||||
await this.prisma.$transaction(async $tx => {
|
||||
for (const itemResult of itemResults) {
|
||||
await $tx.$executeRaw(Prisma.sql`
|
||||
INSERT INTO sales_invoice_item_taxes (
|
||||
id,
|
||||
tax_id,
|
||||
status,
|
||||
retry_count,
|
||||
last_attempt_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
invoice_item_id
|
||||
) VALUES (
|
||||
UUID(),
|
||||
${itemResult.tax_id || null},
|
||||
${itemResult.status},
|
||||
0,
|
||||
${itemResult.sent_at || new Date()},
|
||||
NOW(),
|
||||
NOW(),
|
||||
${itemResult.invoice_item_id}
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
updated_at = NOW()
|
||||
`)
|
||||
|
||||
const rows = await $tx.$queryRaw<TaxRow[]>(Prisma.sql`
|
||||
SELECT id, retry_count
|
||||
FROM sales_invoice_item_taxes
|
||||
WHERE invoice_item_id = ${itemResult.invoice_item_id}
|
||||
LIMIT 1
|
||||
`)
|
||||
|
||||
if (!rows.length) continue
|
||||
|
||||
const itemTaxRow = rows[0]
|
||||
const attemptNo = Number(itemTaxRow.retry_count || 0) + 1
|
||||
|
||||
await $tx.$executeRaw(Prisma.sql`
|
||||
INSERT INTO sales_invoice_item_tax_attempts (
|
||||
id,
|
||||
attempt_no,
|
||||
status,
|
||||
tax_id,
|
||||
request_payload,
|
||||
response_payload,
|
||||
error_message,
|
||||
sent_at,
|
||||
received_at,
|
||||
created_at,
|
||||
item_tax_id
|
||||
) VALUES (
|
||||
UUID(),
|
||||
${attemptNo},
|
||||
${itemResult.status},
|
||||
${itemResult.tax_id || null},
|
||||
${JSON.stringify(itemResult.request_payload ?? null)},
|
||||
${JSON.stringify(itemResult.response_payload ?? null)},
|
||||
${itemResult.error_message || null},
|
||||
${itemResult.sent_at ? new Date(itemResult.sent_at) : new Date()},
|
||||
${itemResult.received_at ? new Date(itemResult.received_at) : new Date()},
|
||||
NOW(),
|
||||
${itemTaxRow.id}
|
||||
)
|
||||
`)
|
||||
|
||||
await $tx.$executeRaw(Prisma.sql`
|
||||
UPDATE sales_invoice_item_taxes
|
||||
SET
|
||||
tax_id = COALESCE(${itemResult.tax_id || null}, tax_id),
|
||||
status = ${itemResult.status},
|
||||
retry_count = ${attemptNo},
|
||||
last_attempt_at = ${itemResult.sent_at ? new Date(itemResult.sent_at) : new Date()},
|
||||
updated_at = NOW()
|
||||
WHERE id = ${itemTaxRow.id}
|
||||
`)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
import {
|
||||
CustomerType,
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import {
|
||||
ITaxSwitchAdapter,
|
||||
TaxSendStatus,
|
||||
TaxSwitchBulkSendResultDto,
|
||||
TaxSwitchGetResultDto,
|
||||
TaxSwitchSendItemResultDto,
|
||||
TaxSwitchSendPayloadDto,
|
||||
} from '../../dto/tax-switch.dto'
|
||||
import {
|
||||
NamaTaxGetResponseDto,
|
||||
NamaTaxRequestDto,
|
||||
NamaTaxSendItemResponseDto,
|
||||
} from './nama-fiscal-switch.dto'
|
||||
|
||||
@Injectable()
|
||||
export class NamaTaxSwitchAdapter implements ITaxSwitchAdapter {
|
||||
readonly code = 'NAMA'
|
||||
private readonly sandboxBaseUrl =
|
||||
process.env.NAMA_FISCAL_SANDBOX_URL || 'https://sandbox-api.nama.ir'
|
||||
private readonly productionBaseUrl =
|
||||
process.env.NAMA_FISCAL_PRODUCTION_URL || 'https://api.nama.ir'
|
||||
|
||||
private readonly sendPath = '/api/v1/fiscal/invoices/single-send'
|
||||
private readonly sendBulkPath = '/api/v1/invoices'
|
||||
private readonly checkStatus = '/api/v1/invoices/check-by-uuids'
|
||||
private readonly checkBulkStatus = '/api/v1/invoices/check-by-uuids'
|
||||
private readonly getPath = '/api/v1/fiscal/invoices/'
|
||||
|
||||
private get baseUrl() {
|
||||
return process.env.NODE_ENV === 'production'
|
||||
? this.productionBaseUrl
|
||||
: this.sandboxBaseUrl
|
||||
}
|
||||
|
||||
private buildSendUrl() {
|
||||
return `${this.baseUrl}${this.sendPath}`
|
||||
}
|
||||
|
||||
private buildGetUrl(taxId: string) {
|
||||
return `${this.baseUrl}${this.getPath}/${taxId}`
|
||||
}
|
||||
|
||||
async send(payload: TaxSwitchSendPayloadDto): Promise<TaxSwitchSendItemResultDto[]> {
|
||||
const mappedRequest = this.mapToNamaRequestDto(payload)
|
||||
|
||||
return payload.items.map((item, index) => {
|
||||
const sentAt = new Date()
|
||||
const receivedAt = new Date(sentAt.getTime() + 50)
|
||||
|
||||
const providerResponse: NamaTaxSendItemResponseDto = {
|
||||
invoice_item_id: item.invoice_item_id,
|
||||
status: TaxSendStatus.SENT,
|
||||
tax_id: `TAX-${payload.invoice_code}-${index + 1}`,
|
||||
request_payload: {
|
||||
url: this.buildSendUrl(),
|
||||
body: mappedRequest,
|
||||
},
|
||||
response_payload: {
|
||||
provider: this.code,
|
||||
env: process.env.NODE_ENV || 'development',
|
||||
endpoint: this.buildSendUrl(),
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
sent_at: sentAt.toISOString(),
|
||||
received_at: receivedAt.toISOString(),
|
||||
}
|
||||
|
||||
return {
|
||||
invoice_item_id: providerResponse.invoice_item_id,
|
||||
status: providerResponse.status,
|
||||
tax_id: providerResponse.tax_id,
|
||||
request_payload: providerResponse.request_payload,
|
||||
response_payload: providerResponse.response_payload,
|
||||
error_message: providerResponse.error_message,
|
||||
sent_at: providerResponse.sent_at,
|
||||
received_at: providerResponse.received_at,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async sendBulk(
|
||||
payloads: TaxSwitchSendPayloadDto[],
|
||||
): Promise<TaxSwitchBulkSendResultDto[]> {
|
||||
const result: TaxSwitchBulkSendResultDto[] = []
|
||||
for (const payload of payloads) {
|
||||
const itemResults = await this.send(payload)
|
||||
result.push({
|
||||
invoice_id: payload.invoice_id,
|
||||
items: itemResults,
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
async get(taxId: string): Promise<TaxSwitchGetResultDto> {
|
||||
const providerResponse: NamaTaxGetResponseDto = {
|
||||
tax_id: taxId,
|
||||
status: TaxSendStatus.SENT,
|
||||
response_payload: {
|
||||
provider: this.code,
|
||||
env: process.env.NODE_ENV || 'development',
|
||||
endpoint: this.buildGetUrl(taxId),
|
||||
status: 'CONFIRMED',
|
||||
tracking_code: taxId,
|
||||
},
|
||||
received_at: new Date().toISOString(),
|
||||
}
|
||||
|
||||
return {
|
||||
tax_id: providerResponse.tax_id,
|
||||
status: providerResponse.status,
|
||||
response_payload: providerResponse.response_payload,
|
||||
received_at: providerResponse.received_at,
|
||||
}
|
||||
}
|
||||
|
||||
private mapToNamaRequestDto(payload: TaxSwitchSendPayloadDto): NamaTaxRequestDto {
|
||||
return {
|
||||
uuid: payload.invoice_id,
|
||||
economic_code: '',
|
||||
fiscal_id: '',
|
||||
payment: [],
|
||||
header: {
|
||||
ins: this.mapFiscalRequestType(payload.type),
|
||||
inp: '2',
|
||||
inty: this.mapFiscalInvoiceCustomerType(payload.customer_type),
|
||||
// unique_tax_code: payload.invoice_code,
|
||||
inno: payload.invoice_code,
|
||||
tins: '',
|
||||
indatim: payload.invoice_date.getTime() + '',
|
||||
name:
|
||||
`${payload.customer?.individual_info?.first_name} ${payload.customer?.individual_info?.last_name}` ||
|
||||
payload.customer?.legal_info?.name ||
|
||||
'',
|
||||
tob: this.mapCustomerType(payload.customer?.type),
|
||||
address: '',
|
||||
mobile: payload.customer?.individual_info?.mobile_number || '',
|
||||
bid:
|
||||
payload.customer?.individual_info?.national_id ||
|
||||
payload.customer?.legal_info?.economic_code ||
|
||||
'',
|
||||
},
|
||||
body: payload.items.map(item => ({
|
||||
sstid: item.sku,
|
||||
vra: item.sku_vat,
|
||||
// sstt: item.unit_type,
|
||||
fee: String(item.unit_price),
|
||||
dis: String(item.discount),
|
||||
mu: item.measure_unit,
|
||||
am: String(item.quantity),
|
||||
consfee: '0',
|
||||
bros: '0',
|
||||
spro: '0',
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
private mapFiscalRequestType(type: FiscalRequestType) {
|
||||
switch (type) {
|
||||
case FiscalRequestType.MAIN:
|
||||
return '1'
|
||||
case FiscalRequestType.UPDATE:
|
||||
return '2'
|
||||
case FiscalRequestType.REVOKE:
|
||||
return '3'
|
||||
case FiscalRequestType.REMOVE:
|
||||
return '4'
|
||||
}
|
||||
}
|
||||
|
||||
private mapFiscalInvoiceCustomerType(type?: FiscalInvoiceCustomerType) {
|
||||
switch (type) {
|
||||
case FiscalInvoiceCustomerType.Unknown:
|
||||
return '1'
|
||||
case FiscalInvoiceCustomerType.Known:
|
||||
return '2'
|
||||
default:
|
||||
return '3'
|
||||
}
|
||||
}
|
||||
|
||||
private mapCustomerType(type?: CustomerType) {
|
||||
switch (type) {
|
||||
case CustomerType.INDIVIDUAL:
|
||||
return '1'
|
||||
case CustomerType.LEGAL:
|
||||
return '2'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator'
|
||||
import { TaxSendStatus } from '../../dto/tax-switch.dto'
|
||||
|
||||
export class NamaTaxBodyItemDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sstid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
vra: string
|
||||
|
||||
// @ApiProperty()
|
||||
// @IsString()
|
||||
// sstt: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fee: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
dis: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
mu: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
am: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
consfee: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bros: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
spro: string
|
||||
}
|
||||
|
||||
export class NamaTaxHeaderDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
ins: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inp: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
inty: string
|
||||
|
||||
// @ApiProperty({required: true})
|
||||
// @IsString()
|
||||
// unique_tax_code: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tins: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
indatim: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tob: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
address?: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
mobile?: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bid: string
|
||||
}
|
||||
|
||||
export class NamaTaxRequestDto {
|
||||
@ApiProperty({ type: [NamaTaxBodyItemDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaTaxBodyItemDto)
|
||||
body: NamaTaxBodyItemDto[]
|
||||
|
||||
@ApiProperty({ type: [Object] })
|
||||
@IsArray()
|
||||
payment: unknown[]
|
||||
|
||||
@ApiProperty({ type: NamaTaxHeaderDto })
|
||||
@ValidateNested()
|
||||
@Type(() => NamaTaxHeaderDto)
|
||||
header: NamaTaxHeaderDto
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
uuid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
economic_code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fiscal_id: string
|
||||
}
|
||||
|
||||
export class NamaTaxSendItemResponseDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_item_id: string
|
||||
|
||||
@ApiProperty({ enum: TaxSendStatus })
|
||||
@IsEnum(TaxSendStatus)
|
||||
status: TaxSendStatus
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tax_id?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
request_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
response_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
error_message?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
sent_at?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
received_at?: string | null
|
||||
}
|
||||
|
||||
export class NamaTaxGetResponseDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tax_id: string
|
||||
|
||||
@ApiProperty({ enum: TaxSendStatus })
|
||||
@IsEnum(TaxSendStatus)
|
||||
status: TaxSendStatus
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
response_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
received_at?: string | null
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { SalesInvoiceFiscalSwitchService } from './fiscal/sales-invoice-fiscal-switch.service'
|
||||
import { SalesInvoiceFiscalService } from './fiscal/sales-invoice-fiscal.service'
|
||||
import { NamaTaxSwitchAdapter } from './fiscal/switch/nama/nama-fiscal-switch.adapter'
|
||||
import { HttpClientUtil } from '../../../common/utils/http-client.util'
|
||||
import { SalesInvoiceTspSwitchService } from '../../tspProviders/sales-invoice-tsp-switch.service'
|
||||
import { SalesInvoiceTspService } from '../../tspProviders/sales-invoice-tsp.service'
|
||||
import { NamaProviderSwitchAdapter } from '../../tspProviders/switch/nama/nama-provider.adapter'
|
||||
import { StatisticsController } from './saleInvoices.controller'
|
||||
import { SaleInvoicesService } from './saleInvoices.service'
|
||||
|
||||
@@ -11,9 +12,10 @@ import { SaleInvoicesService } from './saleInvoices.service'
|
||||
controllers: [StatisticsController],
|
||||
providers: [
|
||||
SaleInvoicesService,
|
||||
SalesInvoiceFiscalService,
|
||||
SalesInvoiceFiscalSwitchService,
|
||||
NamaTaxSwitchAdapter,
|
||||
HttpClientUtil,
|
||||
SalesInvoiceTspService,
|
||||
SalesInvoiceTspSwitchService,
|
||||
NamaProviderSwitchAdapter,
|
||||
],
|
||||
exports: [SaleInvoicesService],
|
||||
})
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
import { translateEnumValue } from '@/common/utils'
|
||||
import { TspProviderResponseStatus } from '@/generated/prisma/enums'
|
||||
import {
|
||||
SalesInvoiceSelect,
|
||||
SalesInvoiceWhereInput,
|
||||
SalesInvoiceWhereUniqueInput,
|
||||
} from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { BadRequestException, Injectable } from '@nestjs/common'
|
||||
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { SalesInvoiceFiscalService } from './fiscal/sales-invoice-fiscal.service'
|
||||
import { SalesInvoiceTspService } from '../../tspProviders/sales-invoice-tsp.service'
|
||||
|
||||
@Injectable()
|
||||
export class SaleInvoicesService {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private salesInvoiceTaxService: SalesInvoiceFiscalService,
|
||||
private salesInvoiceTaxService: SalesInvoiceTspService,
|
||||
) {}
|
||||
|
||||
private readonly defaultSelect: SalesInvoiceSelect = {
|
||||
@@ -49,10 +51,8 @@ export class SaleInvoicesService {
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
id: true,
|
||||
attempts: {
|
||||
|
||||
tsp_attempts: {
|
||||
orderBy: {
|
||||
created_at: 'asc',
|
||||
},
|
||||
@@ -62,8 +62,18 @@ export class SaleInvoicesService {
|
||||
status: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
private readonly invoiceMapper = (invoice: any) => {
|
||||
const { tsp_attempts, ...rest } = invoice || {}
|
||||
|
||||
return {
|
||||
...rest,
|
||||
status: translateEnumValue(
|
||||
'TspProviderResponseStatus',
|
||||
invoice.tsp_attempts?.[0]?.status || TspProviderResponseStatus.NOT_SEND,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
async findAll(consumer_id: string, page = 1, perPage = 10) {
|
||||
@@ -81,7 +91,9 @@ export class SaleInvoicesService {
|
||||
}),
|
||||
await tx.salesInvoice.count({ where: invoicesWhere }),
|
||||
])
|
||||
return ResponseMapper.paginate(invoices, { page, perPage, total })
|
||||
|
||||
const mappedInvoices = invoices.map(this.invoiceMapper)
|
||||
return ResponseMapper.paginate(mappedInvoices, { page, perPage, total })
|
||||
}
|
||||
|
||||
async findOne(consumer_id: string, id: string) {
|
||||
@@ -161,15 +173,21 @@ export class SaleInvoicesService {
|
||||
unknown_customer: true,
|
||||
},
|
||||
})
|
||||
return ResponseMapper.single(invoice)
|
||||
|
||||
if (invoice) {
|
||||
return ResponseMapper.single(this.invoiceMapper(invoice))
|
||||
}
|
||||
throw new NotFoundException('فاکتور مورد نظر شما یافت نشد.')
|
||||
}
|
||||
|
||||
async send(consumer_id: string, invoice_id: string) {
|
||||
await this.salesInvoiceTaxService.send(consumer_id, invoice_id)
|
||||
const tspProviderResult = await this.salesInvoiceTaxService.send(
|
||||
consumer_id,
|
||||
invoice_id,
|
||||
)
|
||||
|
||||
return ResponseMapper.single({
|
||||
invoice_id,
|
||||
sent_to_tax: true,
|
||||
...tspProviderResult,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -109,9 +109,9 @@ export class EnumsController {
|
||||
return this.enumsService.getEnumValues('ConsumerRole')
|
||||
}
|
||||
|
||||
@Get('fiscal_response_status')
|
||||
@Get('tsp_provider_response_status')
|
||||
@PublicWithToken()
|
||||
async getFiscalResponseStatus(): Promise<EnumsServiceGetEnumValuesResponseDto> {
|
||||
return this.enumsService.getEnumValues('FiscalResponseStatus')
|
||||
async getTspProviderResponseStatus(): Promise<EnumsServiceGetEnumValuesResponseDto> {
|
||||
return this.enumsService.getEnumValues('TspProviderResponseStatus')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,13 +13,9 @@ import {
|
||||
ConsumerStatus,
|
||||
ConsumerType,
|
||||
CustomerType,
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
FiscalResponseStatus,
|
||||
GoodPricingModel,
|
||||
LicenseStatus,
|
||||
LicenseType,
|
||||
PartnerFiscalSwitchType,
|
||||
PartnerRole,
|
||||
PartnerStatus,
|
||||
PaymentMethodType,
|
||||
@@ -30,6 +26,10 @@ import {
|
||||
ProviderStatus,
|
||||
SKUGuildType,
|
||||
TokenType,
|
||||
TspProviderCustomerType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
TspProviderType,
|
||||
UnitType,
|
||||
UserStatus,
|
||||
UserType,
|
||||
@@ -79,10 +79,7 @@ export class EnumsService {
|
||||
ConsumerStatus: this.prepareData(ConsumerStatus, 'ConsumerStatus'),
|
||||
ConsumerType: this.prepareData(ConsumerType, 'ConsumerType'),
|
||||
PartnerStatus: this.prepareData(PartnerStatus, 'PartnerStatus'),
|
||||
PartnerFiscalSwitchType: this.prepareData(
|
||||
PartnerFiscalSwitchType,
|
||||
'PartnerFiscalSwitchType',
|
||||
),
|
||||
TspProviderType: this.prepareData(TspProviderType, 'TspProviderType'),
|
||||
ApplicationPlatform: this.prepareData(ApplicationPlatform, 'ApplicationPlatform'),
|
||||
ApplicationReleaseType: this.prepareData(
|
||||
ApplicationReleaseType,
|
||||
@@ -93,14 +90,17 @@ export class EnumsService {
|
||||
'ApplicationPublisher',
|
||||
),
|
||||
CustomerType: this.prepareData(CustomerType, 'CustomerType'),
|
||||
FiscalResponseStatus: this.prepareData(
|
||||
FiscalResponseStatus,
|
||||
'FiscalResponseStatus',
|
||||
TspProviderResponseStatus: this.prepareData(
|
||||
TspProviderResponseStatus,
|
||||
'TspProviderResponseStatus',
|
||||
),
|
||||
FiscalRequestType: this.prepareData(FiscalRequestType, 'FiscalRequestType'),
|
||||
FiscalInvoiceCustomerType: this.prepareData(
|
||||
FiscalInvoiceCustomerType,
|
||||
'FiscalInvoiceCustomerType',
|
||||
TspProviderRequestType: this.prepareData(
|
||||
TspProviderRequestType,
|
||||
'TspProviderRequestType',
|
||||
),
|
||||
TspProviderCustomerType: this.prepareData(
|
||||
TspProviderCustomerType,
|
||||
'TspProviderCustomerType',
|
||||
),
|
||||
SKUGuildType: this.prepareData(SKUGuildType, 'SKUGuildType'),
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ export class CreateSalesInvoiceDto {
|
||||
@ApiProperty({ required: false, default: false })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
send_to_tax?: boolean
|
||||
send_to_tsp?: boolean
|
||||
|
||||
@ApiProperty({ required: true, default: CustomerType.UNKNOWN })
|
||||
@IsEnum(CustomerType)
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
IsString,
|
||||
Min,
|
||||
} from 'class-validator'
|
||||
import { FiscalResponseStatus } from 'generated/prisma/enums'
|
||||
import { TspProviderResponseStatus } from 'generated/prisma/enums'
|
||||
|
||||
export class SalesInvoicesFilterDto {
|
||||
@ApiPropertyOptional({ default: 1 })
|
||||
@@ -70,10 +70,10 @@ export class SalesInvoicesFilterDto {
|
||||
@IsString()
|
||||
customer_economic_code?: string
|
||||
|
||||
@ApiPropertyOptional({ enum: FiscalResponseStatus })
|
||||
@ApiPropertyOptional({ enum: TspProviderResponseStatus })
|
||||
@IsOptional()
|
||||
@IsEnum(FiscalResponseStatus)
|
||||
status?: FiscalResponseStatus
|
||||
@IsEnum(TspProviderResponseStatus)
|
||||
status?: TspProviderResponseStatus
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import { PosInfo } from '@/common/decorators/posInfo.decorator'
|
||||
import type { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { Controller, Get, Param, Post } from '@nestjs/common'
|
||||
import { PosSalesInvoiceFiscalService } from './sales-invoice-fiscal.service'
|
||||
|
||||
@Controller('pos/sales_invoices/:invoiceId/fiscal')
|
||||
export class PosSalesInvoiceFiscalController {
|
||||
constructor(private readonly service: PosSalesInvoiceFiscalService) {}
|
||||
|
||||
@Post('send')
|
||||
async send(@PosInfo() posInfo: IPosPayload, @Param('invoiceId') invoiceId: string) {
|
||||
return this.service.send(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Post('retry')
|
||||
async retry(@PosInfo() posInfo: IPosPayload, @Param('invoiceId') invoiceId: string) {
|
||||
return this.service.retry(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Get('status')
|
||||
async getStatus(
|
||||
@PosInfo() posInfo: IPosPayload,
|
||||
@Param('invoiceId') invoiceId: string,
|
||||
) {
|
||||
return this.service.getStatus(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Post('status/refresh')
|
||||
async refreshStatus(
|
||||
@PosInfo() posInfo: IPosPayload,
|
||||
@Param('invoiceId') invoiceId: string,
|
||||
) {
|
||||
return this.service.refreshStatus(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
@Get('attempts')
|
||||
async getAttempts(
|
||||
@PosInfo() posInfo: IPosPayload,
|
||||
@Param('invoiceId') invoiceId: string,
|
||||
) {
|
||||
return this.service.getAttempts(invoiceId, posInfo)
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { SalesInvoiceFiscalSwitchService } from '../../../consumer/saleInvoices/fiscal/sales-invoice-fiscal-switch.service'
|
||||
import { NamaTaxSwitchAdapter } from '../../../consumer/saleInvoices/fiscal/switch/nama/nama-fiscal-switch.adapter'
|
||||
import { PosSalesInvoiceFiscalController } from './sales-invoice-fiscal.controller'
|
||||
import { PosSalesInvoiceFiscalService } from './sales-invoice-fiscal.service'
|
||||
|
||||
@Module({
|
||||
controllers: [PosSalesInvoiceFiscalController],
|
||||
providers: [PosSalesInvoiceFiscalService, SalesInvoiceFiscalSwitchService, NamaTaxSwitchAdapter],
|
||||
exports: [PosSalesInvoiceFiscalService],
|
||||
})
|
||||
export class PosSalesInvoiceFiscalModule {}
|
||||
@@ -1,411 +0,0 @@
|
||||
import { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable, NotFoundException } from '@nestjs/common'
|
||||
import {
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
FiscalResponseStatus,
|
||||
} from 'generated/prisma/enums'
|
||||
import {
|
||||
TaxSendStatus,
|
||||
TaxSwitchGetResultDto,
|
||||
TaxSwitchSendItemResultDto,
|
||||
TaxSwitchSendPayloadDto,
|
||||
} from '../../../consumer/saleInvoices/fiscal/dto/tax-switch.dto'
|
||||
import { SalesInvoiceFiscalSwitchService } from '../../../consumer/saleInvoices/fiscal/sales-invoice-fiscal-switch.service'
|
||||
|
||||
@Injectable()
|
||||
export class PosSalesInvoiceFiscalService {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly fiscalSwitchService: SalesInvoiceFiscalSwitchService,
|
||||
) {}
|
||||
|
||||
async send(invoiceId: string, posInfo: IPosPayload) {
|
||||
const payload = await this.buildPayload(invoiceId, posInfo)
|
||||
const itemResults = await this.safeSend(payload)
|
||||
const attempt = await this.persistAttempt(invoiceId, itemResults)
|
||||
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
fiscal_id: attempt.fiscal_id,
|
||||
status: attempt.status,
|
||||
attempt_no: attempt.attempt_no,
|
||||
}
|
||||
}
|
||||
|
||||
async retry(invoiceId: string, posInfo: IPosPayload) {
|
||||
return this.send(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
async getStatus(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.getInvoiceForBusiness(invoiceId, posInfo.business_id)
|
||||
if (!invoice.fiscal) {
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
status: FiscalResponseStatus.NOT_SEND,
|
||||
fiscal: null,
|
||||
}
|
||||
}
|
||||
|
||||
const latestAttempt = invoice.fiscal.attempts[0] || null
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
status: latestAttempt?.status || FiscalResponseStatus.NOT_SEND,
|
||||
fiscal: {
|
||||
id: invoice.fiscal.id,
|
||||
retry_count: invoice.fiscal.retry_count,
|
||||
last_attempt_at: invoice.fiscal.last_attempt_at,
|
||||
},
|
||||
latest_attempt: latestAttempt,
|
||||
}
|
||||
}
|
||||
|
||||
async refreshStatus(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.getInvoiceForBusiness(invoiceId, posInfo.business_id)
|
||||
const latestAttempt = invoice.fiscal?.attempts?.[0]
|
||||
|
||||
if (!invoice.fiscal || !latestAttempt?.tax_id) {
|
||||
return this.getStatus(invoiceId, posInfo)
|
||||
}
|
||||
|
||||
const providerCode = invoice.pos.provider?.code
|
||||
const switchResult = await this.fiscalSwitchService.get(
|
||||
providerCode,
|
||||
latestAttempt.tax_id,
|
||||
)
|
||||
const mappedStatus = this.mapSwitchGetStatus(switchResult.status)
|
||||
|
||||
const refreshedAttempt = await this.prisma.$transaction(async tx => {
|
||||
const nextNo = (latestAttempt.attempt_no || 0) + 1
|
||||
const createdAttempt = await tx.saleInvoiceFiscalAttempts.create({
|
||||
data: {
|
||||
fiscal_id: invoice.fiscal!.id,
|
||||
attempt_no: nextNo,
|
||||
status: mappedStatus,
|
||||
tax_id: switchResult.tax_id,
|
||||
response_payload: switchResult.response_payload
|
||||
? JSON.parse(JSON.stringify(switchResult.response_payload))
|
||||
: undefined,
|
||||
received_at: switchResult.received_at
|
||||
? new Date(switchResult.received_at)
|
||||
: null,
|
||||
type: FiscalRequestType.MAIN,
|
||||
},
|
||||
})
|
||||
|
||||
await tx.saleInvoiceFiscals.update({
|
||||
where: { id: invoice.fiscal!.id },
|
||||
data: {
|
||||
retry_count: nextNo,
|
||||
last_attempt_at: createdAttempt.created_at,
|
||||
},
|
||||
})
|
||||
|
||||
return createdAttempt
|
||||
})
|
||||
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
status: refreshedAttempt.status,
|
||||
latest_attempt: refreshedAttempt,
|
||||
}
|
||||
}
|
||||
|
||||
async getAttempts(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.getInvoiceForBusiness(invoiceId, posInfo.business_id)
|
||||
if (!invoice.fiscal) {
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
fiscal_id: null,
|
||||
attempts: [],
|
||||
}
|
||||
}
|
||||
|
||||
const attempts = await this.prisma.saleInvoiceFiscalAttempts.findMany({
|
||||
where: {
|
||||
fiscal_id: invoice.fiscal.id,
|
||||
},
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
invoice_id: invoiceId,
|
||||
fiscal_id: invoice.fiscal.id,
|
||||
attempts,
|
||||
}
|
||||
}
|
||||
|
||||
private async buildPayload(invoiceId: string, posInfo: IPosPayload) {
|
||||
const invoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos: {
|
||||
id: posInfo.pos_id,
|
||||
complex: {
|
||||
business_activity_id: posInfo.business_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
invoice_date: true,
|
||||
total_amount: true,
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
sku_vat: true,
|
||||
measure_unit_code: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
payload: true,
|
||||
good_snapshot: true,
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
individual: true,
|
||||
legal: true,
|
||||
},
|
||||
},
|
||||
|
||||
pos: {
|
||||
select: {
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
fiscal_id: true,
|
||||
economic_code: true,
|
||||
consumer: {
|
||||
select: {
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
fiscal_switch_type: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!invoice) {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { partner } = (invoice.pos.complex.business_activity.consumer.legal ||
|
||||
invoice.pos.complex.business_activity.consumer.individual)!
|
||||
|
||||
return {
|
||||
invoice_id: invoice.id,
|
||||
invoice_code: invoice.code,
|
||||
invoice_date: invoice.invoice_date,
|
||||
total_amount: Number(invoice.total_amount),
|
||||
customer_type: invoice.customer
|
||||
? FiscalInvoiceCustomerType.Known
|
||||
: FiscalInvoiceCustomerType.Unknown,
|
||||
type: FiscalRequestType.MAIN,
|
||||
provider_code: partner.fiscal_switch_type,
|
||||
items: invoice.items.map(item => ({
|
||||
invoice_item_id: item.id,
|
||||
quantity: Number(item.quantity),
|
||||
unit_price: Number(item.unit_price),
|
||||
total_amount: Number(item.total_amount),
|
||||
good_id: item.good_id,
|
||||
service_id: item.service_id,
|
||||
payload: item.payload,
|
||||
good_snapshot: item.good_snapshot,
|
||||
discount: String((item.payload as Record<string, any>)?.discount || '0'),
|
||||
sku: item.sku_code,
|
||||
sku_vat: String(item.sku_vat),
|
||||
measure_unit: item.measure_unit_code,
|
||||
// sku: item.
|
||||
})),
|
||||
} satisfies TaxSwitchSendPayloadDto
|
||||
}
|
||||
|
||||
private async safeSend(payload: TaxSwitchSendPayloadDto) {
|
||||
try {
|
||||
return await this.fiscalSwitchService.send(payload)
|
||||
} catch (error: any) {
|
||||
const now = new Date().toISOString()
|
||||
return payload.items.map(item => ({
|
||||
invoice_item_id: item.invoice_item_id,
|
||||
status: TaxSendStatus.FAILED,
|
||||
error_message: error?.message || 'Unexpected fiscal switch error.',
|
||||
sent_at: now,
|
||||
received_at: now,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
private async persistAttempt(
|
||||
invoiceId: string,
|
||||
itemResults: TaxSwitchSendItemResultDto[],
|
||||
) {
|
||||
return this.prisma.$transaction(async tx => {
|
||||
const fiscal = await tx.saleInvoiceFiscals.upsert({
|
||||
where: { invoice_id: invoiceId },
|
||||
update: {},
|
||||
create: {
|
||||
invoice_id: invoiceId,
|
||||
},
|
||||
})
|
||||
|
||||
const latest = await tx.saleInvoiceFiscalAttempts.findFirst({
|
||||
where: { fiscal_id: fiscal.id },
|
||||
orderBy: { attempt_no: 'desc' },
|
||||
select: { attempt_no: true },
|
||||
})
|
||||
const nextAttemptNo = (latest?.attempt_no || 0) + 1
|
||||
|
||||
const finalStatus = this.mapItemResultsStatus(itemResults)
|
||||
const firstTaxId = itemResults.find(item => item.tax_id)?.tax_id || null
|
||||
const sentAt = itemResults.map(item => item.sent_at).find(Boolean)
|
||||
const receivedAt = itemResults.map(item => item.received_at).find(Boolean)
|
||||
const errors = itemResults.map(item => item.error_message).filter(Boolean)
|
||||
const errorMessage = errors.length ? Array.from(new Set(errors)).join(' | ') : null
|
||||
|
||||
const attempt = await tx.saleInvoiceFiscalAttempts.create({
|
||||
data: {
|
||||
fiscal_id: fiscal.id,
|
||||
attempt_no: nextAttemptNo,
|
||||
status: finalStatus,
|
||||
tax_id: firstTaxId,
|
||||
type: FiscalRequestType.MAIN,
|
||||
request_payload: JSON.parse(
|
||||
JSON.stringify(itemResults.map(item => item.request_payload)),
|
||||
),
|
||||
response_payload: JSON.parse(
|
||||
JSON.stringify(itemResults.map(item => item.response_payload)),
|
||||
),
|
||||
error_message: errorMessage,
|
||||
sent_at: sentAt ? new Date(sentAt) : null,
|
||||
received_at: receivedAt ? new Date(receivedAt) : null,
|
||||
},
|
||||
})
|
||||
|
||||
await tx.saleInvoiceFiscals.update({
|
||||
where: { id: fiscal.id },
|
||||
data: {
|
||||
retry_count: nextAttemptNo,
|
||||
last_attempt_at: attempt.sent_at || attempt.created_at,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
fiscal_id: fiscal.id,
|
||||
status: attempt.status,
|
||||
attempt_no: attempt.attempt_no,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private mapItemResultsStatus(itemResults: TaxSwitchSendItemResultDto[]) {
|
||||
if (!itemResults.length) {
|
||||
return FiscalResponseStatus.NOT_SEND
|
||||
}
|
||||
const hasFailure = itemResults.some(item => item.status === TaxSendStatus.FAILED)
|
||||
if (hasFailure) {
|
||||
return FiscalResponseStatus.FAILURE
|
||||
}
|
||||
const hasSent = itemResults.some(item => item.status === TaxSendStatus.SENT)
|
||||
if (hasSent) {
|
||||
return FiscalResponseStatus.SUCCESS
|
||||
}
|
||||
return FiscalResponseStatus.NOT_SEND
|
||||
}
|
||||
|
||||
private mapSwitchGetStatus(status: TaxSwitchGetResultDto['status']) {
|
||||
switch (status) {
|
||||
case TaxSendStatus.SENT:
|
||||
return FiscalResponseStatus.SUCCESS
|
||||
case TaxSendStatus.FAILED:
|
||||
return FiscalResponseStatus.FAILURE
|
||||
default:
|
||||
return FiscalResponseStatus.NOT_SEND
|
||||
}
|
||||
}
|
||||
|
||||
private async getInvoiceForBusiness(invoiceId: string, businessId: string) {
|
||||
const invoice = await this.prisma.salesInvoice.findFirst({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity_id: businessId,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
pos: {
|
||||
select: {
|
||||
provider: {
|
||||
select: {
|
||||
code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
id: true,
|
||||
retry_count: true,
|
||||
last_attempt_at: true,
|
||||
attempts: {
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
take: 1,
|
||||
select: {
|
||||
id: true,
|
||||
attempt_no: true,
|
||||
status: true,
|
||||
tax_id: true,
|
||||
sent_at: true,
|
||||
received_at: true,
|
||||
error_message: true,
|
||||
created_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!invoice) {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
return invoice
|
||||
}
|
||||
}
|
||||
+1
-6
@@ -1,7 +1,6 @@
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsNumber, IsObject, IsOptional, IsString } from 'class-validator'
|
||||
import { IsNumber, IsObject, IsOptional, IsString } from 'class-validator'
|
||||
import type { SaleInvoiceType } from 'common/interfaces/sale-invoice-payload'
|
||||
import { UnitType } from 'generated/prisma/enums'
|
||||
|
||||
export class CreateSalesInvoiceItemDto {
|
||||
@IsNumber()
|
||||
@@ -24,10 +23,6 @@ export class CreateSalesInvoiceItemDto {
|
||||
@ApiProperty({ required: true })
|
||||
invoice_id: string
|
||||
|
||||
@IsEnum(UnitType)
|
||||
@ApiProperty({ enum: Object.values(UnitType) })
|
||||
unit_type: UnitType
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@ApiProperty({ required: false })
|
||||
|
||||
@@ -20,15 +20,24 @@ export class SalesInvoicesController {
|
||||
return this.salesInvoicesService.findOne(posInfo, id)
|
||||
}
|
||||
|
||||
@Get(':id/inquiry')
|
||||
inquiry(@PosInfo() posInfo: IPosPayload, @Param('id') id: string) {
|
||||
return this.salesInvoicesService.inquiry(
|
||||
posInfo.consumer_account_id,
|
||||
posInfo.pos_id,
|
||||
id,
|
||||
)
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() data: CreateSalesInvoiceDto, @PosInfo() posInfo: IPosPayload) {
|
||||
return this.salesInvoicesService.create(data, posInfo)
|
||||
}
|
||||
|
||||
// @Post(':id/send')
|
||||
// send(@Param('id') id: string, @PosInfo() posInfo: IPosPayload) {
|
||||
// return this.salesInvoicesService.send(id, posInfo)
|
||||
// }
|
||||
@Post(':id/send')
|
||||
send(@Param('id') id: string, @PosInfo() posInfo: IPosPayload) {
|
||||
return this.salesInvoicesService.send(id, posInfo)
|
||||
}
|
||||
|
||||
// @Post('send/bulk')
|
||||
// sendBulk(@Body() data: SendBulkSalesInvoicesDto, @PosInfo() posInfo: IPosPayload) {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { SalesInvoiceFiscalSwitchService } from '../../consumer/saleInvoices/fiscal/sales-invoice-fiscal-switch.service'
|
||||
import { SalesInvoiceFiscalService } from '../../consumer/saleInvoices/fiscal/sales-invoice-fiscal.service'
|
||||
import { NamaTaxSwitchAdapter } from '../../consumer/saleInvoices/fiscal/switch/nama/nama-fiscal-switch.adapter'
|
||||
import { PosSalesInvoiceFiscalModule } from './fiscal/sales-invoice-fiscal.module'
|
||||
import { HttpClientUtil } from '../../../common/utils/http-client.util'
|
||||
import { SalesInvoiceTspSwitchService } from '../../tspProviders/sales-invoice-tsp-switch.service'
|
||||
import { SalesInvoiceTspService } from '../../tspProviders/sales-invoice-tsp.service'
|
||||
import { NamaProviderSwitchAdapter } from '../../tspProviders/switch/nama/nama-provider.adapter'
|
||||
import { SalesInvoicesController } from './sales-invoices.controller'
|
||||
import { SalesInvoicesService } from './sales-invoices.service'
|
||||
|
||||
@Module({
|
||||
imports: [PosSalesInvoiceFiscalModule],
|
||||
controllers: [SalesInvoicesController],
|
||||
providers: [
|
||||
SalesInvoicesService,
|
||||
SalesInvoiceFiscalService,
|
||||
SalesInvoiceFiscalSwitchService,
|
||||
NamaTaxSwitchAdapter,
|
||||
HttpClientUtil,
|
||||
SalesInvoiceTspService,
|
||||
SalesInvoiceTspSwitchService,
|
||||
NamaProviderSwitchAdapter,
|
||||
],
|
||||
})
|
||||
export class PosSalesInvoicesModule {}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { translateEnumValue } from '@/common/utils'
|
||||
import { SalesInvoiceCreateInput } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { BadRequestException, Injectable } from '@nestjs/common'
|
||||
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import type { CustomerIndividual, CustomerLegal } from 'generated/prisma/client'
|
||||
import { Prisma } from 'generated/prisma/client'
|
||||
import {
|
||||
ConsumerRole,
|
||||
CustomerType,
|
||||
FiscalResponseStatus,
|
||||
PaymentMethodType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
} from 'generated/prisma/enums'
|
||||
import { SalesInvoiceFiscalService } from '../../consumer/saleInvoices/fiscal/sales-invoice-fiscal.service'
|
||||
import { SalesInvoiceTspService } from '../../tspProviders/sales-invoice-tsp.service'
|
||||
import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto'
|
||||
import { SalesInvoicesFilterDto } from './dto/sales-invoices-filter.dto'
|
||||
|
||||
@@ -53,7 +56,7 @@ export class SalesInvoicesService {
|
||||
|
||||
constructor(
|
||||
private prisma: PrismaService,
|
||||
private salesInvoiceTaxService: SalesInvoiceFiscalService,
|
||||
private salesInvoiceTaxService: SalesInvoiceTspService,
|
||||
) {}
|
||||
|
||||
async findAll(posInfo: IPosPayload, query: SalesInvoicesFilterDto = {}) {
|
||||
@@ -96,9 +99,7 @@ export class SalesInvoicesService {
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
attempts: {
|
||||
tsp_attempts: {
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
@@ -108,8 +109,6 @@ export class SalesInvoicesService {
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
await tx.salesInvoice.count({ where }),
|
||||
])
|
||||
@@ -117,8 +116,8 @@ export class SalesInvoicesService {
|
||||
const summaryItems = items.map(invoice => ({
|
||||
...invoice,
|
||||
status: translateEnumValue(
|
||||
'FiscalResponseStatus',
|
||||
invoice.fiscal?.attempts?.[0]?.status || FiscalResponseStatus.NOT_SEND,
|
||||
'TspProviderResponseStatus',
|
||||
invoice.tsp_attempts?.[0]?.status || TspProviderResponseStatus.NOT_SEND,
|
||||
),
|
||||
}))
|
||||
|
||||
@@ -126,10 +125,11 @@ export class SalesInvoicesService {
|
||||
}
|
||||
|
||||
async findOne(posInfo: IPosPayload, id: string) {
|
||||
const invoice = await this.prisma.salesInvoice.findFirstOrThrow({
|
||||
const invoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id,
|
||||
pos: {
|
||||
id: posInfo.pos_id,
|
||||
complex: {
|
||||
business_activity_id: posInfo.business_id,
|
||||
},
|
||||
@@ -234,12 +234,7 @@ export class SalesInvoicesService {
|
||||
},
|
||||
},
|
||||
},
|
||||
fiscal: {
|
||||
select: {
|
||||
id: true,
|
||||
retry_count: true,
|
||||
last_attempt_at: true,
|
||||
attempts: {
|
||||
tsp_attempts: {
|
||||
orderBy: {
|
||||
created_at: 'desc',
|
||||
},
|
||||
@@ -253,26 +248,36 @@ export class SalesInvoicesService {
|
||||
received_at: true,
|
||||
created_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
take: 1,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (invoice) {
|
||||
const { tsp_attempts, ...rest } = invoice || {}
|
||||
|
||||
return ResponseMapper.single({
|
||||
...invoice,
|
||||
status: invoice.fiscal?.attempts?.[0]?.status || FiscalResponseStatus.NOT_SEND,
|
||||
...rest,
|
||||
status: tsp_attempts?.[0]?.status || TspProviderResponseStatus.NOT_SEND,
|
||||
})
|
||||
} else throw new NotFoundException('فاکتور مورد نظر شما یافت نشد.')
|
||||
}
|
||||
|
||||
// async send(invoiceId: string, posInfo: IPosPayload) {
|
||||
// await this.salesInvoiceTaxService.send(invoiceId, posInfo.pos_id)
|
||||
async send(invoiceId: string, posInfo: IPosPayload) {
|
||||
const consumer_id = await this.checkAccessToInvoice(
|
||||
posInfo.consumer_account_id,
|
||||
posInfo.pos_id,
|
||||
)
|
||||
const invoice = await this.salesInvoiceTaxService.send(consumer_id, invoiceId)
|
||||
|
||||
// return ResponseMapper.single({
|
||||
// invoice_id: invoiceId,
|
||||
// sent_to_tax: true,
|
||||
// })
|
||||
// }
|
||||
return ResponseMapper.single(invoice)
|
||||
}
|
||||
|
||||
async inquiry(consumer_account_id: string, pos_id: string, invoiceId: string) {
|
||||
const consumer_id = await this.checkAccessToInvoice(consumer_account_id, pos_id)
|
||||
const invoice = await this.salesInvoiceTaxService.get(invoiceId, pos_id, consumer_id)
|
||||
return ResponseMapper.single(invoice)
|
||||
}
|
||||
|
||||
// async sendBulk(invoiceIds: string[], posInfo: IPosPayload) {
|
||||
// if (!invoiceIds.length) {
|
||||
@@ -325,13 +330,13 @@ export class SalesInvoicesService {
|
||||
normalizedInvoiceDate,
|
||||
)
|
||||
|
||||
return salesInvoice
|
||||
})
|
||||
|
||||
if (data.send_to_tax) {
|
||||
if (data.send_to_tsp) {
|
||||
await this.salesInvoiceTaxService.send(salesInvoice.id, pos_id)
|
||||
}
|
||||
|
||||
return salesInvoice
|
||||
})
|
||||
|
||||
return ResponseMapper.create(salesInvoice)
|
||||
} catch (error) {
|
||||
if (
|
||||
@@ -500,17 +505,13 @@ export class SalesInvoicesService {
|
||||
}
|
||||
|
||||
if (query.status) {
|
||||
if (query.status === FiscalResponseStatus.NOT_SEND) {
|
||||
where.fiscal = null
|
||||
if (query.status === TspProviderResponseStatus.NOT_SEND) {
|
||||
where.tsp_attempts = undefined
|
||||
} else {
|
||||
where.fiscal = {
|
||||
is: {
|
||||
attempts: {
|
||||
where.tsp_attempts = {
|
||||
some: {
|
||||
status: query.status,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -530,8 +531,9 @@ export class SalesInvoicesService {
|
||||
cash: PaymentMethodType.CASH,
|
||||
set_off: PaymentMethodType.SET_OFF,
|
||||
card: PaymentMethodType.CARD,
|
||||
payment_gateway: PaymentMethodType.PAYMENT_GATEWAY,
|
||||
bank: PaymentMethodType.BANK,
|
||||
check: PaymentMethodType.CHECK,
|
||||
check: PaymentMethodType.CHEQUE,
|
||||
other: PaymentMethodType.OTHER,
|
||||
terminal: PaymentMethodType.TERMINAL,
|
||||
}
|
||||
@@ -705,6 +707,8 @@ export class SalesInvoicesService {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
code: true,
|
||||
VAT: true,
|
||||
},
|
||||
},
|
||||
local_sku: true,
|
||||
@@ -714,6 +718,7 @@ export class SalesInvoicesService {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
code: true,
|
||||
},
|
||||
},
|
||||
base_sale_price: true,
|
||||
@@ -755,7 +760,7 @@ export class SalesInvoicesService {
|
||||
} = params
|
||||
const { customer_id, customer_type, customer, payments, ...invoiceData } = data
|
||||
|
||||
const salesInvoiceData: any = {
|
||||
const salesInvoiceData: SalesInvoiceCreateInput = {
|
||||
...invoiceData,
|
||||
invoice_date: normalizedInvoiceDate,
|
||||
invoice_number: invoiceNumber,
|
||||
@@ -764,11 +769,14 @@ export class SalesInvoicesService {
|
||||
items: {
|
||||
createMany: {
|
||||
data: data.items.map(item => ({
|
||||
good_id: item.good_id,
|
||||
good_id: item.good_id!,
|
||||
quantity: item.quantity,
|
||||
unit_price: item.unit_price,
|
||||
total_amount: item.total_amount,
|
||||
measure_unit_text: item.unit_type,
|
||||
measure_unit_text: goodsById.get(item.good_id!)?.measure_unit.name || null,
|
||||
measure_unit_code: goodsById.get(item.good_id!)?.measure_unit.code || null,
|
||||
sku_code: goodsById.get(item.good_id!)?.sku.code || null,
|
||||
sku_vat: goodsById.get(item.good_id!)?.sku.VAT || null,
|
||||
payload: item.payload ? JSON.parse(JSON.stringify(item.payload)) : undefined,
|
||||
good_snapshot: item.good_id
|
||||
? JSON.parse(
|
||||
@@ -777,7 +785,6 @@ export class SalesInvoicesService {
|
||||
}),
|
||||
)
|
||||
: undefined,
|
||||
unit_type: item.unit_type,
|
||||
})),
|
||||
},
|
||||
},
|
||||
@@ -794,6 +801,16 @@ export class SalesInvoicesService {
|
||||
},
|
||||
}
|
||||
|
||||
if (data.send_to_tsp) {
|
||||
salesInvoiceData.tsp_attempts = {
|
||||
create: {
|
||||
attempt_no: 1,
|
||||
status: TspProviderResponseStatus.QUEUED,
|
||||
type: TspProviderRequestType.MAIN,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
if (customerId) {
|
||||
salesInvoiceData.customer = {
|
||||
connect: {
|
||||
@@ -819,10 +836,29 @@ export class SalesInvoicesService {
|
||||
},
|
||||
select: {
|
||||
invoice_number: true,
|
||||
pos: {
|
||||
select: {
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
invoice_number_sequence: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return (latestInvoice?.invoice_number || 0) + 1
|
||||
const latestSequence =
|
||||
latestInvoice?.pos?.complex?.business_activity?.invoice_number_sequence.toNumber() ||
|
||||
0
|
||||
|
||||
console.log(latestSequence)
|
||||
|
||||
return Math.max(latestInvoice?.invoice_number || 0, latestSequence) + 1
|
||||
}
|
||||
|
||||
private async createPayments(
|
||||
@@ -852,7 +888,7 @@ export class SalesInvoicesService {
|
||||
terminal_id: terminalInfo.terminalId,
|
||||
stan: terminalInfo.stan,
|
||||
rrn: terminalInfo.rrn,
|
||||
transaction_date_time: new Date(terminalInfo.transactionDateTime),
|
||||
transaction_date_time: new Date(terminalInfo.transactionDateTime || ''),
|
||||
customer_card_no: terminalInfo.customerCardNO || null,
|
||||
description: terminalInfo.description || null,
|
||||
},
|
||||
@@ -867,6 +903,35 @@ export class SalesInvoicesService {
|
||||
pos_id: string,
|
||||
invoice_number: number,
|
||||
) {
|
||||
return `${business_id.substring(0, 2)}-${complex_id.substring(0, 2)}-${pos_id.substring(0, 2)}-${invoice_number.toString()}`
|
||||
return `${business_id.substring(business_id.length - 2, business_id.length)}-${complex_id.substring(complex_id.length - 2, complex_id.length)}-${pos_id.substring(pos_id.length - 2, pos_id.length)}-${invoice_number.toString()}`
|
||||
}
|
||||
|
||||
private async checkAccessToInvoice(
|
||||
consumer_account_id: string,
|
||||
pos_id: string,
|
||||
): Promise<string> {
|
||||
const consumer = await this.prisma.consumerAccount.findUnique({
|
||||
where: {
|
||||
id: consumer_account_id,
|
||||
OR: [
|
||||
{
|
||||
pos: {
|
||||
id: pos_id,
|
||||
},
|
||||
},
|
||||
{
|
||||
role: ConsumerRole.OWNER,
|
||||
},
|
||||
],
|
||||
},
|
||||
select: {
|
||||
consumer_id: true,
|
||||
},
|
||||
})
|
||||
if (!consumer) {
|
||||
throw new BadRequestException('شما دسترسی لازم برای ارسال فاکتور را ندارید.')
|
||||
}
|
||||
|
||||
return consumer.consumer_id
|
||||
}
|
||||
}
|
||||
|
||||
+117
-55
@@ -1,28 +1,27 @@
|
||||
import {
|
||||
CustomerType,
|
||||
FiscalInvoiceCustomerType,
|
||||
FiscalRequestType,
|
||||
PartnerFiscalSwitchType,
|
||||
InvoiceTemplateType,
|
||||
PaymentMethodType,
|
||||
TspProviderCustomerType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
TspProviderType,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsDateString,
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
Min,
|
||||
ValidateNested,
|
||||
} from 'class-validator'
|
||||
|
||||
export enum TaxSendStatus {
|
||||
SENT = 'SENT',
|
||||
FAILED = 'FAILED',
|
||||
PENDING = 'PENDING',
|
||||
}
|
||||
|
||||
export class CustomerLegalInfoDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
@@ -66,7 +65,34 @@ export class CustomerInfoDto {
|
||||
@ValidateNested({ each: true })
|
||||
individual_info?: CustomerIndividualInfoDto
|
||||
}
|
||||
export class TaxSwitchSendItemPayloadDto {
|
||||
|
||||
export class PaymentInfoDto {
|
||||
@ApiProperty({ required: true, enum: PaymentMethodType })
|
||||
@IsEnum(PaymentMethodType)
|
||||
payment_method: PaymentMethodType
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsNumber({ allowInfinity: false, allowNaN: false })
|
||||
@Min(10_000)
|
||||
amount: number
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tracking_code?: string
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
card_number?: string
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
paid_at?: Date
|
||||
}
|
||||
|
||||
export class TspProviderSendItemPayloadDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
sku: string
|
||||
@@ -116,20 +142,20 @@ export class TaxSwitchSendItemPayloadDto {
|
||||
payload?: unknown
|
||||
}
|
||||
|
||||
export class TaxSwitchSendPayloadDto {
|
||||
@ApiProperty({ required: true, enum: FiscalRequestType })
|
||||
@IsEnum(FiscalRequestType)
|
||||
type: FiscalRequestType
|
||||
export class TspProviderSendPayloadDto {
|
||||
@ApiProperty({ required: true, enum: TspProviderRequestType })
|
||||
@IsEnum(TspProviderRequestType)
|
||||
type: TspProviderRequestType
|
||||
|
||||
@ApiProperty({ required: true, enum: FiscalInvoiceCustomerType })
|
||||
@IsEnum(FiscalInvoiceCustomerType)
|
||||
customer_type: FiscalInvoiceCustomerType
|
||||
@ApiProperty({ required: true, enum: TspProviderCustomerType })
|
||||
@IsEnum(TspProviderCustomerType)
|
||||
customer_type: TspProviderCustomerType
|
||||
|
||||
@ApiProperty({ type: [TaxSwitchSendItemPayloadDto] })
|
||||
@ApiProperty({ type: [TspProviderSendItemPayloadDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TaxSwitchSendItemPayloadDto)
|
||||
items: TaxSwitchSendItemPayloadDto[]
|
||||
@Type(() => TspProviderSendItemPayloadDto)
|
||||
items: TspProviderSendItemPayloadDto[]
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@Type(() => CustomerInfoDto)
|
||||
@@ -137,11 +163,10 @@ export class TaxSwitchSendPayloadDto {
|
||||
customer?: CustomerInfoDto
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsString()
|
||||
invoice_code: string
|
||||
@IsNumber()
|
||||
invoice_number: number
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsOptional()
|
||||
@IsDateString()
|
||||
invoice_date: Date
|
||||
|
||||
@@ -153,86 +178,123 @@ export class TaxSwitchSendPayloadDto {
|
||||
@IsNumber()
|
||||
total_amount: number
|
||||
|
||||
@ApiProperty({ required: true, enum: PartnerFiscalSwitchType })
|
||||
@IsEnum(PartnerFiscalSwitchType)
|
||||
provider_code: PartnerFiscalSwitchType
|
||||
@ApiProperty({ required: true, enum: TspProviderType })
|
||||
@IsEnum(TspProviderType)
|
||||
tsp_provider: TspProviderType
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsString()
|
||||
economic_code: string
|
||||
|
||||
@ApiProperty({ required: true, nullable: true })
|
||||
@IsString()
|
||||
fiscal_id: string
|
||||
|
||||
@ApiProperty({ required: true, type: [PaymentInfoDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => PaymentInfoDto)
|
||||
payments: PaymentInfoDto[]
|
||||
|
||||
@ApiProperty({ required: true, enum: InvoiceTemplateType })
|
||||
@IsEnum(InvoiceTemplateType)
|
||||
invoice_template: InvoiceTemplateType
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tsp_token: string
|
||||
}
|
||||
|
||||
export class TaxSwitchSendItemResultDto {
|
||||
export class TspProviderSendItemResultDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_item_id: string
|
||||
invoice_id: string
|
||||
|
||||
@ApiProperty({ enum: TaxSendStatus })
|
||||
@IsEnum(TaxSendStatus)
|
||||
status: TaxSendStatus
|
||||
@ApiProperty({ enum: TspProviderResponseStatus })
|
||||
@IsEnum(TspProviderResponseStatus)
|
||||
status: TspProviderResponseStatus
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tax_id?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@ApiProperty({ required: true, nullable: true, type: TspProviderSendPayloadDto })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
request_payload?: unknown
|
||||
@Type(() => TspProviderSendPayloadDto)
|
||||
request_payload: TspProviderSendPayloadDto
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
response_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsBoolean()
|
||||
hasError: boolean
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
error_message?: string | null
|
||||
message?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
@IsDateString()
|
||||
sent_at?: string | null
|
||||
sent_at: string
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
@IsDateString()
|
||||
received_at?: string | null
|
||||
received_at: string
|
||||
}
|
||||
|
||||
export class TaxSwitchBulkSendResultDto {
|
||||
export class TspProviderBulkSendResultDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
invoice_id: string
|
||||
|
||||
@ApiProperty({ type: [TaxSwitchSendItemResultDto] })
|
||||
@ApiProperty({ type: [TspProviderSendItemResultDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => TaxSwitchSendItemResultDto)
|
||||
items: TaxSwitchSendItemResultDto[]
|
||||
@Type(() => TspProviderSendItemResultDto)
|
||||
items: TspProviderSendItemResultDto[]
|
||||
}
|
||||
|
||||
export class TaxSwitchGetResultDto {
|
||||
export class TspProviderGetResultDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tax_id: string
|
||||
|
||||
@ApiProperty({ enum: TaxSendStatus })
|
||||
@IsEnum(TaxSendStatus)
|
||||
status: TaxSendStatus
|
||||
@ApiProperty({ enum: TspProviderResponseStatus })
|
||||
@IsEnum(TspProviderResponseStatus)
|
||||
status: TspProviderResponseStatus
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsBoolean()
|
||||
hasError: boolean
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
message?: string | null
|
||||
|
||||
@ApiProperty({ required: false, nullable: true, type: Object })
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
response_payload?: unknown
|
||||
|
||||
@ApiProperty({ required: false, nullable: true })
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: true })
|
||||
@IsDateString()
|
||||
received_at?: string | null
|
||||
sent_at: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsDateString()
|
||||
received_at: string
|
||||
}
|
||||
|
||||
export interface ITaxSwitchAdapter {
|
||||
export interface IProviderSwitchAdapter {
|
||||
readonly code: string
|
||||
send(payload: TaxSwitchSendPayloadDto): Promise<TaxSwitchSendItemResultDto[]>
|
||||
sendBulk(payloads: TaxSwitchSendPayloadDto[]): Promise<TaxSwitchBulkSendResultDto[]>
|
||||
get(taxId: string): Promise<TaxSwitchGetResultDto>
|
||||
send(payload: TspProviderSendPayloadDto): Promise<TspProviderSendItemResultDto>
|
||||
sendBulk(payloads: TspProviderSendPayloadDto[]): Promise<TspProviderBulkSendResultDto[]>
|
||||
get(invoiceId: string, tsp_token: string): Promise<TspProviderGetResultDto>
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import {
|
||||
TspProviderBulkSendResultDto,
|
||||
TspProviderGetResultDto,
|
||||
TspProviderSendItemResultDto,
|
||||
TspProviderSendPayloadDto,
|
||||
} from './dto/provider-switch.dto'
|
||||
import { NamaProviderSwitchAdapter } from './switch/nama/nama-provider.adapter'
|
||||
|
||||
@Injectable()
|
||||
export class SalesInvoiceTspSwitchService {
|
||||
constructor(private readonly namaAdapter: NamaProviderSwitchAdapter) {}
|
||||
|
||||
private resolveSwitch(providerCode: string) {
|
||||
const normalizedCode = providerCode.trim().toUpperCase() || ''
|
||||
|
||||
switch (normalizedCode) {
|
||||
case 'NAMA':
|
||||
default:
|
||||
return this.namaAdapter
|
||||
}
|
||||
}
|
||||
|
||||
async send(payload: TspProviderSendPayloadDto): Promise<TspProviderSendItemResultDto> {
|
||||
const adapter = this.resolveSwitch(payload.tsp_provider)
|
||||
return adapter.send(payload)
|
||||
}
|
||||
|
||||
async sendBulk(
|
||||
payloads: TspProviderSendPayloadDto[],
|
||||
): Promise<TspProviderBulkSendResultDto[]> {
|
||||
const groupedByProvider = new Map<string, TspProviderSendPayloadDto[]>()
|
||||
|
||||
for (const payload of payloads) {
|
||||
const key = payload.tsp_provider?.trim().toUpperCase() || 'NAMA'
|
||||
const currentGroup = groupedByProvider.get(key) || []
|
||||
currentGroup.push(payload)
|
||||
groupedByProvider.set(key, currentGroup)
|
||||
}
|
||||
|
||||
const result: TspProviderBulkSendResultDto[] = []
|
||||
for (const [providerCode, groupedPayloads] of groupedByProvider.entries()) {
|
||||
const adapter = this.resolveSwitch(providerCode)
|
||||
const providerResult = await adapter.sendBulk(groupedPayloads)
|
||||
result.push(...providerResult)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
async get(
|
||||
providerCode: string,
|
||||
invoiceId: string,
|
||||
tspToken: string,
|
||||
): Promise<TspProviderGetResultDto> {
|
||||
const adapter = this.resolveSwitch(providerCode)
|
||||
return await adapter.get(invoiceId, tspToken)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,595 @@
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'
|
||||
import {
|
||||
TspProviderCustomerType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
} from 'generated/prisma/client'
|
||||
import { CreateSalesInvoiceDto } from '../pos/sales-invoices/dto/create-sales-invoice.dto'
|
||||
import {
|
||||
TspProviderSendItemResultDto,
|
||||
TspProviderSendPayloadDto,
|
||||
} from './dto/provider-switch.dto'
|
||||
import { SalesInvoiceTspSwitchService } from './sales-invoice-tsp-switch.service'
|
||||
|
||||
type ItemTspRow = {
|
||||
tsp_provider: string | null
|
||||
tax_id: string | null
|
||||
}
|
||||
|
||||
type IAttempt = any
|
||||
|
||||
@Injectable()
|
||||
export class SalesInvoiceTspService {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly tspSwitchService: SalesInvoiceTspSwitchService,
|
||||
) {}
|
||||
|
||||
async send(consumer_id: string, invoice_id: string): Promise<IAttempt> {
|
||||
const posId = await this.getPosId(consumer_id, invoice_id)
|
||||
const payload = await this.buildPayload(invoice_id, posId)
|
||||
const attempt = await this.prisma.saleInvoiceTspAttempts.create({
|
||||
data: {
|
||||
attempt_no: 1,
|
||||
invoice_id,
|
||||
status: TspProviderResponseStatus.QUEUED,
|
||||
type: TspProviderRequestType.MAIN,
|
||||
request_payload: JSON.parse(JSON.stringify(payload)),
|
||||
},
|
||||
})
|
||||
|
||||
const sendResult = await this.trySend(payload)
|
||||
|
||||
console.log('sendResult')
|
||||
console.log(sendResult)
|
||||
|
||||
if (sendResult) {
|
||||
if (sendResult.hasError) {
|
||||
throw new Error(sendResult.message || '')
|
||||
}
|
||||
|
||||
const updatedAttempt = await this.prisma.saleInvoiceTspAttempts.update({
|
||||
where: {
|
||||
id: attempt.id,
|
||||
},
|
||||
data: {
|
||||
response_payload: JSON.parse(JSON.stringify(sendResult)),
|
||||
status: sendResult.status,
|
||||
tax_id: sendResult.tax_id,
|
||||
sent_at: sendResult.sent_at,
|
||||
received_at: sendResult.received_at,
|
||||
},
|
||||
select: {
|
||||
status: true,
|
||||
invoice: true,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
...updatedAttempt.invoice,
|
||||
status: updatedAttempt.status,
|
||||
}
|
||||
} else {
|
||||
throw new NotFoundException(
|
||||
'متاسفانه امکان ارسال فاکتور به سیستم مالیاتی در حال حاضر وجود ندارد. لطفا بعدا تلاش کنید.',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async sendBulk(consumer_id: string, invoice_ids: string[]): Promise<void> {
|
||||
if (!invoice_ids.length) return
|
||||
|
||||
const payloads: TspProviderSendPayloadDto[] = []
|
||||
for (const invoiceId of invoice_ids) {
|
||||
const posId = await this.getPosId(consumer_id, invoiceId)
|
||||
payloads.push(await this.buildPayload(invoiceId, posId))
|
||||
}
|
||||
|
||||
const bulkResult = await this.tspSwitchService.sendBulk(payloads)
|
||||
const allItemResults = bulkResult.flatMap(result => result.items)
|
||||
await this.persistAttemptResults(allItemResults)
|
||||
}
|
||||
|
||||
async get(invoice_id: string, pos_id: string, consumer_id: string): Promise<IAttempt> {
|
||||
const [attempt, pos] = await this.prisma.$transaction(async tx => [
|
||||
await tx.saleInvoiceTspAttempts.findFirst({
|
||||
where: {
|
||||
invoice_id,
|
||||
invoice: {
|
||||
pos: {
|
||||
id: pos_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
}),
|
||||
|
||||
await tx.pos.findUnique({
|
||||
where: {
|
||||
id: pos_id,
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
partner_token: true,
|
||||
consumer: {
|
||||
select: {
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
tsp_provider: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
tsp_provider: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
])
|
||||
|
||||
if (!attempt) {
|
||||
throw new NotFoundException('صورتحساب ارسالی فاکتور شما به سامانه یافت نشد.')
|
||||
}
|
||||
if (!pos) {
|
||||
throw new NotFoundException('مشکلی در ساختار اطلاعات ورودی شما وجود دارد.')
|
||||
}
|
||||
|
||||
const { business_activity } = pos.complex
|
||||
|
||||
const { partner } = (business_activity.consumer.individual ||
|
||||
business_activity.consumer.legal)!
|
||||
|
||||
const result = await this.tspSwitchService.get(
|
||||
partner.tsp_provider,
|
||||
invoice_id,
|
||||
business_activity.partner_token,
|
||||
)
|
||||
|
||||
console.log('getResult', result)
|
||||
|
||||
if (!result) {
|
||||
throw new NotFoundException('نتیجه ارسال فاکتور یافت نشد.')
|
||||
}
|
||||
|
||||
const updatedAttempt = await this.prisma.saleInvoiceTspAttempts.update({
|
||||
where: {
|
||||
id: attempt.id,
|
||||
},
|
||||
data: {
|
||||
response_payload: JSON.parse(JSON.stringify(result)),
|
||||
status: result.status,
|
||||
received_at: result.received_at,
|
||||
},
|
||||
select: {
|
||||
status: true,
|
||||
invoice: true,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
...updatedAttempt.invoice,
|
||||
status: updatedAttempt.status,
|
||||
}
|
||||
}
|
||||
|
||||
async update(
|
||||
consumer_id: string,
|
||||
invoice_id: string,
|
||||
dataToUpdate: CreateSalesInvoiceDto,
|
||||
): Promise<IAttempt> {
|
||||
const posId = await this.getPosId(consumer_id, invoice_id)
|
||||
const payload = await this.buildPayload(invoice_id, posId)
|
||||
|
||||
const lastAttempt = await this.prisma.saleInvoiceTspAttempts.findFirst({
|
||||
where: {
|
||||
invoice_id,
|
||||
invoice: {
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
include: {
|
||||
invoice: {
|
||||
include: {
|
||||
items: {
|
||||
include: {
|
||||
good: true,
|
||||
},
|
||||
},
|
||||
payments: {
|
||||
include: {
|
||||
terminal_info: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!lastAttempt || lastAttempt?.status === TspProviderResponseStatus.QUEUED) {
|
||||
throw new BadRequestException(
|
||||
'فاکتور هنوز به سامانه مالیاتی ارسال نشده است یا در صف ارسال قرار دارد. لطفا بعدا تلاش کنید.',
|
||||
)
|
||||
}
|
||||
|
||||
let isUpdated = false
|
||||
let isBackFromSale = false
|
||||
for (let item of dataToUpdate.items) {
|
||||
const lastAttemptInvoiceItem = lastAttempt.invoice.items.find(
|
||||
prevItem => prevItem.good_id === item.good_id,
|
||||
)
|
||||
if (!lastAttemptInvoiceItem) {
|
||||
isBackFromSale = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (dataToUpdate.total_amount !== lastAttempt.invoice.total_amount.toNumber()) {
|
||||
isUpdated = true
|
||||
}
|
||||
|
||||
const attempt = await this.prisma.saleInvoiceTspAttempts.create({
|
||||
data: {
|
||||
attempt_no: 1,
|
||||
invoice_id,
|
||||
status: TspProviderResponseStatus.QUEUED,
|
||||
type: TspProviderRequestType.MAIN,
|
||||
request_payload: JSON.parse(JSON.stringify(payload)),
|
||||
},
|
||||
})
|
||||
|
||||
const sendResult = await this.trySend(payload)
|
||||
|
||||
console.log('sendResult')
|
||||
console.log(sendResult)
|
||||
|
||||
if (sendResult) {
|
||||
if (sendResult.hasError) {
|
||||
throw new Error(sendResult.message || '')
|
||||
}
|
||||
|
||||
const updatedAttempt = await this.prisma.saleInvoiceTspAttempts.update({
|
||||
where: {
|
||||
id: attempt.id,
|
||||
},
|
||||
data: {
|
||||
response_payload: JSON.parse(JSON.stringify(sendResult)),
|
||||
status: sendResult.status,
|
||||
tax_id: sendResult.tax_id,
|
||||
sent_at: sendResult.sent_at,
|
||||
received_at: sendResult.received_at,
|
||||
},
|
||||
select: {
|
||||
status: true,
|
||||
invoice: true,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
...updatedAttempt.invoice,
|
||||
status: updatedAttempt.status,
|
||||
}
|
||||
} else {
|
||||
throw new NotFoundException(
|
||||
'متاسفانه امکان ارسال فاکتور به سیستم مالیاتی در حال حاضر وجود ندارد. لطفا بعدا تلاش کنید.',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private async getPosId(consumer_id: string, invoice_id: string): Promise<string> {
|
||||
const now = new Date()
|
||||
const saleInvoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoice_id,
|
||||
pos: {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
pos: {
|
||||
select: {
|
||||
id: true,
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
name: true,
|
||||
license_activation: {
|
||||
select: {
|
||||
expires_at: true,
|
||||
license_renews: {
|
||||
select: {
|
||||
expires_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!saleInvoice) {
|
||||
throw new NotFoundException('متاسفانه فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { license_activation, name: businessName } =
|
||||
saleInvoice.pos.complex.business_activity
|
||||
let expired = !license_activation || false
|
||||
if (license_activation) {
|
||||
const { expires_at, license_renews } = license_activation
|
||||
if (expires_at < now) {
|
||||
for (const renew of license_renews) {
|
||||
if (renew.expires_at > now) {
|
||||
expired = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (expired) {
|
||||
throw new NotFoundException(`متاسفانه مجوز ${businessName} منقضی شده است.`)
|
||||
}
|
||||
|
||||
return saleInvoice.pos.id
|
||||
}
|
||||
|
||||
private async buildPayload(
|
||||
invoiceId: string,
|
||||
posId: string,
|
||||
): Promise<TspProviderSendPayloadDto> {
|
||||
const invoice = await this.prisma.salesInvoice.findUnique({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
pos_id: posId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
total_amount: true,
|
||||
invoice_date: true,
|
||||
invoice_number: true,
|
||||
items: {
|
||||
select: {
|
||||
id: true,
|
||||
quantity: true,
|
||||
unit_price: true,
|
||||
total_amount: true,
|
||||
measure_unit_code: true,
|
||||
measure_unit_text: true,
|
||||
sku_code: true,
|
||||
sku_vat: true,
|
||||
good_id: true,
|
||||
service_id: true,
|
||||
payload: true,
|
||||
good_snapshot: true,
|
||||
},
|
||||
},
|
||||
pos: {
|
||||
select: {
|
||||
complex: {
|
||||
select: {
|
||||
business_activity: {
|
||||
select: {
|
||||
fiscal_id: true,
|
||||
economic_code: true,
|
||||
partner_token: true,
|
||||
guild: {
|
||||
select: {
|
||||
invoice_template: true,
|
||||
},
|
||||
},
|
||||
consumer: {
|
||||
select: {
|
||||
legal: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
tsp_provider: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
individual: {
|
||||
select: {
|
||||
partner: {
|
||||
select: {
|
||||
tsp_provider: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
customer: {
|
||||
select: {
|
||||
type: true,
|
||||
individual: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
national_id: true,
|
||||
mobile_number: true,
|
||||
},
|
||||
},
|
||||
legal: {
|
||||
select: {
|
||||
name: true,
|
||||
economic_code: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
payments: {
|
||||
select: {
|
||||
amount: true,
|
||||
payment_method: true,
|
||||
paid_at: true,
|
||||
terminal_info: {
|
||||
select: {
|
||||
stan: true,
|
||||
rrn: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!invoice) {
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { partner } = (invoice.pos.complex.business_activity.consumer.legal ||
|
||||
invoice.pos.complex.business_activity.consumer.individual)!
|
||||
|
||||
return {
|
||||
invoice_id: invoice.id,
|
||||
invoice_number: invoice.invoice_number,
|
||||
invoice_date: invoice.invoice_date,
|
||||
total_amount: Number(invoice.total_amount),
|
||||
economic_code: invoice.pos.complex.business_activity.economic_code,
|
||||
fiscal_id: invoice.pos.complex.business_activity.fiscal_id,
|
||||
invoice_template: invoice.pos.complex.business_activity.guild.invoice_template,
|
||||
tsp_token: invoice.pos.complex.business_activity.partner_token,
|
||||
payments: invoice.payments.map(payment => ({
|
||||
amount: Number(payment.amount),
|
||||
payment_method: payment.payment_method,
|
||||
paid_at: payment.paid_at,
|
||||
card_number: payment.terminal_info ? payment.terminal_info.stan : undefined,
|
||||
tracking_code: payment.terminal_info ? payment.terminal_info.rrn : undefined,
|
||||
})),
|
||||
type: TspProviderRequestType.MAIN,
|
||||
tsp_provider: partner.tsp_provider!,
|
||||
customer_type: invoice.customer?.type
|
||||
? TspProviderCustomerType.Known
|
||||
: TspProviderCustomerType.Unknown,
|
||||
customer: invoice.customer?.type
|
||||
? {
|
||||
type: invoice.customer.type,
|
||||
legal_info: invoice.customer.legal ?? undefined,
|
||||
individual_info: invoice.customer.individual ?? undefined,
|
||||
}
|
||||
: undefined,
|
||||
items: invoice.items.map(item => ({
|
||||
invoice_item_id: item.id,
|
||||
quantity: Number(item.quantity),
|
||||
unit_price: Number(item.unit_price),
|
||||
total_amount: Number(item.total_amount),
|
||||
measure_unit: item.measure_unit_code,
|
||||
sku: item.sku_code,
|
||||
sku_vat: String(item.sku_vat),
|
||||
discount: String((item.payload as Record<string, any>)?.discount || '0'),
|
||||
good_id: item.good_id,
|
||||
service_id: item.service_id,
|
||||
payload: item.payload,
|
||||
good_snapshot: item.good_snapshot,
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
private async trySend(
|
||||
payload: TspProviderSendPayloadDto,
|
||||
): Promise<TspProviderSendItemResultDto | null> {
|
||||
const taxResult = await this.tspSwitchService.send(payload)
|
||||
|
||||
return taxResult || null
|
||||
}
|
||||
|
||||
private async persistAttemptResults(
|
||||
itemResults: TspProviderSendItemResultDto[],
|
||||
): Promise<any> {
|
||||
if (!itemResults.length) return
|
||||
|
||||
const attemptsResult = [] as any[]
|
||||
console.log('persistAttemptResults')
|
||||
|
||||
for (const itemResult of itemResults) {
|
||||
const attempt = await this.prisma.$transaction(async tx => {
|
||||
const lastAttempt = await tx.saleInvoiceTspAttempts.findFirst({
|
||||
where: {
|
||||
invoice_id: itemResult.invoice_id,
|
||||
},
|
||||
orderBy: {
|
||||
attempt_no: 'desc',
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
})
|
||||
|
||||
const attempt = await tx.saleInvoiceTspAttempts.update({
|
||||
where: {
|
||||
id: lastAttempt!.id,
|
||||
},
|
||||
data: {
|
||||
status: itemResult.status,
|
||||
tax_id: itemResult.tax_id,
|
||||
request_payload: JSON.parse(JSON.stringify(itemResult.request_payload)),
|
||||
response_payload: JSON.parse(JSON.stringify(itemResult.response_payload)),
|
||||
error_message: itemResult.message,
|
||||
sent_at: itemResult.sent_at ? new Date(itemResult.sent_at) : new Date(),
|
||||
received_at: itemResult.received_at
|
||||
? new Date(itemResult.received_at)
|
||||
: new Date(),
|
||||
},
|
||||
})
|
||||
|
||||
return attempt
|
||||
})
|
||||
attemptsResult.push(attempt)
|
||||
}
|
||||
|
||||
console.log(attemptsResult)
|
||||
|
||||
return attemptsResult
|
||||
}
|
||||
}
|
||||
|
||||
// {"type": "MAIN", "items": [{"sku": "2720000044726", "good_id": "01KQHY48M299C9BG2D06DMWK4E", "payload": {"karat": "18", "wages": 40000000, "profit": 48000000, "commission": 40000000}, "sku_vat": "0", "discount": "0", "quantity": 2, "service_id": null, "unit_price": 200000000, "measure_unit": "63", "total_amount": 540800000, "good_snapshot": {"good": {"id": "01KQHY48M299C9BG2D06DMWK4E", "sku": {"id": "01KQHXE2D4XEFSDK4DSV2J6GT2", "VAT": "0", "code": "2720000044726", "name": "گوشواره طلا زیورالات ساخته شده از طلا"}, "name": "گوشواره", "barcode": null, "category": {"id": "01KQHY48CF6X2TK2AG09MKDVKQ", "name": "زیورآلات"}, "image_url": null, "local_sku": null, "measure_unit": {"id": "01KQHY489HE02787SE8TWDE18S", "code": "63", "name": "گرم"}, "pricing_model": "GOLD", "base_sale_price": "0"}}, "invoice_item_id": "01KQMZTMDC4M4T7VE9GFZJEW4E"}], "payments": [{"amount": 540800000, "paid_at": "2026-05-02T18:39:46.000Z", "payment_method": "CASH"}], "fiscal_id": "A296T3", "tsp_token": "pfFE6QxOJxUIhzkpUCPWYMR5", "invoice_id": "98c3377d-4e42-4703-97f0-38c3b3c8e87f", "invoice_date": "2026-05-02T18:39:46.000Z", "total_amount": 540800000, "tsp_provider": "NAMA", "customer_type": "Unknown", "economic_code": "14003579468", "invoice_number": 13, "invoice_template": "GOLD_JEWELRY"}
|
||||
@@ -0,0 +1,340 @@
|
||||
import {
|
||||
createEnsureSuccessResponseInterceptor,
|
||||
createHeaderRequestInterceptor,
|
||||
FetchRequestInterceptor,
|
||||
} from '@/common/interceptors/fetch-request.interceptor'
|
||||
import { HttpClientUtil } from '@/common/utils/http-client.util'
|
||||
import {
|
||||
CustomerType,
|
||||
InvoiceTemplateType,
|
||||
PaymentMethodType,
|
||||
TspProviderCustomerType,
|
||||
TspProviderRequestType,
|
||||
TspProviderResponseStatus,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { Injectable, Logger } from '@nestjs/common'
|
||||
import {
|
||||
CustomerInfoDto,
|
||||
IProviderSwitchAdapter,
|
||||
PaymentInfoDto,
|
||||
TspProviderBulkSendResultDto,
|
||||
TspProviderGetResultDto,
|
||||
TspProviderSendItemResultDto,
|
||||
TspProviderSendPayloadDto,
|
||||
} from '../../dto/provider-switch.dto'
|
||||
import {
|
||||
NamaProviderGetResponseDto,
|
||||
NamaProviderPaymentInfoDto,
|
||||
NamaProviderRequestDto,
|
||||
NamaProviderResponseStatus,
|
||||
NamaProviderSendItemResponseDto,
|
||||
} from './nama-provider.dto'
|
||||
|
||||
@Injectable()
|
||||
export class NamaProviderSwitchAdapter implements IProviderSwitchAdapter {
|
||||
readonly code = 'NAMA'
|
||||
private readonly logger = new Logger(NamaProviderSwitchAdapter.name)
|
||||
private readonly sandboxBaseUrl =
|
||||
process.env.NAMA_PROVIDER_SANDBOX_URL || 'https://external-api-dev.namatsp.ir'
|
||||
private readonly productionBaseUrl =
|
||||
process.env.NAMA_PROVIDER_PRODUCTION_URL || 'https://api.nama.ir'
|
||||
|
||||
private readonly sendPath = '/api/v1/invoices/single-send'
|
||||
private readonly sendBulkPath = '/api/v1/invoices'
|
||||
private readonly checkBulkStatus = '/api/v1/invoices/check-by-uuids'
|
||||
private readonly getPath = '/api/v1/invoices'
|
||||
constructor(private readonly httpClient: HttpClientUtil) {}
|
||||
|
||||
private get baseUrl() {
|
||||
return this.sandboxBaseUrl
|
||||
// return process.env.NODE_ENV === 'production'
|
||||
// ? this.productionBaseUrl
|
||||
// : this.sandboxBaseUrl
|
||||
}
|
||||
|
||||
private buildSendUrl() {
|
||||
return `${this.baseUrl}${this.sendPath}`
|
||||
}
|
||||
|
||||
private buildGetUrl(invoiceId: string) {
|
||||
return `${this.baseUrl}${this.getPath}/${invoiceId}`
|
||||
}
|
||||
|
||||
private createRequestInterceptors(token: string): FetchRequestInterceptor[] {
|
||||
return [
|
||||
createHeaderRequestInterceptor({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: token,
|
||||
}),
|
||||
createEnsureSuccessResponseInterceptor(),
|
||||
{
|
||||
onError: (context, error) => {
|
||||
this.logger.error(`NAMA request failed: ${context.url}`, error)
|
||||
return Promise.reject(error)
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
async send(payload: TspProviderSendPayloadDto): Promise<TspProviderSendItemResultDto> {
|
||||
const mappedRequest = this.mapToNamaRequestDto(payload)
|
||||
try {
|
||||
console.log(mappedRequest)
|
||||
|
||||
const response = await this.httpClient.request(
|
||||
this.buildSendUrl(),
|
||||
{
|
||||
method: 'POST',
|
||||
body: JSON.stringify(mappedRequest),
|
||||
},
|
||||
this.createRequestInterceptors(payload.tsp_token),
|
||||
)
|
||||
const providerResponse: NamaProviderSendItemResponseDto = await response.json()
|
||||
this.logger.debug('NAMA provider response', providerResponse)
|
||||
|
||||
const result: TspProviderSendItemResultDto = {
|
||||
invoice_id: payload.invoice_id,
|
||||
request_payload: payload,
|
||||
hasError: !response.ok,
|
||||
message: providerResponse.message,
|
||||
sent_at: new Date().toISOString(),
|
||||
response_payload: providerResponse,
|
||||
received_at: providerResponse.tsp_update_time,
|
||||
tax_id: providerResponse.tax_id,
|
||||
status: this.mapResponseStatus(
|
||||
providerResponse.status as NamaProviderResponseStatus,
|
||||
),
|
||||
}
|
||||
|
||||
return result
|
||||
} catch (err) {
|
||||
this.logger.error('NAMA send failed', err)
|
||||
const failure: TspProviderSendItemResultDto = {
|
||||
invoice_id: payload.invoice_id,
|
||||
request_payload: payload,
|
||||
hasError: true,
|
||||
message: (err as Error).message,
|
||||
sent_at: new Date().toISOString(),
|
||||
received_at: new Date().toISOString(),
|
||||
tax_id: null,
|
||||
status: TspProviderResponseStatus.NOT_SEND,
|
||||
}
|
||||
return failure
|
||||
}
|
||||
}
|
||||
|
||||
async sendBulk(
|
||||
payloads: TspProviderSendPayloadDto[],
|
||||
): Promise<TspProviderBulkSendResultDto[]> {
|
||||
const result: TspProviderBulkSendResultDto[] = []
|
||||
for (const payload of payloads) {
|
||||
const itemResults = await this.send(payload)
|
||||
result.push({
|
||||
invoice_id: payload.invoice_id,
|
||||
items: [itemResults],
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
async get(invoiceId: string, tsp_token: string): Promise<TspProviderGetResultDto> {
|
||||
try {
|
||||
const response = await this.httpClient.request(
|
||||
this.buildGetUrl(invoiceId),
|
||||
{
|
||||
method: 'GET',
|
||||
},
|
||||
this.createRequestInterceptors(tsp_token),
|
||||
)
|
||||
const providerResponse: NamaProviderGetResponseDto = await response.json()
|
||||
this.logger.debug('NAMA provider response', providerResponse)
|
||||
|
||||
const result: TspProviderGetResultDto = {
|
||||
hasError: !response.ok,
|
||||
message: providerResponse.message,
|
||||
response_payload: providerResponse,
|
||||
sent_at: new Date().toISOString(),
|
||||
received_at: providerResponse.tsp_update_time || new Date().toISOString(),
|
||||
tax_id: providerResponse.tax_id,
|
||||
status: this.mapResponseStatus(
|
||||
providerResponse.status as NamaProviderResponseStatus,
|
||||
),
|
||||
}
|
||||
|
||||
return result
|
||||
} catch (err) {
|
||||
this.logger.error('NAMA send failed', err)
|
||||
// const failure: TspProviderGetResultDto = {
|
||||
// invoice_id: invoiceId,
|
||||
// hasError: true,
|
||||
// message: (err as Error).message,
|
||||
// received_at: new Date().toISOString(),
|
||||
// tax_id: null,
|
||||
// status: TspProviderResponseStatus.NOT_SEND,
|
||||
// }
|
||||
// return failure
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
private mapResponseStatus(
|
||||
status: NamaProviderResponseStatus,
|
||||
): TspProviderResponseStatus {
|
||||
switch (status.toUpperCase()) {
|
||||
case NamaProviderResponseStatus.SUCCESS:
|
||||
case NamaProviderResponseStatus.POSTED:
|
||||
return TspProviderResponseStatus.SUCCESS
|
||||
case NamaProviderResponseStatus.PENDING:
|
||||
case NamaProviderResponseStatus.IN_PROGRESS:
|
||||
return TspProviderResponseStatus.QUEUED
|
||||
case NamaProviderResponseStatus.FAILED:
|
||||
return TspProviderResponseStatus.FAILURE
|
||||
default:
|
||||
return TspProviderResponseStatus.QUEUED
|
||||
}
|
||||
}
|
||||
|
||||
private mapToNamaRequestDto(
|
||||
payload: TspProviderSendPayloadDto,
|
||||
): NamaProviderRequestDto {
|
||||
return {
|
||||
uuid: payload.invoice_id,
|
||||
economic_code: payload.economic_code,
|
||||
fiscal_id: payload.fiscal_id,
|
||||
payment: this.mapPayments(payload.payments),
|
||||
header: {
|
||||
ins: this.mapTspProviderRequestType(payload.type),
|
||||
inp: this.mapInvoiceTemplate(payload.invoice_template),
|
||||
inty: this.mapTspProviderCustomerType(payload.customer_type),
|
||||
inno: payload.invoice_number.toString(),
|
||||
tins: '',
|
||||
indatim: payload.invoice_date.getTime() + '',
|
||||
setm: '1',
|
||||
...this.mapCustomerInfo(payload.customer),
|
||||
},
|
||||
body: payload.items.map(item => ({
|
||||
sstid: item.sku,
|
||||
vra: item.sku_vat,
|
||||
// sstt: item.unit_type,
|
||||
fee: String(item.unit_price),
|
||||
dis: String(item.discount),
|
||||
mu: item.measure_unit,
|
||||
am: String(item.quantity),
|
||||
consfee: '0',
|
||||
bros: '0',
|
||||
spro: '0',
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
private mapTspProviderRequestType(type: TspProviderRequestType) {
|
||||
switch (type) {
|
||||
case TspProviderRequestType.MAIN:
|
||||
return '1'
|
||||
case TspProviderRequestType.UPDATE:
|
||||
return '2'
|
||||
case TspProviderRequestType.REVOKE:
|
||||
return '3'
|
||||
case TspProviderRequestType.REMOVE:
|
||||
return '4'
|
||||
}
|
||||
}
|
||||
|
||||
private mapInvoiceTemplate(template: InvoiceTemplateType) {
|
||||
switch (template) {
|
||||
case InvoiceTemplateType.SALE:
|
||||
return '1'
|
||||
case InvoiceTemplateType.FX_SALE:
|
||||
return '2'
|
||||
case InvoiceTemplateType.GOLD_JEWELRY:
|
||||
return '3'
|
||||
case InvoiceTemplateType.CONTRACT:
|
||||
return '4'
|
||||
case InvoiceTemplateType.UTILITY:
|
||||
return '5'
|
||||
case InvoiceTemplateType.AIR_TICKET:
|
||||
return '6'
|
||||
case InvoiceTemplateType.EXPORT:
|
||||
return '7'
|
||||
case InvoiceTemplateType.BILL_OF_LADING:
|
||||
return '8'
|
||||
case InvoiceTemplateType.PETROCHEMICAL:
|
||||
return '9'
|
||||
case InvoiceTemplateType.COMMODITY_EXCHANGE:
|
||||
return '11'
|
||||
case InvoiceTemplateType.INSURANCE:
|
||||
return '13'
|
||||
}
|
||||
}
|
||||
|
||||
private mapTspProviderCustomerType(type?: TspProviderCustomerType) {
|
||||
switch (type) {
|
||||
case TspProviderCustomerType.Unknown:
|
||||
return '1'
|
||||
case TspProviderCustomerType.Known:
|
||||
return '2'
|
||||
default:
|
||||
return '3'
|
||||
}
|
||||
}
|
||||
|
||||
private mapCustomerType(type?: CustomerType) {
|
||||
switch (type) {
|
||||
case CustomerType.INDIVIDUAL:
|
||||
return '1'
|
||||
case CustomerType.LEGAL:
|
||||
return '2'
|
||||
default:
|
||||
return '5'
|
||||
}
|
||||
}
|
||||
|
||||
private mapCustomerInfo(customer?: CustomerInfoDto) {
|
||||
const info = {} as any
|
||||
info.tob = this.mapCustomerType(customer?.type)
|
||||
if (customer?.type === CustomerType.LEGAL && customer.legal_info) {
|
||||
info.name = customer.legal_info.name
|
||||
info.bid = customer.legal_info.economic_code
|
||||
info.address = ''
|
||||
} else if (customer?.type === CustomerType.INDIVIDUAL && customer.individual_info) {
|
||||
info.name = `${customer.individual_info?.first_name || ''} ${
|
||||
customer.individual_info?.last_name || ''
|
||||
}`.trim()
|
||||
info.bid = customer.individual_info.national_id
|
||||
info.mobile = customer.individual_info.mobile_number
|
||||
info.address = ''
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
private mapPaymentMethod(method: PaymentMethodType): number {
|
||||
switch (method) {
|
||||
case PaymentMethodType.CHEQUE:
|
||||
return 1
|
||||
case PaymentMethodType.SET_OFF:
|
||||
return 2
|
||||
case PaymentMethodType.CASH:
|
||||
return 3
|
||||
case PaymentMethodType.TERMINAL:
|
||||
return 4
|
||||
case PaymentMethodType.PAYMENT_GATEWAY:
|
||||
return 5
|
||||
case PaymentMethodType.CARD:
|
||||
return 6
|
||||
case PaymentMethodType.BANK:
|
||||
return 7
|
||||
case PaymentMethodType.OTHER:
|
||||
return 8
|
||||
}
|
||||
}
|
||||
|
||||
private mapPayments(payments: PaymentInfoDto[]): NamaProviderPaymentInfoDto[] {
|
||||
return payments.map(payment => ({
|
||||
pmt: this.mapPaymentMethod(payment.payment_method),
|
||||
pv: payment.amount,
|
||||
trn: payment.tracking_code,
|
||||
pcn: payment.card_number,
|
||||
pdt: payment.paid_at ? String(payment.paid_at.getTime()) : undefined,
|
||||
}))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
import { TspProviderResponseStatus } from '@/generated/prisma/enums'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
Min,
|
||||
ValidateNested,
|
||||
} from 'class-validator'
|
||||
|
||||
export enum NamaProviderResponseStatus {
|
||||
POSTED = 'SUCCESS',
|
||||
PENDING = 'PENDING',
|
||||
IN_PROGRESS = 'IN_PROGRESS',
|
||||
SUCCESS = 'SUCCESS',
|
||||
FAILED = 'FAILED',
|
||||
}
|
||||
|
||||
export class NamaProviderPaymentInfoDto {
|
||||
@ApiProperty({ required: true, description: 'روش پرداخت' })
|
||||
@IsNumber()
|
||||
pmt: number
|
||||
|
||||
@ApiProperty({ required: true, description: 'مبلغ پرداختی' })
|
||||
@IsNumber()
|
||||
@Min(10_000)
|
||||
pv: number
|
||||
|
||||
@ApiProperty({ required: false, description: 'شمارهی پیگیری' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
trn?: string
|
||||
|
||||
@ApiProperty({ required: false, description: 'شمارهی کارت پرداخت کنندهی صورتحساب' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
pcn?: string
|
||||
|
||||
@ApiProperty({ required: false, description: 'تاریخ و زمان پرداخت صورتحساب unix' })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
pdt?: string
|
||||
}
|
||||
|
||||
export class NamaProviderBodyItemDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sstid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
vra: string
|
||||
|
||||
// @ApiProperty()
|
||||
// @IsString()
|
||||
// sstt: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fee: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
dis: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
mu: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
am: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
consfee: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bros: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
spro: string
|
||||
}
|
||||
|
||||
export class NamaProviderHeaderDto {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
ins: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inp: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
inty: string
|
||||
|
||||
// @ApiProperty({required: true})
|
||||
// @IsString()
|
||||
// unique_tax_code: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tins: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
indatim: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
tob: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
address?: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
mobile?: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bid: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
setm: string
|
||||
}
|
||||
|
||||
export class NamaProviderRequestDto {
|
||||
@ApiProperty({ type: [NamaProviderBodyItemDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaProviderBodyItemDto)
|
||||
body: NamaProviderBodyItemDto[]
|
||||
|
||||
@ApiProperty({ type: [NamaProviderPaymentInfoDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaProviderPaymentInfoDto)
|
||||
payment: NamaProviderPaymentInfoDto[]
|
||||
|
||||
@ApiProperty({ type: NamaProviderHeaderDto })
|
||||
@ValidateNested()
|
||||
@Type(() => NamaProviderHeaderDto)
|
||||
header: NamaProviderHeaderDto
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
uuid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
economic_code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fiscal_id: string
|
||||
}
|
||||
|
||||
export class NamaProviderApiErrorItemDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
message: string
|
||||
}
|
||||
|
||||
export class NamaProviderApiErrorResponseDto {
|
||||
@ApiProperty({ type: [NamaProviderApiErrorItemDto], required: false })
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaProviderApiErrorItemDto)
|
||||
error?: NamaProviderApiErrorItemDto
|
||||
}
|
||||
|
||||
export class NamaProviderSendItemResponseDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
uuid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
message: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
status: NamaProviderResponseStatus
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tax_id: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
reference_number: string
|
||||
|
||||
@ApiProperty({ type: () => NamaProviderApiErrorResponseDto, required: false })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => NamaProviderApiErrorResponseDto)
|
||||
tax_api_response?: NamaProviderApiErrorResponseDto
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tsp_update_time: string
|
||||
}
|
||||
|
||||
export class NamaProviderGetResponseDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
uuid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
message: string
|
||||
|
||||
@ApiProperty({ enum: TspProviderResponseStatus })
|
||||
@IsEnum(TspProviderResponseStatus)
|
||||
status: TspProviderResponseStatus
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tax_id: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
reference_number: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tsp_update_time: string
|
||||
}
|
||||
Reference in New Issue
Block a user