All files / core/services PixService.ts

70% Statements 7/10
100% Branches 0/0
75% Functions 3/4
70% Lines 7/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  2x 2x     8x     1x       1x 1x             2x      
import { Pix } from "@/core/models/Pix";
import { PixRemote } from "@/infra/http/PixRemote";
 
export class PixService {
  public constructor(
    private readonly remote: PixRemote
  ) {}
 
  public async create(data: Pix): Promise<Pix> {
    const response = await this.remote.create(data);
    return response.data;
  }
 
  public async find(data?: Partial<Pix>): Promise<Array<Pix>> {
    const response = await this.remote.find(data);
    return (response.data as any).body;
  }

  public async findOne(PixId: number): Promise<Pix> {
    const response = await this.remote.findOne(PixId);
    return response.data;
  }
}