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", // [default:null]
Not recommended, just visible 		"locked": true, 		"lockStringfitnessLevel": "Finish 6 more workouts before Thurs 9th June",10, // [default:10]
         "MWIfitnessBias": 0.541, // [default:1]
      "breakdowncreated": 987654345, {// Unix timestamp (seconds) [default:0]
      "epocmaxImpactCredit": 0.13, // [default:0]
        "cardioimpactCredit": 0.19,    // [default:0]
      "metabolicupdatedIC": 0.1987654345, // Unix timestamp (seconds) [default:0]
      "strengthtriggersFired": 0.1
        }
 { "triggerId_01": true, "triggerId_02": true }, // [default:null]
    },       "wktdef2sessions": {
        "recommendedfor7MW": "You need to work on your abs"2, // Recommended[default:0]
and reason for this to be shown to user 		"lockedforAfterburner": 0 false,
		"lockString": "",
 // [default:0]
      },
      "MWItotalActivities": 0.542, // [default:0]
      "breakdowntotalActivities7MW": {1, // [default:0]
        "epoctotalActivitiesAF": 0.1, // [default:0]
        "cardiofirstActivity7MW": 0.1987654345, // Unix timestamp (seconds) [default:0]
      "metabolicfirstActivityAF": 0.1,
   987654345, // Unix timestamp (seconds) [default:0]
      "strengthtimedNotifSeqVersion": 0.1, // Version of timed notif sequence user is }on (server   use) [default:0]
  }     }
  },
  "workouts": {
    "activities": {"testMode": false, // Puts the app in 'test mode' for this user [default:false]
       "user_id_01notifTokens": { // ClientsAPN listentokens herefor permanentlythe for ChildAdded, ChildChanged and ChildRemoveduser's devices [default:null]
        "for7MW": { "workoutapn_id_01token": {true }, // Clients post new activity to here with auto id, server listens
 Where 'api_token' is the actual token string
        "workoutDefIdforAfterburner": { "wktdef1apn_token",: true }
      }
 "finish": 987654345, // Unix}
timestamp (seconds) },
  "visibles":  {
    "exertionworkoutDefs": 0.5,
   { // Workout defs that are visible to the user
      "finalHeartRateBPMuser_id_01": 160,{ 
         "finalHeartRateDelayfor7MW": 0{ // Length7MW ofclients delaylisten (inhere secs)permanently afterfor theChildAdded, workoutChildChanged beforeand theChildRemoved
HR was measured (0 if they didn't press the 'start again' button) "wktdef1": {
        }    "recommended": "", // }Not recommended, just visible  },// [default:null]
    "results": {       "user_id_01locked": {true, // ClientsNot listenavailable hereto permanentlyuser for(unlocked ChildAdded,via ChildChangedIAP and ChildRemoved/or journey trigger) [default:false]
  	        "workout_id_01lockString": { "Finish 6 more workouts before Thurs 9th June", // ServerDisplayed to posts workout results hereuser [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,
 {
            "durationrecommended": 5678,"You need to work on your abs", // Recommended and reason for this to  "volume": 3456be shown to user
            "locked": }false, // Available to user
            "strengthlockString": {"",
              "stressMWI": 430.54,
              "magnitudeProductbreakdown": 0.6,{
              "halflifeProductepoc": 0.31,
              "durationcardio": 56780.1,
              "volumemetabolic": 34560.1,
            },  "strength": 0.1
         "epoc": {  }
          }
 "stress": 43,      },
        "magnitudeProductforAfterburner": 0.6,
      { // Afterburner clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
          "halflifeProductwktdef1": 0.3,{
              "durationrecommended": 5678"", // Not recommended, just visible
  	        "volumelocked": 3456
 false, // Available to user
  	        }"lockString": "",
            "metabolicMWI": {0.54,
              "stressbreakdown": 43,{
              "magnitudeProductepoc": 0.61,
              "halflifeProductcardio": 0.31,
              "durationmetabolic": 56780.1,
              "volumestrength": 34560.1
            }
          },
          "muscleGroupswktdef2": {
            "upperrecommended": 0.3,
            "lower": 0.3,"You need to work on your abs", // Recommended and reason for this to be shown to user
            "corelocked": 0.4
   false, // Available to user
      }      "lockString": "",
 }       }     }"MWI": 0.54,
   },   "afterburn": {     "user_id_01breakdown": {
   // Clients listen here permanently       "startepoc": 3456789870.1,
  // Unix timestamp (seconds)       "response  "cardio": { 0.1,
              "resolutionmetabolic": 6000.1,
  //   Secs         "epocstrength": [0.6,0.5,0.3,0.2,0.1,0.0],1
            }
"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]  }
    },
    "routines": {
   "impactCredit   "user_id_01": { 
        "resolutionfor7MW": 600,{ // Secs7MW clients listen here permanently for ChildAdded, ChildChanged  "futureCredit": 0.9,and ChildRemoved
          "pending": [0.0,0.1,0.2,0.3,0.4,0.5]routine_id_01": {
      },       "messageslocked": [true, // Messages displayed below the radar chartNot available to user (unlocked via IAP and/or journey trigger) [default:false]
         {"t":0,"body":"Restoring body temperature", "detaillockString": ""},Finish 6 more workouts before Thurs 9th June"  {"t":120,"body":"Replenishing glycogen stores", "detail": "detail/glycogen"}// Displayed to user [default:null]
          ]},
          "notificationsroutine_id_02": [{
            {"tlocked":6000,"body":"Great workout! You're still burning calories and building strength."},
 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": {
        "date": 4567890987false, // UnixAvailable
  timestamp (seconds)         "titlelockString": "Post title",
        "read": false, }
       "location": "post/location.html",
		"icon": "default"
      }
    }
  },
  "journeyTriggers: {
	"trigger01 },
        "forAfterburner": { // 7MW clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
          "routine_id_03": {
	    "category": "achievement", 	  "triggerType": "activitiesInDays", 	  "triggerValAlocked": 7false, // 7Available
 activities 	  "triggerValB": 7, // in 7 days 	  "actionslockString": [ 		{"action":"post","itemId":"articleId","data":"e.g.
url parameters"}, 		{"action":"unlock","itemId":"workoutDefId","data":""} 	}, 	"trigger02": { 	  "category": "education", 	}
 "triggerType": "totalActivities", 	  "triggerValA": 10, // 10}
activities 	  "triggerValB": 0, // Not used}
	  "actions": [ 		{"action":"post","itemId":"articleId","data":"e.g. url parameters"}
	}
  },
  "definitionsworkouts": {
	"version    "activities": 1,{
      "exerciseDefsuser_id_01": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "exdef1workout_id_01": { // Clients post new activity to here with "behaviour": 1auto id, server listens
          "titleworkoutDefId": "Crucheswktdef1", // [no default]
          "videofinish": "01-Crunches.mp4"987654345, // Unix timestamp      "image": "abs",(seconds) [default:0]
          "desciterations": "A crunch begins with lying face up on the floor with 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.",
        "subtitle": "Target your abs for a balanced set of stomach muscles.",
        "calPerSec": 5,
        "skill": 0.2,
        "strength": 0.7,
 1.5, // Number of times it was performed [default:1]
          "exertion": 0.5, // [default:0.5]
          "finalHeartRateBPM": 160, // [default:140]
          "finalHeartRateDelay": 0, // Length of delay (in secs) after 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]
        }
      "cardio": 0.1,}
    },
    "epocresults": 0.4,{
        "metabolic"user_id_01": 0.4,
        "upper": 0.5,{ // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "coreworkout_id_01": 0.5,{ // Server posts workout results here
          "lowerworkoutDefId": 0.5
  "wktdef1", // [no default]
   },       "exdef2finish": {987654345, // Unix timestamp (seconds) // [no default]
 "behaviour": 1,         "titleAWI": "Squats"0.1, // [default:0.5]
      "video":    "02-Squats.mp4"responseDuration": 3456, // [default: 0]
          "imageintensity": "abs"0.9, //      [default:0.5]
		  "descapp": "Squats are an excellent exercise for training7MW", // Short code of the app the loweractivity bodywas andperformed corein: muscles7MW, ifAF, doneetc regularly[no theydefault]
help to define thighs and buttocks.",      "responses": {  "subtitle": "Train your lower body and core.",
// [no default]
            "calPerSeccardio": 4,{
              "skillstress": 0.2,43,
              "strengthmagnitudeProduct": 0.6,
        "cardio      "halflifeProduct": 0.3,
        "epoc      "duration": 0.45678,
         "metabolic": 0.6,    "volume": 3456
   "upper": 0.5,        },
"core": 0.5,           "lowerstrength": 0.5{
       },       "exdef3stress": { 43,
              "behaviourmagnitudeProduct": 10.6,
        "title": "Planks",
        "videohalflifeProduct": "03-Plank.mp4"0.3,
        "image      "duration": "abs"5678,
        "desc      "volume": "The3456
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.",  "epoc": {
              "stress": 43,
              "magnitudeProduct": 0.6,
              "subtitlehalflifeProduct": "Work out your core muscles.",0.3,
              "calPerSecduration": 65678,
        "skill": 0.3,     "volume": 3456
  "strength": 0.5,         "cardio": 0.2},
        "epoc": 0.4,   "metabolic": {
    "metabolic": 0.4,         "upperstress": 0.543,
              "coremagnitudeProduct": 0.56,
              "lowerhalflifeProduct": 0.53,
       },       "exdef4duration": {5678,
              "behaviourvolume": 3456
  1,         "title": "Push Ups", }
         "video": "04-PushUps.mp4" },
          "imagemuscleGroups": "abs",{
            "descupper": "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.",
  0.3, // [default: 0.3]
            "lower": 0.3, // [default: 0.3]
            "core": 0.4 // [default: 0.3]
     "subtitle": "Train your upper body.", }
       "calPerSec": 3, }
      }
 "skill": 0.1,  }
  },
   "strengthafterburn": 0.8,{
    "user_id_01": { // Clients "cardio": 0.2,
listen here permanently
       "epocstart": 0.6345678987, // Unix timestamp (seconds) // [no default]
 "metabolic": 0.6,    "response": {    "upper": 0.5,// [default:null]
        "coreresolution": 0.5,
600, // Secs
        "lowerepoc": [0.5
      }6,0.5,0.3,0.2,0.1,0.0],
      "exdef5": {         "behaviour"cardio": [0.6,0.5,0.3,0.2,0.1,0.0],
        "titlestrength": "Side Plank"[0.6,0.5,0.3,0.2,0.1,0.0],
        "videometabolic": "06-SidePlank.mp4",[0.6,0.5,0.3,0.2,0.1,0.0]
      },
      "imageimpactCredit": "abs", { // [default:null]
        "descresolution": "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.",
        "subtitle": "Target your abs for a balanced set of stomach muscles.",
        "calPerSec": 5600, // Secs
        "futureCredit": 0.9,
        "pending": [0.0,0.1,0.2,0.3,0.4,0.5]
      },
      "messages": [ // Messages displayed below the radar chart [default:null]
        {"t":0,"body":"Restoring body temperature", "detail": ""},
        {"strengtht": 0.7,
        "cardio": 0.2,120,"body":"Replenishing glycogen stores", "detail": "detail/glycogen"}
        "epoc": 0.5,
],
       "metabolicnotifications": 0.5, [ // [default:null]
        {"skillt": 0.2,
        "upper": 0.56000,"body":"Great workout! You're still burning calories and building strength."},
        {"coret": 0.5,
        "lower": 0.5
 14400,"body":"Fitness test unlocked! You're ready to take another fitness test."}
      ]
    },
   },
  "exdef6timelineArticles": {
    "user_id_01": { // Clients listen here permanently "behaviour": 1,
 for ChildAdded, ChildChanged and ChildRemoved
      "titlearticle_id_01": "Jumping Jacks",
{
        "videodate": "33-JumpingJack.mp4"4567890987, // Unix timestamp (seconds) // [no default]
 "image": "abs",
        "desctitle": "JumpingPost Jacks are the original circuit training exercise that evenly targets your muscle groups to elicit a strong cardiovascular response.",
  title", // [no default]
        "read": false, // [default:true]
        "subtitlelocation": "Get those heart muscles jumping!post/location.html", // [no default]
		"icon": "default",    "calPerSec": 6,// [default:"default"]
        "appMask": "strength": 0.1,7MW,AF", // [default: all apps]
        "cardiopromptRating": 0.8,
 true // [default:false]
      }
"metabolic": 0.6,   }
  },
  "epocdefinitions": 0.6,{
        "skill": 0.1,
        "upper": 0.5,"routines": { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
        "core"routine_id_01": 0.5,{
        "lowertitle": 0.5"The Wonder Routine", // [no default]
 },       "exdef7image": {"wonder-routine", // [default:"default-routine"]
        "behaviourdesc": 1"Big long description", // [default:null]
        "titleappStoreId7MW": "Burpeesroutine01", // StoreKit product id [default:null]
        "videoin7MW": "42-Burps.mp4"true, // For server use [default:false]
        "imageinAfterburner": "abs"false, // For server use [default:false]
        "desclockedIn7MW": "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.",
        "subtitle": "Burpees are tough but well worth your time.",
        "calPerSec": 6,false, // For server use [default:false]
        "lockedInAfterburner": false, // For server use [default:false]
        "video": "", // [default:null]
        "minFitnessLevel": 4, // [default:1]
        "strengthworkoutDefs": 0.2, { // [no default]
          "cardiowktdef1": {
0.9,         "metabolic   "type": 0.61, // [default:1]
      "epoc": 0.6,         "skilltitle": 0.3"Aerobic", // [no default]
     "upper": 0.5,      "image": "abs", // [default:"core": 0.5,default"]
            "lowerdesc": 0.5"Aerobic Basic Movement", // [default:null]
  }     },     "workoutDefsbreakDuration": {5, // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved// [default:10]
            "wktdef1appStoreId7MW": {
    "workout01", // StoreKit product id [default:null]
   "type": 1,
        "titlelocked": "Aerobic"false, // For server use     "image[default:false]
			"MWI": "abs"0.54, // [default:0.5]
      "desc": "Aerobic Basic Movement",
        "breakDurationexercises": 5,
		"appStoreId: "workout01",[ // [no default]
        "exercises": [      {
    {             "id": "exdef1", // [no default]
                "duration": 20 // [no default]
              },
              {
                "id": "exdef2",
                "duration": 15
              },
              {
                "id": "exdef3",
                "duration": 10
              },
              {
                "id": "exdef4",
                "duration": 5
          },    },
      {        {
                "id": "exdef5",
                "duration": 10
              }
            ],
            "adaptiveStress": {
              "strength": 0.2, // [default:1]
              "cardio": 0.9, // [default:1]
              "metabolic": 0.6, // [default:1]
              "epoc": 0.6 // [default:1]
            },
            "muscleStress": {
              "upper": 10, // [default:1]
              "lower": 10, // [default:1]
              "core": 10 // [default:1]
            }
          },
      "wktdef2": { }
      }
"type": 1,   },
     "titleexerciseDefs": "Thai Boxing",
 { // Clients listen here permanently for ChildAdded, ChildChanged and ChildRemoved
      "imageexdef1": "abs",{
        "descbehaviour": "Boxing With Kicking",1, // [default:1]
        "breakDurationtitle": 4,
		"appStoreId: "workout02"Cruches",         "exercises": [
// [no default]
         {
  "video": "01-Crunches.mp4", // [no default]
         "idimage": "exdef5abs", // [default:"default"]
          "durationdesc": 15"A crunch begins with lying face up on the floor with },knees bent. The movement begins by curling the shoulders towards the {pelvis. The hands can be behind or beside the neck or crossed over "id": "exdef3",
            "duration": 10
the chest. Injury can be caused by pushing against the head or neck with hands.", // [default:null]
         },
          {
   "subtitle": "Target your abs for a balanced set of stomach muscles.", // [default:null]
        "idcalPerSec": "exdef1"5,    // [default:0]
        "durationskill": 5
 0.2, // [default:0.5]
        }
        ],"strength": 0.7, // [default:0.5]
        "stresscardio": {
 0.1, // [default:0.5]
        "strengthepoc": 0.24, // [default:0.5]
        "cardiometabolic": 0.94, // [default:0.5]
        "metabolicupper": 0.65, // [default:0.5]
        "epoccore": 0.6
5, // [default:0.5]
       },
        "muscleStress"lower": {
 0.5, // [default:0.5]
        "upperneedsHalfwaySwap": 10,false // [default:false]
        "lower": 10,
 },
        "coreexdef2": 10{
        }
      },
      "wktdef3"behaviour": {1,
        "typetitle": 1"Squats",
        "titlevideo": "Silat02-Squats.mp4",
        "image": "abs",
        "desc": "TraditionalSquats Martialare Arts",an excellent exercise for training the lower body and "breakDuration": 5,
		"appStoreId: "workout03"core muscles, if done regularly they help to define thighs and buttocks.",
        "exercisessubtitle": ["Train your lower body and core.",
     {   "calPerSec": 4,
        "idskill": "exdef4",
   0.2,
        "durationstrength": 50.6,
          }"cardio": 0.3,
        "epoc": 0.4,
{          "metabolic": 0.6,
  "id      "upper": "exdef5"0.5,
        "core": 0.5,
  "duration      "lower": 10 0.5,
        "needsHalfwaySwap": true
      }
    },
   ], "journeyTriggers": {
      "adaptiveStressforAfterburner": {

         "strengthtrigger01": 0.2,{
          "cardiocategory": 0.9"achievement",
          "metabolictriggerType": 0.6"activeDaysInWeeks",
          "epoccondition1": 0.6
   4, // 4 active days
    },         "muscleStress""condition2": {8, // every week for 8 weeks
    "upper": 10,
          "loweractions": 10,[
            "core": 10
        }
{"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
     },       {"wktdef4actionType": {
        "type": 1,"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
        "title": "OCD", ]
       "image": "abs" },
        "desctrigger02": {
"Modern Exercise",         "breakDurationcategory": 6"education",
		"appStoreId: "workout04",         "exercisestriggerType": "totalActivities",
[           {
 "condition1": 10, // 10 activities
          "idcondition2": "exdef3",
 0, // Not used
          "durationactions": 20[
          },
     {"actionType":"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}
      {    ]
        "id": "exdef2",}
      },
      "durationfor7MW": 15{
        "trigger01": {
},           {
 "category": "achievement",
          "idtriggerType": "exdef4activeDaysInWeeks",

           "durationcondition1": 54, // 4 active days
      }    "condition2": 8, // every week ],for         "adaptiveStress": {8 weeks
           "strengthactions": 0.2,[
            {"cardioactionType": 0.9,
          "metabolic": 0.6,
          "epoc": 0.6
 "postArticle","articleId":"article_id_01","data":"e.g. url parameters"},
      },         {"muscleStress": {
actionType":"unlockWorkout","workoutDefId":"workoutDef_id_01","articleId":"article_id_02","data":""}
         "upper": 10, ]
          "lower": 10,
 },
        "coretrigger02": 10{
        }  "category": "education",
   },       "wktdef5triggerType": "totalActivities",
{          "typecondition1": 110, // 10 activities
          "titlecondition2": "Warming Up",
0, // Not used
       "image":   "absactions",:    [
    "desc": "Basic",         {"breakDurationactionType": 5,
		"appStoreId: "workout05",
        "exercises": [
"postArticle","articleId":"article_id_01","data":"e.g. url parameters"}
         { ]
        }
  "id": "exdef2",   }
    }
    "durationtimedNotifs": 20{
      "forAfterburner": {
  },           {
 "notif01": {
          "iddeltaHours": "exdef2"24, // Delta after APN token reg that the notif is delivered  "duration": 15[no default]
           }
        ],
  "seqVersion": 0, // Sequence version to allow future updates without flooding existing users [default:0]
     "adaptiveStress": {    "title": "Title of notification",    "strength": 0.2,// [default:""]
           "cardiobody": 0.9,
  "Body of notification" // [no default]
       "metabolic": 0.6 },
      },
      "epocfor7MW": 0.6 {
        "notif01": {
 },         "muscleStressdeltaHours": {24, 
          "upperseqVersion": 100, 
          "lowertitle": 10 "Title of notification",
          "corebody": 10"Body of notification"
        },
      },
    }
  },
  "wktdef6receipts": {
   
    "typeuser_id_01": 1,{
        "title"receipt_auto_id_01": "6{
Min Strength",         "receipt"image": "absreceipt_data", // Written by the client after an IAP purchase
        "descvalidation": "Quick workout that targets strength building, increasing your restimng metabilic rate.",{ // Written by the server after the receipt has been processed
          "breakDurationvalidationDate": 53456789,
		"appStoreId: "workout06", // Timestamp [default:0]
          "exercisesisValid": true [default:false]
        }
  {    }
    }
   "id": "exdef1",
            "duration": 55
          },
          {
            "id": "exdef4",
            "duration": 55
          },
          {
            "id": "exdef5",
            "duration": 55
          },
          {
            "id": "exdef1",
            "duration": 55
          },
          {
            "id": "exdef4",
            "duration": 55
          },
          {
            "id": "exdef5",
            "duration": 55
          }
        ],
        "adaptiveStress": {
          "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,
		"appStoreId: "workout07",
        "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,
		"appStoreId: "workout08",
        "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,
		"appStoreId: "workout09",
        "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