Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourGreen
titleAccurate

Code Block
languagejs
linenumberstrue
{
  "config": { // All clients listen here permanently
    "articleBaseUrl": "http://cloud-storage.com/articles/",
  },   "userslegalsUrl": {"http://impossible.am/legalstuff/",
    "user_id_01for7MW": {
// Clients listen here permanently
      "usernamefacebookPage": "user",
      "emailfacebookGroup": "user@somewhere.com",
      "fitnessLevelinstagramUser": 10"",
      "fitnessBiasfaqsUrl": 1,""
    },
    "createdforAfterburner": 987654345,{
// Unix timestamp (seconds)
      "maxImpactCreditfacebookPage": 3"",
      "impactCreditfacebookGroup": 0.9"",
      "updatedICinstagramUser": 987654345"",
// Unix timestamp (seconds)       "apnIdsfaqsUrl": []""
    }
  },
  "visibleWorkoutDefsusers": { //
Workout defs that are visible to the user
    "user_id_01": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "wktdef1username": {
 "user", // [default:null]
      "recommendedemail": "user@somewhere.com", // Not recommended, just visible
		"locked [default:null]
      "fitnessLevel": true10, 		"lockString": "Finish 6 more workouts in the next 6 days",
 // [default:10]
      "fitnessBias": 1, // [default:1]
      "MWIcreated": 0.54987654345, // Unix timestamp (seconds) [default:0]
      "breakdownmaxImpactCredit": {3,   // [default:0]
       "epocimpactCredit": 0.19,    // [default:0]
      "cardioupdatedIC": 0.1987654345, // Unix timestamp (seconds) [default:0]
      "metabolictriggersFired": 0.1,
    { "triggerId_01": true, "triggerId_02": true }, // [default:null]
      "strengthsessions": 0.1{
        }
      },"for7MW": 2, // [default:0]
        "wktdef2forAfterburner": {0 // [default:0]
      "recommended": "You need to work on your abs"},
      "totalActivities": 2, // Recommended[default:0]
and reason for this to be shown to user
		"locked": false,
		"lockString": "",
 "totalActivities7MW": 1, // [default:0]
      "MWItotalActivitiesAF": 0.541, // [default:0]
      "breakdownfirstActivity7MW": 987654345, {// Unix timestamp (seconds) [default:0]
      "epocfirstActivityAF": 0.1,
   987654345, // Unix timestamp (seconds) [default:0]
      "cardiotimedNotifSeqVersion": 0.1, // Version of timed notif sequence user is on  "metabolic": 0.1,(server use) [default:0]
          "strengthtestMode": 0.1
        }
 false, // Puts the app in 'test mode' for this user [default:false]
    }  "notifTokens": { // }APN tokens for },the user's devices "workouts": {[default:null]
        "activitiesfor7MW": {
      "userapn_id_01token": {true }, // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemovedWhere 'api_token' is the actual token string
        "forAfterburner": { "workoutapn_id_01token": { // Clients post new activity to here with auto id, server listens
          "workoutDefId": "wktdef1",
  true }
      }
    }
  },
  "visibles": {
       "finishworkoutDefs": 987654345,{ // UnixWorkout defs timestampthat (seconds)are visible to the user
      "exertionuser_id_01": 0.5,{ 
         "finalHeartRateBPMfor7MW": 160,{ // 7MW clients listen here permanently for ChildAdded, ChildChanged and "finalHeartRateDelay":ChildRemoved
0 // Length of delay (in secs) after the workout before the HR was measured (0 if they didn't press the 'start again' button)
        }
      }"wktdef1": {
            "recommended": "", // Not recommended, just visible // [default:null]
       },     "resultslocked": {true, // Not available to user  "user_id_01": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "workout_id_01": { // Server posts workout results here(unlocked via IAP and/or journey trigger) [default:false]
  	        "lockString": "Finish 6 more workouts before Thurs 9th June", // Displayed to user [default:null]
            "workoutDefIdMWI": "wktdef1",0.54, // [default:0.5]
            "finishbreakdown": 987654345,{
// Unix timestamp (seconds)           "AWIepoc": 0.1, // [default:0.25]
        "responseDuration": 3456,           "intensity"cardio": 0.91, // [default:0.25]
        "responses": {     "metabolic": 0.1, // [default:0.25]
    "cardio": {         "strength": 0.1 // [default:0.25]
  "stress": 43,         }
     "magnitudeProduct": 0.6,    },
          "halflifeProductwktdef2": 0.3,{
            "recommended": "You "duration": 5678,
 need to work on your abs", // Recommended and reason for this to be shown to user
            "volumelocked": 3456 false, // Available to user
            }"lockString": "",
            "strengthMWI": {
 0.54,
            "stressbreakdown": 43,{
              "magnitudeProductepoc": 0.61,
              "halflifeProductcardio": 0.31,
              "durationmetabolic": 56780.1,
              "volumestrength": 34560.1
            },
          }
 "epoc": {      },
        "stressforAfterburner": 43 { // Afterburner clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
           "magnitudeProductwktdef1": 0.6,
 {
            "halflifeProductrecommended": 0.3,
   "", // Not recommended, just visible
  	        "durationlocked": 5678false, // Available to user
  	        "volumelockString": "",
3456             }"MWI": 0.54,
            "metabolicbreakdown": {
              "stressepoc": 430.1,
              "magnitudeProductcardio": 0.61,
              "halflifeProductmetabolic": 0.31,
              "durationstrength": 5678,0.1
            }
 "volume": 3456        },
    }      "wktdef2":  {
  },           "muscleGroupsrecommended": {"You need to work on your abs", // Recommended and reason for this to be shown "upper": 0.3,to user
            "lowerlocked": 0.3,false, // Available to user
            "corelockString": 0.4"",
          }  "MWI": 0.54,
      }      "breakdown": }{
    }   },   "afterburn": {     "user_id_01": { // Clients listen here permanently"epoc": 0.1,
              "startcardio": 3456789870.1,
 //    Unix timestamp (seconds)       "responsemetabolic": { 0.1,
              "resolutionstrength": 600, // Secs0.1
          "epoc": [0.6,0.5,0.3,0.2,0.1,0.0],
 }
       "cardio": [0.6,0.5,0.3,0.2,0.1,0.0],   }
     "strength": [0.6,0.5,0.3,0.2,0.1,0.0],     }
   "metabolic": [0.6,0.5,0.3,0.2,0.1,0.0]  }
    },
 
    "impactCreditroutines": {
        "resolution"user_id_01": 600,{ //
Secs         "futureCreditfor7MW": 0.9,
        "pending": [0.0,0.1,0.2,0.3,0.4,0.5]
  { // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
   },       "messagesroutine_id_01": [ //{
Messages displayed below the radar chart
        {"tlocked":0,"body":"Restoring body temperature", "detail": ""}, true, // Not available to user (unlocked via IAP and/or journey trigger) [default:false]
            {"tlockString":120,"body":"Replenishing glycogen stores", "detail": "detail/glycogen"}
   "Finish 6 more workouts before Thurs 9th June" // Displayed to user [default:null]
   ],       "notifications": [},
          {"t":6000,"body":"Great workout! You're still burning calories and building strength."},"routine_id_02": {
            "locked": true,
         {   "tlockString":14400,"body ":"Fitness test// unlocked! You're ready to take another fitness test."}
No lock string, so only unlocked via IAP [default:null]
     ]     },
  },   "timelineArticles": {     "userroutine_id_0103": {
// Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved       "article_id_01"locked": false, {// Available
       "date": 4567890987, // Unix timestamp (seconds)
 "lockString": ""
       "title": "Post title", }
       "read": false},
        "locationforAfterburner": { "post/location.html"
      }// 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
    }   },   "definitionsroutine_id_03": {
	"version": 1,     "exerciseDefs      "locked": {false, // ClientsAvailable
listen here permanently for ChildAdded, ChildChanged and ChildRemoved       "exdef1lockString": {""
        "behaviour": 1, }
       "title": "Cruches", }
       }
