Skip to content

TheM.user Reference

Constructor

The parent TheM class contains functionality enabling the initialization of any TheM subclass or submodule instance by simply calling TheM.doInit('subclassName'), where the input string is a case sensitive space-delimited string containing the names of all submodules that may be required in the current session. Most TheM subclasses also require the 'common' submodule. It is common to initialize the target submodule and any other submodule dependencies concurrently. The following example will initialize a new instance of the necessary submodules using a proxy constructor in TheM parent class.

TheM.doInit('subclassName1 subclassName2 subclassName3 etc');

Example

TheM.doInit('common user');

Properties

Property table for TheM.user

Property Description Required Schema
AFiUserId Gets (returns) the unique user ID in ampliFi. Yes {
  "title": "TheM.user.AFiUserId",
  "type": "string",
  "description": "Gets (returns) the unique user ID
in ampliFi.",
  "$comment": "enumerable getter",
  "examples": [
    "testaurlx8wfimcrw"
  ],
  "nullable": false
}
userId Gets (returns) the AFiUserId. Yes {
  "title": "TheM.user.userId",
  "type": "string",
  "description": "Gets (returns) the AFiUserId.",
  "$comment": "enumerable getter",
  "examples": [
    "testaurlx8wfimcrw"
  ],
  "nullable": false
}
AFiEntityId Gets (returns) the AFiEntityId. Can be modified via a 'modelBank user details pushed' event (see User Guide). No {
  "title": "TheM.user.AFiEntityId",
  "type": "string",
  "description": "Gets (returns) the AFiEntityId.
Can be modified via a 'modelBank user details
pushed' event (see User Guide).",
  "$comment": "enumerable getter",
  "examples": [
    ""
  ],
  "default": ""
}
sortId Gets (returns) the sortId. Can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title": "TheM.user.sortId",
  "type": "string",
  "description": "Gets (returns) the sortId. Can be
modified via a 'modelBank user details pushed'
event (see User Guide).",
  "$comment": "enumerable getter",
  "examples": [
    "m1j"
  ],
  "nullable": false
}
entityName Gets (returns) or sets the entityName. Can be modified via a 'modelBank user details pushed' event (see User Guide). No {
  "title": "TheM.user.entityName",
  "type": "string",
  "description": "Gets (returns) or sets the
entityName. Can be modified via a 'modelBank user
details pushed' event (see User Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    ""
  ],
  "default": ""
}
name Gets (returns) the user name object. Can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title": "TheM.user.name",
  "type": "object",
  "description": "Gets (returns) the user name
object. Can be modified via a 'modelBank user
details pushed' event (see User Guide).",
  "$comment": "enumerable getter",
  "examples": [
    {
      "firstName": "Suzy",
      "lastName": "Tester",
      "middleName": "Queue"
    }
  ],
  "nullable": false
}
firstName Gets (returns) user's first name. Yes {
  "title": "TheM.user.firstName",
  "type": "string",
  "description": "Gets (returns) user's first
name.",
  "$comment": "",
  "examples": [
    "John"
  ],
  "nullable": false
}
middleName Gets (returns) user's middle name (if applicable). No {
  "title": "TheM.user.middleName",
  "type": "string",
  "description": "Gets (returns) user's middle name
(if applicable).",
  "$comment": "",
  "examples": [
    ""
  ],
  "nullable": true
}
lastName Gets (returns) user's last name. Yes {
  "title": "TheM.user.lastName",
  "type": "string",
  "description": "Gets (returns) user's last
