Model ledgers
Permissions
| User Group | Create? | Read? | Update? | Delete? |
|---|
| super_user | x | x | x | x |
| line_manager | x | x | x | |
| api | x | x | x | |
| pos | x | x | | |
| owner | | x | x | x |
| admin | | x | | |
| user | x | x | | |
Fields
| Name | Type | Link | Maps To | Default | Indexed? | Unique? | Required? |
|---|
| __v | Number | | | | | | |
| _deleted | Boolean | | | false | x | | |
| _id | ObjectID | | | [Function] | | | |
| _owner_id | ObjectID | User | _owner | | x | | |
| _updated_by_id | ObjectID | User | _updated_by | | x | | |
| amount | Number | | | | | | x |
| balance | Number | | | | | | |
| createdAt | Date | | | | | | |
| cred_type | String | | | | x | | |
| currency_id | ObjectID | Currency | | | x | | |
| date | Date | | | [Function] | x | | x |
| description | String | | | | | | |
| details | Mixed | | | | | | |
| email | String | | | | | | |
| invoice_id | ObjectID | Invoice | | | x | | |
| is_transfer | Boolean | | | false | | | |
| location_id | ObjectID | Location | | | x | | |
| organisation_id | ObjectID | Organisation | | | x | | |
| partner_id | ObjectID | Partner | | | x | | |
| partner_reference | Mixed | | | | | x | |
| product_id | Array of ObjectID | | | [Function] | | | |
| receipt | String | | | | | | |
| reserve | Boolean | | | false | | | |
| reserve_expires | Date | | | [Function] | | | |
| source_id | ObjectID | | | | | | |
| source_type | String | | | | | | |
| transaction_type | String | | | | | | |
| updatedAt | Date | | | | | | |
| user_id | ObjectID | User | | | x | | x |
| wallet_id | Array of ObjectID | | | [Function] | | | |
| wallet_split | Array of Mixed | | | [Function] | | | |
Field Details
__v
{
"path": "__v",
"instance": "Number",
"options": {},
"validators": []
}_deleted
{
"path": "_deleted",
"instance": "Boolean",
"options": {
"default": false,
"index": true
},
"validators": [],
"defaultValue": false
}_id
{
"path": "_id",
"instance": "ObjectID",
"options": {
"auto": true,
"type": "ObjectId"
},
"validators": [],
"defaultValue": "[Function]"
}_owner_id
{
"path": "_owner_id",
"instance": "ObjectID",
"options": {
"link": "User",
"map_to": "_owner",
"index": true
},
"validators": []
}_updated_by_id
{
"path": "_updated_by_id",
"instance": "ObjectID",
"options": {
"link": "User",
"map_to": "_updated_by",
"index": true
},
"validators": []
}amount
{
"path": "amount",
"instance": "Number",
"options": {
"required": true
},
"validators": [
{
"message": "Path `{PATH}` is required."
}
],
"isRequired": true
}Validators
- : Path `{PATH}` is required.
balance
{
"path": "balance",
"instance": "Number",
"options": {},
"validators": []
}createdAt
{
"path": "createdAt",
"instance": "Date",
"options": {
"immutable": true
},
"validators": []
}cred_type
{
"path": "cred_type",
"instance": "String",
"options": {
"index": true
},
"validators": []
}currency_id
{
"path": "currency_id",
"instance": "ObjectID",
"options": {
"index": true,
"link": "Currency"
},
"validators": []
}date
{
"path": "date",
"instance": "Date",
"options": {
"required": true,
"index": true
},
"validators": [
{
"message": "Path `{PATH}` is required."
}
],
"isRequired": true,
"defaultValue": "[Function]"
}Validators
- : Path `{PATH}` is required.
description
{
"path": "description",
"instance": "String",
"options": {},
"validators": []
}details
{
"path": "details",
"instance": "Mixed",
"options": {},
"validators": []
}email
{
"path": "email",
"instance": "String",
"options": {},
"validators": []
}invoice_id
{
"path": "invoice_id",
"instance": "ObjectID",
"options": {
"index": true,
"link": "Invoice"
},
"validators": []
}is_transfer
{
"path": "is_transfer",
"instance": "Boolean",
"options": {
"default": false
},
"validators": [],
"defaultValue": false
}location_id
{
"path": "location_id",
"instance": "ObjectID",
"options": {
"link": "Location",
"index": true
},
"validators": []
}organisation_id
{
"path": "organisation_id",
"instance": "ObjectID",
"options": {
"index": true,
"link": "Organisation"
},
"validators": []
}partner_id
{
"path": "partner_id",
"instance": "ObjectID",
"options": {
"index": true,
"link": "Partner"
},
"validators": []
}partner_reference
{
"path": "partner_reference",
"instance": "Mixed",
"options": {
"unique": true,
"sparse": true
},
"validators": []
}product_id
{
"path": "product_id",
"instance": "Array",
"options": {
"type": [
{
"index": true,
"link": "Product"
}
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "ObjectID"
}receipt
{
"path": "receipt",
"instance": "String",
"options": {},
"validators": []
}reserve
{
"path": "reserve",
"instance": "Boolean",
"options": {
"default": false
},
"validators": [],
"defaultValue": false
}reserve_expires
{
"path": "reserve_expires",
"instance": "Date",
"options": {},
"validators": [],
"defaultValue": "[Function]"
}source_id
{
"path": "source_id",
"instance": "ObjectID",
"options": {},
"validators": []
}source_type
{
"path": "source_type",
"instance": "String",
"options": {},
"validators": []
}transaction_type
{
"path": "transaction_type",
"instance": "String",
"options": {
"validate": {}
},
"validators": [
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`"
}
]
}Validators
- : Validator failed for path `{PATH}` with value `{VALUE}`
updatedAt
{
"path": "updatedAt",
"instance": "Date",
"options": {},
"validators": []
}user_id
{
"path": "user_id",
"instance": "ObjectID",
"options": {
"index": true,
"link": "User",
"required": true
},
"validators": [
{
"message": "Path `{PATH}` is required."
}
],
"isRequired": true
}Validators
- : Path `{PATH}` is required.
wallet_id
{
"path": "wallet_id",
"instance": "Array",
"options": {
"type": [
{
"index": true,
"link": "Wallet"
}
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "ObjectID"
}wallet_split
{
"path": "wallet_split",
"instance": "Array",
"options": {
"type": [
null
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "Mixed"
}