import CardRepository from '../repository/CardRepository'

export default class {

    constructor(
        private cardRepository : CardRepository
    ) {}

    async getAll() {
        return await this.cardRepository.get();
    }

    async create(card : any) {
        return await this.cardRepository.create(card);
    }

    async update(card: any) {
        return await this.cardRepository.update(card);
    }

    async delete(id: any) {
        return await this.cardRepository.delete(id);
    }

    async get(id : any) {
        return await this.cardRepository.getFirst({_id : id});
    }
}
