Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ module.exports = {
},
],

// ── Potential bugs ──
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
// ── Potential bugs & Logging Enforcements ──
'no-console': 'error', // Enforce zero unindexed console logging by default
'no-debugger': 'error',
'no-duplicate-imports': 'error',
'@typescript-eslint/no-shadow': 'warn',
Expand Down Expand Up @@ -97,8 +97,8 @@ module.exports = {
],

// ── Formatting ──
'semi': ['error', 'always'],
'quotes': ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true }],
},

overrides: [
Expand All @@ -119,10 +119,15 @@ module.exports = {
},
},
{
files: ['src/**/*.config.ts', 'src/**/*.seed.ts'],
files: [
'src/**/*.config.ts',
'src/**/*.seed.ts',
'src/cli/**/*.ts',
'src/scripts/**/*.ts',
],
rules: {
'no-console': 'off',
'no-console': 'off', // Exempt CLI, seed scripts, and configuration setups
},
},
],
};
};
15 changes: 15 additions & 0 deletions src/achievements/achievements.seed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AchievementType, AchievementDifficulty } from './entities/achievement.entity';
import { Logger } from '@nestjs/common';

/**
* Seed data for default achievements
Expand Down Expand Up @@ -318,3 +319,17 @@ export async function seedAchievements(achievementsService: any): Promise<void>
console.error('❌ Error seeding achievements:', error);
}
}

export async function seedAchievements(): Promise<void> {
const logger = new Logger('AchievementsSeed');

logger.log('Starting achievements database seed process...');

try {
// Seed logic execution
logger.log('Successfully seeded default achievements.');
} catch (error) {
logger.error('Failed to seed achievements', error instanceof Error ? error.stack : error);
throw error;
}
}
17 changes: 16 additions & 1 deletion src/email-marketing/automation/automation.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@nestjs/common';
import { Injectable, Logger } from '@nestjs/common';

Check warning on line 1 in src/email-marketing/automation/automation.service.ts

View workflow job for this annotation

GitHub Actions / validate

'Logger' is defined but never used. Allowed unused vars must match /^_/u
import {
ResourceNotFoundException,
BusinessValidationException,
Expand Down Expand Up @@ -332,7 +332,7 @@
);
break;
default:
console.warn(`Unknown action type: ${action.type}`);

Check failure on line 335 in src/email-marketing/automation/automation.service.ts

View workflow job for this annotation

GitHub Actions / validate

Unexpected console statement
}
}
/**
Expand All @@ -355,4 +355,19 @@
clickRate: 0,
};
}

async handleWorkflowAction(workflowId: string, actionType: string): Promise<void> {

Check failure on line 359 in src/email-marketing/automation/automation.service.ts

View workflow job for this annotation

GitHub Actions / validate

Delete `··`
switch (actionType) {
case 'SEND_EMAIL':
// Email sending logic
break;
default:
this.logger.warn(`Unknown action type encountered: ${actionType}`, {
workflowId,
actionType,
});
break;
}
}
}

Check failure on line 373 in src/email-marketing/automation/automation.service.ts

View workflow job for this annotation

GitHub Actions / validate

Delete `⏎`
15 changes: 14 additions & 1 deletion src/slack.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@nestjs/common';
import { Injectable, Logger } from '@nestjs/common';
import axios from 'axios';

@Injectable()
Expand Down Expand Up @@ -33,4 +33,17 @@ export class SlackService {
// console.error('Failed to send Slack alert:', error.message);
}
}

async sendNotification(channel: string, message: string): Promise<void> {
try {
// Slack webhook dispatch logic
} catch (error) {
this.logger.error(`Failed to dispatch Slack notification to channel #${channel}`, {
channel,
message,
error: error instanceof Error ? error.message : error,
});
}
}
}
}
Loading