import { Injectable } from '@angular/core';
import { GenericService } from '@iqser/common-ui';
import { IGeneralConfiguration } from '@red/domain';
import { Observable } from 'rxjs';

@Injectable({
    providedIn: 'root',
})
export class GeneralSettingsService extends GenericService<IGeneralConfiguration> {
    protected readonly _defaultModelPath = 'configuration';
    protected readonly _serviceName: string = 'tenant-user-management';

    getGeneralConfigurations(): Observable<IGeneralConfiguration> {
        return this._getOne(['general']);
    }

    updateGeneralConfigurations(body: IGeneralConfiguration) {
        return this._post<unknown>(body, `${this._defaultModelPath}/general`);
    }
}
