Skip to content

Commit

Permalink
Merge pull request #533 from jbeckert/master
Browse files Browse the repository at this point in the history
Update to offer management schema
  • Loading branch information
kstreeter authored Oct 30, 2018
2 parents b0f0fda + 9736017 commit 14940af
Show file tree
Hide file tree
Showing 24 changed files with 443 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "object",
"title": "Capping Constraint",
"description":
"Offer Capping Constraint is a component in a Personalization Offer that defines the parameters for capping. Capping is the process of limiting how many times an offer can be proposed, for an individual profile as well as across all profiles.",
"A capping constraint is a component in a personalized offer that defines the parameters for capping. Capping is the process of limiting how many times an offer can be proposed, for an individual profile as well as across all profiles.",
"definitions": {
"capping-constraint": {
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,168 @@
{
"@id": "https://www.example.com/offers/eligibility-rule/rule-0001",
"xdm:name": "Californians with two or more purchases of more than $1000",
"xdm:value":
"profile.xdm:homeAddress.xdm:stateOrProvince = \"CA\" AND (SELECT X FROM xEvent WHERE X.xdm:commerce.xdm:order.xdm:priceTotal > 1000 AND X.xdm:commerce.xdm:order.xdm:currencyCode = \"USD\").count() > 1",
"xdm:name": "Californians with one or more purchases of more than $1000",
"xdm:valueAsText":
"homeAddress.stateOrProvince = \"CA\" AND (some x FROM xEvent WHERE commerce.order.priceTotal > 1000 AND x.commerce.order.currencyCode = \"USD\")",
"xdm:value": {
"nodeType": "fnApply",
"fnName": "and",
"params": [
{
"nodeType": "fnApply",
"fnName": "=",
"params": [
{
"nodeType": "fieldLookup",
"fieldName": "xdm:stateOrProvince",
"object": {
"nodeType": "fieldLookup",
"fieldName": "xdm:homeAddress",
"object": {
"nodeType": "literal",
"literalType": "XDMObject",
"value": "profile"
}
}
},
{
"literalType": "String",
"nodeType": "literal",
"value": "CA"
}
]
},
{
"nodeType": "quantification",
"quantifier": "some",
"variables": [
{
"nodeType": "varDecl",
"varName": "x",
"from": {
"nodeType": "fnApply",
"fnName": "modelInstances",
"params": [
{
"nodeType": "literal",
"literalType": "String",
"value": "https://ns.adobe.com/xdm/context/experienceevent"
}
]
},
"where": {
"nodeType": "fnApply",
"fnName": "and",
"params": [
{
"nodeType": "quantification",
"quantifier": "some",
"variables": [
{
"nodeType": "varDecl",
"varName": "id",
"from": {
"nodeType": "fieldLookup",
"fieldName": "xdm:endUserIDs",
"object": {
"nodeType": "varRef",
"varName": "x"
}
},
"where": {
"nodeType": "fnApply",
"fnName": "in",
"params": [
{
"nodeType": "varRef",
"varName": "id"
},
{
"nodeType": "fieldLookup",
"fieldName": "xdm:identities",
"object": {
"nodeType": "literal",
"literalType": "XDMObject",
"value": "profile"
}
}
]
}
}
]
},
{
"nodeType": "fnApply",
"fnName": ">",
"params": [
{
"nodeType": "fieldLookup",
"fieldName": "xdm:priceTotal",
"object": {
"nodeType": "fieldLookup",
"fieldName": "xdm:order",
"object": {
"nodeType": "fieldLookup",
"fieldName": "xdm:commerce",
"object": {
"nodeType": "varRef",
"varName": "x"
}
}
}
},
{
"nodeType": "literal",
"literalType": "Integer",
"value": 1000
}
]
},
{
"nodeType": "fnApply",
"fnName": "=",
"params": [
{
"nodeType": "fieldLookup",
"fieldName": "xdm:currencyCode",
"object": {
"nodeType": "fieldLookup",
"fieldName": "xdm:order",
"object": {
"nodeType": "fieldLookup",
"fieldName": "xdm:commerce",
"object": {
"nodeType": "varRef",
"varName": "x"
}
}
}
},
{
"nodeType": "literal",
"literalType": "String",
"value": "USD"
}
]
}
]
}
}
]
}
]
},
"xdm:modelUsage": [
{
"xdm:model": "https://ns.adobe.com/xdm/context/profile",
"xdm:modelPropertyPaths": ["xdm:homeAddress.xdm:stateProvince"]
"xdm:modelReference": "https://ns.adobe.com/xdm/context/profile",
"xdm:modelPropertyPaths": [
"xdm:identities",
"xdm:homeAddress.xdm:stateProvince"
]
},
{
"xdm:model": "https://ns.adobe.com/xdm/context/experienceevent",
"xdm:modelReference": "https://ns.adobe.com/xdm/context/experienceevent",
"xdm:modelPropertyPaths": [
"xdm:endUserIDs",
"xdm:commerce.xdm:order.xdm:priceTotal",
"xdm:commerce.xdm:order.xdm:currencyCode"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "object",
"title": "Eligibility Rule",
"description":
"An EligibilityRule is a named reusable predicate used in the domain of audience segmentation and message personalization. The Profile Query Language forms the foundation of those predicates. The prodicate operates not only over profile fields but also over contextual data objects provided at the time of decisioning.",
"An eligibility rule is a named reusable predicate used in the domain of audience segmentation and message personalization. The Profile Query Language forms the foundation of those predicates. The predicate operates not only over profile fields but also over contextual data objects provided at the time of decisioning.",
"definitions": {
"eligibility-rule": {
"properties": {
Expand All @@ -21,39 +21,46 @@
"format": "uri-reference",
"title": "ID",
"description":
"The unique identifier of the EligibilityRule. This identifier is assigned by clients or services that use the repository and is not generated by the repository itself. This @id must be unique within a repository container for objects that are not the same, otherwise it is interpreted as referring to the same object. The @id is used in link relationships. For example an Offer's selection constraint object references an EligibilityRule object."
"The unique identifier of the eligibility rule. This identifier is assigned by clients or services that use the repository and is not generated by the repository itself. This @id must be unique within a repository container for objects that are not the same, otherwise it is interpreted as referring to the same object. The @id is used in link relationships. For example an offer's selection constraint object references an eligibility rule object."
},
"xdm:name": {
"type": "string",
"title": "Name",
"description":
"EligibilityRule name that is used to locate this object in a search operation"
"Eligibility rule name that is used to locate this object in a search operation"
},
"xdm:valueAsText": {
"type": "string",
"title": "Expression over XDM instances in an alternate query syntax",
"description":
"Contains the expression over a collection of context XDM instances as a serialized string."
},
"xdm:value": {
"type": "object",
"$ref":
"https://ns.adobe.com/experience/offer-management/filter-expression",
"title": "Expression over XDM instances",
"description":
"Contains the expression over a collection of context XDM instances. When the expression evaluates to true the offer refering to this eligibility rule will be included in the decisioning otherwise included. Central context instances include the profile and the experience events associtaed with the profile.",
"$ref":
"https://ns.adobe.com/experience/offer-management/filter-expression"
"Contains the expression tree over a collection of context XDM instances. When the expression evaluates to true the offer refering to this eligibility rule will be included in the decisioning otherwise included. Central context instances include the profile and the experience events associtaed with the profile."
},
"xdm:modelUsage": {
"title": "Used Properties",
"description":
"An list of Model Usage objects, one per model, that lists the fully qualified path to every used property from the model.",
"A list of \"model usage\" objects, one per model, that lists the fully qualified path to every used property from the model.",
"type": "array",
"items": {
"$ref":
"https://ns.adobe.com/experience/offer-management/model-usage"
}
}
},
"required": ["xdm:name", "xdm:value", "xdm:modelUsage"]
}
}
},
"allOf": [
{
"$ref": "#/definitions/eligibility-rule"
},
{
"required": ["xdm:name", "xdm:value", "xdm:modelUsage"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
"Fallback offer is a default offer used when there is no personalization offer left that satisfies all constraints",
"definitions": {
"fallback-offer": {
"type": "object"
"allOf": [
{
"$ref":
"https://ns.adobe.com/experience/offer-management/offer#/definitions/offer"
}
]
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
}
]
}
}
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
]
},
"where": {
"nodeType": "fnApply",
"fnName": "and",
"params": [
{
Expand All @@ -99,7 +100,7 @@
"object": {
"nodeType": "varRef",
"varName": "x"
},
}
},
"where": {
"nodeType": "fnApply",
Expand All @@ -108,14 +109,14 @@
{
"nodeType": "varRef",
"varName": "id"
}
},
{
"nodeType": "fieldLookup",
"fieldName": "xdm:identities",
"object": {
"nodeType": "varRef",
"varName": "p"
},
}
}
]
}
Expand Down
Loading

0 comments on commit 14940af

Please sign in to comment.