New JuneDevelopers
Core concepts

Data model

How rounds, scores, shots, reports, priorities, plans, evaluations, focus sets, and clubs connect, and which id field links each pair.

View .md

Your data has two halves. The round half is what happened on the course: rounds, the score on each hole, and each shot. The practice half is what New June made of it: a report after each round, the priorities those reports point to, a plan for each priority, and an evaluation of each active plan after every round.

New June data model: hole scores and shots point to a round; a report points to a round; priorities point to reports; plans point to a priority; evaluations point to a plan and a round; focus sets point to plans; shots name a club.round_idround_idclubround_idlast_seen_report_idpriority_idprimary_plan_id, secondary_plan_idsplan_idround_idhole_scoreroundshotclubreportpriorityplanfocus_setevaluationNew June data model: hole scores and shots point to a round; a report points to a round; priorities point to reports; plans point to a priority; evaluations point to a plan and a round; focus sets point to plans; shots name a club.round_idround_idclubround_idlast_seen_report_idpriority_idplan idsplan_idround_idhole_scoreshotroundclubreportpriorityplanfocus_setevaluation
Arrows point from the object that holds the id field to the object it names. The dashed arrow is a value match (shot.club equals club.club), not an id.

The objects

ObjectWhat it isLinks
roundOne round of golf, scheduled, in progress, or finished. Carries totals (total_strokes, par_total, score_to_par), the course, and the tee.The root. Other objects point to it with round_id.
hole_scoreYour score on one hole: strokes, putts, penalties, fairway, green in regulation, par, and yardage.round_id
shotOne shot: club, lie, what you planned, what happened, and where it started and finished.round_id, plus hole_number and sequence_number for its place in the round. club matches club.club.
reportThe analysis of one round: a headline, the written analysis, per-hole notes, and the areas to work on. One per round.round_id
priorityA lasting area of your game that reports keep pointing to, such as lag putting.first_seen_report_id, last_seen_report_id
planA practice plan for one priority, with ordered steps and one graduation criterion.priority_id, created_from_report_id
evaluationHow one plan went in one round: open, partial, or complete, with a confidence.plan_id, round_id, report_id
focus_setThe lineup of plans in use for a period: one primary plan and up to two secondary plans.primary_plan_id, secondary_plan_ids, source_report_id
clubA club in your bag, with your typical carry and total distance.Matched to shots by the club value, not by id.

How the practice loop works

  1. You play a round. Hole scores and shots are recorded against it.
  2. After the round, New June produces a report. Its priorities list names the areas to work on, most important first.
  3. Areas that keep coming up become durable priorities. first_seen_report_id and last_seen_report_id show when a priority first appeared and when a report last raised it.
  4. A priority gets a plan: practice steps (milestones such as a drill) and one criterion (what counts as done, measured from your rounds).
  5. After every later round, New June writes an evaluation for each active plan. status says how far the plan got in that round: open (not met yet), partial, or complete.
  6. The focus set names the plans you are working on right now. GET /v1/focus_sets/current returns it.

Steps never graduate a plan

Marking every step done does not finish a plan. Only the criterion does: a plan becomes graduated when your rounds meet its criterion, as recorded in its evaluations. Steps are milestones on the way.

Relationships are query filters, never nested paths. To go from one object to its related objects, filter the related collection by the id:

You haveYou wantRequest
A roundIts hole scoresGET /v1/hole_scores?round_id=<round.id>
A roundIts shots, in playing orderGET /v1/shots?round_id=<round.id>
A roundIts reportGET /v1/reports?round_id=<round.id>
A roundThe evaluations made after itGET /v1/evaluations?round_id=<round.id>
A priorityIts plansGET /v1/plans?priority_id=<priority.id>
A planIts evaluations, newest firstGET /v1/evaluations?plan_id=<plan.id>
A planIts priorityGET /v1/priorities/<plan.priority_id>
A focus setIts plansGET /v1/plans/<id> for primary_plan_id and each of secondary_plan_ids

There is no expand parameter. Fetch related objects with a second request, and cache what you can: priorities, plans, and clubs change far less often than rounds.

Ids

Every object has an id (a UUID) and an object field naming its type. Ids are stable: an object keeps its id for its whole life. A field that names another object ends in _id and holds that object's id. The round's id is always called round_id.