Model wallets
Permissions
User Group | Create? | Read? | Update? | Delete? |
---|
admin | | x | | |
finance | x | x | x | x |
setup | x | x | x | x |
user | | x | | |
Fields
Name | Type | Link | Maps To | Default | Indexed? | Unique? |
---|
__v | Number | | | | | |
_deleted | Boolean | | | false | x | |
_id | ObjectID | | | function defaultId() {
return new oid();
} | | |
_owner_id | ObjectID | | | | | |
_updated_by_id | ObjectID | User | _updated_by | | x | |
balance | Number | | | 0 | | |
createdAt | Date | | | | | |
currency_id | ObjectID | Currency | | | x | |
date_created | Date | | | function now() { [native code] } | | |
last_quota_date | Date | | | function now() { [native code] } | x | |
name | String | | | | x | |
organisation_id | ObjectID | Organisation | | | x | |
organisation_wide | Boolean | | | false | | |
personal | Boolean | | | | | |
previous_balance | Number | | | 0 | | |
priority | Number | | | | | |
quota_amount | Number | | | 0 | | |
quota_frequency | String | | | never | x | |
quota_type | String | | | free | x | |
updatedAt | Date | | | | | |
user_id | Array | | | function() {
// 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": {},
"_index": null
}
{
"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": "balance",
"instance": "Number",
"validators": [
{
"message": "Path `{PATH}` ({VALUE}) is less than minimum allowed value (0).",
"type": "min",
"min": 0
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"balance"
],
"options": {
"default": 0,
"min": 0
},
"_index": null,
"defaultValue": 0,
"$fullPath": "balance"
}
{
"path": "createdAt",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [
null,
null
],
"_presplitPath": [
"createdAt"
],
"options": {
"immutable": true
},
"_index": null,
"$immutable": true,
"$fullPath": "createdAt"
}
{
"path": "currency_id",
"instance": "ObjectID",
"validators": [
{
"message": "Path `{PATH}` is required.",
"type": "required"
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"currency_id"
],
"options": {
"index": true,
"link": "Currency",
"required": true
},
"_index": true,
"isRequired": true,
"originalRequiredValue": true
}
{
"path": "date_created",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"date_created"
],
"options": {},
"_index": null
}
{
"path": "last_quota_date",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"last_quota_date"
],
"options": {
"index": true
},
"_index": true
}
{
"enumValues": [],
"regExp": null,
"path": "name",
"instance": "String",
"validators": [
{
"message": "Path `{PATH}` is required.",
"type": "required"
},
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
"type": "user defined",
"validator": {}
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"name"
],
"options": {
"required": true,
"validate": {},
"index": true
},
"_index": true,
"isRequired": true,
"originalRequiredValue": true
}
{
"path": "organisation_id",
"instance": "ObjectID",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"organisation_id"
],
"options": {
"index": true,
"link": "Organisation"
},
"_index": true
}
{
"path": "organisation_wide",
"instance": "Boolean",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"organisation_wide"
],
"options": {
"default": false
},
"_index": null,
"defaultValue": false
}
{
"path": "personal",
"instance": "Boolean",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"personal"
],
"options": {},
"_index": null
}
{
"path": "previous_balance",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"previous_balance"
],
"options": {
"default": 0
},
"_index": null,
"defaultValue": 0
}
{
"path": "priority",
"instance": "Number",
"validators": [
{
"message": "Path `{PATH}` is required.",
"type": "required"
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"priority"
],
"options": {
"required": true
},
"_index": null,
"isRequired": true,
"originalRequiredValue": true
}
{
"path": "quota_amount",
"instance": "Number",
"validators": [
{
"message": "Path `{PATH}` ({VALUE}) is less than minimum allowed value (0).",
"type": "min",
"min": 0
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"quota_amount"
],
"options": {
"default": 0,
"min": 0
},
"_index": null,
"defaultValue": 0
}
{
"enumValues": [],
"regExp": null,
"path": "quota_frequency",
"instance": "String",
"validators": [
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
"type": "user defined",
"validator": {}
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"quota_frequency"
],
"options": {
"validate": {},
"index": true,
"default": "never"
},
"_index": true,
"defaultValue": "never"
}
{
"enumValues": [],
"regExp": null,
"path": "quota_type",
"instance": "String",
"validators": [
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
"type": "user defined",
"validator": {}
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"quota_type"
],
"options": {
"validate": {},
"index": true,
"default": "free"
},
"_index": true,
"defaultValue": "free"
}
{
"path": "updatedAt",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"updatedAt"
],
"options": {},
"_index": null,
"$fullPath": "updatedAt"
}
{
"schemaOptions": {
"timestamps": true,
"toJSON": {
"virtuals": true
},
"toObject": {
"virtuals": true
},
"perms": {
"admin": "r",
"finance": "crud",
"setup": "crud",
"user": "r"
},
"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": "",
"user": "r",
"all": "",
"finance": "crud",
"setup": "crud"
},
"pluralization": true
},
"caster": {
"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,
"_arrayPath": "user_id.$",
"_arrayParentPath": "user_id"
},
"$embeddedSchemaType": {
"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,
"_arrayPath": "user_id.$",
"_arrayParentPath": "user_id"
},
"$isMongooseArray": true,
"path": "user_id",
"instance": "Array",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"user_id"
],
"options": {
"type": [
{
"index": true,
"link": "User",
"required": true
}
]
},
"_index": null
}