a350ec7990
- Implemented AccountsService for managing consumer accounts including create, update, delete, and find operations. - Created DTOs for account creation and updates. - Developed BusinessActivitiesController and BusinessActivitiesService for handling business activities related to consumers. - Added complexes management with ComplexesController and ComplexesService. - Introduced POS management with ComplexPosesController and ComplexPosesService. - Created necessary DTOs for business activities and POS. - Established Licenses management with LicensesController and LicensesService. - Integrated consumer management with PartnerConsumersController and PartnerConsumersService. - Added Prisma module imports and service connections across modules.
27 lines
734 B
TypeScript
27 lines
734 B
TypeScript
import { ResponseMapper } from '@/common/response/response-mapper'
|
|
import { PrismaService } from '@/prisma/prisma.service'
|
|
import { Injectable } from '@nestjs/common'
|
|
import mapConsumerWithLicenseUtil from './utils/mapConsumerWithLicense.util'
|
|
|
|
@Injectable()
|
|
export class ConsumerService {
|
|
constructor(private readonly prisma: PrismaService) {}
|
|
|
|
async getInfo(consumer_id: string) {
|
|
const consumer = await this.prisma.consumer.findUniqueOrThrow({
|
|
where: {
|
|
id: consumer_id,
|
|
},
|
|
select: {
|
|
id: true,
|
|
first_name: true,
|
|
last_name: true,
|
|
mobile_number: true,
|
|
status: true,
|
|
},
|
|
})
|
|
|
|
return ResponseMapper.single(mapConsumerWithLicenseUtil(consumer))
|
|
}
|
|
}
|