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? |
---|
__v | Number | | | | | |
_deleted | Boolean | | | false | x | |
_id | ObjectID | | | function defaultId() {
return new oid();
} | | |
_owner_id | ObjectID | User | _owner | | x | |
_updated_by_id | ObjectID | User | _updated_by | | x | |
amortise_months | Number | | | | | |
available_in_locations_id | Array | | | function() {
// Leave it up to `cast()` to convert the array
return fn
? defaultArr.call(this)
: defaultArr != null
? [].concat(defaultArr)
: [];
} | | |
createdAt | Date | | | | | |
date_created | Date | | | function now() { [native code] } | | |
description | String | | | | | |
image | String | | | | | |
img | String | | | | | |
location_id | ObjectID | Location | | | | |
markup | Number | | | | | |
member_discount | Number | | | 0 | | |
name | String | | | | | |
payment_options | Array | | | function() {
// Leave it up to `cast()` to convert the array
return fn
? defaultArr.call(this)
: defaultArr != null
? [].concat(defaultArr)
: [];
} | | |
price | Number | | | | | |
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 | |
supplier_name | String | | | | | |
supplier_sku | String | | | | | |
tax_rate | Number | | | | | |
third_party_emails | Array | | | function() {
// Leave it up to `cast()` to convert the array
return fn
? defaultArr.call(this)
: defaultArr != null
? [].concat(defaultArr)
: [];
} | | |
topup_size | Number | | | | | |
updatedAt | Date | | | | | |
volume | Number | | | | | |
xero_account | String | | | | | |
xero_code | String | | | | x | |
xero_id | String | | | | | |
xero_tax_type | String | | | | | |
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": "amortise_months",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"amortise_months"
],
"options": {},
"_index": null
}
{
"schemaOptions": {
"timestamps": true,
"toJSON": {
"virtuals": true
},
"toObject": {
"virtuals": true
},
"perms": {
"setup": "crud",
"finance": "crud",
"admin": "r",
"all": "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": "",
"all": "r",
"setup": "crud",
"finance": "crud"
},
"pluralization": true
},
"caster": {
"path": "available_in_locations_id",
"instance": "ObjectID",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"available_in_locations_id"
],
"options": {
"link": "Location",
"map_to": "available_in_locations",
"index": true
},
"_index": true,
"_arrayPath": "available_in_locations_id.$",
"_arrayParentPath": "available_in_locations_id"
},
"$embeddedSchemaType": {
"path": "available_in_locations_id",
"instance": "ObjectID",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"available_in_locations_id"
],
"options": {
"link": "Location",
"map_to": "available_in_locations",
"index": true
},
"_index": true,
"_arrayPath": "available_in_locations_id.$",
"_arrayParentPath": "available_in_locations_id"
},
"$isMongooseArray": true,
"path": "available_in_locations_id",
"instance": "Array",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"available_in_locations_id"
],
"options": {
"type": [
{
"link": "Location",
"map_to": "available_in_locations",
"index": true
}
]
},
"_index": null
}
{
"path": "createdAt",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [
null,
null
],
"_presplitPath": [
"createdAt"
],
"options": {
"immutable": true
},
"_index": null,
"$immutable": true
}
{
"path": "date_created",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"date_created"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "description",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"description"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "image",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"image"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "img",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"img"
],
"options": {},
"_index": null
}
{
"path": "location_id",
"instance": "ObjectID",
"validators": [
{
"message": "Path `{PATH}` is required.",
"type": "required"
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"location_id"
],
"options": {
"link": "Location",
"required": true
},
"_index": null,
"isRequired": true,
"originalRequiredValue": true
}
{
"path": "markup",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"markup"
],
"options": {},
"_index": null
}
{
"path": "member_discount",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"member_discount"
],
"options": {
"default": 0
},
"_index": null,
"defaultValue": 0
}
{
"enumValues": [],
"regExp": null,
"path": "name",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"name"
],
"options": {},
"_index": null
}
{
"schemaOptions": {
"timestamps": true,
"toJSON": {
"virtuals": true
},
"toObject": {
"virtuals": true
},
"perms": {
"setup": "crud",
"finance": "crud",
"admin": "r",
"all": "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": "",
"all": "r",
"setup": "crud",
"finance": "crud"
},
"pluralization": true
},
"caster": {
"enumValues": [],
"regExp": null,
"path": "payment_options",
"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": [
"payment_options"
],
"options": {
"validate": {},
"required": true
},
"_index": null,
"isRequired": true,
"originalRequiredValue": true,
"_arrayPath": "payment_options.$",
"_arrayParentPath": "payment_options"
},
"$embeddedSchemaType": {
"enumValues": [],
"regExp": null,
"path": "payment_options",
"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": [
"payment_options"
],
"options": {
"validate": {},
"required": true
},
"_index": null,
"isRequired": true,
"originalRequiredValue": true,
"_arrayPath": "payment_options.$",
"_arrayParentPath": "payment_options"
},
"$isMongooseArray": true,
"path": "payment_options",
"instance": "Array",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"payment_options"
],
"options": {
"type": [
{
"validate": {},
"required": true
}
]
},
"_index": null
}
{
"path": "price",
"instance": "Number",
"validators": [
{
"message": "Path `{PATH}` is required.",
"type": "required"
},
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
"type": "user defined"
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"price"
],
"options": {
"required": true
},
"_index": null,
"isRequired": true,
"originalRequiredValue": true
}
{
"path": "price_customisable",
"instance": "Boolean",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"price_customisable"
],
"options": {
"default": false
},
"_index": null,
"defaultValue": false
}
{
"path": "price_updated_date",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"price_updated_date"
],
"options": {},
"_index": null
}
{
"path": "pro_rata",
"instance": "Boolean",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"pro_rata"
],
"options": {
"default": false,
"index": true
},
"_index": true,
"defaultValue": false
}
{
"path": "producttype_id",
"instance": "ObjectID",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"producttype_id"
],
"options": {
"link": "producttype"
},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "purchase_frequency",
"instance": "String",
"validators": [
{
"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
"type": "user defined",
"validator": {}
}
],
"getters": [],
"setters": [],
"_presplitPath": [
"purchase_frequency"
],
"options": {
"validate": {},
"index": true
},
"_index": true
}
{
"path": "purchase_price",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"purchase_price"
],
"options": {},
"_index": null
}
{
"path": "self_service",
"instance": "Boolean",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"self_service"
],
"options": {
"default": false,
"index": true
},
"_index": true,
"defaultValue": false
}
{
"enumValues": [],
"regExp": null,
"path": "supplier_name",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"supplier_name"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "supplier_sku",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"supplier_sku"
],
"options": {},
"_index": null
}
{
"path": "tax_rate",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"tax_rate"
],
"options": {},
"_index": null
}
{
"schemaOptions": {
"timestamps": true,
"toJSON": {
"virtuals": true
},
"toObject": {
"virtuals": true
},
"perms": {
"setup": "crud",
"finance": "crud",
"admin": "r",
"all": "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": "",
"all": "r",
"setup": "crud",
"finance": "crud"
},
"pluralization": true
},
"caster": {
"enumValues": [],
"regExp": null,
"path": "third_party_emails",
"instance": "String",
"validators": [
{
"message": "Please use a valid email address",
"type": "user defined"
}
],
"getters": [],
"setters": [
null
],
"_presplitPath": [
"third_party_emails"
],
"options": {
"validate": [
null,
"Please use a valid email address"
]
},
"_index": null,
"_arrayPath": "third_party_emails.$",
"_arrayParentPath": "third_party_emails"
},
"$embeddedSchemaType": {
"enumValues": [],
"regExp": null,
"path": "third_party_emails",
"instance": "String",
"validators": [
{
"message": "Please use a valid email address",
"type": "user defined"
}
],
"getters": [],
"setters": [
null
],
"_presplitPath": [
"third_party_emails"
],
"options": {
"validate": [
null,
"Please use a valid email address"
]
},
"_index": null,
"_arrayPath": "third_party_emails.$",
"_arrayParentPath": "third_party_emails"
},
"$isMongooseArray": true,
"path": "third_party_emails",
"instance": "Array",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"third_party_emails"
],
"options": {
"type": [
{
"validate": [
null,
"Please use a valid email address"
]
}
]
},
"_index": null
}
{
"path": "topup_size",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"topup_size"
],
"options": {},
"_index": null
}
{
"path": "updatedAt",
"instance": "Date",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"updatedAt"
],
"options": {},
"_index": null
}
{
"path": "volume",
"instance": "Number",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"volume"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "xero_account",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"xero_account"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "xero_code",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"xero_code"
],
"options": {
"index": true
},
"_index": true
}
{
"enumValues": [],
"regExp": null,
"path": "xero_id",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"xero_id"
],
"options": {},
"_index": null
}
{
"enumValues": [],
"regExp": null,
"path": "xero_tax_type",
"instance": "String",
"validators": [],
"getters": [],
"setters": [],
"_presplitPath": [
"xero_tax_type"
],
"options": {},
"_index": null
}