Purpose
Read a CSV of classroom IDs and student IDs, authenticate to the APEX Learning API, and post enrollment payloads in batches by classroom.
Current state
Last touched: 2024-06-06. Functionality and completeness: Core enrollment flow is implemented; documentation and guardrails are minimal.
Next step
Add baseline automated tests to cover critical flows; Add CI pipeline for build/test/lint; Document deployment/runtime environment (or add Dockerfile); Document interfaces (CLI flags, API endpoints, file formats); Add structured logging and basic health checks.
Interfaces
Inputs- config.toml, CSV input file, APEX Learning API
- Configuration files (TOML/YAML/JSON/INI/CONF)
- CSV files
Outputs- Enrollment API calls, error_log.csv
- CSV files
Reality to Action trace
Reality IngestionNot in scope.
Canonical StorageNot in scope.
Automation EnginesNot in scope.
Human InterfacesContributes in this stage.
Operational AdoptionContributes in this stage.
Core workflow
TBD. Document the 5-10 steps that define the core workflow.
Artifacts
- CSV columns `ClassroomName`, `StudentId`; JSON payload includes studentUsers with ImportUserId and ImportOrgId
Operational notes
Constraints and scars
- Prints the access token to stdout and lacks rate-limit/backoff handling; large CSVs may trigger API throttling.
Reliability posture
Failure modes and safe behavior: Non-success responses are logged unless the API reports "Enrollment already exists". Idempotency / retries / batching behavior: No retries; re-runs can attempt duplicate enrollments but are ignored if the API reports they already exist.
Observability
- Metrics/health checks: None documented
- Logs: stdout/stderr plus error_log.csv for API failures.
Security and privacy
Config includes client_secret; protect config files and avoid printing tokens in shared logs. error_log.csv may include sensitive enrollment errors; store with restricted access.
Dependencies
Upstream- APEX Learning API (token + classrooms enrollments)
Ownership
OwnersJosh Barton
UsersJosh Barton (owner)
APEXLearningAPI
Architecture & Major Components
High-level diagram (text):
- Entry/trigger -> core logic -> outputs (details per docs below)
Entry/trigger
→core logic
→outputs
Entry points: src/main.rs
Top-level folders: src
src/ submodules: None (single-file implementation)
Key abstractions: token fetch, CSV grouping, per-classroom async tasks, error logging to CSV
Setup / Build / Run
- Build system(s): Cargo.
- Requires a config.toml and CSV file path configured before running.