create license management
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-- DropIndex
|
||||
DROP INDEX `accounts_password_key` ON `accounts`;
|
||||
@@ -0,0 +1,17 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `licenses` DROP FOREIGN KEY `licenses_partner_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `licenses_partner_id_fkey` ON `licenses`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `consumers` ADD COLUMN `license_id` VARCHAR(191) NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `licenses` MODIFY `partner_id` VARCHAR(191) NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `consumers` ADD CONSTRAINT `consumers_license_id_fkey` FOREIGN KEY (`license_id`) REFERENCES `licenses`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `licenses` ADD CONSTRAINT `licenses_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `pos_id` on the `licenses` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `licenses` DROP FOREIGN KEY `licenses_pos_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `licenses_pos_id_fkey` ON `licenses`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `licenses` DROP COLUMN `pos_id`;
|
||||
@@ -1,7 +1,7 @@
|
||||
model Account {
|
||||
id String @id @default(uuid())
|
||||
username String @unique()
|
||||
password String @unique()
|
||||
password String
|
||||
status AccountStatus
|
||||
type AccountType
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ model Consumer {
|
||||
first_name String
|
||||
last_name String
|
||||
status ConsumerStatus @default(ACTIVE)
|
||||
license_id String?
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
license License? @relation(fields: [license_id], references: [id])
|
||||
accounts ConsumerAccount[]
|
||||
businessActivities BusinessActivity[]
|
||||
|
||||
@@ -93,7 +95,6 @@ model Pos {
|
||||
provider_id String?
|
||||
provider Provider? @relation(fields: [provider_id], references: [id])
|
||||
|
||||
licenses License[]
|
||||
permissionPos PermissionPos[]
|
||||
salesInvoices SalesInvoice[]
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ model License {
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
pos_id String
|
||||
partner_id String
|
||||
partner_id String?
|
||||
|
||||
pos Pos @relation(fields: [pos_id], references: [id])
|
||||
partner Partner @relation(fields: [partner_id], references: [id])
|
||||
// pos Pos @relation(fields: [pos_id], references: [id])
|
||||
partner Partner? @relation(fields: [partner_id], references: [id])
|
||||
|
||||
consumers Consumer[]
|
||||
|
||||
@@map("licenses")
|
||||
}
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
// generator client {
|
||||
// provider = "prisma-client-js"
|
||||
// // output = "../../src/generated/prisma"
|
||||
// // moduleFormat = "cjs"
|
||||
// previewFeatures = ["views"]
|
||||
// }
|
||||
|
||||
// datasource db {
|
||||
// provider = "mysql"
|
||||
// }
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
// output = "../../src/generated/prisma"
|
||||
// moduleFormat = "cjs"
|
||||
provider = "prisma-client"
|
||||
output = "../../src/generated/prisma"
|
||||
moduleFormat = "cjs"
|
||||
previewFeatures = ["views"]
|
||||
}
|
||||
|
||||
|
||||
+276
-4
@@ -1,4 +1,6 @@
|
||||
import { PasswordUtil } from '@/common/utils/password.util'
|
||||
import { GoodPricingModel, POSType, UnitType } from '@/generated/prisma/enums'
|
||||
import { GoodCreateInput, GoodCreateManyInput } from '@/generated/prisma/models'
|
||||
import { prisma } from '../src/lib/prisma'
|
||||
|
||||
async function main() {
|
||||
@@ -28,8 +30,9 @@ async function main() {
|
||||
},
|
||||
})
|
||||
|
||||
const guildsCount = prisma.guild.count()
|
||||
if (!guildsCount) {
|
||||
// ****************** GUILD Start ****************** //
|
||||
const guilds = await prisma.guild.findMany()
|
||||
if (!guilds.length) {
|
||||
const guilds = await prisma.guild.createMany({
|
||||
data: [
|
||||
{
|
||||
@@ -42,9 +45,17 @@ async function main() {
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
const goldGuildId = guilds[0].id
|
||||
|
||||
// ****************** GUILD Good Categories Start ****************** //
|
||||
const goldGuildId = guilds[0].id
|
||||
const goldGuildGoodCategories = await prisma.goodCategory.findMany({
|
||||
where: {
|
||||
guild_id: goldGuildId,
|
||||
is_default_guild_good: true,
|
||||
},
|
||||
})
|
||||
if (!goldGuildGoodCategories) {
|
||||
const categoryFactory = (name: string) => ({
|
||||
name,
|
||||
guild_id: goldGuildId,
|
||||
@@ -62,6 +73,267 @@ async function main() {
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
// ****************** GUILD Good Start ****************** //
|
||||
const goodFactory = (
|
||||
name: string,
|
||||
categoryId: string,
|
||||
pricingModel: GoodPricingModel,
|
||||
unitType: UnitType,
|
||||
): GoodCreateManyInput => ({
|
||||
name,
|
||||
category_id: categoryId,
|
||||
pricing_model: pricingModel,
|
||||
sku: '',
|
||||
unit_type: unitType,
|
||||
is_default_guild_good: true,
|
||||
})
|
||||
|
||||
const zivarCategory = await prisma.goodCategory.findFirst({
|
||||
where: {
|
||||
name: 'زیورآلات',
|
||||
},
|
||||
})
|
||||
if (zivarCategory) {
|
||||
const zivarGoods = await prisma.good.count({
|
||||
where: {
|
||||
category_id: zivarCategory?.id,
|
||||
},
|
||||
})
|
||||
if (!zivarGoods) {
|
||||
const goodItems: GoodCreateManyInput[] = []
|
||||
|
||||
goodItems.push(
|
||||
...[
|
||||
goodFactory(
|
||||
'آویز گردنبند طلا',
|
||||
zivarCategory.id,
|
||||
GoodPricingModel.GOLD,
|
||||
UnitType.GRAM,
|
||||
),
|
||||
goodFactory('النگو', zivarCategory.id, GoodPricingModel.GOLD, UnitType.GRAM),
|
||||
goodFactory('انگشتر', zivarCategory.id, GoodPricingModel.GOLD, UnitType.GRAM),
|
||||
goodFactory('دستبند', zivarCategory.id, GoodPricingModel.GOLD, UnitType.GRAM),
|
||||
goodFactory('زنجیر', zivarCategory.id, GoodPricingModel.GOLD, UnitType.GRAM),
|
||||
goodFactory('سرویس', zivarCategory.id, GoodPricingModel.GOLD, UnitType.GRAM),
|
||||
goodFactory('گوشواره', zivarCategory.id, GoodPricingModel.GOLD, UnitType.GRAM),
|
||||
],
|
||||
)
|
||||
|
||||
await prisma.good.createMany({ data: goodItems })
|
||||
}
|
||||
}
|
||||
|
||||
const goldCategory = await prisma.goodCategory.findFirst({
|
||||
where: {
|
||||
name: 'طلا',
|
||||
},
|
||||
})
|
||||
if (goldCategory) {
|
||||
const goldGoods = await prisma.good.count({
|
||||
where: {
|
||||
category_id: goldCategory?.id,
|
||||
},
|
||||
})
|
||||
if (!goldGoods) {
|
||||
const goodItems: GoodCreateInput[] = []
|
||||
goodItems.push(
|
||||
...[
|
||||
goodFactory(
|
||||
'طلای آب شده',
|
||||
goldCategory.id,
|
||||
GoodPricingModel.GOLD,
|
||||
UnitType.GRAM,
|
||||
),
|
||||
goodFactory(
|
||||
'طلای شکسته',
|
||||
goldCategory.id,
|
||||
GoodPricingModel.GOLD,
|
||||
UnitType.GRAM,
|
||||
),
|
||||
goodFactory(
|
||||
'طلای مستعمل',
|
||||
goldCategory.id,
|
||||
GoodPricingModel.GOLD,
|
||||
UnitType.GRAM,
|
||||
),
|
||||
],
|
||||
)
|
||||
await prisma.good.createMany({ data: goodItems })
|
||||
}
|
||||
}
|
||||
|
||||
const coinCategory = await prisma.goodCategory.findFirst({
|
||||
where: {
|
||||
name: 'سکه',
|
||||
},
|
||||
})
|
||||
if (coinCategory) {
|
||||
const coinGoods = await prisma.good.count({
|
||||
where: {
|
||||
category_id: coinCategory?.id,
|
||||
},
|
||||
})
|
||||
if (!coinGoods) {
|
||||
const goodItems: GoodCreateInput[] = []
|
||||
goodItems.push(
|
||||
...[
|
||||
goodFactory(
|
||||
'مسکوکات خارجی',
|
||||
coinCategory.id,
|
||||
GoodPricingModel.STANDARD,
|
||||
UnitType.COUNT,
|
||||
),
|
||||
goodFactory(
|
||||
'مسکوکات داخلی (پارسیان)',
|
||||
coinCategory.id,
|
||||
GoodPricingModel.STANDARD,
|
||||
UnitType.COUNT,
|
||||
),
|
||||
goodFactory(
|
||||
'تمام بهار آزادی (طرح جدید)',
|
||||
coinCategory.id,
|
||||
GoodPricingModel.STANDARD,
|
||||
UnitType.COUNT,
|
||||
),
|
||||
goodFactory(
|
||||
'تمام بهار آزادی (طرح قدیم)',
|
||||
coinCategory.id,
|
||||
GoodPricingModel.STANDARD,
|
||||
UnitType.COUNT,
|
||||
),
|
||||
],
|
||||
)
|
||||
await prisma.good.createMany({ data: goodItems })
|
||||
}
|
||||
}
|
||||
|
||||
const shemshCategory = await prisma.goodCategory.findFirst({
|
||||
where: {
|
||||
name: 'شمش',
|
||||
},
|
||||
})
|
||||
|
||||
if (shemshCategory) {
|
||||
const shemshGoods = await prisma.good.count({
|
||||
where: {
|
||||
category_id: shemshCategory?.id,
|
||||
},
|
||||
})
|
||||
if (!shemshGoods) {
|
||||
await prisma.good.create({
|
||||
data: goodFactory(
|
||||
'شمش استاندارد',
|
||||
shemshCategory.id,
|
||||
GoodPricingModel.GOLD,
|
||||
UnitType.GRAM,
|
||||
),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// ****************** BA Start ****************** //
|
||||
const ba = await prisma.businessActivity.count()
|
||||
|
||||
if (!ba) {
|
||||
await prisma.businessActivity.create({
|
||||
data: {
|
||||
name: 'طلا فروشی',
|
||||
user: {
|
||||
create: {
|
||||
first_name: 'محمد',
|
||||
last_name: 'زرگر',
|
||||
mobile_number: '09120258155',
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
account: {
|
||||
create: {
|
||||
username: 'zargar',
|
||||
password: await PasswordUtil.hash('123456'),
|
||||
status: 'ACTIVE',
|
||||
type: 'CONSUMER',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
guild: {
|
||||
connect: {
|
||||
id: guilds[0].id,
|
||||
},
|
||||
},
|
||||
complexes: {
|
||||
create: {
|
||||
name: 'فروشگاه طلای مرکزی',
|
||||
address: 'تهران، خیابان جمهوری',
|
||||
tax_id: '12312452345765',
|
||||
pos_list: {
|
||||
create: {
|
||||
name: 'لاین ۱',
|
||||
pos_type: POSType.WEB,
|
||||
serial: '12312312',
|
||||
status: 'ACTIVE',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
// ****************** BA Start ****************** //
|
||||
|
||||
// ****************** partner Start ****************** //
|
||||
const partner = await prisma.partner.count()
|
||||
if (!partner) {
|
||||
await prisma.partner.create({
|
||||
data: {
|
||||
name: 'تیس',
|
||||
code: 'TIS',
|
||||
license_quota: 5,
|
||||
status: 'ACTIVE',
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
account: {
|
||||
create: {
|
||||
username: 'tis',
|
||||
password: await PasswordUtil.hash('123456'),
|
||||
status: 'ACTIVE',
|
||||
type: 'PARTNER',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// ****************** provider Start ****************** //
|
||||
const provider = await prisma.provider.count()
|
||||
if (!provider) {
|
||||
await prisma.provider.create({
|
||||
data: {
|
||||
name: 'توسن',
|
||||
code: 'Tosan',
|
||||
status: 'ACTIVE',
|
||||
accounts: {
|
||||
create: {
|
||||
role: 'OWNER',
|
||||
account: {
|
||||
create: {
|
||||
username: 'tosan',
|
||||
password: await PasswordUtil.hash('123456'),
|
||||
status: 'ACTIVE',
|
||||
type: 'PROVIDER',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { IPosPayload } from '@/common/models/posPayload.model'
|
||||
import { AccessTokenPayload } from '@/common/models/tokenPayload.model'
|
||||
import { AccessTokenPayload, IConsumerPayload, IPosPayload } from '@/common/models'
|
||||
|
||||
declare global {
|
||||
interface Request {
|
||||
decodedToken: AccessTokenPayload
|
||||
posData: IPosPayload
|
||||
decodedToken?: AccessTokenPayload
|
||||
consumerData?: IConsumerPayload
|
||||
posData?: IPosPayload
|
||||
}
|
||||
namespace Express {
|
||||
interface Request {
|
||||
decodedToken: AccessTokenPayload
|
||||
posData: IPosPayload
|
||||
decodedToken?: AccessTokenPayload
|
||||
consumerData?: IConsumerPayload
|
||||
posData?: IPosPayload
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
BadRequestException,
|
||||
createParamDecorator,
|
||||
ExecutionContext,
|
||||
ForbiddenException,
|
||||
} from '@nestjs/common'
|
||||
import { Request } from 'express'
|
||||
import { IConsumerPayload } from '../models'
|
||||
|
||||
export const ConsumerInfoInfo = createParamDecorator(
|
||||
(data: keyof IConsumerPayload | undefined, ctx: ExecutionContext) => {
|
||||
try {
|
||||
const request = ctx.switchToHttp().getRequest<Request>()
|
||||
const info = request.consumerData
|
||||
|
||||
if (!info) {
|
||||
throw new ForbiddenException('شما به این بخش دسترسی ندارید')
|
||||
}
|
||||
|
||||
if (data) {
|
||||
return info[data]
|
||||
}
|
||||
|
||||
return info
|
||||
} catch (err) {
|
||||
if (err) {
|
||||
throw err
|
||||
}
|
||||
|
||||
throw new BadRequestException('مشکلی در ساختار درخواست شما وجود دارد.')
|
||||
}
|
||||
},
|
||||
)
|
||||
@@ -14,7 +14,7 @@ export const TokenAccount = createParamDecorator(
|
||||
const account = request.decodedToken
|
||||
|
||||
// ✅ if middleware didn't populate req.account, return undefined or throw
|
||||
if (!account.user?.id) {
|
||||
if (!account || !account.user?.id) {
|
||||
throw new UnauthorizedException('شما به این بخش دسترسی ندارید')
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
// src/common/guards/permissions.guard.ts
|
||||
import { ITokenPayload } from '@/modules/auth/auth.utils'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { ExecutionContext, ForbiddenException, Injectable } from '@nestjs/common'
|
||||
import { Request as ExpressRequest } from 'express'
|
||||
|
||||
@Injectable()
|
||||
export class ConsumerGuard {
|
||||
constructor(private prisma: PrismaService) {}
|
||||
|
||||
async canActivate(
|
||||
tokenPayload: ITokenPayload,
|
||||
context: ExecutionContext,
|
||||
): Promise<boolean> {
|
||||
if (!tokenPayload || tokenPayload.type !== 'CONSUMER')
|
||||
throw new ForbiddenException('شما دسترسی لازم را ندارید.')
|
||||
|
||||
const consumer = await this.prisma.consumer.findFirst({
|
||||
where: {
|
||||
accounts: {
|
||||
some: {
|
||||
id: tokenPayload.account_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
select: {
|
||||
license: {
|
||||
select: {
|
||||
expires_at: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if (!consumer) {
|
||||
throw new ForbiddenException('شما دسترسی لازم را ندارید.')
|
||||
}
|
||||
|
||||
const req = context.switchToHttp().getRequest<ExpressRequest>()
|
||||
|
||||
if (req.method !== 'GET') {
|
||||
if (!consumer.license?.expires_at) {
|
||||
throw new ForbiddenException('برای کاربر شما لایسنس ایجاد نشده است.')
|
||||
}
|
||||
if (
|
||||
new Date().toUTCString() > new Date(consumer.license?.expires_at).toUTCString()
|
||||
) {
|
||||
throw new ForbiddenException('لایسنس شما منقضی شده است.')
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,26 @@
|
||||
// src/common/guards/permissions.guard.ts
|
||||
import { ITokenPayload } from '@/modules/auth/auth.utils'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import {
|
||||
CanActivate,
|
||||
ExecutionContext,
|
||||
ForbiddenException,
|
||||
Injectable,
|
||||
} from '@nestjs/common'
|
||||
import { Reflector } from '@nestjs/core'
|
||||
import { JwtService } from '@nestjs/jwt'
|
||||
import { ExecutionContext, ForbiddenException, Injectable } from '@nestjs/common'
|
||||
import { Request as ExpressRequest } from 'express'
|
||||
import { IS_PUBLIC_KEY } from '../decorators/public.decorator'
|
||||
import { checkAndDecodeJwtToken } from '../utils/jwt-user.util'
|
||||
|
||||
@Injectable()
|
||||
export class PosGuard implements CanActivate {
|
||||
constructor(
|
||||
private jwt: JwtService,
|
||||
private reflector: Reflector,
|
||||
private prisma: PrismaService,
|
||||
) {}
|
||||
|
||||
async canActivate(context: ExecutionContext): Promise<boolean> {
|
||||
const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [
|
||||
context.getHandler(),
|
||||
context.getClass(),
|
||||
])
|
||||
if (isPublic) return true
|
||||
|
||||
// const requiredPermissions = this.reflector.get<string[]>(
|
||||
// 'permissions',
|
||||
// context.getHandler(),
|
||||
// )
|
||||
// if (!requiredPermissions || requiredPermissions.length === 0) return true
|
||||
export class PosGuard {
|
||||
constructor(private prisma: PrismaService) {}
|
||||
|
||||
async canActivate(
|
||||
tokenPayload: ITokenPayload,
|
||||
context: ExecutionContext,
|
||||
): Promise<boolean> {
|
||||
const req = context.switchToHttp().getRequest<ExpressRequest>()
|
||||
|
||||
const account = checkAndDecodeJwtToken(req, this.jwt)
|
||||
// const account = req.decodedToken
|
||||
|
||||
if (!req.url.startsWith('/api/v1/pos/')) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (!account || account.type !== 'CONSUMER')
|
||||
if (!tokenPayload || tokenPayload.type !== 'CONSUMER')
|
||||
throw new ForbiddenException('شما دسترسی لازم را ندارید.')
|
||||
|
||||
const cookie = req.cookies
|
||||
const { posId, accessToken } = cookie
|
||||
const { posId } = cookie
|
||||
|
||||
if (!posId || !accessToken) {
|
||||
if (!posId) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -60,7 +32,7 @@ export class PosGuard implements CanActivate {
|
||||
user: {
|
||||
accounts: {
|
||||
some: {
|
||||
id: account.account_id,
|
||||
id: tokenPayload.account_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -83,7 +55,7 @@ export class PosGuard implements CanActivate {
|
||||
|
||||
const foundedAccount = await this.prisma.consumerAccount.findUnique({
|
||||
where: {
|
||||
id: account.account_id,
|
||||
id: tokenPayload.account_id,
|
||||
},
|
||||
select: {
|
||||
role: true,
|
||||
@@ -96,7 +68,7 @@ export class PosGuard implements CanActivate {
|
||||
|
||||
const accountPermissions = await this.prisma.permissionConsumer.findUnique({
|
||||
where: {
|
||||
account_id: account.account_id,
|
||||
account_id: tokenPayload.account_id,
|
||||
},
|
||||
select: {
|
||||
posPermissions: true,
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ITokenPayload } from '@/modules/auth/auth.utils'
|
||||
import {
|
||||
CanActivate,
|
||||
ExecutionContext,
|
||||
ForbiddenException,
|
||||
Injectable,
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common'
|
||||
@@ -8,12 +10,16 @@ import { Reflector } from '@nestjs/core'
|
||||
import { JwtService } from '@nestjs/jwt'
|
||||
import { Request as ExpressRequest } from 'express'
|
||||
import { IS_PUBLIC_KEY } from '../decorators/public.decorator'
|
||||
import { ConsumerGuard } from './auth-consumer.guard'
|
||||
import { PosGuard } from './auth-pos.guard'
|
||||
|
||||
@Injectable()
|
||||
export class JwtAuthGuard implements CanActivate {
|
||||
constructor(
|
||||
private jwt: JwtService,
|
||||
private reflector: Reflector,
|
||||
private consumerGuard: ConsumerGuard,
|
||||
private posGuard: PosGuard,
|
||||
) {}
|
||||
|
||||
async canActivate(context: ExecutionContext): Promise<boolean> {
|
||||
@@ -42,15 +48,19 @@ export class JwtAuthGuard implements CanActivate {
|
||||
secret: process.env.JWT_SECRET,
|
||||
})
|
||||
|
||||
// if (payload.type !== 'POS')
|
||||
// throw new UnauthorizedException('Invalid or expired token')
|
||||
|
||||
// Set the typed dataPayload to the request
|
||||
// req.dataPayload = payload
|
||||
const tokenPayload = this.jwt.decode(token) as ITokenPayload
|
||||
|
||||
if (req.url.startsWith('/api/v1/consumer')) {
|
||||
await this.consumerGuard.canActivate(tokenPayload, context)
|
||||
} else if (req.url.startsWith('/api/v1/pos')) {
|
||||
await this.consumerGuard.canActivate(tokenPayload, context)
|
||||
await this.posGuard.canActivate(tokenPayload, context)
|
||||
} else if (tokenPayload.type != 'ADMIN') {
|
||||
throw new ForbiddenException('شما دسترسی لازم را ندارید')
|
||||
}
|
||||
return true
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
if (err) throw err
|
||||
throw new UnauthorizedException('Invalid or expired token')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface IConsumerPayload {
|
||||
user_id: string
|
||||
account_id: string
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './consumerPayload.model'
|
||||
export * from './posPayload.model'
|
||||
export * from './tokenPayload.model'
|
||||
File diff suppressed because one or more lines are too long
@@ -2627,6 +2627,7 @@ export const ConsumerScalarFieldEnum = {
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name',
|
||||
status: 'status',
|
||||
license_id: 'license_id',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
} as const
|
||||
@@ -2717,7 +2718,6 @@ export const LicenseScalarFieldEnum = {
|
||||
status: 'status',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
pos_id: 'pos_id',
|
||||
partner_id: 'partner_id'
|
||||
} as const
|
||||
|
||||
@@ -3063,7 +3063,8 @@ export const ConsumerOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
mobile_number: 'mobile_number',
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name'
|
||||
last_name: 'last_name',
|
||||
license_id: 'license_id'
|
||||
} as const
|
||||
|
||||
export type ConsumerOrderByRelevanceFieldEnum = (typeof ConsumerOrderByRelevanceFieldEnum)[keyof typeof ConsumerOrderByRelevanceFieldEnum]
|
||||
@@ -3132,7 +3133,6 @@ export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFiel
|
||||
|
||||
export const LicenseOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
pos_id: 'pos_id',
|
||||
partner_id: 'partner_id'
|
||||
} as const
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ export const ConsumerScalarFieldEnum = {
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name',
|
||||
status: 'status',
|
||||
license_id: 'license_id',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at'
|
||||
} as const
|
||||
@@ -232,7 +233,6 @@ export const LicenseScalarFieldEnum = {
|
||||
status: 'status',
|
||||
created_at: 'created_at',
|
||||
updated_at: 'updated_at',
|
||||
pos_id: 'pos_id',
|
||||
partner_id: 'partner_id'
|
||||
} as const
|
||||
|
||||
@@ -578,7 +578,8 @@ export const ConsumerOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
mobile_number: 'mobile_number',
|
||||
first_name: 'first_name',
|
||||
last_name: 'last_name'
|
||||
last_name: 'last_name',
|
||||
license_id: 'license_id'
|
||||
} as const
|
||||
|
||||
export type ConsumerOrderByRelevanceFieldEnum = (typeof ConsumerOrderByRelevanceFieldEnum)[keyof typeof ConsumerOrderByRelevanceFieldEnum]
|
||||
@@ -647,7 +648,6 @@ export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFiel
|
||||
|
||||
export const LicenseOrderByRelevanceFieldEnum = {
|
||||
id: 'id',
|
||||
pos_id: 'pos_id',
|
||||
partner_id: 'partner_id'
|
||||
} as const
|
||||
|
||||
|
||||
@@ -204,17 +204,17 @@ export type AccountOrderByWithRelationInput = {
|
||||
export type AccountWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: string
|
||||
username?: string
|
||||
password?: string
|
||||
AND?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[]
|
||||
OR?: Prisma.AccountWhereInput[]
|
||||
NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[]
|
||||
password?: Prisma.StringFilter<"Account"> | string
|
||||
status?: Prisma.EnumAccountStatusFilter<"Account"> | $Enums.AccountStatus
|
||||
type?: Prisma.EnumAccountTypeFilter<"Account"> | $Enums.AccountType
|
||||
admin_account?: Prisma.XOR<Prisma.AdminAccountNullableScalarRelationFilter, Prisma.AdminAccountWhereInput> | null
|
||||
provider_account?: Prisma.XOR<Prisma.ProviderAccountNullableScalarRelationFilter, Prisma.ProviderAccountWhereInput> | null
|
||||
partner_account?: Prisma.XOR<Prisma.PartnerAccountNullableScalarRelationFilter, Prisma.PartnerAccountWhereInput> | null
|
||||
consumer_account?: Prisma.XOR<Prisma.ConsumerAccountNullableScalarRelationFilter, Prisma.ConsumerAccountWhereInput> | null
|
||||
}, "id" | "username" | "password">
|
||||
}, "id" | "username">
|
||||
|
||||
export type AccountOrderByWithAggregationInput = {
|
||||
id?: Prisma.SortOrder
|
||||
|
||||
@@ -30,6 +30,7 @@ export type ConsumerMinAggregateOutputType = {
|
||||
first_name: string | null
|
||||
last_name: string | null
|
||||
status: $Enums.ConsumerStatus | null
|
||||
license_id: string | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
}
|
||||
@@ -40,6 +41,7 @@ export type ConsumerMaxAggregateOutputType = {
|
||||
first_name: string | null
|
||||
last_name: string | null
|
||||
status: $Enums.ConsumerStatus | null
|
||||
license_id: string | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
}
|
||||
@@ -50,6 +52,7 @@ export type ConsumerCountAggregateOutputType = {
|
||||
first_name: number
|
||||
last_name: number
|
||||
status: number
|
||||
license_id: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
_all: number
|
||||
@@ -62,6 +65,7 @@ export type ConsumerMinAggregateInputType = {
|
||||
first_name?: true
|
||||
last_name?: true
|
||||
status?: true
|
||||
license_id?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
}
|
||||
@@ -72,6 +76,7 @@ export type ConsumerMaxAggregateInputType = {
|
||||
first_name?: true
|
||||
last_name?: true
|
||||
status?: true
|
||||
license_id?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
}
|
||||
@@ -82,6 +87,7 @@ export type ConsumerCountAggregateInputType = {
|
||||
first_name?: true
|
||||
last_name?: true
|
||||
status?: true
|
||||
license_id?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
_all?: true
|
||||
@@ -165,6 +171,7 @@ export type ConsumerGroupByOutputType = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
status: $Enums.ConsumerStatus
|
||||
license_id: string | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
_count: ConsumerCountAggregateOutputType | null
|
||||
@@ -196,8 +203,10 @@ export type ConsumerWhereInput = {
|
||||
first_name?: Prisma.StringFilter<"Consumer"> | string
|
||||
last_name?: Prisma.StringFilter<"Consumer"> | string
|
||||
status?: Prisma.EnumConsumerStatusFilter<"Consumer"> | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.StringNullableFilter<"Consumer"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
license?: Prisma.XOR<Prisma.LicenseNullableScalarRelationFilter, Prisma.LicenseWhereInput> | null
|
||||
accounts?: Prisma.ConsumerAccountListRelationFilter
|
||||
businessActivities?: Prisma.BusinessActivityListRelationFilter
|
||||
}
|
||||
@@ -208,8 +217,10 @@ export type ConsumerOrderByWithRelationInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
license_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
license?: Prisma.LicenseOrderByWithRelationInput
|
||||
accounts?: Prisma.ConsumerAccountOrderByRelationAggregateInput
|
||||
businessActivities?: Prisma.BusinessActivityOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.ConsumerOrderByRelevanceInput
|
||||
@@ -224,8 +235,10 @@ export type ConsumerWhereUniqueInput = Prisma.AtLeast<{
|
||||
first_name?: Prisma.StringFilter<"Consumer"> | string
|
||||
last_name?: Prisma.StringFilter<"Consumer"> | string
|
||||
status?: Prisma.EnumConsumerStatusFilter<"Consumer"> | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.StringNullableFilter<"Consumer"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
license?: Prisma.XOR<Prisma.LicenseNullableScalarRelationFilter, Prisma.LicenseWhereInput> | null
|
||||
accounts?: Prisma.ConsumerAccountListRelationFilter
|
||||
businessActivities?: Prisma.BusinessActivityListRelationFilter
|
||||
}, "id" | "mobile_number">
|
||||
@@ -236,6 +249,7 @@ export type ConsumerOrderByWithAggregationInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
license_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
_count?: Prisma.ConsumerCountOrderByAggregateInput
|
||||
@@ -252,6 +266,7 @@ export type ConsumerScalarWhereWithAggregatesInput = {
|
||||
first_name?: Prisma.StringWithAggregatesFilter<"Consumer"> | string
|
||||
last_name?: Prisma.StringWithAggregatesFilter<"Consumer"> | string
|
||||
status?: Prisma.EnumConsumerStatusWithAggregatesFilter<"Consumer"> | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.StringNullableWithAggregatesFilter<"Consumer"> | string | null
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"Consumer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeWithAggregatesFilter<"Consumer"> | Date | string
|
||||
}
|
||||
@@ -264,6 +279,7 @@ export type ConsumerCreateInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutConsumersInput
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutUserInput
|
||||
businessActivities?: Prisma.BusinessActivityCreateNestedManyWithoutUserInput
|
||||
}
|
||||
@@ -274,6 +290,7 @@ export type ConsumerUncheckedCreateInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
license_id?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutUserInput
|
||||
@@ -288,6 +305,7 @@ export type ConsumerUpdateInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
license?: Prisma.LicenseUpdateOneWithoutConsumersNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutUserNestedInput
|
||||
businessActivities?: Prisma.BusinessActivityUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
@@ -298,6 +316,7 @@ export type ConsumerUncheckedUpdateInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutUserNestedInput
|
||||
@@ -310,6 +329,7 @@ export type ConsumerCreateManyInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
license_id?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
}
|
||||
@@ -330,6 +350,7 @@ export type ConsumerUncheckedUpdateManyInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
@@ -346,6 +367,7 @@ export type ConsumerCountOrderByAggregateInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
license_id?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
}
|
||||
@@ -356,6 +378,7 @@ export type ConsumerMaxOrderByAggregateInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
license_id?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
}
|
||||
@@ -366,6 +389,7 @@ export type ConsumerMinOrderByAggregateInput = {
|
||||
first_name?: Prisma.SortOrder
|
||||
last_name?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
license_id?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
}
|
||||
@@ -375,6 +399,16 @@ export type ConsumerScalarRelationFilter = {
|
||||
isNot?: Prisma.ConsumerWhereInput
|
||||
}
|
||||
|
||||
export type ConsumerListRelationFilter = {
|
||||
every?: Prisma.ConsumerWhereInput
|
||||
some?: Prisma.ConsumerWhereInput
|
||||
none?: Prisma.ConsumerWhereInput
|
||||
}
|
||||
|
||||
export type ConsumerOrderByRelationAggregateInput = {
|
||||
_count?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type EnumConsumerStatusFieldUpdateOperationsInput = {
|
||||
set?: $Enums.ConsumerStatus
|
||||
}
|
||||
@@ -407,6 +441,48 @@ export type ConsumerUpdateOneRequiredWithoutBusinessActivitiesNestedInput = {
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ConsumerUpdateToOneWithWhereWithoutBusinessActivitiesInput, Prisma.ConsumerUpdateWithoutBusinessActivitiesInput>, Prisma.ConsumerUncheckedUpdateWithoutBusinessActivitiesInput>
|
||||
}
|
||||
|
||||
export type ConsumerCreateNestedManyWithoutLicenseInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerCreateWithoutLicenseInput, Prisma.ConsumerUncheckedCreateWithoutLicenseInput> | Prisma.ConsumerCreateWithoutLicenseInput[] | Prisma.ConsumerUncheckedCreateWithoutLicenseInput[]
|
||||
connectOrCreate?: Prisma.ConsumerCreateOrConnectWithoutLicenseInput | Prisma.ConsumerCreateOrConnectWithoutLicenseInput[]
|
||||
createMany?: Prisma.ConsumerCreateManyLicenseInputEnvelope
|
||||
connect?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ConsumerUncheckedCreateNestedManyWithoutLicenseInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerCreateWithoutLicenseInput, Prisma.ConsumerUncheckedCreateWithoutLicenseInput> | Prisma.ConsumerCreateWithoutLicenseInput[] | Prisma.ConsumerUncheckedCreateWithoutLicenseInput[]
|
||||
connectOrCreate?: Prisma.ConsumerCreateOrConnectWithoutLicenseInput | Prisma.ConsumerCreateOrConnectWithoutLicenseInput[]
|
||||
createMany?: Prisma.ConsumerCreateManyLicenseInputEnvelope
|
||||
connect?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
}
|
||||
|
||||
export type ConsumerUpdateManyWithoutLicenseNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerCreateWithoutLicenseInput, Prisma.ConsumerUncheckedCreateWithoutLicenseInput> | Prisma.ConsumerCreateWithoutLicenseInput[] | Prisma.ConsumerUncheckedCreateWithoutLicenseInput[]
|
||||
connectOrCreate?: Prisma.ConsumerCreateOrConnectWithoutLicenseInput | Prisma.ConsumerCreateOrConnectWithoutLicenseInput[]
|
||||
upsert?: Prisma.ConsumerUpsertWithWhereUniqueWithoutLicenseInput | Prisma.ConsumerUpsertWithWhereUniqueWithoutLicenseInput[]
|
||||
createMany?: Prisma.ConsumerCreateManyLicenseInputEnvelope
|
||||
set?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
disconnect?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
delete?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
connect?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
update?: Prisma.ConsumerUpdateWithWhereUniqueWithoutLicenseInput | Prisma.ConsumerUpdateWithWhereUniqueWithoutLicenseInput[]
|
||||
updateMany?: Prisma.ConsumerUpdateManyWithWhereWithoutLicenseInput | Prisma.ConsumerUpdateManyWithWhereWithoutLicenseInput[]
|
||||
deleteMany?: Prisma.ConsumerScalarWhereInput | Prisma.ConsumerScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ConsumerUncheckedUpdateManyWithoutLicenseNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.ConsumerCreateWithoutLicenseInput, Prisma.ConsumerUncheckedCreateWithoutLicenseInput> | Prisma.ConsumerCreateWithoutLicenseInput[] | Prisma.ConsumerUncheckedCreateWithoutLicenseInput[]
|
||||
connectOrCreate?: Prisma.ConsumerCreateOrConnectWithoutLicenseInput | Prisma.ConsumerCreateOrConnectWithoutLicenseInput[]
|
||||
upsert?: Prisma.ConsumerUpsertWithWhereUniqueWithoutLicenseInput | Prisma.ConsumerUpsertWithWhereUniqueWithoutLicenseInput[]
|
||||
createMany?: Prisma.ConsumerCreateManyLicenseInputEnvelope
|
||||
set?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
disconnect?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
delete?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
connect?: Prisma.ConsumerWhereUniqueInput | Prisma.ConsumerWhereUniqueInput[]
|
||||
update?: Prisma.ConsumerUpdateWithWhereUniqueWithoutLicenseInput | Prisma.ConsumerUpdateWithWhereUniqueWithoutLicenseInput[]
|
||||
updateMany?: Prisma.ConsumerUpdateManyWithWhereWithoutLicenseInput | Prisma.ConsumerUpdateManyWithWhereWithoutLicenseInput[]
|
||||
deleteMany?: Prisma.ConsumerScalarWhereInput | Prisma.ConsumerScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type ConsumerCreateWithoutAccountsInput = {
|
||||
id?: string
|
||||
mobile_number: string
|
||||
@@ -415,6 +491,7 @@ export type ConsumerCreateWithoutAccountsInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutConsumersInput
|
||||
businessActivities?: Prisma.BusinessActivityCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
@@ -424,6 +501,7 @@ export type ConsumerUncheckedCreateWithoutAccountsInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
license_id?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
businessActivities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutUserInput
|
||||
@@ -453,6 +531,7 @@ export type ConsumerUpdateWithoutAccountsInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
license?: Prisma.LicenseUpdateOneWithoutConsumersNestedInput
|
||||
businessActivities?: Prisma.BusinessActivityUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
@@ -462,6 +541,7 @@ export type ConsumerUncheckedUpdateWithoutAccountsInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
businessActivities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutUserNestedInput
|
||||
@@ -475,6 +555,7 @@ export type ConsumerCreateWithoutBusinessActivitiesInput = {
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
license?: Prisma.LicenseCreateNestedOneWithoutConsumersInput
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
@@ -484,6 +565,7 @@ export type ConsumerUncheckedCreateWithoutBusinessActivitiesInput = {
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
license_id?: string | null
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutUserInput
|
||||
@@ -513,6 +595,7 @@ export type ConsumerUpdateWithoutBusinessActivitiesInput = {
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
license?: Prisma.LicenseUpdateOneWithoutConsumersNestedInput
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
@@ -522,11 +605,120 @@ export type ConsumerUncheckedUpdateWithoutBusinessActivitiesInput = {
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerCreateWithoutLicenseInput = {
|
||||
id?: string
|
||||
mobile_number: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountCreateNestedManyWithoutUserInput
|
||||
businessActivities?: Prisma.BusinessActivityCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type ConsumerUncheckedCreateWithoutLicenseInput = {
|
||||
id?: string
|
||||
mobile_number: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedCreateNestedManyWithoutUserInput
|
||||
businessActivities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutUserInput
|
||||
}
|
||||
|
||||
export type ConsumerCreateOrConnectWithoutLicenseInput = {
|
||||
where: Prisma.ConsumerWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.ConsumerCreateWithoutLicenseInput, Prisma.ConsumerUncheckedCreateWithoutLicenseInput>
|
||||
}
|
||||
|
||||
export type ConsumerCreateManyLicenseInputEnvelope = {
|
||||
data: Prisma.ConsumerCreateManyLicenseInput | Prisma.ConsumerCreateManyLicenseInput[]
|
||||
skipDuplicates?: boolean
|
||||
}
|
||||
|
||||
export type ConsumerUpsertWithWhereUniqueWithoutLicenseInput = {
|
||||
where: Prisma.ConsumerWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.ConsumerUpdateWithoutLicenseInput, Prisma.ConsumerUncheckedUpdateWithoutLicenseInput>
|
||||
create: Prisma.XOR<Prisma.ConsumerCreateWithoutLicenseInput, Prisma.ConsumerUncheckedCreateWithoutLicenseInput>
|
||||
}
|
||||
|
||||
export type ConsumerUpdateWithWhereUniqueWithoutLicenseInput = {
|
||||
where: Prisma.ConsumerWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.ConsumerUpdateWithoutLicenseInput, Prisma.ConsumerUncheckedUpdateWithoutLicenseInput>
|
||||
}
|
||||
|
||||
export type ConsumerUpdateManyWithWhereWithoutLicenseInput = {
|
||||
where: Prisma.ConsumerScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.ConsumerUpdateManyMutationInput, Prisma.ConsumerUncheckedUpdateManyWithoutLicenseInput>
|
||||
}
|
||||
|
||||
export type ConsumerScalarWhereInput = {
|
||||
AND?: Prisma.ConsumerScalarWhereInput | Prisma.ConsumerScalarWhereInput[]
|
||||
OR?: Prisma.ConsumerScalarWhereInput[]
|
||||
NOT?: Prisma.ConsumerScalarWhereInput | Prisma.ConsumerScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"Consumer"> | string
|
||||
mobile_number?: Prisma.StringFilter<"Consumer"> | string
|
||||
first_name?: Prisma.StringFilter<"Consumer"> | string
|
||||
last_name?: Prisma.StringFilter<"Consumer"> | string
|
||||
status?: Prisma.EnumConsumerStatusFilter<"Consumer"> | $Enums.ConsumerStatus
|
||||
license_id?: Prisma.StringNullableFilter<"Consumer"> | string | null
|
||||
created_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"Consumer"> | Date | string
|
||||
}
|
||||
|
||||
export type ConsumerCreateManyLicenseInput = {
|
||||
id?: string
|
||||
mobile_number: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
status?: $Enums.ConsumerStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
}
|
||||
|
||||
export type ConsumerUpdateWithoutLicenseInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUpdateManyWithoutUserNestedInput
|
||||
businessActivities?: Prisma.BusinessActivityUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerUncheckedUpdateWithoutLicenseInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
accounts?: Prisma.ConsumerAccountUncheckedUpdateManyWithoutUserNestedInput
|
||||
businessActivities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutUserNestedInput
|
||||
}
|
||||
|
||||
export type ConsumerUncheckedUpdateManyWithoutLicenseInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
mobile_number?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
first_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
last_name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
status?: Prisma.EnumConsumerStatusFieldUpdateOperationsInput | $Enums.ConsumerStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Count Type ConsumerCountOutputType
|
||||
@@ -573,8 +765,10 @@ export type ConsumerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
first_name?: boolean
|
||||
last_name?: boolean
|
||||
status?: boolean
|
||||
license_id?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
license?: boolean | Prisma.Consumer$licenseArgs<ExtArgs>
|
||||
accounts?: boolean | Prisma.Consumer$accountsArgs<ExtArgs>
|
||||
businessActivities?: boolean | Prisma.Consumer$businessActivitiesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ConsumerCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -588,12 +782,14 @@ export type ConsumerSelectScalar = {
|
||||
first_name?: boolean
|
||||
last_name?: boolean
|
||||
status?: boolean
|
||||
license_id?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
}
|
||||
|
||||
export type ConsumerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "mobile_number" | "first_name" | "last_name" | "status" | "created_at" | "updated_at", ExtArgs["result"]["consumer"]>
|
||||
export type ConsumerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "mobile_number" | "first_name" | "last_name" | "status" | "license_id" | "created_at" | "updated_at", ExtArgs["result"]["consumer"]>
|
||||
export type ConsumerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
license?: boolean | Prisma.Consumer$licenseArgs<ExtArgs>
|
||||
accounts?: boolean | Prisma.Consumer$accountsArgs<ExtArgs>
|
||||
businessActivities?: boolean | Prisma.Consumer$businessActivitiesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.ConsumerCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -602,6 +798,7 @@ export type ConsumerInclude<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
export type $ConsumerPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "Consumer"
|
||||
objects: {
|
||||
license: Prisma.$LicensePayload<ExtArgs> | null
|
||||
accounts: Prisma.$ConsumerAccountPayload<ExtArgs>[]
|
||||
businessActivities: Prisma.$BusinessActivityPayload<ExtArgs>[]
|
||||
}
|
||||
@@ -611,6 +808,7 @@ export type $ConsumerPayload<ExtArgs extends runtime.Types.Extensions.InternalAr
|
||||
first_name: string
|
||||
last_name: string
|
||||
status: $Enums.ConsumerStatus
|
||||
license_id: string | null
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
}, ExtArgs["result"]["consumer"]>
|
||||
@@ -953,6 +1151,7 @@ readonly fields: ConsumerFieldRefs;
|
||||
*/
|
||||
export interface Prisma__ConsumerClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
license<T extends Prisma.Consumer$licenseArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$licenseArgs<ExtArgs>>): Prisma.Prisma__LicenseClient<runtime.Types.Result.GetResult<Prisma.$LicensePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
accounts<T extends Prisma.Consumer$accountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$accountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConsumerAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
businessActivities<T extends Prisma.Consumer$businessActivitiesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Consumer$businessActivitiesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$BusinessActivityPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
@@ -989,6 +1188,7 @@ export interface ConsumerFieldRefs {
|
||||
readonly first_name: Prisma.FieldRef<"Consumer", 'String'>
|
||||
readonly last_name: Prisma.FieldRef<"Consumer", 'String'>
|
||||
readonly status: Prisma.FieldRef<"Consumer", 'ConsumerStatus'>
|
||||
readonly license_id: Prisma.FieldRef<"Consumer", 'String'>
|
||||
readonly created_at: Prisma.FieldRef<"Consumer", 'DateTime'>
|
||||
readonly updated_at: Prisma.FieldRef<"Consumer", 'DateTime'>
|
||||
}
|
||||
@@ -1333,6 +1533,25 @@ export type ConsumerDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer.license
|
||||
*/
|
||||
export type Consumer$licenseArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the License
|
||||
*/
|
||||
select?: Prisma.LicenseSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the License
|
||||
*/
|
||||
omit?: Prisma.LicenseOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.LicenseInclude<ExtArgs> | null
|
||||
where?: Prisma.LicenseWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer.accounts
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,6 @@ export type LicenseMinAggregateOutputType = {
|
||||
status: $Enums.LicenseStatus | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
pos_id: string | null
|
||||
partner_id: string | null
|
||||
}
|
||||
|
||||
@@ -42,7 +41,6 @@ export type LicenseMaxAggregateOutputType = {
|
||||
status: $Enums.LicenseStatus | null
|
||||
created_at: Date | null
|
||||
updated_at: Date | null
|
||||
pos_id: string | null
|
||||
partner_id: string | null
|
||||
}
|
||||
|
||||
@@ -53,7 +51,6 @@ export type LicenseCountAggregateOutputType = {
|
||||
status: number
|
||||
created_at: number
|
||||
updated_at: number
|
||||
pos_id: number
|
||||
partner_id: number
|
||||
_all: number
|
||||
}
|
||||
@@ -66,7 +63,6 @@ export type LicenseMinAggregateInputType = {
|
||||
status?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
pos_id?: true
|
||||
partner_id?: true
|
||||
}
|
||||
|
||||
@@ -77,7 +73,6 @@ export type LicenseMaxAggregateInputType = {
|
||||
status?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
pos_id?: true
|
||||
partner_id?: true
|
||||
}
|
||||
|
||||
@@ -88,7 +83,6 @@ export type LicenseCountAggregateInputType = {
|
||||
status?: true
|
||||
created_at?: true
|
||||
updated_at?: true
|
||||
pos_id?: true
|
||||
partner_id?: true
|
||||
_all?: true
|
||||
}
|
||||
@@ -172,8 +166,7 @@ export type LicenseGroupByOutputType = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
pos_id: string
|
||||
partner_id: string
|
||||
partner_id: string | null
|
||||
_count: LicenseCountAggregateOutputType | null
|
||||
_min: LicenseMinAggregateOutputType | null
|
||||
_max: LicenseMaxAggregateOutputType | null
|
||||
@@ -204,10 +197,9 @@ export type LicenseWhereInput = {
|
||||
status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
pos_id?: Prisma.StringFilter<"License"> | string
|
||||
partner_id?: Prisma.StringFilter<"License"> | string
|
||||
pos?: Prisma.XOR<Prisma.PosScalarRelationFilter, Prisma.PosWhereInput>
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
partner_id?: Prisma.StringNullableFilter<"License"> | string | null
|
||||
partner?: Prisma.XOR<Prisma.PartnerNullableScalarRelationFilter, Prisma.PartnerWhereInput> | null
|
||||
consumers?: Prisma.ConsumerListRelationFilter
|
||||
}
|
||||
|
||||
export type LicenseOrderByWithRelationInput = {
|
||||
@@ -217,10 +209,9 @@ export type LicenseOrderByWithRelationInput = {
|
||||
status?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
pos_id?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
pos?: Prisma.PosOrderByWithRelationInput
|
||||
partner_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
partner?: Prisma.PartnerOrderByWithRelationInput
|
||||
consumers?: Prisma.ConsumerOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.LicenseOrderByRelevanceInput
|
||||
}
|
||||
|
||||
@@ -234,10 +225,9 @@ export type LicenseWhereUniqueInput = Prisma.AtLeast<{
|
||||
status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
pos_id?: Prisma.StringFilter<"License"> | string
|
||||
partner_id?: Prisma.StringFilter<"License"> | string
|
||||
pos?: Prisma.XOR<Prisma.PosScalarRelationFilter, Prisma.PosWhereInput>
|
||||
partner?: Prisma.XOR<Prisma.PartnerScalarRelationFilter, Prisma.PartnerWhereInput>
|
||||
partner_id?: Prisma.StringNullableFilter<"License"> | string | null
|
||||
partner?: Prisma.XOR<Prisma.PartnerNullableScalarRelationFilter, Prisma.PartnerWhereInput> | null
|
||||
consumers?: Prisma.ConsumerListRelationFilter
|
||||
}, "id">
|
||||
|
||||
export type LicenseOrderByWithAggregationInput = {
|
||||
@@ -247,8 +237,7 @@ export type LicenseOrderByWithAggregationInput = {
|
||||
status?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
pos_id?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
_count?: Prisma.LicenseCountOrderByAggregateInput
|
||||
_max?: Prisma.LicenseMaxOrderByAggregateInput
|
||||
_min?: Prisma.LicenseMinOrderByAggregateInput
|
||||
@@ -264,8 +253,7 @@ export type LicenseScalarWhereWithAggregatesInput = {
|
||||
status?: Prisma.EnumLicenseStatusWithAggregatesFilter<"License"> | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeWithAggregatesFilter<"License"> | Date | string
|
||||
updated_at?: Prisma.DateTimeWithAggregatesFilter<"License"> | Date | string
|
||||
pos_id?: Prisma.StringWithAggregatesFilter<"License"> | string
|
||||
partner_id?: Prisma.StringWithAggregatesFilter<"License"> | string
|
||||
partner_id?: Prisma.StringNullableWithAggregatesFilter<"License"> | string | null
|
||||
}
|
||||
|
||||
export type LicenseCreateInput = {
|
||||
@@ -275,8 +263,8 @@ export type LicenseCreateInput = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos: Prisma.PosCreateNestedOneWithoutLicensesInput
|
||||
partner: Prisma.PartnerCreateNestedOneWithoutLicensesInput
|
||||
partner?: Prisma.PartnerCreateNestedOneWithoutLicensesInput
|
||||
consumers?: Prisma.ConsumerCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateInput = {
|
||||
@@ -286,8 +274,8 @@ export type LicenseUncheckedCreateInput = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos_id: string
|
||||
partner_id: string
|
||||
partner_id?: string | null
|
||||
consumers?: Prisma.ConsumerUncheckedCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUpdateInput = {
|
||||
@@ -297,8 +285,8 @@ export type LicenseUpdateInput = {
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutLicensesNestedInput
|
||||
partner?: Prisma.PartnerUpdateOneRequiredWithoutLicensesNestedInput
|
||||
partner?: Prisma.PartnerUpdateOneWithoutLicensesNestedInput
|
||||
consumers?: Prisma.ConsumerUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateInput = {
|
||||
@@ -308,8 +296,8 @@ export type LicenseUncheckedUpdateInput = {
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
consumers?: Prisma.ConsumerUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseCreateManyInput = {
|
||||
@@ -319,8 +307,7 @@ export type LicenseCreateManyInput = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos_id: string
|
||||
partner_id: string
|
||||
partner_id?: string | null
|
||||
}
|
||||
|
||||
export type LicenseUpdateManyMutationInput = {
|
||||
@@ -339,18 +326,12 @@ export type LicenseUncheckedUpdateManyInput = {
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
export type LicenseListRelationFilter = {
|
||||
every?: Prisma.LicenseWhereInput
|
||||
some?: Prisma.LicenseWhereInput
|
||||
none?: Prisma.LicenseWhereInput
|
||||
}
|
||||
|
||||
export type LicenseOrderByRelationAggregateInput = {
|
||||
_count?: Prisma.SortOrder
|
||||
export type LicenseNullableScalarRelationFilter = {
|
||||
is?: Prisma.LicenseWhereInput | null
|
||||
isNot?: Prisma.LicenseWhereInput | null
|
||||
}
|
||||
|
||||
export type LicenseOrderByRelevanceInput = {
|
||||
@@ -366,7 +347,6 @@ export type LicenseCountOrderByAggregateInput = {
|
||||
status?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
pos_id?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
@@ -377,7 +357,6 @@ export type LicenseMaxOrderByAggregateInput = {
|
||||
status?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
pos_id?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
@@ -388,50 +367,33 @@ export type LicenseMinOrderByAggregateInput = {
|
||||
status?: Prisma.SortOrder
|
||||
created_at?: Prisma.SortOrder
|
||||
updated_at?: Prisma.SortOrder
|
||||
pos_id?: Prisma.SortOrder
|
||||
partner_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type LicenseCreateNestedManyWithoutPosInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutPosInput, Prisma.LicenseUncheckedCreateWithoutPosInput> | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[]
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[]
|
||||
createMany?: Prisma.LicenseCreateManyPosInputEnvelope
|
||||
connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
export type LicenseListRelationFilter = {
|
||||
every?: Prisma.LicenseWhereInput
|
||||
some?: Prisma.LicenseWhereInput
|
||||
none?: Prisma.LicenseWhereInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateNestedManyWithoutPosInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutPosInput, Prisma.LicenseUncheckedCreateWithoutPosInput> | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[]
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[]
|
||||
createMany?: Prisma.LicenseCreateManyPosInputEnvelope
|
||||
connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
export type LicenseOrderByRelationAggregateInput = {
|
||||
_count?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type LicenseUpdateManyWithoutPosNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutPosInput, Prisma.LicenseUncheckedCreateWithoutPosInput> | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[]
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[]
|
||||
upsert?: Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput | Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput[]
|
||||
createMany?: Prisma.LicenseCreateManyPosInputEnvelope
|
||||
set?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
disconnect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
delete?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
update?: Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput | Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput[]
|
||||
updateMany?: Prisma.LicenseUpdateManyWithWhereWithoutPosInput | Prisma.LicenseUpdateManyWithWhereWithoutPosInput[]
|
||||
deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
export type LicenseCreateNestedOneWithoutConsumersInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutConsumersInput, Prisma.LicenseUncheckedCreateWithoutConsumersInput>
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutConsumersInput
|
||||
connect?: Prisma.LicenseWhereUniqueInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateManyWithoutPosNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutPosInput, Prisma.LicenseUncheckedCreateWithoutPosInput> | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[]
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[]
|
||||
upsert?: Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput | Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput[]
|
||||
createMany?: Prisma.LicenseCreateManyPosInputEnvelope
|
||||
set?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
disconnect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
delete?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[]
|
||||
update?: Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput | Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput[]
|
||||
updateMany?: Prisma.LicenseUpdateManyWithWhereWithoutPosInput | Prisma.LicenseUpdateManyWithWhereWithoutPosInput[]
|
||||
deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
export type LicenseUpdateOneWithoutConsumersNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.LicenseCreateWithoutConsumersInput, Prisma.LicenseUncheckedCreateWithoutConsumersInput>
|
||||
connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutConsumersInput
|
||||
upsert?: Prisma.LicenseUpsertWithoutConsumersInput
|
||||
disconnect?: Prisma.LicenseWhereInput | boolean
|
||||
delete?: Prisma.LicenseWhereInput | boolean
|
||||
connect?: Prisma.LicenseWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.LicenseUpdateToOneWithWhereWithoutConsumersInput, Prisma.LicenseUpdateWithoutConsumersInput>, Prisma.LicenseUncheckedUpdateWithoutConsumersInput>
|
||||
}
|
||||
|
||||
export type EnumLicenseStatusFieldUpdateOperationsInput = {
|
||||
@@ -480,64 +442,60 @@ export type LicenseUncheckedUpdateManyWithoutPartnerNestedInput = {
|
||||
deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type LicenseCreateWithoutPosInput = {
|
||||
export type LicenseCreateWithoutConsumersInput = {
|
||||
id?: string
|
||||
starts_at: Date | string
|
||||
expires_at: Date | string
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
partner: Prisma.PartnerCreateNestedOneWithoutLicensesInput
|
||||
partner?: Prisma.PartnerCreateNestedOneWithoutLicensesInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateWithoutPosInput = {
|
||||
export type LicenseUncheckedCreateWithoutConsumersInput = {
|
||||
id?: string
|
||||
starts_at: Date | string
|
||||
expires_at: Date | string
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
partner_id: string
|
||||
partner_id?: string | null
|
||||
}
|
||||
|
||||
export type LicenseCreateOrConnectWithoutPosInput = {
|
||||
export type LicenseCreateOrConnectWithoutConsumersInput = {
|
||||
where: Prisma.LicenseWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutPosInput, Prisma.LicenseUncheckedCreateWithoutPosInput>
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutConsumersInput, Prisma.LicenseUncheckedCreateWithoutConsumersInput>
|
||||
}
|
||||
|
||||
export type LicenseCreateManyPosInputEnvelope = {
|
||||
data: Prisma.LicenseCreateManyPosInput | Prisma.LicenseCreateManyPosInput[]
|
||||
skipDuplicates?: boolean
|
||||
export type LicenseUpsertWithoutConsumersInput = {
|
||||
update: Prisma.XOR<Prisma.LicenseUpdateWithoutConsumersInput, Prisma.LicenseUncheckedUpdateWithoutConsumersInput>
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutConsumersInput, Prisma.LicenseUncheckedCreateWithoutConsumersInput>
|
||||
where?: Prisma.LicenseWhereInput
|
||||
}
|
||||
|
||||
export type LicenseUpsertWithWhereUniqueWithoutPosInput = {
|
||||
where: Prisma.LicenseWhereUniqueInput
|
||||
update: Prisma.XOR<Prisma.LicenseUpdateWithoutPosInput, Prisma.LicenseUncheckedUpdateWithoutPosInput>
|
||||
create: Prisma.XOR<Prisma.LicenseCreateWithoutPosInput, Prisma.LicenseUncheckedCreateWithoutPosInput>
|
||||
export type LicenseUpdateToOneWithWhereWithoutConsumersInput = {
|
||||
where?: Prisma.LicenseWhereInput
|
||||
data: Prisma.XOR<Prisma.LicenseUpdateWithoutConsumersInput, Prisma.LicenseUncheckedUpdateWithoutConsumersInput>
|
||||
}
|
||||
|
||||
export type LicenseUpdateWithWhereUniqueWithoutPosInput = {
|
||||
where: Prisma.LicenseWhereUniqueInput
|
||||
data: Prisma.XOR<Prisma.LicenseUpdateWithoutPosInput, Prisma.LicenseUncheckedUpdateWithoutPosInput>
|
||||
export type LicenseUpdateWithoutConsumersInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner?: Prisma.PartnerUpdateOneWithoutLicensesNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUpdateManyWithWhereWithoutPosInput = {
|
||||
where: Prisma.LicenseScalarWhereInput
|
||||
data: Prisma.XOR<Prisma.LicenseUpdateManyMutationInput, Prisma.LicenseUncheckedUpdateManyWithoutPosInput>
|
||||
}
|
||||
|
||||
export type LicenseScalarWhereInput = {
|
||||
AND?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
OR?: Prisma.LicenseScalarWhereInput[]
|
||||
NOT?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"License"> | string
|
||||
starts_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
expires_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
pos_id?: Prisma.StringFilter<"License"> | string
|
||||
partner_id?: Prisma.StringFilter<"License"> | string
|
||||
export type LicenseUncheckedUpdateWithoutConsumersInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
}
|
||||
|
||||
export type LicenseCreateWithoutPartnerInput = {
|
||||
@@ -547,7 +505,7 @@ export type LicenseCreateWithoutPartnerInput = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos: Prisma.PosCreateNestedOneWithoutLicensesInput
|
||||
consumers?: Prisma.ConsumerCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedCreateWithoutPartnerInput = {
|
||||
@@ -557,7 +515,7 @@ export type LicenseUncheckedCreateWithoutPartnerInput = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos_id: string
|
||||
consumers?: Prisma.ConsumerUncheckedCreateNestedManyWithoutLicenseInput
|
||||
}
|
||||
|
||||
export type LicenseCreateOrConnectWithoutPartnerInput = {
|
||||
@@ -586,44 +544,17 @@ export type LicenseUpdateManyWithWhereWithoutPartnerInput = {
|
||||
data: Prisma.XOR<Prisma.LicenseUpdateManyMutationInput, Prisma.LicenseUncheckedUpdateManyWithoutPartnerInput>
|
||||
}
|
||||
|
||||
export type LicenseCreateManyPosInput = {
|
||||
id?: string
|
||||
starts_at: Date | string
|
||||
expires_at: Date | string
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
partner_id: string
|
||||
}
|
||||
|
||||
export type LicenseUpdateWithoutPosInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner?: Prisma.PartnerUpdateOneRequiredWithoutLicensesNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateWithoutPosInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateManyWithoutPosInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
partner_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
export type LicenseScalarWhereInput = {
|
||||
AND?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
OR?: Prisma.LicenseScalarWhereInput[]
|
||||
NOT?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[]
|
||||
id?: Prisma.StringFilter<"License"> | string
|
||||
starts_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
expires_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
updated_at?: Prisma.DateTimeFilter<"License"> | Date | string
|
||||
partner_id?: Prisma.StringNullableFilter<"License"> | string | null
|
||||
}
|
||||
|
||||
export type LicenseCreateManyPartnerInput = {
|
||||
@@ -633,7 +564,6 @@ export type LicenseCreateManyPartnerInput = {
|
||||
status: $Enums.LicenseStatus
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
pos_id: string
|
||||
}
|
||||
|
||||
export type LicenseUpdateWithoutPartnerInput = {
|
||||
@@ -643,7 +573,7 @@ export type LicenseUpdateWithoutPartnerInput = {
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos?: Prisma.PosUpdateOneRequiredWithoutLicensesNestedInput
|
||||
consumers?: Prisma.ConsumerUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateWithoutPartnerInput = {
|
||||
@@ -653,7 +583,7 @@ export type LicenseUncheckedUpdateWithoutPartnerInput = {
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
consumers?: Prisma.ConsumerUncheckedUpdateManyWithoutLicenseNestedInput
|
||||
}
|
||||
|
||||
export type LicenseUncheckedUpdateManyWithoutPartnerInput = {
|
||||
@@ -663,10 +593,38 @@ export type LicenseUncheckedUpdateManyWithoutPartnerInput = {
|
||||
status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
pos_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Count Type LicenseCountOutputType
|
||||
*/
|
||||
|
||||
export type LicenseCountOutputType = {
|
||||
consumers: number
|
||||
}
|
||||
|
||||
export type LicenseCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
consumers?: boolean | LicenseCountOutputTypeCountConsumersArgs
|
||||
}
|
||||
|
||||
/**
|
||||
* LicenseCountOutputType without action
|
||||
*/
|
||||
export type LicenseCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the LicenseCountOutputType
|
||||
*/
|
||||
select?: Prisma.LicenseCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* LicenseCountOutputType without action
|
||||
*/
|
||||
export type LicenseCountOutputTypeCountConsumersArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.ConsumerWhereInput
|
||||
}
|
||||
|
||||
|
||||
export type LicenseSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
id?: boolean
|
||||
@@ -675,10 +633,10 @@ export type LicenseSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
status?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
pos_id?: boolean
|
||||
partner_id?: boolean
|
||||
pos?: boolean | Prisma.PosDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.License$partnerArgs<ExtArgs>
|
||||
consumers?: boolean | Prisma.License$consumersArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.LicenseCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}, ExtArgs["result"]["license"]>
|
||||
|
||||
|
||||
@@ -690,21 +648,21 @@ export type LicenseSelectScalar = {
|
||||
status?: boolean
|
||||
created_at?: boolean
|
||||
updated_at?: boolean
|
||||
pos_id?: boolean
|
||||
partner_id?: boolean
|
||||
}
|
||||
|
||||
export type LicenseOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "starts_at" | "expires_at" | "status" | "created_at" | "updated_at" | "pos_id" | "partner_id", ExtArgs["result"]["license"]>
|
||||
export type LicenseOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "starts_at" | "expires_at" | "status" | "created_at" | "updated_at" | "partner_id", ExtArgs["result"]["license"]>
|
||||
export type LicenseInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
pos?: boolean | Prisma.PosDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.PartnerDefaultArgs<ExtArgs>
|
||||
partner?: boolean | Prisma.License$partnerArgs<ExtArgs>
|
||||
consumers?: boolean | Prisma.License$consumersArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.LicenseCountOutputTypeDefaultArgs<ExtArgs>
|
||||
}
|
||||
|
||||
export type $LicensePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
name: "License"
|
||||
objects: {
|
||||
pos: Prisma.$PosPayload<ExtArgs>
|
||||
partner: Prisma.$PartnerPayload<ExtArgs>
|
||||
partner: Prisma.$PartnerPayload<ExtArgs> | null
|
||||
consumers: Prisma.$ConsumerPayload<ExtArgs>[]
|
||||
}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: string
|
||||
@@ -713,8 +671,7 @@ export type $LicensePayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
||||
status: $Enums.LicenseStatus
|
||||
created_at: Date
|
||||
updated_at: Date
|
||||
pos_id: string
|
||||
partner_id: string
|
||||
partner_id: string | null
|
||||
}, ExtArgs["result"]["license"]>
|
||||
composites: {}
|
||||
}
|
||||
@@ -1055,8 +1012,8 @@ readonly fields: LicenseFieldRefs;
|
||||
*/
|
||||
export interface Prisma__LicenseClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||
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>
|
||||
partner<T extends Prisma.PartnerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PartnerDefaultArgs<ExtArgs>>): Prisma.Prisma__PartnerClient<runtime.Types.Result.GetResult<Prisma.$PartnerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
partner<T extends Prisma.License$partnerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.License$partnerArgs<ExtArgs>>): Prisma.Prisma__PartnerClient<runtime.Types.Result.GetResult<Prisma.$PartnerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
consumers<T extends Prisma.License$consumersArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.License$consumersArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ConsumerPayload<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.
|
||||
@@ -1092,7 +1049,6 @@ export interface LicenseFieldRefs {
|
||||
readonly status: Prisma.FieldRef<"License", 'LicenseStatus'>
|
||||
readonly created_at: Prisma.FieldRef<"License", 'DateTime'>
|
||||
readonly updated_at: Prisma.FieldRef<"License", 'DateTime'>
|
||||
readonly pos_id: Prisma.FieldRef<"License", 'String'>
|
||||
readonly partner_id: Prisma.FieldRef<"License", 'String'>
|
||||
}
|
||||
|
||||
@@ -1436,6 +1392,49 @@ export type LicenseDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Inter
|
||||
limit?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* License.partner
|
||||
*/
|
||||
export type License$partnerArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Partner
|
||||
*/
|
||||
select?: Prisma.PartnerSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Partner
|
||||
*/
|
||||
omit?: Prisma.PartnerOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.PartnerInclude<ExtArgs> | null
|
||||
where?: Prisma.PartnerWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* License.consumers
|
||||
*/
|
||||
export type License$consumersArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the Consumer
|
||||
*/
|
||||
select?: Prisma.ConsumerSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the Consumer
|
||||
*/
|
||||
omit?: Prisma.ConsumerOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.ConsumerInclude<ExtArgs> | null
|
||||
where?: Prisma.ConsumerWhereInput
|
||||
orderBy?: Prisma.ConsumerOrderByWithRelationInput | Prisma.ConsumerOrderByWithRelationInput[]
|
||||
cursor?: Prisma.ConsumerWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.ConsumerScalarFieldEnum | Prisma.ConsumerScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* License without action
|
||||
*/
|
||||
|
||||
@@ -370,9 +370,9 @@ export type PartnerUncheckedUpdateManyInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
}
|
||||
|
||||
export type PartnerScalarRelationFilter = {
|
||||
is?: Prisma.PartnerWhereInput
|
||||
isNot?: Prisma.PartnerWhereInput
|
||||
export type PartnerNullableScalarRelationFilter = {
|
||||
is?: Prisma.PartnerWhereInput | null
|
||||
isNot?: Prisma.PartnerWhereInput | null
|
||||
}
|
||||
|
||||
export type PartnerOrderByRelevanceInput = {
|
||||
@@ -419,16 +419,23 @@ export type PartnerSumOrderByAggregateInput = {
|
||||
license_quota?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type PartnerScalarRelationFilter = {
|
||||
is?: Prisma.PartnerWhereInput
|
||||
isNot?: Prisma.PartnerWhereInput
|
||||
}
|
||||
|
||||
export type PartnerCreateNestedOneWithoutLicensesInput = {
|
||||
create?: Prisma.XOR<Prisma.PartnerCreateWithoutLicensesInput, Prisma.PartnerUncheckedCreateWithoutLicensesInput>
|
||||
connectOrCreate?: Prisma.PartnerCreateOrConnectWithoutLicensesInput
|
||||
connect?: Prisma.PartnerWhereUniqueInput
|
||||
}
|
||||
|
||||
export type PartnerUpdateOneRequiredWithoutLicensesNestedInput = {
|
||||
export type PartnerUpdateOneWithoutLicensesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.PartnerCreateWithoutLicensesInput, Prisma.PartnerUncheckedCreateWithoutLicensesInput>
|
||||
connectOrCreate?: Prisma.PartnerCreateOrConnectWithoutLicensesInput
|
||||
upsert?: Prisma.PartnerUpsertWithoutLicensesInput
|
||||
disconnect?: Prisma.PartnerWhereInput | boolean
|
||||
delete?: Prisma.PartnerWhereInput | boolean
|
||||
connect?: Prisma.PartnerWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.PartnerUpdateToOneWithWhereWithoutLicensesInput, Prisma.PartnerUpdateWithoutLicensesInput>, Prisma.PartnerUncheckedUpdateWithoutLicensesInput>
|
||||
}
|
||||
|
||||
@@ -233,7 +233,6 @@ export type PosWhereInput = {
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
device?: Prisma.XOR<Prisma.DeviceNullableScalarRelationFilter, Prisma.DeviceWhereInput> | null
|
||||
provider?: Prisma.XOR<Prisma.ProviderNullableScalarRelationFilter, Prisma.ProviderWhereInput> | null
|
||||
licenses?: Prisma.LicenseListRelationFilter
|
||||
permissionPos?: Prisma.PermissionPosListRelationFilter
|
||||
salesInvoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}
|
||||
@@ -253,7 +252,6 @@ export type PosOrderByWithRelationInput = {
|
||||
complex?: Prisma.ComplexOrderByWithRelationInput
|
||||
device?: Prisma.DeviceOrderByWithRelationInput
|
||||
provider?: Prisma.ProviderOrderByWithRelationInput
|
||||
licenses?: Prisma.LicenseOrderByRelationAggregateInput
|
||||
permissionPos?: Prisma.PermissionPosOrderByRelationAggregateInput
|
||||
salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
|
||||
_relevance?: Prisma.PosOrderByRelevanceInput
|
||||
@@ -277,7 +275,6 @@ export type PosWhereUniqueInput = Prisma.AtLeast<{
|
||||
complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
|
||||
device?: Prisma.XOR<Prisma.DeviceNullableScalarRelationFilter, Prisma.DeviceWhereInput> | null
|
||||
provider?: Prisma.XOR<Prisma.ProviderNullableScalarRelationFilter, Prisma.ProviderWhereInput> | null
|
||||
licenses?: Prisma.LicenseListRelationFilter
|
||||
permissionPos?: Prisma.PermissionPosListRelationFilter
|
||||
salesInvoices?: Prisma.SalesInvoiceListRelationFilter
|
||||
}, "id" | "serial">
|
||||
@@ -328,7 +325,6 @@ export type PosCreateInput = {
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -345,7 +341,6 @@ export type PosUncheckedCreateInput = {
|
||||
complex_id: string
|
||||
device_id?: string | null
|
||||
provider_id?: string | null
|
||||
licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -362,7 +357,6 @@ export type PosUpdateInput = {
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -379,7 +373,6 @@ export type PosUncheckedUpdateInput = {
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -578,20 +571,6 @@ export type PosUncheckedUpdateManyWithoutDeviceNestedInput = {
|
||||
deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[]
|
||||
}
|
||||
|
||||
export type PosCreateNestedOneWithoutLicensesInput = {
|
||||
create?: Prisma.XOR<Prisma.PosCreateWithoutLicensesInput, Prisma.PosUncheckedCreateWithoutLicensesInput>
|
||||
connectOrCreate?: Prisma.PosCreateOrConnectWithoutLicensesInput
|
||||
connect?: Prisma.PosWhereUniqueInput
|
||||
}
|
||||
|
||||
export type PosUpdateOneRequiredWithoutLicensesNestedInput = {
|
||||
create?: Prisma.XOR<Prisma.PosCreateWithoutLicensesInput, Prisma.PosUncheckedCreateWithoutLicensesInput>
|
||||
connectOrCreate?: Prisma.PosCreateOrConnectWithoutLicensesInput
|
||||
upsert?: Prisma.PosUpsertWithoutLicensesInput
|
||||
connect?: Prisma.PosWhereUniqueInput
|
||||
update?: Prisma.XOR<Prisma.XOR<Prisma.PosUpdateToOneWithWhereWithoutLicensesInput, Prisma.PosUpdateWithoutLicensesInput>, Prisma.PosUncheckedUpdateWithoutLicensesInput>
|
||||
}
|
||||
|
||||
export type PosCreateNestedOneWithoutPermissionPosInput = {
|
||||
create?: Prisma.XOR<Prisma.PosCreateWithoutPermissionPosInput, Prisma.PosUncheckedCreateWithoutPermissionPosInput>
|
||||
connectOrCreate?: Prisma.PosCreateOrConnectWithoutPermissionPosInput
|
||||
@@ -673,7 +652,6 @@ export type PosCreateWithoutComplexInput = {
|
||||
updated_at?: Date | string
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -689,7 +667,6 @@ export type PosUncheckedCreateWithoutComplexInput = {
|
||||
updated_at?: Date | string
|
||||
device_id?: string | null
|
||||
provider_id?: string | null
|
||||
licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -748,7 +725,6 @@ export type PosCreateWithoutDeviceInput = {
|
||||
updated_at?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -764,7 +740,6 @@ export type PosUncheckedCreateWithoutDeviceInput = {
|
||||
updated_at?: Date | string
|
||||
complex_id: string
|
||||
provider_id?: string | null
|
||||
licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -795,86 +770,6 @@ export type PosUpdateManyWithWhereWithoutDeviceInput = {
|
||||
data: Prisma.XOR<Prisma.PosUpdateManyMutationInput, Prisma.PosUncheckedUpdateManyWithoutDeviceInput>
|
||||
}
|
||||
|
||||
export type PosCreateWithoutLicensesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
export type PosUncheckedCreateWithoutLicensesInput = {
|
||||
id?: string
|
||||
name: string
|
||||
serial: string
|
||||
model?: string | null
|
||||
status?: $Enums.POSStatus
|
||||
pos_type: $Enums.POSType
|
||||
created_at?: Date | string
|
||||
updated_at?: Date | string
|
||||
complex_id: string
|
||||
device_id?: string | null
|
||||
provider_id?: string | null
|
||||
permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
export type PosCreateOrConnectWithoutLicensesInput = {
|
||||
where: Prisma.PosWhereUniqueInput
|
||||
create: Prisma.XOR<Prisma.PosCreateWithoutLicensesInput, Prisma.PosUncheckedCreateWithoutLicensesInput>
|
||||
}
|
||||
|
||||
export type PosUpsertWithoutLicensesInput = {
|
||||
update: Prisma.XOR<Prisma.PosUpdateWithoutLicensesInput, Prisma.PosUncheckedUpdateWithoutLicensesInput>
|
||||
create: Prisma.XOR<Prisma.PosCreateWithoutLicensesInput, Prisma.PosUncheckedCreateWithoutLicensesInput>
|
||||
where?: Prisma.PosWhereInput
|
||||
}
|
||||
|
||||
export type PosUpdateToOneWithWhereWithoutLicensesInput = {
|
||||
where?: Prisma.PosWhereInput
|
||||
data: Prisma.XOR<Prisma.PosUpdateWithoutLicensesInput, Prisma.PosUncheckedUpdateWithoutLicensesInput>
|
||||
}
|
||||
|
||||
export type PosUpdateWithoutLicensesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
export type PosUncheckedUpdateWithoutLicensesInput = {
|
||||
id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
serial?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus
|
||||
pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType
|
||||
created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
export type PosCreateWithoutPermissionPosInput = {
|
||||
id?: string
|
||||
name: string
|
||||
@@ -887,7 +782,6 @@ export type PosCreateWithoutPermissionPosInput = {
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -903,7 +797,6 @@ export type PosUncheckedCreateWithoutPermissionPosInput = {
|
||||
complex_id: string
|
||||
device_id?: string | null
|
||||
provider_id?: string | null
|
||||
licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -935,7 +828,6 @@ export type PosUpdateWithoutPermissionPosInput = {
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -951,7 +843,6 @@ export type PosUncheckedUpdateWithoutPermissionPosInput = {
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -966,7 +857,6 @@ export type PosCreateWithoutProviderInput = {
|
||||
updated_at?: Date | string
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -982,7 +872,6 @@ export type PosUncheckedCreateWithoutProviderInput = {
|
||||
updated_at?: Date | string
|
||||
complex_id: string
|
||||
device_id?: string | null
|
||||
licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
@@ -1025,7 +914,6 @@ export type PosCreateWithoutSalesInvoicesInput = {
|
||||
complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput
|
||||
device?: Prisma.DeviceCreateNestedOneWithoutPosesInput
|
||||
provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput
|
||||
licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -1041,7 +929,6 @@ export type PosUncheckedCreateWithoutSalesInvoicesInput = {
|
||||
complex_id: string
|
||||
device_id?: string | null
|
||||
provider_id?: string | null
|
||||
licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedCreateNestedManyWithoutPosInput
|
||||
}
|
||||
|
||||
@@ -1073,7 +960,6 @@ export type PosUpdateWithoutSalesInvoicesInput = {
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -1089,7 +975,6 @@ export type PosUncheckedUpdateWithoutSalesInvoicesInput = {
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
|
||||
@@ -1117,7 +1002,6 @@ export type PosUpdateWithoutComplexInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -1133,7 +1017,6 @@ export type PosUncheckedUpdateWithoutComplexInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -1175,7 +1058,6 @@ export type PosUpdateWithoutDeviceInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput
|
||||
licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -1191,7 +1073,6 @@ export type PosUncheckedUpdateWithoutDeviceInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -1233,7 +1114,6 @@ export type PosUpdateWithoutProviderInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput
|
||||
device?: Prisma.DeviceUpdateOneWithoutPosesNestedInput
|
||||
licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -1249,7 +1129,6 @@ export type PosUncheckedUpdateWithoutProviderInput = {
|
||||
updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||
complex_id?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
device_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput
|
||||
permissionPos?: Prisma.PermissionPosUncheckedUpdateManyWithoutPosNestedInput
|
||||
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutPosNestedInput
|
||||
}
|
||||
@@ -1273,13 +1152,11 @@ export type PosUncheckedUpdateManyWithoutProviderInput = {
|
||||
*/
|
||||
|
||||
export type PosCountOutputType = {
|
||||
licenses: number
|
||||
permissionPos: number
|
||||
salesInvoices: number
|
||||
}
|
||||
|
||||
export type PosCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
licenses?: boolean | PosCountOutputTypeCountLicensesArgs
|
||||
permissionPos?: boolean | PosCountOutputTypeCountPermissionPosArgs
|
||||
salesInvoices?: boolean | PosCountOutputTypeCountSalesInvoicesArgs
|
||||
}
|
||||
@@ -1294,13 +1171,6 @@ export type PosCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensio
|
||||
select?: Prisma.PosCountOutputTypeSelect<ExtArgs> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* PosCountOutputType without action
|
||||
*/
|
||||
export type PosCountOutputTypeCountLicensesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
where?: Prisma.LicenseWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* PosCountOutputType without action
|
||||
*/
|
||||
@@ -1331,7 +1201,6 @@ export type PosSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = ru
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
device?: boolean | Prisma.Pos$deviceArgs<ExtArgs>
|
||||
provider?: boolean | Prisma.Pos$providerArgs<ExtArgs>
|
||||
licenses?: boolean | Prisma.Pos$licensesArgs<ExtArgs>
|
||||
permissionPos?: boolean | Prisma.Pos$permissionPosArgs<ExtArgs>
|
||||
salesInvoices?: boolean | Prisma.Pos$salesInvoicesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.PosCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -1358,7 +1227,6 @@ export type PosInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
|
||||
complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
|
||||
device?: boolean | Prisma.Pos$deviceArgs<ExtArgs>
|
||||
provider?: boolean | Prisma.Pos$providerArgs<ExtArgs>
|
||||
licenses?: boolean | Prisma.Pos$licensesArgs<ExtArgs>
|
||||
permissionPos?: boolean | Prisma.Pos$permissionPosArgs<ExtArgs>
|
||||
salesInvoices?: boolean | Prisma.Pos$salesInvoicesArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.PosCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -1370,7 +1238,6 @@ export type $PosPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
complex: Prisma.$ComplexPayload<ExtArgs>
|
||||
device: Prisma.$DevicePayload<ExtArgs> | null
|
||||
provider: Prisma.$ProviderPayload<ExtArgs> | null
|
||||
licenses: Prisma.$LicensePayload<ExtArgs>[]
|
||||
permissionPos: Prisma.$PermissionPosPayload<ExtArgs>[]
|
||||
salesInvoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
|
||||
}
|
||||
@@ -1729,7 +1596,6 @@ export interface Prisma__PosClient<T, Null = never, ExtArgs extends runtime.Type
|
||||
complex<T extends Prisma.ComplexDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ComplexDefaultArgs<ExtArgs>>): Prisma.Prisma__ComplexClient<runtime.Types.Result.GetResult<Prisma.$ComplexPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
|
||||
device<T extends Prisma.Pos$deviceArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$deviceArgs<ExtArgs>>): Prisma.Prisma__DeviceClient<runtime.Types.Result.GetResult<Prisma.$DevicePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
provider<T extends Prisma.Pos$providerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$providerArgs<ExtArgs>>): Prisma.Prisma__ProviderClient<runtime.Types.Result.GetResult<Prisma.$ProviderPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
|
||||
licenses<T extends Prisma.Pos$licensesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$licensesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$LicensePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
permissionPos<T extends Prisma.Pos$permissionPosArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$permissionPosArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PermissionPosPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
salesInvoices<T extends Prisma.Pos$salesInvoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Pos$salesInvoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||
/**
|
||||
@@ -2152,30 +2018,6 @@ export type Pos$providerArgs<ExtArgs extends runtime.Types.Extensions.InternalAr
|
||||
where?: Prisma.ProviderWhereInput
|
||||
}
|
||||
|
||||
/**
|
||||
* Pos.licenses
|
||||
*/
|
||||
export type Pos$licensesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
/**
|
||||
* Select specific fields to fetch from the License
|
||||
*/
|
||||
select?: Prisma.LicenseSelect<ExtArgs> | null
|
||||
/**
|
||||
* Omit specific fields from the License
|
||||
*/
|
||||
omit?: Prisma.LicenseOmit<ExtArgs> | null
|
||||
/**
|
||||
* Choose, which related nodes to fetch as well
|
||||
*/
|
||||
include?: Prisma.LicenseInclude<ExtArgs> | null
|
||||
where?: Prisma.LicenseWhereInput
|
||||
orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[]
|
||||
cursor?: Prisma.LicenseWhereUniqueInput
|
||||
take?: number
|
||||
skip?: number
|
||||
distinct?: Prisma.LicenseScalarFieldEnum | Prisma.LicenseScalarFieldEnum[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Pos.permissionPos
|
||||
*/
|
||||
|
||||
+8
-3
@@ -5,8 +5,9 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
|
||||
import { AppModule } from './app.module'
|
||||
import { PrismaExceptionFilter } from './common/filters/prisma-exception.filter'
|
||||
import { ValidationExceptionFilter } from './common/filters/validation-exception.filter'
|
||||
import { ConsumerGuard } from './common/guards/auth-consumer.guard'
|
||||
import { PosGuard } from './common/guards/auth-pos.guard'
|
||||
import { JwtAuthGuard } from './common/guards/jwt-auth.guard'
|
||||
import { PosGuard } from './common/guards/pos.gaurd'
|
||||
import { LoggingInterceptor } from './common/interceptors/logging.interceptor'
|
||||
import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor'
|
||||
import { PrismaService } from './prisma/prisma.service'
|
||||
@@ -81,9 +82,13 @@ async function bootstrap() {
|
||||
// Register global exception filters: validation errors and Prisma errors
|
||||
app.useGlobalFilters(new ValidationExceptionFilter(), new PrismaExceptionFilter())
|
||||
|
||||
app.useGlobalGuards(new JwtAuthGuard(app.get(JwtService), app.get(Reflector)))
|
||||
app.useGlobalGuards(
|
||||
new PosGuard(app.get(JwtService), app.get(Reflector), app.get(PrismaService)),
|
||||
new JwtAuthGuard(
|
||||
app.get(JwtService),
|
||||
app.get(Reflector),
|
||||
new ConsumerGuard(new PrismaService()),
|
||||
new PosGuard(new PrismaService()),
|
||||
),
|
||||
)
|
||||
|
||||
await app.listen(process.env.PORT ?? 5002)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { AdminUsersService } from './consumers.service'
|
||||
import { CreateConsumerDto, UpdateConsumerDto } from './dto/consumer.dto'
|
||||
|
||||
@@ -25,9 +25,4 @@ export class AdminUsersController {
|
||||
async update(@Param('id') id: string, @Body() data: UpdateConsumerDto) {
|
||||
return this.usersService.update(id, data)
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async delete(@Param('id') id: string) {
|
||||
return this.usersService.delete(id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,15 @@ import { AdminUserAccountsModule } from './accounts/accounts.module'
|
||||
import { AdminConsumerBusinessActivitiesModule } from './business-activities/business-activities.module'
|
||||
import { AdminUsersController } from './consumers.controller'
|
||||
import { AdminUsersService } from './consumers.service'
|
||||
import { AdminConsumerLicensesModule } from './licenses/licenses.module'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule, AdminUserAccountsModule, AdminConsumerBusinessActivitiesModule],
|
||||
imports: [
|
||||
PrismaModule,
|
||||
AdminUserAccountsModule,
|
||||
AdminConsumerBusinessActivitiesModule,
|
||||
AdminConsumerLicensesModule,
|
||||
],
|
||||
controllers: [AdminUsersController],
|
||||
providers: [AdminUsersService],
|
||||
exports: [AdminUserAccountsModule],
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import { PasswordUtil } from '@/common/utils/password.util'
|
||||
import { AccountStatus, AccountType, ConsumerRole } from '@/generated/prisma/enums'
|
||||
import {
|
||||
AccountStatus,
|
||||
AccountType,
|
||||
ConsumerRole,
|
||||
LicenseStatus,
|
||||
PartnerStatus,
|
||||
} from '@/generated/prisma/enums'
|
||||
import { ConsumerCreateInput, ConsumerSelect } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { BadRequestException, Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { CreateConsumerDto, UpdateConsumerDto } from './dto/consumer.dto'
|
||||
|
||||
@@ -9,17 +16,33 @@ import { CreateConsumerDto, UpdateConsumerDto } from './dto/consumer.dto'
|
||||
export class AdminUsersService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
private readonly defaultSelect: ConsumerSelect = {
|
||||
id: true,
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
license: {
|
||||
select: {
|
||||
id: true,
|
||||
starts_at: true,
|
||||
expires_at: true,
|
||||
status: true,
|
||||
partner: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
async findAll() {
|
||||
const [consumers, count] = await this.prisma.$transaction([
|
||||
this.prisma.consumer.findMany({
|
||||
select: {
|
||||
id: true,
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
}),
|
||||
this.prisma.consumer.count(),
|
||||
])
|
||||
@@ -33,16 +56,12 @@ export class AdminUsersService {
|
||||
}
|
||||
|
||||
async findOne(id: string) {
|
||||
this.prisma.license.findFirst({
|
||||
where: {},
|
||||
})
|
||||
const consumer = await this.prisma.consumer.findUniqueOrThrow({
|
||||
where: { id },
|
||||
select: {
|
||||
id: true,
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
status: true,
|
||||
created_at: true,
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
|
||||
return ResponseMapper.single({
|
||||
@@ -52,32 +71,79 @@ export class AdminUsersService {
|
||||
}
|
||||
|
||||
async create(data: CreateConsumerDto) {
|
||||
const { username, password, ...rest } = data
|
||||
return this.prisma.consumer.create({
|
||||
data: {
|
||||
...rest,
|
||||
accounts: {
|
||||
create: {
|
||||
role: ConsumerRole.OWNER,
|
||||
account: {
|
||||
create: {
|
||||
username,
|
||||
password: await PasswordUtil.hash(password),
|
||||
type: AccountType.CONSUMER,
|
||||
status: AccountStatus.ACTIVE,
|
||||
},
|
||||
const { username, password, license, ...rest } = data
|
||||
const dataToCreate: ConsumerCreateInput = {
|
||||
...rest,
|
||||
accounts: {
|
||||
create: {
|
||||
role: ConsumerRole.OWNER,
|
||||
account: {
|
||||
create: {
|
||||
username,
|
||||
password: await PasswordUtil.hash(password),
|
||||
type: AccountType.CONSUMER,
|
||||
status: AccountStatus.ACTIVE,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
if (license) {
|
||||
if (license.partner_id) {
|
||||
const partner = await this.prisma.partner.findUnique({
|
||||
where: {
|
||||
id: license.partner_id,
|
||||
status: PartnerStatus.ACTIVE,
|
||||
},
|
||||
select: {
|
||||
name: true,
|
||||
license_quota: true,
|
||||
_count: {
|
||||
select: {
|
||||
licenses: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!partner) {
|
||||
throw new BadRequestException('متاسفانه شریک تجاری مورد نظر شما یافت نشد')
|
||||
}
|
||||
const partnerLicensesRemainsQuota =
|
||||
partner.license_quota || 0 - partner._count.licenses
|
||||
|
||||
if (!partnerLicensesRemainsQuota) {
|
||||
throw new BadRequestException(
|
||||
`تعداد لایسنسهای فعلی شریک تجاری ${partner.name} به پایان رسیده است`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
dataToCreate.license = {
|
||||
create: {
|
||||
starts_at: license.starts_at,
|
||||
expires_at: new Date(
|
||||
new Date(license.starts_at).getFullYear() + 1,
|
||||
).toISOString(),
|
||||
status: LicenseStatus.ACTIVE,
|
||||
partner: {
|
||||
connect: {
|
||||
id: license.partner_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return this.prisma.consumer.create({
|
||||
data: dataToCreate,
|
||||
select: this.defaultSelect,
|
||||
})
|
||||
}
|
||||
|
||||
async update(id: string, data: UpdateConsumerDto) {
|
||||
return this.prisma.admin.update({ where: { id }, data })
|
||||
}
|
||||
|
||||
async delete(id: string) {
|
||||
return this.prisma.admin.delete({ where: { id } })
|
||||
return this.prisma.consumer.update({
|
||||
where: { id },
|
||||
data,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ConsumerStatus } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsString } from 'class-validator'
|
||||
import { ApiProperty, OmitType, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsObject, IsString } from 'class-validator'
|
||||
import { CreateLicenseDto } from '../licenses/dto/license.dto'
|
||||
|
||||
export class CreateConsumerDto {
|
||||
@IsString()
|
||||
@@ -22,8 +23,16 @@ export class CreateConsumerDto {
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
password: string
|
||||
|
||||
@IsObject()
|
||||
@ApiProperty()
|
||||
license: CreateLicenseDto
|
||||
}
|
||||
export class UpdateConsumerDto extends PartialType(CreateConsumerDto) {
|
||||
export class UpdateConsumerDto extends OmitType(PartialType(CreateConsumerDto), [
|
||||
'password',
|
||||
'username',
|
||||
'license',
|
||||
]) {
|
||||
@IsEnum(ConsumerStatus)
|
||||
@ApiProperty({ enum: ConsumerStatus })
|
||||
status: ConsumerStatus
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { LicenseStatus } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, OmitType, PartialType } from '@nestjs/swagger'
|
||||
import { IsDateString, IsEnum } from 'class-validator'
|
||||
|
||||
export class CreateLicenseDto {
|
||||
@ApiProperty({ required: true, default: new Date().toISOString() })
|
||||
@IsDateString(
|
||||
{ strict: true },
|
||||
{ message: 'invoice_date must be a valid ISO-8601 string' },
|
||||
)
|
||||
starts_at: Date
|
||||
|
||||
@ApiProperty()
|
||||
@IsDateString(
|
||||
{ strict: true },
|
||||
{ message: 'invoice_date must be a valid ISO-8601 string' },
|
||||
)
|
||||
expires_at?: Date
|
||||
|
||||
@ApiProperty()
|
||||
partner_id: string
|
||||
}
|
||||
|
||||
export class UpdateLicenseDto extends OmitType(PartialType(CreateLicenseDto), [
|
||||
'starts_at',
|
||||
]) {
|
||||
@ApiProperty({ required: true, default: new Date().toISOString() })
|
||||
@IsDateString(
|
||||
{ strict: true },
|
||||
{ message: 'invoice_date must be a valid ISO-8601 string' },
|
||||
)
|
||||
starts_at: Date
|
||||
|
||||
@ApiProperty({ enum: LicenseStatus })
|
||||
@IsEnum(LicenseStatus)
|
||||
status?: LicenseStatus
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Body, Controller, Param, Patch, Post } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto'
|
||||
import { LicensesService } from './licenses.service'
|
||||
|
||||
@ApiTags('AdminConsumerAccounts')
|
||||
@Controller('admin/consumers/:consumerId/licenses')
|
||||
export class LicensesController {
|
||||
constructor(private readonly service: LicensesService) {}
|
||||
|
||||
@Post()
|
||||
async create(@Param('consumerId') consumerId: string, @Body() data: CreateLicenseDto) {
|
||||
return this.service.create(consumerId, data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateLicenseDto) {
|
||||
return this.service.update(id, data)
|
||||
}
|
||||
|
||||
// @Delete(':id')
|
||||
// async delete(@Param('id') id: string) {
|
||||
// return this.service.delete(id)
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { PrismaModule } from '@/prisma/prisma.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { LicensesController } from './licenses.controller'
|
||||
import { LicensesService } from './licenses.service'
|
||||
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
controllers: [LicensesController],
|
||||
providers: [LicensesService],
|
||||
exports: [LicensesService],
|
||||
})
|
||||
export class AdminConsumerLicensesModule {}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { LicenseStatus } from '@/generated/prisma/enums'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto'
|
||||
|
||||
@Injectable()
|
||||
export class LicensesService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
private readonly setExpireDate = (starts_at: Date) => {
|
||||
return new Date(
|
||||
new Date(starts_at).setFullYear(new Date(starts_at).getFullYear() + 1),
|
||||
).toISOString()
|
||||
}
|
||||
|
||||
async create(consumerId: string, data: CreateLicenseDto) {
|
||||
const { starts_at, expires_at } = data
|
||||
const license = await this.prisma.license.create({
|
||||
data: {
|
||||
starts_at,
|
||||
expires_at: expires_at ?? this.setExpireDate(starts_at),
|
||||
partner: {
|
||||
connect: {
|
||||
id: data.partner_id,
|
||||
},
|
||||
},
|
||||
consumers: {
|
||||
connect: {
|
||||
id: consumerId,
|
||||
},
|
||||
},
|
||||
status: LicenseStatus.ACTIVE,
|
||||
},
|
||||
})
|
||||
return ResponseMapper.create(license)
|
||||
}
|
||||
|
||||
async update(id: string, data: UpdateLicenseDto) {
|
||||
const { starts_at, expires_at } = data
|
||||
const license = await this.prisma.license.update({
|
||||
where: { id },
|
||||
data: {
|
||||
...data,
|
||||
starts_at,
|
||||
expires_at: expires_at ?? this.setExpireDate(starts_at),
|
||||
},
|
||||
})
|
||||
return ResponseMapper.update(license)
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export class GoodsController {
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Param('guildId') guildId: string, @Body() data: CreateGuildGoodDto) {
|
||||
return this.goodsService.create(guildId, data)
|
||||
create(@Body() data: CreateGuildGoodDto) {
|
||||
return this.goodsService.create(data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export class GoodsService {
|
||||
return ResponseMapper.single(good)
|
||||
}
|
||||
|
||||
async create(guild_id: string, data: CreateGuildGoodDto) {
|
||||
async create(data: CreateGuildGoodDto) {
|
||||
const { category_id, ...rest } = data
|
||||
|
||||
const good = await this.prisma.good.create({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common'
|
||||
import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto'
|
||||
import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
||||
import { UpdateLicenseDto } from './dto/license.dto'
|
||||
import { PartnerLicensesService } from './licenses.service'
|
||||
|
||||
@Controller('admin/licenses')
|
||||
@@ -16,11 +16,6 @@ export class LicensesController {
|
||||
return this.licensesService.findOne(id)
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(@Body() data: CreateLicenseDto) {
|
||||
return this.licensesService.create(data)
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
async update(@Param('id') id: string, @Body() data: UpdateLicenseDto) {
|
||||
return this.licensesService.update(id, data)
|
||||
|
||||
@@ -2,8 +2,7 @@ import { LicenseInclude } from '@/generated/prisma/models'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
import { LicenseStatus } from 'generated/prisma/enums'
|
||||
import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto'
|
||||
import { UpdateLicenseDto } from './dto/license.dto'
|
||||
|
||||
@Injectable()
|
||||
export class PartnerLicensesService {
|
||||
@@ -43,7 +42,6 @@ export class PartnerLicensesService {
|
||||
this.prisma.license.findMany({
|
||||
include: this.licenseInclude,
|
||||
omit: {
|
||||
pos_id: true,
|
||||
partner_id: true,
|
||||
},
|
||||
}),
|
||||
@@ -51,7 +49,7 @@ export class PartnerLicensesService {
|
||||
])
|
||||
return ResponseMapper.paginate(
|
||||
licenses.map(license => {
|
||||
const { pos, ...rest } = license
|
||||
const { ...rest } = license
|
||||
// @ts-ignore
|
||||
const { accounts, ...posRest } = pos
|
||||
return {
|
||||
@@ -71,12 +69,11 @@ export class PartnerLicensesService {
|
||||
where: { id },
|
||||
include: this.licenseInclude,
|
||||
omit: {
|
||||
pos_id: true,
|
||||
partner_id: true,
|
||||
},
|
||||
})
|
||||
if (license) {
|
||||
const { pos, ...rest } = license
|
||||
const { ...rest } = license
|
||||
// @ts-ignore
|
||||
const { accounts, ...posRest } = pos
|
||||
return ResponseMapper.single({
|
||||
@@ -89,24 +86,6 @@ export class PartnerLicensesService {
|
||||
return ResponseMapper.single(license)
|
||||
}
|
||||
|
||||
async create(data: CreateLicenseDto) {
|
||||
const date = new Date(data.starts_at || '')
|
||||
const expiresAt =
|
||||
data.expires_at || new Date(date.setFullYear(date.getFullYear() + 1))
|
||||
|
||||
const license = await this.prisma.license.create({
|
||||
data: {
|
||||
partner_id: data.partner_id,
|
||||
pos_id: data.pos_id,
|
||||
starts_at: date,
|
||||
expires_at: expiresAt,
|
||||
status: LicenseStatus.ACTIVE,
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.create(license)
|
||||
}
|
||||
|
||||
async update(id: string, data: UpdateLicenseDto) {
|
||||
const license = await this.prisma.license.update({
|
||||
where: { id },
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
import { Controller } from '@nestjs/common'
|
||||
import { ConsumerInfoInfo } from '@/common/decorators/consumerInfo.decorator'
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { ApiTags } from '@nestjs/swagger'
|
||||
import { ConsumerService } from './consumer.service'
|
||||
|
||||
@ApiTags('Consumer')
|
||||
@Controller('consumer')
|
||||
export class ConsumerController {}
|
||||
export class ConsumerController {
|
||||
constructor(private service: ConsumerService) {}
|
||||
|
||||
@Get('')
|
||||
async findOne(@ConsumerInfoInfo('user_id') userId: string) {
|
||||
return this.service.getInfo(userId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common'
|
||||
// import { Observable } from 'rxjs'
|
||||
|
||||
// @Injectable()
|
||||
// export class AdminGuard implements CanActivate {
|
||||
// canActivate(
|
||||
// _context: ExecutionContext,
|
||||
// ): boolean | Promise<boolean> | Observable<boolean> {
|
||||
// // Replace with real auth/permission checks (e.g., check JWT claims)
|
||||
// const request = _context.switchToHttp().getRequest()
|
||||
// const isAdminHeader = request.headers['x-admin']
|
||||
// return isAdminHeader === 'true' || request.isAdminRequest === true
|
||||
// }
|
||||
// }
|
||||
@@ -1,20 +1,50 @@
|
||||
import { checkAndDecodeJwtToken } from '@/common/utils/jwt-user.util'
|
||||
import { AccountType } from '@/generated/prisma/enums'
|
||||
import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { ForbiddenException, Injectable, NestMiddleware } from '@nestjs/common'
|
||||
import { JwtService } from '@nestjs/jwt'
|
||||
import { NextFunction, Request, Response } from 'express'
|
||||
|
||||
@Injectable()
|
||||
export class ConsumerMiddleware implements NestMiddleware {
|
||||
constructor(private jwtService: JwtService) {}
|
||||
use(req: Request, _res: Response, next: NextFunction) {
|
||||
const decodedToken = checkAndDecodeJwtToken(req, this.jwtService)
|
||||
if (decodedToken?.type === AccountType.CONSUMER) {
|
||||
req.decodedToken = decodedToken
|
||||
constructor(
|
||||
private prisma: PrismaService,
|
||||
private jwtService: JwtService,
|
||||
) {}
|
||||
|
||||
async use(req: Request, _res: Response, next: NextFunction) {
|
||||
const doForbidden = () => {
|
||||
throw new ForbiddenException('شما دسترسی لازم را ندارید')
|
||||
}
|
||||
try {
|
||||
const tokenAccount = checkAndDecodeJwtToken(req, this.jwtService)
|
||||
|
||||
if (tokenAccount?.type !== 'CONSUMER') {
|
||||
return doForbidden()
|
||||
}
|
||||
|
||||
const consumerAccount = await this.prisma.consumerAccount.findUnique({
|
||||
where: {
|
||||
id: tokenAccount.account_id,
|
||||
},
|
||||
select: {
|
||||
user_id: true,
|
||||
account_id: true,
|
||||
},
|
||||
})
|
||||
|
||||
if (!consumerAccount) {
|
||||
return doForbidden()
|
||||
}
|
||||
|
||||
req.consumerData = {
|
||||
account_id: consumerAccount.account_id,
|
||||
user_id: consumerAccount.user_id,
|
||||
}
|
||||
req.decodedToken = tokenAccount
|
||||
|
||||
return next()
|
||||
} catch (error) {
|
||||
return doForbidden()
|
||||
}
|
||||
|
||||
throw new UnauthorizedException('شما دسترسی لازم را ندارید.')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@ import { ConsumerAccountsModule } from './accounts/accounts.module'
|
||||
import { ConsumerBusinessActivitiesModule } from './business-activities/business-activities.module'
|
||||
import { ConsumerController } from './consumer.controller'
|
||||
import { ConsumerMiddleware } from './consumer.middleware'
|
||||
import { ConsumerService } from './consumer.service'
|
||||
|
||||
@Module({
|
||||
controllers: [ConsumerController],
|
||||
imports: [ConsumerAccountsModule, ConsumerBusinessActivitiesModule],
|
||||
providers: [JwtService],
|
||||
providers: [JwtService, ConsumerService],
|
||||
})
|
||||
export class ConsumerModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
@@ -17,5 +18,10 @@ export class ConsumerModule implements NestModule {
|
||||
method: RequestMethod.ALL,
|
||||
version: '1',
|
||||
})
|
||||
consumer.apply(ConsumerMiddleware).forRoutes({
|
||||
path: '/consumer',
|
||||
method: RequestMethod.ALL,
|
||||
version: '1',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { ResponseMapper } from '@/common/response/response-mapper'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class ConsumerService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
async getInfo(consumer_id: string) {
|
||||
const consumer = await this.prisma.consumer.findUnique({
|
||||
where: {
|
||||
id: consumer_id,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
mobile_number: true,
|
||||
status: true,
|
||||
license: {
|
||||
select: {
|
||||
starts_at: true,
|
||||
expires_at: true,
|
||||
status: true,
|
||||
partner: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.single({
|
||||
...consumer,
|
||||
full_name: `${consumer?.first_name} ${consumer?.last_name}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user