Advertisement
Guest User

Untitled

a guest
May 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5.  
  6. namespace Sitecore.Feature.ExternalProfiling.Models
  7. {
  8. using System.Web.Mvc;
  9. using Newtonsoft.Json;
  10. using Sitecore.Feature.ExternalProfiling.Engine.Actions;
  11.  
  12. public class RulesLogicModel
  13. {
  14. public Rule rule { get; set; }
  15. }
  16.  
  17. public class Rule
  18. {
  19. [JsonIgnore]
  20. public string Description { get; set; } // Manual for now, will be auto generated later.
  21. public Trigger[] triggers { get; set; }
  22. public Condition[] conditions { get; set; }
  23. public Action[] actions { get; set; }
  24. }
  25.  
  26. public class Trigger
  27. {
  28. public string triggerType { get; set; } // For now always 'PropertyChanged'
  29. public string facetType { get; set; } // 'GolfFacet' or 'DemographicFacet'
  30. public string facetProperty { get; set; } // 'Handicap', 'DateOfBirth'
  31. }
  32.  
  33. public class Condition
  34. {
  35. public Statement statementPre { get; set; }
  36. public Operation operation { get; set; }
  37. public Statement statementPost { get; set; }
  38. }
  39.  
  40. public class Statement
  41. {
  42. [JsonIgnore]
  43. public List<SelectListItem> PropTypeValues { get; internal set; }
  44.  
  45. public string statementType { get; set; } //'constant' or 'property'
  46. public string propertyOrigin { get; set; } // 'int', 'string' or 'GolfFacet'
  47. public string propertyValue { get; set; } // '5', 'Clara', or 'Handicap'
  48. }
  49.  
  50. public class Operation
  51. {
  52. public string stateType { get; set; } // 'GreaterThan', 'LesserThan' or 'Equals'
  53. }
  54.  
  55. public class Action
  56. {
  57. public string actionType { get; set; } // For now always 'ProfileCard'
  58. public string operationType { get; set; } // 'Increment' or 'Decrement'
  59. public string itemName { get; set; } // 'Expert Golfer'
  60. public string amount { get; set; } // '5'
  61. }
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement