import { DataSource } from 'typeorm';
import { Student } from './entity/Student';
import { Client } from './entity/Client';
import { TitleStudent } from './entity/TitleStudent';
import { TypeStudent } from './entity/TypeStudent';
import { Classes } from './entity/Classes';
import { Course } from './entity/Course';
import { ClientType } from './entity/ClientType';
import { CourseCategory } from './entity/CourseCategory';
import { TeachingMode } from './entity/TeachingMode';
import { ClassDetail } from './entity/ClassDetail';
import { Address } from './entity/Address';
import { User } from './entity/User';
import { ClassNumber } from './entity/ClassNumber';
import { PaymentType } from './entity/PaymentType';

export const AppDataSource = new DataSource({
  type: 'mysql',
  host: process.env.DB_HOST,
  port: Number(process.env.DB_PORT),
  username: process.env.DB_USER,
  password: process.env.DB_PASS,
  database: process.env.DB_NAME,
  synchronize: true,
  logging: false,
  entities: [
    Student,
    Client,
    TitleStudent,
    TypeStudent,
    Classes,
    Course,
    ClientType,
    CourseCategory,
    TeachingMode,
    ClassDetail,
    Address,
    User,
    ClassNumber,
    PaymentType,
    ClassNumber,
  ],
  migrations: [],
  subscribers: [],
});