"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BaseChannel=void 0;const RedisCache_1=require("../cache/RedisCache");class BaseChannel{constructor(e){this.channelName=e}validate(e){if(!e.userId)throw new Error("userId is required");if(!e.data&&!e.template)throw new Error("Either data or template must be provided")}async trackDelivery(e,a){await RedisCache_1.redisCache.trackDelivery(e,this.channelName,a)}getChannelName(){return this.channelName}async isAvailableForUser(e){return!0}log(e,a){const r=(new Date).toISOString();console.log(`[${this.channelName}] ${r} - ${e}`,a?JSON.stringify(a):"")}logError(e,a){const r=(new Date).toISOString();console.error(`[${this.channelName}] ${r} - ERROR: ${e}`,a)}}exports.BaseChannel=BaseChannel;