import { connect } from "mongoose";
import {
    PaginateCompaniesResults,
    SysAdminPaginateCompaniesParams,
    SysAdminUpdateCompanyParams,
    SysAdminSetCompanyBannedParams,
} from "../../../Models/Companies/Companies.Interface";
import CompaniesList from "../../../Models/Companies/Companies";

export class SA_CompaniesService {
    public async sysAdminPaginate(data: SysAdminPaginateCompaniesParams): Promise<PaginateCompaniesResults> {
        await connect(`${process.env.DATABASE_CONNECTION}`);
        return await CompaniesList.sysAdminPaginate(data);
    }

    public async sysAdminUpdate(data: SysAdminUpdateCompanyParams): Promise<void> {
        await connect(`${process.env.DATABASE_CONNECTION}`);
        return await CompaniesList.sysAdminUpdate(data);
    }

    public async sysAdminSetBanned(data: SysAdminSetCompanyBannedParams): Promise<void> {
        await connect(`${process.env.DATABASE_CONNECTION}`);
        return await CompaniesList.sysAdminSetBanned(data);
    }
}
