import { BaseAdapter } from '@humand-packages/common';
import { Knex } from 'knex';
import { Service } from 'typedi';
import { TimeTrackingCDCPort } from '../../../changeDataCapture/business/ports/timeTrackingCDCPort';
import { TimeTrackingCDCService } from '../../business/services/timeTrackingCDCService';

@Service()
export class TimeTrackingCDCAdapter extends BaseAdapter implements TimeTrackingCDCPort {
    constructor(private readonly timeTrackingCDCService: TimeTrackingCDCService) {
        super();
    }

    init = async (knexClient: Knex, clientId: string): Promise<void> => {
        await this.timeTrackingCDCService.init(knexClient, clientId);
    };

    stop = async (): Promise<void> => {
        await this.timeTrackingCDCService.stop();
    };
}
