import { TypeOrmModule } from "@nestjs/typeorm";
import ArticleEntity from "../entity/article.entity";
import ArticleBarcodeEntity from "../entity/article_barcode.entity";
import ArticleCategoryEntity from "../entity/article_category.entity";
import ArticlePriceEntity from "../entity/article_price.entity";
import ArticleStoreEntity from "../entity/article_store.entity";
import AttributeEntity from "../entity/attribute.entity";
import CategoryEntity from "../entity/category.entity";
import CustomerEntity from "../entity/customer.entity";
import DeviceEntity from "../entity/device.entity";
import OperatorEntity from "../entity/operator.entity";
import PaymentEntity from "../entity/payment.entity";
import PriceEntity from "../entity/price.entity";
import RateEntity from "../entity/rate.entity";
import StorageEntity from "../entity/storage.entity";
import StoreEntity from "../entity/store.entity";
import SupplierEntity from "../entity/supplier.entity";
import UnitMeasureEntity from "../entity/unit_measure.entity";
import UserEntity from "../entity/user.entity";
import TipologyEntity from "../entity/tipology.entity";
import InvoiceCounterEntity from "../entity/invoice_counter.entity";
import CreditNoteCounterEntity from "../entity/credit_note.entity";
import DocumentProgressiveEntity from "../entity/document_progressive.entity";
import MediaEntity from "../entity/media.entity";
import os from 'os';
import ArticleImageEntity from "../entity/article_images.entity";
import DocumentEntity from "../entity/document.entity";
import DocumentCustomerEntity from "../entity/document_customer.entity";
import DocumentDiscountEntity from "../entity/document_discount.entity";
import DocumentOperatorEntity from "../entity/document_operator.entity";
import DocumentPaymentEntity from "../entity/document_payment.entity";
import DocumentRowEntity from "../entity/document_row.entity";
import DocumentStorageEntity from "../entity/document_storage.entity";
import DocumentStoreEntity from "../entity/document_store.entity";
import DocumentSupplierEntity from "../entity/document_supplier.entity";
import DocumentUserEntity from "../entity/document_user.entity";
import DocumentDeviceEntity from "../entity/document_device.entity";
import MovementEntity from "../entity/movement.entity";

const platform  = os.platform();
const isLinux   = platform == "linux";

export default TypeOrmModule.forRoot(
    {
        type        : "mysql",
        host        : "localhost",
        username    : isLinux ? "ext_root_gump" : "root",
        password    : isLinux ? "Ant070400@!!"  : "Ant070400@",
        database    : "gump",
        synchronize : false,
        entities    : [
            UserEntity,
            UnitMeasureEntity,
            SupplierEntity,
            StoreEntity,
            StorageEntity,
            RateEntity,
            PriceEntity,
            PaymentEntity,
            OperatorEntity,
            DeviceEntity,
            CustomerEntity,
            CategoryEntity,
            AttributeEntity,
            ArticleEntity,
            ArticleStoreEntity,
            ArticlePriceEntity,
            ArticleCategoryEntity,
            ArticleBarcodeEntity,
            ArticleImageEntity,
            TipologyEntity,
            InvoiceCounterEntity,
            CreditNoteCounterEntity,
            MediaEntity,
            DocumentEntity,
            DocumentCustomerEntity,
            DocumentDeviceEntity,
            DocumentDiscountEntity,
            DocumentOperatorEntity,
            DocumentPaymentEntity,
            DocumentProgressiveEntity,
            DocumentRowEntity,
            DocumentStorageEntity,
            DocumentStoreEntity,
            DocumentSupplierEntity,
            DocumentUserEntity,
            MovementEntity
        ]
    }
);