Tengo dos archivos donde se definen dos clases:
Primera clase:
const { TournamentParticipationDataAccessService } = require('./TournamentParticipationDataAccessService.js') const { TournamentDateUtil } = require('./TournamentDateUtil.js') const tournamentParticipationDataAccessService = require('./TournamentParticipationDataAccessService.js') class TournamentDataAccessService { constructor() { this.tournamentParticipationDataAccessService = new TournamentParticipationDataAccessService() } scheduleBeginOfTournament(tournamentObject) { var beginningDate = TournamentDateUtil.convertUTCDateToLocalDate(new Date(tournamentObject.beginningDate)); console.log("Beginning date of tournament: " + tournamentObject.objectID + " " + beginningDate) var beginOfRoundScheduler = scheduler.scheduleJob(beginningDate, function() { this.tournamentParticipationDataAccessService.checkIfTournamentHasReachedParticipationNumber(tournamentObject) // DOESN'T WORK }) }..
Luego tengo estos otros archivos que contienen otra clase desde la cual quiero usar una función en mi clase TournamentDataAccessService
class TournamentParticipationDataAccessService { ... checkIfTournamentHasReachedParticipationNumber(tournamentObject) { ... } } module.exports.TournamentParticipationDataAccessService = TournamentParticipationDataAccessService module.exports.identifyWinnerOfRound = this.identifyWinnerOfRound module.exports.checkIfTournamentHasReachedParticipationNumber = this.checkIfTournamentHasReachedParticipationNumber module.exports.assignParticipantsToGroups = this.assignParticipantsToGroups ¿Por qué no puedo llamar a una función como this.tournamentParticipationDataAccessService.checkIfTournamentHasReachedParticipationNumber(tournamentObject) ?