Model ledgers


Permissions

User GroupCreate?Read?Update?Delete?
super_userxxxx
line_managerxxx
apixxx
posxx
ownerxxx
adminx
userxx

Fields

NameTypeLinkMaps ToDefaultIndexed?Unique?
__vNumber
_deletedBooleanfalsex
_idObjectIDfunction defaultId() { return new oid(); }
_owner_idObjectIDUser_ownerx
_updated_by_idObjectIDUser_updated_byx
amountNumber
balanceNumber
createdAtDate
cred_typeStringx
currency_idObjectIDCurrencyx
dateDatefunction now() { [native code] }x
descriptionString
detailsMixed
emailString
invoice_idObjectIDInvoicex
is_transferBooleanfalse
location_idObjectIDLocationx
organisation_idObjectIDOrganisationx
partner_idObjectIDPartnerx
partner_referenceMixedx
product_idArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }
receiptString
reserveBooleanfalse
reserve_expiresDatefunction now() { [native code] }
source_idObjectID
source_typeString
transaction_typeString
updatedAtDate
user_idObjectIDUserx
wallet_idArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }
wallet_splitArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }

Raw definition

{
	"path": "__v",
	"instance": "Number",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"__v"
	],
	"options": {},
	"_index": null
}
{
	"path": "_deleted",
	"instance": "Boolean",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"_deleted"
	],
	"options": {
		"default": false,
		"index": true
	},
	"_index": true,
	"defaultValue": false
}
{
	"path": "_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [
		null
	],
	"_presplitPath": [
		"_id"
	],
	"options": {
		"auto": true,
		"type": "ObjectId"
	},
	"_index": null
}
{
	"path": "_owner_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"_owner_id"
	],
	"options": {
		"link": "User",
		"map_to": "_owner",
		"index": true
	},
	"_index": true
}
{
	"path": "_updated_by_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"_updated_by_id"
	],
	"options": {
		"link": "User",
		"map_to": "_updated_by",
		"index": true
	},
	"_index": true
}
{
	"path": "amount",
	"instance": "Number",
	"validators": [
		{
			"message": "Path `{PATH}` is required.",
			"type": "required"
		}
	],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"amount"
	],
	"options": {
		"required": true
	},
	"_index": null,
	"isRequired": true,
	"originalRequiredValue": true
}
{
	"path": "balance",
	"instance": "Number",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"balance"
	],
	"options": {},
	"_index": null
}
{
	"path": "createdAt",
	"instance": "Date",
	"validators": [],
	"getters": [],
	"setters": [
		null,
		null
	],
	"_presplitPath": [
		"createdAt"
	],
	"options": {
		"immutable": true
	},
	"_index": null,
	"$immutable": true
}
{
	"enumValues": [],
	"regExp": null,
	"path": "cred_type",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"cred_type"
	],
	"options": {
		"index": true
	},
	"_index": true
}
{
	"path": "currency_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"currency_id"
	],
	"options": {
		"index": true,
		"link": "Currency"
	},
	"_index": true
}
{
	"path": "date",
	"instance": "Date",
	"validators": [
		{
			"message": "Path `{PATH}` is required.",
			"type": "required"
		}
	],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"date"
	],
	"options": {
		"required": true,
		"index": true
	},
	"_index": true,
	"isRequired": true,
	"originalRequiredValue": true
}
{
	"enumValues": [],
	"regExp": null,
	"path": "description",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"description"
	],
	"options": {},
	"_index": null
}
{
	"path": "details",
	"instance": "Mixed",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"details"
	],
	"options": {},
	"_index": null
}
{
	"enumValues": [],
	"regExp": null,
	"path": "email",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"email"
	],
	"options": {},
	"_index": null
}
{
	"path": "invoice_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"invoice_id"
	],
	"options": {
		"index": true,
		"link": "Invoice"
	},
	"_index": true
}
{
	"path": "is_transfer",
	"instance": "Boolean",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"is_transfer"
	],
	"options": {
		"default": false
	},
	"_index": null,
	"defaultValue": false
}
{
	"path": "location_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"location_id"
	],
	"options": {
		"link": "Location",
		"index": true
	},
	"_index": true
}
{
	"path": "organisation_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"organisation_id"
	],
	"options": {
		"index": true,
		"link": "Organisation"
	},
	"_index": true
}
{
	"path": "partner_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"partner_id"
	],
	"options": {
		"index": true,
		"link": "Partner"
	},
	"_index": true
}
{
	"path": "partner_reference",
	"instance": "Mixed",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"partner_reference"
	],
	"options": {
		"unique": true,
		"sparse": true
	},
	"_index": {
		"unique": true,
		"sparse": true,
		"background": true
	}
}
{
	"schemaOptions": {
		"timestamps": true,
		"toJSON": {
			"virtuals": true
		},
		"toObject": {
			"virtuals": true
		},
		"perms": {
			"super_user": "crud",
			"line_manager": "cru",
			"api": "cru",
			"pos": "cr",
			"owner": "rud",
			"admin": "r",
			"user": "cr"
		},
		"typeKey": "type",
		"id": true,
		"_id": true,
		"validateBeforeSave": true,
		"read": null,
		"shardKey": null,
		"discriminatorKey": "__t",
		"autoIndex": null,
		"minimize": true,
		"optimisticConcurrency": false,
		"versionKey": "__v",
		"capped": false,
		"bufferCommands": true,
		"strictQuery": true,
		"strict": true,
		"_perms": {
			"admin": "r",
			"owner": "rud",
			"user": "cr",
			"all": "",
			"super_user": "crud",
			"line_manager": "cru",
			"api": "cru",
			"pos": "cr"
		},
		"pluralization": true
	},
	"caster": {
		"path": "product_id",
		"instance": "ObjectID",
		"validators": [],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"product_id"
		],
		"options": {
			"index": true,
			"link": "Product"
		},
		"_index": true,
		"_arrayPath": "product_id.$",
		"_arrayParentPath": "product_id"
	},
	"$embeddedSchemaType": {
		"path": "product_id",
		"instance": "ObjectID",
		"validators": [],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"product_id"
		],
		"options": {
			"index": true,
			"link": "Product"
		},
		"_index": true,
		"_arrayPath": "product_id.$",
		"_arrayParentPath": "product_id"
	},
	"$isMongooseArray": true,
	"path": "product_id",
	"instance": "Array",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"product_id"
	],
	"options": {
		"type": [
			{
				"index": true,
				"link": "Product"
			}
		]
	},
	"_index": null
}
{
	"enumValues": [],
	"regExp": null,
	"path": "receipt",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"receipt"
	],
	"options": {},
	"_index": null
}
{
	"path": "reserve",
	"instance": "Boolean",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"reserve"
	],
	"options": {
		"default": false
	},
	"_index": null,
	"defaultValue": false
}
{
	"path": "reserve_expires",
	"instance": "Date",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"reserve_expires"
	],
	"options": {},
	"_index": null
}
{
	"path": "source_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"source_id"
	],
	"options": {},
	"_index": null
}
{
	"enumValues": [],
	"regExp": null,
	"path": "source_type",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"source_type"
	],
	"options": {},
	"_index": null
}
{
	"enumValues": [],
	"regExp": null,
	"path": "transaction_type",
	"instance": "String",
	"validators": [
		{
			"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
			"type": "user defined",
			"validator": {}
		}
	],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"transaction_type"
	],
	"options": {
		"validate": {}
	},
	"_index": null
}
{
	"path": "updatedAt",
	"instance": "Date",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"updatedAt"
	],
	"options": {},
	"_index": null
}
{
	"path": "user_id",
	"instance": "ObjectID",
	"validators": [
		{
			"message": "Path `{PATH}` is required.",
			"type": "required"
		}
	],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"user_id"
	],
	"options": {
		"index": true,
		"link": "User",
		"required": true
	},
	"_index": true,
	"isRequired": true,
	"originalRequiredValue": true
}
{
	"schemaOptions": {
		"timestamps": true,
		"toJSON": {
			"virtuals": true
		},
		"toObject": {
			"virtuals": true
		},
		"perms": {
			"super_user": "crud",
			"line_manager": "cru",
			"api": "cru",
			"pos": "cr",
			"owner": "rud",
			"admin": "r",
			"user": "cr"
		},
		"typeKey": "type",
		"id": true,
		"_id": true,
		"validateBeforeSave": true,
		"read": null,
		"shardKey": null,
		"discriminatorKey": "__t",
		"autoIndex": null,
		"minimize": true,
		"optimisticConcurrency": false,
		"versionKey": "__v",
		"capped": false,
		"bufferCommands": true,
		"strictQuery": true,
		"strict": true,
		"_perms": {
			"admin": "r",
			"owner": "rud",
			"user": "cr",
			"all": "",
			"super_user": "crud",
			"line_manager": "cru",
			"api": "cru",
			"pos": "cr"
		},
		"pluralization": true
	},
	"caster": {
		"path": "wallet_id",
		"instance": "ObjectID",
		"validators": [],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"wallet_id"
		],
		"options": {
			"index": true,
			"link": "Wallet"
		},
		"_index": true,
		"_arrayPath": "wallet_id.$",
		"_arrayParentPath": "wallet_id"
	},
	"$embeddedSchemaType": {
		"path": "wallet_id",
		"instance": "ObjectID",
		"validators": [],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"wallet_id"
		],
		"options": {
			"index": true,
			"link": "Wallet"
		},
		"_index": true,
		"_arrayPath": "wallet_id.$",
		"_arrayParentPath": "wallet_id"
	},
	"$isMongooseArray": true,
	"path": "wallet_id",
	"instance": "Array",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"wallet_id"
	],
	"options": {
		"type": [
			{
				"index": true,
				"link": "Wallet"
			}
		]
	},
	"_index": null
}
{
	"schemaOptions": {
		"timestamps": true,
		"toJSON": {
			"virtuals": true
		},
		"toObject": {
			"virtuals": true
		},
		"perms": {
			"super_user": "crud",
			"line_manager": "cru",
			"api": "cru",
			"pos": "cr",
			"owner": "rud",
			"admin": "r",
			"user": "cr"
		},
		"typeKey": "type",
		"id": true,
		"_id": true,
		"validateBeforeSave": true,
		"read": null,
		"shardKey": null,
		"discriminatorKey": "__t",
		"autoIndex": null,
		"minimize": true,
		"optimisticConcurrency": false,
		"versionKey": "__v",
		"capped": false,
		"bufferCommands": true,
		"strictQuery": true,
		"strict": true,
		"_perms": {
			"admin": "r",
			"owner": "rud",
			"user": "cr",
			"all": "",
			"super_user": "crud",
			"line_manager": "cru",
			"api": "cru",
			"pos": "cr"
		},
		"pluralization": true
	},
	"caster": {
		"path": "wallet_split",
		"instance": "Mixed",
		"validators": [],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"wallet_split"
		],
		"options": {},
		"_index": null,
		"_arrayPath": "wallet_split.$",
		"_arrayParentPath": "wallet_split"
	},
	"$embeddedSchemaType": {
		"path": "wallet_split",
		"instance": "Mixed",
		"validators": [],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"wallet_split"
		],
		"options": {},
		"_index": null,
		"_arrayPath": "wallet_split.$",
		"_arrayParentPath": "wallet_split"
	},
	"$isMongooseArray": true,
	"path": "wallet_split",
	"instance": "Array",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"wallet_split"
	],
	"options": {
		"type": [
			null
		]
	},
	"_index": null
}