58 lines
2.0 KiB
TypeScript
58 lines
2.0 KiB
TypeScript
import { Env } from '@adonisjs/core/env'
|
|
|
|
export default await Env.create(new URL('../', import.meta.url), {
|
|
NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
|
|
PORT: Env.schema.number(),
|
|
APP_KEY: Env.schema.string(),
|
|
HOST: Env.schema.string({ format: 'host' }),
|
|
LOG_LEVEL: Env.schema.string.optional(),
|
|
|
|
/*
|
|
|----------------------------------------------------------
|
|
| Database (MySQL)
|
|
|----------------------------------------------------------
|
|
*/
|
|
DB_HOST: Env.schema.string({ format: 'host' }),
|
|
DB_PORT: Env.schema.number(),
|
|
DB_USER: Env.schema.string(),
|
|
DB_PASSWORD: Env.schema.string.optional(),
|
|
DB_DATABASE: Env.schema.string(),
|
|
|
|
/*
|
|
|----------------------------------------------------------
|
|
| Redis (queue / BullMQ)
|
|
|----------------------------------------------------------
|
|
*/
|
|
REDIS_HOST: Env.schema.string({ format: 'host' }),
|
|
REDIS_PORT: Env.schema.number(),
|
|
REDIS_PASSWORD: Env.schema.string.optional(),
|
|
|
|
/*
|
|
|----------------------------------------------------------
|
|
| Sync ERP định kỳ (cron cho BullMQ job scheduler)
|
|
|----------------------------------------------------------
|
|
| SYNC_CRON: biểu thức cron (mặc định 2h sáng mỗi ngày).
|
|
| SYNC_TZ: timezone áp cho cron (mặc định Australia/Sydney).
|
|
*/
|
|
SYNC_CRON: Env.schema.string.optional(),
|
|
SYNC_TZ: Env.schema.string.optional(),
|
|
|
|
/*
|
|
|----------------------------------------------------------
|
|
| Pricing engine / external services
|
|
|----------------------------------------------------------
|
|
*/
|
|
OPENAI_API_KEY: Env.schema.string.optional(),
|
|
OPENAI_MODEL: Env.schema.string.optional(),
|
|
PRICING_AUTO_APPLY_THRESHOLD_PCT: Env.schema.number.optional(),
|
|
PRICING_FLOOR_MARKUP: Env.schema.number.optional(),
|
|
|
|
// ERP (sync service — API hoàn thiện sau)
|
|
ERP_API_URL: Env.schema.string.optional(),
|
|
ERP_API_KEY: Env.schema.string.optional(),
|
|
|
|
// eBay
|
|
EBAY_CLIENT_ID: Env.schema.string.optional(),
|
|
EBAY_CLIENT_SECRET: Env.schema.string.optional(),
|
|
})
|