name.",
  "$comment": "",
  "examples": [
    "Testman"
  ],
  "nullable": false
}
fullName Gets (returns) the user fullName in 'firstName middleInitial lastName' format. Yes {
  "title": "TheM.user.fullName",
  "type": "string",
  "description": "Gets (returns) the user fullName
in 'firstName middleInitial lastName' format.",
  "$comment": "enumerable getter",
  "examples": [
    "Suzy Q Tester"
  ],
  "nullable": false
}
address Gets (returns) the first address in the addresses array. The addresses array can be modified via a 'modelBank user details pushed' or 'modelBank user addresses pushed' event (see User Guide). Yes {
  "title": "TheM.user.address",
  "type": "object",
  "description": "Gets (returns) the first address
in the addresses array. The addresses array can be
modified via a 'modelBank user details pushed' or
'modelBank user addresses pushed' event (see User
Guide).",
  "$comment": "enumerable getter",
  "examples": [
    {
      "AFiUserAddressId":
"testzrctagoggontpgzkusmmfbjmxrzumwvpiftrlosz
",
      "AFiUserId": "testaurlx8wfimcrw",
      "addressLine1": "123 Main Str.",
      "addressLine2": null,
      "city": "Harrisburg",
      "countryCode": "US",
      "dtsModified": "Mon Jun 10 2024 07:37:53 GMT-0400
(Eastern Daylight Time)",
      "isMain": true,
      "postalCode": "12345",
      "state": "PA",
      "isSyncedToServer": true,
      "isValid": true,
      "toJSON": {
        "AFiUserAddressId":
"testzrctagoggontpgzkusmmfbjmxrzumwvpiftrlosz
",
        "addressLine1": "123 Main Str.",
        "addressLine2": null,
        "city": "Harrisburg",
        "countryCode": "US",
        "dtsModified": "Mon Jun 10 2024 07:37:53 GMT-0400
(Eastern Daylight Time)",
        "postalCode": "12345",
        "state": "PA"
      },
      "validationMessage": ""
    }
  ],
  "nullable": false
}
addresses Gets (returns) the addresses array. Yes {
  "title": "TheM.user.addresses",
  "type": "array",
  "description": "Gets (returns) the addresses
array.",
  "$comment": "enumerable getter",
  "examples": [
    [
      {
        "AFiUserAddressId":
"testzrctagoggontpgzkusmmfbjmxrzumwvpiftrlosz
",
        "AFiUserId": "testaurlx8wfimcrw",
        "addressLine1": "123 Main Str.",
        "addressLine2": null,
        "city": "Harrisburg",
        "countryCode": "US",
        "dtsModified": "Mon Jun 10 2024 07:37:53 GMT-0400
(Eastern Daylight Time)",
        "isMain": true,
        "postalCode": "12345",
        "state": "PA",
        "isSyncedToServer": true,
        "isValid": true,
        "toJSON": {
          "AFiUserAddressId":
"testzrctagoggontpgzkusmmfbjmxrzumwvpiftrlosz
",
          "addressLine1": "123 Main Str.",
          "addressLine2": null,
          "city": "Harrisburg",
          "countryCode": "US",
          "dtsModified": "Mon Jun 10 2024 07:37:53 GMT-0400
(Eastern Daylight Time)",
          "postalCode": "12345",
          "state": "PA"
        },
        "validationMessage": ""
      }
    ]
  ],
  "nullable": false
}
newTempAddress Gets (returns) a new instance of the Address class. No {
  "title": "TheM.user.newTempAddress",
  "type": "object",
  "description": "Gets (returns) a new instance of
the Address class.",
  "$comment": "enumerable getter",
  "examples": [
    {
      "AFiUserAddressId": "new",
      "countryCode": "US",
      "dtsModified": "Sun Oct 15 1978 00:00:00 GMT-0400
(Eastern Daylight Time)",
      "isMain": false,
      "isSyncedToServer": false,
      "isValid": false,
      "toJSON": {
        "AFiUserAddressId": "new",
        "countryCode": "US",
        "dtsModified": "Sun Oct 15 1978 00:00:00 GMT-0400
(Eastern Daylight Time)"
      },
      "validationMessage": "enter address line 1"
    }
  ]
}
homecurrency Gets (returns) or sets the homecurrency for the current user. Can be modified via a 'modelBank user details pushed' event (see User Guide). No {
  "title": "TheM.user.homecurrency",
  "type": "string",
  "description": "Gets (returns) or sets the
homecurrency for the current user. Can be modified
via a 'modelBank user details pushed' event (see
User Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    "USD"
  ],
  "default": "USD"
}
mobile Gets (returns) or sets the mobile number of the current user. Can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title": "TheM.user.mobile",
  "type": "string",
  "description": "Gets (returns) or sets the mobile
number of the current user. Can be modified via a
'modelBank user details pushed' event (see User
Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    "5556667777"
  ],
  "nullable": false
}
email Gets (returns) or sets the email address of the current user. Can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title": "TheM.user.email",
  "type": "string",
  "description": "Gets (returns) or sets the email
address of the current user. Can be modified via a
'modelBank user details pushed' event (see User
Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    "testuser@test.email"
  ],
  "nullable": false
}
dobDay Gets (returns) the user's day of birth in DD format. Yes {
  "title": "TheM.user.dobDay",
  "type": "string",
  "description": "Gets (returns) the user's day of
birth in DD format.",
  "$comment": "",
  "examples": [
    "15"
  ],
  "nullable": false
}
dobMonth Gets (returns) the user's birth month in MM format. Yes {
  "title": "TheM.user.dobMonth",
  "type": "string",
  "description": "Gets (returns) the user's birth