"video": "01-Crunches.mp4",   }
  },
  "imageworkouts": {
    "absactivities",:  {
      "descuser_id_01": "A{ crunch// beginsClients withlisten lyinghere facepermanently upfor onChildAdded, theChildChanged floorand withChildRemoved
knees bent. The movement begins by curling the shoulders towards the pelvis. The hands can be behind or beside the neck or crossed over the chest. Injury can be caused by pushing against the head or neck with hands.", "workout_id_01": { // Clients post new activity to here with auto id, server listens
          "workoutDefId": "wktdef1", // [no default]
          "subtitlefinish": "Target your abs for a balanced set of stomach muscles.",987654345, // Unix timestamp (seconds) [default:0]
          "calPerSeciterations": 1.5, // Number of times it was performed  "skill": 0.2,[default:1]
          "strengthexertion": 0.75,         "cardio": 0.1,// [default:0.5]
          "epocfinalHeartRateBPM": 0.4160, // [default:140]
          "metabolicfinalHeartRateDelay": 0.4, // Length of delay (in secs) after  "upper": 0.5,
        "core": 0.5,
        "lower": 0.5
      },
      "exdef2": {
 the workout before the HR was measured (0 if they didn't press the 'start again' button) [default:0]
		  "app": "7MW" // Short code of the app the activity was performed in: 7MW, AF, etc [default:null]
        }
      "behaviour": 1,}
    },
    "titleresults": "Squats",{
        "video"user_id_01": "02-Squats.mp4",
        "image": "abs",{ // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "descworkout_id_01": "Squats{ are// anServer excellentposts exerciseworkout forresults traininghere
the lower body and core muscles, if done regularly they help to define thighs and buttocks.","workoutDefId": "wktdef1", // [no default]
          "subtitlefinish": "Train your lower body and core."987654345, // Unix timestamp (seconds) // [no default]
 "calPerSec": 4,         "skillAWI": 0.21,         "strength": 0.6,// [default:0.5]
          "cardioresponseDuration": 0.33456, // [default: 0]
     "epoc": 0.4,
        "metabolicintensity": 0.69,         "upper": 0.5,
        "core": 0.5,// [default:0.5]
		  "app": "7MW", // Short code of the app the activity was performed in: 7MW, AF, etc [no default]
          "lowerresponses": 0.5
  { // [no default]
    },        "exdef3cardio": {
              "behaviourstress": 143,
        "title": "Planks",         "videomagnitudeProduct": "03-Plank.mp4"0.6,
        "image      "halflifeProduct": "abs"0.3,
        "desc": "The plank helps you to build strength in your core, upper and lower body so its a good full body work out. You do not need any equipment to perform this exercise all you need is a bit of space, and it really helps improve flexibility by stretching muscles and will improve posture if performed regularly.","duration": 5678,
              "volume": 3456
            },
            "strength": {
              "subtitlestress": 43,
"Work  out your core muscles.",         "calPerSecmagnitudeProduct": 0.6,
              "skillhalflifeProduct": 0.3,
        "strength": 0.5,
        "cardioduration": 0.2,
   5678,
    "epoc": 0.4,         "metabolicvolume": 0.4,3456
        "upper": 0.5,     },
   "core": 0.5,         "lowerepoc": 0.5{
       },       "exdef4stress": 43,
{         "behaviour": 1,    "magnitudeProduct": 0.6,
   "title": "Push Ups",         "videohalflifeProduct": "04-PushUps.mp4"0.3,
        "image      "duration": "abs",5678,
              "descvolume": 3456
"The push up is a great muscle toning exercise for the arms, chest},
triceps and the front of the shoulders, whether performed on the knees or toes this is a good strength building exercise that can be performed anywhere.""metabolic": {
              "stress": 43,
        "subtitle": "Train your upper body.",      "magnitudeProduct": 0.6,
              "calPerSechalflifeProduct": 0.3,
        "skill      "duration": 0.1,5678,
              "strengthvolume": 0.8, 3456
            "cardio": 0.2,}
         "epoc": 0.6, },
          "metabolicmuscleGroups": 0.6,{
            "upper": 0.53, // [default: 0.3]
     "core": 0.5,
        "lower": 0.5
3, // [default: 0.3]
     },       "exdef5core": {
 0.4 // [default: 0.3]
      "behaviour": 1,   }
     "title": "Side Plank", }
      }
