TheM.cheques 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.
Example
Properties
Property table for TheM.cheques
Property | Description | Required | Schema |
---|---|---|---|
all | Gets (returns) an array with all the checks associated with the user that are not deleted. | Yes | { "title": "TheM.cheques.all", "type": "array", "description": "Gets (returns) an array with all the checks associated with the user that are not deleted.", "$comment": "getter", "examples": [ [ { "AFiChequeId": "awcqly8ox03hpkxd9u8ax8ed8nh147jsoikhkgtjgjcw ", "amount": 10.01, "currency": "USD", "dtsCreated": "2024-07-15T17:02:41.567Z", "dtsModified": "2024-07-15T17:02:41.567Z", "dtsProcessed": "2024-07-15T17:02:41.567Z", "isAccepted": false, "isCredited": false, "isDelivered": true, "isDelivering": false, "isPendingApproval": false, "isSyncedToServer": true, "isValid": true, "isActive": true, "isDeleted": false, "toJSON": {} } ] ], "nullable": false } |
pending | Gets (returns) an array with all the checks associated with the user that do not yet have both a front and back image that have been successfully delivered to the server. | Yes | { "title": "TheM.cheques.pending", "type": "array", "description": "Gets (returns) an array with all the checks associated with the user that do not yet have both a front and back image that have been successfully delivered to the server.", "$comment": "getter", "examples": [ [ { "AFiChequeId": "awcqly8ox03hpkxd9u8ax8ed8nh147jsoikhkgtjgjcw ", "amount": 10.01, "currency": "USD", "dtsCreated": "2024-07-15T17:02:41.567Z", "dtsModified": "2024-07-15T17:02:41.567Z", "dtsProcessed": "2024-07-15T17:02:41.567Z", "isAccepted": false, "isCredited": false, "isDelivered": true, "isDelivering": false, "isPendingApproval": false, "isSyncedToServer": true, "isValid": true, "isActive": true, "isDeleted": false, "toJSON": {} } ] ], "nullable": false } |
newTempCheque | Returns a new instance of the Cheque class. Create a new check like const checkEntity = TheM.cheques.newTempCheque . Then set the properties of the new check like checkEntity.amount = 10.01 . |
Yes | { "title": "TheM.cheques.newTempCheque", "type": "object", "description": "Returns a new instance of the Cheque class. Create a new check like const<br/>checkEntity = TheM.cheques.newTempCheque . Thenset the properties of the new check like checkEntity.amount = 10.01 .","$comment": "getter", "examples": [ [ { "AFiChequeId": "new", "dtsCreated": "2024-07-15T17:02:41.567Z", "dtsModified": "2024-07-15T17:02:41.567Z", "dtsProcessed": "2024-07-15T17:02:41.567Z", "isAccepted": false, "isCredited": false, "isDelivered": false, "isPendingApproval": false, "isSyncedToServer": false, "isValid": false, "toJSON": {} } ] ], "nullable": false } |
length | Gets (returns) the length of the cheques array. | Yes | { "title": "TheM.cheques.length", "type": "number", "description": "Gets (returns) the length of the cheques array.", "examples": [ 1 ], "default": 0, "nullable": false } |
isReady | Gets (returns) or sets true if TheM.cheques is fully ready. When setting isReady true for the first time, a(n) 'TheM.cheques ready' event is also triggered. | Yes | { "title": "TheM.cheques.isReady", "type": "boolean", "description": "Gets (returns) or sets true if TheM.cheques is fully ready. When setting isReady true for the first time, a(n) 'TheM.cheques ready' event is also triggered.", "$comment": "getter setter", "examples": [ true, false ], "default": false, "nullable": false } |
Methods
Method Name | Parameter Descriptions | Description | Example |
---|---|---|---|
doSave | [] |
Saves cheques 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.cheques.doSave(); |
doLoad | [] |
Loads cheques 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.cheques.doLoad(); |
doUpdate | [ |
Causes framework to pull fresh cheques data from the server. If the data is fresh enough, meaning an update has happened recently, the framework will ignore the suggestion. However, you can force the framework to update the data by sending true as an argument. On success, a(n) 'modelBank cheques refreshed' event will occur. Local updates are sent to the server prior to pulling the data from the server. |
TheM.cheques.doUpdate(true); |
cheque | [ |
Returns the check associated with the user specified by the givenAFiChequeId, if a match exists. | TheM.cheques.cheque("awcqly8ox03hpkxd9u8ax8ed8nh147jsoikhkgtjgjcw"); |
filtered | [ |
This method accepts an object, givenParams , containing filter criteria (key:value pairs where key is a cheque property) and then returns an array of checks with properties matching the given criteria. If no givenParams are included, then an unfiltered check list is returned. |
TheM.cheques.filtered({); |
Submodules
Submodule Name | Link |
---|---|
Cheque | Cheque Reference |