feat: add response DTOs for various services across modules
- Created response DTOs for ConfigService, AppService, AuthService, CatalogsService, AccountsService, BusinessActivityComplexesService, ComplexPosesService, SalesInvoicesService, BusinessActivitiesService, ConsumerBusinessActivityGoodsService, and others. - Implemented Create, FindAll, FindOne, and Update response types for services in consumer, partners, and POS modules. - Added request DTOs for creating and updating goods in the consumer business activities module. - Introduced filtering DTO for partner licenses. - Enhanced response mapping for partner license activations.
This commit is contained in:
@@ -29,7 +29,7 @@ export class GoodsService {
|
||||
},
|
||||
}
|
||||
|
||||
async findAll(complex_id: string, guild_id: string) {
|
||||
async findAll(business_activity_id: string, guild_id: string) {
|
||||
const goods = await this.prisma.good.findMany({
|
||||
where: {
|
||||
OR: [
|
||||
@@ -40,7 +40,7 @@ export class GoodsService {
|
||||
},
|
||||
},
|
||||
{
|
||||
complex_id,
|
||||
business_activity_id,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -50,15 +50,13 @@ export class GoodsService {
|
||||
return ResponseMapper.list(goods)
|
||||
}
|
||||
|
||||
async findOne(good_id: string, complex_id: string, guild_id: string) {
|
||||
async findOne(good_id: string, business_activity_id: string, guild_id: string) {
|
||||
const good = await this.prisma.good.findUnique({
|
||||
where: {
|
||||
id: good_id,
|
||||
complex: {
|
||||
id: complex_id,
|
||||
business_activity: {
|
||||
guild_id,
|
||||
},
|
||||
business_activity: {
|
||||
id: business_activity_id,
|
||||
guild_id,
|
||||
},
|
||||
},
|
||||
select: this.defaultSelect,
|
||||
@@ -67,12 +65,12 @@ export class GoodsService {
|
||||
return ResponseMapper.single(good)
|
||||
}
|
||||
|
||||
async create(data: CreateGoodDto, complex_id: string) {
|
||||
async create(data: CreateGoodDto, business_activity_id: string) {
|
||||
const { category_id, ...rest } = data
|
||||
|
||||
const dataToCreate = {
|
||||
...rest,
|
||||
complex_id,
|
||||
business_activity_id,
|
||||
connect: {
|
||||
category: {
|
||||
id: category_id,
|
||||
@@ -88,9 +86,9 @@ export class GoodsService {
|
||||
id: category_id,
|
||||
},
|
||||
},
|
||||
complex: {
|
||||
business_activity: {
|
||||
connect: {
|
||||
id: complex_id,
|
||||
id: business_activity_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user