"video": "06-SidePlank.mp4",   }
  },
  "imageafterburn": "abs",{
    "user_id_01": { // Clients "desc": "The side plank helps you to build strength in your core, upper and lower body so its a good full body work out. It helps improve flexibility by stretching muscles and will improve posture if performed regularly.",
 listen here permanently
      "start": 345678987, // Unix timestamp (seconds) // [no default]
      "response": { // [default:null]
        "resolution": 600, // Secs
        "subtitle": "Target your abs for a balanced set of stomach muscles."epoc": [0.6,0.5,0.3,0.2,0.1,0.0],
        "calPerSeccardio": [0.6,0.5,0.3,0.2,0.1,0.0],
        "strength": [0.6,0.5,0.7,
        "cardio": 3,0.2,0.1,0.0],
        "epocmetabolic": [0.6,0.5,0.3,0.2,0.1,0.0]
        "metabolic": 0.5},
        "skillimpactCredit": 0.2,{ // [default:null]
        "upperresolution": 0.5600, // Secs
        "corefutureCredit": 0.59,
        "lowerpending": [0.0,0.1,0.2,0.3,0.4,0.5]
      },
      "exdef6messages": {[ // Messages displayed below the radar chart  "behaviour": 1,[default:null]
        {"t":0,"body":"Restoring body temperature", "titledetail": "Jumping Jacks"},
        "video{"t":120,"body":"Replenishing glycogen stores"33-JumpingJack.mp4", "detail": "detail/glycogen"}
      "image": "abs",
 ],
      "descnotifications": "Jumping[ Jacks are the original circuit training exercise that evenly targets your muscle groups to elicit a strong cardiovascular response."// [default:null]
        {"t":6000,"body":"Great workout! You're still burning calories and building strength."},
        "subtitle{"t":14400,"body": "GetFitness those heart muscles jumping!",
        "calPerSec": 6,test unlocked! You're ready to take another fitness test."}
      ]
 "strength": 0.1,  }
  },
   "cardiotimelineArticles": 0.8,
   {
    "metabolicuser_id_01": 0.6,
        "epoc": 0.6,{ // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "skill"article_id_01": 0.1,{
        "upperdate": 0.54567890987, // Unix timestamp (seconds) // [no default]
 "core": 0.5,
        "lowertitle": 0.5
   "Post title", // [no default]
  },
      "exdef7read": {false,   // [default:true]
        "behaviourlocation": 1"post/location.html", // [no       "titledefault]
		"icon": "Burpeesdefault", // [default:"default"]
        "videoappMask": "42-Burps.mp47MW,AF", // [default: all apps]
        "imagepromptRating": "abs",
 true // [default:false]
      "desc": "Burpees are a full body exercise which work virtually every muscle in the body, this means that you can burn more calories in a lot less time.",
 }
    }
  },
  "definitions": {
    "routines": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "subtitleroutine_id_01": "Burpees{
are tough but well worth your time.",  "title": "The Wonder Routine", // [no  "calPerSec": 6,default]
         "strengthimage": 0.2"wonder-routine", // [default:"default-routine"]
        "cardiodesc": 0.9,
"Big long description", // [default:null]
        "metabolicappStoreId7MW": 0.6"routine01", // StoreKit product      "epoc": 0.6,
id [default:null]
        "skillin7MW": 0.3true, // For server      "upper": 0.5,use [default:false]
         "coreinAfterburner": 0.5false, // For server use  [default:false]
  "lower      "lockedIn7MW": 0.5
      }false, // For server use [default:false]
      },     "workoutDefslockedInAfterburner": {false, // ClientsFor listenserver here permanently for ChildAdded, ChildChanged and ChildRemoveduse [default:false]
        "video": "",  "wktdef1": {// [default:null]
        "typeminFitnessLevel": 4, 1,// [default:1]
        "titleworkoutDefs": "Aerobic",
  { // [no default]
     "image": "abs",
        "descwktdef1": {
"Aerobic  Basic Movement",         "breakDurationtype": 51, // [default:1]
      "exercises": [     "title": "Aerobic", // [no default]
 {             "idimage": "exdef1abs", // [default:"default"]
            "durationdesc": 20"Aerobic Basic Movement", // [default:null]
      },      "breakDuration": 5, // // [default:10]
{             "idappStoreId7MW": "exdef2workout01", // StoreKit product      id [default:null]
   "duration": 15           }"locked": false, // For server use [default:false]
			"MWI": 0.54,    {// [default:0.5]
            "idexercises": "exdef3",
  [ // [no default]
         "duration": 10    {
      },           {
   "id": "exdef1", // [no default]
                "idduration": "exdef4",
  20 // [no default]
          "duration": 5   },
       },       {
   {             "id": "exdef5exdef2",
                "duration": 1015
          }    },
    ],         "adaptiveStress": {
          "strength": 0.2,     "id": "exdef3",
    "cardio": 0.9,           "metabolicduration": 0.6,10
          "epoc": 0.6   },
     },         "muscleStress": {{
                "upperid": 10"exdef4",
          "lower": 10,     "duration": 5
    "core": 10         },
      },       "wktdef2": {
 
      "type": 1,         "titleid": "Thai Boxingexdef5",
        "image": "abs",         "descduration": "Boxing With Kicking",10
        "breakDuration": 4,     }
   "exercises": [           {],
            "idadaptiveStress": "exdef5",{
              "durationstrength": 15
 0.2, // [default:1]
        },      "cardio": 0.9, // [default:1]
 {             "idmetabolic": "exdef3"0.6,   // [default:1]
         "duration": 10    "epoc": 0.6 // [default:1]
   },           {},
            "idmuscleStress": "exdef1",{
              "durationupper": 510, // [default:1]
        }         ]"lower": 10, // [default:1]
      "stress": {       "core": 10   "strength": 0.2,// [default:1]
           "cardio": 0.9, }
          "metabolic": 0.6,}
        }
  "epoc": 0.6   }
     },
   
    "muscleStressexerciseDefs": { // Clients listen here permanently      "upper": 10for ChildAdded, ChildChanged and ChildRemoved
       "lowerexdef1": 10,{
          "corebehaviour": 101,         }
      },// [default:1]
        "wktdef3title": {
        "type": 1,"Cruches", // [no default]
        "titlevideo": "Silat01-Crunches.mp4", // [no default]
        "image": "abs", // [default:"default"]
        "desc": "TraditionalA crunch Martialbegins Arts",with lying face up on the floor with  "breakDuration": 5,
        "exercises": [
          {
            "id": "exdef4",
   knees bent. The movement begins by curling the shoulders towards the pelvis. The hands can be behind or beside the neck or crossed over the chest. Injury can be caused by pushing against the head or neck with hands.", // [default:null]
        "durationsubtitle": 5"Target your abs for a balanced set of    }stomach muscles.", // [default:null]
        {
   "calPerSec": 5, // [default:0]
        "idskill": "exdef5"0.2,   // [default:0.5]
         "durationstrength": 10
 0.7, // [default:0.5]
        }
        ],"cardio": 0.1, // [default:0.5]
        "adaptiveStressepoc": {
 0.4, // [default:0.5]
        "strengthmetabolic": 0.24, // [default:0.5]
        "cardioupper": 0.95, // [default:0.5]
        "metaboliccore": 0.65, // [default:0.5]
        "epoclower": 0.65, // [default:0.5]
      },  "needsHalfwaySwap": false // [default:false]
   "muscleStress": {    },
      "upperexdef2": 10,
{
         "lowerbehaviour": 101,

         "coretitle": 10"Squats",
        }
"video": "02-Squats.mp4",
     },   "image": "abs",
  "wktdef4      "desc": {
        "type": 1,
        "title": "OCD"Squats are an excellent exercise for training the lower body and core muscles, if done regularly they help to define thighs and buttocks.",
        "imagesubtitle": "absTrain your lower body and core.",
        "desccalPerSec": "Modern Exercise"4,
        "breakDurationskill": 60.2,
        "exercisesstrength": [0.6,
        "cardio": 0.3,
{        "epoc": 0.4,
        "idmetabolic": "exdef3",
  0.6,
         "durationupper": 200.5,
          }"core": 0.5,
        "lower": 0.5,
{        "needsHalfwaySwap": true
   "id": "exdef2",  }
    },
     "durationjourneyTriggers": 15{
      "forAfterburner": {
  },           "trigger01": {
            "idcategory": "exdef4achievement",
            "durationtriggerType": 5"activeDaysInWeeks",
          }
     "condition1": 4, // 4 active days
  ],         "adaptiveStresscondition2": {8, // every week for 8 weeks
    "strength": 0.2,
          "cardioactions": 0.9, [
            "metabolic": 0.6,
          "epoc": 0.6
 {"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
      },         "muscleStress": {{"actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
          ]
     "upper": 10,  },
        "lowertrigger02": 10,{
          "corecategory": 10"education",
        }  "triggerType": "totalActivities",
   },       "wktdef5condition1": {10, // 10 activities
          "typecondition2": 10, // Not used
      "title    "actions": "Warming Up",[
            "image{"actionType":"postArticle","articleId": "abs",article_id_01","data":"e.g. url parameters"}
          ]
 "desc": "Basic",      }
  "breakDuration": 5,    },
      "exercisesfor7MW": [{
        "trigger01":  {
            "idcategory": "exdef2achievement",
            "durationtriggerType": 20"activeDaysInWeeks",
          },
    "condition1": 4, // 4 active days
     {     "condition2": 8, // every week for 8  "id": "exdef2",weeks
             "durationactions": 15[
          }  {"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url  parameters"},
   ],         {"adaptiveStress": {
          "strength": 0.2,
          "cardio": 0.9,
          "metabolic": 0.6,actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
          ]
"epoc": 0.6         },
        "muscleStresstrigger02": {
          "uppercategory": 10"education",
          "lowertriggerType": 10"totalActivities",
          "corecondition1": 10, // 10 activities
     }     "condition2": 0, },// Not used
    "wktdef6": {     "actions": [
  "type": 1,         "title{"actionType":"postArticle","articleId": "6 Min Strength",
 "article_id_01","data":"e.g. url parameters"}
      "image": "abs",   ]
     "desc": "Quick workout that}
targets strength building, increasing your restimng metabilic}
rate.",    }
    "breakDurationtimedNotifs": 5,{
        "exercisesforAfterburner": [{
         "notif01": {
            "iddeltaHours": "exdef1"24, // Delta after APN token reg that the notif is delivered  "duration": 55[no default]
          "seqVersion": }0, // Sequence version to allow future updates without flooding existing {
 users [default:0]
          "idtitle": "exdef4Title of notification", // [default:""]
          "durationbody": 55
   "Body of notification" // [no default]
        },
      },
   {   "for7MW": {
        "idnotif01": "exdef5",{
            "durationdeltaHours": 5524, 
         },           {
"seqVersion": 0, 
          "idtitle": "exdef1Title of notification",
 
          "durationbody": 55"Body of notification"
        },
      }
   { }
  },
  "receipts": {
    "user_id_01": "exdef4", {
      "receipt_auto_id_01": {
        "durationreceipt": 55
          },"receipt_data", // Written by the client after an IAP purchase
            "validation": { // Written by the server after the receipt has    "id": "exdef5",been processed
            "durationvalidationDate": 553456789, //          }Timestamp [default:0]
         ],         "adaptiveStress"isValid": { true [default:false]
        }
 "strength": 0.2,    }
    }
 "cardio": 0.9,
          "metabolic": 0.6,
          "epoc": 0.6
        },
        "muscleStress": {
          "upper": 10,
          "lower": 10,
          "core": 10
        }
      },
      "wktdef7": {
        "type": 1,
        "title": "6 Min Cardio",
        "image": "abs",
        "desc": "Short workout that pushes your cardiovascular system to burn fat now and for the next 24 hours.",
        "breakDuration": 5,
        "exercises": [
          {
            "id": "exdef6",
            "duration": 55
          },
          {
            "id": "exdef7",
            "duration": 55
          },
          {
            "id": "exdef6",
            "duration": 55
          },
          {
            "id": "exdef7",
            "duration": 55
          },
          {
            "id": "exdef6",
            "duration": 55
          },
          {
            "id": "exdef7",
            "duration": 55
          }
        ],
        "adaptiveStress": {
          "strength": 0.2,
          "cardio": 0.9,
          "metabolic": 0.6,
          "epoc": 0.6
        },
        "muscleStress": {
          "upper": 10,
          "lower": 10,
          "core": 10
        }
      },
      "wktdef8": {
        "type": 1,
        "title": "2 Min Cardio Blast",
        "image": "abs",
        "desc": "Short workout that pushes your cardiovascular system to burn fat now and for the next 24 hours.",
        "breakDuration": 5,
        "exercises": [
          {
            "id": "exdef6",
            "duration": 55
          },
          {
            "id": "exdef7",
            "duration": 55
          }
        ],
        "adaptiveStress": {
          "strength": 0.2,
          "cardio": 0.9,
          "metabolic": 0.6,
          "epoc": 0.6
        },
        "muscleStress": {
          "upper": 10,
          "lower": 10,
          "core": 10
        }
      },
      "wktdef9": {
        "type": 1,
        "title": "2 Min Cardio Blast 2x",
        "image": "abs",
        "desc": "Short workout that pushes your cardiovascular system to burn fat now and for the next 24 hours.",
        "breakDuration": 5,
        "exercises": [
          {
            "id": "exdef6",
            "duration": 55
          },
          {
            "id": "exdef7",
            "duration": 55
          }
        ],
        "adaptiveStress": {
          "strength": 0.2,
          "cardio": 0.9,
          "metabolic": 0.6,
          "epoc": 0.6
        },
        "muscleStress": {
          "upper": 10,
          "lower": 10,
          "core": 10
        }
      }
    }
  }
} },
}

Client-Side Data Validation & Error Handling

We apply the following process to validate data on the client and to handle the errors appropriately:

SituationActions
  • Property is missing or is wrong type
  • Property has a default defined in the model schema.
  • Log error to crashlytics.
  • Handle silently and apply default value.
  • Property is missing or is wrong type
  • Property doesn't have a default defined.
  • Log error to crashlytics.
  • Throw exception (catch the exception according to object-specific rules, see below).
  • Entire object is missing
  • Log error to crashlytics.
  • Throw exception (catch the exception according to object-specific rules, see below).

Data Validation Exception Handling

EntityChecksAction
visibleWorkoutDef
  • Missing properties without defaults.
  • Missing or invalid workout definition.
Hide from user.
exerciseDefinition
  • Missing properties without defaults.
Tell user via alert view.
timelineArticle
  • Missing properties without defaults.
Hide from user.
activity
  • Missing properties without defaults.
Tell user via alert view.
result
  • Missing properties without defaults.
Tell user via alert view.
afterburn
  • Missing properties without defaults.
Tell user via alert view.
userN/A (all properties have defaults)None