Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const model = {
name: req.user.username,
serviceId: req.service.externalId,
period,
links,
linksToDisplay,
goLiveNotStarted: req.service.currentGoLiveStage === NOT_STARTED,
goLiveStarted: goLiveStartedStages.includes(req.service.currentGoLiveStage),
goLiveRequested: goLiveRequestedStages.includes(req.service.currentGoLiveStage),
account: req.account
}
try {
const { fromDateTime, toDateTime } = getTransactionDateRange(period)
const transactionsPeriodString = `fromDate=${encodeURIComponent(datetime(fromDateTime, 'date'))}&fromTime=${encodeURIComponent(datetime(fromDateTime, 'time'))}&toDate=${encodeURIComponent(datetime(toDateTime, 'date'))}&toTime=${encodeURIComponent(datetime(toDateTime, 'time'))}`
logger.info(`[${correlationId}] successfully logged in`)
if (isADirectDebitAccount(gatewayAccountId)) {
// todo implement transaction list for direct debit
return response(req, res, 'dashboard/index', Object.assign(model, {
activityError: true
}))
}
const namespace = getNamespace(clsXrayConfig.nameSpaceName)
const clsSegment = namespace.get(clsXrayConfig.segmentKeyName)
AWSXRay.captureAsyncFunc('ledgerClient_getTransactionSummary', function (subsegment) {
LedgerClient.transactionSummary(gatewayAccountId, fromDateTime, toDateTime, { correlationId: correlationId })
.then(result => {