month in MM format.",
  "$comment": "",
  "examples": [
    "10"
  ],
  "nullable": false
}
dobYear Gets (returns) the user's birth year in YYYY format. Yes {
  "title": "TheM.user.dobYear",
  "type": "string",
  "description": "Gets (returns) the user's birth
year in YYYY format.",
  "$comment": "",
  "examples": [
    "1978"
  ],
  "nullable": false
}
dosDob Gets (returns) the user's birth date in YYYY-MM-DD format. Yes {
  "title": "TheM.user.dosDob",
  "type": "string",
  "description": "Gets (returns) the user's birth
date in YYYY-MM-DD format.",
  "$comment": "",
  "examples": [
    "1978-10-15"
  ],
  "nullable": false
}
languageCode Gets (returns) or sets the languageCode. Can be modified via a 'modelBank user details pushed' event (see User Guide). No {
  "title": "TheM.user.languageCode",
  "type": "boolean",
  "description": "Gets (returns) or sets the
languageCode. Can be modified via a 'modelBank user
details pushed' event (see User Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    "EN"
  ],
  "default": "EN"
}
faceImage Gets (returns) or sets the faceImage of the current user in base 64 string format. Can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title": "TheM.user.faceImage",
  "type": "string",
  "description": "Gets (returns) or sets the
faceImage of the current user in base 64 string
format. Can be modified via a 'modelBank user
details pushed' event (see User Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    "veryLongBase64ImageString"
  ],
  "nullable": false
}
extras Gets (returns) an object containing any additional information. No {
  "title": "TheM.user.extras",
  "type": "object",
  "description": "Gets (returns) an object
containing any additional information.",
  "$comment": "",
  "examples": [
    {
      "sex": "male",
      "eyeColor": "BRO",
      "hairColor": "BLK",
      "heightMetric": "181",
      "weightmetric": "85"
    }
  ],
  "nullable": true
}
private Gets (returns) true if user is not a business (is an individual). Yes {
  "title": "TheM.user.private",
  "type": "boolean",
  "description": "Gets (returns) true if user is not a
business (is an individual).",
  "$comment": "",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
mainAFiAccountId Gets (returns) the account ID for the user's main account. Yes {
  "title": "TheM.user.mainAFiAccountId",
  "type": "string",
  "description": "Gets (returns) the account ID for
the user's main account.",
  "$comment": "",
  "examples": [
    "qwegal8kgtmysmels"
  ],
  "nullable": false
}
uiStage Gets (returns) the user's current user interface stage. Yes {
  "title": "TheM.user.uiStage",
  "type": "string",
  "description": "Gets (returns) the user's current
user interface stage.",
  "$comment": "",
  "examples": [
    "firstContact"
  ],
  "nullable": false
}
devices Gets (returns) the current devices object. The devices object has two methods, TheM.user.devices.get() and TheM.user.devices.update(devices). Both methods call the authenticateddevices endpoint in TabaPay. The optional devices parameter in TheM.user.devices.update(devices) is an array of authenticateddevices objects: [{AFiLinkLinkId: 'AAOQODLGG', isActive: true}]. No {
  "title": "TheM.user.devices",
  "type": "object",
  "description": "Gets (returns) the current
devices object. The devices object has two methods,
TheM.user.devices.get() and
TheM.user.devices.update(devices). Both
methods call the authenticateddevices endpoint in
TabaPay. The optional devices parameter in
TheM.user.devices.update(devices) is an array of
authenticateddevices objects: [{AFiLinkLinkId:
'AAOQODLGG', isActive: true}].",
  "$comment": "enumerable getter",
  "examples": [
    {}
  ],
  "default": [
    {}
  ]
}
segment Gets (returns) the segment that the user is currently in. The segment can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title": "TheM.user.segment",
  "type": "string",
  "description": "Gets (returns) the segment that
