Skip to content

Commit

Permalink
Merge pull request #2 from jbeckert/offer-management
Browse files Browse the repository at this point in the history
Update models for usage of @id
  • Loading branch information
dmitry-shkolnik authored May 20, 2018
2 parents 487cba8 + 575f7df commit 5b04ae9
Show file tree
Hide file tree
Showing 19 changed files with 186 additions and 226 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://ns.adobe.com/experience/offer-management/capping-constraint",
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Capping Constraint",
"description": "Offer Capping Constraint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
"$id":
"https://ns.adobe.com/experience/offer-management/content/html-content",
"meta:extends": ["https://ns.adobe.com/experience/offer-management/representation-content"],
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Content",
"description": "Offer HTML Content",
"title": "HTML Content",
"description": "Image content used in an offer representation",
"definitions": {
"html-content": {
"type": "object",
"title": "HTML Content",
"description": "HTML content used in an offer representation",
"properties": {
"@type": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
"$id":
"https://ns.adobe.com/experience/offer-management/content/image-content",
"meta:extends": ["https://ns.adobe.com/experience/offer-management/representation-content"],
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Image Content",
"description": "Offer Image Content",
"description": "Image content used in an offer representation",
"definitions": {
"image-content": {
"type": "object",
"title": "Image",
"description": "Offer content as an image",
"title": "Image Content",
"description": "Image content used in an offer representation",
"properties": {
"@type": {
"type": "string",
Expand All @@ -31,7 +33,7 @@
"type": "string",
"format": "uri",
"title": "Image URL",
"description": "Image representing the offer"
"description": "Image representing the offer. Access to the image may be restricted and clients should not use this URL in to deliver the content publicly."
},
"xdm:imageName": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
"$id":
"https://ns.adobe.com/experience/offer-management/content/text-content",
"meta:extends": ["https://ns.adobe.com/experience/offer-management/representation-content"],
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Plain Text Content",
"description": "Offer Representation",
"description": "Plain text content used in an offer representation",
"definitions": {
"text-content": {
"type": "object",
"title": "Plain Text Content",
"description": "Plain text content used in an offer representation",
"properties": {
"@type": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"@id": "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",
"usedProperties" : [
{
"xdm:modelReference" : "https://ns.adobe.com/xdm/context/profile",
"xdm:modelPropertyPaths" : [
"xdm:homeAddress.xdm:stateProvince"
]
},
{
"xdm:modelReference" : "https://ns.adobe.com/xdm/context/experienceevent",
"xdm:modelPropertyPaths" : [
"xdm:commerce.xdm:order.xdm:priceTotal",
"xdm:commerce.xdm:order.xdm:currencyCode"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,41 @@
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://ns.adobe.com/experience/offer-management/eligibility-rule",
"meta:extensible": "true",
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Eligibility Rule",
"description": "Eligibility rule encapsulates a profile query",
"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.",
"definitions": {
"eligibility-rule": {
"properties": {
"@id": {
"type": "string",
"format": "uri",
"title": "ID",
"description": "The unique identifier of the filter"
"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 unquie 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."
},
"xdm:name": {
"type": "string",
"title": "Name",
"description": "Filter name"
"description": "EligibilityRule name that is used to locate this object in a search operation"
},
"xdm:value": {
"type": "string",
"title": "Expression",
"description": "Profile Query"
"title": "PQL Expression",
"description": "The string serialization of the predicate expression in pql/json format"
},
"xdm:usedProperties": {
"xdm:modelUsage": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"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.",
"type": "array",
"items": {
"$ref": "https://ns.adobe.com/experience/offer-management/model-usage"
}
}
},
"required": ["xdm:name", "xdm:value"]
"required": ["@id", "xdm:name", "xdm:value", "xdm:modelUsage"]
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,14 @@
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://ns.adobe.com/experience/offer-management/fallback-offer",
"meta:extends": ["https://ns.adobe.com/experience/offer-management/offer"],
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Fallback Offer",
"description":
"Fallback offer is a default offer used when there is no offers satisfying all constraints",
"description": "Fallback offer is a default offer used when there is no personalization offer left that satisfies all constraints",
"definitions": {
"fallback-offer": {
"type": "object",
"properties": {
"@id": {
"type": "string",
"format": "uri",
"title": "ID",
"description": "The unique identifier of the offer"
},
"xdm:name": {
"type": "string",
"title": "Name",
"description": "Offer name"
},
"xdm:status": {
"type": "string",
"title": "Status",
"description": "Offer Status",
"enum": [
"draft",
"pending",
"rejected",
"approved",
"inUse",
"archived"
],
"meta:enum": {
"draft": "Draft",
"pending": "Pending",
"rejected": "Rejected",
"approved": "Approved",
"inUse": "In Use",
"archived": "Archived"
}
},
"xdm:representations": {
"type": "array",
"items": {
"$ref":
"https://ns.adobe.com/experience/offer-management/offer-representation"
},
"title": "Representations",
"description": "Offer representations for different placements"
},
"xdm:customMetadata": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"title": "Custom Properties",
"description":
"Custom metadata allows end-users to attach properties to individual instances"
}
}
"type": "object"
}
},
"allOf": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"meta:license": [
"Copyright 2018 Adobe Systems Incorporated. All rights reserved.",
"This work is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license",
"you may not use this file except in compliance with the License. You may obtain a copy",
"of the License at https://creativecommons.org/licenses/by/4.0/"
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://ns.adobe.com/experience/offer-management/model-usage",
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Used XDM Models and Properties from those models",
"description": "A key-value pair whose key is reference to the model, i.e. its @id property. The value is an array of strings, each string representing a fully qualified path to an XDM field with dots used as the path delimiter.",
"definitions": {
"model-usage": {
"type": "object",
"title": "Model and Used Properties",
"description": "A key-value pair whose key is reference to the model, i.e. its @id property. The value is an array of strings, each string representing a fully qualified path to an XDM field with dots used as the path delimiter.",
"properties": {
"xdm:modelReference": {
"type": "string",
"format": "uri",
"description": "Reference to the model, i.e. its @id property. "
},
"xdm:modelPropertyPaths": {
"type": "array",
"items": {
"type": "string",
"description": "A fully qualified path to an XDM field with dots used as the path delimite "
}
}
},
"required": ["xdm:modelReference", "xdm:modelPropertyPaths"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://ns.adobe.com/experience/offer-management/offer-activity",
"meta:abstract": false,
"meta:extensible": true,
"type": "object",
"title": "Activity",
"description": "Offer Activity",
"description": "An Offer Activity is used to control the decisioning process. It specifies the filter criteria applied to the total inventory to narrow down by topic/category, the placement to narrow down the inventory to those offers that technically fit into the desired space for the offer and specifies a fall back option should the combined constraints disqualify all available personalization options (offers).",
"definitions": {
"offer-activity": {
"properties": {
"@id": {
"type": "string",
"format": "uri",
"title": "ID",
"description": "The unique identifier of the activity"
"description": "The unique identifier of the activity. This identifier is assigned by clients or services that use the repository and is not generated by the repository itself. This @id must be unquie within a repository container for objects that are not the same, otherwise it is interpreted as referring to the same object. "
},
"xdm:name": {
"type": "string",
Expand All @@ -28,10 +30,9 @@
"type": "string",
"title": "Status",
"description": "Activity Status",
"enum": ["draft", "pending", "live", "complete", "archived"],
"enum": ["draft", "live", "complete", "archived"],
"meta:enum": {
"draft": "Draft",
"pending": "Pending",
"live": "Live",
"complete": "Complete",
"archived": "Archived"
Expand All @@ -51,11 +52,24 @@
},
"xdm:placement": {
"type": "string",
"title": "Placement",
"description": "Placement to constrain the offers"
"format": "uri",
"title": "Offer Placement",
"description": "The reference to an offer placement used to restrict to certain offers when a decisioning is made the context of this activity. The value is the URI (@id) of the placement that is referenced."
},
"xdm:filter": {
"type": "string",
"format": "uri",
"title": "Offer Filter",
"description": "The reference to a filter that is applied to the inventory when a decisioning is made the context of this activity. The value is the URI (@id) of the filter that is referenced."
},
"xdm:fallback": {
"type": "string",
"format": "uri",
"title": "Fallback Offer",
"description": "The reference to a fallback offer that is used when decisioning in the context of this activity does not qualify any of the offers specified in the offer filter. The value is the URI (@id) of the tag that is referenced."
}
},
"required": ["xdm:name", "xdm:status"]
"required": ["@id", "xdm:name", "xdm:status"]
}
},
"allOf": [
Expand Down

This file was deleted.

Loading

0 comments on commit 5b04ae9

Please sign in to comment.