Model products


Permissions

User GroupCreate?Read?Update?Delete?
setupxxxx
financexxxx
adminx
allx

Fields

NameTypeLinkMaps ToDefaultIndexed?Unique?
__vNumber
_deletedBooleanfalsex
_idObjectIDfunction defaultId() { return new oid(); }
_owner_idObjectIDUser_ownerx
_updated_by_idObjectIDUser_updated_byx
amortise_monthsNumber
available_in_locations_idArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }
createdAtDate
date_createdDatefunction now() { [native code] }
descriptionString
imageString
imgString
location_idObjectIDLocation
markupNumber
member_discountNumber0
nameString
payment_optionsArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }
priceNumber
price_customisableBooleanfalse
price_updated_dateDate
pro_rataBooleanfalsex
producttype_idObjectIDproducttype
purchase_frequencyStringx
purchase_priceNumber
self_serviceBooleanfalsex
supplier_nameString
supplier_skuString
tax_rateNumber
third_party_emailsArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }
topup_sizeNumber
updatedAtDate
volumeNumber
xero_accountString
xero_codeStringx
xero_idString
xero_tax_typeString

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
}