Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CatalogClient.courseExists(term, code) with mocked HTTP

Aperta
#13 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter
Ambito
backend, testing

Direzione di ricerca

Read the generated SDK entry point at packages/sdk_dart/lib/src/generated/catalog.dart and the app configuration in lib/config.dart, then implement the wrapper in lib/onboarding/course_lookup.dart. Add MockClient coverage in test/course_lookup_test.dart for the listed responses and query parameters; done means those tests pass without network access and errors map to unavailable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

onboarding

What to build

The app needs to ask the catalog whether a typed course exists in a term. Do not write HTTP or JSON parsing: the SDK already ships the generated client. package:devdogsuga_sdk/catalog.dart exports CatalogClient(baseUrl:, httpClient:, clientName:) with courseExists({required String abbr, TermCode? term}), returning CourseExists (exists, offered, abbr, term). Source: packages/sdk_dart/lib/src/generated/catalog.dart in DevDogsUGA/DevDogsUGA.

Build a thin app-side wrapper and test it:

  • class CourseLookup taking a CatalogClient, with Future<CourseCheck> check(int term, String code) where CourseCheck is exists, offered, or unavailable (the catalog is down or the request throws ApiException, which is the documented fallback: the database then checks only the format).
  • A provider (in lib/app.dart or a new file) that builds one CatalogClient from the CATALOG_URL define (.env.example already has it) with clientName: 'dogpack'.

Files

  • new lib/onboarding/course_lookup.dart
  • lib/config.dart (read CATALOG_URL; fall back to the SDK's catalogServers['production'])
  • new test/course_lookup_test.dart
  • pubspec.yaml and pubspec.lock: add http as a dev dependency (flutter pub add --dev http), because package:http/testing.dart is not otherwise a direct dependency and flutter analyze fails without it

Acceptance

  • Tests use package:http/testing.dart MockClient passed as httpClient; no network.
  • The test asserts the request path ends with /course-exists (the real base URL is .../catalog/v1, so the full path is /catalog/v1/course-exists) and that abbr and term are query parameters.
  • Covered: exists and offered; exists but not offered; unknown course; a 500 gives unavailable; a socket failure gives unavailable.
  • No handwritten JSON decoding in DogPack code.

How to check

flutter test test/course_lookup_test.dart.

Before you start

Setup is in first contribution. Run flutter analyze and flutter test before you open the PR; both must pass. Keep the change to the files listed. Comment on this issue to claim it.

Lingua principale
PLpgSQL
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DevDogsUGA/DogPack

Tutte le issue di DevDogsUGA/DogPack

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.