Model products
Permissions
| User Group | Create? | Read? | Update? | Delete? |
|---|
| setup | x | x | x | x |
| finance | x | x | x | x |
| admin | | x | | |
| all | | 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 | | |
| amortise_months | Number | | | | | | |
| available_in_locations_id | Array of ObjectID | | | [Function] | | | |
| createdAt | Date | | | | | | |
| date_created | Date | | | [Function] | | | |
| description | String | | | | | | |
| image | String | | | | | | |
| img | String | | | | | | |
| location_id | ObjectID | Location | | | | | x |
| markup | Number | | | | | | |
| member_discount | Number | | | 0 | | | |
| name | String | | | | | | |
| payment_options | Array of String | | | [Function] | | | |
| price | Number | | | | | | x |
| price_customisable | Boolean | | | false | | | |
| price_updated_date | Date | | | | | | |
| pro_rata | Boolean | | | false | x | | |
| producttype_id | ObjectID | producttype | | | | | |
| purchase_frequency | String | | | | x | | |
| purchase_price | Number | | | | | | |
| self_service | Boolean | | | false | x | | |
| sublocations | Array of String | | | [Function] | | | |
| supplier_name | String | | | | | | |
| supplier_sku | String | | | | | | |
| tax_rate | Number | | | | | | |
| third_party_emails | Array of String | | | [Function] | | | |
| topup_size | Number | | | | | | |
| updatedAt | Date | | | | | | |
| volume | Number | | | | | | |
| xero_account | String | | | | | | |
| xero_code | String | | | | x | | |
| xero_id | String | | | | | | |
| xero_tax_type | String | | | | | | |
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": []
}amortise_months
{
"path": "amortise_months",
"instance": "Number",
"options": {},
"validators": []
}available_in_locations_id
{
"path": "available_in_locations_id",
"instance": "Array",
"options": {
"type": [
{
"link": "Location",
"map_to": "available_in_locations",
"index": true
}
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "ObjectID"
}createdAt
{
"path": "createdAt",
"instance": "Date",
"options": {
"immutable": true
},
"validators": []
}date_created
{
"path": "date_created",
"instance": "Date",
"options": {},
"validators": [],
"defaultValue": "[Function]"
}description
{
"path": "description",
"instance": "String",
"options": {},
"validators": []
}image
{
"path": "image",
"instance": "String",
"options": {},
"validators": []
}img
{
"path": "img",
"instance": "String",
"options": {},
"validators": []
}location_id
{
"path": "location_id",
"instance": "ObjectID",
"options": {
"link": "Location",
"required": true
},
"validators": [
{
"message": "Path `{PATH}` is required."
}
],
"isRequired": true
}Validators
- : Path `{PATH}` is required.
markup
{
"path": "markup",
"instance": "Number",
"options": {},
"validators": []
}member_discount
{
"path": "member_discount",
"instance": "Number",
"options": {
"default": 0
},
"validators": [],
"defaultValue": 0
}name
{
"path": "name",
"instance": "String",
"options": {},
"validators": []
}payment_options
{
"path": "payment_options",
"instance": "Array",
"options": {
"type": [
{
"validate": {},
"required": true
}
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "String"
}price
{
"path": "price",
"instance": "Number",
"options": {
"required": true
},
"validators": [
{
"message": "Path `{PATH}` is required."
},
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`"
}
],
"isRequired": true
}Validators
- : Path `{PATH}` is required.
- : Validator failed for path `{PATH}` with value `{VALUE}`
price_customisable
{
"path": "price_customisable",
"instance": "Boolean",
"options": {
"default": false
},
"validators": [],
"defaultValue": false
}price_updated_date
{
"path": "price_updated_date",
"instance": "Date",
"options": {},
"validators": []
}pro_rata
{
"path": "pro_rata",
"instance": "Boolean",
"options": {
"default": false,
"index": true
},
"validators": [],
"defaultValue": false
}producttype_id
{
"path": "producttype_id",
"instance": "ObjectID",
"options": {
"link": "producttype"
},
"validators": []
}purchase_frequency
{
"path": "purchase_frequency",
"instance": "String",
"options": {
"validate": {},
"index": true
},
"validators": [
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`"
}
]
}Validators
- : Validator failed for path `{PATH}` with value `{VALUE}`
purchase_price
{
"path": "purchase_price",
"instance": "Number",
"options": {},
"validators": []
}self_service
{
"path": "self_service",
"instance": "Boolean",
"options": {
"default": false,
"index": true
},
"validators": [],
"defaultValue": false
}sublocations
{
"path": "sublocations",
"instance": "Array",
"options": {
"type": [
{}
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "String"
}supplier_name
{
"path": "supplier_name",
"instance": "String",
"options": {},
"validators": []
}supplier_sku
{
"path": "supplier_sku",
"instance": "String",
"options": {},
"validators": []
}tax_rate
{
"path": "tax_rate",
"instance": "Number",
"options": {},
"validators": []
}third_party_emails
{
"path": "third_party_emails",
"instance": "Array",
"options": {
"type": [
{
"validate": [
null,
"Please use a valid email address"
]
}
]
},
"validators": [],
"defaultValue": "[Function]",
"arrayType": "String"
}topup_size
{
"path": "topup_size",
"instance": "Number",
"options": {},
"validators": []
}updatedAt
{
"path": "updatedAt",
"instance": "Date",
"options": {},
"validators": []
}volume
{
"path": "volume",
"instance": "Number",
"options": {},
"validators": []
}xero_account
{
"path": "xero_account",
"instance": "String",
"options": {},
"validators": []
}xero_code
{
"path": "xero_code",
"instance": "String",
"options": {
"index": true
},
"validators": []
}xero_id
{
"path": "xero_id",
"instance": "String",
"options": {},
"validators": []
}xero_tax_type
{
"path": "xero_tax_type",
"instance": "String",
"options": {},
"validators": []
}