Model discounts


Permissions

User GroupCreate?Read?Update?Delete?
financexxxx
line_managerxxxx
adminx

Fields

NameTypeLinkMaps ToDefaultIndexed?Unique?
__vNumber
_deletedBooleanfalsex
_idObjectIDfunction defaultId() { return new oid(); }
_owner_idObjectIDUser_ownerx
_updated_by_idObjectIDUser_updated_byx
apply_toArrayfunction() { // Leave it up to `cast()` to convert the array return fn ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; }
commentString
createdAtDate
date_createdDatefunction now() { [native code] }
date_endDatex
date_startDatefunction now() { [native code] }x
descriptionString
discountNumber0
license_idObjectIDLicense
lineitem_idObjectIDLineItem
organisation_idObjectIDOrganisationx
producttype_idObjectIDProductTypex
updatedAtDate

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
}
{
	"schemaOptions": {
		"timestamps": true,
		"toJSON": {
			"virtuals": true
		},
		"toObject": {
			"virtuals": true
		},
		"perms": {
			"finance": "crud",
			"line_manager": "crud",
			"admin": "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": "",
			"finance": "crud",
			"line_manager": "crud"
		},
		"pluralization": true
	},
	"caster": {
		"enumValues": [],
		"regExp": null,
		"path": "apply_to",
		"instance": "String",
		"validators": [
			{
				"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
				"type": "user defined",
				"validator": {}
			}
		],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"apply_to"
		],
		"options": {
			"validate": {}
		},
		"_index": null,
		"_arrayPath": "apply_to.$",
		"_arrayParentPath": "apply_to"
	},
	"$embeddedSchemaType": {
		"enumValues": [],
		"regExp": null,
		"path": "apply_to",
		"instance": "String",
		"validators": [
			{
				"message": "Validator failed for path `{PATH}` with value `{VALUE}`",
				"type": "user defined",
				"validator": {}
			}
		],
		"getters": [],
		"setters": [],
		"_presplitPath": [
			"apply_to"
		],
		"options": {
			"validate": {}
		},
		"_index": null,
		"_arrayPath": "apply_to.$",
		"_arrayParentPath": "apply_to"
	},
	"$isMongooseArray": true,
	"path": "apply_to",
	"instance": "Array",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"apply_to"
	],
	"options": {
		"type": [
			{
				"validate": {}
			}
		]
	},
	"_index": null
}
{
	"enumValues": [],
	"regExp": null,
	"path": "comment",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"comment"
	],
	"options": {},
	"_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
}
{
	"path": "date_end",
	"instance": "Date",
	"validators": [
		{
			"message": "Path `{PATH}` ({VALUE}) is after maximum allowed value (9999-12-31).",
			"type": "max",
			"max": "9999-12-31"
		},
		{
			"message": "Path `{PATH}` ({VALUE}) is before minimum allowed value (1800-01-01).",
			"type": "min",
			"min": "1800-01-01"
		}
	],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"date_end"
	],
	"options": {
		"max": "9999-12-31",
		"min": "1800-01-01",
		"index": true
	},
	"_index": true
}
{
	"path": "date_start",
	"instance": "Date",
	"validators": [
		{
			"message": "Path `{PATH}` ({VALUE}) is after maximum allowed value (9999-12-31).",
			"type": "max",
			"max": "9999-12-31"
		},
		{
			"message": "Path `{PATH}` ({VALUE}) is before minimum allowed value (1800-01-01).",
			"type": "min",
			"min": "1800-01-01"
		}
	],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"date_start"
	],
	"options": {
		"max": "9999-12-31",
		"min": "1800-01-01",
		"index": true
	},
	"_index": true
}
{
	"enumValues": [],
	"regExp": null,
	"path": "description",
	"instance": "String",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"description"
	],
	"options": {},
	"_index": null
}
{
	"path": "discount",
	"instance": "Number",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"discount"
	],
	"options": {
		"default": 0
	},
	"_index": null,
	"defaultValue": 0
}
{
	"path": "license_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"license_id"
	],
	"options": {
		"link": "License"
	},
	"_index": null
}
{
	"path": "lineitem_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"lineitem_id"
	],
	"options": {
		"link": "LineItem"
	},
	"_index": null
}
{
	"path": "organisation_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"organisation_id"
	],
	"options": {
		"link": "Organisation",
		"index": true
	},
	"_index": true
}
{
	"path": "producttype_id",
	"instance": "ObjectID",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"producttype_id"
	],
	"options": {
		"link": "ProductType",
		"default": null,
		"index": true
	},
	"_index": true,
	"defaultValue": null
}
{
	"path": "updatedAt",
	"instance": "Date",
	"validators": [],
	"getters": [],
	"setters": [],
	"_presplitPath": [
		"updatedAt"
	],
	"options": {},
	"_index": null
}