add max catalogue
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
import { Injectable, Logger, NotFoundException } from '@nestjs/common';
|
||||||
import { SetupBusinessDto } from './dto/setup-business.dto';
|
import { SetupBusinessDto } from './dto/setup-business.dto';
|
||||||
import { UpdateBusinessDto } from './dto/update-business.dto';
|
import { UpdateBusinessDto } from './dto/update-business.dto';
|
||||||
import { EntityManager } from '@mikro-orm/postgresql';
|
import { EntityManager } from '@mikro-orm/postgresql';
|
||||||
@@ -10,6 +10,8 @@ import { Catalogue } from '../catalogue/entities/catalogue.entity';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BusinessService {
|
export class BusinessService {
|
||||||
|
private readonly logger = new Logger(BusinessService.name);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly em: EntityManager,
|
private readonly em: EntityManager,
|
||||||
private readonly businessRepository: BusinessRepository
|
private readonly businessRepository: BusinessRepository
|
||||||
@@ -17,7 +19,10 @@ export class BusinessService {
|
|||||||
|
|
||||||
async setupAccount(dto: SetupBusinessDto) {
|
async setupAccount(dto: SetupBusinessDto) {
|
||||||
const { danakSubscriptionId, name, phone, slug, firstName, lastName, maxCataloguesCount } = dto
|
const { danakSubscriptionId, name, phone, slug, firstName, lastName, maxCataloguesCount } = dto
|
||||||
|
this.logger.log('recived request from danak payload', {
|
||||||
|
danakSubscriptionId, name, phone, slug,
|
||||||
|
firstName, lastName, maxCataloguesCount
|
||||||
|
})
|
||||||
const business = await this.em.transactional(async (em) => {
|
const business = await this.em.transactional(async (em) => {
|
||||||
const business = em.create(Business, {
|
const business = em.create(Business, {
|
||||||
danakSubscriptionId,
|
danakSubscriptionId,
|
||||||
|
|||||||
Reference in New Issue
Block a user