the user is currently in. The segment can be modified
via a 'modelBank user details pushed' event (see
User Guide).",
  "$comment": "enumerable getter",
  "examples": [
    "demo"
  ],
  "nullable": false
}
postOnboardingStepsRequired Gets (returns) or sets the postOnboardingStepsRequired. Can be modified via a 'modelBank user details pushed' event (see User Guide). Yes {
  "title":
"TheM.user.postOnboardingStepsRequired",
  "type": "boolean",
  "description": "Gets (returns) or sets the
postOnboardingStepsRequired. Can be modified via
a 'modelBank user details pushed' event (see User
Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    "postonboardingadultstep2"
  ],
  "nullable": false
}
dtsCreated Gets (returns) the date time stamp when the record was created. Yes {
  "title": "TheM.user.dtsCreated",
  "type": "Date",
  "description": "Gets (returns) the date time stamp
when the record was created.",
  "$comment": "",
  "examples": [
    "Fri Jun 28 2024 07:12:10 GMT-0400 (Eastern
Daylight Time)"
  ],
  "nullable": false
}
dtsCreatedAtUsers Gets (returns) the date time stamp when the user applied. Yes {
  "title": "TheM.user.dtsCreatedAtUsers",
  "type": "Date",
  "description": "Gets (returns) the date time stamp
when the user applied.",
  "$comment": "",
  "examples": [
    "Fri Jun 28 2024 07:12:10 GMT-0400 (Eastern
Daylight Time)"
  ],
  "nullable": false
}
dtsModified Gets (returns) the date time stamp when user record was last modified. Yes {
  "title": "TheM.user.dtsModified",
  "type": "Date",
  "description": "Gets (returns) the date time stamp
when user record was last modified.",
  "$comment": "",
  "examples": [
    "Fri Jun 28 2024 07:12:10 GMT-0400 (Eastern
Daylight Time)"
  ],
  "nullable": false
}
dtsRegistered Gets (returns) the date time stamp when user was registered. Yes {
  "title": "TheM.user.dtsRegistered",
  "type": "Date",
  "description": "Gets (returns) the date time stamp
when user was registered.",
  "$comment": "",
  "examples": [
    "Fri Jun 28 2024 07:12:10 GMT-0400 (Eastern
Daylight Time)"
  ],
  "nullable": false
}
isAuthenticated Gets (returns) true if the current user has been authenticated. No {
  "title": "TheM.user.isAuthenticated",
  "type": "boolean",
  "description": "Gets (returns) true if the current
user has been authenticated.",
  "$comment": "getter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isActive Gets (returns) true if user is categorized as active. No {
  "title": "TheM.user.isActive",
  "type": "boolean",
  "description": "Gets (returns) true if user is
categorized as active.",
  "$comment": "",
  "examples": [
    true,
    false
  ],
  "default": false
}
isFullyRegistered Gets (returns) true if user has passed KYC/KYB (Know Your Customer/Business) and has opened an account. No {
  "title": "TheM.user.isFullyRegistered",
  "type": "boolean",
  "description": "Gets (returns) true if user has
passed KYC/KYB (Know Your Customer/Business) and
has opened an account.",
  "$comment": "",
  "examples": [
    true,
    false
  ],
  "default": false
}
isIdleUser Gets (returns) true if user was created, but bank account was not opened. No {
  "title": "TheM.user.isIdleUser",
  "type": "boolean",
  "description": "Gets (returns) true if user was
created, but bank account was not opened.",
  "$comment": "",
  "examples": [
    true,
    false
  ],
  "default": false
}
isMetric Gets (returns) or sets true if units of measurement are metric. Can be modified via a 'modelBank user details pushed' event (see User Guide). No {
  "title": "TheM.user.isMetric",
  "type": "boolean",
  "description": "Gets (returns) or sets true if
units of measurement are metric. Can be modified via
a 'modelBank user details pushed' event (see User
Guide).",
  "$comment": "enumerable getter setter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isExpired Gets (returns) or sets true if user data is stale and needs to be updated. No {
  "title": "TheM.user.isExpired",
  "type": "boolean",
  "description": "Gets (returns) or sets true if user
data is stale and needs to be updated.",
  "$comment": "getter setter",
  "examples": [
    true,
    false
  ]
}
isSyncedToServer Gets (returns) or sets true if user data is synced to the server. Can only be set false. No {
  "title": "TheM.user.isSyncedToServer",
  "type": "boolean",
  "description": "Gets (returns) or sets true if user
data is synced to the server. Can only be set false.",
  "$comment": "getter setter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isLoggingIn Gets (returns) true if the user is currently logging in. No {
  "title": "TheM.user.isLoggingIn",
  "type": "boolean",
  "description": "Gets (returns) true if the user is
currently logging in.",
  "$comment": "getter",
  "examples": [
    true,
    false
  ],
  "default": false
}
toJSON Gets (returns) a JSON formatted object of user properties. Yes {
  "title": "TheM.user.toJSON",
  "type": "object",
  "description": "Gets (returns) a JSON formatted
object of user properties.",
  "$comment": "getter",
  "examples": [
    {
      "AFiEntityId": "",
      "AFiUserId": "testaurlx8wfimcrw",
      "addresses": [],
      "dtsModified": 0,
      "dtsUpdated": "Tue Jun 11 2024 06:40:48 GMT-0400
(Eastern Daylight Time)",
      "email": "testuser@test.email",
      "entityName": "",
      "faceImage": "VeryLongBase64ImageString",
      "homecurrency": "USD",
      "isMetric": false,
      "isSyncedToServer": true,
      "languageCode": "en",
      "mobile": "5556667777",
      "name": {
        "firstName": "Suzy",
        "lastName": "Tester",
        "middleName": "Queue"
      },
      "names": [],
      "private": true,
      "segment": "demo",
      "sortId": "m1j"
    }
  ],
  "nullable": false
}

