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:
@@ -1,3 +1,5 @@
|
||||
import { QUERY_CONSTANTS } from '@/common/queryConstants'
|
||||
import consumer_mappersUtil from '@/common/utils/mappers/consumer_mappers.util'
|
||||
import { ConsumerStatus } from '@/generated/prisma/enums'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
@@ -95,7 +97,7 @@ export class PosService {
|
||||
complex: {
|
||||
business_activity: {
|
||||
consumer: {
|
||||
consumer_accounts: {
|
||||
accounts: {
|
||||
some: {
|
||||
id: account_id,
|
||||
},
|
||||
@@ -133,7 +135,7 @@ export class PosService {
|
||||
}
|
||||
|
||||
async getMe(account_id: string, pos_id: string) {
|
||||
const account = await this.prisma.consumerAccount.findUniqueOrThrow({
|
||||
const pos = await this.prisma.consumerAccount.findUniqueOrThrow({
|
||||
where: {
|
||||
id: account_id,
|
||||
consumer: {
|
||||
@@ -158,8 +160,10 @@ export class PosService {
|
||||
role: true,
|
||||
consumer: {
|
||||
select: {
|
||||
first_name: true,
|
||||
last_name: true,
|
||||
id: true,
|
||||
type: true,
|
||||
status: true,
|
||||
...QUERY_CONSTANTS.CONSUMER.infoSelect,
|
||||
},
|
||||
},
|
||||
account: {
|
||||
@@ -170,6 +174,11 @@ export class PosService {
|
||||
},
|
||||
})
|
||||
|
||||
return ResponseMapper.single(account)
|
||||
const { consumer, ...rest } = pos
|
||||
|
||||
return ResponseMapper.single({
|
||||
...rest,
|
||||
consumer: consumer_mappersUtil(consumer),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user