import { inject, injectable } from "tsyringe"; import { TtnGatewayReception } from "../models/ttnGatewayReception"; import { TtnGatewayReceptionRepository } from "../repositories/ttnGatewayReceptionRepository"; @injectable() export class TtnGatewayReceptionService { constructor( @inject(TtnGatewayReceptionRepository) private repository: TtnGatewayReceptionRepository ) {} public async getAllGatewayReceptions() { return this.repository.findAll(); } public async getGatewayReceptionById(id: string) { return this.repository.findById(id); } public async createGatewayReception(data: Partial) { return this.repository.create(data); } public async createGatewayReceptions(data: Partial[]) { return this.repository.createMany(data); } public async updateGatewayReception( id: string, data: Partial ) { return this.repository.update(id, data); } public async deleteGatewayReception(id: string) { return this.repository.delete(id); } }