/**
 * Chart of Accounts - OpenAPI/Swagger Documentation
 */

/**
 * @swagger
 * components:
 *   schemas:
 *     ChartOfAccount:
 *       type: object
 *       required:
 *         - accountCode
 *         - accountName
 *         - category
 *         - level
 *         - normalBalance
 *       properties:
 *         accountCode:
 *           type: string
 *           pattern: '^\d{4,10}$'
 *           example: "1000"
 *         accountName:
 *           type: string
 *           example: "ASSETS"
 *         category:
 *           type: string
 *           enum: [ASSET, LIABILITY, EQUITY, REVENUE, EXPENSE, OTHER]
 */

export const swaggerDefinitions = {
  ChartOfAccount: {
    type: 'object',
    required: ['accountCode', 'accountName', 'category', 'level', 'normalBalance'],
    properties: {
      accountCode: { type: 'string', pattern: '^\\d{4,10}$' },
      accountName: { type: 'string' },
      category: { type: 'string', enum: ['ASSET', 'LIABILITY', 'EQUITY', 'REVENUE', 'EXPENSE', 'OTHER'] },
      level: { type: 'integer', minimum: 1, maximum: 10 },
      normalBalance: { type: 'string', enum: ['DEBIT', 'CREDIT'] },
      isActive: { type: 'boolean', default: true },
    },
  },
};
