import { BaseAdapter } from '@humand-packages/common';
import { Service } from 'typedi';
import { PortsDI } from '../../../../config/portsDI';
import { FacialRecognitionKioskData, FacialRecognitionKioskPort } from '../../../facialRecognition/business/ports/facialRecognitionKioskPort';
import { TimeTrackingKioskPort } from '../../business/ports/timeTrackingKioskPort';

@Service()
export class FacialRecognitionKioskAdapter extends BaseAdapter implements FacialRecognitionKioskPort {
    constructor(@PortsDI(TimeTrackingKioskPort) private readonly kioskService: TimeTrackingKioskPort) {
        super();
    }

    async getByBotAppId(botAppId: number, instanceId: number): Promise<FacialRecognitionKioskData | null> {
        const kiosk = await this.kioskService.getByBotAppId(botAppId, instanceId);
        if (!kiosk) return null;
        return { faceRecognitionEnabled: kiosk.faceRecognitionEnabled };
    }
}