Methods

Method Name Parameter Descriptions Description Example
doSave
[]
Saves user data in local storage. Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. Returns true. TheM.user.doSave();
doLoad
[]
Loads user data from local storage and returns a boolean value to indicate success. Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. TheM.user.doLoad();
doUpdate
[]
Causes framework to pull fresh user data from the server. If the data is fresh enough, meaning an update has happened recently, the framework will ignore the suggestion. On success, a(n) 'modelBank user refreshed' event will occur. Sends modified user data to the server first, and then pulls fresh user data from the server. TheM.user.doUpdate();
doLogin
[
{
"title": "GivenCredentials",
"type": "object",
"nullable": false,
"example": {
"dtsValueString":
"1719573130059",
"deviceTag": "DEVICE_TAG",
"deviceData": {
"platform": "android",
"build": "0.0.01"
},
"channel": "android_v1",
"dynamicScreensVersion": 1,
"socket": {
"halfRef": "RandomString"
},
"cryptotext":
"CryptoJS.AES.encrypt((DEVICE_
TAG) + dtsValueString,
serverSecret).toString()"
}
}
]
Logs the user in using the given credentials. TheM.user.doLogin(
  {
   "dtsValueString": "1719573130059",
   "deviceTag": "DEVICE_TAG",
   "deviceData": {
   "platform": "android",
   "build": "0.0.01"
   },
   "channel": "android_v1",
   "dynamicScreensVersion": 1,
   "socket": {
   "halfRef": "RandomString"
   },
   "cryptotext": "CryptoJS.AES.encrypt((DEVICE_TAG) + dtsValueString, serverSecret).toString()"
  }
);
doLogout
[]
Logs the user out. Removes user data from memory upon logging out. TheM.user.doLogout();
isValidField
[
{
"title": "fieldName",
"type": "string",
"nullable": false,
"example": "ssn"
},
{
"title": "value",
"type": "string",
"nullable": false,
"example": "123456789"
}
]
Checks to make sure the given value is valid for the given fieldName. Possible fieldNames to check are 'ssn', 'mobile', 'email', and 'postalCode'. TheM.user.isValidField("ssn","123456789");
getNewTempAddress
[
{
"title": "given",
"type": "object",
"nullable": false,
"example": {
"AFiUserAddressId": "new123",
"AFiUserId":
"testaurlx8wfimcrw",
"addressLine1": "123 New Str.",
"addressLine2": null,
"city": "Harrisburg",
"countryCode": "US",
"dtsModified": "Mon Jun 10 2024
07:37:53 GMT-0400 (Eastern
Daylight Time)",
"isMain": false,
"postalCode": "12345",
"state": "PA",
"isSyncedToServer": false
}
}
]
Gets (returns) a new instance of the Address class, passing the given object as the initial address property values. TheM.user.getNewTempAddress(
  {
   "AFiUserAddressId": "new123",
   "AFiUserId": "testaurlx8wfimcrw",
   "addressLine1": "123 New Str.",
   "addressLine2": null,
   "city": "Harrisburg",
   "countryCode": "US",
   "dtsModified": "Mon Jun 10 2024 07:37:53 GMT-0400 (Eastern Daylight Time)",
   "isMain": false,
   "postalCode": "12345",
   "state": "PA",
   "isSyncedToServer": false
  }
);
devices.get
[]
Calls the authenticateddevices endpoint in TabaPay and returns the result. TheM.user.devices.get();
devices.update
[
{
"title": "devices",
"type": "array",
"nullable": true,
"example": [
{
"AFiLinkLinkId": "AAOQODLGG",
"isActive": true
}
]
}
]
Calls the authenticateddevices endpoint in TabaPay and returns the result. The optional devices parameter in TheM.user.devices.update(devices) is an array of authenticateddevices objects: [{AFiLinkLinkId: 'AAOQODLGG', isActive: true}]. TheM.user.devices.update(
[
{
"AFiLinkLinkId": "AAOQODLGG",
"isActive": true
}
]
);

Submodules

Submodule Name Link
Address Address Reference