log user idenifier and debit manager gets lnd and application manager

This commit is contained in:
Mothana 2024-09-19 01:02:15 +04:00
parent c40445ae14
commit bed397e424
3 changed files with 6 additions and 2 deletions

View file

@ -50,6 +50,8 @@ export default class {
const user = await this.storage.userStorage.GetUser(ctx.user_id) const user = await this.storage.userStorage.GetUser(ctx.user_id)
const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) const app = await this.storage.applicationStorage.GetApplication(ctx.app_id)
const appUser = await this.storage.applicationStorage.GetAppUserFromUser(app, user.user_id) const appUser = await this.storage.applicationStorage.GetAppUserFromUser(app, user.user_id)
console.log("User Identifier/pointer here", appUser?.identifier)
if (!appUser) { if (!appUser) {
throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing
} }

View file

@ -42,8 +42,10 @@ export class DebitManager {
storage: Storage storage: Storage
lnd: LND lnd: LND
logger = getLogger({ component: 'DebitManager' }) logger = getLogger({ component: 'DebitManager' })
constructor(storage: Storage) { constructor(storage: Storage, lnd: LND, applicationManager: ApplicationManager) {
this.storage = storage this.storage = storage
this.lnd = lnd
this.applicationManager = applicationManager
} }
AuthorizeDebit = async (ctx: Types.UserContext, req: Types.DebitAuthorizationRequest): Promise<Types.DebitAuthorization> => { AuthorizeDebit = async (ctx: Types.UserContext, req: Types.DebitAuthorizationRequest): Promise<Types.DebitAuthorization> => {

View file

@ -71,7 +71,7 @@ export default class {
this.productManager = new ProductManager(this.storage, this.paymentManager, this.settings) this.productManager = new ProductManager(this.storage, this.paymentManager, this.settings)
this.applicationManager = new ApplicationManager(this.storage, this.settings, this.paymentManager) this.applicationManager = new ApplicationManager(this.storage, this.settings, this.paymentManager)
this.appUserManager = new AppUserManager(this.storage, this.settings, this.applicationManager) this.appUserManager = new AppUserManager(this.storage, this.settings, this.applicationManager)
this.debitManager = new DebitManager(this.storage) this.debitManager = new DebitManager(this.storage, this.lnd, this.applicationManager)
} }
Stop() { Stop() {