- logs in find all coa by user
This commit is contained in:
@@ -50,6 +50,7 @@ export class CoaService {
|
||||
}
|
||||
|
||||
async findByUser(id: string, typeOfCoa: coaType) {
|
||||
console.log('findbyuser', 'msk')
|
||||
try {
|
||||
return await this.coaRepository.findOneOrFail({
|
||||
user: id,
|
||||
@@ -72,6 +73,7 @@ export class CoaService {
|
||||
|
||||
async findByTwoUser(from: string, destination: string, typeOfCoa: coaType) {
|
||||
try {
|
||||
console.log('findbytwouser', 'msk')
|
||||
return await this.coaRepository.findOneOrFail({
|
||||
user: from,
|
||||
relatedUser: destination,
|
||||
|
||||
@@ -165,6 +165,7 @@ export class TransactionService {
|
||||
currentUser.userId,
|
||||
coaType.ACCOUNT_RECEIVABLE,
|
||||
);
|
||||
console.log('coamsk1', 'coa')
|
||||
const coaWallet = await this.coaService.findByUser(
|
||||
distributeTransactionDto.destination,
|
||||
coaType.WALLET,
|
||||
@@ -226,6 +227,7 @@ export class TransactionService {
|
||||
);
|
||||
|
||||
// GET COA
|
||||
console.log('coamsk2', 'coa')
|
||||
const coaSenderWallet = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
@@ -237,6 +239,7 @@ export class TransactionService {
|
||||
coaType.ACCOUNT_PAYABLE,
|
||||
);
|
||||
|
||||
console.log('coamsk3', 'coa')
|
||||
const coaReceiverWallet = await this.coaService.findByUser(
|
||||
distributeTransactionDto.destination,
|
||||
coaType.WALLET,
|
||||
@@ -351,6 +354,7 @@ export class TransactionService {
|
||||
let profit = product_price.mark_up_price;
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk4', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
@@ -509,6 +513,7 @@ export class TransactionService {
|
||||
);
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk5', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
@@ -732,6 +737,7 @@ export class TransactionService {
|
||||
);
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk6', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
@@ -1251,6 +1257,7 @@ export class TransactionService {
|
||||
}
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk7', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
@@ -1496,10 +1503,10 @@ export class TransactionService {
|
||||
seriNumber: string,
|
||||
status: string,
|
||||
) {
|
||||
console.log('callbackpartner', 'masuk')
|
||||
const partnerData = await this.userService.findPartner(partnerId);
|
||||
const userData = await this.userService.findOneByPartner(partnerId);
|
||||
|
||||
console.log('coamsk8', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
@@ -1582,6 +1589,7 @@ export class TransactionService {
|
||||
async withdrawBenefit(user) {
|
||||
const userData = await this.userService.findExist(user);
|
||||
|
||||
console.log('coamsk9', 'coa')
|
||||
const coaProfit = await this.coaService.findByUser(user, coaType.PROFIT);
|
||||
|
||||
const coaBank = await this.coaService.findByName(
|
||||
@@ -2057,6 +2065,7 @@ export class TransactionService {
|
||||
),
|
||||
);
|
||||
|
||||
console.log('coamsk10', 'coa')
|
||||
return Promise.all(
|
||||
supervisorData.map(async (it) => {
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
|
||||
Reference in New Issue
Block a user