Skip to content

Build the service layer for all pet-related API calls to the PetChain NestJS backend. #63

@llinsss

Description

@llinsss

Context

This is a React Native mobile app written in TypeScript. The "backend" folder contains issues — actual implementation goes in src/. This is client-side code, not server-side.

File to Create

src/services/petService.ts

Requirements

  • getAllPets() — fetch all pets for the logged-in owner
  • getPetById(petId) — fetch a single pet by ID
  • getPetByQRCode(qrCode) — fetch pet using scanned QR code
  • createPet(data) — register a new pet
  • updatePet(petId, data) — update pet details
  • deletePet(petId) — remove a pet

Acceptance Criteria

  • All CRUD functions are implemented and typed
  • getPetByQRCode() works with QR scan data
  • Errors from the API are handled and surfaced correctly
  • All functions return typed Promise responses
  • Uses the shared API client (not a raw Axios call)

Tech Stack

  • TypeScript
  • Axios

Related Issues

Depends on: #1 (API Client), #3 (Pet Model)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions