refactor user accounts structure

This commit is contained in:
2026-03-16 00:33:40 +03:30
parent d2215b9f04
commit 0ad6a3200e
118 changed files with 18774 additions and 8764 deletions
@@ -14,15 +14,16 @@ export class GoodsService {
base_sale_price: true,
is_default_guild_good: true,
local_sku: true,
guild_id: true,
} as GoodOmit
async findAll(guildId: string) {
const [goods, count] = await this.prisma.$transaction([
this.prisma.good.findMany({
where: {
guild_id: guildId,
is_default_guild_good: true,
category: {
guild_id: guildId,
},
},
include: {
category: {
@@ -44,9 +45,11 @@ export class GoodsService {
async findOne(guild_id: string, id: string) {
const good = await this.prisma.good.findUnique({
where: {
guild_id,
id,
is_default_guild_good: true,
category: {
guild_id,
},
},
include: {
@@ -69,11 +72,6 @@ export class GoodsService {
const good = await this.prisma.good.create({
data: {
guild: {
connect: {
id: guild_id,
},
},
category: {
connect: {
id: category_id,