Change the profile the plan is computed from
update_profileUpdate the personal details (sex, birth year, birth month, height) that every health suggestion is derived from, so an incorrect profile is corrected before the plan is computed.
Instructions
Change who the record is about: sex, birth year, birth month, height in cm. Every suggestion is derived from them, so a wrong one makes the whole plan wrong. Setting a field the record does not hold yet is an add: send it on its own. CHANGING one the record already holds needs expected with the value you believe is there now, read from the record first — a mismatch refuses the call and writes nothing. This overwrites: the profile is one last-write-wins object with no earlier version to read back. Display preferences (units) are not yours to change. On the hosted server this takes two calls: the first answers with what it would do and a confirm receipt; show it to the user and call again with confirm and approval (the user’s own words, quoted verbatim) only after their own yes, in their own words.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sex | No | The sex the plan is computed for. | |
| confirm | No | Hosted server, second call only: the receipt the first call returned, after the user’s own yes. | |
| approval | No | ||
| expected | No | What you believe the record holds now, per field you are changing. `null` claims the field is unset. | |
| heightCm | No | Height in centimetres. | |
| birthYear | No | Year of birth, e.g. 1971. | |
| birthMonth | No | Month of birth, 1–12. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changed | Yes | Every field that moved. Empty when the record already said that. | |
| confirm | No | The receipt to send back, unchanged, after the user’s own yes. | |
| proposal | No | True on the first call of a two-phase write: nothing was written yet. | |
| confirmFrom | No | When the receipt becomes usable. Do not call before it. |