// server/config.js
const path = require('path');

const PORT = 3001;
const UPLOADS_DIR = path.join(__dirname, 'uploads');
const SETTINGS_PATH = path.join(__dirname, 'app-settings.json');

const DEFAULTS = {
  uploadMaxSizeMB: 50,
  cacheTTLMs: 60000,
  sessionMaxAge: 7 * 24 * 60 * 60 * 1000,
  tokenExpiryDays: 7,
};

const QUERY_LIMITS = {
  small: 200,
  medium: 500,
  large: 1000,
  max: 5000,
};

const ALL_MODULES = ['marketing', 'projects', 'finance'];

// NocoDB table name mapping for ownership checks
const TABLE_NAME_MAP = { posts: 'Posts', tasks: 'Tasks', campaigns: 'Campaigns', projects: 'Projects' };

// Entity types allowed for comments
const COMMENT_ENTITY_TYPES = new Set(['post', 'task', 'project', 'campaign', 'asset']);

module.exports = { PORT, UPLOADS_DIR, SETTINGS_PATH, DEFAULTS, QUERY_LIMITS, ALL_MODULES, TABLE_NAME_MAP, COMMENT_ENTITY_TYPES };
